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 1796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 void Document::enqueueAnimationFrameEvent(PassRefPtr<Event> event) | 1807 void Document::enqueueAnimationFrameEvent(PassRefPtr<Event> event) |
1808 { | 1808 { |
1809 ensureScriptedAnimationController().enqueueEvent(event); | 1809 ensureScriptedAnimationController().enqueueEvent(event); |
1810 } | 1810 } |
1811 | 1811 |
1812 void Document::enqueueUniqueAnimationFrameEvent(PassRefPtr<Event> event) | 1812 void Document::enqueueUniqueAnimationFrameEvent(PassRefPtr<Event> event) |
1813 { | 1813 { |
1814 ensureScriptedAnimationController().enqueuePerFrameEvent(event); | 1814 ensureScriptedAnimationController().enqueuePerFrameEvent(event); |
1815 } | 1815 } |
1816 | 1816 |
1817 void Document::enqueueScrollEventForNode(Node* target) | |
1818 { | |
1819 // Per the W3C CSSOM View Module only scroll events fired at the document sh
ould bubble. | |
1820 RefPtr<Event> scrollEvent = target->isDocumentNode() ? Event::createBubble(E
ventTypeNames::scroll) : Event::create(EventTypeNames::scroll); | |
1821 scrollEvent->setTarget(target); | |
1822 ensureScriptedAnimationController().enqueuePerFrameEvent(scrollEvent.release
()); | |
1823 } | |
1824 | |
1825 void Document::enqueueResizeEvent() | 1817 void Document::enqueueResizeEvent() |
1826 { | 1818 { |
1827 RefPtr<Event> event = Event::create(EventTypeNames::resize); | 1819 RefPtr<Event> event = Event::create(EventTypeNames::resize); |
1828 event->setTarget(domWindow()); | 1820 event->setTarget(domWindow()); |
1829 ensureScriptedAnimationController().enqueuePerFrameEvent(event.release()); | 1821 ensureScriptedAnimationController().enqueuePerFrameEvent(event.release()); |
1830 } | 1822 } |
1831 | 1823 |
1832 void Document::enqueueMediaQueryChangeListeners(Vector<RefPtr<MediaQueryListList
ener> >& listeners) | 1824 void Document::enqueueMediaQueryChangeListeners(Vector<RefPtr<MediaQueryListList
ener> >& listeners) |
1833 { | 1825 { |
1834 ensureScriptedAnimationController().enqueueMediaQueryChangeListeners(listene
rs); | 1826 ensureScriptedAnimationController().enqueueMediaQueryChangeListeners(listene
rs); |
1835 } | 1827 } |
1836 | 1828 |
1837 void Document::addListenerTypeIfNeeded(const AtomicString& eventType) | 1829 void Document::addListenerTypeIfNeeded(const AtomicString& eventType) |
1838 { | 1830 { |
1839 if (eventType == EventTypeNames::animationstart) { | 1831 if (eventType == EventTypeNames::animationstart) { |
1840 addListenerType(ANIMATIONSTART_LISTENER); | 1832 addListenerType(ANIMATIONSTART_LISTENER); |
1841 } else if (eventType == EventTypeNames::animationend) { | 1833 } else if (eventType == EventTypeNames::animationend) { |
1842 addListenerType(ANIMATIONEND_LISTENER); | 1834 addListenerType(ANIMATIONEND_LISTENER); |
1843 } else if (eventType == EventTypeNames::animationiteration) { | 1835 } else if (eventType == EventTypeNames::animationiteration) { |
1844 addListenerType(ANIMATIONITERATION_LISTENER); | 1836 addListenerType(ANIMATIONITERATION_LISTENER); |
1845 } else if (eventType == EventTypeNames::transitionend) { | 1837 } else if (eventType == EventTypeNames::transitionend) { |
1846 addListenerType(TRANSITIONEND_LISTENER); | 1838 addListenerType(TRANSITIONEND_LISTENER); |
1847 } else if (eventType == EventTypeNames::scroll) { | |
1848 addListenerType(SCROLL_LISTENER); | |
1849 } | 1839 } |
1850 } | 1840 } |
1851 | 1841 |
1852 const AtomicString& Document::referrer() const | 1842 const AtomicString& Document::referrer() const |
1853 { | 1843 { |
1854 return nullAtom; | 1844 return nullAtom; |
1855 } | 1845 } |
1856 | 1846 |
1857 static bool isValidNameNonASCII(const LChar* characters, unsigned length) | 1847 static bool isValidNameNonASCII(const LChar* characters, unsigned length) |
1858 { | 1848 { |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2193 | 2183 |
2194 DocumentLoadTiming* Document::timing() const | 2184 DocumentLoadTiming* Document::timing() const |
2195 { | 2185 { |
2196 return &m_documentLoadTiming; | 2186 return &m_documentLoadTiming; |
2197 } | 2187 } |
2198 | 2188 |
2199 IntSize Document::initialViewportSize() const | 2189 IntSize Document::initialViewportSize() const |
2200 { | 2190 { |
2201 if (!view()) | 2191 if (!view()) |
2202 return IntSize(); | 2192 return IntSize(); |
2203 return view()->unscaledVisibleContentSize(IncludeScrollbars); | 2193 return view()->unscaledVisibleContentSize(); |
2204 } | 2194 } |
2205 | 2195 |
2206 Node* eventTargetNodeForDocument(Document* doc) | 2196 Node* eventTargetNodeForDocument(Document* doc) |
2207 { | 2197 { |
2208 if (!doc) | 2198 if (!doc) |
2209 return 0; | 2199 return 0; |
2210 Node* node = doc->focusedElement(); | 2200 Node* node = doc->focusedElement(); |
2211 if (!node) | 2201 if (!node) |
2212 node = doc->documentElement(); | 2202 node = doc->documentElement(); |
2213 return node; | 2203 return node; |
2214 } | 2204 } |
2215 | 2205 |
2216 void Document::adjustFloatQuadsForScroll(Vector<FloatQuad>& quads) | |
2217 { | |
2218 if (!view()) | |
2219 return; | |
2220 | |
2221 LayoutRect visibleContentRect = view()->visibleContentRect(); | |
2222 for (size_t i = 0; i < quads.size(); ++i) { | |
2223 quads[i].move(-FloatSize(visibleContentRect.x().toFloat(), visibleConten
tRect.y().toFloat())); | |
2224 } | |
2225 } | |
2226 | |
2227 void Document::adjustFloatRectForScroll(FloatRect& rect) | |
2228 { | |
2229 if (!view()) | |
2230 return; | |
2231 | |
2232 LayoutRect visibleContentRect = view()->visibleContentRect(); | |
2233 rect.move(-FloatSize(visibleContentRect.x().toFloat(), visibleContentRect.y(
).toFloat())); | |
2234 } | |
2235 | |
2236 void Document::decrementActiveParserCount() | 2206 void Document::decrementActiveParserCount() |
2237 { | 2207 { |
2238 --m_activeParserCount; | 2208 --m_activeParserCount; |
2239 } | 2209 } |
2240 | 2210 |
2241 Document& Document::ensureTemplateDocument() | 2211 Document& Document::ensureTemplateDocument() |
2242 { | 2212 { |
2243 if (isTemplateDocument()) | 2213 if (isTemplateDocument()) |
2244 return *this; | 2214 return *this; |
2245 | 2215 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2324 using namespace blink; | 2294 using namespace blink; |
2325 void showLiveDocumentInstances() | 2295 void showLiveDocumentInstances() |
2326 { | 2296 { |
2327 WeakDocumentSet& set = liveDocumentSet(); | 2297 WeakDocumentSet& set = liveDocumentSet(); |
2328 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 2298 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
2329 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it
) { | 2299 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it
) { |
2330 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut
f8().data()); | 2300 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut
f8().data()); |
2331 } | 2301 } |
2332 } | 2302 } |
2333 #endif | 2303 #endif |
OLD | NEW |