Title: [295142] trunk
Revision
295142
Author
[email protected]
Date
2022-06-02 13:52:05 -0700 (Thu, 02 Jun 2022)

Log Message

ASAN_ILL | decltype; InlineIterator::Box::line; WebCore::logicallyNextRun
https://bugs.webkit.org/show_bug.cgi?id=238673
<rdar://problem/90482678>

Reviewed by Simon Fraser.

r286350 made it so that whenever the layout viewport of a `FrameView` changed, it would call
`Document::updateViewportUnitsOnResize`, which invalidates the style of all elements that use CSS
viewport units. This is problematic because it can be triggered by a layout (specifically during
`LayoutPhase::InPostLayout`), meaning that there will be dirty styles after a layout.

In reality, the only reason that that `Document::updateViewportUnitsOnResize` call was needed was
because on the first layout, the `RenderView::size` would be empty (as it derives its size during
layout). All subsequent layouts would have a correct size.

After much investigation and debate, it was decided that the CSS dynamic `dv*` viewport units should
really be using the `FrameView::size` (i.e. never using the `RenderView::size`) because they really
care about the size of the view(port). As such, partially revert `FrameView` to before r286350 and
make it so that `FrameView::sizeForCSSDynamicViewportUnits` never looks at the `RenderView::size`.

* Source/WebCore/page/FrameView.h:
* Source/WebCore/page/FrameView.cpp:
(WebCore::FrameView::setLayoutViewportOverrideRect):
(WebCore::FrameView::availableContentSizeChanged):
(WebCore::FrameView::layoutOrVisualViewportChanged):
(WebCore::FrameView::sizeForCSSDynamicViewportUnits const):

* LayoutTests/fast/layoutformattingcontext/set-content-size-layout-reentry-crash.html: Added.
* LayoutTests/fast/layoutformattingcontext/set-content-size-layout-reentry-crash-expected.txt: Added.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/CSSViewportUnits.mm:
(TEST.CSSViewportUnits.AllSame):
(TEST.CSSViewportUnits.NegativeMinimumViewportInset):
(TEST.CSSViewportUnits.NegativeMaximumViewportInset):
(TEST.CSSViewportUnits.MinimumViewportInsetLargerThanMaximumViewportInset):
(TEST.CSSViewportUnits.MinimumViewportInsetThanLargerFrame):
(TEST.CSSViewportUnits.MaximumViewportInsetThanLargerFrame):
(TEST.CSSViewportUnits.MinimumViewportInset):
(TEST.CSSViewportUnits.MaximumViewportInset):
(TEST.CSSViewportUnits.MinimumViewportInsetWithZoom):
(TEST.CSSViewportUnits.MaximumViewportInsetWithZoom):
(TEST.CSSViewportUnits.MinimumViewportInsetWithWritingMode):
(TEST.CSSViewportUnits.MaximumViewportInsetWithWritingMode):
(TEST.CSSViewportUnits.MinimumViewportInsetWithFrame):
(TEST.CSSViewportUnits.MaximumViewportInsetWithFrame):
(TEST.CSSViewportUnits.MinimumViewportInsetWithBounds):
(TEST.CSSViewportUnits.MaximumViewportInsetWithBounds):
(TEST.CSSViewportUnits.MinimumViewportInsetWithContentInset):
(TEST.CSSViewportUnits.MaximumViewportInsetWithContentInset):
(TEST.CSSViewportUnits.MinimumViewportInsetWithSafeAreaInsets):
(TEST.CSSViewportUnits.MaximumViewportInsetWithSafeAreaInsets):
(TEST.CSSViewportUnits.UnobscuredSizeOverridesIgnoreMinimumViewportInset):
(TEST.CSSViewportUnits.UnobscuredSizeOverridesIgnoreMaximumViewportInset):
(TEST.CSSViewportUnits.EmptyUnobscuredSizeOverrides):
(TEST.CSSViewportUnits.SameUnobscuredSizeOverrides):
(TEST.CSSViewportUnits.DifferentUnobscuredSizeOverrides):
(TEST.CSSViewportUnits.SVGDocument):
`FrameView::size` doesn't include scrollbars, so manually account for them where expected. This is
expected, as according to <https://drafts.csswg.org/css-values-4/#viewport-variants>:
> In all cases, scrollbars are assumed not to exist.

Canonical link: https://commits.webkit.org/251232@main

Modified Paths

Added Paths

Diff

Added: trunk/LayoutTests/fast/layoutformattingcontext/set-content-size-layout-reentry-crash-expected.txt (0 => 295142)


--- trunk/LayoutTests/fast/layoutformattingcontext/set-content-size-layout-reentry-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/layoutformattingcontext/set-content-size-layout-reentry-crash-expected.txt	2022-06-02 20:52:05 UTC (rev 295142)
@@ -0,0 +1,3 @@
+CONSOLE MESSAGE: PASS if this doesn't crash.
+aaaaaaa
+

Added: trunk/LayoutTests/fast/layoutformattingcontext/set-content-size-layout-reentry-crash.html (0 => 295142)


--- trunk/LayoutTests/fast/layoutformattingcontext/set-content-size-layout-reentry-crash.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layoutformattingcontext/set-content-size-layout-reentry-crash.html	2022-06-02 20:52:05 UTC (rev 295142)
@@ -0,0 +1,26 @@
+<style>
+  body {
+    -webkit-user-modify: read-only;
+    text-emphasis-style: '';
+  }
+  span {
+    top: 100vw;
+    content: '' url();
+  }
+</style>
+<script src=""
+<script>
+  _onload_ = () => {
+    document.body.append('aaaaaaa');
+    let span0 = document.createElement('span');
+    document.body.append(span0);
+    let div0 = document.createElement('div');
+    document.body.append(div0);
+    span0.append(document.createElement('table'));
+    getSelection().selectAllChildren(div0);
+    getSelection().modify('extend', 'left', 'paragraph');
+    if (window.testRunner)
+        testRunner.dumpAsText();
+    console.log("PASS if this doesn't crash.");
+  };
+</script>

Modified: trunk/Source/WebCore/page/FrameView.cpp (295141 => 295142)


--- trunk/Source/WebCore/page/FrameView.cpp	2022-06-02 20:34:50 UTC (rev 295141)
+++ trunk/Source/WebCore/page/FrameView.cpp	2022-06-02 20:52:05 UTC (rev 295142)
@@ -1714,15 +1714,23 @@
 
     LayoutRect oldRect = layoutViewportRect();
     m_layoutViewportOverrideRect = rect;
+    LayoutRect newRect = layoutViewportRect();
 
     // Triggering layout on height changes is necessary to make bottom-fixed elements behave correctly.
-    if (oldRect.height() != layoutViewportRect().height())
+    if (oldRect.height() != newRect.height())
         layoutTriggering = TriggerLayoutOrNot::Yes;
 
     LOG_WITH_STREAM(Scrolling, stream << "\nFrameView " << this << " setLayoutViewportOverrideRect() - changing override layout viewport from " << oldRect << " to " << valueOrDefault(m_layoutViewportOverrideRect) << " layoutTriggering " << (layoutTriggering == TriggerLayoutOrNot::Yes ? "yes" : "no"));
 
-    if (oldRect != layoutViewportRect() && layoutTriggering == TriggerLayoutOrNot::Yes)
-        setViewportConstrainedObjectsNeedLayout();
+    if (layoutTriggering == TriggerLayoutOrNot::Yes) {
+        if (oldRect != newRect)
+            setViewportConstrainedObjectsNeedLayout();
+
+        if (oldRect.size() != newRect.size()) {
+            if (auto* document = frame().document())
+                document->updateViewportUnitsOnResize();
+        }
+    }
 }
 
 void FrameView::setVisualViewportOverrideRect(std::optional<LayoutRect> rect)
@@ -2827,7 +2835,7 @@
         // FIXME: Merge this logic with m_setNeedsLayoutWasDeferred and find a more appropriate
         // way of handling potential recursive layouts when the viewport is resized to accomodate
         // the content but the content always overflows the viewport. See webkit.org/b/165781.
-        if (layoutContext().layoutPhase() == FrameViewLayoutContext::LayoutPhase::InViewSizeAdjust)
+        if (layoutContext().layoutPhase() != FrameViewLayoutContext::LayoutPhase::InViewSizeAdjust || !useFixedLayout())
             document->updateViewportUnitsOnResize();
     }
 
@@ -2938,14 +2946,6 @@
         if (auto scrollingCoordinator = this->scrollingCoordinator())
             scrollingCoordinator->frameViewVisualViewportChanged(*this);
     }
-
-    auto layoutViewportSize = layoutViewportRect().size();
-    if (layoutViewportSize != m_lastLayoutViewportSize) {
-        if (auto* document = frame().document())
-            document->updateViewportUnitsOnResize();
-
-        m_lastLayoutViewportSize = layoutViewportSize;
-    }
 }
 
 void FrameView::unobscuredContentSizeChanged()
@@ -5761,7 +5761,16 @@
 
 FloatSize FrameView::sizeForCSSDynamicViewportUnits() const
 {
-    return rectForFixedPositionLayout().size();
+    if (m_layoutViewportOverrideRect)
+        return m_layoutViewportOverrideRect->size();
+
+    if (useFixedLayout())
+        return fixedLayoutSize();
+
+    if (frame().settings().visualViewportEnabled())
+        return size();
+
+    return viewportConstrainedVisibleContentRect().size();
 }
 
 bool FrameView::shouldPlaceVerticalScrollbarOnLeft() const

Modified: trunk/Source/WebCore/page/FrameView.h (295141 => 295142)


--- trunk/Source/WebCore/page/FrameView.h	2022-06-02 20:34:50 UTC (rev 295141)
+++ trunk/Source/WebCore/page/FrameView.h	2022-06-02 20:52:05 UTC (rev 295142)
@@ -933,7 +933,6 @@
     Vector<Function<void()>> m_postLayoutCallbackQueue;
 
     LayoutPoint m_layoutViewportOrigin;
-    LayoutSize m_lastLayoutViewportSize;
     std::optional<LayoutRect> m_layoutViewportOverrideRect;
     std::optional<LayoutRect> m_visualViewportOverrideRect; // Used when the iOS keyboard is showing.
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/CSSViewportUnits.mm (295141 => 295142)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/CSSViewportUnits.mm	2022-06-02 20:34:50 UTC (rev 295141)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/CSSViewportUnits.mm	2022-06-02 20:52:05 UTC (rev 295142)
@@ -60,6 +60,12 @@
     [webView objectByEvaluatingJavaScript:[NSString stringWithFormat:@"document.querySelectorAll('%@').forEach((element) => element.style['%@'] = %@)", selector, property, value]];
 }
 
+#if PLATFORM(MAC)
+constexpr auto scrollbarSize = 15;
+#else
+constexpr auto scrollbarSize = 0;
+#endif
+
 TEST(CSSViewportUnits, AllSame)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
@@ -88,8 +94,8 @@
     EXPECT_FLOAT_EQ(320, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed"); // No horizontal overflow.
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -128,8 +134,8 @@
     EXPECT_FLOAT_EQ(320, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -163,8 +169,8 @@
     EXPECT_FLOAT_EQ(500, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -198,8 +204,8 @@
     EXPECT_FLOAT_EQ(320, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -314,8 +320,8 @@
     EXPECT_FLOAT_EQ(258, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed"); // No horizontal overflow.
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -355,8 +361,8 @@
     EXPECT_FLOAT_EQ(320, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed"); // No horizontal overflow.
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -403,8 +409,8 @@
     EXPECT_FLOAT_EQ(258, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -451,8 +457,8 @@
     EXPECT_FLOAT_EQ(320, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -493,8 +499,8 @@
     EXPECT_FLOAT_EQ(458, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed"); // No vertical overflow.
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -528,8 +534,8 @@
     EXPECT_FLOAT_EQ(258, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -570,8 +576,8 @@
     EXPECT_FLOAT_EQ(500, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed"); // No vertical overflow.
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -605,8 +611,8 @@
     EXPECT_FLOAT_EQ(320, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -648,8 +654,8 @@
     EXPECT_FLOAT_EQ(158, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed"); // No horizontal overflow.
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -691,8 +697,8 @@
     EXPECT_FLOAT_EQ(220, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed"); // No horizontal overflow.
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -734,8 +740,8 @@
     EXPECT_FLOAT_EQ(258, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed"); // No horizontal overflow.
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -777,8 +783,8 @@
     EXPECT_FLOAT_EQ(320, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed"); // No horizontal overflow.
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -822,8 +828,8 @@
     EXPECT_FLOAT_EQ(258, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -865,8 +871,8 @@
     EXPECT_FLOAT_EQ(320, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -910,8 +916,8 @@
     EXPECT_FLOAT_EQ(258, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -955,8 +961,8 @@
     EXPECT_FLOAT_EQ(320, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -999,8 +1005,8 @@
     EXPECT_FLOAT_EQ(30.5, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -1043,8 +1049,8 @@
     EXPECT_FLOAT_EQ(30.5, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -1084,8 +1090,8 @@
     EXPECT_FLOAT_EQ(10.5, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -1119,8 +1125,8 @@
     EXPECT_FLOAT_EQ(10.5, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -1154,8 +1160,8 @@
     EXPECT_FLOAT_EQ(20.5, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -1189,8 +1195,8 @@
     EXPECT_FLOAT_EQ(10.5, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -1230,8 +1236,8 @@
     EXPECT_FLOAT_EQ(10.5, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -1265,8 +1271,8 @@
     EXPECT_FLOAT_EQ(10.5, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -1300,8 +1306,8 @@
     EXPECT_FLOAT_EQ(20.5, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -1335,8 +1341,8 @@
     EXPECT_FLOAT_EQ(10.5, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -1376,8 +1382,8 @@
     EXPECT_FLOAT_EQ(30.5, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -1411,8 +1417,8 @@
     EXPECT_FLOAT_EQ(30.5, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -1446,8 +1452,8 @@
     EXPECT_FLOAT_EQ(40.5, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -1481,8 +1487,8 @@
     EXPECT_FLOAT_EQ(30.5, viewportUnitLength(webView, @"lvi"));
 
     {
-        double fixedWidth = widthOfElementWithID(webView, @"fixed");
-        double fixedHeight = heightOfElementWithID(webView, @"fixed");
+        double fixedWidth = widthOfElementWithID(webView, @"fixed") + scrollbarSize;
+        double fixedHeight = heightOfElementWithID(webView, @"fixed") + scrollbarSize;
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvw"));
         EXPECT_FLOAT_EQ(fixedHeight, viewportUnitLength(webView, @"dvh"));
         EXPECT_FLOAT_EQ(fixedWidth, viewportUnitLength(webView, @"dvmin"));
@@ -1577,8 +1583,8 @@
 
         double dvw = viewportUnitLength(webView, @"dvw");
         double dvh = viewportUnitLength(webView, @"dvh");
-        EXPECT_FLOAT_EQ(widthOfElementWithID(webView, @"fixed"), dvw);
-        EXPECT_FLOAT_EQ(heightOfElementWithID(webView, @"fixed"), dvh);
+        EXPECT_FLOAT_EQ(widthOfElementWithID(webView, @"fixed") + scrollbarSize, dvw);
+        EXPECT_FLOAT_EQ(heightOfElementWithID(webView, @"fixed") + scrollbarSize, dvh);
         EXPECT_FLOAT_EQ(dvw, viewportUnitLength(webView, @"dvmin"));
         EXPECT_FLOAT_EQ(dvh, viewportUnitLength(webView, @"dvmax"));
         EXPECT_FLOAT_EQ(dvh, viewportUnitLength(webView, @"dvb"));
@@ -1618,8 +1624,8 @@
 
         double dvw = viewportUnitLength(webView, @"dvw");
         double dvh = viewportUnitLength(webView, @"dvh");
-        EXPECT_FLOAT_EQ(widthOfElementWithID(webView, @"fixed"), dvw);
-        EXPECT_FLOAT_EQ(heightOfElementWithID(webView, @"fixed"), dvh);
+        EXPECT_FLOAT_EQ(widthOfElementWithID(webView, @"fixed") + scrollbarSize, dvw);
+        EXPECT_FLOAT_EQ(heightOfElementWithID(webView, @"fixed") + scrollbarSize, dvh);
         EXPECT_FLOAT_EQ(dvw, viewportUnitLength(webView, @"dvmin"));
         EXPECT_FLOAT_EQ(dvh, viewportUnitLength(webView, @"dvmax"));
         EXPECT_FLOAT_EQ(dvw, viewportUnitLength(webView, @"dvb"));
@@ -1659,8 +1665,8 @@
 
         double dvw = viewportUnitLength(webView, @"dvw");
         double dvh = viewportUnitLength(webView, @"dvh");
-        EXPECT_FLOAT_EQ(widthOfElementWithID(webView, @"fixed"), dvw);
-        EXPECT_FLOAT_EQ(heightOfElementWithID(webView, @"fixed"), dvh);
+        EXPECT_FLOAT_EQ(widthOfElementWithID(webView, @"fixed") + scrollbarSize, dvw);
+        EXPECT_FLOAT_EQ(heightOfElementWithID(webView, @"fixed") + scrollbarSize, dvh);
         EXPECT_FLOAT_EQ(dvw, viewportUnitLength(webView, @"dvmin"));
         EXPECT_FLOAT_EQ(dvh, viewportUnitLength(webView, @"dvmax"));
         EXPECT_FLOAT_EQ(dvh, viewportUnitLength(webView, @"dvb"));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to