Changeset 124772 in webkit
- Timestamp:
- Aug 6, 2012, 8:24:17 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r124771 r124772 1 2012-08-06 Andrei Bucur <abucur@adobe.com> 2 3 [CSS Regions] Add the NamedFlow.getRegions() API 4 https://bugs.webkit.org/show_bug.cgi?id=93240 5 6 Reviewed by Andreas Kling. 7 8 Link to spec: http://www.w3.org/TR/2012/WD-css3-regions-20120503/#dom-named-flow 9 The test also verifies the regions are returned in document order. 10 11 * fast/regions/webkit-named-flow-get-regions-expected.txt: Added. 12 * fast/regions/webkit-named-flow-get-regions.html: Added. 13 1 14 2012-08-06 Andrei Bucur <abucur@adobe.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r124771 r124772 1 2012-08-06 Andrei Bucur <abucur@adobe.com> 2 3 [CSS Regions] Add the NamedFlow.getRegions() API 4 https://bugs.webkit.org/show_bug.cgi?id=93240 5 6 Reviewed by Andreas Kling. 7 8 This patch adds the NamedFlow.getRegions() API call as specified by http://www.w3.org/TR/2012/WD-css3-regions-20120503/#dom-named-flow . 9 For now, WebKit supports only one type of regions, Element. The Region interface will be introduced when other interfaces will be capable 10 of becoming regions. 11 12 New test: fast/regions/webkit-named-flow-get-regions.html 13 14 * dom/WebKitNamedFlow.cpp: 15 (WebCore::WebKitNamedFlow::getRegionsByContent): Add a check not to include the pseudo-elements that are regions; those don't have a node attached. 16 (WebCore::WebKitNamedFlow::getRegions): 17 (WebCore): 18 * dom/WebKitNamedFlow.h: 19 (WebKitNamedFlow): 20 * dom/WebKitNamedFlow.idl: 21 1 22 2012-08-06 Andrei Bucur <abucur@adobe.com> 2 23 -
trunk/Source/WebCore/dom/WebKitNamedFlow.cpp
r124350 r124772 118 118 for (RenderRegionList::const_iterator iter = regionList.begin(); iter != regionList.end(); ++iter) { 119 119 const RenderRegion* renderRegion = *iter; 120 if (!renderRegion->isValid()) 120 // FIXME: Pseudo-elements are not included in the list 121 if (!renderRegion->isValid() || !renderRegion->node()) 121 122 continue; 122 123 if (m_parentFlowThread->objectInFlowRegion(contentNode->renderer(), renderRegion)) 123 124 regionNodes.append(renderRegion->node()); 124 125 } 126 } 127 128 return StaticNodeList::adopt(regionNodes); 129 } 130 131 PassRefPtr<NodeList> WebKitNamedFlow::getRegions() 132 { 133 Vector<RefPtr<Node> > regionNodes; 134 135 if (m_flowManager->document()) 136 m_flowManager->document()->updateLayoutIgnorePendingStylesheets(); 137 138 // The renderer may be destroyed or created after the style update. 139 // Because this is called from JS, where the wrapper keeps a reference to the NamedFlow, no guard is necessary. 140 if (!m_parentFlowThread) 141 return StaticNodeList::adopt(regionNodes); 142 143 const RenderRegionList& regionList = m_parentFlowThread->renderRegionList(); 144 for (RenderRegionList::const_iterator iter = regionList.begin(); iter != regionList.end(); ++iter) { 145 const RenderRegion* renderRegion = *iter; 146 // FIXME: Pseudo-elements are not included in the list 147 if (!renderRegion->isValid() || !renderRegion->node()) 148 continue; 149 regionNodes.append(renderRegion->node()); 125 150 } 126 151 -
trunk/Source/WebCore/dom/WebKitNamedFlow.h
r124350 r124772 57 57 int firstEmptyRegionIndex() const; 58 58 PassRefPtr<NodeList> getRegionsByContent(Node*); 59 PassRefPtr<NodeList> getRegions(); 59 60 PassRefPtr<NodeList> getContent(); 60 61 -
trunk/Source/WebCore/dom/WebKitNamedFlow.idl
r124350 r124772 38 38 readonly attribute long firstEmptyRegionIndex; 39 39 NodeList getRegionsByContent(in Node contentNode); 40 NodeList getRegions(); 40 41 NodeList getContent(); 41 42
Note:
See TracChangeset
for help on using the changeset viewer.