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) |
| 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 TrackExceptionState exceptionState; |
| 5718 AtomicString selector(metaElementContents.substring(0, firstSemicolon)); |
| 5719 RefPtr<StaticNodeList> nodeList = querySelectorAll(selector, exceptionSt
ate); |
| 5720 if (!nodeList || exceptionState.hadException()) |
| 5721 continue; |
| 5722 |
| 5723 unsigned nodeListLength = nodeList->length(); |
| 5724 if (!nodeListLength) |
| 5725 continue; |
| 5726 |
| 5727 StringBuilder markup; |
| 5728 for (unsigned nodeIndex = 0; nodeIndex < nodeListLength; ++nodeIndex) { |
| 5729 Node* node = nodeList->item(nodeIndex); |
| 5730 markup.append(createStyledMarkupForNavigationTransition(node)); |
| 5731 } |
| 5732 |
| 5733 TransitionElementData newElements; |
| 5734 newElements.scope = metaElementContents.substring(firstSemicolon + 1).st
ripWhiteSpace(); |
| 5735 newElements.selector = selector; |
| 5736 newElements.markup = markup.toString(); |
| 5737 elementData.append(newElements); |
| 5738 } |
| 5739 } |
| 5740 |
5701 bool Document::hasFocus() const | 5741 bool Document::hasFocus() const |
5702 { | 5742 { |
5703 Page* page = this->page(); | 5743 Page* page = this->page(); |
5704 if (!page) | 5744 if (!page) |
5705 return false; | 5745 return false; |
5706 if (!page->focusController().isActive() || !page->focusController().isFocuse
d()) | 5746 if (!page->focusController().isActive() || !page->focusController().isFocuse
d()) |
5707 return false; | 5747 return false; |
5708 Frame* focusedFrame = page->focusController().focusedFrame(); | 5748 Frame* focusedFrame = page->focusController().focusedFrame(); |
5709 if (focusedFrame && focusedFrame->isLocalFrame()) { | 5749 if (focusedFrame && focusedFrame->isLocalFrame()) { |
5710 if (toLocalFrame(focusedFrame)->tree().isDescendantOf(frame())) | 5750 if (toLocalFrame(focusedFrame)->tree().isDescendantOf(frame())) |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5851 using namespace WebCore; | 5891 using namespace WebCore; |
5852 void showLiveDocumentInstances() | 5892 void showLiveDocumentInstances() |
5853 { | 5893 { |
5854 WeakDocumentSet& set = liveDocumentSet(); | 5894 WeakDocumentSet& set = liveDocumentSet(); |
5855 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5895 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5856 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it
) { | 5896 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()); | 5897 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut
f8().data()); |
5858 } | 5898 } |
5859 } | 5899 } |
5860 #endif | 5900 #endif |
OLD | NEW |