LEFT | RIGHT |
1 /* | 1 /* |
2 Copyright (C) 1997 Martin Jones (mjones@kde.org) | 2 Copyright (C) 1997 Martin Jones (mjones@kde.org) |
3 (C) 1998 Waldo Bastian (bastian@kde.org) | 3 (C) 1998 Waldo Bastian (bastian@kde.org) |
4 (C) 1998, 1999 Torben Weis (weis@kde.org) | 4 (C) 1998, 1999 Torben Weis (weis@kde.org) |
5 (C) 1999 Lars Knoll (knoll@kde.org) | 5 (C) 1999 Lars Knoll (knoll@kde.org) |
6 (C) 1999 Antti Koivisto (koivisto@kde.org) | 6 (C) 1999 Antti Koivisto (koivisto@kde.org) |
7 Copyright (C) 2004-2017 Apple Inc. All rights reserved. | 7 Copyright (C) 2004-2017 Apple Inc. All rights reserved. |
8 | 8 |
9 This library is free software; you can redistribute it and/or | 9 This library is free software; you can redistribute it and/or |
10 modify it under the terms of the GNU Library General Public | 10 modify it under the terms of the GNU Library General Public |
11 License as published by the Free Software Foundation; either | 11 License as published by the Free Software Foundation; either |
12 version 2 of the License, or (at your option) any later version. | 12 version 2 of the License, or (at your option) any later version. |
13 | 13 |
14 This library is distributed in the hope that it will be useful, | 14 This library is distributed in the hope that it will be useful, |
15 but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 Library General Public License for more details. | 17 Library General Public License for more details. |
18 | 18 |
19 You should have received a copy of the GNU Library General Public License | 19 You should have received a copy of the GNU Library General Public License |
20 along with this library; see the file COPYING.LIB. If not, write to | 20 along with this library; see the file COPYING.LIB. If not, write to |
21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
22 Boston, MA 02110-1301, USA. | 22 Boston, MA 02110-1301, USA. |
23 */ | 23 */ |
24 | 24 |
25 #pragma once | 25 #pragma once |
26 | 26 |
27 #include "AdjustViewSizeOrNot.h" | 27 #include "AdjustViewSizeOrNot.h" |
28 #include "Color.h" | 28 #include "Color.h" |
29 #include "ContainerNode.h" | 29 #include "ContainerNode.h" |
| 30 #include "LayoutContext.h" |
30 #include "LayoutMilestones.h" | 31 #include "LayoutMilestones.h" |
31 #include "LayoutRect.h" | 32 #include "LayoutRect.h" |
32 #include "Pagination.h" | 33 #include "Pagination.h" |
33 #include "PaintPhase.h" | 34 #include "PaintPhase.h" |
34 #include "RenderPtr.h" | 35 #include "RenderPtr.h" |
35 #include "ScrollView.h" | 36 #include "ScrollView.h" |
36 #include "TiledBacking.h" | 37 #include "TiledBacking.h" |
37 #include <memory> | 38 #include <memory> |
38 #include <wtf/Forward.h> | 39 #include <wtf/Forward.h> |
39 #include <wtf/Function.h> | 40 #include <wtf/Function.h> |
(...skipping 14 matching lines...) Expand all Loading... |
54 class RenderBox; | 55 class RenderBox; |
55 class RenderElement; | 56 class RenderElement; |
56 class RenderEmbeddedObject; | 57 class RenderEmbeddedObject; |
57 class RenderLayer; | 58 class RenderLayer; |
58 class RenderObject; | 59 class RenderObject; |
59 class RenderScrollbarPart; | 60 class RenderScrollbarPart; |
60 class RenderStyle; | 61 class RenderStyle; |
61 class RenderView; | 62 class RenderView; |
62 class RenderWidget; | 63 class RenderWidget; |
63 | 64 |
| 65 enum class FrameFlattening; |
| 66 |
64 Pagination::Mode paginationModeForRenderStyle(const RenderStyle&); | 67 Pagination::Mode paginationModeForRenderStyle(const RenderStyle&); |
65 | 68 |
66 class FrameView final : public ScrollView { | 69 class FrameView final : public ScrollView { |
67 public: | 70 public: |
68 friend class RenderView; | 71 friend class RenderView; |
69 friend class Internals; | 72 friend class Internals; |
| 73 friend class LayoutContext; |
70 | 74 |
71 WEBCORE_EXPORT static Ref<FrameView> create(Frame&); | 75 WEBCORE_EXPORT static Ref<FrameView> create(Frame&); |
72 static Ref<FrameView> create(Frame&, const IntSize& initialSize); | 76 static Ref<FrameView> create(Frame&, const IntSize& initialSize); |
73 | 77 |
74 virtual ~FrameView(); | 78 virtual ~FrameView(); |
75 | 79 |
76 HostWindow* hostWindow() const final; | 80 HostWindow* hostWindow() const final; |
77 ···· | 81 ···· |
78 WEBCORE_EXPORT void invalidateRect(const IntRect&) final; | 82 WEBCORE_EXPORT void invalidateRect(const IntRect&) final; |
79 void setFrameRect(const IntRect&) final; | 83 void setFrameRect(const IntRect&) final; |
(...skipping 15 matching lines...) Expand all Loading... |
95 WEBCORE_EXPORT void setCanHaveScrollbars(bool) final; | 99 WEBCORE_EXPORT void setCanHaveScrollbars(bool) final; |
96 WEBCORE_EXPORT void updateCanHaveScrollbars(); | 100 WEBCORE_EXPORT void updateCanHaveScrollbars(); |
97 | 101 |
98 Ref<Scrollbar> createScrollbar(ScrollbarOrientation) final; | 102 Ref<Scrollbar> createScrollbar(ScrollbarOrientation) final; |
99 | 103 |
100 bool avoidScrollbarCreation() const final; | 104 bool avoidScrollbarCreation() const final; |
101 | 105 |
102 void setContentsSize(const IntSize&) final; | 106 void setContentsSize(const IntSize&) final; |
103 void updateContentsSize() final; | 107 void updateContentsSize() final; |
104 | 108 |
105 void layout(bool allowSubtree = true); | 109 const LayoutContext& layoutContext() const { return m_layoutContext; } |
| 110 LayoutContext& layoutContext() { return m_layoutContext; } |
| 111 |
106 WEBCORE_EXPORT bool didFirstLayout() const; | 112 WEBCORE_EXPORT bool didFirstLayout() const; |
107 void layoutTimerFired(); | |
108 void scheduleRelayout(); | |
109 void scheduleRelayoutOfSubtree(RenderElement&); | |
110 void unscheduleRelayout(); | |
111 void queuePostLayoutCallback(WTF::Function<void ()>&&); | 113 void queuePostLayoutCallback(WTF::Function<void ()>&&); |
112 bool layoutPending() const; | |
113 bool isInLayout() const { return m_layoutPhase != OutsideLayout; } | |
114 bool isInRenderTreeLayout() const { return m_layoutPhase == InRenderTreeLayo
ut; } | |
115 bool inPaintableState() { return m_layoutPhase != InRenderTreeLayout && m_la
youtPhase != InViewSizeAdjust && m_layoutPhase != InPostLayout; } | |
116 | |
117 RenderElement* layoutRoot() const { return m_layoutRoot; } | |
118 void clearLayoutRoot() { m_layoutRoot = nullptr; } | |
119 int layoutCount() const { return m_layoutCount; } | |
120 | 114 |
121 WEBCORE_EXPORT bool needsLayout() const; | 115 WEBCORE_EXPORT bool needsLayout() const; |
122 WEBCORE_EXPORT void setNeedsLayout(); | 116 WEBCORE_EXPORT void setNeedsLayout(); |
123 void setViewportConstrainedObjectsNeedLayout(); | 117 void setViewportConstrainedObjectsNeedLayout(); |
124 | 118 |
125 bool needsStyleRecalcOrLayout(bool includeSubframes = true) const; | |
126 | |
127 bool needsFullRepaint() const { return m_needsFullRepaint; } | |
128 | |
129 WEBCORE_EXPORT bool renderedCharactersExceed(unsigned threshold); | 119 WEBCORE_EXPORT bool renderedCharactersExceed(unsigned threshold); |
| 120 |
| 121 void scheduleSelectionUpdate(); |
130 | 122 |
131 #if PLATFORM(IOS) | 123 #if PLATFORM(IOS) |
132 bool useCustomFixedPositionLayoutRect() const; | 124 bool useCustomFixedPositionLayoutRect() const; |
133 IntRect customFixedPositionLayoutRect() const { return m_customFixedPosition
LayoutRect; } | 125 IntRect customFixedPositionLayoutRect() const { return m_customFixedPosition
LayoutRect; } |
134 WEBCORE_EXPORT void setCustomFixedPositionLayoutRect(const IntRect&); | 126 WEBCORE_EXPORT void setCustomFixedPositionLayoutRect(const IntRect&); |
135 bool updateFixedPositionLayoutRect(); | 127 bool updateFixedPositionLayoutRect(); |
136 | 128 |
137 IntSize customSizeForResizeEvent() const { return m_customSizeForResizeEvent
; } | 129 IntSize customSizeForResizeEvent() const { return m_customSizeForResizeEvent
; } |
138 WEBCORE_EXPORT void setCustomSizeForResizeEvent(IntSize); | 130 WEBCORE_EXPORT void setCustomSizeForResizeEvent(IntSize); |
139 | 131 |
140 WEBCORE_EXPORT void setScrollVelocity(double horizontalVelocity, double vert
icalVelocity, double scaleChangeRate, MonotonicTime timestamp); | 132 WEBCORE_EXPORT void setScrollVelocity(double horizontalVelocity, double vert
icalVelocity, double scaleChangeRate, MonotonicTime timestamp); |
141 #else | 133 #else |
142 bool useCustomFixedPositionLayoutRect() const { return false; } | 134 bool useCustomFixedPositionLayoutRect() const { return false; } |
143 #endif | 135 #endif |
144 | |
145 WEBCORE_EXPORT void serviceScriptedAnimations(); | |
146 | 136 |
147 void willRecalcStyle(); | 137 void willRecalcStyle(); |
148 bool updateCompositingLayersAfterStyleChange(); | 138 bool updateCompositingLayersAfterStyleChange(); |
149 void updateCompositingLayersAfterLayout(); | 139 void updateCompositingLayersAfterLayout(); |
150 | 140 |
151 void clearBackingStores(); | 141 void clearBackingStores(); |
152 | 142 |
153 // Called when changes to the GraphicsLayer hierarchy have to be synchronize
d with | 143 // Called when changes to the GraphicsLayer hierarchy have to be synchronize
d with |
154 // content rendered via the normal painting path. | 144 // content rendered via the normal painting path. |
155 void setNeedsOneShotDrawingSynchronization(); | 145 void setNeedsOneShotDrawingSynchronization(); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 ExtendedBackgroundMode calculateExtendedBackgroundMode() const; | 199 ExtendedBackgroundMode calculateExtendedBackgroundMode() const; |
210 | 200 |
211 bool hasExtendedBackgroundRectForPainting() const; | 201 bool hasExtendedBackgroundRectForPainting() const; |
212 IntRect extendedBackgroundRectForPainting() const; | 202 IntRect extendedBackgroundRectForPainting() const; |
213 | 203 |
214 bool shouldUpdateWhileOffscreen() const; | 204 bool shouldUpdateWhileOffscreen() const; |
215 WEBCORE_EXPORT void setShouldUpdateWhileOffscreen(bool); | 205 WEBCORE_EXPORT void setShouldUpdateWhileOffscreen(bool); |
216 bool shouldUpdate() const; | 206 bool shouldUpdate() const; |
217 | 207 |
218 WEBCORE_EXPORT void adjustViewSize(); | 208 WEBCORE_EXPORT void adjustViewSize(); |
219 ···· | 209 IntSize layoutSizeForMediaQuery() const; |
| 210 |
220 WEBCORE_EXPORT void setViewportSizeForCSSViewportUnits(IntSize); | 211 WEBCORE_EXPORT void setViewportSizeForCSSViewportUnits(IntSize); |
221 IntSize viewportSizeForCSSViewportUnits() const; | 212 IntSize viewportSizeForCSSViewportUnits() const; |
222 ···· | 213 ···· |
223 IntRect windowClipRect() const final; | 214 IntRect windowClipRect() const final; |
224 WEBCORE_EXPORT IntRect windowClipRectForFrameOwner(const HTMLFrameOwnerEleme
nt*, bool clipToLayerContents) const; | 215 WEBCORE_EXPORT IntRect windowClipRectForFrameOwner(const HTMLFrameOwnerEleme
nt*, bool clipToLayerContents) const; |
225 | 216 |
226 float visibleContentScaleFactor() const final; | 217 float visibleContentScaleFactor() const final; |
227 | 218 |
228 #if USE(COORDINATED_GRAPHICS) | 219 #if USE(COORDINATED_GRAPHICS) |
229 void setFixedVisibleContentRect(const IntRect&) final; | 220 void setFixedVisibleContentRect(const IntRect&) final; |
(...skipping 20 matching lines...) Expand all Loading... |
250 No, | 241 No, |
251 Yes | 242 Yes |
252 }; | 243 }; |
253 // This origin can be overridden by setLayoutViewportOverrideRect. | 244 // This origin can be overridden by setLayoutViewportOverrideRect. |
254 void setBaseLayoutViewportOrigin(LayoutPoint, TriggerLayoutOrNot = TriggerLa
youtOrNot::Yes); | 245 void setBaseLayoutViewportOrigin(LayoutPoint, TriggerLayoutOrNot = TriggerLa
youtOrNot::Yes); |
255 // This size can be overridden by setLayoutViewportOverrideRect. | 246 // This size can be overridden by setLayoutViewportOverrideRect. |
256 WEBCORE_EXPORT LayoutSize baseLayoutViewportSize() const; | 247 WEBCORE_EXPORT LayoutSize baseLayoutViewportSize() const; |
257 ···· | 248 ···· |
258 // If set, overrides the default "m_layoutViewportOrigin, size of initial co
ntaining block" rect. | 249 // If set, overrides the default "m_layoutViewportOrigin, size of initial co
ntaining block" rect. |
259 // Used with delegated scrolling (i.e. iOS). | 250 // Used with delegated scrolling (i.e. iOS). |
260 WEBCORE_EXPORT void setLayoutViewportOverrideRect(std::optional<LayoutRect>)
; | 251 WEBCORE_EXPORT void setLayoutViewportOverrideRect(std::optional<LayoutRect>,
TriggerLayoutOrNot = TriggerLayoutOrNot::Yes); |
261 // If set, overrides m_layoutViewportOverrideRect. Only used during unstable
scroll updates, so that "client" coordinates are· | |
262 // computed with an origin that changes along with the scroll position. | |
263 // FIXME: This is ugly; would be better to be able to make setLayoutViewport
OverrideRect() callable during unstable updates.· | |
264 WEBCORE_EXPORT void setUnstableLayoutViewportRect(std::optional<LayoutRect>)
; | |
265 | 252 |
266 // These are in document coordinates, unaffected by page scale (but affected
by zooming). | 253 // These are in document coordinates, unaffected by page scale (but affected
by zooming). |
267 WEBCORE_EXPORT LayoutRect layoutViewportRect() const; | 254 WEBCORE_EXPORT LayoutRect layoutViewportRect() const; |
268 WEBCORE_EXPORT LayoutRect visualViewportRect() const; | 255 WEBCORE_EXPORT LayoutRect visualViewportRect() const; |
269 ···· | 256 ···· |
270 static LayoutRect visibleDocumentRect(const FloatRect& visibleContentRect, f
loat headerHeight, float footerHeight, const FloatSize& totalContentsSize, float
pageScaleFactor); | 257 static LayoutRect visibleDocumentRect(const FloatRect& visibleContentRect, f
loat headerHeight, float footerHeight, const FloatSize& totalContentsSize, float
pageScaleFactor); |
271 | 258 |
272 // This is different than visibleContentRect() in that it ignores negative (
or overly positive) | 259 // This is different than visibleContentRect() in that it ignores negative (
or overly positive) |
273 // offsets from rubber-banding, and it takes zooming into account.· | 260 // offsets from rubber-banding, and it takes zooming into account.· |
274 LayoutRect viewportConstrainedVisibleContentRect() const; | 261 LayoutRect viewportConstrainedVisibleContentRect() const; |
275 ···· | 262 ···· |
276 LayoutRect rectForFixedPositionLayout() const; | 263 LayoutRect rectForFixedPositionLayout() const; |
277 | 264 |
278 void viewportContentsChanged(); | 265 void viewportContentsChanged(); |
279 WEBCORE_EXPORT void resumeVisibleImageAnimationsIncludingSubframes(); | 266 WEBCORE_EXPORT void resumeVisibleImageAnimationsIncludingSubframes(); |
280 | 267 |
281 String mediaType() const; | 268 String mediaType() const; |
282 WEBCORE_EXPORT void setMediaType(const String&); | 269 WEBCORE_EXPORT void setMediaType(const String&); |
283 void adjustMediaTypeForPrinting(bool printing); | 270 void adjustMediaTypeForPrinting(bool printing); |
284 | 271 |
285 void setCannotBlitToWindow(); | 272 void setCannotBlitToWindow(); |
286 void setIsOverlapped(bool); | 273 void setIsOverlapped(bool); |
287 void setContentIsOpaque(bool); | 274 void setContentIsOpaque(bool); |
288 | 275 |
289 void addSlowRepaintObject(RenderElement*); | 276 void addSlowRepaintObject(RenderElement&); |
290 void removeSlowRepaintObject(RenderElement*); | 277 void removeSlowRepaintObject(RenderElement&); |
291 bool hasSlowRepaintObject(const RenderElement& renderer) const { return m_sl
owRepaintObjects && m_slowRepaintObjects->contains(&renderer); } | 278 bool hasSlowRepaintObject(const RenderElement& renderer) const { return m_sl
owRepaintObjects && m_slowRepaintObjects->contains(&renderer); } |
292 bool hasSlowRepaintObjects() const { return m_slowRepaintObjects && m_slowRe
paintObjects->size(); } | 279 bool hasSlowRepaintObjects() const { return m_slowRepaintObjects && m_slowRe
paintObjects->size(); } |
293 | 280 |
294 // Includes fixed- and sticky-position objects. | 281 // Includes fixed- and sticky-position objects. |
295 typedef HashSet<RenderElement*> ViewportConstrainedObjectSet; | 282 typedef HashSet<RenderElement*> ViewportConstrainedObjectSet; |
296 void addViewportConstrainedObject(RenderElement*); | 283 void addViewportConstrainedObject(RenderElement*); |
297 void removeViewportConstrainedObject(RenderElement*); | 284 void removeViewportConstrainedObject(RenderElement*); |
298 const ViewportConstrainedObjectSet* viewportConstrainedObjects() const { ret
urn m_viewportConstrainedObjects.get(); } | 285 const ViewportConstrainedObjectSet* viewportConstrainedObjects() const { ret
urn m_viewportConstrainedObjects.get(); } |
299 bool hasViewportConstrainedObjects() const { return m_viewportConstrainedObj
ects && m_viewportConstrainedObjects->size() > 0; } | 286 bool hasViewportConstrainedObjects() const { return m_viewportConstrainedObj
ects && m_viewportConstrainedObjects->size() > 0; } |
300 ···· | 287 ···· |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 WEBCORE_EXPORT void paintContentsForSnapshot(GraphicsContext&, const IntRect
& imageRect, SelectionInSnapshot shouldPaintSelection, CoordinateSpaceForSnapsho
t); | 369 WEBCORE_EXPORT void paintContentsForSnapshot(GraphicsContext&, const IntRect
& imageRect, SelectionInSnapshot shouldPaintSelection, CoordinateSpaceForSnapsho
t); |
383 | 370 |
384 void paintOverhangAreas(GraphicsContext&, const IntRect& horizontalOverhangA
rea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) final; | 371 void paintOverhangAreas(GraphicsContext&, const IntRect& horizontalOverhangA
rea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) final; |
385 void paintScrollCorner(GraphicsContext&, const IntRect& cornerRect) final; | 372 void paintScrollCorner(GraphicsContext&, const IntRect& cornerRect) final; |
386 void paintScrollbar(GraphicsContext&, Scrollbar&, const IntRect&) final; | 373 void paintScrollbar(GraphicsContext&, Scrollbar&, const IntRect&) final; |
387 | 374 |
388 WEBCORE_EXPORT Color documentBackgroundColor() const; | 375 WEBCORE_EXPORT Color documentBackgroundColor() const; |
389 | 376 |
390 bool isInChildFrameWithFrameFlattening() const; | 377 bool isInChildFrameWithFrameFlattening() const; |
391 | 378 |
392 void startDisallowingLayout() { ++m_layoutDisallowedCount; } | 379 void startDisallowingLayout() { layoutContext().startDisallowingLayout(); } |
393 void endDisallowingLayout() { ASSERT(m_layoutDisallowedCount > 0); --m_layou
tDisallowedCount; } | 380 void endDisallowingLayout() { layoutContext().endDisallowingLayout(); } |
394 bool layoutDisallowed() const { return m_layoutDisallowedCount; } | |
395 | 381 |
396 static double currentPaintTimeStamp() { return sCurrentPaintTimeStamp; } //
returns 0 if not painting | 382 static double currentPaintTimeStamp() { return sCurrentPaintTimeStamp; } //
returns 0 if not painting |
397 ···· | 383 ···· |
398 WEBCORE_EXPORT void updateLayoutAndStyleIfNeededRecursive(); | 384 WEBCORE_EXPORT void updateLayoutAndStyleIfNeededRecursive(); |
399 | 385 |
400 void incrementVisuallyNonEmptyCharacterCount(unsigned); | 386 void incrementVisuallyNonEmptyCharacterCount(unsigned); |
401 void incrementVisuallyNonEmptyPixelCount(const IntSize&); | 387 void incrementVisuallyNonEmptyPixelCount(const IntSize&); |
402 void updateIsVisuallyNonEmpty(); | 388 void updateIsVisuallyNonEmpty(); |
403 bool isVisuallyNonEmpty() const { return m_isVisuallyNonEmpty; } | 389 bool isVisuallyNonEmpty() const { return m_isVisuallyNonEmpty; } |
404 WEBCORE_EXPORT void enableAutoSizeMode(bool enable, const IntSize& minSize,
const IntSize& maxSize); | 390 WEBCORE_EXPORT void enableAutoSizeMode(bool enable, const IntSize& minSize,
const IntSize& maxSize); |
405 WEBCORE_EXPORT void setAutoSizeFixedMinimumHeight(int); | 391 WEBCORE_EXPORT void setAutoSizeFixedMinimumHeight(int); |
406 IntSize autoSizingIntrinsicContentSize() const { return m_autoSizeContentSiz
e; } | 392 IntSize autoSizingIntrinsicContentSize() const { return m_autoSizeContentSiz
e; } |
407 | 393 |
408 WEBCORE_EXPORT void forceLayout(bool allowSubtree = false); | 394 WEBCORE_EXPORT void forceLayout(bool allowSubtreeLayout = false); |
409 WEBCORE_EXPORT void forceLayoutForPagination(const FloatSize& pageSize, cons
t FloatSize& originalPageSize, float maximumShrinkFactor, AdjustViewSizeOrNot); | 395 WEBCORE_EXPORT void forceLayoutForPagination(const FloatSize& pageSize, cons
t FloatSize& originalPageSize, float maximumShrinkFactor, AdjustViewSizeOrNot); |
410 | 396 |
411 // FIXME: This method is retained because of embedded WebViews in AppKit. W
hen a WebView is embedded inside | 397 // FIXME: This method is retained because of embedded WebViews in AppKit. W
hen a WebView is embedded inside |
412 // some enclosing view with auto-pagination, no call happens to resize the v
iew. The new pagination model | 398 // some enclosing view with auto-pagination, no call happens to resize the v
iew. The new pagination model |
413 // needs the view to resize as a result of the breaks, but that means that t
he enclosing view has to potentially | 399 // needs the view to resize as a result of the breaks, but that means that t
he enclosing view has to potentially |
414 // resize around that view. Auto-pagination uses the bounds of the actual v
iew that's being printed to determine | 400 // resize around that view. Auto-pagination uses the bounds of the actual v
iew that's being printed to determine |
415 // the edges of the print operation, so the resize is necessary if the enclo
sing view's bounds depend on the | 401 // the edges of the print operation, so the resize is necessary if the enclo
sing view's bounds depend on the |
416 // web document's bounds. | 402 // web document's bounds. |
417 //· | 403 //· |
418 // This is already a problem if the view needs to be a different size becaus
e of printer fonts or because of print stylesheets. | 404 // This is already a problem if the view needs to be a different size becaus
e of printer fonts or because of print stylesheets. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 | 459 |
474 float documentToAbsoluteScaleFactor(std::optional<float> effectiveZoom = std
::nullopt) const; | 460 float documentToAbsoluteScaleFactor(std::optional<float> effectiveZoom = std
::nullopt) const; |
475 float absoluteToDocumentScaleFactor(std::optional<float> effectiveZoom = std
::nullopt) const; | 461 float absoluteToDocumentScaleFactor(std::optional<float> effectiveZoom = std
::nullopt) const; |
476 | 462 |
477 FloatRect absoluteToDocumentRect(FloatRect, std::optional<float> effectiveZo
om = std::nullopt) const; | 463 FloatRect absoluteToDocumentRect(FloatRect, std::optional<float> effectiveZo
om = std::nullopt) const; |
478 FloatPoint absoluteToDocumentPoint(FloatPoint, std::optional<float> effectiv
eZoom = std::nullopt) const; | 464 FloatPoint absoluteToDocumentPoint(FloatPoint, std::optional<float> effectiv
eZoom = std::nullopt) const; |
479 | 465 |
480 FloatSize documentToClientOffset() const; | 466 FloatSize documentToClientOffset() const; |
481 FloatRect documentToClientRect(FloatRect) const; | 467 FloatRect documentToClientRect(FloatRect) const; |
482 FloatPoint documentToClientPoint(FloatPoint) const; | 468 FloatPoint documentToClientPoint(FloatPoint) const; |
| 469 WEBCORE_EXPORT FloatRect clientToDocumentRect(FloatRect) const; |
| 470 WEBCORE_EXPORT FloatPoint clientToDocumentPoint(FloatPoint) const; |
483 | 471 |
484 FloatRect layoutViewportToAbsoluteRect(FloatRect) const; | 472 FloatRect layoutViewportToAbsoluteRect(FloatRect) const; |
485 FloatPoint layoutViewportToAbsolutePoint(FloatPoint) const; | 473 FloatPoint layoutViewportToAbsolutePoint(FloatPoint) const; |
486 | 474 |
487 // Unlike client coordinates, layout viewport coordinates are affected by pa
ge zoom. | 475 // Unlike client coordinates, layout viewport coordinates are affected by pa
ge zoom. |
488 float clientToLayoutViewportScaleFactor() const; | 476 float clientToLayoutViewportScaleFactor() const; |
489 float layoutViewportToClientScaleFactor() const; | 477 float layoutViewportToClientScaleFactor() const; |
490 FloatPoint clientToLayoutViewportPoint(FloatPoint) const; | 478 FloatPoint clientToLayoutViewportPoint(FloatPoint) const; |
491 | 479 |
492 | 480 bool isFrameViewScrollCorner(const RenderScrollbarPart& scrollCorner) const
{ return m_scrollCorner.get() == &scrollCorner; } |
493 bool isFrameViewScrollCorner(const RenderScrollbarPart& scrollCorner) const
{ return m_scrollCorner == &scrollCorner; } | |
494 | 481 |
495 // isScrollable() takes an optional Scrollability parameter that allows the
caller to define what they mean by 'scrollable.' | 482 // isScrollable() takes an optional Scrollability parameter that allows the
caller to define what they mean by 'scrollable.' |
496 // Most callers are interested in the default value, Scrollability::Scrollab
le, which means that there is actually content | 483 // Most callers are interested in the default value, Scrollability::Scrollab
le, which means that there is actually content |
497 // to scroll to, and a scrollbar that will allow you to access it. In some c
ases, callers want to know if the FrameView is allowed | 484 // to scroll to, and a scrollbar that will allow you to access it. In some c
ases, callers want to know if the FrameView is allowed |
498 // to rubber-band, which the main frame might be allowed to do even if there
is no content to scroll to. In that case, | 485 // to rubber-band, which the main frame might be allowed to do even if there
is no content to scroll to. In that case, |
499 // callers use Scrollability::ScrollableOrRubberbandable. | 486 // callers use Scrollability::ScrollableOrRubberbandable. |
500 enum class Scrollability { Scrollable, ScrollableOrRubberbandable }; | 487 enum class Scrollability { Scrollable, ScrollableOrRubberbandable }; |
501 WEBCORE_EXPORT bool isScrollable(Scrollability definitionOfScrollable = Scro
llability::Scrollable); | 488 WEBCORE_EXPORT bool isScrollable(Scrollability definitionOfScrollable = Scro
llability::Scrollable); |
502 | 489 |
503 bool isScrollableOrRubberbandable() final; | 490 bool isScrollableOrRubberbandable() final; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 | 591 |
605 bool hasFlippedBlockRenderers() const { return m_hasFlippedBlockRenderers; } | 592 bool hasFlippedBlockRenderers() const { return m_hasFlippedBlockRenderers; } |
606 void setHasFlippedBlockRenderers(bool b) { m_hasFlippedBlockRenderers = b; } | 593 void setHasFlippedBlockRenderers(bool b) { m_hasFlippedBlockRenderers = b; } |
607 | 594 |
608 void updateWidgetPositions(); | 595 void updateWidgetPositions(); |
609 void didAddWidgetToRenderTree(Widget&); | 596 void didAddWidgetToRenderTree(Widget&); |
610 void willRemoveWidgetFromRenderTree(Widget&); | 597 void willRemoveWidgetFromRenderTree(Widget&); |
611 | 598 |
612 const HashSet<Widget*>& widgetsInRenderTree() const { return m_widgetsInRend
erTree; } | 599 const HashSet<Widget*>& widgetsInRenderTree() const { return m_widgetsInRend
erTree; } |
613 | 600 |
614 typedef Vector<Ref<FrameView>, 16> FrameViewList; | |
615 FrameViewList renderedChildFrameViews() const; | |
616 | |
617 void addTrackedRepaintRect(const FloatRect&); | 601 void addTrackedRepaintRect(const FloatRect&); |
618 | 602 |
619 // exposedRect represents WebKit's understanding of what part | 603 // exposedRect represents WebKit's understanding of what part |
620 // of the view is actually exposed on screen (taking into account | 604 // of the view is actually exposed on screen (taking into account |
621 // clipping by other UI elements), whereas visibleContentRect is | 605 // clipping by other UI elements), whereas visibleContentRect is |
622 // internal to WebCore and doesn't respect those things. | 606 // internal to WebCore and doesn't respect those things. |
623 WEBCORE_EXPORT void setViewExposedRect(std::optional<FloatRect>); | 607 WEBCORE_EXPORT void setViewExposedRect(std::optional<FloatRect>); |
624 std::optional<FloatRect> viewExposedRect() const { return m_viewExposedRect;
} | 608 std::optional<FloatRect> viewExposedRect() const { return m_viewExposedRect;
} |
625 | 609 |
626 #if ENABLE(CSS_SCROLL_SNAP) | 610 #if ENABLE(CSS_SCROLL_SNAP) |
(...skipping 11 matching lines...) Expand all Loading... |
638 | 622 |
639 bool shouldPlaceBlockDirectionScrollbarOnLeft() const final; | 623 bool shouldPlaceBlockDirectionScrollbarOnLeft() const final; |
640 | 624 |
641 void didRestoreFromPageCache(); | 625 void didRestoreFromPageCache(); |
642 | 626 |
643 void willDestroyRenderTree(); | 627 void willDestroyRenderTree(); |
644 void didDestroyRenderTree(); | 628 void didDestroyRenderTree(); |
645 | 629 |
646 void setSpeculativeTilingDelayDisabledForTesting(bool disabled) { m_speculat
iveTilingDelayDisabledForTesting = disabled; } | 630 void setSpeculativeTilingDelayDisabledForTesting(bool disabled) { m_speculat
iveTilingDelayDisabledForTesting = disabled; } |
647 | 631 |
| 632 WEBCORE_EXPORT FrameFlattening effectiveFrameFlattening() const; |
| 633 |
648 protected: | 634 protected: |
649 bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectT
oScroll, const IntRect& clipRect) final; | 635 bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectT
oScroll, const IntRect& clipRect) final; |
650 void scrollContentsSlowPath(const IntRect& updateRect) final; | 636 void scrollContentsSlowPath(const IntRect& updateRect) final; |
651 ···· | 637 ···· |
652 void repaintSlowRepaintObjects(); | 638 void repaintSlowRepaintObjects(); |
653 | 639 |
654 bool isVerticalDocument() const final; | 640 bool isVerticalDocument() const final; |
655 bool isFlippedDocument() const final; | 641 bool isFlippedDocument() const final; |
656 | 642 |
657 private: | 643 private: |
658 explicit FrameView(Frame&); | 644 explicit FrameView(Frame&); |
659 | 645 |
660 void reset(); | 646 void reset(); |
661 void init(); | 647 void init(); |
662 | 648 |
663 enum LayoutPhase { | 649 enum LayoutPhase { |
664 OutsideLayout, | 650 OutsideLayout, |
665 InPreLayout, | 651 InPreLayout, |
666 InPreLayoutStyleUpdate, | |
667 InRenderTreeLayout, | 652 InRenderTreeLayout, |
668 InViewSizeAdjust, | 653 InViewSizeAdjust, |
669 InPostLayout, | 654 InPostLayout |
670 InPostLayerPositionsUpdatedAfterLayout, | |
671 }; | 655 }; |
672 LayoutPhase layoutPhase() const { return m_layoutPhase; } | |
673 | |
674 bool inPreLayoutStyleUpdate() const { return m_layoutPhase == InPreLayoutSty
leUpdate; } | |
675 | 656 |
676 bool isFrameView() const final { return true; } | 657 bool isFrameView() const final { return true; } |
677 | 658 |
678 friend class RenderWidget; | 659 friend class RenderWidget; |
679 bool useSlowRepaints(bool considerOverlap = true) const; | 660 bool useSlowRepaints(bool considerOverlap = true) const; |
680 bool useSlowRepaintsIfNotOverlapped() const; | 661 bool useSlowRepaintsIfNotOverlapped() const; |
681 void updateCanBlitOnScrollRecursively(); | 662 void updateCanBlitOnScrollRecursively(); |
682 bool shouldLayoutAfterContentsResized() const; | 663 bool shouldLayoutAfterContentsResized() const; |
683 | 664 |
684 bool shouldUpdateCompositingLayersAfterScrolling() const; | 665 bool shouldUpdateCompositingLayersAfterScrolling() const; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 bool usesMockScrollAnimator() const final; | 718 bool usesMockScrollAnimator() const final; |
738 void logMockScrollAnimatorMessage(const String&) const final; | 719 void logMockScrollAnimatorMessage(const String&) const final; |
739 | 720 |
740 // Override scrollbar notifications to update the AXObject cache. | 721 // Override scrollbar notifications to update the AXObject cache. |
741 void didAddScrollbar(Scrollbar*, ScrollbarOrientation) final; | 722 void didAddScrollbar(Scrollbar*, ScrollbarOrientation) final; |
742 void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) final; | 723 void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) final; |
743 | 724 |
744 IntSize sizeForResizeEvent() const; | 725 IntSize sizeForResizeEvent() const; |
745 void sendResizeEventIfNeeded(); | 726 void sendResizeEventIfNeeded(); |
746 | 727 |
| 728 void adjustScrollbarsForLayout(bool firstLayout); |
| 729 |
747 void handleDeferredScrollbarsUpdateAfterDirectionChange(); | 730 void handleDeferredScrollbarsUpdateAfterDirectionChange(); |
748 | 731 |
749 void updateScrollableAreaSet(); | 732 void updateScrollableAreaSet(); |
750 void updateLayoutViewport(); | 733 void updateLayoutViewport(); |
751 | 734 |
752 void notifyPageThatContentAreaWillPaint() const final; | 735 void notifyPageThatContentAreaWillPaint() const final; |
753 | 736 |
754 void enableSpeculativeTilingIfNeeded(); | 737 void enableSpeculativeTilingIfNeeded(); |
755 void speculativeTilingEnableTimerFired(); | 738 void speculativeTilingEnableTimerFired(); |
756 | 739 |
757 void updateEmbeddedObjectsTimerFired(); | 740 void updateEmbeddedObjectsTimerFired(); |
758 bool updateEmbeddedObjects(); | 741 bool updateEmbeddedObjects(); |
759 void updateEmbeddedObject(RenderEmbeddedObject&); | 742 void updateEmbeddedObject(RenderEmbeddedObject&); |
760 void scrollToAnchor(); | 743 void scrollToAnchor(); |
761 void scrollPositionChanged(const ScrollPosition& oldPosition, const ScrollPo
sition& newPosition); | 744 void scrollPositionChanged(const ScrollPosition& oldPosition, const ScrollPo
sition& newPosition); |
762 void scrollableAreaSetChanged(); | 745 void scrollableAreaSetChanged(); |
763 void sendScrollEvent(); | 746 void sendScrollEvent(); |
| 747 void resetScrollAnchor(); |
764 | 748 |
765 bool hasCustomScrollbars() const; | 749 bool hasCustomScrollbars() const; |
766 | 750 |
767 void updateScrollCorner() final; | 751 void updateScrollCorner() final; |
768 | 752 |
769 FrameView* parentFrameView() const; | 753 FrameView* parentFrameView() const; |
770 | 754 |
771 void startLayoutAtMainFrameViewIfNeeded(bool allowSubtree); | |
772 bool frameFlatteningEnabled() const; | 755 bool frameFlatteningEnabled() const; |
773 bool isFrameFlatteningValidForThisFrame() const; | 756 bool isFrameFlatteningValidForThisFrame() const; |
| 757 |
| 758 void markRootOrBodyRendererDirty() const; |
774 | 759 |
775 bool qualifiesAsVisuallyNonEmpty() const; | 760 bool qualifiesAsVisuallyNonEmpty() const; |
776 bool isViewForDocumentInFrame() const; | 761 bool isViewForDocumentInFrame() const; |
777 | 762 |
778 AXObjectCache* axObjectCache() const; | 763 AXObjectCache* axObjectCache() const; |
779 void notifyWidgetsInAllFrames(WidgetNotification); | 764 void notifyWidgetsInAllFrames(WidgetNotification); |
780 void removeFromAXObjectCache(); | 765 void removeFromAXObjectCache(); |
781 void notifyWidgets(WidgetNotification); | 766 void notifyWidgets(WidgetNotification); |
782 | 767 |
783 void convertSubtreeLayoutToFullLayout(); | 768 void setFrameFlatteningViewSizeForMediaQuery() { m_frameFlatteningViewSizeFo
rMediaQuery = layoutSize(); } |
784 | 769 bool frameFlatteningViewSizeForMediaQueryIsSet() const { return m_frameFlatt
eningViewSizeForMediaQuery.has_value(); } |
785 RenderElement* viewportRenderer() const; | 770 RenderElement* viewportRenderer() const; |
| 771 ···· |
| 772 void willDoLayout(WeakPtr<RenderElement> layoutRoot); |
| 773 void didLayout(WeakPtr<RenderElement> layoutRoot); |
786 | 774 |
787 HashSet<Widget*> m_widgetsInRenderTree; | 775 HashSet<Widget*> m_widgetsInRenderTree; |
788 | 776 |
789 static double sCurrentPaintTimeStamp; // used for detecting decoded resource
thrash in the cache | 777 static double sCurrentPaintTimeStamp; // used for detecting decoded resource
thrash in the cache |
790 | 778 |
791 LayoutSize m_size; | 779 LayoutSize m_size; |
792 LayoutSize m_margins; | 780 LayoutSize m_margins; |
793 | 781 |
794 std::unique_ptr<ListHashSet<RenderEmbeddedObject*>> m_embeddedObjectsToUpdat
e; | 782 std::unique_ptr<ListHashSet<RenderEmbeddedObject*>> m_embeddedObjectsToUpdat
e; |
795 const Ref<Frame> m_frame; | 783 const Ref<Frame> m_frame; |
796 | 784 |
797 std::unique_ptr<HashSet<const RenderElement*>> m_slowRepaintObjects; | 785 std::unique_ptr<HashSet<const RenderElement*>> m_slowRepaintObjects; |
798 | 786 |
799 bool m_needsFullRepaint; | |
800 ···· | |
801 bool m_canHaveScrollbars; | 787 bool m_canHaveScrollbars; |
802 bool m_cannotBlitToWindow; | 788 bool m_cannotBlitToWindow; |
803 bool m_isOverlapped { false }; | 789 bool m_isOverlapped { false }; |
804 bool m_contentIsOpaque; | 790 bool m_contentIsOpaque; |
805 | 791 |
806 Timer m_layoutTimer; | |
807 bool m_delayedLayout; | |
808 RenderElement* m_layoutRoot { nullptr }; | |
809 | |
810 LayoutPhase m_layoutPhase; | |
811 bool m_layoutSchedulingEnabled; | |
812 bool m_inSynchronousPostLayout; | |
813 int m_layoutCount; | |
814 unsigned m_nestedLayoutCount; | |
815 Timer m_postLayoutTasksTimer; | |
816 Timer m_updateEmbeddedObjectsTimer; | 792 Timer m_updateEmbeddedObjectsTimer; |
817 bool m_firstLayoutCallbackPending; | 793 bool m_firstLayoutCallbackPending; |
818 | 794 |
819 bool m_firstLayout; | |
820 bool m_isTransparent; | 795 bool m_isTransparent; |
821 Color m_baseBackgroundColor; | 796 Color m_baseBackgroundColor; |
822 IntSize m_lastViewportSize; | 797 IntSize m_lastViewportSize; |
823 float m_lastZoomFactor; | 798 float m_lastZoomFactor; |
824 | 799 |
825 String m_mediaType; | 800 String m_mediaType; |
826 String m_mediaTypeWhenNotPrinting; | 801 String m_mediaTypeWhenNotPrinting; |
827 | 802 |
828 bool m_overflowStatusDirty; | 803 bool m_overflowStatusDirty; |
829 bool m_horizontalOverflow; | 804 bool m_horizontalOverflow; |
(...skipping 12 matching lines...) Expand all Loading... |
842 | 817 |
843 bool m_isTrackingRepaints; // Used for testing. | 818 bool m_isTrackingRepaints; // Used for testing. |
844 Vector<FloatRect> m_trackedRepaintRects; | 819 Vector<FloatRect> m_trackedRepaintRects; |
845 | 820 |
846 bool m_shouldUpdateWhileOffscreen; | 821 bool m_shouldUpdateWhileOffscreen; |
847 | 822 |
848 std::optional<FloatRect> m_viewExposedRect; | 823 std::optional<FloatRect> m_viewExposedRect; |
849 ···· | 824 ···· |
850 LayoutPoint m_layoutViewportOrigin; | 825 LayoutPoint m_layoutViewportOrigin; |
851 std::optional<LayoutRect> m_layoutViewportOverrideRect; | 826 std::optional<LayoutRect> m_layoutViewportOverrideRect; |
852 std::optional<LayoutRect> m_unstableLayoutViewportRect; | |
853 | |
854 unsigned m_deferSetNeedsLayoutCount; | |
855 bool m_setNeedsLayoutWasDeferred; | |
856 int m_layoutDisallowedCount { 0 }; | |
857 | 827 |
858 RefPtr<Node> m_nodeToDraw; | 828 RefPtr<Node> m_nodeToDraw; |
859 PaintBehavior m_paintBehavior; | 829 PaintBehavior m_paintBehavior; |
860 bool m_isPainting; | 830 bool m_isPainting; |
861 | 831 |
862 unsigned m_visuallyNonEmptyCharacterCount; | 832 unsigned m_visuallyNonEmptyCharacterCount; |
863 unsigned m_visuallyNonEmptyPixelCount; | 833 unsigned m_visuallyNonEmptyPixelCount; |
864 bool m_isVisuallyNonEmpty; | 834 bool m_isVisuallyNonEmpty; |
865 bool m_firstVisuallyNonEmptyLayoutCallbackPending; | 835 bool m_firstVisuallyNonEmptyLayoutCallbackPending; |
866 | 836 |
(...skipping 24 matching lines...) Expand all Loading... |
891 // True if autosize has been run since m_shouldAutoSize was set. | 861 // True if autosize has been run since m_shouldAutoSize was set. |
892 bool m_didRunAutosize; | 862 bool m_didRunAutosize; |
893 // The lower bound on the size when autosizing. | 863 // The lower bound on the size when autosizing. |
894 IntSize m_minAutoSize; | 864 IntSize m_minAutoSize; |
895 // The upper bound on the size when autosizing. | 865 // The upper bound on the size when autosizing. |
896 IntSize m_maxAutoSize; | 866 IntSize m_maxAutoSize; |
897 // The fixed height to resize the view to after autosizing is complete. | 867 // The fixed height to resize the view to after autosizing is complete. |
898 int m_autoSizeFixedMinimumHeight; | 868 int m_autoSizeFixedMinimumHeight; |
899 // The intrinsic content size decided by autosizing. | 869 // The intrinsic content size decided by autosizing. |
900 IntSize m_autoSizeContentSize; | 870 IntSize m_autoSizeContentSize; |
| 871 // Report the first computed frame view size to media queries. |
| 872 std::optional<IntSize> m_frameFlatteningViewSizeForMediaQuery; |
901 | 873 |
902 std::unique_ptr<ScrollableAreaSet> m_scrollableAreas; | 874 std::unique_ptr<ScrollableAreaSet> m_scrollableAreas; |
903 std::unique_ptr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; | 875 std::unique_ptr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; |
904 | 876 |
905 int m_headerHeight; | 877 int m_headerHeight; |
906 int m_footerHeight; | 878 int m_footerHeight; |
907 | 879 |
908 LayoutMilestones m_milestonesPendingPaint; | 880 LayoutMilestones m_milestonesPendingPaint; |
909 | 881 |
910 static const unsigned visualCharacterThreshold = 200; | 882 static const unsigned visualCharacterThreshold = 200; |
911 static const unsigned visualPixelThreshold = 32 * 32; | 883 static const unsigned visualPixelThreshold = 32 * 32; |
912 | 884 |
913 #if ENABLE(CSS_DEVICE_ADAPTATION) | 885 #if ENABLE(CSS_DEVICE_ADAPTATION) |
914 // Size of viewport before any UA or author styles have overridden | 886 // Size of viewport before any UA or author styles have overridden |
915 // the viewport given by the window or viewing area of the UA. | 887 // the viewport given by the window or viewing area of the UA. |
916 IntSize m_initialViewportSize; | 888 IntSize m_initialViewportSize; |
917 #endif | 889 #endif |
918 | 890 |
919 bool m_visualUpdatesAllowedByClient; | 891 bool m_visualUpdatesAllowedByClient; |
920 bool m_hasFlippedBlockRenderers; | 892 bool m_hasFlippedBlockRenderers; |
921 bool m_speculativeTilingDelayDisabledForTesting { false }; | 893 bool m_speculativeTilingDelayDisabledForTesting { false }; |
922 | 894 |
923 ScrollPinningBehavior m_scrollPinningBehavior; | 895 ScrollPinningBehavior m_scrollPinningBehavior; |
924 | 896 |
925 IntRect* m_cachedWindowClipRect { nullptr }; | 897 IntRect* m_cachedWindowClipRect { nullptr }; |
926 Vector<WTF::Function<void ()>> m_postLayoutCallbackQueue; | 898 Vector<WTF::Function<void ()>> m_postLayoutCallbackQueue; |
| 899 |
| 900 LayoutContext m_layoutContext; |
927 }; | 901 }; |
928 | 902 |
929 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) | 903 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) |
930 { | 904 { |
931 if (m_isVisuallyNonEmpty) | 905 if (m_isVisuallyNonEmpty) |
932 return; | 906 return; |
933 m_visuallyNonEmptyCharacterCount += count; | 907 m_visuallyNonEmptyCharacterCount += count; |
934 if (m_visuallyNonEmptyCharacterCount <= visualCharacterThreshold) | 908 if (m_visuallyNonEmptyCharacterCount <= visualCharacterThreshold) |
935 return; | 909 return; |
936 updateIsVisuallyNonEmpty(); | 910 updateIsVisuallyNonEmpty(); |
937 } | 911 } |
938 | 912 |
939 inline void FrameView::incrementVisuallyNonEmptyPixelCount(const IntSize& size) | 913 inline void FrameView::incrementVisuallyNonEmptyPixelCount(const IntSize& size) |
940 { | 914 { |
941 if (m_isVisuallyNonEmpty) | 915 if (m_isVisuallyNonEmpty) |
942 return; | 916 return; |
943 m_visuallyNonEmptyPixelCount += size.width() * size.height(); | 917 m_visuallyNonEmptyPixelCount += size.width() * size.height(); |
944 if (m_visuallyNonEmptyPixelCount <= visualPixelThreshold) | 918 if (m_visuallyNonEmptyPixelCount <= visualPixelThreshold) |
945 return; | 919 return; |
946 updateIsVisuallyNonEmpty(); | 920 updateIsVisuallyNonEmpty(); |
947 } | 921 } |
948 | 922 |
949 } // namespace WebCore | 923 } // namespace WebCore |
950 | 924 |
951 SPECIALIZE_TYPE_TRAITS_WIDGET(FrameView, isFrameView()) | 925 SPECIALIZE_TYPE_TRAITS_WIDGET(FrameView, isFrameView()) |
LEFT | RIGHT |