OLD | NEW |
---|---|
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 #include "core/dom/NodeRareData.h" | 80 #include "core/dom/NodeRareData.h" |
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/ScriptRunner.h" | 87 #include "core/dom/ScriptRunner.h" |
88 #include "core/dom/ScriptedAnimationController.h" | 88 #include "core/dom/ScriptedAnimationController.h" |
89 #include "core/dom/SelectorQuery.h" | 89 #include "core/dom/SelectorQuery.h" |
90 #include "core/dom/StaticNodeList.h" | |
90 #include "core/dom/StyleEngine.h" | 91 #include "core/dom/StyleEngine.h" |
91 #include "core/dom/TouchList.h" | 92 #include "core/dom/TouchList.h" |
92 #include "core/dom/TransformSource.h" | 93 #include "core/dom/TransformSource.h" |
93 #include "core/dom/TreeWalker.h" | 94 #include "core/dom/TreeWalker.h" |
94 #include "core/dom/VisitedLinkState.h" | 95 #include "core/dom/VisitedLinkState.h" |
95 #include "core/dom/XMLDocument.h" | 96 #include "core/dom/XMLDocument.h" |
96 #include "core/dom/custom/CustomElementMicrotaskRunQueue.h" | 97 #include "core/dom/custom/CustomElementMicrotaskRunQueue.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 5578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5691 m_taskRunner->postTask(AutofocusTask::create()); | 5693 m_taskRunner->postTask(AutofocusTask::create()); |
5692 } | 5694 } |
5693 | 5695 |
5694 Element* Document::activeElement() const | 5696 Element* Document::activeElement() const |
5695 { | 5697 { |
5696 if (Element* element = treeScope().adjustedFocusedElement()) | 5698 if (Element* element = treeScope().adjustedFocusedElement()) |
5697 return element; | 5699 return element; |
5698 return body(); | 5700 return body(); |
5699 } | 5701 } |
5700 | 5702 |
5703 void Document::getTransitionElementData(Vector<TransitionElementData>& elementDa ta, ExceptionState& exceptionState) | |
5704 { | |
5705 if (!head()) | |
5706 return; | |
5707 | |
5708 for (HTMLMetaElement* metaElement = Traversal<HTMLMetaElement>::firstChild(* head()); metaElement; metaElement = Traversal<HTMLMetaElement>::nextSibling(*met aElement)) { | |
5709 if (metaElement->name() != "transition-elements") | |
5710 continue; | |
5711 | |
5712 const String& metaElementContents = metaElement->content().string(); | |
5713 size_t firstSemicolon = metaElementContents.find(';'); | |
5714 if (firstSemicolon == kNotFound) | |
5715 continue; | |
5716 | |
5717 AtomicString selector(metaElementContents.substring(0, firstSemicolon)); | |
5718 RefPtr<StaticNodeList> nodeList = querySelectorAll(selector, exceptionSt ate); | |
5719 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.
| |
5720 continue; | |
5721 | |
5722 unsigned nodeListLength = nodeList->length(); | |
5723 if (!nodeListLength) | |
5724 continue; | |
5725 | |
5726 StringBuilder markup; | |
5727 for (unsigned nodeIndex = 0; nodeIndex < nodeListLength; ++nodeIndex) { | |
5728 Node* node = nodeList->item(nodeIndex); | |
5729 markup.append(createStyledMarkupForNavigationTransition(node)); | |
5730 } | |
5731 | |
5732 TransitionElementData newElements; | |
5733 newElements.scope = metaElementContents.substring(firstSemicolon + 1).st ripWhiteSpace(); | |
5734 newElements.selector = selector; | |
5735 newElements.markup = markup.toString(); | |
5736 elementData.append(newElements); | |
5737 } | |
5738 } | |
5739 | |
5701 bool Document::hasFocus() const | 5740 bool Document::hasFocus() const |
5702 { | 5741 { |
5703 Page* page = this->page(); | 5742 Page* page = this->page(); |
5704 if (!page) | 5743 if (!page) |
5705 return false; | 5744 return false; |
5706 if (!page->focusController().isActive() || !page->focusController().isFocuse d()) | 5745 if (!page->focusController().isActive() || !page->focusController().isFocuse d()) |
5707 return false; | 5746 return false; |
5708 Frame* focusedFrame = page->focusController().focusedFrame(); | 5747 Frame* focusedFrame = page->focusController().focusedFrame(); |
5709 if (focusedFrame && focusedFrame->isLocalFrame()) { | 5748 if (focusedFrame && focusedFrame->isLocalFrame()) { |
5710 if (toLocalFrame(focusedFrame)->tree().isDescendantOf(frame())) | 5749 if (toLocalFrame(focusedFrame)->tree().isDescendantOf(frame())) |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5851 using namespace WebCore; | 5890 using namespace WebCore; |
5852 void showLiveDocumentInstances() | 5891 void showLiveDocumentInstances() |
5853 { | 5892 { |
5854 WeakDocumentSet& set = liveDocumentSet(); | 5893 WeakDocumentSet& set = liveDocumentSet(); |
5855 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5894 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5856 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) { | 5895 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) { |
5857 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data()); | 5896 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data()); |
5858 } | 5897 } |
5859 } | 5898 } |
5860 #endif | 5899 #endif |
OLD | NEW |