Skip to content
  • mihnea@adobe.com's avatar
    [CSSRegions]Implement NamedFlow::contentNodes attribute · a230a172
    mihnea@adobe.com authored
    https://bugs.webkit.org/show_bug.cgi?id=80134
    
    Reviewed by David Hyatt.
    
    Source/WebCore:
    
    The named flow content nodes collection contains those nodes with webkitFlowInto property set to 'flow'.
    In the list, the nodes are placed in document order. Nodes with display:none are also part of the list.
    The list of nodes is returned as a static node list.
    
    The content nodes are stored in RenderNamedFlowThread. The content nodes are added to the list in NodeRenderingContext::moveToFlowThreadIfNeeded
    and removed from the list in Element::detach. When an element -webkit-flow-into property is changed, the element is detached and attached.
    I have also added a bit in NodeFlags to mark that an element is part of a named flow (and the corresponding inNamedFlow/setInNamedFlow/clearInNamedFlow functions).
    
    Test: fast/regions/webkit-named-flow-content-nodes.html
    
    * dom/Document.cpp:
    (WebCore::Document::webkitGetFlowByName):
    * dom/Document.h:
    * dom/Element.cpp:
    (WebCore::Element::detach):
    * dom/Node.h:
    (WebCore::Node::inNamedFlow):
    (WebCore::Node::setInNamedFlow):
    (WebCore::Node::clearInNamedFlow):
    (Node):
    * dom/NodeRenderingContext.cpp:
    (WebCore::NodeRenderingContext::moveToFlowThreadIfNeeded):
    * dom/WebKitNamedFlow.cpp:
    (WebCore::WebKitNamedFlow::contentNodes):
    (WebCore):
    * dom/WebKitNamedFlow.h:
    (WebKitNamedFlow):
    * dom/WebKitNamedFlow.idl:
    * rendering/FlowThreadController.cpp:
    (WebCore::FlowThreadController::registerNamedFlowContentNode):
    (WebCore):
    (WebCore::FlowThreadController::unregisterNamedFlowContentNode):
    * rendering/FlowThreadController.h:
    (FlowThreadController):
    * rendering/RenderNamedFlowThread.cpp:
    (WebCore):
    (WebCore::RenderNamedFlowThread::registerNamedFlowContentNode):
    (WebCore::RenderNamedFlowThread::unregisterNamedFlowContentNode):
    * rendering/RenderNamedFlowThread.h:
    (WebCore):
    (RenderNamedFlowThread):
    (WebCore::RenderNamedFlowThread::contentNodes):
    (WebCore::RenderNamedFlowThread::hasContentNode):
    
    LayoutTests:
    
    * fast/regions/webkit-named-flow-content-nodes-expected.txt: Added.
    * fast/regions/webkit-named-flow-content-nodes.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    a230a172