Merge commit 1170303 from the Enterprise branch

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1171389 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent c5415f6983
commit d0abc1a165

@ -1 +1 @@
Revision 1170137 Revision 1170313

@ -1076,6 +1076,13 @@ bool CSSParser::parseValue( int propId, bool important )
CSS_PROP_LIST_STYLE_IMAGE }; CSS_PROP_LIST_STYLE_IMAGE };
return parseShortHand(propId, properties, 3, important); return parseShortHand(propId, properties, 3, important);
} }
case CSS_PROP_WORD_WRAP:
{
// normal | break-word
if ( id == CSS_VAL_NORMAL || id == CSS_VAL_BREAK_WORD )
valid_primitive = true;
break;
}
default: default:
// #ifdef CSS_DEBUG // #ifdef CSS_DEBUG
// kdDebug( 6080 ) << "illegal or CSS2 Aural property: " << val << endl; // kdDebug( 6080 ) << "illegal or CSS2 Aural property: " << val << endl;

@ -1,4 +1,4 @@
/* ANSI-C code produced by gperf version 3.0.1 */ /* ANSI-C code produced by gperf version 3.0.2 */
/* Command-line: gperf -a -L ANSI-C -E -C -c -o -t -k '*' -NfindProp -Hhash_prop -Wwordlist_prop -D -s 2 cssproperties.gperf */ /* Command-line: gperf -a -L ANSI-C -E -C -c -o -t -k '*' -NfindProp -Hhash_prop -Wwordlist_prop -D -s 2 cssproperties.gperf */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
@ -40,7 +40,7 @@ struct props {
}; };
static const struct props * findProp (register const char *str, register unsigned int len); static const struct props * findProp (register const char *str, register unsigned int len);
/* maximum key range = 508, duplicates = 0 */ /* maximum key range = 469, duplicates = 0 */
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
@ -54,32 +54,32 @@ hash_prop (register const char *str, register unsigned int len)
{ {
static const unsigned short asso_values[] = static const unsigned short asso_values[] =
{ {
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 0, 511, 511, 511, 511, 472, 472, 472, 472, 472, 0, 472, 472, 472, 472,
511, 0, 511, 511, 511, 511, 511, 511, 511, 511, 472, 0, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 10, 0, 0, 472, 472, 472, 472, 472, 472, 472, 10, 0, 0,
5, 5, 160, 0, 0, 0, 511, 15, 5, 0, 5, 5, 120, 0, 0, 0, 472, 15, 5, 0,
25, 0, 0, 15, 0, 30, 0, 40, 5, 190, 25, 0, 0, 50, 0, 30, 0, 40, 0, 140,
5, 135, 120, 511, 511, 511, 511, 511, 511, 511, 35, 180, 80, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
511, 511, 511, 511, 511, 511 472, 472, 472, 472, 472, 472
}; };
register int hval = len; register int hval = len;
@ -193,11 +193,11 @@ findProp (register const char *str, register unsigned int len)
{ {
enum enum
{ {
TOTAL_KEYWORDS = 128, TOTAL_KEYWORDS = 129,
MIN_WORD_LENGTH = 3, MIN_WORD_LENGTH = 3,
MAX_WORD_LENGTH = 32, MAX_WORD_LENGTH = 32,
MIN_HASH_VALUE = 3, MIN_HASH_VALUE = 3,
MAX_HASH_VALUE = 510 MAX_HASH_VALUE = 471
}; };
static const struct props wordlist_prop[] = static const struct props wordlist_prop[] =
@ -214,20 +214,18 @@ findProp (register const char *str, register unsigned int len)
{"color", CSS_PROP_COLOR}, {"color", CSS_PROP_COLOR},
#line 58 "cssproperties.gperf" #line 58 "cssproperties.gperf"
{"height", CSS_PROP_HEIGHT}, {"height", CSS_PROP_HEIGHT},
#line 118 "cssproperties.gperf" #line 119 "cssproperties.gperf"
{"border", CSS_PROP_BORDER}, {"border", CSS_PROP_BORDER},
#line 121 "cssproperties.gperf"
{"border-top", CSS_PROP_BORDER_TOP},
#line 122 "cssproperties.gperf" #line 122 "cssproperties.gperf"
{"border-right", CSS_PROP_BORDER_RIGHT}, {"border-top", CSS_PROP_BORDER_TOP},
#line 123 "cssproperties.gperf" #line 123 "cssproperties.gperf"
{"border-right", CSS_PROP_BORDER_RIGHT},
#line 124 "cssproperties.gperf"
{"border-bottom", CSS_PROP_BORDER_BOTTOM}, {"border-bottom", CSS_PROP_BORDER_BOTTOM},
#line 42 "cssproperties.gperf" #line 42 "cssproperties.gperf"
{"clear", CSS_PROP_CLEAR}, {"clear", CSS_PROP_CLEAR},
#line 119 "cssproperties.gperf" #line 120 "cssproperties.gperf"
{"border-color", CSS_PROP_BORDER_COLOR}, {"border-color", CSS_PROP_BORDER_COLOR},
#line 76 "cssproperties.gperf"
{"max-height", CSS_PROP_MAX_HEIGHT},
#line 28 "cssproperties.gperf" #line 28 "cssproperties.gperf"
{"border-top-color", CSS_PROP_BORDER_TOP_COLOR}, {"border-top-color", CSS_PROP_BORDER_TOP_COLOR},
#line 29 "cssproperties.gperf" #line 29 "cssproperties.gperf"
@ -236,7 +234,7 @@ findProp (register const char *str, register unsigned int len)
{"border-bottom-color", CSS_PROP_BORDER_BOTTOM_COLOR}, {"border-bottom-color", CSS_PROP_BORDER_BOTTOM_COLOR},
#line 78 "cssproperties.gperf" #line 78 "cssproperties.gperf"
{"min-height", CSS_PROP_MIN_HEIGHT}, {"min-height", CSS_PROP_MIN_HEIGHT},
#line 129 "cssproperties.gperf" #line 130 "cssproperties.gperf"
{"margin", CSS_PROP_MARGIN}, {"margin", CSS_PROP_MARGIN},
#line 49 "cssproperties.gperf" #line 49 "cssproperties.gperf"
{"direction", CSS_PROP_DIRECTION}, {"direction", CSS_PROP_DIRECTION},
@ -248,7 +246,7 @@ findProp (register const char *str, register unsigned int len)
{"margin-bottom", CSS_PROP_MARGIN_BOTTOM}, {"margin-bottom", CSS_PROP_MARGIN_BOTTOM},
#line 61 "cssproperties.gperf" #line 61 "cssproperties.gperf"
{"line-height", CSS_PROP_LINE_HEIGHT}, {"line-height", CSS_PROP_LINE_HEIGHT},
#line 131 "cssproperties.gperf" #line 132 "cssproperties.gperf"
{"padding", CSS_PROP_PADDING}, {"padding", CSS_PROP_PADDING},
#line 89 "cssproperties.gperf" #line 89 "cssproperties.gperf"
{"padding-top", CSS_PROP_PADDING_TOP}, {"padding-top", CSS_PROP_PADDING_TOP},
@ -256,53 +254,53 @@ findProp (register const char *str, register unsigned int len)
{"padding-right", CSS_PROP_PADDING_RIGHT}, {"padding-right", CSS_PROP_PADDING_RIGHT},
#line 91 "cssproperties.gperf" #line 91 "cssproperties.gperf"
{"padding-bottom", CSS_PROP_PADDING_BOTTOM}, {"padding-bottom", CSS_PROP_PADDING_BOTTOM},
#line 102 "cssproperties.gperf" #line 76 "cssproperties.gperf"
{"text-align", CSS_PROP_TEXT_ALIGN}, {"max-height", CSS_PROP_MAX_HEIGHT},
#line 45 "cssproperties.gperf" #line 45 "cssproperties.gperf"
{"content", CSS_PROP_CONTENT}, {"content", CSS_PROP_CONTENT},
#line 97 "cssproperties.gperf" #line 97 "cssproperties.gperf"
{"position", CSS_PROP_POSITION}, {"position", CSS_PROP_POSITION},
#line 103 "cssproperties.gperf"
{"text-decoration", CSS_PROP_TEXT_DECORATION},
#line 80 "cssproperties.gperf" #line 80 "cssproperties.gperf"
{"orphans", CSS_PROP_ORPHANS}, {"orphans", CSS_PROP_ORPHANS},
#line 48 "cssproperties.gperf"
{"cursor", CSS_PROP_CURSOR},
#line 110 "cssproperties.gperf" #line 110 "cssproperties.gperf"
{"vertical-align", CSS_PROP_VERTICAL_ALIGN}, {"vertical-align", CSS_PROP_VERTICAL_ALIGN},
#line 48 "cssproperties.gperf"
{"cursor", CSS_PROP_CURSOR},
#line 24 "cssproperties.gperf" #line 24 "cssproperties.gperf"
{"border-collapse", CSS_PROP_BORDER_COLLAPSE}, {"border-collapse", CSS_PROP_BORDER_COLLAPSE},
#line 104 "cssproperties.gperf" #line 131 "cssproperties.gperf"
{"text-indent", CSS_PROP_TEXT_INDENT},
#line 130 "cssproperties.gperf"
{"outline", CSS_PROP_OUTLINE}, {"outline", CSS_PROP_OUTLINE},
#line 135 "cssproperties.gperf" #line 136 "cssproperties.gperf"
{"scrollbar-highlight-color", CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR}, {"scrollbar-highlight-color", CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR},
#line 41 "cssproperties.gperf" #line 41 "cssproperties.gperf"
{"caption-side", CSS_PROP_CAPTION_SIDE}, {"caption-side", CSS_PROP_CAPTION_SIDE},
#line 136 "cssproperties.gperf" #line 137 "cssproperties.gperf"
{"scrollbar-3dlight-color", CSS_PROP_SCROLLBAR_3DLIGHT_COLOR}, {"scrollbar-3dlight-color", CSS_PROP_SCROLLBAR_3DLIGHT_COLOR},
#line 25 "cssproperties.gperf" #line 25 "cssproperties.gperf"
{"border-spacing", CSS_PROP_BORDER_SPACING}, {"border-spacing", CSS_PROP_BORDER_SPACING},
#line 102 "cssproperties.gperf"
{"text-align", CSS_PROP_TEXT_ALIGN},
#line 109 "cssproperties.gperf" #line 109 "cssproperties.gperf"
{"unicode-bidi", CSS_PROP_UNICODE_BIDI}, {"unicode-bidi", CSS_PROP_UNICODE_BIDI},
#line 82 "cssproperties.gperf" #line 82 "cssproperties.gperf"
{"outline-color", CSS_PROP_OUTLINE_COLOR}, {"outline-color", CSS_PROP_OUTLINE_COLOR},
#line 60 "cssproperties.gperf" #line 60 "cssproperties.gperf"
{"letter-spacing", CSS_PROP_LETTER_SPACING}, {"letter-spacing", CSS_PROP_LETTER_SPACING},
#line 98 "cssproperties.gperf" #line 103 "cssproperties.gperf"
{"quotes", CSS_PROP_QUOTES}, {"text-decoration", CSS_PROP_TEXT_DECORATION},
#line 138 "cssproperties.gperf" #line 139 "cssproperties.gperf"
{"scrollbar-track-color", CSS_PROP_SCROLLBAR_TRACK_COLOR}, {"scrollbar-track-color", CSS_PROP_SCROLLBAR_TRACK_COLOR},
#line 117 "cssproperties.gperf" #line 118 "cssproperties.gperf"
{"background", CSS_PROP_BACKGROUND}, {"background", CSS_PROP_BACKGROUND},
#line 70 "cssproperties.gperf" #line 104 "cssproperties.gperf"
{"-khtml-marquee", CSS_PROP__KHTML_MARQUEE}, {"text-indent", CSS_PROP_TEXT_INDENT},
#line 69 "cssproperties.gperf" #line 69 "cssproperties.gperf"
{"-khtml-margin-start", CSS_PROP__KHTML_MARGIN_START}, {"-khtml-margin-start", CSS_PROP__KHTML_MARGIN_START},
#line 14 "cssproperties.gperf" #line 14 "cssproperties.gperf"
{"background-color", CSS_PROP_BACKGROUND_COLOR}, {"background-color", CSS_PROP_BACKGROUND_COLOR},
#line 132 "cssproperties.gperf" #line 100 "cssproperties.gperf"
{"size", CSS_PROP_SIZE},
#line 133 "cssproperties.gperf"
{"scrollbar-base-color", CSS_PROP_SCROLLBAR_BASE_COLOR}, {"scrollbar-base-color", CSS_PROP_SCROLLBAR_BASE_COLOR},
#line 47 "cssproperties.gperf" #line 47 "cssproperties.gperf"
{"counter-reset", CSS_PROP_COUNTER_RESET}, {"counter-reset", CSS_PROP_COUNTER_RESET},
@ -312,208 +310,208 @@ findProp (register const char *str, register unsigned int len)
{"background-image", CSS_PROP_BACKGROUND_IMAGE}, {"background-image", CSS_PROP_BACKGROUND_IMAGE},
#line 96 "cssproperties.gperf" #line 96 "cssproperties.gperf"
{"page-break-inside", CSS_PROP_PAGE_BREAK_INSIDE}, {"page-break-inside", CSS_PROP_PAGE_BREAK_INSIDE},
#line 98 "cssproperties.gperf"
{"quotes", CSS_PROP_QUOTES},
#line 16 "cssproperties.gperf" #line 16 "cssproperties.gperf"
{"background-repeat", CSS_PROP_BACKGROUND_REPEAT}, {"background-repeat", CSS_PROP_BACKGROUND_REPEAT},
#line 21 "cssproperties.gperf"
{"-khtml-background-clip", CSS_PROP__KHTML_BACKGROUND_CLIP},
#line 46 "cssproperties.gperf"
{"counter-increment", CSS_PROP_COUNTER_INCREMENT},
#line 27 "cssproperties.gperf"
{"-khtml-border-vertical-spacing", CSS_PROP__KHTML_BORDER_VERTICAL_SPACING},
#line 81 "cssproperties.gperf"
{"opacity", CSS_PROP_OPACITY},
#line 71 "cssproperties.gperf"
{"-khtml-marquee-direction", CSS_PROP__KHTML_MARQUEE_DIRECTION},
#line 73 "cssproperties.gperf"
{"-khtml-marquee-repetition", CSS_PROP__KHTML_MARQUEE_REPETITION},
#line 100 "cssproperties.gperf"
{"size", CSS_PROP_SIZE},
#line 74 "cssproperties.gperf"
{"-khtml-marquee-speed", CSS_PROP__KHTML_MARQUEE_SPEED},
#line 22 "cssproperties.gperf"
{"-khtml-background-origin", CSS_PROP__KHTML_BACKGROUND_ORIGIN},
#line 17 "cssproperties.gperf"
{"background-attachment", CSS_PROP_BACKGROUND_ATTACHMENT},
#line 116 "cssproperties.gperf"
{"z-index", CSS_PROP_Z_INDEX},
#line 18 "cssproperties.gperf"
{"background-position", CSS_PROP_BACKGROUND_POSITION},
#line 59 "cssproperties.gperf" #line 59 "cssproperties.gperf"
{"left", CSS_PROP_LEFT}, {"left", CSS_PROP_LEFT},
#line 19 "cssproperties.gperf"
{"background-position-x", CSS_PROP_BACKGROUND_POSITION_X},
#line 141 "cssproperties.gperf"
{"-khtml-user-input", CSS_PROP__KHTML_USER_INPUT},
#line 72 "cssproperties.gperf"
{"-khtml-marquee-increment", CSS_PROP__KHTML_MARQUEE_INCREMENT},
#line 52 "cssproperties.gperf" #line 52 "cssproperties.gperf"
{"float", CSS_PROP_FLOAT}, {"float", CSS_PROP_FLOAT},
#line 111 "cssproperties.gperf" #line 21 "cssproperties.gperf"
{"visibility", CSS_PROP_VISIBILITY}, {"-khtml-background-clip", CSS_PROP__KHTML_BACKGROUND_CLIP},
#line 127 "cssproperties.gperf" #line 70 "cssproperties.gperf"
{"-khtml-marquee", CSS_PROP__KHTML_MARQUEE},
#line 27 "cssproperties.gperf"
{"-khtml-border-vertical-spacing", CSS_PROP__KHTML_BORDER_VERTICAL_SPACING},
#line 46 "cssproperties.gperf"
{"counter-increment", CSS_PROP_COUNTER_INCREMENT},
#line 128 "cssproperties.gperf"
{"font", CSS_PROP_FONT}, {"font", CSS_PROP_FONT},
#line 126 "cssproperties.gperf"
{"box-sizing", CSS_PROP_BOX_SIZING},
#line 124 "cssproperties.gperf"
{"border-left", CSS_PROP_BORDER_LEFT},
#line 50 "cssproperties.gperf"
{"display", CSS_PROP_DISPLAY},
#line 51 "cssproperties.gperf"
{"empty-cells", CSS_PROP_EMPTY_CELLS},
#line 120 "cssproperties.gperf"
{"border-style", CSS_PROP_BORDER_STYLE},
#line 114 "cssproperties.gperf" #line 114 "cssproperties.gperf"
{"width", CSS_PROP_WIDTH}, {"width", CSS_PROP_WIDTH},
#line 32 "cssproperties.gperf" #line 125 "cssproperties.gperf"
{"border-top-style", CSS_PROP_BORDER_TOP_STYLE}, {"border-left", CSS_PROP_BORDER_LEFT},
#line 117 "cssproperties.gperf"
{"z-index", CSS_PROP_Z_INDEX},
#line 31 "cssproperties.gperf" #line 31 "cssproperties.gperf"
{"border-left-color", CSS_PROP_BORDER_LEFT_COLOR}, {"border-left-color", CSS_PROP_BORDER_LEFT_COLOR},
#line 33 "cssproperties.gperf" #line 22 "cssproperties.gperf"
{"border-right-style", CSS_PROP_BORDER_RIGHT_STYLE}, {"-khtml-background-origin", CSS_PROP__KHTML_BACKGROUND_ORIGIN},
#line 34 "cssproperties.gperf" #line 17 "cssproperties.gperf"
{"border-bottom-style", CSS_PROP_BORDER_BOTTOM_STYLE}, {"background-attachment", CSS_PROP_BACKGROUND_ATTACHMENT},
#line 68 "cssproperties.gperf" #line 126 "cssproperties.gperf"
{"margin-left", CSS_PROP_MARGIN_LEFT},
#line 125 "cssproperties.gperf"
{"border-width", CSS_PROP_BORDER_WIDTH}, {"border-width", CSS_PROP_BORDER_WIDTH},
#line 77 "cssproperties.gperf" #line 18 "cssproperties.gperf"
{"max-width", CSS_PROP_MAX_WIDTH}, {"background-position", CSS_PROP_BACKGROUND_POSITION},
#line 128 "cssproperties.gperf"
{"list-style", CSS_PROP_LIST_STYLE},
#line 36 "cssproperties.gperf" #line 36 "cssproperties.gperf"
{"border-top-width", CSS_PROP_BORDER_TOP_WIDTH}, {"border-top-width", CSS_PROP_BORDER_TOP_WIDTH},
#line 101 "cssproperties.gperf"
{"table-layout", CSS_PROP_TABLE_LAYOUT},
#line 37 "cssproperties.gperf" #line 37 "cssproperties.gperf"
{"border-right-width", CSS_PROP_BORDER_RIGHT_WIDTH}, {"border-right-width", CSS_PROP_BORDER_RIGHT_WIDTH},
#line 38 "cssproperties.gperf" #line 38 "cssproperties.gperf"
{"border-bottom-width", CSS_PROP_BORDER_BOTTOM_WIDTH}, {"border-bottom-width", CSS_PROP_BORDER_BOTTOM_WIDTH},
#line 92 "cssproperties.gperf" #line 68 "cssproperties.gperf"
{"padding-left", CSS_PROP_PADDING_LEFT}, {"margin-left", CSS_PROP_MARGIN_LEFT},
#line 142 "cssproperties.gperf"
{"-khtml-user-input", CSS_PROP__KHTML_USER_INPUT},
#line 79 "cssproperties.gperf" #line 79 "cssproperties.gperf"
{"min-width", CSS_PROP_MIN_WIDTH}, {"min-width", CSS_PROP_MIN_WIDTH},
#line 127 "cssproperties.gperf"
{"box-sizing", CSS_PROP_BOX_SIZING},
#line 92 "cssproperties.gperf"
{"padding-left", CSS_PROP_PADDING_LEFT},
#line 71 "cssproperties.gperf"
{"-khtml-marquee-direction", CSS_PROP__KHTML_MARQUEE_DIRECTION},
#line 73 "cssproperties.gperf"
{"-khtml-marquee-repetition", CSS_PROP__KHTML_MARQUEE_REPETITION},
#line 95 "cssproperties.gperf" #line 95 "cssproperties.gperf"
{"page-break-before", CSS_PROP_PAGE_BREAK_BEFORE}, {"page-break-before", CSS_PROP_PAGE_BREAK_BEFORE},
#line 74 "cssproperties.gperf"
{"-khtml-marquee-speed", CSS_PROP__KHTML_MARQUEE_SPEED},
#line 94 "cssproperties.gperf" #line 94 "cssproperties.gperf"
{"page-break-after", CSS_PROP_PAGE_BREAK_AFTER}, {"page-break-after", CSS_PROP_PAGE_BREAK_AFTER},
#line 62 "cssproperties.gperf" #line 81 "cssproperties.gperf"
{"list-style-image", CSS_PROP_LIST_STYLE_IMAGE}, {"opacity", CSS_PROP_OPACITY},
#line 77 "cssproperties.gperf"
{"max-width", CSS_PROP_MAX_WIDTH},
#line 112 "cssproperties.gperf"
{"white-space", CSS_PROP_WHITE_SPACE},
#line 56 "cssproperties.gperf" #line 56 "cssproperties.gperf"
{"font-variant", CSS_PROP_FONT_VARIANT}, {"font-variant", CSS_PROP_FONT_VARIANT},
#line 107 "cssproperties.gperf" #line 19 "cssproperties.gperf"
{"text-transform", CSS_PROP_TEXT_TRANSFORM}, {"background-position-x", CSS_PROP_BACKGROUND_POSITION_X},
#line 133 "cssproperties.gperf" #line 134 "cssproperties.gperf"
{"scrollbar-face-color", CSS_PROP_SCROLLBAR_FACE_COLOR}, {"scrollbar-face-color", CSS_PROP_SCROLLBAR_FACE_COLOR},
#line 112 "cssproperties.gperf" #line 72 "cssproperties.gperf"
{"white-space", CSS_PROP_WHITE_SPACE}, {"-khtml-marquee-increment", CSS_PROP__KHTML_MARQUEE_INCREMENT},
#line 106 "cssproperties.gperf" #line 116 "cssproperties.gperf"
{"text-shadow", CSS_PROP_TEXT_SHADOW},
#line 84 "cssproperties.gperf"
{"outline-style", CSS_PROP_OUTLINE_STYLE},
#line 115 "cssproperties.gperf"
{"word-spacing", CSS_PROP_WORD_SPACING}, {"word-spacing", CSS_PROP_WORD_SPACING},
#line 139 "cssproperties.gperf" #line 111 "cssproperties.gperf"
{"visibility", CSS_PROP_VISIBILITY},
#line 140 "cssproperties.gperf"
{"scrollbar-arrow-color", CSS_PROP_SCROLLBAR_ARROW_COLOR}, {"scrollbar-arrow-color", CSS_PROP_SCROLLBAR_ARROW_COLOR},
#line 85 "cssproperties.gperf" #line 85 "cssproperties.gperf"
{"outline-width", CSS_PROP_OUTLINE_WIDTH}, {"outline-width", CSS_PROP_OUTLINE_WIDTH},
#line 63 "cssproperties.gperf" #line 106 "cssproperties.gperf"
{"list-style-position", CSS_PROP_LIST_STYLE_POSITION}, {"text-shadow", CSS_PROP_TEXT_SHADOW},
#line 50 "cssproperties.gperf"
{"display", CSS_PROP_DISPLAY},
#line 107 "cssproperties.gperf"
{"text-transform", CSS_PROP_TEXT_TRANSFORM},
#line 51 "cssproperties.gperf"
{"empty-cells", CSS_PROP_EMPTY_CELLS},
#line 121 "cssproperties.gperf"
{"border-style", CSS_PROP_BORDER_STYLE},
#line 32 "cssproperties.gperf"
{"border-top-style", CSS_PROP_BORDER_TOP_STYLE},
#line 26 "cssproperties.gperf" #line 26 "cssproperties.gperf"
{"-khtml-border-horizontal-spacing", CSS_PROP__KHTML_BORDER_HORIZONTAL_SPACING}, {"-khtml-border-horizontal-spacing", CSS_PROP__KHTML_BORDER_HORIZONTAL_SPACING},
#line 75 "cssproperties.gperf" #line 33 "cssproperties.gperf"
{"-khtml-marquee-style", CSS_PROP__KHTML_MARQUEE_STYLE}, {"border-right-style", CSS_PROP_BORDER_RIGHT_STYLE},
#line 34 "cssproperties.gperf"
{"border-bottom-style", CSS_PROP_BORDER_BOTTOM_STYLE},
#line 23 "cssproperties.gperf" #line 23 "cssproperties.gperf"
{"-khtml-background-size", CSS_PROP__KHTML_BACKGROUND_SIZE}, {"-khtml-background-size", CSS_PROP__KHTML_BACKGROUND_SIZE},
#line 20 "cssproperties.gperf" #line 135 "cssproperties.gperf"
{"background-position-y", CSS_PROP_BACKGROUND_POSITION_Y},
#line 134 "cssproperties.gperf"
{"scrollbar-shadow-color", CSS_PROP_SCROLLBAR_SHADOW_COLOR}, {"scrollbar-shadow-color", CSS_PROP_SCROLLBAR_SHADOW_COLOR},
#line 137 "cssproperties.gperf" #line 129 "cssproperties.gperf"
{"scrollbar-darkshadow-color", CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR}, {"list-style", CSS_PROP_LIST_STYLE},
#line 101 "cssproperties.gperf"
{"table-layout", CSS_PROP_TABLE_LAYOUT},
#line 54 "cssproperties.gperf" #line 54 "cssproperties.gperf"
{"font-size", CSS_PROP_FONT_SIZE}, {"font-size", CSS_PROP_FONT_SIZE},
#line 64 "cssproperties.gperf"
{"list-style-type", CSS_PROP_LIST_STYLE_TYPE},
#line 55 "cssproperties.gperf"
{"font-style", CSS_PROP_FONT_STYLE},
#line 35 "cssproperties.gperf"
{"border-left-style", CSS_PROP_BORDER_LEFT_STYLE},
#line 86 "cssproperties.gperf" #line 86 "cssproperties.gperf"
{"overflow", CSS_PROP_OVERFLOW}, {"overflow", CSS_PROP_OVERFLOW},
#line 87 "cssproperties.gperf" #line 62 "cssproperties.gperf"
{"overflow-x", CSS_PROP_OVERFLOW_X}, {"list-style-image", CSS_PROP_LIST_STYLE_IMAGE},
#line 105 "cssproperties.gperf" #line 138 "cssproperties.gperf"
{"text-overflow", CSS_PROP_TEXT_OVERFLOW}, {"scrollbar-darkshadow-color", CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR},
#line 57 "cssproperties.gperf" #line 57 "cssproperties.gperf"
{"font-weight", CSS_PROP_FONT_WEIGHT}, {"font-weight", CSS_PROP_FONT_WEIGHT},
#line 39 "cssproperties.gperf" #line 39 "cssproperties.gperf"
{"border-left-width", CSS_PROP_BORDER_LEFT_WIDTH}, {"border-left-width", CSS_PROP_BORDER_LEFT_WIDTH},
#line 140 "cssproperties.gperf" #line 115 "cssproperties.gperf"
{"word-wrap", CSS_PROP_WORD_WRAP},
#line 84 "cssproperties.gperf"
{"outline-style", CSS_PROP_OUTLINE_STYLE},
#line 141 "cssproperties.gperf"
{"-khtml-flow-mode", CSS_PROP__KHTML_FLOW_MODE}, {"-khtml-flow-mode", CSS_PROP__KHTML_FLOW_MODE},
#line 87 "cssproperties.gperf"
{"overflow-x", CSS_PROP_OVERFLOW_X},
#line 113 "cssproperties.gperf" #line 113 "cssproperties.gperf"
{"widows", CSS_PROP_WIDOWS}, {"widows", CSS_PROP_WIDOWS},
#line 105 "cssproperties.gperf"
{"text-overflow", CSS_PROP_TEXT_OVERFLOW},
#line 63 "cssproperties.gperf"
{"list-style-position", CSS_PROP_LIST_STYLE_POSITION},
#line 20 "cssproperties.gperf"
{"background-position-y", CSS_PROP_BACKGROUND_POSITION_Y},
#line 83 "cssproperties.gperf" #line 83 "cssproperties.gperf"
{"outline-offset", CSS_PROP_OUTLINE_OFFSET}, {"outline-offset", CSS_PROP_OUTLINE_OFFSET},
#line 53 "cssproperties.gperf" #line 75 "cssproperties.gperf"
{"font-family", CSS_PROP_FONT_FAMILY}, {"-khtml-marquee-style", CSS_PROP__KHTML_MARQUEE_STYLE},
#line 55 "cssproperties.gperf"
{"font-style", CSS_PROP_FONT_STYLE},
#line 35 "cssproperties.gperf"
{"border-left-style", CSS_PROP_BORDER_LEFT_STYLE},
#line 64 "cssproperties.gperf"
{"list-style-type", CSS_PROP_LIST_STYLE_TYPE},
#line 88 "cssproperties.gperf" #line 88 "cssproperties.gperf"
{"overflow-y", CSS_PROP_OVERFLOW_Y} {"overflow-y", CSS_PROP_OVERFLOW_Y},
#line 53 "cssproperties.gperf"
{"font-family", CSS_PROP_FONT_FAMILY}
}; };
static const signed char lookup[] = static const short lookup[] =
{ {
-1, -1, -1, 0, -1, 1, 2, -1, -1, 3, -1, -1, -1, 0, -1, 1, 2, -1, -1, 3,
4, 5, -1, -1, -1, -1, 6, -1, -1, -1, 4, 5, -1, -1, -1, -1, 6, -1, -1, -1,
7, -1, 8, 9, -1, 10, -1, 11, -1, -1, 7, -1, 8, 9, -1, 10, -1, 11, -1, -1,
12, 13, -1, 14, 15, -1, -1, -1, -1, -1, -1, 12, -1, 13, 14, -1, -1, -1, -1, -1,
16, 17, -1, -1, 18, 19, -1, 20, 21, -1, 15, 16, -1, -1, 17, 18, -1, 19, 20, -1,
-1, 22, 23, -1, -1, -1, 24, -1, 25, 26, -1, 21, 22, -1, -1, -1, 23, -1, 24, 25,
27, -1, 28, 29, -1, -1, -1, -1, -1, -1, 26, -1, 27, 28, -1, -1, -1, -1, -1, -1,
30, -1, 31, -1, -1, -1, 32, -1, -1, 33, -1, -1, 29, -1, 30, -1, 31, -1, -1, -1,
34, 35, 36, -1, -1, 37, -1, 38, 39, 40, 32, -1, 33, -1, -1, 34, -1, 35, 36, 37,
-1, -1, 41, 42, 43, -1, 44, -1, -1, -1, 38, -1, 39, 40, 41, -1, -1, -1, -1, -1,
-1, 45, -1, -1, -1, 46, -1, -1, -1, 47, 42, 43, -1, -1, -1, 44, -1, -1, -1, -1,
-1, -1, -1, -1, 48, -1, 49, -1, -1, -1, -1, 45, -1, -1, 46, -1, 47, -1, -1, 48,
50, -1, -1, 51, -1, 52, 53, 54, -1, -1, 49, -1, -1, 50, -1, 51, 52, 53, -1, -1,
-1, -1, 55, -1, -1, -1, -1, -1, -1, -1, -1, 54, 55, -1, 56, -1, -1, -1, -1, -1,
-1, -1, 56, -1, -1, -1, -1, 57, -1, -1, 57, -1, 58, -1, 59, 60, -1, 61, -1, 62,
58, -1, 59, -1, 60, 61, -1, -1, -1, 62, 63, 64, -1, -1, -1, -1, -1, 65, -1, -1,
63, -1, -1, -1, 64, -1, 65, 66, -1, 67, -1, -1, 66, -1, 67, -1, 68, 69, -1, 70,
-1, -1, -1, -1, 68, -1, 69, 70, -1, 71, -1, 71, -1, 72, 73, -1, 74, 75, -1, 76,
72, -1, -1, -1, -1, 73, -1, -1, -1, 74, 77, -1, -1, -1, -1, -1, -1, 78, -1, 79,
75, 76, 77, -1, -1, -1, 78, 79, -1, -1, 80, -1, 81, -1, -1, 82, 83, 84, -1, 85,
80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 86, 87, -1, -1, -1, 88, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 85, 86, -1, 87, 89, -1, -1, -1, 90, -1, -1, -1, -1, -1,
88, 89, 90, 91, 92, -1, -1, 93, -1, 94, -1, -1, 91, -1, -1, 92, 93, -1, -1, -1,
-1, -1, 95, -1, -1, -1, 96, -1, -1, -1, -1, -1, -1, 94, -1, -1, 95, 96, -1, 97,
-1, 97, -1, -1, -1, -1, -1, 98, -1, 99, -1, 98, 99, -1, -1, -1, 100, 101, 102, 103,
100, 101, -1, -1, -1, -1, 102, -1, -1, -1, -1, -1, 104, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, -1, 105, -1, -1, 106, -1, 107, -1, 108,
-1, -1, 104, -1, -1, -1, 105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 109, -1,
-1, -1, -1, 106, 107, -1, -1, 108, -1, -1, -1, -1, -1, -1, -1, -1, 110, -1, -1, -1,
109, -1, 110, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1,
-1, -1, 112, -1, -1, -1, -1, -1, -1, -1, -1, 112, 113, -1, 114, -1, -1, -1, 115, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 116, -1, -1, -1, 117, -1, -1, -1, -1,
-1, 118, -1, 119, -1, -1, -1, -1, -1, 120,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 113, -1, -1, 114,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 115, -1, -1, -1, -1, -1, 121, -1, -1, -1, -1, -1, -1, -1, -1,
116, -1, 117, 118, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 122, -1, -1, -1, -1, -1,
119, -1, -1, -1, -1, -1, -1, -1, 120, -1, 123, -1, -1, -1, -1, 124, -1, 125, -1, -1,
-1, 121, 122, -1, -1, -1, -1, -1, -1, -1,
-1, 123, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 124, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 125, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 126, -1, -1, -1, -1, -1, -1, -1, -1, 126, -1, -1, -1, -1,
127 127, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 128
}; };
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
@ -535,7 +533,7 @@ findProp (register const char *str, register unsigned int len)
} }
return 0; return 0;
} }
#line 142 "cssproperties.gperf" #line 143 "cssproperties.gperf"
static const char * const propertyList[] = { static const char * const propertyList[] = {
"", "",
@ -640,6 +638,7 @@ static const char * const propertyList[] = {
"white-space", "white-space",
"widows", "widows",
"width", "width",
"word-wrap",
"word-spacing", "word-spacing",
"z-index", "z-index",
"background", "background",

@ -109,35 +109,36 @@ DOM::DOMString getPropertyName(unsigned short id) KDE_NO_EXPORT;
#define CSS_PROP_WHITE_SPACE 99 #define CSS_PROP_WHITE_SPACE 99
#define CSS_PROP_WIDOWS 100 #define CSS_PROP_WIDOWS 100
#define CSS_PROP_WIDTH 101 #define CSS_PROP_WIDTH 101
#define CSS_PROP_WORD_SPACING 102 #define CSS_PROP_WORD_WRAP 102
#define CSS_PROP_Z_INDEX 103 #define CSS_PROP_WORD_SPACING 103
#define CSS_PROP_BACKGROUND 104 #define CSS_PROP_Z_INDEX 104
#define CSS_PROP_BORDER 105 #define CSS_PROP_BACKGROUND 105
#define CSS_PROP_BORDER_COLOR 106 #define CSS_PROP_BORDER 106
#define CSS_PROP_BORDER_STYLE 107 #define CSS_PROP_BORDER_COLOR 107
#define CSS_PROP_BORDER_TOP 108 #define CSS_PROP_BORDER_STYLE 108
#define CSS_PROP_BORDER_RIGHT 109 #define CSS_PROP_BORDER_TOP 109
#define CSS_PROP_BORDER_BOTTOM 110 #define CSS_PROP_BORDER_RIGHT 110
#define CSS_PROP_BORDER_LEFT 111 #define CSS_PROP_BORDER_BOTTOM 111
#define CSS_PROP_BORDER_WIDTH 112 #define CSS_PROP_BORDER_LEFT 112
#define CSS_PROP_BOX_SIZING 113 #define CSS_PROP_BORDER_WIDTH 113
#define CSS_PROP_FONT 114 #define CSS_PROP_BOX_SIZING 114
#define CSS_PROP_LIST_STYLE 115 #define CSS_PROP_FONT 115
#define CSS_PROP_MARGIN 116 #define CSS_PROP_LIST_STYLE 116
#define CSS_PROP_OUTLINE 117 #define CSS_PROP_MARGIN 117
#define CSS_PROP_PADDING 118 #define CSS_PROP_OUTLINE 118
#define CSS_PROP_SCROLLBAR_BASE_COLOR 119 #define CSS_PROP_PADDING 119
#define CSS_PROP_SCROLLBAR_FACE_COLOR 120 #define CSS_PROP_SCROLLBAR_BASE_COLOR 120
#define CSS_PROP_SCROLLBAR_SHADOW_COLOR 121 #define CSS_PROP_SCROLLBAR_FACE_COLOR 121
#define CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR 122 #define CSS_PROP_SCROLLBAR_SHADOW_COLOR 122
#define CSS_PROP_SCROLLBAR_3DLIGHT_COLOR 123 #define CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR 123
#define CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR 124 #define CSS_PROP_SCROLLBAR_3DLIGHT_COLOR 124
#define CSS_PROP_SCROLLBAR_TRACK_COLOR 125 #define CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR 125
#define CSS_PROP_SCROLLBAR_ARROW_COLOR 126 #define CSS_PROP_SCROLLBAR_TRACK_COLOR 126
#define CSS_PROP__KHTML_FLOW_MODE 127 #define CSS_PROP_SCROLLBAR_ARROW_COLOR 127
#define CSS_PROP__KHTML_USER_INPUT 128 #define CSS_PROP__KHTML_FLOW_MODE 128
#define CSS_PROP__KHTML_USER_INPUT 129
#define CSS_PROP_MAX CSS_PROP_Z_INDEX #define CSS_PROP_MAX CSS_PROP_Z_INDEX
#define CSS_PROP_TOTAL 129 #define CSS_PROP_TOTAL 130
#endif #endif

@ -116,6 +116,7 @@ visibility
white-space white-space
widows widows
width width
word-wrap
word-spacing word-spacing
z-index z-index
background background

@ -175,6 +175,26 @@ if (id == propID) \
return;\ return;\
} }
#define HANDLE_INHERIT_ON_INHERITED_PROPERTY(prop, Prop) \
if (isInherit) \
{\
style->set##Prop(parentStyle->prop());\
return;\
}
#define HANDLE_INITIAL(prop, Prop) \
if (isInitial) \
{\
style->set##Prop(RenderStyle::initial##Prop());\
return;\
}
#define HANDLE_INITIAL_AND_INHERIT_ON_INHERITED_PROPERTY(prop, Prop) \
HANDLE_INITIAL(prop, Prop) \
else \
HANDLE_INHERIT_ON_INHERITED_PROPERTY(prop, Prop)
namespace khtml { namespace khtml {
CSSStyleSelectorList *CSSStyleSelector::s_defaultStyle; CSSStyleSelectorList *CSSStyleSelector::s_defaultStyle;
@ -3953,6 +3973,13 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
break; break;
} }
} }
case CSS_PROP_WORD_WRAP: {
HANDLE_INITIAL_AND_INHERIT_ON_INHERITED_PROPERTY(wordWrap, WordWrap)
if (!primitiveValue)
return;
style->setWordWrap(primitiveValue->getIdent() == CSS_VAL_NORMAL ? WWNORMAL : WWBREAKWORD);
break;
}
default: default:
return; return;
} }

File diff suppressed because it is too large Load Diff

@ -227,63 +227,64 @@ DOM::DOMString getValueName(unsigned short id) KDE_NO_EXPORT;
#define CSS_VAL_PRE_WRAP 216 #define CSS_VAL_PRE_WRAP 216
#define CSS_VAL_PRE_LINE 217 #define CSS_VAL_PRE_LINE 217
#define CSS_VAL__KHTML_NOWRAP 218 #define CSS_VAL__KHTML_NOWRAP 218
#define CSS_VAL_ABOVE 219 #define CSS_VAL_BREAK_WORD 219
#define CSS_VAL_ABSOLUTE 220 #define CSS_VAL_ABOVE 220
#define CSS_VAL_ALWAYS 221 #define CSS_VAL_ABSOLUTE 221
#define CSS_VAL_AVOID 222 #define CSS_VAL_ALWAYS 222
#define CSS_VAL_BELOW 223 #define CSS_VAL_AVOID 223
#define CSS_VAL_BIDI_OVERRIDE 224 #define CSS_VAL_BELOW 224
#define CSS_VAL_BLINK 225 #define CSS_VAL_BIDI_OVERRIDE 225
#define CSS_VAL_BOTH 226 #define CSS_VAL_BLINK 226
#define CSS_VAL_CROP 227 #define CSS_VAL_BOTH 227
#define CSS_VAL_CROSS 228 #define CSS_VAL_CROP 228
#define CSS_VAL_EMBED 229 #define CSS_VAL_CROSS 229
#define CSS_VAL_FIXED 230 #define CSS_VAL_EMBED 230
#define CSS_VAL_HAND 231 #define CSS_VAL_FIXED 231
#define CSS_VAL_HIDE 232 #define CSS_VAL_HAND 232
#define CSS_VAL_HIGHER 233 #define CSS_VAL_HIDE 233
#define CSS_VAL_INVERT 234 #define CSS_VAL_HIGHER 234
#define CSS_VAL_LANDSCAPE 235 #define CSS_VAL_INVERT 235
#define CSS_VAL_LEVEL 236 #define CSS_VAL_LANDSCAPE 236
#define CSS_VAL_LINE_THROUGH 237 #define CSS_VAL_LEVEL 237
#define CSS_VAL_LOUD 238 #define CSS_VAL_LINE_THROUGH 238
#define CSS_VAL_LOWER 239 #define CSS_VAL_LOUD 239
#define CSS_VAL_MARQUEE 240 #define CSS_VAL_LOWER 240
#define CSS_VAL_MIX 241 #define CSS_VAL_MARQUEE 241
#define CSS_VAL_OVERLINE 242 #define CSS_VAL_MIX 242
#define CSS_VAL_PORTRAIT 243 #define CSS_VAL_OVERLINE 243
#define CSS_VAL_RELATIVE 244 #define CSS_VAL_PORTRAIT 244
#define CSS_VAL_SCROLL 245 #define CSS_VAL_RELATIVE 245
#define CSS_VAL_SEPARATE 246 #define CSS_VAL_SCROLL 246
#define CSS_VAL_SHOW 247 #define CSS_VAL_SEPARATE 247
#define CSS_VAL_STATIC 248 #define CSS_VAL_SHOW 248
#define CSS_VAL_THICK 249 #define CSS_VAL_STATIC 249
#define CSS_VAL_THIN 250 #define CSS_VAL_THICK 250
#define CSS_VAL_UNDERLINE 251 #define CSS_VAL_THIN 251
#define CSS_VAL__KHTML_NORMAL 252 #define CSS_VAL_UNDERLINE 252
#define CSS_VAL__KHTML_AROUND_FLOATS 253 #define CSS_VAL__KHTML_NORMAL 253
#define CSS_VAL_BORDER_BOX 254 #define CSS_VAL__KHTML_AROUND_FLOATS 254
#define CSS_VAL_CONTENT_BOX 255 #define CSS_VAL_BORDER_BOX 255
#define CSS_VAL_ENABLED 256 #define CSS_VAL_CONTENT_BOX 256
#define CSS_VAL_DISABLED 257 #define CSS_VAL_ENABLED 257
#define CSS_VAL_FORWARDS 258 #define CSS_VAL_DISABLED 258
#define CSS_VAL_BACKWARDS 259 #define CSS_VAL_FORWARDS 259
#define CSS_VAL_AHEAD 260 #define CSS_VAL_BACKWARDS 260
#define CSS_VAL_REVERSE 261 #define CSS_VAL_AHEAD 261
#define CSS_VAL_UP 262 #define CSS_VAL_REVERSE 262
#define CSS_VAL_DOWN 263 #define CSS_VAL_UP 263
#define CSS_VAL_SLOW 264 #define CSS_VAL_DOWN 264
#define CSS_VAL_FAST 265 #define CSS_VAL_SLOW 265
#define CSS_VAL_INFINITE 266 #define CSS_VAL_FAST 266
#define CSS_VAL_SLIDE 267 #define CSS_VAL_INFINITE 267
#define CSS_VAL_ALTERNATE 268 #define CSS_VAL_SLIDE 268
#define CSS_VAL_UNFURL 269 #define CSS_VAL_ALTERNATE 269
#define CSS_VAL_CLIP 270 #define CSS_VAL_UNFURL 270
#define CSS_VAL_ELLIPSIS 271 #define CSS_VAL_CLIP 271
#define CSS_VAL_BORDER 272 #define CSS_VAL_ELLIPSIS 272
#define CSS_VAL_CONTENT 273 #define CSS_VAL_BORDER 273
#define CSS_VAL_PADDING 274 #define CSS_VAL_CONTENT 274
#define CSS_VAL_PADDING 275
#define CSS_VAL_TOTAL 275 #define CSS_VAL_TOTAL 276
#endif #endif

@ -309,6 +309,11 @@ pre-wrap
pre-line pre-line
-khtml-nowrap -khtml-nowrap
# #
# CSS_PROP_WORD_WRAP
#
#normal
break-word
#
# Unordered rest # Unordered rest
# #
above above

@ -44,10 +44,10 @@ namespace khtml {
// an iterator which goes through a BidiParagraph // an iterator which goes through a BidiParagraph
struct BidiIterator struct BidiIterator
{ {
BidiIterator() : par(0), obj(0), pos(0) {} BidiIterator() : par(0), obj(0), pos(0), endOfInline(0) {}
BidiIterator(RenderBlock *_par, RenderObject *_obj, unsigned int _pos) : par(_par), obj(_obj), pos(_pos) {} BidiIterator(RenderBlock *_par, RenderObject *_obj, unsigned int _pos, bool eoi=false) : par(_par), obj(_obj), pos(_pos), endOfInline(eoi) {}
void increment( BidiState &bidi ); void increment( BidiState &bidi, bool skipInlines=true );
bool atEnd() const; bool atEnd() const;
@ -57,6 +57,7 @@ struct BidiIterator
RenderBlock *par; RenderBlock *par;
RenderObject *obj; RenderObject *obj;
unsigned int pos; unsigned int pos;
bool endOfInline;
}; };
@ -128,21 +129,6 @@ static int getBorderPaddingMargin(RenderObject* child, bool endOfInline)
return result; return result;
} }
static int inlineWidth(RenderObject* child, bool start = true, bool end = true)
{
int extraWidth = 0;
RenderObject* parent = child->parent();
while (parent->isInline() && !parent->isInlineBlockOrInlineTable()) {
if (start && parent->firstChild() == child)
extraWidth += getBorderPaddingMargin(parent, false);
if (end && parent->lastChild() == child)
extraWidth += getBorderPaddingMargin(parent, true);
child = parent;
parent = child->parent();
}
return extraWidth;
}
#ifndef NDEBUG #ifndef NDEBUG
static bool inBidiRunDetach; static bool inBidiRunDetach;
#endif #endif
@ -241,15 +227,19 @@ inline bool operator!=( const BidiIterator &it1, const BidiIterator &it2 )
return false; return false;
} }
// when modifying this function, make sure you check InlineMinMaxIterator::next() as well.
static inline RenderObject *Bidinext(RenderObject *par, RenderObject *current, BidiState &bidi, static inline RenderObject *Bidinext(RenderObject *par, RenderObject *current, BidiState &bidi,
bool skipInlines = true) bool skipInlines = true, bool *endOfInline = 0 )
{ {
RenderObject *next = 0; RenderObject *next = 0;
bool oldEndOfInline = endOfInline ? *endOfInline : false;
if (oldEndOfInline)
*endOfInline = false;
while(current != 0) while(current != 0)
{ {
//kdDebug( 6040 ) << "current = " << current << endl; //kdDebug( 6040 ) << "current = " << current << endl;
if (!current->isFloating() && !current->isReplaced() && !current->isPositioned()) { if (!oldEndOfInline && !current->isFloating() && !current->isReplaced() && !current->isPositioned()) {
next = current->firstChild(); next = current->firstChild();
if ( next && adjustEmbedding ) { if ( next && adjustEmbedding ) {
EUnicodeBidi ub = next->style()->unicodeBidi(); EUnicodeBidi ub = next->style()->unicodeBidi();
@ -262,6 +252,12 @@ static inline RenderObject *Bidinext(RenderObject *par, RenderObject *current, B
} }
} }
if (!next) { if (!next) {
if (!skipInlines && !oldEndOfInline && current->isInlineFlow() && endOfInline) {
next = current;
*endOfInline = true;
break;
}
while (current && current != par) { while (current && current != par) {
next = current->nextSibling(); next = current->nextSibling();
if (next) break; if (next) break;
@ -269,6 +265,11 @@ static inline RenderObject *Bidinext(RenderObject *par, RenderObject *current, B
embed( TQChar::DirPDF, bidi ); embed( TQChar::DirPDF, bidi );
} }
current = current->parent(); current = current->parent();
if (!skipInlines && current && current != par && current->isInlineFlow() && endOfInline) {
next = current;
*endOfInline = true;
break;
}
} }
} }
@ -300,17 +301,17 @@ static RenderObject *first( RenderObject *par, BidiState &bidi, bool skipInlines
return o; return o;
} }
inline void BidiIterator::increment (BidiState &bidi) inline void BidiIterator::increment (BidiState &bidi, bool skipInlines)
{ {
if(!obj) return; if(!obj) return;
if(obj->isText()) { if(obj->isText()) {
pos++; pos++;
if(pos >= static_cast<RenderText *>(obj)->stringLength()) { if(pos >= static_cast<RenderText *>(obj)->stringLength()) {
obj = Bidinext( par, obj, bidi ); obj = Bidinext( par, obj, bidi, skipInlines );
pos = 0; pos = 0;
} }
} else { } else {
obj = Bidinext( par, obj, bidi ); obj = Bidinext( par, obj, bidi, skipInlines, &endOfInline );
pos = 0; pos = 0;
} }
} }
@ -1322,45 +1323,6 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator
#endif #endif
} }
#ifdef APPLE_CHANGES // KDE handles compact blocks differently
static void buildCompactRuns(RenderObject* compactObj, BidiState &bidi)
{
sBuildingCompactRuns = true;
if (!compactObj->isRenderBlock()) {
// Just append a run for our object.
isLineEmpty = false;
addRun(new (compactObj->renderArena()) BidiRun(0, compactObj->length(), compactObj, bidi.context, dir));
}
else {
// Format the compact like it is its own single line. We build up all the runs for
// the little compact and then reorder them for bidi.
RenderBlock* compactBlock = static_cast<RenderBlock*>(compactObj);
adjustEmbedding = true;
BidiIterator start(compactBlock, first(compactBlock, bidi), 0);
adjustEmbedding = false;
BidiIterator end = start;
betweenMidpoints = false;
isLineEmpty = true;
previousLineBrokeAtBR = true;
end = compactBlock->findNextLineBreak(start, bidi);
if (!isLineEmpty)
compactBlock->bidiReorderLine(start, end, bidi);
}
sCompactFirstBidiRun = sFirstBidiRun;
sCompactLastBidiRun = sLastBidiRun;
sCompactBidiRunCount = sBidiRunCount;
sNumMidpoints = 0;
sCurrMidpoint = 0;
betweenMidpoints = false;
sBuildingCompactRuns = false;
}
#endif
void RenderBlock::layoutInlineChildren(bool relayoutChildren, int breakBeforeLine) void RenderBlock::layoutInlineChildren(bool relayoutChildren, int breakBeforeLine)
{ {
BidiState bidi; BidiState bidi;
@ -1470,13 +1432,6 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int breakBeforeLin
oldStart = start; oldStart = start;
oldBidi = bidi; oldBidi = bidi;
} }
#ifdef APPLE_CHANGES // KDE handles compact blocks differently
if (m_firstLine && firstChild() && firstChild()->isCompact()) {
buildCompactRuns(firstChild(), bidi);
start.obj = firstChild()->nextSibling();
end = start;
}
#endif
if (lineCount == breakBeforeLine) { if (lineCount == breakBeforeLine) {
m_height = pageTopAfter(oldPos); m_height = pageTopAfter(oldPos);
pagebreakHint = true; pagebreakHint = true;
@ -1491,15 +1446,6 @@ redo_linebreak:
// At the same time we figure out where border/padding/margin should be applied for // At the same time we figure out where border/padding/margin should be applied for
// inline flow boxes. // inline flow boxes.
#ifdef APPLE_CHANGES // KDE handles compact blocks differently
if (sCompactFirstBidiRun) {
// We have a compact line sharing this line. Link the compact runs
// to our runs to create a single line of runs.
sCompactLastBidiRun->nextRun = sFirstBidiRun;
sFirstBidiRun = sCompactFirstBidiRun;
sBidiRunCount += sCompactBidiRunCount;
}
#endif
if (sBidiRunCount) { if (sBidiRunCount) {
InlineFlowBox* lineBox = constructLine(start, end); InlineFlowBox* lineBox = constructLine(start, end);
if (lineBox) { if (lineBox) {
@ -1698,7 +1644,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
} }
} }
adjustEmbedding = true; adjustEmbedding = true;
start.increment(bidi); start.increment(bidi, false /*skipInlines*/);
adjustEmbedding = false; adjustEmbedding = false;
} }
@ -1714,6 +1660,11 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
return start; return start;
} }
// This variable says we have encountered an object after which initial whitespace should be ignored (e.g. InlineFlows at the begining of a line).
// Either we have nothing to do, if there is no whitespace after the object... or we have to enter the ignoringSpaces state.
// This dilemma will be resolved when we have a peek at the next object.
bool checkShouldIgnoreInitialWhitespace = false;
// This variable is used only if whitespace isn't set to PRE, and it tells us whether // This variable is used only if whitespace isn't set to PRE, and it tells us whether
// or not we are currently ignoring whitespace. // or not we are currently ignoring whitespace.
bool ignoringSpaces = false; bool ignoringSpaces = false;
@ -1727,13 +1678,14 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
BidiIterator lBreak = start; BidiIterator lBreak = start;
RenderObject *o = start.obj; InlineMinMaxIterator it(start.par, start.obj, start.endOfInline, false /*skipPositioned*/);
RenderObject *last = o; InlineMinMaxIterator lastIt = it;
int pos = start.pos; int pos = start.pos;
bool prevLineBrokeCleanly = previousLineBrokeAtBR; bool prevLineBrokeCleanly = previousLineBrokeAtBR;
previousLineBrokeAtBR = false; previousLineBrokeAtBR = false;
RenderObject* o = it.current;
while( o ) { while( o ) {
#ifdef DEBUG_LINEBREAKS #ifdef DEBUG_LINEBREAKS
kdDebug(6041) << "new object "<< o <<" width = " << w <<" tmpw = " << tmpW << endl; kdDebug(6041) << "new object "<< o <<" width = " << w <<" tmpw = " << tmpW << endl;
@ -1742,6 +1694,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
if( w + tmpW <= width ) { if( w + tmpW <= width ) {
lBreak.obj = o; lBreak.obj = o;
lBreak.pos = 0; lBreak.pos = 0;
lBreak.endOfInline = it.endOfInline;
// A <br> always breaks a line, so don't let the line be collapsed // A <br> always breaks a line, so don't let the line be collapsed
// away. Also, the space at the end of a line with a <br> does not // away. Also, the space at the end of a line with a <br> does not
@ -1792,13 +1745,22 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
} }
} }
} else if (o->isInlineFlow()) { } else if (o->isInlineFlow()) {
// Only empty inlines matter. We treat those similarly to replaced elements. tmpW += getBorderPaddingMargin(o, it.endOfInline);
KHTMLAssert(!o->firstChild()); if (isLineEmpty) isLineEmpty = !tmpW;
tmpW += o->marginLeft()+o->borderLeft()+o->paddingLeft()+ if (o->isWordBreak()) { // #### shouldn't be an InlineFlow!
o->marginRight()+o->borderRight()+o->paddingRight(); w += tmpW;
tmpW = 0;
lBreak.obj = o;
lBreak.pos = 0;
lBreak.endOfInline = it.endOfInline;
} else if (!it.endOfInline) {
// this is the beginning of the line (other non-initial inline flows are handled directly when
// incrementing the iterator below). We want to skip initial whitespace as much as possible.
checkShouldIgnoreInitialWhitespace = true;
}
} else if ( o->isReplaced() || o->isGlyph() ) { } else if ( o->isReplaced() || o->isGlyph() ) {
EWhiteSpace currWS = o->style()->whiteSpace(); EWhiteSpace currWS = o->style()->whiteSpace();
EWhiteSpace lastWS = last->style()->whiteSpace(); EWhiteSpace lastWS = lastIt.current->style()->whiteSpace();
// WinIE marquees have different whitespace characteristics by default when viewed from // WinIE marquees have different whitespace characteristics by default when viewed from
// the outside vs. the inside. Text inside is NOWRAP, and so we altered the marquee's // the outside vs. the inside. Text inside is NOWRAP, and so we altered the marquee's
@ -1806,8 +1768,8 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
// for the marquee when checking for line breaking. // for the marquee when checking for line breaking.
if (o->isHTMLMarquee() && o->layer() && o->layer()->marquee()) if (o->isHTMLMarquee() && o->layer() && o->layer()->marquee())
currWS = o->layer()->marquee()->whiteSpace(); currWS = o->layer()->marquee()->whiteSpace();
if (last->isHTMLMarquee() && last->layer() && last->layer()->marquee()) if (lastIt.current->isHTMLMarquee() && lastIt.current->layer() && lastIt.current->layer()->marquee())
lastWS = last->layer()->marquee()->whiteSpace(); lastWS = lastIt.current->layer()->marquee()->whiteSpace();
// Break on replaced elements if either has normal white-space. // Break on replaced elements if either has normal white-space.
if (currWS == NORMAL || lastWS == NORMAL) { if (currWS == NORMAL || lastWS == NORMAL) {
@ -1815,9 +1777,10 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
tmpW = 0; tmpW = 0;
lBreak.obj = o; lBreak.obj = o;
lBreak.pos = 0; lBreak.pos = 0;
lBreak.endOfInline = false;
} }
tmpW += o->width()+o->marginLeft()+o->marginRight()+inlineWidth(o); tmpW += o->width()+o->marginLeft()+o->marginRight();
if (ignoringSpaces) { if (ignoringSpaces) {
BidiIterator startMid( 0, o, 0 ); BidiIterator startMid( 0, o, 0 );
addMidpoint(startMid); addMidpoint(startMid);
@ -1828,21 +1791,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
trailingSpaceObject = 0; trailingSpaceObject = 0;
if (o->isListMarker() && o->style()->listStylePosition() == OUTSIDE) { if (o->isListMarker() && o->style()->listStylePosition() == OUTSIDE) {
// The marker must not have an effect on whitespace at the start checkShouldIgnoreInitialWhitespace = true;
// of the line. We start ignoring spaces to make sure that any additional
// spaces we see will be discarded.
//
// Optimize for a common case. If we can't find whitespace after the list
// item, then this is all moot. -dwh
RenderObject* next = Bidinext( start.par, o, bidi );
if (!style()->preserveWS() && next && next->isText() && static_cast<RenderText*>(next)->stringLength() > 0 &&
(static_cast<RenderText*>(next)->text()[0].category() == TQChar::Separator_Space ||
static_cast<RenderText*>(next)->text()[0] == '\n')) {
currentCharacterIsSpace = true;
ignoringSpaces = true;
BidiIterator endMid( 0, o, 0 );
addMidpoint(endMid);
}
} }
} else if ( o->isText() ) { } else if ( o->isText() ) {
RenderText *t = static_cast<RenderText *>(o); RenderText *t = static_cast<RenderText *>(o);
@ -1859,10 +1808,8 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
#ifdef APPLE_CHANGES #ifdef APPLE_CHANGES
int wordSpacing = o->style()->wordSpacing(); int wordSpacing = o->style()->wordSpacing();
#endif #endif
bool appliedStartWidth = pos > 0; // If the span originated on a previous line,
// then assume the start width has been applied.
bool appliedEndWidth = false;
bool nextIsSoftBreakable = false; bool nextIsSoftBreakable = false;
bool checkBreakWord = autoWrap && (o->style()->wordWrap() == WWBREAKWORD);
while(len) { while(len) {
bool previousCharacterIsSpace = currentCharacterIsSpace; bool previousCharacterIsSpace = currentCharacterIsSpace;
@ -1870,6 +1817,8 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
nextIsSoftBreakable = false; nextIsSoftBreakable = false;
const TQChar c = str[pos]; const TQChar c = str[pos];
currentCharacterIsSpace = c == ' '; currentCharacterIsSpace = c == ' ';
checkBreakWord &= !w; // only break words when no other breaking opportunity exists earlier
// on the line (even within the text object we are currently processing)
if (preserveWS || !currentCharacterIsSpace) if (preserveWS || !currentCharacterIsSpace)
isLineEmpty = false; isLineEmpty = false;
@ -1921,13 +1870,11 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
} }
} }
if ( (preserveLF && c == '\n') || (autoWrap && (isBreakable( str, pos, strlen ) || isSoftBreakable)) ) { const bool isbreakablePosition = (preserveLF && c == '\n') || (autoWrap &&
(isBreakable( str, pos, strlen ) || isSoftBreakable));
if ( isbreakablePosition || checkBreakWord ) {
tmpW += t->width(lastSpace, pos - lastSpace, f); tmpW += t->width(lastSpace, pos - lastSpace, f);
if (!appliedStartWidth) {
tmpW += inlineWidth(o, true, false);
appliedStartWidth = true;
}
#ifdef APPLE_CHANGES #ifdef APPLE_CHANGES
applyWordSpacing = (wordSpacing && currentCharacterIsSpace && !previousCharacterIsSpace && applyWordSpacing = (wordSpacing && currentCharacterIsSpace && !previousCharacterIsSpace &&
!t->containsOnlyWhitespace(pos+1, strlen-(pos+1))); !t->containsOnlyWhitespace(pos+1, strlen-(pos+1)));
@ -1957,9 +1904,14 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
} }
if (autoWrap) { if (autoWrap) {
if (w+tmpW > width) if (w+tmpW > width) {
if (checkBreakWord && pos) {
lBreak.obj = o;
lBreak.pos = pos-1;
lBreak.endOfInline = false;
}
goto end; goto end;
else if ( (pos > 1 && str[pos-1].unicode() == SOFT_HYPHEN) ) } else if ( (pos > 1 && str[pos-1].unicode() == SOFT_HYPHEN) )
// Subtract the width of the soft hyphen out since we fit on a line. // Subtract the width of the soft hyphen out since we fit on a line.
tmpW -= t->width(pos-1, 1, f); tmpW -= t->width(pos-1, 1, f);
} }
@ -1967,6 +1919,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
if( preserveLF && *(str+pos) == '\n' ) { if( preserveLF && *(str+pos) == '\n' ) {
lBreak.obj = o; lBreak.obj = o;
lBreak.pos = pos; lBreak.pos = pos;
lBreak.endOfInline = false;
#ifdef DEBUG_LINEBREAKS #ifdef DEBUG_LINEBREAKS
kdDebug(6041) << "forced break sol: " << start.obj << " " << start.pos << " end: " << lBreak.obj << " " << lBreak.pos << " width=" << w << endl; kdDebug(6041) << "forced break sol: " << start.obj << " " << start.pos << " end: " << lBreak.obj << " " << lBreak.pos << " width=" << w << endl;
@ -1974,11 +1927,12 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
return lBreak; return lBreak;
} }
if ( autoWrap ) { if ( autoWrap && isbreakablePosition ) {
w += tmpW; w += tmpW;
tmpW = 0; tmpW = 0;
lBreak.obj = o; lBreak.obj = o;
lBreak.pos = pos; lBreak.pos = pos;
lBreak.endOfInline = false;
} }
lastSpace = pos; lastSpace = pos;
@ -2016,31 +1970,63 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
len--; len--;
} }
// IMPORTANT: pos is > length here! if (!ignoringSpaces) {
if (!ignoringSpaces) // We didn't find any space that would be beyond the line |width|.
// Lets add to |tmpW| the remaining width since the last space we found.
// Before we test this new |tmpW| however, we will have to look ahead to check
// if the next object/position can serve as a line breaking opportunity.
tmpW += t->width(lastSpace, pos - lastSpace, f); tmpW += t->width(lastSpace, pos - lastSpace, f);
if (!appliedStartWidth) if (checkBreakWord && !w && pos && tmpW > width) {
tmpW += inlineWidth(o, true, false); // Avoid doing the costly lookahead for break-word,
if (!appliedEndWidth) // since we know we are allowed to break.
tmpW += inlineWidth(o, false, true); lBreak.obj = o;
lBreak.pos = pos-1;
lBreak.endOfInline = false;
goto end;
}
}
} else } else
KHTMLAssert( false ); KHTMLAssert( false );
RenderObject* next = Bidinext(start.par, o, bidi); InlineMinMaxIterator savedIt = lastIt;
bool autoWrap = o->style()->autoWrap(); lastIt = it;
o = it.next();
// advance the iterator to the next non-inline-flow
while (o && o->isInlineFlow() && !o->isWordBreak()) {
tmpW += getBorderPaddingMargin(o, it.endOfInline);
if (isLineEmpty) isLineEmpty = !tmpW;
o = it.next();
}
if (checkShouldIgnoreInitialWhitespace) {
// Check if we should switch to ignoringSpaces state
if (!style()->preserveWS() && it.current && it.current->isText()) {
const RenderText* rt = static_cast<RenderText*>(it.current);
if (rt->stringLength() > 0 && (rt->text()[0].category() == TQChar::Separator_Space || rt->text()[0] == '\n')) {
currentCharacterIsSpace = true;
ignoringSpaces = true;
BidiIterator endMid( 0, lastIt.current, 0 );
addMidpoint(endMid);
}
}
checkShouldIgnoreInitialWhitespace = false;
}
bool autoWrap = lastIt.current->style()->autoWrap();
bool checkForBreak = autoWrap; bool checkForBreak = autoWrap;
if (w && w + tmpW > width && lBreak.obj && !o->style()->preserveLF() && !autoWrap) if (w && w + tmpW > width && lBreak.obj && !lastIt.current->style()->preserveLF() && !autoWrap)
checkForBreak = true; checkForBreak = true;
else if (next && o->isText() && next->isText() && !next->isBR()) { else if (it.current && lastIt.current->isText() && it.current->isText() && !it.current->isBR()) {
if (autoWrap || next->style()->autoWrap()) { if (autoWrap || it.current->style()->autoWrap()) {
if (currentCharacterIsSpace) if (currentCharacterIsSpace)
checkForBreak = true; checkForBreak = true;
else { else {
checkForBreak = false; checkForBreak = false;
RenderText* nextText = static_cast<RenderText*>(next); RenderText* nextText = static_cast<RenderText*>(it.current);
if (nextText->stringLength() != 0) { if (nextText->stringLength() != 0) {
TQChar c = nextText->text()[0]; TQChar c = nextText->text()[0];
if (c == ' ' || c == '\t' || (c == '\n' && !next->style()->preserveLF())) { if (c == ' ' || c == '\t' || (c == '\n' && !it.current->style()->preserveLF())) {
// If the next item on the line is text, and if we did not end with // If the next item on the line is text, and if we did not end with
// a space, then the next text run continues our word (and so it needs to // a space, then the next text run continues our word (and so it needs to
// keep adding to |tmpW|. Just update and continue. // keep adding to |tmpW|. Just update and continue.
@ -2052,8 +2038,9 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
if (canPlaceOnLine && checkForBreak) { if (canPlaceOnLine && checkForBreak) {
w += tmpW; w += tmpW;
tmpW = 0; tmpW = 0;
lBreak.obj = next; lBreak.obj = it.current;
lBreak.pos = 0; lBreak.pos = 0;
lBreak.endOfInline = it.endOfInline;
} }
} }
} }
@ -2063,7 +2050,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
//kdDebug() << " too wide w=" << w << " tmpW = " << tmpW << " width = " << width << endl; //kdDebug() << " too wide w=" << w << " tmpW = " << tmpW << " width = " << width << endl;
//kdDebug() << "start=" << start.obj << " current=" << o << endl; //kdDebug() << "start=" << start.obj << " current=" << o << endl;
// if we have floats, try to get below them. // if we have floats, try to get below them.
if (currentCharacterIsSpace && !ignoringSpaces && !o->style()->preserveWS()) if (currentCharacterIsSpace && !ignoringSpaces && !lastIt.current->style()->preserveWS())
trailingSpaceObject = 0; trailingSpaceObject = 0;
int fb = nearestFloatBottom(m_height); int fb = nearestFloatBottom(m_height);
@ -2087,24 +2074,26 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
// |width| may have been adjusted because we got shoved down past a float (thus // |width| may have been adjusted because we got shoved down past a float (thus
// giving us more room), so we need to retest, and only jump to // giving us more room), so we need to retest, and only jump to
// the end label if we still don't fit on the line. -dwh // the end label if we still don't fit on the line. -dwh
if (w + tmpW > width) if (w + tmpW > width) {
it = lastIt;
lastIt = savedIt;
o = it.current;
goto end; goto end;
}
} }
last = o; if (!lastIt.current->isFloatingOrPositioned() && lastIt.current->isReplaced() && lastIt.current->style()->autoWrap()) {
o = next;
if (!last->isFloatingOrPositioned() && last->isReplaced() && last->style()->autoWrap()) {
// Go ahead and add in tmpW. // Go ahead and add in tmpW.
w += tmpW; w += tmpW;
tmpW = 0; tmpW = 0;
lBreak.obj = o; lBreak.obj = o;
lBreak.pos = 0; lBreak.pos = 0;
lBreak.endOfInline = it.endOfInline;
} }
// Clear out our character space bool, since inline <pre>s don't collapse whitespace // Clear out our character space bool, since inline <pre>s don't collapse whitespace
// with adjacent inline normal/nowrap spans. // with adjacent inline normal/nowrap spans.
if (last->style()->preserveWS()) if (lastIt.current->style()->preserveWS())
currentCharacterIsSpace = false; currentCharacterIsSpace = false;
pos = 0; pos = 0;
@ -2113,9 +2102,10 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
#ifdef DEBUG_LINEBREAKS #ifdef DEBUG_LINEBREAKS
kdDebug( 6041 ) << "end of par, width = " << width << " linewidth = " << w + tmpW << endl; kdDebug( 6041 ) << "end of par, width = " << width << " linewidth = " << w + tmpW << endl;
#endif #endif
if( w + tmpW <= width || (last && !last->style()->autoWrap())) { if( w + tmpW <= width || (lastIt.current && !lastIt.current->style()->autoWrap())) {
lBreak.obj = 0; lBreak.obj = 0;
lBreak.pos = 0; lBreak.pos = 0;
lBreak.endOfInline = false;
} }
end: end:
@ -2127,21 +2117,25 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
if(pos != 0) { if(pos != 0) {
lBreak.obj = o; lBreak.obj = o;
lBreak.pos = pos - 1; lBreak.pos = pos - 1;
lBreak.endOfInline = it.endOfInline;
} else { } else {
lBreak.obj = last; lBreak.obj = lastIt.current;
lBreak.pos = last->isText() ? last->length() : 0; lBreak.pos = lastIt.current->isText() ? lastIt.current->length() : 0;
lBreak.endOfInline = lastIt.endOfInline;
} }
} else if( lBreak.obj ) { } else if( lBreak.obj ) {
if( last != o ) { if( lastIt.current != o ) {
// better to break between object boundaries than in the middle of a word // better to break between object boundaries than in the middle of a word
lBreak.obj = o; lBreak.obj = o;
lBreak.pos = 0; lBreak.pos = 0;
lBreak.endOfInline = it.endOfInline;
} else { } else {
// Don't ever break in the middle of a word if we can help it. // Don't ever break in the middle of a word if we can help it.
// There's no room at all. We just have to be on this line, // There's no room at all. We just have to be on this line,
// even though we'll spill out. // even though we'll spill out.
lBreak.obj = o; lBreak.obj = o;
lBreak.pos = pos; lBreak.pos = pos;
lBreak.endOfInline = it.endOfInline;
} }
} }
} }
@ -2150,8 +2144,11 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
start = posStart; start = posStart;
// make sure we consume at least one char/object. // make sure we consume at least one char/object.
if( lBreak == start ) // and avoid returning an InlineFlow
// (FIXME: turn those wordbreaks into empty text objects - they shouldn't be inline flows!)
if( lBreak == start || (lBreak.obj && lBreak.obj->isInlineFlow() && !lBreak.obj->isWordBreak())) {
lBreak.increment(bidi); lBreak.increment(bidi);
}
#ifdef DEBUG_LINEBREAKS #ifdef DEBUG_LINEBREAKS
kdDebug(6041) << "regular break sol: " << start.obj << " " << start.pos << " end: " << lBreak.obj << " " << lBreak.pos << " width=" << w << endl; kdDebug(6041) << "regular break sol: " << start.obj << " " << start.pos << " end: " << lBreak.obj << " " << lBreak.pos << " width=" << w << endl;

@ -24,6 +24,7 @@
#define BIDI_H #define BIDI_H
#include <tqstring.h> #include <tqstring.h>
#include "rendering/render_object.h"
namespace khtml { namespace khtml {
class RenderArena; class RenderArena;
@ -101,6 +102,71 @@ public:
struct BidiIterator; struct BidiIterator;
struct BidiState; struct BidiState;
struct InlineMinMaxIterator
{
/* InlineMinMaxIterator is a class that will iterate over all render objects that contribute to
inline min/max width calculations. Note the following about the way it walks:
(1) Positioned content is skipped (since it does not contribute to min/max width of a block)
(2) We do not drill into the children of floats or replaced elements, since you can't break
in the middle of such an element.
(3) Inline flows (e.g., <a>, <span>, <i>) are walked twice, since each side can have
distinct borders/margin/padding that contribute to the min/max width.
*/
RenderObject* parent;
RenderObject* current;
bool endOfInline;
bool skipPositioned;
InlineMinMaxIterator(RenderObject* p, RenderObject* o, bool eOI=false, bool skipPos=true)
:parent(p), current(o), endOfInline(eOI), skipPositioned(skipPos) {}
inline RenderObject* next();
};
inline RenderObject* InlineMinMaxIterator::next()
{
RenderObject* result = 0;
bool oldEndOfInline = endOfInline;
endOfInline = false;
while (current != 0 || (current == parent))
{
//kDebug( 6040 ) << "current = " << current;
if (!oldEndOfInline &&
(current == parent ||
(!current->isFloating() && !current->isReplaced() && !current->isPositioned())))
result = current->firstChild();
if (!result) {
// We hit the end of our inline. (It was empty, e.g., <span></span>.)
if (!oldEndOfInline && current->isInlineFlow()) {
result = current;
endOfInline = true;
break;
}
while (current && current != parent) {
result = current->nextSibling();
if (result) break;
current = current->parent();
if (current && current != parent && current->isInlineFlow()) {
result = current;
endOfInline = true;
break;
}
}
}
if (!result) break;
if ((!skipPositioned || !result->isPositioned()) && (result->isText() || result->isBR() ||
result->isFloatingOrPositioned() || result->isReplaced() || result->isGlyph() || result->isInlineFlow()))
break;
current = result;
result = 0;
}
// Update our position.
current = result;
return current;
}
} }
#endif #endif

@ -2623,74 +2623,6 @@ void RenderBlock::calcMinMaxWidth()
// ### compare with min/max width set in style sheet... // ### compare with min/max width set in style sheet...
} }
struct InlineMinMaxIterator
{
/* InlineMinMaxIterator is a class that will iterate over all render objects that contribute to
inline min/max width calculations. Note the following about the way it walks:
(1) Positioned content is skipped (since it does not contribute to min/max width of a block)
(2) We do not drill into the children of floats or replaced elements, since you can't break
in the middle of such an element.
(3) Inline flows (e.g., <a>, <span>, <i>) are walked twice, since each side can have
distinct borders/margin/padding that contribute to the min/max width.
*/
RenderObject* parent;
RenderObject* current;
bool endOfInline;
InlineMinMaxIterator(RenderObject* p, RenderObject* o, bool end = false)
:parent(p), current(o), endOfInline(end) {}
RenderObject* next();
};
RenderObject* InlineMinMaxIterator::next()
{
RenderObject* result = 0;
bool oldEndOfInline = endOfInline;
endOfInline = false;
while (current != 0 || (current == parent))
{
//kdDebug( 6040 ) << "current = " << current << endl;
if (!oldEndOfInline &&
(current == parent ||
(!current->isFloating() && !current->isReplaced() && !current->isPositioned())))
result = current->firstChild();
if (!result) {
// We hit the end of our inline. (It was empty, e.g., <span></span>.)
if (!oldEndOfInline && current->isInlineFlow()) {
result = current;
endOfInline = true;
break;
}
while (current && current != parent) {
result = current->nextSibling();
if (result) break;
current = current->parent();
if (current && current != parent && current->isInlineFlow()) {
result = current;
endOfInline = true;
break;
}
}
}
if (!result) break;
if (!result->isPositioned() && (result->isText() || result->isBR() ||
result->isFloating() || result->isReplaced() ||
result->isInlineFlow()))
break;
current = result;
result = 0;
}
// Update our position.
current = result;
return current;
}
// bidi.cpp defines the following functions too. // bidi.cpp defines the following functions too.
// Maybe these should not be static, after all... // Maybe these should not be static, after all...

@ -271,8 +271,8 @@ bool InlineFlowBox::onEndChain(RenderObject* endObject)
RenderObject* curr = endObject; RenderObject* curr = endObject;
RenderObject* parent = curr->parent(); RenderObject* parent = curr->parent();
while (parent && !parent->isRenderBlock() || parent == object()) { while (parent && !parent->isRenderBlock()) {
if (parent->lastChild() != curr) if (parent->lastChild() != curr || parent == object())
return false; return false;
curr = parent; curr = parent;

@ -244,6 +244,11 @@ bool RenderObject::isHR() const
return element() && element()->id() == ID_HR; return element() && element()->id() == ID_HR;
} }
bool RenderObject::isWordBreak() const
{
return element() && element()->id() == ID_WBR;
}
bool RenderObject::isHTMLMarquee() const bool RenderObject::isHTMLMarquee() const
{ {
return element() && element()->renderer() == this && element()->id() == ID_MARQUEE; return element() && element()->renderer() == this && element()->id() == ID_MARQUEE;

@ -282,6 +282,7 @@ public:
virtual bool isApplet() const { return false; } virtual bool isApplet() const { return false; }
bool isHTMLMarquee() const; bool isHTMLMarquee() const;
bool isWordBreak() const;
bool isAnonymous() const { return m_isAnonymous; } bool isAnonymous() const { return m_isAnonymous; }
void setIsAnonymous(bool b) { m_isAnonymous = b; } void setIsAnonymous(bool b) { m_isAnonymous = b; }

@ -429,7 +429,7 @@ bool StyleCSS3NonInheritedData::operator==(const StyleCSS3NonInheritedData& o) c
} }
StyleCSS3InheritedData::StyleCSS3InheritedData() StyleCSS3InheritedData::StyleCSS3InheritedData()
:Shared<StyleCSS3InheritedData>(), textShadow(0) :Shared<StyleCSS3InheritedData>(), textShadow(0), wordWrap(RenderStyle::initialWordWrap())
#ifdef APPLE_CHANGES #ifdef APPLE_CHANGES
, userModify(READ_ONLY), textSizeAdjust(RenderStyle::initialTextSizeAdjust()) , userModify(READ_ONLY), textSizeAdjust(RenderStyle::initialTextSizeAdjust())
#endif #endif
@ -441,6 +441,7 @@ StyleCSS3InheritedData::StyleCSS3InheritedData(const StyleCSS3InheritedData& o)
:Shared<StyleCSS3InheritedData>() :Shared<StyleCSS3InheritedData>()
{ {
textShadow = o.textShadow ? new ShadowData(*o.textShadow) : 0; textShadow = o.textShadow ? new ShadowData(*o.textShadow) : 0;
wordWrap = o.wordWrap;
#ifdef APPLE_CHANGES #ifdef APPLE_CHANGES
userModify = o.userModify; userModify = o.userModify;
textSizeAdjust = o.textSizeAdjust; textSizeAdjust = o.textSizeAdjust;
@ -454,7 +455,7 @@ StyleCSS3InheritedData::~StyleCSS3InheritedData()
bool StyleCSS3InheritedData::operator==(const StyleCSS3InheritedData& o) const bool StyleCSS3InheritedData::operator==(const StyleCSS3InheritedData& o) const
{ {
return shadowDataEquivalent(o) return shadowDataEquivalent(o) && (wordWrap == o.wordWrap)
#ifdef APPLE_CHANGES #ifdef APPLE_CHANGES
&& (userModify == o.userModify) && (textSizeAdjust == o.textSizeAdjust) && (userModify == o.userModify) && (textSizeAdjust == o.textSizeAdjust)
#endif #endif

@ -192,6 +192,9 @@ enum EFloat {
FNONE = 0, FLEFT = 0x01, FRIGHT = 0x02, FLEFT_ALIGN = 0x05, FRIGHT_ALIGN = 0x06 FNONE = 0, FLEFT = 0x01, FRIGHT = 0x02, FLEFT_ALIGN = 0x05, FRIGHT_ALIGN = 0x06
}; };
enum EWordWrap {
WWNORMAL = 0, WWBREAKWORD = 0x01
};
//------------------------------------------------ //------------------------------------------------
// Border attributes. Not inherited. // Border attributes. Not inherited.
@ -702,6 +705,7 @@ class StyleCSS3InheritedData : public Shared<StyleCSS3InheritedData>
EUserModify userModify : 2; // Flag used for editing state EUserModify userModify : 2; // Flag used for editing state
bool textSizeAdjust : 1; // An Apple extension. Not really CSS3 but not worth making a new struct over. bool textSizeAdjust : 1; // An Apple extension. Not really CSS3 but not worth making a new struct over.
#endif #endif
EWordWrap wordWrap : 1;
private: private:
StyleCSS3InheritedData &operator=(const StyleCSS3InheritedData &); StyleCSS3InheritedData &operator=(const StyleCSS3InheritedData &);
}; };
@ -1195,6 +1199,7 @@ public:
return background->m_outline._offset; return background->m_outline._offset;
} }
ShadowData* textShadow() const { return css3InheritedData->textShadow; } ShadowData* textShadow() const { return css3InheritedData->textShadow; }
EWordWrap wordWrap() const { return css3InheritedData->wordWrap; }
float opacity() { return css3NonInheritedData->opacity; } float opacity() { return css3NonInheritedData->opacity; }
EUserInput userInput() const { return inherited_flags.f._user_input; } EUserInput userInput() const { return inherited_flags.f._user_input; }
@ -1346,6 +1351,7 @@ public:
// CSS3 Setters // CSS3 Setters
void setBoxSizing( EBoxSizing b ) { SET_VAR(box,box_sizing,b); } void setBoxSizing( EBoxSizing b ) { SET_VAR(box,box_sizing,b); }
void setOutlineOffset(unsigned short v) { SET_VAR(background,m_outline._offset,v) } void setOutlineOffset(unsigned short v) { SET_VAR(background,m_outline._offset,v) }
void setWordWrap(EWordWrap w) { SET_VAR(css3InheritedData, wordWrap, w); }
void setTextShadow(ShadowData* val, bool add=false); void setTextShadow(ShadowData* val, bool add=false);
void setOpacity(float f) { SET_VAR(css3NonInheritedData, opacity, f); } void setOpacity(float f) { SET_VAR(css3NonInheritedData, opacity, f); }
void setUserInput(EUserInput ui) { inherited_flags.f._user_input = ui; } void setUserInput(EUserInput ui) { inherited_flags.f._user_input = ui; }
@ -1424,6 +1430,7 @@ public:
static EDisplay initialDisplay() { return INLINE; } static EDisplay initialDisplay() { return INLINE; }
static EEmptyCell initialEmptyCells() { return SHOW; } static EEmptyCell initialEmptyCells() { return SHOW; }
static EFloat initialFloating() { return FNONE; } static EFloat initialFloating() { return FNONE; }
static EWordWrap initialWordWrap() { return WWNORMAL; }
static EListStylePosition initialListStylePosition() { return OUTSIDE; } static EListStylePosition initialListStylePosition() { return OUTSIDE; }
static EListStyleType initialListStyleType() { return LDISC; } static EListStyleType initialListStyleType() { return LDISC; }
static EOverflow initialOverflowX() { return OVISIBLE; } static EOverflow initialOverflowX() { return OVISIBLE; }

Loading…
Cancel
Save