Changeset 29054 in webkit


Ignore:
Timestamp:
Dec 31, 2007 5:32:00 PM (16 years ago)
Author:
mitz@apple.com
Message:

WebCore:

Reviewed by Darin Adler.

Test: fast/dynamic/create-renderer-for-whitespace-only-text.html

  • dom/Node.cpp: (WebCore::Node::attach): Added code to check if this node's renderer has become the "previous renderer" of any sibling text node, and if so, ensure that that node gets a renderer if it now needs one. (WebCore::Node::createRendererIfNeeded): Removed the assertion that the node is not attached.

LayoutTests:

Reviewed by Darin Adler.

  • fast/dynamic/create-renderer-for-whitespace-only-text.html: Added.
  • fast/dynamic/style-access-late-stylesheet-load-expected.txt:
  • platform/mac-leopard/fast/dynamic: Added.
  • platform/mac-leopard/fast/dynamic/create-renderer-for-whitespace-only-text-expected.checksum: Added.
  • platform/mac-leopard/fast/dynamic/create-renderer-for-whitespace-only-text-expected.png: Added.
  • platform/mac/editing/deleting/delete-block-merge-contents-001-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-019-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-020-expected.txt:
  • platform/mac/editing/inserting/editable-html-element-expected.txt:
  • platform/mac/editing/inserting/editing-empty-divs-expected.txt:
  • platform/mac/editing/pasteboard/paste-TIFF-expected.txt:
  • platform/mac/editing/selection/4983858-expected.txt:
  • platform/mac/editing/selection/5136696-expected.txt:
  • platform/mac/editing/selection/drag-to-contenteditable-iframe-expected.txt:
  • platform/mac/editing/style/remove-underline-across-paragraph-expected.txt:
  • platform/mac/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
  • platform/mac/editing/style/remove-underline-after-paragraph-expected.txt:
  • platform/mac/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
  • platform/mac/editing/style/remove-underline-from-stylesheet-expected.txt:
  • platform/mac/fast/dynamic/create-renderer-for-whitespace-only-text-expected.txt: Added.
  • platform/mac/fast/dynamic/move-node-with-selection-expected.txt:
  • platform/mac/fast/forms/input-align-expected.txt:
  • platform/mac/fast/inline/positionedLifetime-expected.txt:
Location:
trunk
Files:
5 added
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r29053 r29054  
     12007-12-31  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        - test and updated results for http://bugs.webkit.org/show_bug.cgi?id=14134
     6          <rdar://problem/5655160> REGRESSION (r25353): Whitespace nodes ignored between inline list items
     7
     8        * fast/dynamic/create-renderer-for-whitespace-only-text.html: Added.
     9        * fast/dynamic/style-access-late-stylesheet-load-expected.txt:
     10        * platform/mac-leopard/fast/dynamic: Added.
     11        * platform/mac-leopard/fast/dynamic/create-renderer-for-whitespace-only-text-expected.checksum: Added.
     12        * platform/mac-leopard/fast/dynamic/create-renderer-for-whitespace-only-text-expected.png: Added.
     13        * platform/mac/editing/deleting/delete-block-merge-contents-001-expected.txt:
     14        * platform/mac/editing/deleting/delete-block-merge-contents-019-expected.txt:
     15        * platform/mac/editing/deleting/delete-block-merge-contents-020-expected.txt:
     16        * platform/mac/editing/inserting/editable-html-element-expected.txt:
     17        * platform/mac/editing/inserting/editing-empty-divs-expected.txt:
     18        * platform/mac/editing/pasteboard/paste-TIFF-expected.txt:
     19        * platform/mac/editing/selection/4983858-expected.txt:
     20        * platform/mac/editing/selection/5136696-expected.txt:
     21        * platform/mac/editing/selection/drag-to-contenteditable-iframe-expected.txt:
     22        * platform/mac/editing/style/remove-underline-across-paragraph-expected.txt:
     23        * platform/mac/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
     24        * platform/mac/editing/style/remove-underline-after-paragraph-expected.txt:
     25        * platform/mac/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
     26        * platform/mac/editing/style/remove-underline-from-stylesheet-expected.txt:
     27        * platform/mac/fast/dynamic/create-renderer-for-whitespace-only-text-expected.txt: Added.
     28        * platform/mac/fast/dynamic/move-node-with-selection-expected.txt:
     29        * platform/mac/fast/forms/input-align-expected.txt:
     30        * platform/mac/fast/inline/positionedLifetime-expected.txt:
     31
    1322007-12-31  Darin Adler  <darin@apple.com>
    233
  • trunk/LayoutTests/fast/dynamic/style-access-late-stylesheet-load-expected.txt

    r25308 r29054  
    11Test that offsetWidth and similar get up to date style information even if a new stylesheet load is started at late stage of document rendering
    22PASS
     3
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-001-expected.txt

    r25970 r29054  
    2222          RenderText {#text} at (40,0) size 44x28
    2323            text run at (40,0) width 44: "Two"
     24          RenderText {#text} at (0,0) size 0x0
    2425caret: position 4 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-019-expected.txt

    r25970 r29054  
    2424          RenderText {#text} at (31,14) size 17x28
    2525            text run at (31,14) width 17: "X"
     26          RenderText {#text} at (0,0) size 0x0
    2627caret: position 2 of child 0 {#text} of child 1 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-020-expected.txt

    r25970 r29054  
    2525          RenderText {#text} at (31,14) size 17x28
    2626            text run at (31,14) width 17: "X"
     27          RenderText {#text} at (0,0) size 0x0
    2728caret: position 2 of child 0 {#text} of child 1 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  • trunk/LayoutTests/platform/mac/editing/inserting/editable-html-element-expected.txt

    r25970 r29054  
    2323          text run at (0,18) width 755: "paragraph separator doesn't split the body (inserting a paragraph separator usually splits/clones the enclosing block flow "
    2424          text run at (0,36) width 58: "element)."
     25        RenderText {#text} at (0,0) size 0x0
    2526      RenderBlock {DIV} at (0,54) size 784x18
    2627        RenderBR {BR} at (0,0) size 0x18
  • trunk/LayoutTests/platform/mac/editing/inserting/editing-empty-divs-expected.txt

    r25970 r29054  
    6363        RenderText {#text} at (1,1) size 7x18
    6464          text run at (1,1) width 7: "c"
     65        RenderText {#text} at (0,0) size 0x0
    6566      RenderBlock {P} at (0,268) size 784x18
    6667        RenderText {#text} at (0,0) size 234x18
     
    7879          RenderText {#text} at (0,0) size 7x18
    7980            text run at (0,0) width 7: "c"
     81          RenderText {#text} at (0,0) size 0x0
    8082        RenderBlock {P} at (1,35) size 705x0
    8183caret: position 1 of child 0 {#text} of child 21 {DIV} of child 2 {BODY} of child 0 {HTML} of document
  • trunk/LayoutTests/platform/mac/editing/pasteboard/paste-TIFF-expected.txt

    r25970 r29054  
    1414        RenderBlock (anonymous) at (14,14) size 756x97
    1515          RenderImage {IMG} at (0,0) size 593x97
     16          RenderText {#text} at (0,0) size 0x0
    1617        RenderBlock {DIV} at (14,111) size 756x0
    1718      RenderBlock {DIV} at (0,125) size 784x0
  • trunk/LayoutTests/platform/mac/editing/selection/4983858-expected.txt

    r25970 r29054  
    88          text run at (0,0) width 780: "This tests for a bug where selecting a word would select the line break and word before it.  Only the word in the  paragraph "
    99          text run at (0,18) width 162: "below should be selected:"
     10        RenderText {#text} at (0,0) size 0x0
    1011      RenderBlock {DIV} at (0,36) size 784x18
    1112        RenderText {#text} at (0,0) size 21x18
  • trunk/LayoutTests/platform/mac/editing/selection/5136696-expected.txt

    r25970 r29054  
    1717                  text run at (0,0) width 270: "This test should be selected, but this frame "
    1818                  text run at (0,18) width 133: "shouldn't be focused."
     19                RenderText {#text} at (0,0) size 0x0
    1920        RenderBR {BR} at (304,154) size 0x0
    2021        RenderTextControl {INPUT} at (2,156) size 217x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
  • trunk/LayoutTests/platform/mac/editing/selection/drag-to-contenteditable-iframe-expected.txt

    r25970 r29054  
    1818              RenderBody {BODY} at (8,8) size 184x184 [bgcolor=#FFFFE0]
    1919                RenderImage {IMG} at (0,0) size 76x103
     20                RenderText {#text} at (0,0) size 0x0
    2021        RenderText {#text} at (208,194) size 4x18
    2122          text run at (208,194) width 4: " "
  • trunk/LayoutTests/platform/mac/editing/style/remove-underline-across-paragraph-expected.txt

    r25970 r29054  
    116116              text run at (78,0) width 78: " xxxxxx"
    117117selection start: position 0 of child 1 {#text} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
    118 selection end:   position 7 of child 0 {#text} of child 4 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
     118selection end:   position 7 of child 0 {#text} of child 3 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  • trunk/LayoutTests/platform/mac/editing/style/remove-underline-across-paragraph-in-bold-expected.txt

    r25970 r29054  
    118118              text run at (78,0) width 78: " xxxxxx"
    119119selection start: position 0 of child 0 {#text} of child 1 {B} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
    120 selection end:   position 7 of child 0 {#text} of child 0 {B} of child 4 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
     120selection end:   position 7 of child 0 {#text} of child 0 {B} of child 3 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  • trunk/LayoutTests/platform/mac/editing/style/remove-underline-after-paragraph-expected.txt

    r25970 r29054  
    101101          RenderText {#text} at (0,0) size 156x28
    102102            text run at (0,0) width 156: " xxxxxx xxxxxx"
    103 caret: position 14 of child 0 {#text} of child 3 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
     103caret: position 14 of child 0 {#text} of child 2 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  • trunk/LayoutTests/platform/mac/editing/style/remove-underline-after-paragraph-in-bold-expected.txt

    r25970 r29054  
    103103            RenderText {#text} at (0,0) size 156x28
    104104              text run at (0,0) width 156: " xxxxxx xxxxxx"
    105 caret: position 14 of child 0 {#text} of child 0 {B} of child 3 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
     105caret: position 14 of child 0 {#text} of child 0 {B} of child 2 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  • trunk/LayoutTests/platform/mac/editing/style/remove-underline-from-stylesheet-expected.txt

    r25970 r29054  
    8383          RenderText {#text} at (164,14) size 78x28
    8484            text run at (164,14) width 78: " xxxxxx"
    85           RenderText {#text} at (0,0) size 0x0
    86           RenderInline {SPAN} at (0,0) size 0x0
     85          RenderInline {SPAN} at (0,0) size 0x28
    8786selection start: position 0 of child 1 {#text} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
    8887selection end:   position 6 of child 1 {#text} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  • trunk/LayoutTests/platform/mac/fast/dynamic/move-node-with-selection-expected.txt

    r25970 r29054  
    99            text run at (0,0) width 84: "Lorem ipsum"
    1010      RenderBlock (anonymous) at (0,18) size 784x0
     11        RenderText {#text} at (0,0) size 0x0
     12        RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/fast/forms/input-align-expected.txt

    r25970 r29054  
    2121        RenderBR {BR} at (0,0) size 0x0
    2222        RenderTextControl {INPUT} at (2,71) size 148x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
    23         RenderBR {BR} at (152,85) size 0x0
     23        RenderText {#text} at (152,71) size 4x18
     24          text run at (152,71) width 4: " "
     25        RenderBR {BR} at (0,0) size 0x0
    2426      RenderBlock {DIV} at (0,126) size 784x23
    2527        RenderTextControl {INPUT} at (2,2) size 148x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
  • trunk/LayoutTests/platform/mac/fast/inline/positionedLifetime-expected.txt

    r25970 r29054  
    1212      RenderText {#text} at (0,0) size 0x0
    1313      RenderText {#text} at (0,0) size 0x0
     14      RenderText {#text} at (0,0) size 0x0
  • trunk/WebCore/ChangeLog

    r29053 r29054  
     12007-12-31  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=14134
     6          <rdar://problem/5655160> REGRESSION (r25353): Whitespace nodes ignored between inline list items
     7
     8        Test: fast/dynamic/create-renderer-for-whitespace-only-text.html
     9
     10        * dom/Node.cpp:
     11        (WebCore::Node::attach): Added code to check if this node's renderer
     12        has become the "previous renderer" of any sibling text node, and if so,
     13        ensure that that node gets a renderer if it now needs one.
     14        (WebCore::Node::createRendererIfNeeded): Removed the assertion that the
     15        node is not attached.
     16
    1172007-12-31  Darin Adler  <darin@apple.com>
    218
  • trunk/WebCore/dom/Node.cpp

    r29053 r29054  
    798798    ASSERT(!attached());
    799799    ASSERT(!renderer() || (renderer()->style() && renderer()->parent()));
     800
     801    // If this node got a renderer it may be the previousRenderer() of sibling text nodes and thus affect the
     802    // result of Text::rendererIsNeeded() for those nodes.
     803    if (renderer()) {
     804        for (Node* next = nextSibling(); next; next = next->nextSibling()) {
     805            if (next->renderer())
     806                break;
     807            if (!next->attached())
     808                break;  // Assume this means none of the following siblings are attached.
     809            if (next->isTextNode())
     810                next->createRendererIfNeeded();
     811        }
     812    }
     813
    800814    m_attached = true;
    801815}
     
    974988    if (!document()->shouldCreateRenderers())
    975989        return;
    976    
    977     ASSERT(!attached());
     990
    978991    ASSERT(!renderer());
    979992   
Note: See TracChangeset for help on using the changeset viewer.