Changeset 111229 in webkit
- Timestamp:
- Mar 19, 2012 1:24:14 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r111227 r111229 1 2012-03-19 Mihnea Ovidenie <mihnea@adobe.com> 2 3 [CSSRegions]Implement NamedFlow::contentNodes attribute 4 https://bugs.webkit.org/show_bug.cgi?id=80134 5 6 Reviewed by David Hyatt. 7 8 The named flow content nodes collection contains those nodes with webkitFlowInto property set to 'flow'. 9 In the list, the nodes are placed in document order. Nodes with display:none are also part of the list. 10 The list of nodes is returned as a static node list. 11 12 * fast/regions/webkit-named-flow-content-nodes-expected.txt: Added. 13 * fast/regions/webkit-named-flow-content-nodes.html: Added. 14 1 15 2012-03-19 Xingnan Wang <xingnan.wang@intel.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r111227 r111229 1 2012-03-19 Mihnea Ovidenie <mihnea@adobe.com> 2 3 [CSSRegions]Implement NamedFlow::contentNodes attribute 4 https://bugs.webkit.org/show_bug.cgi?id=80134 5 6 Reviewed by David Hyatt. 7 8 The named flow content nodes collection contains those nodes with webkitFlowInto property set to 'flow'. 9 In the list, the nodes are placed in document order. Nodes with display:none are also part of the list. 10 The list of nodes is returned as a static node list. 11 12 Test: fast/regions/webkit-named-flow-content-nodes.html 13 14 * dom/Document.cpp: 15 (WebCore::Document::webkitGetFlowByName): 16 * dom/Document.h: 17 * dom/Element.cpp: 18 (WebCore::Element::detach): 19 * dom/NodeRenderingContext.cpp: 20 (WebCore::NodeRenderingContext::moveToFlowThreadIfNeeded): 21 * dom/WebKitNamedFlow.cpp: 22 (WebCore::WebKitNamedFlow::contentNodes): 23 (WebCore): 24 (WebCore::WebKitNamedFlow::registerContentNode): 25 * dom/WebKitNamedFlow.h: 26 (WebCore): 27 (WebKitNamedFlow): 28 (WebCore::WebKitNamedFlow::unregisterContentNode): 29 * dom/WebKitNamedFlow.idl: 30 1 31 2012-03-19 Xingnan Wang <xingnan.wang@intel.com> 2 32 -
trunk/Source/WebCore/dom/Document.cpp
r111126 r111229 1040 1040 PassRefPtr<WebKitNamedFlow> Document::webkitGetFlowByName(const String& flowName) 1041 1041 { 1042 if (!cssRegionsEnabled() || flowName.isEmpty() || !validFlowName(flowName) || !renderer()) 1042 return webkitGetFlowByName(flowName, CheckFlowNameForInvalidValues); 1043 } 1044 1045 PassRefPtr<WebKitNamedFlow> Document::webkitGetFlowByName(const String& flowName, FlowNameCheck flowNameCheck) 1046 { 1047 if (!cssRegionsEnabled() || !renderer()) 1043 1048 return 0; 1044 1049 1045 // Make a slower check for invalid flow name 1046 CSSParser p(true); 1047 if (!p.parseFlowThread(flowName, this)) 1048 return 0; 1050 if (flowNameCheck == CheckFlowNameForInvalidValues) { 1051 if (flowName.isEmpty() || !validFlowName(flowName)) 1052 return 0; 1053 1054 // Make a slower check for invalid flow name 1055 CSSParser parser(true); 1056 if (!parser.parseFlowThread(flowName, this)) 1057 return 0; 1058 } 1049 1059 1050 1060 if (RenderView* view = renderer()->view()) -
trunk/Source/WebCore/dom/Document.h
r111048 r111229 353 353 354 354 bool cssRegionsEnabled() const; 355 enum FlowNameCheck { 356 CheckFlowNameForInvalidValues, 357 DoNotCheckFlowNameForInvalidValues 358 }; 355 359 PassRefPtr<WebKitNamedFlow> webkitGetFlowByName(const String&); 360 PassRefPtr<WebKitNamedFlow> webkitGetFlowByName(const String&, FlowNameCheck); 356 361 357 362 bool regionBasedColumnsEnabled() const; -
trunk/Source/WebCore/dom/Element.cpp
r111176 r111229 67 67 #include "Text.h" 68 68 #include "TextIterator.h" 69 #include "WebKitAnimationList.h" 69 70 #include "WebKitMutationObserver.h" 70 #include "WebKit AnimationList.h"71 #include "WebKitNamedFlow.h" 71 72 #include "XMLNSNames.h" 72 73 #include "XMLNames.h" … … 980 981 RenderWidget::suspendWidgetHierarchyUpdates(); 981 982 983 if (document()->cssRegionsEnabled()) { 984 RenderStyle* style = renderer() ? renderer()->style() : computedStyle(); 985 if (style && !style->flowThread().isEmpty()) { 986 RefPtr<WebKitNamedFlow> namedFlow = document()->webkitGetFlowByName(style->flowThread(), Document::DoNotCheckFlowNameForInvalidValues); 987 if (namedFlow) 988 namedFlow->unregisterContentNode(this); 989 } 990 } 991 982 992 cancelFocusAppearanceUpdate(); 983 993 if (hasRareData()) -
trunk/Source/WebCore/dom/NodeRenderingContext.cpp
r110161 r111229 39 39 #include "ShadowRoot.h" 40 40 #include "ShadowTree.h" 41 #include "WebKitNamedFlow.h" 41 42 42 43 #if ENABLE(SVG) … … 328 329 ASSERT(m_node->document()->renderView()); 329 330 m_parentFlowRenderer = m_node->document()->renderView()->ensureRenderFlowThreadWithName(m_flowThread); 331 m_parentFlowRenderer->ensureNamedFlow()->registerContentNode(m_node); 330 332 } 331 333 -
trunk/Source/WebCore/dom/WebKitNamedFlow.cpp
r110639 r111229 31 31 #include "WebKitNamedFlow.h" 32 32 33 #include "Node.h" 34 #include "NodeList.h" 33 35 #include "RenderFlowThread.h" 36 #include "StaticNodeList.h" 34 37 35 38 namespace WebCore { … … 50 53 } 51 54 55 PassRefPtr<NodeList> WebKitNamedFlow::contentNodes() const 56 { 57 m_parentFlowThread->document()->updateLayoutIgnorePendingStylesheets(); 58 59 Vector<RefPtr<Node> > contentNodes; 60 for (NamedFlowContentNodes::const_iterator it = m_contentNodes.begin(); it != m_contentNodes.end(); ++it) { 61 Node* node = const_cast<Node*>(*it); 62 ASSERT(node->computedStyle()->flowThread() == m_parentFlowThread->flowThread()); 63 contentNodes.append(node); 64 } 65 66 return StaticNodeList::adopt(contentNodes); 67 } 68 69 // The content nodes list contains those nodes with -webkit-flow-into: flow. 70 // An element with display:none should also be listed among those nodes. 71 // The list of nodes is orderer. 72 void WebKitNamedFlow::registerContentNode(Node* contentNode) 73 { 74 ASSERT(contentNode && contentNode->isElementNode()); 75 76 // Find the first content node following the new content node. 77 for (NamedFlowContentNodes::iterator it = m_contentNodes.begin(); it != m_contentNodes.end(); ++it) { 78 Node* node = *it; 79 unsigned short position = contentNode->compareDocumentPosition(node); 80 if (position & Node::DOCUMENT_POSITION_FOLLOWING) { 81 m_contentNodes.insertBefore(node, contentNode); 82 return; 83 } 84 } 85 m_contentNodes.add(contentNode); 86 } 87 52 88 } // namespace WebCore 53 89 -
trunk/Source/WebCore/dom/WebKitNamedFlow.h
r110639 r111229 31 31 #define WebKitNamedFlow_h 32 32 33 #include <Node.h> 34 #include <wtf/ListHashSet.h> 33 35 #include <wtf/RefCounted.h> 34 36 #include <wtf/RefPtr.h> … … 36 38 namespace WebCore { 37 39 40 class NodeList; 38 41 class RenderFlowThread; 39 42 … … 48 51 49 52 bool overflow() const; 53 PassRefPtr<NodeList> contentNodes() const; 54 55 void registerContentNode(Node* contentNode); 56 void unregisterContentNode(Node* contentNode) { m_contentNodes.remove(contentNode); } 50 57 51 58 private: … … 53 60 54 61 RenderFlowThread* m_parentFlowThread; 62 63 typedef ListHashSet<Node*> NamedFlowContentNodes; 64 NamedFlowContentNodes m_contentNodes; 55 65 }; 56 66 -
trunk/Source/WebCore/dom/WebKitNamedFlow.idl
r110639 r111229 33 33 ] WebKitNamedFlow { 34 34 readonly attribute boolean overflow; 35 readonly attribute NodeList contentNodes; 35 36 }; 36 37 }
Note: See TracChangeset
for help on using the changeset viewer.