Chromium Code Reviews| Index: Source/core/dom/Document.cpp |
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
| index 6d57dec3e71fe4aaf548661c663bab818b53eaee..b2eeb00168e4df58d8e9c1b2ecb573914223f16e 100644 |
| --- a/Source/core/dom/Document.cpp |
| +++ b/Source/core/dom/Document.cpp |
| @@ -87,6 +87,7 @@ |
| #include "core/dom/ScriptRunner.h" |
| #include "core/dom/ScriptedAnimationController.h" |
| #include "core/dom/SelectorQuery.h" |
| +#include "core/dom/StaticNodeList.h" |
| #include "core/dom/StyleEngine.h" |
| #include "core/dom/TouchList.h" |
| #include "core/dom/TransformSource.h" |
| @@ -100,6 +101,7 @@ |
| #include "core/editing/Editor.h" |
| #include "core/editing/FrameSelection.h" |
| #include "core/editing/SpellChecker.h" |
| +#include "core/editing/markup.h" |
| #include "core/events/BeforeUnloadEvent.h" |
| #include "core/events/Event.h" |
| #include "core/events/EventFactory.h" |
| @@ -5698,6 +5700,43 @@ Element* Document::activeElement() const |
| return body(); |
| } |
| +void Document::getTransitionElementData(Vector<TransitionElementData>& elementData, ExceptionState& exceptionState) |
| +{ |
| + if (!head()) |
| + return; |
| + |
| + for (HTMLMetaElement* metaElement = Traversal<HTMLMetaElement>::firstChild(*head()); metaElement; metaElement = Traversal<HTMLMetaElement>::nextSibling(*metaElement)) { |
| + if (metaElement->name() != "transition-elements") |
| + continue; |
| + |
| + const String& metaElementContents = metaElement->content().string(); |
| + size_t firstSemicolon = metaElementContents.find(';'); |
| + if (firstSemicolon == kNotFound) |
| + continue; |
| + |
| + AtomicString selector(metaElementContents.substring(0, firstSemicolon)); |
| + RefPtr<StaticNodeList> nodeList = querySelectorAll(selector, exceptionState); |
| + if (!nodeList || exceptionState.hadException()) |
|
esprehn
2014/07/17 19:10:43
You're reusing the same exceptionState repeatedly
oystein (OOO til 10th of July)
2014/07/17 21:15:06
Done.
|
| + continue; |
| + |
| + unsigned nodeListLength = nodeList->length(); |
| + if (!nodeListLength) |
| + continue; |
| + |
| + StringBuilder markup; |
| + for (unsigned nodeIndex = 0; nodeIndex < nodeListLength; ++nodeIndex) { |
| + Node* node = nodeList->item(nodeIndex); |
| + markup.append(createStyledMarkupForNavigationTransition(node)); |
| + } |
| + |
| + TransitionElementData newElements; |
| + newElements.scope = metaElementContents.substring(firstSemicolon + 1).stripWhiteSpace(); |
| + newElements.selector = selector; |
| + newElements.markup = markup.toString(); |
| + elementData.append(newElements); |
| + } |
| +} |
| + |
| bool Document::hasFocus() const |
| { |
| Page* page = this->page(); |