| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 242 |
| 243 void FrameView::reset() | 243 void FrameView::reset() |
| 244 { | 244 { |
| 245 m_cannotBlitToWindow = false; | 245 m_cannotBlitToWindow = false; |
| 246 m_isOverlapped = false; | 246 m_isOverlapped = false; |
| 247 m_contentIsOpaque = false; | 247 m_contentIsOpaque = false; |
| 248 m_borderX = 30; | 248 m_borderX = 30; |
| 249 m_borderY = 30; | 249 m_borderY = 30; |
| 250 m_layoutTimer.stop(); | 250 m_layoutTimer.stop(); |
| 251 m_layoutRoot = 0; | 251 m_layoutRoot = 0; |
| 252 m_delayedLayout = false; | |
| 253 m_doFullRepaint = true; | 252 m_doFullRepaint = true; |
| 254 m_layoutSchedulingEnabled = true; | 253 m_layoutSchedulingEnabled = true; |
| 255 m_inLayout = false; | 254 m_inLayout = false; |
| 256 m_doingPreLayoutStyleUpdate = false; | 255 m_doingPreLayoutStyleUpdate = false; |
| 257 m_inSynchronousPostLayout = false; | 256 m_inSynchronousPostLayout = false; |
| 258 m_layoutCount = 0; | 257 m_layoutCount = 0; |
| 259 m_nestedLayoutCount = 0; | 258 m_nestedLayoutCount = 0; |
| 260 m_postLayoutTasksTimer.stop(); | 259 m_postLayoutTasksTimer.stop(); |
| 261 m_firstLayout = true; | 260 m_firstLayout = true; |
| 262 m_firstLayoutCallbackPending = false; | 261 m_firstLayoutCallbackPending = false; |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 TRACE_EVENT0("webkit", "FrameView::layout"); | 872 TRACE_EVENT0("webkit", "FrameView::layout"); |
| 874 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "Layout"); | 873 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "Layout"); |
| 875 | 874 |
| 876 // Protect the view from being deleted during layout (in recalcStyle) | 875 // Protect the view from being deleted during layout (in recalcStyle) |
| 877 RefPtr<FrameView> protector(this); | 876 RefPtr<FrameView> protector(this); |
| 878 | 877 |
| 879 // Every scroll that happens during layout is programmatic. | 878 // Every scroll that happens during layout is programmatic. |
| 880 TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, tru
e); | 879 TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, tru
e); |
| 881 | 880 |
| 882 m_layoutTimer.stop(); | 881 m_layoutTimer.stop(); |
| 883 m_delayedLayout = false; | |
| 884 m_setNeedsLayoutWasDeferred = false; | 882 m_setNeedsLayoutWasDeferred = false; |
| 885 | 883 |
| 886 // we shouldn't enter layout() while painting | 884 // we shouldn't enter layout() while painting |
| 887 ASSERT(!isPainting()); | 885 ASSERT(!isPainting()); |
| 888 if (isPainting()) | 886 if (isPainting()) |
| 889 return; | 887 return; |
| 890 | 888 |
| 891 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willLayout
(m_frame.get()); | 889 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willLayout
(m_frame.get()); |
| 892 | 890 |
| 893 if (!allowSubtree && m_layoutRoot) { | 891 if (!allowSubtree && m_layoutRoot) { |
| (...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1886 return; | 1884 return; |
| 1887 if (!m_frame->document()->shouldScheduleLayout()) | 1885 if (!m_frame->document()->shouldScheduleLayout()) |
| 1888 return; | 1886 return; |
| 1889 InspectorInstrumentation::didInvalidateLayout(m_frame.get()); | 1887 InspectorInstrumentation::didInvalidateLayout(m_frame.get()); |
| 1890 | 1888 |
| 1891 // When frame seamless is enabled, the contents of the frame could affect th
e layout of the parent frames. | 1889 // When frame seamless is enabled, the contents of the frame could affect th
e layout of the parent frames. |
| 1892 // Also invalidate parent frame starting from the owner element of this fram
e. | 1890 // Also invalidate parent frame starting from the owner element of this fram
e. |
| 1893 if (m_frame->ownerRenderer() && frame()->document()->shouldDisplaySeamlessly
WithParent()) | 1891 if (m_frame->ownerRenderer() && frame()->document()->shouldDisplaySeamlessly
WithParent()) |
| 1894 m_frame->ownerRenderer()->setNeedsLayout(true, MarkContainingBlockChain)
; | 1892 m_frame->ownerRenderer()->setNeedsLayout(true, MarkContainingBlockChain)
; |
| 1895 | 1893 |
| 1896 int delay = m_frame->document()->minimumLayoutDelay(); | |
| 1897 if (m_layoutTimer.isActive() && m_delayedLayout && !delay) | |
| 1898 unscheduleRelayout(); | |
| 1899 if (m_layoutTimer.isActive()) | 1894 if (m_layoutTimer.isActive()) |
| 1900 return; | 1895 return; |
| 1901 | 1896 |
| 1902 m_delayedLayout = delay != 0; | 1897 m_layoutTimer.startOneShot(0); |
| 1903 m_layoutTimer.startOneShot(delay * 0.001); | |
| 1904 } | 1898 } |
| 1905 | 1899 |
| 1906 static bool isObjectAncestorContainerOf(RenderObject* ancestor, RenderObject* de
scendant) | 1900 static bool isObjectAncestorContainerOf(RenderObject* ancestor, RenderObject* de
scendant) |
| 1907 { | 1901 { |
| 1908 for (RenderObject* r = descendant; r; r = r->container()) { | 1902 for (RenderObject* r = descendant; r; r = r->container()) { |
| 1909 if (r == ancestor) | 1903 if (r == ancestor) |
| 1910 return true; | 1904 return true; |
| 1911 } | 1905 } |
| 1912 return false; | 1906 return false; |
| 1913 } | 1907 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1938 } else { | 1932 } else { |
| 1939 // Just do a full relayout | 1933 // Just do a full relayout |
| 1940 if (m_layoutRoot) | 1934 if (m_layoutRoot) |
| 1941 m_layoutRoot->markContainingBlocksForLayout(false); | 1935 m_layoutRoot->markContainingBlocksForLayout(false); |
| 1942 m_layoutRoot = 0; | 1936 m_layoutRoot = 0; |
| 1943 relayoutRoot->markContainingBlocksForLayout(false); | 1937 relayoutRoot->markContainingBlocksForLayout(false); |
| 1944 InspectorInstrumentation::didInvalidateLayout(m_frame.get()); | 1938 InspectorInstrumentation::didInvalidateLayout(m_frame.get()); |
| 1945 } | 1939 } |
| 1946 } | 1940 } |
| 1947 } else if (m_layoutSchedulingEnabled) { | 1941 } else if (m_layoutSchedulingEnabled) { |
| 1948 int delay = m_frame->document()->minimumLayoutDelay(); | |
| 1949 m_layoutRoot = relayoutRoot; | 1942 m_layoutRoot = relayoutRoot; |
| 1950 ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLa
yout()); | 1943 ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLa
yout()); |
| 1951 InspectorInstrumentation::didInvalidateLayout(m_frame.get()); | 1944 InspectorInstrumentation::didInvalidateLayout(m_frame.get()); |
| 1952 m_delayedLayout = delay != 0; | 1945 m_layoutTimer.startOneShot(0); |
| 1953 m_layoutTimer.startOneShot(delay * 0.001); | |
| 1954 } | 1946 } |
| 1955 } | 1947 } |
| 1956 | 1948 |
| 1957 bool FrameView::layoutPending() const | 1949 bool FrameView::layoutPending() const |
| 1958 { | 1950 { |
| 1959 return m_layoutTimer.isActive(); | 1951 return m_layoutTimer.isActive(); |
| 1960 } | 1952 } |
| 1961 | 1953 |
| 1962 bool FrameView::needsLayout() const | 1954 bool FrameView::needsLayout() const |
| 1963 { | 1955 { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1984 if (RenderView* renderView = this->renderView()) | 1976 if (RenderView* renderView = this->renderView()) |
| 1985 renderView->setNeedsLayout(true); | 1977 renderView->setNeedsLayout(true); |
| 1986 } | 1978 } |
| 1987 | 1979 |
| 1988 void FrameView::unscheduleRelayout() | 1980 void FrameView::unscheduleRelayout() |
| 1989 { | 1981 { |
| 1990 if (!m_layoutTimer.isActive()) | 1982 if (!m_layoutTimer.isActive()) |
| 1991 return; | 1983 return; |
| 1992 | 1984 |
| 1993 m_layoutTimer.stop(); | 1985 m_layoutTimer.stop(); |
| 1994 m_delayedLayout = false; | |
| 1995 } | 1986 } |
| 1996 | 1987 |
| 1997 void FrameView::serviceScriptedAnimations(double monotonicAnimationStartTime) | 1988 void FrameView::serviceScriptedAnimations(double monotonicAnimationStartTime) |
| 1998 { | 1989 { |
| 1999 for (RefPtr<Frame> frame = m_frame; frame; frame = frame->tree()->traverseNe
xt()) { | 1990 for (RefPtr<Frame> frame = m_frame; frame; frame = frame->tree()->traverseNe
xt()) { |
| 2000 frame->view()->serviceScrollAnimations(); | 1991 frame->view()->serviceScrollAnimations(); |
| 2001 if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled()) | 1992 if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled()) |
| 2002 frame->animation()->serviceAnimations(); | 1993 frame->animation()->serviceAnimations(); |
| 2003 if (RuntimeEnabledFeatures::webAnimationsEnabled()) | 1994 if (RuntimeEnabledFeatures::webAnimationsEnabled()) |
| 2004 frame->document()->timeline()->serviceAnimations(monotonicAnimationS
tartTime); | 1995 frame->document()->timeline()->serviceAnimations(monotonicAnimationS
tartTime); |
| (...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3373 } | 3364 } |
| 3374 | 3365 |
| 3375 AXObjectCache* FrameView::axObjectCache() const | 3366 AXObjectCache* FrameView::axObjectCache() const |
| 3376 { | 3367 { |
| 3377 if (frame() && frame()->document()) | 3368 if (frame() && frame()->document()) |
| 3378 return frame()->document()->existingAXObjectCache(); | 3369 return frame()->document()->existingAXObjectCache(); |
| 3379 return 0; | 3370 return 0; |
| 3380 } | 3371 } |
| 3381 | 3372 |
| 3382 } // namespace WebCore | 3373 } // namespace WebCore |
| OLD | NEW |