Chromium Code Reviews| Index: Source/core/dom/Document.cpp |
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
| index cb50f4c117380d975a04297d252c80c508966a40..cfbf236b6849c2e674069ea85bf9cfbcd10fe579 100644 |
| --- a/Source/core/dom/Document.cpp |
| +++ b/Source/core/dom/Document.cpp |
| @@ -100,6 +100,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" |
| @@ -5673,6 +5674,43 @@ Element* Document::activeElement() const |
| return body(); |
| } |
| +void Document::getTransitionElementData(Vector<TransitionElementData>* elementData, ExceptionState& exceptionState) |
|
esprehn
2014/06/13 08:47:05
Since this is only used in tests, lets put it in I
|
| +{ |
| + ASSERT(elementData); |
| + |
| + RefPtr<HTMLCollection> metaElements = getElementsByTagName(HTMLNames::metaTag.localName()); |
|
esprehn
2014/06/13 08:47:06
We don't normally allow code like this in core/, e
oystein (OOO til 10th of July)
2014/06/17 21:07:06
Replaced getElementsByTagName with Traversal<HTMLM
|
| + unsigned length = metaElements->length(); |
| + for (unsigned i = 0; i < length; ++i) { |
| + ASSERT(metaElements->item(i)->isHTMLElement()); |
| + HTMLMetaElement* metaElement = toHTMLMetaElement(metaElements->item(i)); |
| + if (metaElement->name() != "transition-elements") |
| + continue; |
| + |
| + Vector<String> tokens; |
| + String(metaElement->content().impl()).split(';', tokens); |
| + if (tokens.size() != 2) |
| + continue; |
| + |
| + RefPtr<NodeList> nodeList = querySelectorAll(AtomicString(tokens[0]), exceptionState); |
| + if (!nodeList || exceptionState.hadException()) |
| + continue; |
| + |
| + String markup; |
| + unsigned nodeListLength = nodeList->length(); |
| + for (unsigned nodeIdx = 0; nodeIdx < nodeListLength; ++nodeIdx) { |
| + Node* node = nodeList->item(nodeIdx); |
| + markup = markup + createStyledMarkupForNavigationTransition(node); |
| + } |
| + |
| + if (!markup.isEmpty()) { |
| + TransitionElementData newElements; |
| + newElements.scope = tokens[1]; |
| + newElements.markup = markup; |
| + elementData->append(newElements); |
| + } |
| + } |
| +} |
| + |
| bool Document::hasFocus() const |
| { |
| Page* page = this->page(); |