Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Unified Diff: Source/core/dom/Document.cpp

Issue 281383006: Navigation transitions: Added createStyledMarkupForNavigationTransition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review fixes Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/editing/EditingStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 6d57dec3e71fe4aaf548661c663bab818b53eaee..e1188cdf5d072c1fd797f30c951eac49af0cb2e4 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,44 @@ Element* Document::activeElement() const
return body();
}
+void Document::getTransitionElementData(Vector<TransitionElementData>& elementData)
+{
+ 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;
+
+ TrackExceptionState exceptionState;
+ AtomicString selector(metaElementContents.substring(0, firstSemicolon));
+ RefPtr<StaticNodeList> nodeList = querySelectorAll(selector, exceptionState);
+ if (!nodeList || exceptionState.hadException())
+ 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();
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/editing/EditingStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698