Chromium Code Reviews| Index: Source/core/dom/Document.cpp |
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
| index fbd9b0cdfb51f015a793564856b923f5cba92d2f..90e353b3b7a780b98597fed8fc2a04036ca8e9de 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" |
| @@ -5715,6 +5716,37 @@ Element* Document::activeElement() const |
| return body(); |
| } |
| +void Document::getTransitionElementData(Vector<TransitionElementData>& elementData, ExceptionState& exceptionState) |
| +{ |
| + for (HTMLMetaElement* metaElement = head() ? Traversal<HTMLMetaElement>::firstChild(*head()) : 0; metaElement; metaElement = Traversal<HTMLMetaElement>::nextSibling(*metaElement)) { |
|
esprehn
2014/06/26 09:32:55
Lets early return instead.
if (!head())
return;
oystein (OOO til 10th of July)
2014/06/26 23:13:43
Done.
|
| + if (metaElement->name() != "transition-elements") |
| + continue; |
| + |
| + Vector<String> tokens; |
| + metaElement->content().string().split(';', tokens); |
|
esprehn
2014/06/26 09:32:55
";" is valid in CSS selectors, I don't think you c
oystein (OOO til 10th of July)
2014/06/26 23:13:43
Done.
|
| + if (tokens.size() != 2) |
| + continue; |
| + |
| + RefPtr<NodeList> nodeList = querySelectorAll(AtomicString(tokens[0]), exceptionState); |
|
esprehn
2014/06/26 09:32:55
What happens if the elements you select are nested
oystein (OOO til 10th of July)
2014/06/26 23:13:43
Sure, there'll be a few "doing this is undefined b
|
| + if (!nodeList || exceptionState.hadException()) |
| + continue; |
| + |
| + String markup; |
| + unsigned nodeListLength = nodeList->length(); |
| + for (unsigned nodeIdx = 0; nodeIdx < nodeListLength; ++nodeIdx) { |
|
esprehn
2014/06/26 09:32:55
nodeIndex, don't abbreviate.
oystein (OOO til 10th of July)
2014/06/26 23:13:43
Done.
|
| + Node* node = nodeList->item(nodeIdx); |
| + markup = markup + createStyledMarkupForNavigationTransition(node); |
|
esprehn
2014/06/26 09:32:55
I think there's a string builder for this kind of
oystein (OOO til 10th of July)
2014/06/26 23:13:43
Done.
|
| + } |
| + |
| + if (!markup.isEmpty()) { |
|
esprehn
2014/06/26 09:32:55
How can markup be empty if nodeList was non empty?
oystein (OOO til 10th of July)
2014/06/26 23:13:43
Done.
|
| + TransitionElementData newElements; |
| + newElements.scope = tokens[1]; |
|
esprehn
2014/06/26 09:32:55
You'll want to trim() this.
oystein (OOO til 10th of July)
2014/06/26 23:13:43
Done.
|
| + newElements.markup = markup; |
| + elementData.append(newElements); |
| + } |
| + } |
| +} |
| + |
| bool Document::hasFocus() const |
| { |
| Page* page = this->page(); |