Chromium Code Reviews| Index: Source/core/dom/NamedFlow.cpp |
| diff --git a/Source/core/dom/NamedFlow.cpp b/Source/core/dom/NamedFlow.cpp |
| index 4f4d2044d32a3aa2a2dd88d1a37c8872ae99bfdf..ed9f449d02a988ddbe269599e2e15d21fcb719eb 100644 |
| --- a/Source/core/dom/NamedFlow.cpp |
| +++ b/Source/core/dom/NamedFlow.cpp |
| @@ -31,7 +31,9 @@ |
| #include "core/dom/NamedFlow.h" |
| #include "RuntimeEnabledFeatures.h" |
| +#include "core/css/CSSRegion.h" |
| #include "core/dom/NamedFlowCollection.h" |
| +#include "core/dom/Range.h" |
| #include "core/dom/StaticNodeList.h" |
| #include "core/events/ThreadLocalEventNames.h" |
| #include "core/events/UIEvent.h" |
| @@ -117,12 +119,12 @@ int NamedFlow::firstEmptyRegionIndex() const |
| return -1; |
| } |
| -PassRefPtr<NodeList> NamedFlow::getRegionsByContent(Node* contentNode) |
| +Vector<RefPtr<CSSRegion>> NamedFlow::getRegionsByContent(Node* contentNode) |
| { |
| - Vector<RefPtr<Node> > regionNodes; |
| + Vector<RefPtr<CSSRegion>> regionObjects; |
|
Inactive
2013/10/25 17:51:48
C++11?
|
| if (!contentNode) |
| - return StaticNodeList::adopt(regionNodes); |
| + return regionObjects; |
| if (m_flowManager->document()) |
| m_flowManager->document()->updateLayoutIgnorePendingStylesheets(); |
| @@ -130,7 +132,7 @@ PassRefPtr<NodeList> NamedFlow::getRegionsByContent(Node* contentNode) |
| // The renderer may be destroyed or created after the style update. |
| // Because this is called from JS, where the wrapper keeps a reference to the NamedFlow, no guard is necessary. |
| if (!m_parentFlowThread) |
| - return StaticNodeList::adopt(regionNodes); |
| + return regionObjects; |
| if (inFlowThread(contentNode->renderer(), m_parentFlowThread)) { |
| const RenderRegionList& regionList = m_parentFlowThread->renderRegionList(); |
| @@ -141,16 +143,16 @@ PassRefPtr<NodeList> NamedFlow::getRegionsByContent(Node* contentNode) |
| if (renderRegion->isPseudoElement()) |
| continue; |
| if (m_parentFlowThread->objectInFlowRegion(contentNode->renderer(), renderRegion)) |
| - regionNodes.append(renderRegion->node()); |
| + regionObjects.append(CSSRegion::create(renderRegion)); |
| } |
| } |
| - return StaticNodeList::adopt(regionNodes); |
| + return regionObjects; |
| } |
| -PassRefPtr<NodeList> NamedFlow::getRegions() |
| +Vector<RefPtr<CSSRegion>> NamedFlow::getRegions() |
| { |
| - Vector<RefPtr<Node> > regionNodes; |
| + Vector<RefPtr<CSSRegion>> regionObjects; |
| if (m_flowManager->document()) |
| m_flowManager->document()->updateLayoutIgnorePendingStylesheets(); |
| @@ -158,7 +160,7 @@ PassRefPtr<NodeList> NamedFlow::getRegions() |
| // The renderer may be destroyed or created after the style update. |
| // Because this is called from JS, where the wrapper keeps a reference to the NamedFlow, no guard is necessary. |
| if (!m_parentFlowThread) |
| - return StaticNodeList::adopt(regionNodes); |
| + return regionObjects; |
| const RenderRegionList& regionList = m_parentFlowThread->renderRegionList(); |
| for (RenderRegionList::const_iterator iter = regionList.begin(); iter != regionList.end(); ++iter) { |
| @@ -167,10 +169,10 @@ PassRefPtr<NodeList> NamedFlow::getRegions() |
| // http://dev.w3.org/csswg/css-regions/#the-region-interface |
| if (renderRegion->isPseudoElement()) |
| continue; |
| - regionNodes.append(renderRegion->node()); |
| + regionObjects.append(CSSRegion::create(renderRegion)); |
| } |
| - return StaticNodeList::adopt(regionNodes); |
| + return regionObjects; |
| } |
| PassRefPtr<NodeList> NamedFlow::getContent() |