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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 #include "core/dom/NodeRenderStyle.h" 81 #include "core/dom/NodeRenderStyle.h"
82 #include "core/dom/NodeRenderingTraversal.h" 82 #include "core/dom/NodeRenderingTraversal.h"
83 #include "core/dom/NodeTraversal.h" 83 #include "core/dom/NodeTraversal.h"
84 #include "core/dom/NodeWithIndex.h" 84 #include "core/dom/NodeWithIndex.h"
85 #include "core/dom/ProcessingInstruction.h" 85 #include "core/dom/ProcessingInstruction.h"
86 #include "core/dom/RequestAnimationFrameCallback.h" 86 #include "core/dom/RequestAnimationFrameCallback.h"
87 #include "core/dom/ScriptForbiddenScope.h" 87 #include "core/dom/ScriptForbiddenScope.h"
88 #include "core/dom/ScriptRunner.h" 88 #include "core/dom/ScriptRunner.h"
89 #include "core/dom/ScriptedAnimationController.h" 89 #include "core/dom/ScriptedAnimationController.h"
90 #include "core/dom/SelectorQuery.h" 90 #include "core/dom/SelectorQuery.h"
91 #include "core/dom/StaticNodeList.h"
91 #include "core/dom/StyleEngine.h" 92 #include "core/dom/StyleEngine.h"
92 #include "core/dom/TouchList.h" 93 #include "core/dom/TouchList.h"
93 #include "core/dom/TransformSource.h" 94 #include "core/dom/TransformSource.h"
94 #include "core/dom/TreeWalker.h" 95 #include "core/dom/TreeWalker.h"
95 #include "core/dom/VisitedLinkState.h" 96 #include "core/dom/VisitedLinkState.h"
96 #include "core/dom/XMLDocument.h" 97 #include "core/dom/XMLDocument.h"
97 #include "core/dom/custom/CustomElementRegistrationContext.h" 98 #include "core/dom/custom/CustomElementRegistrationContext.h"
98 #include "core/dom/shadow/ElementShadow.h" 99 #include "core/dom/shadow/ElementShadow.h"
99 #include "core/dom/shadow/ShadowRoot.h" 100 #include "core/dom/shadow/ShadowRoot.h"
100 #include "core/editing/Editor.h" 101 #include "core/editing/Editor.h"
101 #include "core/editing/FrameSelection.h" 102 #include "core/editing/FrameSelection.h"
102 #include "core/editing/SpellChecker.h" 103 #include "core/editing/SpellChecker.h"
104 #include "core/editing/markup.h"
103 #include "core/events/BeforeUnloadEvent.h" 105 #include "core/events/BeforeUnloadEvent.h"
104 #include "core/events/Event.h" 106 #include "core/events/Event.h"
105 #include "core/events/EventFactory.h" 107 #include "core/events/EventFactory.h"
106 #include "core/events/EventListener.h" 108 #include "core/events/EventListener.h"
107 #include "core/events/HashChangeEvent.h" 109 #include "core/events/HashChangeEvent.h"
108 #include "core/events/PageTransitionEvent.h" 110 #include "core/events/PageTransitionEvent.h"
109 #include "core/events/ScopedEventQueue.h" 111 #include "core/events/ScopedEventQueue.h"
110 #include "core/fetch/ResourceFetcher.h" 112 #include "core/fetch/ResourceFetcher.h"
111 #include "core/frame/LocalDOMWindow.h" 113 #include "core/frame/LocalDOMWindow.h"
112 #include "core/frame/FrameConsole.h" 114 #include "core/frame/FrameConsole.h"
(...skipping 5576 matching lines...) Expand 10 before | Expand all | Expand 10 after
5689 m_taskRunner->postTask(AutofocusTask::create()); 5691 m_taskRunner->postTask(AutofocusTask::create());
5690 } 5692 }
5691 5693
5692 Element* Document::activeElement() const 5694 Element* Document::activeElement() const
5693 { 5695 {
5694 if (Element* element = treeScope().adjustedFocusedElement()) 5696 if (Element* element = treeScope().adjustedFocusedElement())
5695 return element; 5697 return element;
5696 return body(); 5698 return body();
5697 } 5699 }
5698 5700
5701 void Document::getTransitionElementData(Vector<TransitionElementData>& elementDa ta, ExceptionState& exceptionState)
5702 {
5703 if (!head())
5704 return;
5705
5706 for (HTMLMetaElement* metaElement = Traversal<HTMLMetaElement>::firstChild(* head()); metaElement; metaElement = Traversal<HTMLMetaElement>::nextSibling(*met aElement)) {
5707 if (metaElement->name() != "transition-elements")
5708 continue;
5709
5710 Vector<String> tokens;
esprehn 2014/07/14 22:04:31 Dead code?
oystein (OOO til 10th of July) 2014/07/14 22:44:57 Done.
5711 const String& metaElementContents = metaElement->content().string();
5712 size_t firstSemicolon = metaElementContents.find(';');
5713 if (firstSemicolon == kNotFound)
5714 continue;
5715
5716 AtomicString selector(metaElementContents.substring(0, firstSemicolon));
5717 RefPtr<StaticNodeList> nodeList = querySelectorAll(selector, exceptionSt ate);
5718 if (!nodeList || exceptionState.hadException())
5719 continue;
5720
5721 unsigned nodeListLength = nodeList->length();
5722 if (!nodeListLength)
5723 continue;
5724
5725 StringBuilder markup;
5726 for (unsigned nodeIndex = 0; nodeIndex < nodeListLength; ++nodeIndex) {
5727 Node* node = nodeList->item(nodeIndex);
5728 markup.append(createStyledMarkupForNavigationTransition(node));
5729 }
5730
5731 TransitionElementData newElements;
5732 newElements.scope = metaElementContents.substring(firstSemicolon + 1).st ripWhiteSpace();
esprehn 2014/07/14 22:04:31 What happens if there's nothing after the ;, isn't
oystein (OOO til 10th of July) 2014/07/14 22:44:57 StringImpl::substring does a bounds check and retu
5733 newElements.selector = selector;
5734 newElements.markup = markup.toString();
5735 elementData.append(newElements);
5736 }
5737 }
5738
5699 bool Document::hasFocus() const 5739 bool Document::hasFocus() const
5700 { 5740 {
5701 Page* page = this->page(); 5741 Page* page = this->page();
5702 if (!page) 5742 if (!page)
5703 return false; 5743 return false;
5704 if (!page->focusController().isActive() || !page->focusController().isFocuse d()) 5744 if (!page->focusController().isActive() || !page->focusController().isFocuse d())
5705 return false; 5745 return false;
5706 Frame* focusedFrame = page->focusController().focusedFrame(); 5746 Frame* focusedFrame = page->focusController().focusedFrame();
5707 if (focusedFrame && focusedFrame->isLocalFrame()) { 5747 if (focusedFrame && focusedFrame->isLocalFrame()) {
5708 if (toLocalFrame(focusedFrame)->tree().isDescendantOf(frame())) 5748 if (toLocalFrame(focusedFrame)->tree().isDescendantOf(frame()))
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
5835 visitor->trace(m_compositorPendingAnimations); 5875 visitor->trace(m_compositorPendingAnimations);
5836 visitor->trace(m_contextDocument); 5876 visitor->trace(m_contextDocument);
5837 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5877 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5838 DocumentSupplementable::trace(visitor); 5878 DocumentSupplementable::trace(visitor);
5839 TreeScope::trace(visitor); 5879 TreeScope::trace(visitor);
5840 ContainerNode::trace(visitor); 5880 ContainerNode::trace(visitor);
5841 ExecutionContext::trace(visitor); 5881 ExecutionContext::trace(visitor);
5842 } 5882 }
5843 5883
5844 } // namespace WebCore 5884 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698