From 6fd9af13a8614a4b95e8be1518e745915ef8bb56 Mon Sep 17 00:00:00 2001 From: Bob Jamison Date: Wed, 12 Apr 2006 13:25:21 +0000 Subject: Add new rearranged /dom directory (bzr r479) --- src/dom/prop-css2.cpp | 1304 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1304 insertions(+) create mode 100644 src/dom/prop-css2.cpp (limited to 'src/dom/prop-css2.cpp') diff --git a/src/dom/prop-css2.cpp b/src/dom/prop-css2.cpp new file mode 100644 index 000000000..4f89327b1 --- /dev/null +++ b/src/dom/prop-css2.cpp @@ -0,0 +1,1304 @@ +/** + * Phoebe DOM Implementation. + * + * This is a C++ approximation of the W3C DOM model, which follows + * fairly closely the specifications in the various .idl files, copies of + * which are provided for reference. Most important is this one: + * + * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html + * + * Authors: + * Bob Jamison + * + * Copyright (C) 2005 Bob Jamison + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include +#include + +typedef struct CssProp_def CssProp; + +typedef bool (*parsefunc)(CssProp *prop, char *propName, char *propVal); + + +struct CssProp_def +{ + parsefunc func; + char *name; + char *values; + char *defaultValue; + char *appliesTo; + bool inherited; + char *percentages; + char *mediaGroups; +}; + + +bool parseDefault(CssProp *prop, char *propName, char *propVal) +{ + printf("######## '%s:%s'\n", propName, propVal); + return true; +} + + + +static CssProp cssProps[] = +{ + +{ +parseDefault, +"azimuth", +" | [[ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards | inherit", +"center", +"", +true, +"", +"aural" +}, + + +{ +parseDefault, +"background-attachment", +"scroll | fixed | inherit", +"scroll", +"", +false, +"", +"visual" +}, + + +{ +parseDefault, +"background-color", +" | transparent | inherit", +"transparent", +"", +false, +"", +"visual" +}, + + +{ +parseDefault, +"background-image", +" | none | inherit", +"none", +"", +false, +"", +"visual" +}, + + +{ +parseDefault, +"background-position", +"[ [ | | left | center | right ] [ | | top | center | bottom ]? ] | [ [ left | center | right ] || [ top | center | bottom ] ] | inherit", +"0% 0%", +"", +false, +"refer to the size of the box itself", +"visual" +}, + + +{ +parseDefault, +"background-repeat", +"repeat | repeat-x | repeat-y | no-repeat | inherit", +"repeat", +"", +false, +"", +"visual" +}, + + +{ +parseDefault, +"background", +"['background-color' || 'background-image' || 'background-repeat' || 'background-attachment' || 'background-position'] | inherit", +"see individual properties", +"", +false, +"allowed on 'background-position", +"visual" +}, + + +{ +parseDefault, +"border-collapse", +"collapse | separate | inherit", +"separate", +"table' and 'inline-table' elements", +true, +"", +"visual" +}, + + +{ +parseDefault, +"border-color", +"[ | transparent ]{1,4} | inherit", +"see individual properties", +"", +false, +"", +"visual" +}, + + +{ +parseDefault, +"border-spacing", +" ? | inherit", +"0", +"table' and 'inline-table' elements", +true, +"", +"visual" +}, + + +{ +parseDefault, +"border-style", +"{1,4} | inherit", +"see individual properties", +"", +false, +"", +"visual" +}, + + +{ +parseDefault, +"border-top' 'border-right' 'border-bottom' 'border-left", +"[ || || 'border-top-color' ] | inherit", +"see individual properties", +"", +false, +"", +"visual" +}, + + +{ +parseDefault, +"border-top-color' 'border-right-color' 'border-bottom-color' 'border-left-color", +" | transparent | inherit", +"the value of the 'color' property", +"", +false, +"", +"visual" +}, + + +{ +parseDefault, +"border-top-style' 'border-right-style' 'border-bottom-style' 'border-left-style", +" | inherit", +"none", +"", +false, +"", +"visual" +}, + + +{ +parseDefault, +"border-top-width' 'border-right-width' 'border-bottom-width' 'border-left-width", +" | inherit", +"medium", +"", +false, +"", +"visual" +}, + + +{ +parseDefault, +"border-width", +"{1,4} | inherit", +"see individual properties", +"", +false, +"", +"visual" +}, + + +{ +parseDefault, +"border", +"[ || || 'border-top-color' ] | inherit", +"see individual properties", +"", +false, +"", +"visual" +}, + + +{ +parseDefault, +"bottom", +" | | auto | inherit", +"auto", +"positioned elements", +false, +"refer to height of containing block", +"visual" +}, + + +{ +parseDefault, +"caption-side", +"top | bottom | inherit", +"top", +"table-caption' elements", +true, +"", +"visual" +}, + + +{ +parseDefault, +"clear", +"none | left | right | both | inherit", +"none", +"block-level elements", +false, +"", +"visual" +}, + + +{ +parseDefault, +"clip", +" | auto | inherit", +"auto", +"absolutely positioned elements", +false, +"", +"visual" +}, + + +{ +parseDefault, +"color", +" | inherit", +"depends on user agent", +"", +true, +"", +"visual" +}, + + +{ +parseDefault, +"content", +"normal | [ | | | attr() | open-quote | close-quote | no-open-quote | no-close-quote ]+ | inherit", +"normal", +":before and :after pseudo-elements", +false, +"", +"all " +}, + + +{ +parseDefault, +"counter-increment", +"[ ? ]+ | none | inherit", +"none", +"", +false, +"", +"all " +}, + + +{ +parseDefault, +"counter-reset", +"[ ? ]+ | none | inherit", +"none", +"", +false, +"", +"all " +}, + + +{ +parseDefault, +"cue-after", +" | none | inherit", +"none", +"", +false, +"", +"aural" +}, + + +{ +parseDefault, +"cue-before", +" | none | inherit", +"none", +"", +false, +"", +"aural" +}, + + +{ +parseDefault, +"cue", +"[ 'cue-before' || 'cue-after' ] | inherit", +"see individual properties", +"", +false, +"", +"aural" +}, + + +{ +parseDefault, +"cursor", +"[ [ ,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help | progress ] ] | inherit", +"auto", +"", +true, +"", +"visual, interactive " +}, + + +{ +parseDefault, +"direction", +"ltr | rtl | inherit", +"ltr", +"all elements, but see prose", +true, +"", +"visual" +}, + + +{ +parseDefault, +"display", +"inline | block | list-item | run-in | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | inherit", +"inline", +"", +false, +"", +"all " +}, + + +{ +parseDefault, +"elevation", +" | below | level | above | higher | lower | inherit", +"level", +"", +true, +"", +"aural" +}, + + +{ +parseDefault, +"empty-cells", +"show | hide | inherit", +"show", +"table-cell' elements", +true, +"", +"visual" +}, + + +{ +parseDefault, +"float", +"left | right | none | inherit", +"none", +"all, but see 9.7", +false, +"", +"visual" +}, + + +{ +parseDefault, +"font-family", +"[[ | ] [, | ]* ] | inherit", +"depends on user agent", +"", +true, +"", +"visual" +}, + + +{ +parseDefault, +"font-size", +" | | | | inherit", +"medium", +"", +true, +"refer to parent element's font size", +"visual" +}, + + +{ +parseDefault, +"font-style", +"normal | italic | oblique | inherit", +"normal", +"", +true, +"", +"visual" +}, + + +{ +parseDefault, +"font-variant", +"normal | small-caps | inherit", +"normal", +"", +true, +"", +"visual" +}, + + +{ +parseDefault, +"font-weight", +"normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit", +"normal", +"", +true, +"", +"visual" +}, + + +{ +parseDefault, +"font", +"[ [ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [ / 'line-height' ]? 'font-family' ] | caption | icon | menu | message-box | small-caption | status-bar | inherit", +"see individual properties", +"", +true, +"see individual properties", +"visual" +}, + + +{ +parseDefault, +"height", +" | | auto | inherit", +"auto", +"all elements but non-replaced inline elements, table columns, and column groups", +false, +"see prose", +"visual" +}, + + +{ +parseDefault, +"left", +" | | auto | inherit", +"auto", +"positioned elements", +false, +"refer to width of containing block", +"visual" +}, + + +{ +parseDefault, +"letter-spacing", +"normal | | inherit", +"normal", +"", +true, +"", +"visual" +}, + + +{ +parseDefault, +"line-height", +"normal | | | | inherit", +"normal", +"", +true, +"refer to the font size of the element itself", +"visual" +}, + + +{ +parseDefault, +"list-style-image", +" | none | inherit", +"none", +"elements with 'display: list-item", +true, +"", +"visual" +}, + + +{ +parseDefault, +"list-style-position", +"inside | outside | inherit", +"outside", +"elements with 'display: list-item", +true, +"", +"visual" +}, + + +{ +parseDefault, +"list-style-type", +"disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | none | inherit", +"disc", +"elements with 'display: list-item", +true, +"", +"visual" +}, + + +{ +parseDefault, +"list-style", +"[ 'list-style-type' || 'list-style-position' || 'list-style-image' ] | inherit", +"see individual properties", +"elements with 'display: list-item", +true, +"", +"visual" +}, + + +{ +parseDefault, +"margin-right' 'margin-left", +" | inherit", +"0", +"all elements except elements with table display types other than table and inline-table", +false, +"refer to width of containing block", +"visual" +}, + + +{ +parseDefault, +"margin-top' 'margin-bottom", +" | inherit", +"0", +"all elements except elements with table display types other than table and inline-table", +false, +"refer to width of containing block", +"visual" +}, + + +{ +parseDefault, +"margin", +"{1,4} | inherit", +"see individual properties", +"all elements except elements with table display types other than table and inline-table", +false, +"refer to width of containing block", +"visual" +}, + + +{ +parseDefault, +"max-height", +" | | none | inherit", +"none", +"all elements except non-replaced inline elements and table elements", +false, +"see prose", +"visual" +}, + + +{ +parseDefault, +"max-width", +" | | none | inherit", +"none", +"all elements except non-replaced inline elements and table elements", +false, +"refer to width of containing block", +"visual" +}, + + +{ +parseDefault, +"min-height", +" | | inherit", +"0", +"all elements except non-replaced inline elements and table elements", +false, +"see prose", +"visual" +}, + + +{ +parseDefault, +"min-width", +" | | inherit", +"0", +"all elements except non-replaced inline elements and table elements", +false, +"refer to width of containing block", +"visual" +}, + + +{ +parseDefault, +"orphans", +" | inherit", +"2", +"block-level elements", +true, +"", +"visual, paged " +}, + + +{ +parseDefault, +"outline-color", +" | invert | inherit", +"invert", +"", +false, +"", +"visual, interactive " +}, + + +{ +parseDefault, +"outline-style", +" | inherit", +"none", +"", +false, +"", +"visual, interactive " +}, + + +{ +parseDefault, +"outline-width", +" | inherit", +"medium", +"", +false, +"", +"visual, interactive " +}, + + +{ +parseDefault, +"outline", +"[ 'outline-color' || 'outline-style' || 'outline-width' ] | inherit", +"see individual properties", +"", +false, +"", +"visual, interactive " +}, + + +{ +parseDefault, +"overflow", +"visible | hidden | scroll | auto | inherit", +"visible", +"block-level and replaced elements, table cells, inline blocks", +false, +"", +"visual" +}, + + +{ +parseDefault, +"padding-top' 'padding-right' 'padding-bottom' 'padding-left", +" | inherit", +"0", +"all elements except elements with table display types other than table, inline-table, and table-cell", +false, +"refer to width of containing block", +"visual" +}, + + +{ +parseDefault, +"padding", +"{1,4} | inherit", +"see individual properties", +"all elements except elements with table display types other than table, inline-table, and table-cell", +false, +"refer to width of containing block", +"visual" +}, + + +{ +parseDefault, +"page-break-after", +"auto | always | avoid | left | right | inherit", +"auto", +"block-level elements", +false, +"", +"visual, paged " +}, + + +{ +parseDefault, +"page-break-before", +"auto | always | avoid | left | right | inherit", +"auto", +"block-level elements", +false, +"", +"visual, paged " +}, + + +{ +parseDefault, +"page-break-inside", +"avoid | auto | inherit", +"auto", +"block-level elements", +true, +"", +"visual, paged " +}, + + +{ +parseDefault, +"pause-after", +"