Changeset 160908 in webkit


Ignore:
Timestamp:
Dec 20, 2013 6:44:23 AM (10 years ago)
Author:
Antti Koivisto
Message:

Create render tree lazily
https://bugs.webkit.org/show_bug.cgi?id=120685

Source/WebCore:

Reviewed by Andreas Kling.

We currently recompute style and construct renderer for each DOM node immediately after they are added to
the tree. This is often inefficient as the style may change immediately afterwards and the work needs to be
redone.

With this patch we always compute style and construct render tree lazily, either on style recalc timer or
synchronously when they are needed. It also removes the 'attached' bit. If document has render tree then
all nodes are conceptually "attached" even if this happens lazily.

The patch slightly changes behavior of implicit CSS transitions. A synchronous style change during parsing
may not trigger the animation anymore as laziness means we don't see anything changing. This matches Firefox
and Chrome in our test cases.

  • WebCore.exp.in:
  • bindings/js/JSNodeCustom.cpp:

(WebCore::JSNode::insertBefore):
(WebCore::JSNode::replaceChild):
(WebCore::JSNode::appendChild):

All attaching is now lazy, remove AttachLazily.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::propertyValue):

SVG renderers with !isValid() have empty display property value for some reason. Keep the behavior.

  • dom/ContainerNode.cpp:

(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::parserInsertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::appendChild):
(WebCore::ContainerNode::parserAppendChild):
(WebCore::ContainerNode::updateTreeAfterInsertion):

  • dom/ContainerNode.h:
  • dom/Document.cpp:

(WebCore::Document::~Document):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::createRenderTree):
(WebCore::Document::destroyRenderTree):

Remove attach bit maintenance.

(WebCore::Document::webkitDidExitFullScreenForElement):

Do lazy render tree reconstruction after returning from full screen. That is the only reliable way
to get the render tree back to decent shape.

  • dom/Element.cpp:

(WebCore::Element::isFocusable):

Remove pointless !renderer()->needsLayout() assert.

(WebCore::Element::addShadowRoot):
(WebCore::Element::childShouldCreateRenderer):
(WebCore::Element::resetComputedStyle):

Take care to reset computed style in all descendants. attachRenderTree no longer does this.

  • dom/Element.h:
  • dom/Node.cpp:

(WebCore::Node::insertBefore):
(WebCore::Node::replaceChild):
(WebCore::Node::appendChild):
(WebCore::Node::setNeedsStyleRecalc):

Propagate ReconstructRenderTree.

(WebCore::Node::attached):

Emulate the behavior of old attached bit for now so existing code calling this mostly stays working.

  • dom/Node.h:


Add new ReconstructRenderTree value for StyleChangeType.

  • dom/Range.cpp:

(WebCore::Range::isPointInRange):
(WebCore::Range::comparePoint):
(WebCore::Range::compareNode):
(WebCore::Range::intersectsNode):

  • editing/AppendNodeCommand.cpp:

(WebCore::AppendNodeCommand::doApply):

  • editing/CompositeEditCommand.cpp:

(WebCore::CompositeEditCommand::canRebalance):

  • editing/InsertNodeBeforeCommand.cpp:

(WebCore::InsertNodeBeforeCommand::doApply):

  • html/HTMLDetailsElement.cpp:

(WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):

  • html/HTMLDocument.cpp:

(WebCore::HTMLDocument::activeElement):

  • html/HTMLElement.cpp:

(WebCore::HTMLElement::setInnerText):

TextControlInnerTextElement always preserves newline even if it doesn't have style yet.

(WebCore::HTMLElement::supportsFocus):

  • html/HTMLEmbedElement.cpp:

(WebCore::HTMLEmbedElement::parseAttribute):

  • html/HTMLFormControlElement.cpp:

(WebCore::shouldAutofocus):

Don't autofocus until we have renderer.

  • html/HTMLFormControlElementWithState.cpp:

(WebCore::HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState):

  • html/HTMLFrameElementBase.cpp:

(WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions):

  • html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::updateType):

Lazy render tree construction.

(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::defaultEventHandler):

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::parseAttribute):

  • html/HTMLObjectElement.cpp:

(WebCore::HTMLObjectElement::parseAttribute):

  • html/HTMLSummaryElement.cpp:

(WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot):

  • html/parser/HTMLConstructionSite.cpp:

(WebCore::executeTask):

Don't attach renderer after construction.

  • html/parser/HTMLTreeBuilder.cpp:

(WebCore::HTMLTreeBuilder::callTheAdoptionAgency):

  • html/shadow/ContentDistributor.cpp:

(WebCore::ContentDistributor::invalidateDistribution):

  • html/shadow/InsertionPoint.cpp:

(WebCore::InsertionPoint::willAttachRenderers):
(WebCore::InsertionPoint::willDetachRenderers):

  • html/shadow/MediaControlElements.cpp:

(WebCore::MediaControlTextTrackContainerElement::updateDisplay):

  • html/shadow/MediaControls.cpp:

(WebCore::MediaControls::createTextTrackDisplay):

  • html/shadow/MediaControlsApple.cpp:

(WebCore::MediaControlsApple::createControls):

  • html/track/TextTrackCue.cpp:

(WebCore::TextTrackCue::getDisplayTree):

  • loader/PlaceholderDocument.cpp:

(WebCore::PlaceholderDocument::createRenderTree):

  • loader/cache/CachedResourceLoader.cpp:

(WebCore::CachedResourceLoader::preload):

  • style/StyleResolveTree.cpp:

(WebCore::Style::attachTextRenderer):
(WebCore::Style::detachTextRenderer):

Remove attached bit maintenance.

(WebCore::Style::attachChildren):
(WebCore::Style::attachShadowRoot):
(WebCore::Style::attachRenderTree):
(WebCore::Style::detachShadowRoot):
(WebCore::Style::detachRenderTree):
(WebCore::Style::resolveLocal):

  • svg/SVGTests.cpp:

(WebCore::SVGTests::handleAttributeChange):

Make lazy.

  • testing/Internals.cpp:

(WebCore::Internals::attached):
(WebCore::Internals::elementRenderTreeAsText):
(WebCore::Internals::markerAt):
(WebCore::Internals::nodesFromRect):

LayoutTests:

Reviewed by Andreas Kling.

Most of these are non-visible render tree dump changes (they become simpler).

  • editing/selection/click-on-head-margin-expected.txt:
  • fast/css-generated-content/before-content-continuation-chain-expected.txt:
  • fast/css/transition-color-unspecified.html:
  • fast/dom/adopt-node-crash-2-expected.txt:
  • fast/dom/modify-node-and-while-in-the-callback-too-crash-expected.txt:
  • fast/forms/radio/radio_checked_dynamic-expected.txt:
  • fast/frames/lots-of-iframes-expected.txt:
  • fast/frames/sandboxed-iframe-autofocus-denied-expected.txt:
  • fast/table/table-row-style-not-updated-with-after-content-expected.txt:
  • fullscreen/full-screen-render-inline-expected.txt:
  • fullscreen/parent-flow-inline-with-block-child-expected.txt:
  • platform/mac/editing/inserting/break-blockquote-after-delete-expected.txt:
  • platform/mac/fast/css-generated-content/table-row-group-to-inline-expected.txt:
  • platform/mac/fast/dynamic/011-expected.txt:
  • platform/mac/fast/forms/formmove3-expected.txt:
  • platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt:
  • platform/mac/fast/invalid/001-expected.txt:
  • platform/mac/fast/invalid/003-expected.txt:
  • platform/mac/fast/invalid/004-expected.txt:
  • platform/mac/fast/invalid/007-expected.txt:
  • platform/mac/fast/invalid/019-expected.txt:
  • platform/mac/fast/multicol/span/span-as-immediate-child-generated-content-expected.txt:
  • platform/mac/fast/multicol/span/span-as-immediate-columns-child-dynamic-expected.txt:
  • platform/mac/fast/multicol/span/span-as-nested-columns-child-dynamic-expected.txt:
  • platform/mac/fast/ruby/ruby-base-merge-block-children-crash-expected.txt:
  • platform/mac/tables/mozilla/bugs/bug113235-1-expected.txt:
  • platform/mac/tables/mozilla/bugs/bug647-expected.txt:
  • platform/mac/tables/mozilla/other/wa_table_tr_align-expected.txt:
  • plugins/plugin-remove-readystatechange-expected.txt:
  • svg/custom/system-language-crash-expected.txt:
  • transitions/equivalent-background-image-no-transition.html:
  • transitions/repeated-firing-background-color.html:
  • transitions/transition-duration-cleared-in-transitionend-crash.html:

Adopt a few transition test cases to new behavior.

Location:
trunk
Files:
75 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r160907 r160908  
     12013-12-19  Antti Koivisto  <antti@apple.com>
     2
     3        Create render tree lazily
     4        https://bugs.webkit.org/show_bug.cgi?id=120685
     5
     6        Reviewed by Andreas Kling.
     7       
     8        Most of these are non-visible render tree dump changes (they become simpler).
     9
     10        * editing/selection/click-on-head-margin-expected.txt:
     11        * fast/css-generated-content/before-content-continuation-chain-expected.txt:
     12        * fast/css/transition-color-unspecified.html:
     13        * fast/dom/adopt-node-crash-2-expected.txt:
     14        * fast/dom/modify-node-and-while-in-the-callback-too-crash-expected.txt:
     15        * fast/forms/radio/radio_checked_dynamic-expected.txt:
     16        * fast/frames/lots-of-iframes-expected.txt:
     17        * fast/frames/sandboxed-iframe-autofocus-denied-expected.txt:
     18        * fast/table/table-row-style-not-updated-with-after-content-expected.txt:
     19        * fullscreen/full-screen-render-inline-expected.txt:
     20        * fullscreen/parent-flow-inline-with-block-child-expected.txt:
     21        * platform/mac/editing/inserting/break-blockquote-after-delete-expected.txt:
     22        * platform/mac/fast/css-generated-content/table-row-group-to-inline-expected.txt:
     23        * platform/mac/fast/dynamic/011-expected.txt:
     24        * platform/mac/fast/forms/formmove3-expected.txt:
     25        * platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt:
     26        * platform/mac/fast/invalid/001-expected.txt:
     27        * platform/mac/fast/invalid/003-expected.txt:
     28        * platform/mac/fast/invalid/004-expected.txt:
     29        * platform/mac/fast/invalid/007-expected.txt:
     30        * platform/mac/fast/invalid/019-expected.txt:
     31        * platform/mac/fast/multicol/span/span-as-immediate-child-generated-content-expected.txt:
     32        * platform/mac/fast/multicol/span/span-as-immediate-columns-child-dynamic-expected.txt:
     33        * platform/mac/fast/multicol/span/span-as-nested-columns-child-dynamic-expected.txt:
     34        * platform/mac/fast/ruby/ruby-base-merge-block-children-crash-expected.txt:
     35        * platform/mac/tables/mozilla/bugs/bug113235-1-expected.txt:
     36        * platform/mac/tables/mozilla/bugs/bug647-expected.txt:
     37        * platform/mac/tables/mozilla/other/wa_table_tr_align-expected.txt:
     38        * plugins/plugin-remove-readystatechange-expected.txt:
     39        * svg/custom/system-language-crash-expected.txt:
     40        * transitions/equivalent-background-image-no-transition.html:
     41        * transitions/repeated-firing-background-color.html:
     42        * transitions/transition-duration-cleared-in-transitionend-crash.html:
     43
     44            Adopt a few transition test cases to new behavior.
     45
    1462013-12-20  Mario Sanchez Prada  <mario.prada@samsung.com>
    247
  • trunk/LayoutTests/editing/selection/click-on-head-margin-expected.txt

    r95574 r160908  
    11Click on the right of this line outside the black box.
    22The caret should be placed on the right of the first line, NOT on the right of this line.
    3  PASS
     3PASS
    44
  • trunk/LayoutTests/fast/css-generated-content/before-content-continuation-chain-expected.txt

    r137336 r160908  
    66      RenderBlock (anonymous) at (0,0) size 784x0
    77        RenderInline {SPAN} at (0,0) size 0x0 [color=#008000]
    8       RenderBlock (anonymous) at (0,0) size 784x200
     8      RenderBlock (anonymous) at (0,0) size 784x200 [color=#008000]
    99        RenderBlock (generated) at (0,0) size 784x200 [color=#0000FF]
    1010          RenderText at (0,0) size 200x200
    1111            text run at (0,0) width 200: "A"
    12         RenderBlock {DIV} at (0,200) size 784x0 [color=#008000]
     12        RenderBlock {DIV} at (0,200) size 784x0
    1313      RenderBlock (anonymous) at (0,200) size 784x200
    1414        RenderInline {SPAN} at (0,0) size 200x200 [color=#008000]
  • trunk/LayoutTests/fast/css/transition-color-unspecified.html

    r120683 r160908  
    1515    }, false);
    1616
    17     document.getElementById("test").className = "";
     17    setTimeout(function() { document.getElementById("test").className = "" }, 0);
    1818</script>
  • trunk/LayoutTests/fast/dom/adopt-node-crash-2-expected.txt

    r135914 r160908  
    11Tests for a crash due to adopting a DOM node during DOMFocusOut event. Test passes if it doesn't crash.
    22
     3
  • trunk/LayoutTests/fast/dom/modify-node-and-while-in-the-callback-too-crash-expected.txt

    r159481 r160908  
    11This tests that making changes on a node that triggers a callback where we make changes again on the same node does not result in an assert/crash. Test passes if no crash is observed.
    2 
    3 
  • trunk/LayoutTests/fast/forms/radio/radio_checked_dynamic-expected.txt

    r108612 r160908  
    1111
    1212Test 4: Transfer from <form> to <form>
    13   
     13 
    1414Test 4 Passed
    1515
  • trunk/LayoutTests/fast/frames/lots-of-iframes-expected.txt

    r61205 r160908  
    11Sucessfully created 1000 frames.
    22Successfully blocked creation of frame number 1001.
    3 
  • trunk/LayoutTests/fast/frames/sandboxed-iframe-autofocus-denied-expected.txt

    r137180 r160908  
    11CONSOLE MESSAGE: line 1: Blocked script execution in 'about:srcdoc' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
    2 CONSOLE MESSAGE: line 1: Blocked autofocusing on a form control because the form's frame is sandboxed and the 'allow-scripts' permission is not set.
     2CONSOLE MESSAGE: Blocked autofocusing on a form control because the form's frame is sandboxed and the 'allow-scripts' permission is not set.
    33CONSOLE MESSAGE: line 13: PASS: The input element is not focused.
    44This test passes if the input element in the sandboxed frame is not automatically focused upon, as it should be blocked by the sandboxed scripts flag. A console warning to that effect should also be present.
  • trunk/LayoutTests/fast/table/table-row-style-not-updated-with-after-content-expected.txt

    r95671 r160908  
    88          RenderTableRow {DIV} at (0,0) size 512x256 [color=#0000FF]
    99            RenderTableCell (anonymous) at (0,0) size 512x256 [r=0 c=0 rs=1 cs=1]
    10               RenderTable at (0,0) size 512x256
    11                 RenderTableSection (anonymous) at (0,0) size 512x256
    12                   RenderTableRow (anonymous) at (0,0) size 512x128
     10              RenderBlock (anonymous) at (0,0) size 512x128
     11                RenderText {#text} at (0,0) size 512x128
     12                  text run at (0,0) width 512: "ABCD"
     13              RenderTable at (0,128) size 512x128
     14                RenderTableSection (anonymous) at (0,0) size 512x128
     15                  RenderTableRow (anonymous) at (0,0) size 512x128 [color=#FFFF00]
    1316                    RenderTableCell (anonymous) at (0,0) size 512x128 [r=0 c=0 rs=1 cs=1]
    14                       RenderText {#text} at (0,0) size 512x128
    15                         text run at (0,0) width 512: "ABCD"
    16                   RenderTableRow (anonymous) at (0,128) size 512x128 [color=#FFFF00]
    17                     RenderTableCell (anonymous) at (0,128) size 512x128 [r=1 c=0 rs=1 cs=1]
    1817                      RenderText at (0,0) size 512x128
    1918                        text run at (0,0) width 512: "4578"
  • trunk/LayoutTests/fullscreen/full-screen-render-inline-expected.txt

    r109192 r160908  
    55    RenderBody {BODY} at (8,8) size 784x584
    66      RenderBlock {SUMMARY} at (0,0) size 784x48
    7         RenderBlock (anonymous) at (0,0) size 784x0
    8         RenderBlock (anonymous) at (0,0) size 784x0
    97        RenderBlock (anonymous) at (0,0) size 784x16
    108          RenderText {#text} at (0,0) size 16x16
  • trunk/LayoutTests/fullscreen/parent-flow-inline-with-block-child-expected.txt

    r97088 r160908  
    44  RenderBlock {HTML} at (0,0) size 800x600
    55    RenderBody {BODY} at (8,8) size 784x584
    6       RenderBlock {DIV} at (0,0) size 784x32
     6      RenderBlock {DIV} at (0,0) size 784x16
    77        RenderBlock (anonymous) at (0,0) size 784x16
    88          RenderInline {SPAN} at (0,0) size 16x16
    99            RenderText {#text} at (0,0) size 16x16
    1010              text run at (0,0) width 16: "1"
     11          RenderText {#text} at (16,0) size 16x16
     12            text run at (16,0) width 16: " "
     13          RenderInline {SPAN} at (0,0) size 16x16
     14            RenderText {#text} at (32,0) size 16x16
     15              text run at (32,0) width 16: "2"
     16        RenderBlock (anonymous) at (0,16) size 784x0
     17          RenderBlock {DIV} at (0,0) size 784x0
     18        RenderBlock (anonymous) at (0,16) size 784x0
     19          RenderInline {SPAN} at (0,0) size 0x0
    1120          RenderText {#text} at (0,0) size 0x0
    12         RenderBlock (anonymous) at (0,16) size 784x16
    13           RenderInline {SPAN} at (0,0) size 16x16
    14             RenderText {#text} at (0,0) size 16x16
    15               text run at (0,0) width 16: "2"
    16         RenderBlock (anonymous) at (0,32) size 784x0
    17           RenderBlock {DIV} at (0,0) size 784x0
    18         RenderBlock (anonymous) at (0,32) size 784x0
    19           RenderInline {SPAN} at (0,0) size 0x0
    20         RenderBlock (anonymous) at (0,32) size 784x0
    21           RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/editing/inserting/break-blockquote-after-delete-expected.txt

    r126704 r160908  
    2222              RenderText {#text} at (12,0) size 35x18
    2323                text run at (12,0) width 35: "green"
    24         RenderBlock (anonymous) at (0,54) size 784x0
    2524caret: position 5 of child 2 {#text} of child 4 {DIV} of body
  • trunk/LayoutTests/platform/mac/fast/css-generated-content/table-row-group-to-inline-expected.txt

    r150290 r160908  
    1111          text run at (638,0) width 4: " "
    1212        RenderBR {BR} at (642,14) size 0x0
    13       RenderBlock {UL} at (0,34) size 784x36
    14         RenderListItem {LI} at (40,0) size 744x36
    15           RenderBlock (anonymous) at (0,0) size 744x18
    16             RenderListMarker at (-17,0) size 7x18: bullet
    17           RenderTable at (0,18) size 0x0
    18           RenderBlock (anonymous) at (0,18) size 744x18
    19             RenderInline (generated) at (0,0) size 31x18
    20               RenderText at (0,0) size 31x18
    21                 text run at (0,0) width 31: "hello"
    22             RenderText {#text} at (31,0) size 21x18
    23               text run at (31,0) width 21: "test"
     13      RenderBlock {UL} at (0,34) size 784x18
     14        RenderListItem {LI} at (40,0) size 744x18
     15          RenderListMarker at (-17,0) size 7x18: bullet
     16          RenderInline (generated) at (0,0) size 31x18
     17            RenderText at (0,0) size 31x18
     18              text run at (0,0) width 31: "hello"
     19          RenderText {#text} at (31,0) size 21x18
     20            text run at (31,0) width 21: "test"
  • trunk/LayoutTests/platform/mac/fast/dynamic/011-expected.txt

    r120477 r160908  
    55    RenderBody {BODY} at (8,8) size 784x584
    66      RenderBlock (anonymous) at (0,0) size 784x36
    7         RenderInline {SPAN} at (0,0) size 0x0
    87        RenderInline {SPAN} at (0,0) size 781x36
    98          RenderInline {SPAN} at (0,0) size 781x36
  • trunk/LayoutTests/platform/mac/fast/forms/formmove3-expected.txt

    r155253 r160908  
    77        RenderInline {A} at (0,0) size 0x0
    88          RenderText {#text} at (0,0) size 0x0
    9         RenderInline {A} at (0,0) size 0x0
    109      RenderBlock {DIV} at (0,0) size 784x28
    1110        RenderBlock (anonymous) at (0,0) size 784x0
  • trunk/LayoutTests/platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt

    r155253 r160908  
    77        RenderInline {FONT} at (0,0) size 0x0
    88          RenderText {#text} at (0,0) size 0x0
    9         RenderInline {FONT} at (0,0) size 0x0
    109      RenderBlock {CENTER} at (0,0) size 784x25
    1110        RenderBlock (anonymous) at (0,0) size 784x0
     
    2322          RenderInline {FONT} at (0,0) size 0x0
    2423          RenderText {#text} at (0,0) size 0x0
    25       RenderBlock (anonymous) at (0,25) size 784x0
    2624      RenderBlock {DIV} at (0,25) size 784x36
    2725        RenderText {#text} at (0,0) size 775x36
  • trunk/LayoutTests/platform/mac/fast/invalid/001-expected.txt

    r120477 r160908  
    55    RenderBody {BODY} at (8,8) size 784x584
    66      RenderBlock (anonymous) at (0,0) size 784x0
    7         RenderInline {B} at (0,0) size 0x0
    87        RenderInline {B} at (0,0) size 0x0
    98      RenderBlock {P} at (0,0) size 784x18
  • trunk/LayoutTests/platform/mac/fast/invalid/003-expected.txt

    r155253 r160908  
    99            RenderText {#text} at (0,0) size 89x18
    1010              text run at (0,0) width 89: "Italic and Red"
    11         RenderInline {FONT} at (0,0) size 0x18 [color=#FF0000]
    12           RenderInline {I} at (0,0) size 0x18
    1311        RenderInline {I} at (0,0) size 0x18
    1412      RenderBlock (anonymous) at (0,34) size 784x18
     
    3836          RenderInline {I} at (0,0) size 0x0
    3937            RenderText {#text} at (0,0) size 0x0
    40         RenderInline {FONT} at (0,0) size 0x0 [color=#FF0000]
    41           RenderInline {I} at (0,0) size 0x0
    4238      RenderBlock {P} at (0,136) size 784x18
    4339        RenderInline {FONT} at (0,0) size 123x18 [color=#FF0000]
  • trunk/LayoutTests/platform/mac/fast/invalid/004-expected.txt

    r120477 r160908  
    1919        RenderText {#text} at (0,0) size 0x0
    2020        RenderInline {B} at (0,0) size 0x0
    21         RenderInline {B} at (0,0) size 0x0
    2221      RenderBlock {P} at (0,206) size 784x18
    2322        RenderInline {B} at (0,0) size 97x18
  • trunk/LayoutTests/platform/mac/fast/invalid/007-expected.txt

    r120477 r160908  
    55    RenderBody {BODY} at (8,8) size 784x584
    66      RenderBlock (anonymous) at (0,0) size 784x0
    7         RenderInline {LABEL} at (0,0) size 0x0
    8           RenderInline {A} at (0,0) size 0x0
    97        RenderInline {LABEL} at (0,0) size 0x0
    108          RenderInline {A} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/fast/invalid/019-expected.txt

    r120477 r160908  
    55    RenderBody {BODY} at (8,8) size 784x579
    66      RenderBlock (anonymous) at (0,0) size 784x0
    7         RenderInline {B} at (0,0) size 0x0
    8           RenderInline {NOBR} at (0,0) size 0x0
    97        RenderInline {B} at (0,0) size 0x0
    108          RenderInline {NOBR} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/fast/multicol/span/span-as-immediate-child-generated-content-expected.txt

    r149210 r160908  
    1 layer at (0,0) size 785x2744
     1layer at (0,0) size 785x2762
    22  RenderView at (0,0) size 785x600
    3 layer at (0,0) size 785x2744
    4   RenderBlock {HTML} at (0,0) size 785x2744
    5     RenderBody {BODY} at (8,16) size 769x2712
     3layer at (0,0) size 785x2762
     4  RenderBlock {HTML} at (0,0) size 785x2762
     5    RenderBody {BODY} at (8,16) size 769x2730
    66layer at (8,16) size 760x420
    77  RenderBlock {DIV} at (0,0) size 760x420 [border: (5px solid #800000)]
     
    294294      RenderText at (0,0) size 156x18
    295295        text run at (0,0) width 156: "After Generated Content"
    296 layer at (8,2258) size 760x470
    297   RenderBlock {DIV} at (0,2242) size 760x470 [border: (5px solid #800000)]
     296layer at (8,2258) size 760x488
     297  RenderBlock {DIV} at (0,2242) size 760x488 [border: (5px solid #800000)]
    298298    RenderBlock (anonymous multi-column span) at (5,271) size 750x66
    299299      RenderBlock {H2} at (0,19) size 750x28 [bgcolor=#EEEEEE]
    300300        RenderText {#text} at (0,0) size 276x28
    301301          text run at (0,0) width 276: "This is a spanning element."
     302    RenderBlock (anonymous) at (5,355) size 750x18
     303      RenderBlock {SPAN} at (0,0) size 750x18
     304        RenderText {#text} at (0,0) size 154x18
     305          text run at (0,0) width 154: "Nulla varius enim ac mi."
    302306layer at (13,2263) size 750x266
    303307  RenderBlock (anonymous multi-column) at (5,5) size 750x266
     
    335339        text run at (0,162) width 362: "nec felis. Sed varius turpis vitae pede. Lorem ipsum dolor"
    336340        text run at (0,180) width 229: "sit amet, consectetuer adipiscing elit."
    337 layer at (13,2595) size 750x128
    338   RenderBlock (anonymous multi-column) at (5,337) size 750x128
    339     RenderBlock (anonymous) at (0,0) size 367x18
    340       RenderInline {SPAN} at (0,0) size 354x18
    341         RenderText {#text} at (0,0) size 354x18
    342           text run at (0,0) width 354: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
    343     RenderBlock (anonymous) at (0,18) size 367x18
    344       RenderBlock {SPAN} at (0,0) size 367x18
    345         RenderText {#text} at (0,0) size 154x18
    346           text run at (0,0) width 154: "Nulla varius enim ac mi."
    347     RenderBlock (anonymous) at (0,36) size 367x182
     341layer at (13,2595) size 750x18
     342  RenderBlock (anonymous multi-column) at (5,337) size 750x18
     343    RenderInline {SPAN} at (0,0) size 354x18
     344      RenderText {#text} at (0,0) size 354x18
     345        text run at (0,0) width 354: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
     346layer at (13,2631) size 750x110
     347  RenderBlock (anonymous multi-column) at (5,373) size 750x110
     348    RenderBlock (anonymous) at (0,0) size 367x182
    348349      RenderInline {SPAN} at (0,0) size 362x182
    349350        RenderText {#text} at (0,0) size 362x182
     
    353354          text run at (0,54) width 332: "Cras convallis adipiscing sem. Nam nonummy enim."
    354355          text run at (0,72) width 351: "Nullam bibendum lobortis neque. Vestibulum velit orci,"
    355           text run at (0,92) width 329: "tempus euismod, pretium quis, interdum vitae, nulla."
     356          text run at (0,90) width 329: "tempus euismod, pretium quis, interdum vitae, nulla."
    356357          text run at (0,110) width 339: "Phasellus eget ante et tortor condimentum vestibulum."
    357358          text run at (0,128) width 345: "Suspendisse hendrerit quam nec felis. Sed varius turpis"
     
    359360          text run at (0,164) width 91: "adipiscing elit."
    360361      RenderText {#text} at (0,0) size 0x0
    361     RenderBlock (generated) at (0,218) size 367x20 [bgcolor=#FFFF00]
    362       RenderText at (0,0) size 156x18
    363         text run at (0,0) width 156: "After Generated Content"
     362    RenderBlock (generated) at (0,182) size 367x20 [bgcolor=#FFFF00]
     363      RenderText at (0,0) size 156x18
     364        text run at (0,0) width 156: "After Generated Content"
  • trunk/LayoutTests/platform/mac/fast/multicol/span/span-as-immediate-columns-child-dynamic-expected.txt

    r149210 r160908  
    1 layer at (0,0) size 785x2572
     1layer at (0,0) size 785x2590
    22  RenderView at (0,0) size 785x600
    3 layer at (0,0) size 785x2572
    4   RenderBlock {HTML} at (0,0) size 785x2572
    5     RenderBody {BODY} at (8,16) size 769x2540
     3layer at (0,0) size 785x2590
     4  RenderBlock {HTML} at (0,0) size 785x2590
     5    RenderBody {BODY} at (8,16) size 769x2558
    66layer at (8,16) size 760x382
    77  RenderBlock {DIV} at (0,0) size 760x382 [border: (5px solid #800000)]
     
    153153layer at (13,1265) size 750x126
    154154  RenderBlock (anonymous multi-column) at (5,5) size 750x126
    155     RenderBlock (anonymous) at (0,0) size 367x234
    156       RenderText {#text} at (0,0) size 363x234
    157         text run at (0,0) width 354: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
    158         text run at (0,18) width 351: "Nulla varius enim ac mi. Curabitur sollicitudin felis quis"
    159         text run at (0,36) width 325: "lectus. Quisque adipiscing rhoncus sem. Proin nulla"
    160         text run at (0,54) width 358: "purus, vulputate vel, varius ut, euismod et, nisi. Sed vitae"
    161         text run at (0,72) width 343: "felis vel orci sagittis aliquam. Cras convallis adipiscing"
    162         text run at (0,90) width 340: "sem. Nam nonummy enim. Nullam bibendum lobortis"
    163         text run at (0,108) width 344: "neque. Vestibulum velit orci, tempus euismod, pretium"
    164         text run at (0,126) width 343: "quis, interdum vitae, nulla. Phasellus eget ante et tortor"
    165         text run at (0,144) width 343: "condimentum vestibulum. Suspendisse hendrerit quam"
    166         text run at (0,162) width 362: "nec felis. Sed varius turpis vitae pede. Lorem ipsum dolor"
    167         text run at (0,180) width 233: "sit amet, consectetuer adipiscing elit. "
    168         text run at (233,180) width 121: "Lorem ipsum dolor"
    169         text run at (0,198) width 363: "sit amet, consectetuer adipiscing elit. Nulla varius enim ac"
    170         text run at (0,216) width 20: "mi."
     155    RenderText {#text} at (0,0) size 363x234
     156      text run at (0,0) width 354: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
     157      text run at (0,18) width 351: "Nulla varius enim ac mi. Curabitur sollicitudin felis quis"
     158      text run at (0,36) width 325: "lectus. Quisque adipiscing rhoncus sem. Proin nulla"
     159      text run at (0,54) width 358: "purus, vulputate vel, varius ut, euismod et, nisi. Sed vitae"
     160      text run at (0,72) width 343: "felis vel orci sagittis aliquam. Cras convallis adipiscing"
     161      text run at (0,90) width 340: "sem. Nam nonummy enim. Nullam bibendum lobortis"
     162      text run at (0,108) width 344: "neque. Vestibulum velit orci, tempus euismod, pretium"
     163      text run at (0,126) width 343: "quis, interdum vitae, nulla. Phasellus eget ante et tortor"
     164      text run at (0,144) width 343: "condimentum vestibulum. Suspendisse hendrerit quam"
     165      text run at (0,162) width 362: "nec felis. Sed varius turpis vitae pede. Lorem ipsum dolor"
     166      text run at (0,180) width 233: "sit amet, consectetuer adipiscing elit. "
     167      text run at (233,180) width 121: "Lorem ipsum dolor"
     168      text run at (0,198) width 363: "sit amet, consectetuer adipiscing elit. Nulla varius enim ac"
     169      text run at (0,216) width 20: "mi."
    171170layer at (13,1457) size 750x214
    172171  RenderBlock (anonymous multi-column) at (5,197) size 750x214
     
    258257        text run at (0,162) width 362: "nec felis. Sed varius turpis vitae pede. Lorem ipsum dolor"
    259258        text run at (0,180) width 229: "sit amet, consectetuer adipiscing elit."
    260 layer at (8,2124) size 760x432
    261   RenderBlock {DIV} at (0,2108) size 760x432 [border: (5px solid #800000)]
     259layer at (8,2124) size 760x450
     260  RenderBlock {DIV} at (0,2108) size 760x450 [border: (5px solid #800000)]
    262261    RenderBlock (anonymous multi-column span) at (5,253) size 750x66
    263262      RenderBlock {H2} at (0,19) size 750x28 [bgcolor=#EEEEEE]
    264263        RenderText {#text} at (0,0) size 276x28
    265264          text run at (0,0) width 276: "This is a spanning element."
     265    RenderBlock (anonymous) at (5,337) size 750x18
     266      RenderBlock {SPAN} at (0,0) size 750x18
     267        RenderText {#text} at (0,0) size 154x18
     268          text run at (0,0) width 154: "Nulla varius enim ac mi."
    266269layer at (13,2129) size 750x248
    267270  RenderBlock (anonymous multi-column) at (5,5) size 750x248
     
    296299        text run at (0,162) width 362: "nec felis. Sed varius turpis vitae pede. Lorem ipsum dolor"
    297300        text run at (0,180) width 229: "sit amet, consectetuer adipiscing elit."
    298 layer at (13,2443) size 750x108
    299   RenderBlock (anonymous multi-column) at (5,319) size 750x108
    300     RenderBlock (anonymous) at (0,0) size 367x18
    301       RenderInline {SPAN} at (0,0) size 354x18
    302         RenderText {#text} at (0,0) size 354x18
    303           text run at (0,0) width 354: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
    304     RenderBlock (anonymous) at (0,18) size 367x18
    305       RenderBlock {SPAN} at (0,0) size 367x18
    306         RenderText {#text} at (0,0) size 154x18
    307           text run at (0,0) width 154: "Nulla varius enim ac mi."
    308     RenderBlock (anonymous) at (0,36) size 367x180
    309       RenderInline {SPAN} at (0,0) size 362x180
    310         RenderText {#text} at (0,0) size 362x180
    311           text run at (0,0) width 362: "Curabitur sollicitudin felis quis lectus. Quisque adipiscing"
    312           text run at (0,18) width 350: "rhoncus sem. Proin nulla purus, vulputate vel, varius ut,"
    313           text run at (0,36) width 350: "euismod et, nisi. Sed vitae felis vel orci sagittis aliquam."
    314           text run at (0,54) width 332: "Cras convallis adipiscing sem. Nam nonummy enim."
    315           text run at (0,72) width 351: "Nullam bibendum lobortis neque. Vestibulum velit orci,"
    316           text run at (0,90) width 329: "tempus euismod, pretium quis, interdum vitae, nulla."
    317           text run at (0,108) width 339: "Phasellus eget ante et tortor condimentum vestibulum."
    318           text run at (0,126) width 345: "Suspendisse hendrerit quam nec felis. Sed varius turpis"
    319           text run at (0,144) width 331: "vitae pede. Lorem ipsum dolor sit amet, consectetuer"
    320           text run at (0,162) width 91: "adipiscing elit."
    321       RenderText {#text} at (0,0) size 0x0
     301layer at (13,2443) size 750x18
     302  RenderBlock (anonymous multi-column) at (5,319) size 750x18
     303    RenderInline {SPAN} at (0,0) size 354x18
     304      RenderText {#text} at (0,0) size 354x18
     305        text run at (0,0) width 354: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
     306layer at (13,2479) size 750x90
     307  RenderBlock (anonymous multi-column) at (5,355) size 750x90
     308    RenderInline {SPAN} at (0,0) size 362x180
     309      RenderText {#text} at (0,0) size 362x180
     310        text run at (0,0) width 362: "Curabitur sollicitudin felis quis lectus. Quisque adipiscing"
     311        text run at (0,18) width 350: "rhoncus sem. Proin nulla purus, vulputate vel, varius ut,"
     312        text run at (0,36) width 350: "euismod et, nisi. Sed vitae felis vel orci sagittis aliquam."
     313        text run at (0,54) width 332: "Cras convallis adipiscing sem. Nam nonummy enim."
     314        text run at (0,72) width 351: "Nullam bibendum lobortis neque. Vestibulum velit orci,"
     315        text run at (0,90) width 329: "tempus euismod, pretium quis, interdum vitae, nulla."
     316        text run at (0,108) width 339: "Phasellus eget ante et tortor condimentum vestibulum."
     317        text run at (0,126) width 345: "Suspendisse hendrerit quam nec felis. Sed varius turpis"
     318        text run at (0,144) width 331: "vitae pede. Lorem ipsum dolor sit amet, consectetuer"
     319        text run at (0,162) width 91: "adipiscing elit."
     320    RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/fast/multicol/span/span-as-nested-columns-child-dynamic-expected.txt

    r149210 r160908  
    132132        text run at (0,196) width 229: "sit amet, consectetuer adipiscing elit."
    133133    RenderBlock {SPAN} at (0,246) size 367x36 [color=#FFFFFF] [bgcolor=#000000]
    134       RenderBlock (anonymous) at (0,0) size 367x36
    135         RenderText {#text} at (0,0) size 354x36
    136           text run at (0,0) width 354: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
    137           text run at (0,18) width 154: "Nulla varius enim ac mi."
     134      RenderText {#text} at (0,0) size 354x36
     135        text run at (0,0) width 354: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
     136        text run at (0,18) width 154: "Nulla varius enim ac mi."
    138137layer at (13,1106) size 750x222
    139138  RenderBlock (anonymous multi-column) at (5,229) size 750x222
    140     RenderBlock {SPAN} at (0,16) size 367x198 [color=#FFFFFF] [bgcolor=#000000]
     139    RenderBlock {SPAN} at (0,16) size 367x190 [color=#FFFFFF] [bgcolor=#000000]
    141140      RenderBlock {P} at (0,0) size 367x198
    142141        RenderText {#text} at (0,0) size 362x198
     
    152151          text run at (0,162) width 362: "nec felis. Sed varius turpis vitae pede. Lorem ipsum dolor"
    153152          text run at (0,180) width 229: "sit amet, consectetuer adipiscing elit."
     153      RenderBlock (anonymous) at (0,206) size 367x0
     154        RenderText {#text} at (0,0) size 0x0
    154155    RenderBlock (anonymous) at (0,222) size 367x198
    155156      RenderText {#text} at (0,0) size 362x198
  • trunk/LayoutTests/platform/mac/fast/ruby/ruby-base-merge-block-children-crash-expected.txt

    r95924 r160908  
    77        RenderRubyRun (anonymous) at (0,0) size 64x16
    88          RenderRubyBase (anonymous) at (0,0) size 64x16
    9             RenderBlock (anonymous) at (0,0) size 64x16
    10               RenderText {#text} at (0,0) size 64x16
    11                 text run at (0,0) width 64: "PASS"
    12               RenderInline {I} at (0,0) size 0x0
    13                 RenderText {#text} at (0,0) size 0x0
    14             RenderBlock (anonymous) at (0,16) size 64x0
     9            RenderText {#text} at (0,0) size 64x16
     10              text run at (0,0) width 64: "PASS"
     11            RenderInline {I} at (0,0) size 0x0
     12              RenderText {#text} at (0,0) size 0x0
     13            RenderInline {I} at (0,0) size 0x0
    1514              RenderInline {SPAN} at (0,0) size 0x0
    1615                RenderInline {SPAN} at (0,0) size 0x0
    1716                  RenderText {#text} at (0,0) size 0x0
    1817                  RenderText {#text} at (0,0) size 0x0
    19             RenderBlock (anonymous) at (0,16) size 64x0
    20               RenderInline {I} at (0,0) size 0x0
     18            RenderInline {I} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug113235-1-expected.txt

    r149210 r160908  
    1414                RenderInline {FONT} at (0,0) size 0x0
    1515                  RenderText {#text} at (0,0) size 0x0
    16               RenderBlock (anonymous) at (2,2) size 715x11374
     16              RenderBlock (anonymous) at (2,2) size 715x52
    1717                RenderTable {TABLE} at (0,0) size 566x52 [border: (1px outset #808080)]
    1818                  RenderTableSection {TBODY} at (1,1) size 564x50
     
    2626                        RenderText {#text} at (2,2) size 107x17
    2727                          text run at (2,2) width 107: "Search again..."
    28                 RenderBlock (anonymous) at (0,52) size 715x15
     28              RenderBlock (anonymous) at (2,54) size 715x15
     29                RenderInline {FONT} at (0,0) size 715x15
    2930                  RenderText {#text} at (0,0) size 715x15
    3031                    text run at (0,0) width 332: "This text node only exists once in the original document! "
     
    3233                    text run at (639,0) width 76: "hang forever."
    3334                  RenderInline {A} at (0,0) size 0x0
    34                 RenderBlock {H2} at (0,83) size 715x23
     35              RenderBlock (anonymous) at (2,85) size 715x11291
     36                RenderBlock {H2} at (0,0) size 715x23
    3537                  RenderInline {A} at (0,0) size 169x22
    3638                    RenderText {#text} at (0,0) size 169x22
    3739                      text run at (0,0) width 169: "Table of Contents"
    38                 RenderBlock {P} at (0,122) size 715x150
     40                RenderBlock {P} at (0,39) size 715x150
    3941                  RenderInline {B} at (0,0) size 76x15
    4042                    RenderInline {A} at (0,0) size 76x15 [color=#0000EE]
     
    8991                      text run at (0,135) width 217: "Related Documentation for This Book"
    9092                  RenderText {#text} at (0,0) size 0x0
    91                 RenderBlock {P} at (0,285) size 715x990
     93                RenderBlock {P} at (0,202) size 715x990
    9294                  RenderInline {B} at (0,0) size 58x15
    9395                    RenderInline {A} at (0,0) size 58x15 [color=#0000EE]
     
    478480                      text run at (0,975) width 100: "Table Collocation"
    479481                  RenderText {#text} at (0,0) size 0x0
    480                 RenderBlock {P} at (0,1288) size 715x1995
     482                RenderBlock {P} at (0,1205) size 715x1995
    481483                  RenderInline {B} at (0,0) size 123x15
    482484                    RenderInline {A} at (0,0) size 123x15 [color=#0000EE]
     
    12691271                      text run at (0,1980) width 58: "Examples"
    12701272                  RenderText {#text} at (0,0) size 0x0
    1271                 RenderBlock {P} at (0,3296) size 715x1935
     1273                RenderBlock {P} at (0,3213) size 715x1935
    12721274                  RenderInline {B} at (0,0) size 62x15
    12731275                    RenderInline {A} at (0,0) size 62x15 [color=#0000EE]
     
    20362038                      text run at (0,1920) width 136: "User-Defined Functions"
    20372039                  RenderText {#text} at (0,0) size 0x0
    2038                 RenderBlock {P} at (0,5244) size 715x345
     2040                RenderBlock {P} at (0,5161) size 715x345
    20392041                  RenderInline {B} at (0,0) size 48x15
    20402042                    RenderInline {A} at (0,0) size 48x15 [color=#0000EE]
     
    21672169                      text run at (0,330) width 185: "Examples of a select-statement"
    21682170                  RenderText {#text} at (0,0) size 0x0
    2169                 RenderBlock {P} at (0,5602) size 715x1770
     2171                RenderBlock {P} at (0,5519) size 715x1770
    21702172                  RenderInline {B} at (0,0) size 100x15
    21712173                    RenderInline {A} at (0,0) size 100x15 [color=#0000EE]
     
    28682870                      text run at (0,1755) width 75: "WHENEVER"
    28692871                  RenderText {#text} at (0,0) size 0x0
    2870                 RenderBlock {P} at (0,7385) size 715x300
     2872                RenderBlock {P} at (0,7302) size 715x300
    28712873                  RenderInline {B} at (0,0) size 102x15
    28722874                    RenderInline {A} at (0,0) size 102x15 [color=#0000EE]
     
    29812983                      text run at (0,285) width 105: "WHILE Statement"
    29822984                  RenderText {#text} at (0,0) size 0x0
    2983                 RenderBlock {P} at (0,7698) size 715x15
     2985                RenderBlock {P} at (0,7615) size 715x15
    29842986                  RenderInline {B} at (0,0) size 150x15
    29852987                    RenderInline {A} at (0,0) size 150x15 [color=#0000EE]
     
    29872989                        text run at (0,0) width 150: "Appendix A. SQL Limits"
    29882990                  RenderBR {BR} at (150,12) size 0x0
    2989                 RenderBlock {P} at (0,7726) size 715x90
     2991                RenderBlock {P} at (0,7643) size 715x90
    29902992                  RenderInline {B} at (0,0) size 274x15
    29912993                    RenderInline {A} at (0,0) size 274x15 [color=#0000EE]
     
    30163018                      text run at (0,75) width 325: "DB2 Enterprise - Extended Edition Usage of the SQLCA"
    30173019                  RenderText {#text} at (0,0) size 0x0
    3018                 RenderBlock {P} at (0,7829) size 715x165
     3020                RenderBlock {P} at (0,7746) size 715x165
    30193021                  RenderInline {B} at (0,0) size 264x15
    30203022                    RenderInline {A} at (0,0) size 264x15 [color=#0000EE]
     
    30753077                      text run at (0,150) width 153: "SQLLEN Field for Decimal"
    30763078                  RenderText {#text} at (0,0) size 0x0
    3077                 RenderBlock {P} at (0,8007) size 715x1095
     3079                RenderBlock {P} at (0,7924) size 715x1095
    30783080                  RenderInline {B} at (0,0) size 168x15
    30793081                    RenderInline {A} at (0,0) size 168x15 [color=#0000EE]
     
    35063508                      text run at (0,1080) width 116: "SYSSTAT.TABLES"
    35073509                  RenderText {#text} at (0,0) size 0x0
    3508                 RenderBlock {P} at (0,9115) size 715x165
     3510                RenderBlock {P} at (0,9032) size 715x165
    35093511                  RenderInline {B} at (0,0) size 362x15
    35103512                    RenderInline {A} at (0,0) size 362x15 [color=#0000EE]
     
    35653567                      text run at (0,150) width 147: "OBJCAT.TRANSFORMS"
    35663568                  RenderText {#text} at (0,0) size 0x0
    3567                 RenderBlock {P} at (0,9293) size 715x240
     3569                RenderBlock {P} at (0,9210) size 715x240
    35683570                  RenderInline {B} at (0,0) size 197x15
    35693571                    RenderInline {A} at (0,0) size 197x15 [color=#0000EE]
     
    36543656                      text run at (0,225) width 184: "Considerations and Restrictions"
    36553657                  RenderText {#text} at (0,0) size 0x0
    3656                 RenderBlock {P} at (0,9546) size 715x390
     3658                RenderBlock {P} at (0,9463) size 715x390
    36573659                  RenderInline {B} at (0,0) size 233x15
    36583660                    RenderInline {A} at (0,0) size 233x15 [color=#0000EE]
     
    38033805                      text run at (0,375) width 92: "Walker Resume"
    38043806                  RenderText {#text} at (0,0) size 0x0
    3805                 RenderBlock {P} at (0,9949) size 715x90
     3807                RenderBlock {P} at (0,9866) size 715x90
    38063808                  RenderInline {B} at (0,0) size 369x15
    38073809                    RenderInline {A} at (0,0) size 369x15 [color=#0000EE]
     
    38323834                      text run at (0,75) width 198: "ISO/ANS SQL92 Reserved Words"
    38333835                  RenderText {#text} at (0,0) size 0x0
    3834                 RenderBlock {P} at (0,10052) size 715x15
     3836                RenderBlock {P} at (0,9969) size 715x15
    38353837                  RenderInline {B} at (0,0) size 269x15
    38363838                    RenderInline {A} at (0,0) size 269x15 [color=#0000EE]
     
    38383840                        text run at (0,0) width 269: "Appendix I. Comparison of Isolation Levels"
    38393841                  RenderBR {BR} at (269,12) size 0x0
    3840                 RenderBlock {P} at (0,10080) size 715x15
     3842                RenderBlock {P} at (0,9997) size 715x15
    38413843                  RenderInline {B} at (0,0) size 318x15
    38423844                    RenderInline {A} at (0,0) size 318x15 [color=#0000EE]
     
    38443846                        text run at (0,0) width 318: "Appendix J. Interaction of Triggers and Constraints"
    38453847                  RenderBR {BR} at (318,12) size 0x0
    3846                 RenderBlock {P} at (0,10108) size 715x315
     3848                RenderBlock {P} at (0,10025) size 715x315
    38473849                  RenderInline {B} at (0,0) size 270x15
    38483850                    RenderInline {A} at (0,0) size 270x15 [color=#0000EE]
     
    39633965                      text run at (0,300) width 225: "ADVISE_WORKLOAD Table Definition"
    39643966                  RenderText {#text} at (0,0) size 0x0
    3965                 RenderBlock {P} at (0,10436) size 715x15
     3967                RenderBlock {P} at (0,10353) size 715x15
    39663968                  RenderInline {B} at (0,0) size 227x15
    39673969                    RenderInline {A} at (0,0) size 227x15 [color=#0000EE]
     
    39693971                        text run at (0,0) width 227: "Appendix L. Explain Register Values"
    39703972                  RenderBR {BR} at (227,12) size 0x0
    3971                 RenderBlock {P} at (0,10464) size 715x75
     3973                RenderBlock {P} at (0,10381) size 715x75
    39723974                  RenderInline {B} at (0,0) size 308x15
    39733975                    RenderInline {A} at (0,0) size 308x15 [color=#0000EE]
     
    39923994                      text run at (0,60) width 169: "Example 3: Controlling Depth"
    39933995                  RenderText {#text} at (0,0) size 0x0
    3994                 RenderBlock {P} at (0,10552) size 715x75
     3996                RenderBlock {P} at (0,10469) size 715x75
    39953997                  RenderInline {B} at (0,0) size 187x15
    39963998                    RenderInline {A} at (0,0) size 187x15 [color=#0000EE]
     
    40154017                      text run at (0,60) width 179: "Querying the Exception Tables"
    40164018                  RenderText {#text} at (0,0) size 0x0
    4017                 RenderBlock {P} at (0,10640) size 715x330
     4019                RenderBlock {P} at (0,10557) size 715x330
    40184020                  RenderInline {B} at (0,0) size 420x15
    40194021                    RenderInline {A} at (0,0) size 420x15 [color=#0000EE]
     
    41404142                      text run at (0,315) width 63: "PREPARE"
    41414143                  RenderText {#text} at (0,0) size 0x0
    4142                 RenderBlock {P} at (0,10983) size 715x15
     4144                RenderBlock {P} at (0,10900) size 715x15
    41434145                  RenderInline {B} at (0,0) size 295x15
    41444146                    RenderInline {A} at (0,0) size 295x15 [color=#0000EE]
     
    41464148                        text run at (0,0) width 295: "Appendix P. BNF Specifications for DATALINKs"
    41474149                  RenderBR {BR} at (295,12) size 0x0
    4148                 RenderBlock {P} at (0,11011) size 715x180
     4150                RenderBlock {P} at (0,10928) size 715x180
    41494151                  RenderInline {B} at (0,0) size 217x15
    41504152                    RenderInline {A} at (0,0) size 217x15 [color=#0000EE]
     
    42114213                      text run at (0,165) width 168: "Searching Information Online"
    42124214                  RenderText {#text} at (0,0) size 0x0
    4213                 RenderBlock {P} at (0,11204) size 715x45
     4215                RenderBlock {P} at (0,11121) size 715x45
    42144216                  RenderInline {B} at (0,0) size 126x15
    42154217                    RenderInline {A} at (0,0) size 126x15 [color=#0000EE]
     
    42224224                      text run at (0,30) width 69: "Trademarks"
    42234225                  RenderText {#text} at (0,0) size 0x0
    4224                 RenderBlock {P} at (0,11262) size 715x15
     4226                RenderBlock {P} at (0,11179) size 715x15
    42254227                  RenderInline {B} at (0,0) size 34x15
    42264228                    RenderInline {A} at (0,0) size 34x15 [color=#0000EE]
     
    42284230                        text run at (0,0) width 34: "Index"
    42294231                  RenderBR {BR} at (34,12) size 0x0
    4230                 RenderBlock {P} at (0,11290) size 715x45
     4232                RenderBlock {P} at (0,11207) size 715x45
    42314233                  RenderInline {B} at (0,0) size 95x15
    42324234                    RenderInline {A} at (0,0) size 95x15 [color=#0000EE]
     
    42414243                  RenderInline {A} at (0,0) size 0x0
    42424244                  RenderText {#text} at (0,0) size 0x0
    4243                 RenderTable {TABLE} at (0,11348) size 26x26
     4245                RenderTable {TABLE} at (0,11265) size 26x26
    42444246                  RenderTableSection {TBODY} at (0,0) size 26x26
    42454247                    RenderTableRow {TR} at (0,2) size 26x0
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug647-expected.txt

    r155253 r160908  
    1919                          RenderInline {FONT} at (0,0) size 0x0
    2020                            RenderText {#text} at (0,0) size 0x0
    21                           RenderInline {FONT} at (0,0) size 0x0
    2221                        RenderBlock {CENTER} at (2,2) size 90x13
    2322                          RenderInline {FONT} at (0,0) size 24x13
     
    2524                              text run at (33,0) width 24: "inside"
    2625                          RenderText {#text} at (0,0) size 0x0
    27                         RenderBlock (anonymous) at (2,15) size 90x0
    2826                RenderBlock (anonymous) at (0,23) size 100x18
    2927                  RenderText {#text} at (10,0) size 80x18
  • trunk/LayoutTests/platform/mac/tables/mozilla/other/wa_table_tr_align-expected.txt

    r149210 r160908  
    235235                        text run at (0,18) width 294: "special effect on the row data since it simply"
    236236                        text run at (0,36) width 319: "reiterates the default horizontal row alignment!"
    237                   RenderInline {B} at (0,0) size 0x0
    238                     RenderInline {FONT} at (0,0) size 0x0 [color=#FF0000]
    239237                RenderBlock {P} at (2,72) size 336x0
    240238                  RenderInline {B} at (0,0) size 0x0
     
    281279                        text run at (0,18) width 297: "special effect on the row head since it simply"
    282280                        text run at (0,36) width 319: "reiterates the default horizontal row alignment!"
    283                   RenderInline {B} at (0,0) size 0x0
    284                     RenderInline {FONT} at (0,0) size 0x0 [color=#FF0000]
    285281                RenderBlock {P} at (2,72) size 336x0
    286282                  RenderInline {B} at (0,0) size 0x0
  • trunk/LayoutTests/plugins/plugin-remove-readystatechange-expected.txt

    r128524 r160908  
    11ALERT: PASS: element could not be re-appended
    22This test passes if it does not trip an assert in debug builds. It ensures a readystatechange event can't get dispatched until after a plugin is fully removed.
    3 
  • trunk/LayoutTests/svg/custom/system-language-crash-expected.txt

    r126657 r160908  
    11PASS: did not crash.
    2 
  • trunk/LayoutTests/transitions/equivalent-background-image-no-transition.html

    r120521 r160908  
    4242    });
    4343
    44     document.getElementById("foo").className="trans";
     44    setTimeout(function() { document.getElementById("foo").className="trans" }, 0);
    4545    </script>
    4646
  • trunk/LayoutTests/transitions/repeated-firing-background-color.html

    r141849 r160908  
    4141    });
    4242
    43     document.getElementById("foo").className="trans";
     43    setTimeout(function() { document.getElementById("foo").className="trans" }, 0);
    4444</script>
    4545
  • trunk/LayoutTests/transitions/transition-duration-cleared-in-transitionend-crash.html

    r120521 r160908  
    1414                    testRunner.notifyDone();
    1515            });
    16             el.style.cssText += ';-webkit-transition:background-color 0.2s;background-color:#fff'
     16            setTimeout(function() { el.style.cssText += ';-webkit-transition:background-color 0.2s;background-color:#fff' }, 0);
    1717        </script>
    1818    </body>
  • trunk/Source/WebCore/ChangeLog

    r160906 r160908  
     12013-12-19  Antti Koivisto  <antti@apple.com>
     2
     3        Create render tree lazily
     4        https://bugs.webkit.org/show_bug.cgi?id=120685
     5
     6        Reviewed by Andreas Kling.
     7
     8        We currently recompute style and construct renderer for each DOM node immediately after they are added to
     9        the tree. This is often inefficient as the style may change immediately afterwards and the work needs to be
     10        redone.
     11       
     12        With this patch we always compute style and construct render tree lazily, either on style recalc timer or
     13        synchronously when they are needed. It also removes the 'attached' bit. If document has render tree then
     14        all nodes are conceptually "attached" even if this happens lazily.
     15       
     16        The patch slightly changes behavior of implicit CSS transitions. A synchronous style change during parsing
     17        may not trigger the animation anymore as laziness means we don't see anything changing. This matches Firefox
     18        and Chrome in our test cases.
     19       
     20        * WebCore.exp.in:
     21        * bindings/js/JSNodeCustom.cpp:
     22        (WebCore::JSNode::insertBefore):
     23        (WebCore::JSNode::replaceChild):
     24        (WebCore::JSNode::appendChild):
     25       
     26            All attaching is now lazy, remove AttachLazily.
     27
     28        * css/CSSComputedStyleDeclaration.cpp:
     29        (WebCore::ComputedStyleExtractor::propertyValue):
     30       
     31            SVG renderers with !isValid() have empty display property value for some reason. Keep the behavior.
     32
     33        * dom/ContainerNode.cpp:
     34        (WebCore::ContainerNode::insertBefore):
     35        (WebCore::ContainerNode::parserInsertBefore):
     36        (WebCore::ContainerNode::replaceChild):
     37        (WebCore::ContainerNode::appendChild):
     38        (WebCore::ContainerNode::parserAppendChild):
     39        (WebCore::ContainerNode::updateTreeAfterInsertion):
     40        * dom/ContainerNode.h:
     41        * dom/Document.cpp:
     42        (WebCore::Document::~Document):
     43        (WebCore::Document::updateStyleIfNeeded):
     44        (WebCore::Document::createRenderTree):
     45        (WebCore::Document::destroyRenderTree):
     46       
     47            Remove attach bit maintenance.
     48
     49        (WebCore::Document::webkitDidExitFullScreenForElement):
     50       
     51            Do lazy render tree reconstruction after returning from full screen. That is the only reliable way
     52            to get the render tree back to decent shape.
     53
     54        * dom/Element.cpp:
     55        (WebCore::Element::isFocusable):
     56       
     57            Remove pointless !renderer()->needsLayout() assert.
     58
     59        (WebCore::Element::addShadowRoot):
     60        (WebCore::Element::childShouldCreateRenderer):
     61        (WebCore::Element::resetComputedStyle):
     62       
     63            Take care to reset computed style in all descendants. attachRenderTree no longer does this.
     64
     65        * dom/Element.h:
     66        * dom/Node.cpp:
     67        (WebCore::Node::insertBefore):
     68        (WebCore::Node::replaceChild):
     69        (WebCore::Node::appendChild):
     70        (WebCore::Node::setNeedsStyleRecalc):
     71       
     72            Propagate ReconstructRenderTree.
     73
     74        (WebCore::Node::attached):
     75       
     76            Emulate the behavior of old attached bit for now so existing code calling this mostly stays working.
     77
     78        * dom/Node.h:
     79       
     80            Add new ReconstructRenderTree value for StyleChangeType.
     81
     82        * dom/Range.cpp:
     83        (WebCore::Range::isPointInRange):
     84        (WebCore::Range::comparePoint):
     85        (WebCore::Range::compareNode):
     86        (WebCore::Range::intersectsNode):
     87        * editing/AppendNodeCommand.cpp:
     88        (WebCore::AppendNodeCommand::doApply):
     89        * editing/CompositeEditCommand.cpp:
     90        (WebCore::CompositeEditCommand::canRebalance):
     91        * editing/InsertNodeBeforeCommand.cpp:
     92        (WebCore::InsertNodeBeforeCommand::doApply):
     93        * html/HTMLDetailsElement.cpp:
     94        (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):
     95        * html/HTMLDocument.cpp:
     96        (WebCore::HTMLDocument::activeElement):
     97        * html/HTMLElement.cpp:
     98        (WebCore::HTMLElement::setInnerText):
     99       
     100            TextControlInnerTextElement always preserves newline even if it doesn't have style yet.
     101
     102        (WebCore::HTMLElement::supportsFocus):
     103        * html/HTMLEmbedElement.cpp:
     104        (WebCore::HTMLEmbedElement::parseAttribute):
     105        * html/HTMLFormControlElement.cpp:
     106        (WebCore::shouldAutofocus):
     107       
     108            Don't autofocus until we have renderer.
     109
     110        * html/HTMLFormControlElementWithState.cpp:
     111        (WebCore::HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState):
     112        * html/HTMLFrameElementBase.cpp:
     113        (WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions):
     114        * html/HTMLInputElement.cpp:
     115        (WebCore::HTMLInputElement::updateType):
     116       
     117            Lazy render tree construction.
     118
     119        (WebCore::HTMLInputElement::parseAttribute):
     120        (WebCore::HTMLInputElement::defaultEventHandler):
     121        * html/HTMLMediaElement.cpp:
     122        (WebCore::HTMLMediaElement::parseAttribute):
     123        * html/HTMLObjectElement.cpp:
     124        (WebCore::HTMLObjectElement::parseAttribute):
     125        * html/HTMLSummaryElement.cpp:
     126        (WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot):
     127        * html/parser/HTMLConstructionSite.cpp:
     128        (WebCore::executeTask):
     129       
     130            Don't attach renderer after construction.
     131
     132        * html/parser/HTMLTreeBuilder.cpp:
     133        (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
     134        * html/shadow/ContentDistributor.cpp:
     135        (WebCore::ContentDistributor::invalidateDistribution):
     136        * html/shadow/InsertionPoint.cpp:
     137        (WebCore::InsertionPoint::willAttachRenderers):
     138        (WebCore::InsertionPoint::willDetachRenderers):
     139        * html/shadow/MediaControlElements.cpp:
     140        (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
     141        * html/shadow/MediaControls.cpp:
     142        (WebCore::MediaControls::createTextTrackDisplay):
     143        * html/shadow/MediaControlsApple.cpp:
     144        (WebCore::MediaControlsApple::createControls):
     145        * html/track/TextTrackCue.cpp:
     146        (WebCore::TextTrackCue::getDisplayTree):
     147        * loader/PlaceholderDocument.cpp:
     148        (WebCore::PlaceholderDocument::createRenderTree):
     149        * loader/cache/CachedResourceLoader.cpp:
     150        (WebCore::CachedResourceLoader::preload):
     151        * style/StyleResolveTree.cpp:
     152        (WebCore::Style::attachTextRenderer):
     153        (WebCore::Style::detachTextRenderer):
     154       
     155            Remove attached bit maintenance.
     156
     157        (WebCore::Style::attachChildren):
     158        (WebCore::Style::attachShadowRoot):
     159        (WebCore::Style::attachRenderTree):
     160        (WebCore::Style::detachShadowRoot):
     161        (WebCore::Style::detachRenderTree):
     162        (WebCore::Style::resolveLocal):
     163        * svg/SVGTests.cpp:
     164        (WebCore::SVGTests::handleAttributeChange):
     165       
     166            Make lazy.
     167
     168        * testing/Internals.cpp:
     169        (WebCore::Internals::attached):
     170        (WebCore::Internals::elementRenderTreeAsText):
     171        (WebCore::Internals::markerAt):
     172        (WebCore::Internals::nodesFromRect):
     173
    11742013-12-20  Andreas Kling  <akling@apple.com>
    2175
  • trunk/Source/WebCore/WebCore.exp.in

    r160877 r160908  
    258258__ZN7WebCore13AXObjectCache42gAccessibilityEnhancedUserInterfaceEnabledE
    259259__ZN7WebCore13CharacterData7setDataERKN3WTF6StringERi
    260 __ZN7WebCore13ContainerNode11appendChildEN3WTF10PassRefPtrINS_4NodeEEERiNS_14AttachBehaviorE
     260__ZN7WebCore13ContainerNode11appendChildEN3WTF10PassRefPtrINS_4NodeEEERi
    261261__ZN7WebCore13ContainerNode11removeChildEPNS_4NodeERi
    262262__ZN7WebCore13GraphicsLayer11setChildrenERKN3WTF6VectorIPS0_Lm0ENS1_15CrashOnOverflowEEE
     
    952952__ZN7WebCore4IconD1Ev
    953953__ZN7WebCore4Node10renderRectEPb
    954 __ZN7WebCore4Node11appendChildEN3WTF10PassRefPtrIS0_EERiNS_14AttachBehaviorE
     954__ZN7WebCore4Node11appendChildEN3WTF10PassRefPtrIS0_EERi
    955955__ZN7WebCore4Node11removeChildEPS0_Ri
    956 __ZN7WebCore4Node12insertBeforeEN3WTF10PassRefPtrIS0_EEPS0_RiNS_14AttachBehaviorE
     956__ZN7WebCore4Node12insertBeforeEN3WTF10PassRefPtrIS0_EEPS0_Ri
    957957__ZN7WebCore4Node14removedLastRefEv
    958958__ZN7WebCore4Node14setTextContentERKN3WTF6StringERi
     
    11591159__ZN7WebCore8Document16shortcutIconURLsEv
    11601160__ZN7WebCore8Document17setFocusedElementEN3WTF10PassRefPtrINS_7ElementEEENS_14FocusDirectionE
     1161__ZN7WebCore8Document19updateStyleIfNeededEv
    11611162__ZN7WebCore8Document20styleResolverChangedENS_23StyleResolverUpdateFlagE
    11621163__ZN7WebCore8Document22createDocumentFragmentEv
  • trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp

    r157230 r160908  
    135135{
    136136    ExceptionCode ec = 0;
    137     bool ok = impl().insertBefore(toNode(exec->argument(0)), toNode(exec->argument(1)), ec, AttachLazily);
     137    bool ok = impl().insertBefore(toNode(exec->argument(0)), toNode(exec->argument(1)), ec);
    138138    setDOMException(exec, ec);
    139139    if (ok)
     
    145145{
    146146    ExceptionCode ec = 0;
    147     bool ok = impl().replaceChild(toNode(exec->argument(0)), toNode(exec->argument(1)), ec, AttachLazily);
     147    bool ok = impl().replaceChild(toNode(exec->argument(0)), toNode(exec->argument(1)), ec);
    148148    setDOMException(exec, ec);
    149149    if (ok)
     
    165165{
    166166    ExceptionCode ec = 0;
    167     bool ok = impl().appendChild(toNode(exec->argument(0)), ec, AttachLazily);
     167    bool ok = impl().appendChild(toNode(exec->argument(0)), ec);
    168168    setDOMException(exec, ec);
    169169    if (ok)
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r160765 r160908  
    5959#include "RenderStyle.h"
    6060#include "RenderView.h"
     61#include "SVGElement.h"
    6162#include "StyleInheritedData.h"
    6263#include "StyleProperties.h"
     
    17581759        }
    17591760
     1761        renderer = styledNode->renderer();
     1762
     1763#if ENABLE(SVG)
     1764        if (propertyID == CSSPropertyDisplay && !renderer && isSVGElement(*styledNode) && !toSVGElement(*styledNode).isValid())
     1765            return nullptr;
     1766#endif
    17601767        style = computeRenderStyleForProperty(styledNode, m_pseudoElementSpecifier, propertyID);
    1761         renderer = styledNode->renderer();
    17621768
    17631769        // FIXME: Some of these cases could be narrowed down or optimized better.
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r158739 r160908  
    259259}
    260260
    261 bool ContainerNode::insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode& ec, AttachBehavior attachBehavior)
     261bool ContainerNode::insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode& ec)
    262262{
    263263    // Check that this node is not "floating".
     
    271271    // insertBefore(node, 0) is equivalent to appendChild(node)
    272272    if (!refChild)
    273         return appendChild(newChild, ec, attachBehavior);
     273        return appendChild(newChild, ec);
    274274
    275275    // Make sure adding the new child is OK.
     
    318318        insertBeforeCommon(next.get(), child);
    319319
    320         updateTreeAfterInsertion(child, attachBehavior);
     320        updateTreeAfterInsertion(child);
    321321    }
    322322
     
    397397
    398398    ChildNodeInsertionNotifier(*this).notify(*newChild);
    399 }
    400 
    401 bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& ec, AttachBehavior attachBehavior)
     399
     400    newChild->setNeedsStyleRecalc(ReconstructRenderTree);
     401}
     402
     403bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& ec)
    402404{
    403405    // Check that this node is not "floating".
     
    479481        }
    480482
    481         updateTreeAfterInsertion(child, attachBehavior);
     483        updateTreeAfterInsertion(child);
    482484    }
    483485
     
    675677}
    676678
    677 bool ContainerNode::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, AttachBehavior attachBehavior)
     679bool ContainerNode::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec)
    678680{
    679681    Ref<ContainerNode> protect(*this);
     
    725727        }
    726728
    727         updateTreeAfterInsertion(child, attachBehavior);
     729        updateTreeAfterInsertion(child);
    728730    }
    729731
     
    758760
    759761    ChildNodeInsertionNotifier(*this).notify(*newChild);
     762
     763    newChild->setNeedsStyleRecalc(ReconstructRenderTree);
    760764}
    761765
     
    10661070}
    10671071
    1068 void ContainerNode::updateTreeAfterInsertion(Node& child, AttachBehavior attachBehavior)
     1072void ContainerNode::updateTreeAfterInsertion(Node& child)
    10691073{
    10701074    ASSERT(child.refCount());
     
    10761080    ChildNodeInsertionNotifier(*this).notify(child);
    10771081
    1078     // FIXME: Attachment should be the first operation in this function, but some code
    1079     // (for example, HTMLFormControlElement's autofocus support) requires this ordering.
    1080     if (attached() && !child.attached() && child.parentNode() == this) {
    1081         if (attachBehavior == AttachLazily) {
    1082             if (child.isElementNode())
    1083                 toElement(child).lazyAttach();
    1084             else if (child.isTextNode()) {
    1085                 child.setAttached(true);
    1086                 child.setNeedsStyleRecalc();
    1087             }
    1088         } else
    1089             attachChild(child);
    1090     }
     1082    child.setNeedsStyleRecalc(ReconstructRenderTree);
    10911083
    10921084    dispatchChildInsertionEvents(child);
  • trunk/Source/WebCore/dom/ContainerNode.h

    r159036 r160908  
    9191    Node* childNode(unsigned index) const;
    9292
    93     bool insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode& = ASSERT_NO_EXCEPTION, AttachBehavior = AttachNow);
    94     bool replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& = ASSERT_NO_EXCEPTION, AttachBehavior = AttachNow);
     93    bool insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode& = ASSERT_NO_EXCEPTION);
     94    bool replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& = ASSERT_NO_EXCEPTION);
    9595    bool removeChild(Node* child, ExceptionCode& = ASSERT_NO_EXCEPTION);
    96     bool appendChild(PassRefPtr<Node> newChild, ExceptionCode& = ASSERT_NO_EXCEPTION, AttachBehavior = AttachNow);
     96    bool appendChild(PassRefPtr<Node> newChild, ExceptionCode& = ASSERT_NO_EXCEPTION);
    9797
    9898    // These methods are only used during parsing.
     
    169169    void notifyChildRemoved(Node& child, Node* previousSibling, Node* nextSibling, ChildChangeSource);
    170170
    171     void updateTreeAfterInsertion(Node& child, AttachBehavior);
     171    void updateTreeAfterInsertion(Node& child);
    172172
    173173    bool isContainerNode() const WTF_DELETED_FUNCTION;
  • trunk/Source/WebCore/dom/Document.cpp

    r160847 r160908  
    560560    ASSERT(!m_inPageCache);
    561561    ASSERT(m_ranges.isEmpty());
    562     ASSERT(!m_styleRecalcTimer.isActive());
    563562    ASSERT(!m_parentTreeScope);
    564563
     
    17961795{
    17971796    ASSERT(isMainThread());
    1798     ASSERT(!view() || (!view()->isInLayout() && !view()->isPainting()));
     1797    ASSERT(!view() || !view()->isPainting());
     1798
     1799    if (!view() || view()->isInLayout())
     1800        return;
    17991801
    18001802    if (m_optimizedStyleSheetUpdateTimer.isActive())
     
    19661968    if (m_documentElement)
    19671969        Style::attachRenderTree(*m_documentElement);
    1968 
    1969     setAttached(true);
    19701970}
    19711971
     
    20602060
    20612061    clearChildNeedsStyleRecalc();
    2062     setAttached(false);
    20632062
    20642063    unscheduleStyleRecalc();
     
    54415440        m_fullScreenRenderer->unwrapRenderer();
    54425441
     5442    if (m_fullScreenElement->parentNode())
     5443        m_fullScreenElement->parentNode()->setNeedsStyleRecalc(ReconstructRenderTree);
     5444
    54435445    m_fullScreenElement = nullptr;
    54445446    scheduleForcedStyleRecalc();
  • trunk/Source/WebCore/dom/Element.cpp

    r160901 r160908  
    3737#include "DOMTokenList.h"
    3838#include "DocumentSharedObjectPool.h"
     39#include "ElementIterator.h"
    3940#include "ElementRareData.h"
    4041#include "EventDispatcher.h"
     
    462463    }
    463464
    464     if (renderer())
    465         ASSERT(!renderer()->needsLayout());
    466     else {
     465    if (!renderer()) {
    467466        // If the node is in a display:none tree it might say it needs style recalc but
    468467        // the whole document is actually up to date.
    469         ASSERT(!document().childNeedsStyleRecalc());
     468        ASSERT(!needsStyleRecalc() || !document().childNeedsStyleRecalc());
    470469    }
    471470
     
    14491448}
    14501449
    1451 void Element::lazyReattach(ShouldSetAttached shouldSetAttached)
    1452 {
    1453     if (attached())
    1454         Style::detachRenderTreeInReattachMode(*this);
    1455     lazyAttach(shouldSetAttached);
    1456 }
    1457 
    1458 void Element::lazyAttach(ShouldSetAttached shouldSetAttached)
    1459 {
    1460     for (Node* node = this; node; node = NodeTraversal::next(node, this)) {
    1461         if (!node->isTextNode() && !node->isElementNode())
    1462             continue;
    1463         if (node->hasChildNodes())
    1464             node->setChildNeedsStyleRecalc();
    1465         if (node->isElementNode())
    1466             toElement(node)->setStyleChange(FullStyleChange);
    1467         if (shouldSetAttached == SetAttached)
    1468             node->setAttached(true);
    1469     }
    1470     markAncestorsWithChildNeedsStyleRecalc();
    1471 }
    1472 
    14731450PassRef<RenderStyle> Element::styleForRenderer()
    14741451{
     
    15241501    // Element::recalcStyle.
    15251502    if (attached())
    1526         lazyReattach();
     1503        setNeedsStyleRecalc(ReconstructRenderTree);
    15271504
    15281505    InspectorInstrumentation::didPushShadowRoot(this, shadowRoot);
     
    25342511#if ENABLE(SVG)
    25352512    // Only create renderers for SVG elements whose parents are SVG elements, or for proper <svg xmlns="svgNS"> subdocuments.
    2536     if (child.isSVGElement())
    2537         return child.hasTagName(SVGNames::svgTag) || isSVGElement();
     2513    if (child.isSVGElement()) {
     2514        ASSERT(!isSVGElement());
     2515        return child.hasTagName(SVGNames::svgTag) && toSVGElement(child).isValid();
     2516    }
    25382517#endif
    25392518    return ContainerNode::childShouldCreateRenderer(child);
     
    29532932void Element::resetComputedStyle()
    29542933{
    2955     if (!hasRareData())
     2934    if (!hasRareData() || !elementRareData()->computedStyle())
    29562935        return;
    29572936    elementRareData()->resetComputedStyle();
     2937    for (auto& child : elementDescendants(*this)) {
     2938        if (child.hasRareData())
     2939            child.elementRareData()->resetComputedStyle();
     2940    }
    29582941}
    29592942
  • trunk/Source/WebCore/dom/Element.h

    r160679 r160908  
    305305    virtual void copyNonAttributePropertiesFromElement(const Element&) { }
    306306
    307     enum ShouldSetAttached {
    308         SetAttached,
    309         DoNotSetAttached
    310     };
    311     void lazyAttach(ShouldSetAttached = SetAttached);
    312     void lazyReattach(ShouldSetAttached = SetAttached);
     307    void lazyReattach();
    313308
    314309    virtual RenderElement* createRenderer(PassRef<RenderStyle>);
  • trunk/Source/WebCore/dom/Node.cpp

    r160901 r160908  
    421421}
    422422
    423 bool Node::insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode& ec, AttachBehavior attachBehavior)
     423bool Node::insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode& ec)
    424424{
    425425    if (!isContainerNode()) {
     
    427427        return false;
    428428    }
    429     return toContainerNode(this)->insertBefore(newChild, refChild, ec, attachBehavior);
    430 }
    431 
    432 bool Node::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& ec, AttachBehavior attachBehavior)
     429    return toContainerNode(this)->insertBefore(newChild, refChild, ec);
     430}
     431
     432bool Node::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& ec)
    433433{
    434434    if (!isContainerNode()) {
     
    436436        return false;
    437437    }
    438     return toContainerNode(this)->replaceChild(newChild, oldChild, ec, attachBehavior);
     438    return toContainerNode(this)->replaceChild(newChild, oldChild, ec);
    439439}
    440440
     
    448448}
    449449
    450 bool Node::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, AttachBehavior attachBehavior)
     450bool Node::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec)
    451451{
    452452    if (!isContainerNode()) {
     
    454454        return false;
    455455    }
    456     return toContainerNode(this)->appendChild(newChild, ec, attachBehavior);
     456    return toContainerNode(this)->appendChild(newChild, ec);
    457457}
    458458
     
    674674{
    675675    ASSERT(changeType != NoStyleChange);
    676     if (!attached()) // changed compared to what?
     676    if (changeType != ReconstructRenderTree && !attached()) // changed compared to what?
    677677        return;
    678678
     
    681681        setStyleChange(changeType);
    682682
    683     if (existingChangeType == NoStyleChange)
     683    if (existingChangeType == NoStyleChange || changeType == ReconstructRenderTree)
    684684        markAncestorsWithChildNeedsStyleRecalc();
    685685}
     
    22982298}
    22992299
     2300bool Node::attached() const
     2301{
     2302    // FIXME: This should go away along with the whole vague 'attached' concept. The conditions here produce
     2303    // roughly the old behavior based on an explicit attached bit.
     2304    return inDocument() && document().renderView() && (renderer() || styleChangeType() != ReconstructRenderTree);
     2305}
     2306
    23002307} // namespace WebCore
    23012308
  • trunk/Source/WebCore/dom/Node.h

    r160679 r160908  
    9898    InlineStyleChange = 1 << nodeStyleChangeShift,
    9999    FullStyleChange = 2 << nodeStyleChangeShift,
    100     SyntheticStyleChange = 3 << nodeStyleChangeShift
     100    SyntheticStyleChange = 3 << nodeStyleChangeShift,
     101    ReconstructRenderTree = 4 << nodeStyleChangeShift,
    101102};
    102103
     
    113114private:
    114115    RenderObject* m_renderer;
    115 };
    116 
    117 enum AttachBehavior {
    118     AttachNow,
    119     AttachLazily,
    120116};
    121117
     
    190186    // which will already know and hold a ref on the right node to return. Returning bool allows
    191187    // these methods to be more efficient since they don't need to return a ref
    192     bool insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode&, AttachBehavior = AttachNow);
    193     bool replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode&, AttachBehavior = AttachNow);
     188    bool insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode&);
     189    bool replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode&);
    194190    bool removeChild(Node* child, ExceptionCode&);
    195     bool appendChild(PassRefPtr<Node> newChild, ExceptionCode&, AttachBehavior = AttachNow);
     191    bool appendChild(PassRefPtr<Node> newChild, ExceptionCode&);
    196192
    197193    void remove(ExceptionCode&);
     
    314310    void setUserActionElement(bool flag) { setFlag(flag, IsUserActionElement); }
    315311
    316     bool attached() const { return getFlag(IsAttachedFlag); }
    317     void setAttached(bool flag) { setFlag(flag, IsAttachedFlag); }
     312    bool attached() const;
    318313    bool needsStyleRecalc() const { return styleChangeType() != NoStyleChange; }
    319314    StyleChangeType styleChangeType() const { return static_cast<StyleChangeType>(m_nodeFlags & StyleChangeMask); }
     
    573568        IsHTMLFlag = 1 << 4,
    574569        IsSVGFlag = 1 << 5,
    575         IsAttachedFlag = 1 << 6,
    576570        ChildNeedsStyleRecalcFlag = 1 << 7,
    577571        InDocumentFlag = 1 << 8,
     
    585579        IsParsingChildrenFinishedFlag = 1 << 13, // Element
    586580
    587         StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1),
    588         SelfOrAncestorHasDirAutoFlag = 1 << 16,
     581        StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1) | 1 << (nodeStyleChangeShift + 2),
    589582        IsEditingTextFlag = 1 << 17,
    590583        InNamedFlowFlag = 1 << 18,
     
    600593        ChildrenAffectedByDirectAdjacentRulesFlag = 1 << 27,
    601594        ChildrenAffectedByHoverRulesFlag = 1 << 28,
     595
     596        SelfOrAncestorHasDirAutoFlag = 1 << 29,
    602597
    603598        DefaultNodeFlags = IsParsingChildrenFinishedFlag
  • trunk/Source/WebCore/dom/Range.cpp

    r160679 r160908  
    312312    }
    313313
    314     if (!refNode->attached() || &refNode->document() != &ownerDocument()) {
     314    if (!refNode->inDocument() || &refNode->document() != &ownerDocument()) {
    315315        return false;
    316316    }
     
    341341    }
    342342
    343     if (!refNode->attached() || &refNode->document() != &ownerDocument()) {
     343    if (!refNode->inDocument() || &refNode->document() != &ownerDocument()) {
    344344        ec = WRONG_DOCUMENT_ERR;
    345345        return 0;
     
    377377    }
    378378   
    379     if (!m_start.container() && refNode->attached()) {
     379    if (!m_start.container() && refNode->inDocument()) {
    380380        ec = INVALID_STATE_ERR;
    381381        return NODE_BEFORE;
    382382    }
    383383
    384     if (m_start.container() && !refNode->attached()) {
     384    if (m_start.container() && !refNode->inDocument()) {
    385385        // Firefox doesn't throw an exception for this case; it returns 0.
    386386        return NODE_BEFORE;
     
    592592    }
    593593
    594     if (!refNode->attached() || &refNode->document() != &ownerDocument()) {
     594    if (!refNode->inDocument() || &refNode->document() != &ownerDocument()) {
    595595        // Firefox doesn't throw an exception for these cases; it returns false.
    596596        return false;
  • trunk/Source/WebCore/editing/AppendNodeCommand.cpp

    r154938 r160908  
    6262        return;
    6363
    64     m_parent->appendChild(m_node.get(), IGNORE_EXCEPTION, AttachLazily);
     64    m_parent->appendChild(m_node.get(), IGNORE_EXCEPTION);
    6565
    6666    if (AXObjectCache::accessibilityEnabled())
  • trunk/Source/WebCore/editing/CompositeEditCommand.cpp

    r158163 r160908  
    627627        return false;
    628628
     629    node->document().updateStyleIfNeeded();
     630
    629631    RenderObject* renderer = textNode->renderer();
    630632    if (renderer && !renderer->style().collapseWhiteSpace())
  • trunk/Source/WebCore/editing/InsertNodeBeforeCommand.cpp

    r154938 r160908  
    5656    ASSERT(parent->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable));
    5757
    58     parent->insertBefore(m_insertChild.get(), m_refChild.get(), IGNORE_EXCEPTION, AttachLazily);
     58    parent->insertBefore(m_insertChild.get(), m_refChild.get(), IGNORE_EXCEPTION);
    5959
    6060    if (AXObjectCache* cache = document().existingAXObjectCache())
  • trunk/Source/WebCore/html/HTMLDetailsElement.cpp

    r159036 r160908  
    118118void HTMLDetailsElement::didAddUserAgentShadowRoot(ShadowRoot* root)
    119119{
    120     root->appendChild(DetailsSummaryElement::create(document()), ASSERT_NO_EXCEPTION, AttachLazily);
    121     root->appendChild(DetailsContentElement::create(document()), ASSERT_NO_EXCEPTION, AttachLazily);
     120    root->appendChild(DetailsSummaryElement::create(document()), ASSERT_NO_EXCEPTION);
     121    root->appendChild(DetailsContentElement::create(document()), ASSERT_NO_EXCEPTION);
    122122}
    123123
  • trunk/Source/WebCore/html/HTMLDocument.cpp

    r160753 r160908  
    140140Element* HTMLDocument::activeElement()
    141141{
     142    document().updateStyleIfNeeded();
    142143    if (Element* element = treeScope().focusedElement())
    143144        return element;
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r160733 r160908  
    4040#include "Frame.h"
    4141#include "FrameLoader.h"
     42#include "FrameView.h"
    4243#include "HTMLBRElement.h"
    4344#include "HTMLCollection.h"
     
    479480    // For example, for the contents of textarea elements that are display:none?
    480481    auto r = renderer();
    481     if (r && r->style().preserveNewline()) {
     482    if ((r && r->style().preserveNewline()) || (inDocument() && isTextControlInnerTextElement())) {
    482483        if (!text.contains('\r')) {
    483484            replaceChildrenWithText(*this, text, ec);
     
    662663bool HTMLElement::supportsFocus() const
    663664{
     665    if (!document().view()->isInLayout())
     666        document().updateStyleIfNeeded();
    664667    return Element::supportsFocus() || (rendererIsEditable() && parentNode() && !parentNode()->rendererIsEditable());
    665668}
  • trunk/Source/WebCore/html/HTMLEmbedElement.cpp

    r159856 r160908  
    106106    else if (name == srcAttr) {
    107107        m_url = stripLeadingAndTrailingHTMLSpaces(value);
     108        document().updateStyleIfNeeded();
    108109        if (renderer() && isImageType()) {
    109110            if (!m_imageLoader)
  • trunk/Source/WebCore/html/HTMLFormControlElement.cpp

    r160733 r160908  
    171171static bool shouldAutofocus(HTMLFormControlElement* element)
    172172{
     173    if (!element->renderer())
     174        return false;
    173175    if (!element->fastHasAttribute(autofocusAttr))
    174176        return false;
    175     if (!element->renderer())
     177    if (!element->inDocument() || !element->document().renderView())
    176178        return false;
    177179    if (element->document().ignoreAutofocus())
  • trunk/Source/WebCore/html/HTMLFormControlElementWithState.cpp

    r156903 r160908  
    7878{
    7979    // We don't save/restore control state in a form with autocomplete=off.
    80     return attached() && shouldAutocomplete();
     80    return inDocument() && shouldAutocomplete();
    8181}
    8282
  • trunk/Source/WebCore/html/HTMLFrameElementBase.cpp

    r158962 r160908  
    163163        return;
    164164
    165     // JavaScript in src=javascript: and beforeonload can access the renderer
    166     // during attribute parsing *before* the normal parser machinery would
    167     // attach the element. To support this, we lazyAttach here, but only
    168     // if we don't already have a renderer (if we're inserted
    169     // as part of a DocumentFragment, insertedInto from an earlier element
    170     // could have forced a style resolve and already attached us).
    171165    if (!renderer())
    172         lazyAttach(DoNotSetAttached);
     166        setNeedsStyleRecalc(ReconstructRenderTree);
    173167    setNameAndOpenURL();
    174168}
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r160733 r160908  
    472472    m_inputType->destroyShadowSubtree();
    473473
    474     bool wasAttached = attached();
    475     if (wasAttached)
    476         Style::detachRenderTree(*this);
    477 
    478474    m_inputType = std::move(newType);
    479475    m_inputType->createShadowSubtree();
     
    524520    }
    525521
    526     if (wasAttached) {
    527         Style::attachRenderTree(*this);
    528         if (document().focusedElement() == this)
    529             updateFocusAppearance(true);
    530     }
     522    if (renderer())
     523        setNeedsStyleRecalc(ReconstructRenderTree);
     524
     525    if (document().focusedElement() == this)
     526        updateFocusAppearance(true);
    531527
    532528    if (ShadowRoot* shadowRoot = shadowRootOfParentForDistribution(this))
     
    689685        // FIXME: Detaching just for maxResults change is not ideal.  We should figure out the right
    690686        // time to relayout for this change.
    691         if (m_maxResults != oldResults && (m_maxResults <= 0 || oldResults <= 0) && attached())
     687        if (m_maxResults != oldResults && (m_maxResults <= 0 || oldResults <= 0) && renderer())
    692688            Style::reattachRenderTree(*this);
    693689        setNeedsStyleRecalc();
     
    746742            m_inputType->destroyShadowSubtree();
    747743            m_inputType->createShadowSubtree();
    748             if (!attached())
    749                 Style::attachRenderTree(*this);
     744            Style::attachRenderTree(*this);
    750745        } else {
    751746            m_inputType->destroyShadowSubtree();
     
    12031198    }
    12041199
     1200    document().updateStyleIfNeeded();
    12051201    m_inputType->forwardEvent(evt);
    12061202
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r160755 r160908  
    735735void HTMLMediaElement::willAttachRenderers()
    736736{
    737     ASSERT(!attached());
     737    ASSERT(!renderer());
    738738
    739739#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     
    51075107        mediaControls->enteredFullscreen();
    51085108
    5109     ensureUserAgentShadowRoot().appendChild(mediaControls, ASSERT_NO_EXCEPTION, AttachLazily);
     5109    ensureUserAgentShadowRoot().appendChild(mediaControls, ASSERT_NO_EXCEPTION);
    51105110
    51115111    if (!controls() || !inDocument())
  • trunk/Source/WebCore/html/HTMLObjectElement.cpp

    r160733 r160908  
    116116    } else if (name == dataAttr) {
    117117        m_url = stripLeadingAndTrailingHTMLSpaces(value);
     118        document().updateStyleIfNeeded();
    118119        if (renderer()) {
    119120            setNeedsWidgetUpdate(true);
  • trunk/Source/WebCore/html/HTMLSummaryElement.cpp

    r159604 r160908  
    8080void HTMLSummaryElement::didAddUserAgentShadowRoot(ShadowRoot* root)
    8181{
    82     root->appendChild(DetailsMarkerControl::create(document()), ASSERT_NO_EXCEPTION, AttachLazily);
    83     root->appendChild(SummaryContentElement::create(document()), ASSERT_NO_EXCEPTION, AttachLazily);
     82    root->appendChild(DetailsMarkerControl::create(document()), ASSERT_NO_EXCEPTION);
     83    root->appendChild(SummaryContentElement::create(document()), ASSERT_NO_EXCEPTION);
    8484}
    8585
  • trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp

    r160182 r160908  
    9191    else
    9292        task.parent->parserAppendChild(task.child.get());
    93 
    94     // JavaScript run from beforeload (or DOM Mutation or event handlers)
    95     // might have removed the child, in which case we should not attach it.
    96 
    97     if (task.child->parentNode() && task.parent->attached() && !task.child->attached()) {
    98         if (task.child->isElementNode())
    99             Style::attachRenderTree(*toElement(task.child.get()));
    100         else if (task.child->isTextNode())
    101             Style::attachTextRenderer(*toText(task.child.get()));
    102     }
    10393
    10494    task.child->beginParsingChildren();
  • trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp

    r160753 r160908  
    16041604                parent->parserRemoveChild(*lastNode->element());
    16051605            node->element()->parserAppendChild(lastNode->element());
    1606             if (lastNode->element()->parentElement()->attached() && !lastNode->element()->attached())
    1607                 lastNode->element()->lazyAttach();
    16081606            // 9.10
    16091607            lastNode = node;
     
    16251623            ASSERT(lastNode->stackItem()->isElementNode());
    16261624            ASSERT(lastNode->element()->parentNode());
    1627             if (lastNode->element()->parentNode()->attached() && !lastNode->element()->attached())
    1628                 lastNode->element()->lazyAttach();
    16291625        }
    16301626        // 11.
  • trunk/Source/WebCore/html/shadow/ContentDistributor.cpp

    r158650 r160908  
    145145    bool needsReattach = didNeedInvalidation ? invalidate(host) : false;
    146146
    147     if (needsReattach && host->attached()) {
    148         for (Element* element = ElementTraversal::firstWithin(host); element; element = ElementTraversal::nextSibling(element))
    149             element->lazyReattach();
    150         host->setNeedsStyleRecalc();
    151     }
     147    if (needsReattach)
     148        host->setNeedsStyleRecalc(ReconstructRenderTree);
    152149
    153150    if (didNeedInvalidation) {
  • trunk/Source/WebCore/html/shadow/InsertionPoint.cpp

    r158650 r160908  
    5656        ContentDistributor::ensureDistribution(shadowRoot);
    5757    for (Node* current = firstDistributed(); current; current = nextDistributedTo(current)) {
    58         if (current->attached())
    59             continue;
    6058        if (current->isTextNode()) {
     59            if (current->renderer())
     60                continue;
    6161            Style::attachTextRenderer(*toText(current));
    6262            continue;
    6363        }
    64         if (current->isElementNode())
     64        if (current->isElementNode()) {
     65            if (current->renderer())
     66                Style::detachRenderTree(*toElement(current));
    6567            Style::attachRenderTree(*toElement(current));
     68        }
    6669    }
    6770}
     
    6972void InsertionPoint::willDetachRenderers()
    7073{
    71     if (ShadowRoot* shadowRoot = containingShadowRoot())
    72         ContentDistributor::ensureDistribution(shadowRoot);
    73 
    7474    for (Node* current = firstDistributed(); current; current = nextDistributedTo(current)) {
    7575        if (current->isTextNode()) {
  • trunk/Source/WebCore/html/shadow/MediaControlElements.cpp

    r160733 r160908  
    12911291        if (displayBox->hasChildNodes() && !contains(displayBox.get())) {
    12921292            // Note: the display tree of a cue is removed when the active flag of the cue is unset.
    1293             appendChild(displayBox, ASSERT_NO_EXCEPTION, AttachNow);
     1293            appendChild(displayBox, ASSERT_NO_EXCEPTION);
    12941294            cue->setFontSize(m_fontSize, m_videoDisplaySize.size(), m_fontSizeIsImportant);
    12951295        }
  • trunk/Source/WebCore/html/shadow/MediaControls.cpp

    r160599 r160908  
    393393
    394394    // Insert it before the first controller element so it always displays behind the controls.
    395     insertBefore(textDisplayContainer.release(), m_panel, IGNORE_EXCEPTION, AttachLazily);
     395    insertBefore(textDisplayContainer.release(), m_panel, IGNORE_EXCEPTION);
    396396}
    397397
  • trunk/Source/WebCore/html/shadow/MediaControlsApple.cpp

    r160599 r160908  
    7474    RefPtr<MediaControlRewindButtonElement> rewindButton = MediaControlRewindButtonElement::create(document);
    7575    controls->m_rewindButton = rewindButton.get();
    76     panel->appendChild(rewindButton.release(), ec, AttachLazily);
     76    panel->appendChild(rewindButton.release(), ec);
    7777    if (ec)
    7878        return 0;
     
    8080    RefPtr<MediaControlPlayButtonElement> playButton = MediaControlPlayButtonElement::create(document);
    8181    controls->m_playButton = playButton.get();
    82     panel->appendChild(playButton.release(), ec, AttachLazily);
     82    panel->appendChild(playButton.release(), ec);
    8383    if (ec)
    8484        return 0;
     
    8686    RefPtr<MediaControlReturnToRealtimeButtonElement> returnToRealtimeButton = MediaControlReturnToRealtimeButtonElement::create(document);
    8787    controls->m_returnToRealTimeButton = returnToRealtimeButton.get();
    88     panel->appendChild(returnToRealtimeButton.release(), ec, AttachLazily);
     88    panel->appendChild(returnToRealtimeButton.release(), ec);
    8989    if (ec)
    9090        return 0;
     
    9393        RefPtr<MediaControlStatusDisplayElement> statusDisplay = MediaControlStatusDisplayElement::create(document);
    9494        controls->m_statusDisplay = statusDisplay.get();
    95         panel->appendChild(statusDisplay.release(), ec, AttachLazily);
     95        panel->appendChild(statusDisplay.release(), ec);
    9696        if (ec)
    9797            return 0;
     
    102102    RefPtr<MediaControlCurrentTimeDisplayElement> currentTimeDisplay = MediaControlCurrentTimeDisplayElement::create(document);
    103103    controls->m_currentTimeDisplay = currentTimeDisplay.get();
    104     timelineContainer->appendChild(currentTimeDisplay.release(), ec, AttachLazily);
     104    timelineContainer->appendChild(currentTimeDisplay.release(), ec);
    105105    if (ec)
    106106        return 0;
     
    108108    RefPtr<MediaControlTimelineElement> timeline = MediaControlTimelineElement::create(document, controls.get());
    109109    controls->m_timeline = timeline.get();
    110     timelineContainer->appendChild(timeline.release(), ec, AttachLazily);
     110    timelineContainer->appendChild(timeline.release(), ec);
    111111    if (ec)
    112112        return 0;
     
    114114    RefPtr<MediaControlTimeRemainingDisplayElement> timeRemainingDisplay = MediaControlTimeRemainingDisplayElement::create(document);
    115115    controls->m_timeRemainingDisplay = timeRemainingDisplay.get();
    116     timelineContainer->appendChild(timeRemainingDisplay.release(), ec, AttachLazily);
     116    timelineContainer->appendChild(timeRemainingDisplay.release(), ec);
    117117    if (ec)
    118118        return 0;
    119119
    120120    controls->m_timelineContainer = timelineContainer.get();
    121     panel->appendChild(timelineContainer.release(), ec, AttachLazily);
     121    panel->appendChild(timelineContainer.release(), ec);
    122122    if (ec)
    123123        return 0;
     
    126126    RefPtr<MediaControlSeekBackButtonElement> seekBackButton = MediaControlSeekBackButtonElement::create(document);
    127127    controls->m_seekBackButton = seekBackButton.get();
    128     panel->appendChild(seekBackButton.release(), ec, AttachLazily);
     128    panel->appendChild(seekBackButton.release(), ec);
    129129    if (ec)
    130130        return 0;
     
    133133    RefPtr<MediaControlSeekForwardButtonElement> seekForwardButton = MediaControlSeekForwardButtonElement::create(document);
    134134    controls->m_seekForwardButton = seekForwardButton.get();
    135     panel->appendChild(seekForwardButton.release(), ec, AttachLazily);
     135    panel->appendChild(seekForwardButton.release(), ec);
    136136    if (ec)
    137137        return 0;
     
    142142        RefPtr<MediaControlClosedCaptionsTrackListElement> closedCaptionsTrackList = MediaControlClosedCaptionsTrackListElement::create(document, controls.get());
    143143        controls->m_closedCaptionsTrackList = closedCaptionsTrackList.get();
    144         closedCaptionsContainer->appendChild(closedCaptionsTrackList.release(), ec, AttachLazily);
     144        closedCaptionsContainer->appendChild(closedCaptionsTrackList.release(), ec);
    145145        if (ec)
    146146            return 0;
     
    148148        RefPtr<MediaControlToggleClosedCaptionsButtonElement> toggleClosedCaptionsButton = MediaControlToggleClosedCaptionsButtonElement::create(document, controls.get());
    149149        controls->m_toggleClosedCaptionsButton = toggleClosedCaptionsButton.get();
    150         panel->appendChild(toggleClosedCaptionsButton.release(), ec, AttachLazily);
     150        panel->appendChild(toggleClosedCaptionsButton.release(), ec);
    151151        if (ec)
    152152            return 0;
    153153
    154154        controls->m_closedCaptionsContainer = closedCaptionsContainer.get();
    155         controls->appendChild(closedCaptionsContainer.release(), ec, AttachLazily);
     155        controls->appendChild(closedCaptionsContainer.release(), ec);
    156156        if (ec)
    157157            return 0;
     
    161161    RefPtr<MediaControlFullscreenButtonElement> fullScreenButton = MediaControlFullscreenButtonElement::create(document);
    162162    controls->m_fullScreenButton = fullScreenButton.get();
    163     panel->appendChild(fullScreenButton.release(), ec, AttachLazily);
     163    panel->appendChild(fullScreenButton.release(), ec);
    164164
    165165    // The mute button and the slider element should be in the same div.
     
    171171        RefPtr<MediaControlPanelVolumeSliderElement> slider = MediaControlPanelVolumeSliderElement::create(document);
    172172        controls->m_volumeSlider = slider.get();
    173         volumeSliderContainer->appendChild(slider.release(), ec, AttachLazily);
     173        volumeSliderContainer->appendChild(slider.release(), ec);
    174174        if (ec)
    175175            return 0;
     
    179179        RefPtr<MediaControlVolumeSliderMuteButtonElement> volumeSliderMuteButton = MediaControlVolumeSliderMuteButtonElement::create(document);
    180180        controls->m_volumeSliderMuteButton = volumeSliderMuteButton.get();
    181         volumeSliderContainer->appendChild(volumeSliderMuteButton.release(), ec, AttachLazily);
     181        volumeSliderContainer->appendChild(volumeSliderMuteButton.release(), ec);
    182182
    183183        if (ec)
     
    185185
    186186        controls->m_volumeSliderContainer = volumeSliderContainer.get();
    187         panelVolumeControlContainer->appendChild(volumeSliderContainer.release(), ec, AttachLazily);
     187        panelVolumeControlContainer->appendChild(volumeSliderContainer.release(), ec);
    188188        if (ec)
    189189            return 0;
     
    192192    RefPtr<MediaControlPanelMuteButtonElement> panelMuteButton = MediaControlPanelMuteButtonElement::create(document, controls.get());
    193193    controls->m_panelMuteButton = panelMuteButton.get();
    194     panelVolumeControlContainer->appendChild(panelMuteButton.release(), ec, AttachLazily);
    195     if (ec)
    196         return 0;
    197 
    198     panel->appendChild(panelVolumeControlContainer, ec, AttachLazily);
     194    panelVolumeControlContainer->appendChild(panelMuteButton.release(), ec);
     195    if (ec)
     196        return 0;
     197
     198    panel->appendChild(panelVolumeControlContainer, ec);
    199199    if (ec)
    200200        return 0;
     
    203203    RefPtr<MediaControlFullscreenVolumeMinButtonElement> fullScreenMinVolumeButton = MediaControlFullscreenVolumeMinButtonElement::create(document);
    204204    controls->m_fullScreenMinVolumeButton = fullScreenMinVolumeButton.get();
    205     panel->appendChild(fullScreenMinVolumeButton.release(), ec, AttachLazily);
     205    panel->appendChild(fullScreenMinVolumeButton.release(), ec);
    206206    if (ec)
    207207        return 0;
     
    209209    RefPtr<MediaControlFullscreenVolumeSliderElement> fullScreenVolumeSlider = MediaControlFullscreenVolumeSliderElement::create(document);
    210210    controls->m_fullScreenVolumeSlider = fullScreenVolumeSlider.get();
    211     panel->appendChild(fullScreenVolumeSlider.release(), ec, AttachLazily);
     211    panel->appendChild(fullScreenVolumeSlider.release(), ec);
    212212    if (ec)
    213213        return 0;
     
    215215    RefPtr<MediaControlFullscreenVolumeMaxButtonElement> fullScreenMaxVolumeButton = MediaControlFullscreenVolumeMaxButtonElement::create(document);
    216216    controls->m_fullScreenMaxVolumeButton = fullScreenMaxVolumeButton.get();
    217     panel->appendChild(fullScreenMaxVolumeButton.release(), ec, AttachLazily);
     217    panel->appendChild(fullScreenMaxVolumeButton.release(), ec);
    218218    if (ec)
    219219        return 0;
    220220
    221221    controls->m_panel = panel.get();
    222     controls->appendChild(panel.release(), ec, AttachLazily);
     222    controls->appendChild(panel.release(), ec);
    223223    if (ec)
    224224        return 0;
  • trunk/Source/WebCore/html/track/TextTrackCue.cpp

    r160777 r160908  
    826826    // Note: This is contained by default in m_cueBackgroundBox.
    827827    m_cueBackgroundBox->setPseudo(cueShadowPseudoId());
    828     displayTree->appendChild(m_cueBackgroundBox, ASSERT_NO_EXCEPTION, AttachLazily);
     828    displayTree->appendChild(m_cueBackgroundBox, ASSERT_NO_EXCEPTION);
    829829
    830830    // FIXME(BUG 79916): Runs of children of WebVTT Ruby Objects that are not
  • trunk/Source/WebCore/loader/PlaceholderDocument.cpp

    r160598 r160908  
    3737    for (auto& child : elementChildren(*this))
    3838        Style::attachRenderTree(child);
    39 
    40     setAttached(true);
    4139}
    4240
  • trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp

    r160841 r160908  
    833833    // to making this behavior specific to iOS.
    834834#if !PLATFORM(IOS)
    835     bool hasRendering = m_document->body() && m_document->body()->renderer();
     835    bool hasRendering = m_document->body() && m_document->renderView();
    836836    bool canBlockParser = type == CachedResource::Script || type == CachedResource::CSSStyleSheet;
    837837    if (!hasRendering && !canBlockParser) {
  • trunk/Source/WebCore/style/StyleResolveTree.cpp

    r160138 r160908  
    406406    createTextRendererIfNeeded(textNode);
    407407
    408     textNode.setAttached(true);
    409408    textNode.clearNeedsStyleRecalc();
    410409}
     
    415414        textNode.renderer()->destroyAndCleanupAnonymousWrappers();
    416415    textNode.setRenderer(0);
    417     textNode.setAttached(false);
    418416}
    419417
     
    441439{
    442440    for (Node* child = current.firstChild(); child; child = child->nextSibling()) {
    443         ASSERT(!child->attached() || current.shadowRoot());
    444         if (child->attached())
     441        ASSERT(!child->renderer() || current.shadowRoot() || current.isInsertionPoint());
     442        if (child->renderer())
    445443            continue;
    446444        if (child->isTextNode()) {
     
    455453static void attachShadowRoot(ShadowRoot& shadowRoot)
    456454{
    457     if (shadowRoot.attached())
    458         return;
    459455    StyleResolver& styleResolver = shadowRoot.document().ensureStyleResolver();
    460456    styleResolver.pushParentShadowRoot(&shadowRoot);
     
    465461
    466462    shadowRoot.clearNeedsStyleRecalc();
    467     shadowRoot.setAttached(true);
     463    shadowRoot.clearChildNeedsStyleRecalc();
    468464}
    469465
     
    544540    attachChildren(current);
    545541
    546     current.setAttached(true);
    547542    current.clearNeedsStyleRecalc();
     543    current.clearChildNeedsStyleRecalc();
    548544
    549545    if (AXObjectCache* cache = current.document().axObjectCache())
     
    573569static void detachShadowRoot(ShadowRoot& shadowRoot, DetachType detachType)
    574570{
    575     if (!shadowRoot.attached())
    576         return;
    577571    detachChildren(shadowRoot, detachType);
    578 
    579     shadowRoot.setAttached(false);
    580572}
    581573
     
    602594        current.renderer()->destroyAndCleanupAnonymousWrappers();
    603595    current.setRenderer(0);
    604 
    605     current.setAttached(false);
    606596
    607597    if (current.hasCustomStyleResolveCallbacks())
     
    650640
    651641    Document& document = current.document();
    652     if (currentStyle) {
     642    if (currentStyle && current.styleChangeType() != ReconstructRenderTree) {
    653643        newStyle = current.styleForRenderer();
    654644        localChange = determineChange(currentStyle.get(), newStyle.get(), document.settings());
    655645    }
    656646    if (localChange == Detach) {
    657         if (current.attached())
     647        if (current.renderer() || current.inNamedFlow())
    658648            detachRenderTree(current, ReattachDetach);
    659649        attachRenderTree(current, newStyle.release());
  • trunk/Source/WebCore/svg/SVGTests.cpp

    r154903 r160908  
    157157        return true;
    158158
    159     bool valid = targetElement->isValid();
    160     bool attached = targetElement->attached();
    161     if (valid && !attached && targetElement->parentNode()->attached())
    162         Style::attachRenderTree(*targetElement);
    163     else if (!valid && attached)
    164         Style::detachRenderTree(*targetElement);
     159    targetElement->setNeedsStyleRecalc(ReconstructRenderTree);
    165160
    166161    return true;
  • trunk/Source/WebCore/testing/Internals.cpp

    r160671 r160908  
    487487}
    488488
     489// FIXME: Remove.
    489490bool Internals::attached(Node* node, ExceptionCode& ec)
    490491{
     
    494495    }
    495496
    496     return node->attached();
     497    return true;
    497498}
    498499
     
    503504        return String();
    504505    }
     506
     507    element->document().updateStyleIfNeeded();
    505508
    506509    String representation = externalRepresentation(element);
     
    750753DocumentMarker* Internals::markerAt(Node* node, const String& markerType, unsigned index, ExceptionCode& ec)
    751754{
     755    node->document().updateLayoutIgnorePendingStylesheets();
    752756    if (!node) {
    753757        ec = INVALID_ACCESS_ERR;
     
    12041208    if (!renderView)
    12051209        return 0;
     1210
     1211    document->updateLayoutIgnorePendingStylesheets();
    12061212
    12071213    float zoomFactor = frame->pageZoomFactor();
  • trunk/Source/WebKit/mac/WebView/WebHTMLView.mm

    r160152 r160908  
    30173017// minPageWidth==0 implies a non-printing layout
    30183018- (void)layoutToMinimumPageWidth:(float)minPageLogicalWidth height:(float)minPageLogicalHeight originalPageWidth:(float)originalPageWidth originalPageHeight:(float)originalPageHeight maximumShrinkRatio:(float)maximumShrinkRatio adjustingViewSize:(BOOL)adjustViewSize
    3019 {   
     3019{
     3020    Frame* coreFrame = core([self _frame]);
     3021    if (!coreFrame)
     3022        return;
     3023    if (coreFrame->document()) {
     3024        if (coreFrame->document()->inPageCache())
     3025            return;
     3026        coreFrame->document()->updateStyleIfNeeded();
     3027    }
     3028
    30203029    if (![self _needsLayout])
    30213030        return;
     
    30263035
    30273036    LOG(View, "%@ doing layout", self);
    3028 
    3029     Frame* coreFrame = core([self _frame]);
    3030     if (!coreFrame)
    3031         return;
    30323037
    30333038    if (FrameView* coreView = coreFrame->view()) {
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r160818 r160908  
    17761776    CurrentEvent currentEvent(keyboardEvent);
    17771777
     1778    Frame& frame = m_page->focusController().focusedOrMainFrame();
     1779    frame.document()->updateStyleIfNeeded();
     1780
    17781781    handled = handleKeyEvent(keyboardEvent, m_page.get());
    17791782    if (!handled)
Note: See TracChangeset for help on using the changeset viewer.