Changeset 159192 in webkit
- Timestamp:
- Nov 13, 2013 5:25:32 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r159183 r159192 1 2013-11-12 Antti Koivisto <antti@apple.com> 2 3 Support overflow-wrap:break-word on simple line path 4 https://bugs.webkit.org/show_bug.cgi?id=124206 5 6 Reviewed by Andreas Kling. 7 8 Force these to use line boxes, add ref test versions comparing the paths. 9 10 * fast/forms/basic-textareas-quirks-simple-lines-expected.html: Added. 11 * fast/forms/basic-textareas-quirks-simple-lines.html: Added. 12 * fast/forms/basic-textareas-quirks.html: 13 * fast/forms/linebox-overflow-in-textarea-padding-simple-lines-expected.html: Added. 14 * fast/forms/linebox-overflow-in-textarea-padding-simple-lines.html: Added. 15 * fast/forms/linebox-overflow-in-textarea-padding.html: 16 * fast/forms/negativeLineHeight-simple-lines-expected.html: Added. 17 * fast/forms/negativeLineHeight-simple-lines.html: Added. 18 * fast/forms/negativeLineHeight.html: 19 * fast/forms/textAreaLineHeight-simple-lines-expected.html: Added. 20 * fast/forms/textAreaLineHeight-simple-lines.html: Added. 21 * fast/forms/textAreaLineHeight.html: 22 * fast/parser/entity-comment-in-textarea.html: Made this independent of line layout mode. 23 * fast/replaced/width100percent-textarea.html: 24 * platform/mac/fast/parser/entity-comment-in-textarea-expected.txt: 25 1 26 2013-11-13 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> 2 27 -
trunk/LayoutTests/fast/forms/basic-textareas-quirks.html
r52502 r159192 1 <script> 2 if (window.internals) 3 internals.settings.setSimpleLineLayoutEnabled(false); 4 </script> 1 5 <html><head><style> 2 6 div { -
trunk/LayoutTests/fast/forms/linebox-overflow-in-textarea-padding.html
r41690 r159192 1 <script> 2 if (window.internals) 3 internals.settings.setSimpleLineLayoutEnabled(false); 4 </script> 1 5 <style> 2 6 textarea, #foo { -
trunk/LayoutTests/fast/forms/negativeLineHeight.html
r11995 r159192 1 1 <html lang="en"> 2 2 <head> 3 <script> 4 if (window.internals) 5 internals.settings.setSimpleLineLayoutEnabled(false); 6 </script> 3 7 <style type="text/css"> 4 8 .p { -
trunk/LayoutTests/fast/forms/textAreaLineHeight.html
r11995 r159192 3 3 <html lang="en"> 4 4 <head> 5 <script> 6 if (window.internals) 7 internals.settings.setSimpleLineLayoutEnabled(false); 8 </script> 5 9 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 6 10 <title>StyledTA</title> -
trunk/LayoutTests/fast/parser/entity-comment-in-textarea.html
r34831 r159192 2 2 <body> 3 3 <textarea> 4 <!-- 4 <!--</textarea> --> 5 5 This should be outside the textarea. 6 6 </textarea> -
trunk/LayoutTests/fast/replaced/width100percent-textarea.html
r124410 r159192 7 7 <body> 8 8 <script> 9 if (window.internals) 10 internals.settings.setSimpleLineLayoutEnabled(false); 9 11 if (window.testRunner) 10 12 testRunner.display(); -
trunk/LayoutTests/platform/mac-mountainlion/fast/parser/entity-comment-in-textarea-expected.txt
r158029 r159192 9 9 RenderTextControl {TEXTAREA} at (2,2) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] 10 10 RenderBlock {DIV} at (3,3) size 155x13 11 RenderText {#text} at (0,0) size 2 9x1311 RenderText {#text} at (0,0) size 25x13 12 12 text run at (0,0) width 25: "<!--" 13 text run at (24,0) width 5: " " -
trunk/LayoutTests/platform/mac/fast/parser/entity-comment-in-textarea-expected.txt
r158029 r159192 9 9 RenderTextControl {TEXTAREA} at (2,2) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] 10 10 RenderBlock {DIV} at (3,3) size 155x13 11 RenderText {#text} at (0,0) size 2 9x1311 RenderText {#text} at (0,0) size 26x13 12 12 text run at (0,0) width 26: "<!--" 13 text run at (25,0) width 4: " " -
trunk/Source/WebCore/ChangeLog
r159191 r159192 1 2013-11-12 Antti Koivisto <antti@apple.com> 2 3 Support overflow-wrap:break-word on simple line path 4 https://bugs.webkit.org/show_bug.cgi?id=124206 5 6 Reviewed by Andreas Kling. 7 8 Pure text documents are rendered with break-word. It is also common in discussion board type sites. 9 10 This also makes many <textarea>'s rendered using the simple line path. 11 12 Tests: fast/forms/basic-textareas-quirks-simple-lines.html 13 fast/forms/linebox-overflow-in-textarea-padding-simple-lines.html 14 fast/forms/negativeLineHeight-simple-lines.html 15 fast/forms/textAreaLineHeight-simple-lines.html 16 17 * rendering/RenderBlock.cpp: 18 (WebCore::RenderBlock::updateShapeInsideInfoAfterStyleChange): 19 (WebCore::RenderBlock::markShapeInsideDescendantsForLayout): 20 21 Invalidate the cached line layout mode on shape-inside style change. 22 23 * rendering/SimpleLineLayout.cpp: 24 (WebCore::SimpleLineLayout::canUseForText): 25 (WebCore::SimpleLineLayout::canUseFor): 26 (WebCore::SimpleLineLayout::createTextRuns): 27 1 28 2013-11-13 Andreas Kling <akling@apple.com> 2 29 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r159154 r159192 1420 1420 ShapeInsideInfo* shapeInsideInfo = ensureShapeInsideInfo(); 1421 1421 shapeInsideInfo->dirtyShapeSize(); 1422 } else {1422 } else 1423 1423 setShapeInsideInfo(nullptr); 1424 markShapeInsideDescendantsForLayout(); 1425 } 1424 markShapeInsideDescendantsForLayout(); 1426 1425 } 1427 1426 … … 1453 1452 if (childrenInline()) { 1454 1453 setNeedsLayout(); 1454 invalidateLineLayoutPath(); 1455 1455 return; 1456 1456 } -
trunk/Source/WebCore/rendering/SimpleLineLayout.cpp
r159105 r159192 30 30 #include "Frame.h" 31 31 #include "GraphicsContext.h" 32 #include "HTMLTextFormControlElement.h" 32 33 #include "HitTestLocation.h" 33 34 #include "HitTestRequest.h" … … 39 40 #include "RenderStyle.h" 40 41 #include "RenderText.h" 42 #include "RenderTextControl.h" 41 43 #include "RenderView.h" 42 44 #include "Settings.h" … … 53 55 static bool canUseForText(const CharacterType* text, unsigned length, const SimpleFontData& fontData) 54 56 { 57 // FIXME: <textarea maxlength=0> generates empty text node. 58 if (!length) 59 return false; 55 60 for (unsigned i = 0; i < length; ++i) { 56 61 UChar character = text[i]; … … 114 119 if (flow.parent()->isDeprecatedFlexibleBox()) 115 120 return false; 121 // FIXME: Implementation of wrap=hard looks into lineboxes. 122 if (flow.parent()->isTextArea() && flow.parent()->element()->fastHasAttribute(HTMLNames::wrapAttr)) 123 return false; 124 // FIXME: Placeholders do something strange. 125 if (flow.parent()->isTextControl() && toRenderTextControl(*flow.parent()).textFormControlElement().placeholderElement()) 126 return false; 116 127 // These tests only works during layout. Outside layout this function may give false positives. 117 128 if (flow.view().layoutState()) { … … 166 177 return false; 167 178 if (style.hasTextCombine()) 168 return false;169 if (style.overflowWrap() != NormalOverflowWrap)170 179 return false; 171 180 if (style.backgroundClip() == TextFillBox) … … 283 292 bool preserveNewline = style.preserveNewline(); 284 293 bool wrapLines = style.autoWrap(); 294 bool breakWordOnOverflow = style.overflowWrap() == BreakOverflowWrap && (wrapLines || preserveNewline); 285 295 286 296 const CharacterType* text = textRenderer.text()->getCharacters<CharacterType>(); … … 363 373 } 364 374 375 if (!lineWidth.fitsOnLine() && breakWordOnOverflow) { 376 // Backtrack and start measuring character-by-character. 377 lineWidth.addUncommittedWidth(-lineWidth.uncommittedWidth()); 378 unsigned splitEnd = wordStart; 379 for (; splitEnd < wordEnd; ++splitEnd) { 380 float charWidth = textWidth(textRenderer, text, textLength, splitEnd, splitEnd + 1, 0, font, tabWidth); 381 lineWidth.addUncommittedWidth(charWidth); 382 if (!lineWidth.fitsOnLine() && splitEnd > lineStart) 383 break; 384 lineWidth.commit(); 385 } 386 lineRuns.last().end = splitEnd; 387 lineRuns.last().right = lineWidth.committedWidth(); 388 lineEnd = splitEnd; 389 // To match line boxes, set single-space-only line width to zero. 390 if (text[lineRuns.last().start] == ' ' && lineRuns.last().start + 1 == lineRuns.last().end) 391 lineRuns.last().right = lineRuns.last().left; 392 break; 393 } 394 365 395 lineWidth.commit(); 366 396 … … 372 402 wordEnd = skipWhitespaces(text, wordEnd, textLength, preserveNewline); 373 403 374 if ( wrapLines && !lineWidth.fitsOnLine()) {404 if (!lineWidth.fitsOnLine() && wrapLines) { 375 405 // The first run on the line overflows. 376 406 ASSERT(lineRuns.size() == 1);
Note: See TracChangeset
for help on using the changeset viewer.