Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1b57c1925dd6e75019a596962321846094c57544
      
https://github.com/WebKit/WebKit/commit/1b57c1925dd6e75019a596962321846094c57544
  Author: Abrar Rahman Protyasha <a_protya...@apple.com>
  Date:   2024-04-03 (Wed, 03 Apr 2024)

  Changed paths:
    M LayoutTests/fast/viewport/viewport-legacy-xhtmlmp-remove-and-add.html
    M LayoutTests/fast/viewport/viewport-legacy-xhtmlmp.html
    M LayoutTests/platform/ios/TestExpectations
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/dom/ViewportArguments.h
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

  Log Message:
  -----------
  [iOS] 2 fast/viewport/viewport-legacy-xhtmlmp*.html layout tests are 
constantly failing.
https://bugs.webkit.org/show_bug.cgi?id=271784
rdar://125504723

Reviewed by Tim Horton.

This patch addresses the following failed tests:
- fast/viewport/viewport-legacy-xhtmlmp.html
- fast/viewport/viewport-legacy-xhtmlmp-remove-and-add.html

Both tests use the XHTML Mobile Profile (XHTML-MP) doctype, but this is
not reflected in the document's resolved viewport configuration. The
test output shows that the viewport's width is equivalent to the default
desktop width (980) and the minimum scale is equivalent to the ratio
between the XHTML mobile paramaters width (320) and the default desktop
width.

This patch updates the viewport configuration to XHTML-MP parameters and
provides the right viewport origin type (CSSDeviceAdaption) if the web
page's viewport configuration is being reset and the page has a mobile
doctype, like for the failing tests. This way, We make sure the document
throws away the stale viewport arguments with desktop values and instead
respects the mobile profile, but only if the exisitng viewport arguments
were not configured through a meta tag, since that takes priority over
XHTML-MP.

Lastly, we improve conformance to current smart pointer usage guidelines
with drive-by refactors in WebPage::resetViewportDefaultConfiguration
and in Document::updateViewportArguments.

* LayoutTests/fast/viewport/viewport-legacy-xhtmlmp-remove-and-add.html:
* LayoutTests/fast/viewport/viewport-legacy-xhtmlmp.html:

Update viewport spec link in the test comments.

* LayoutTests/platform/ios/TestExpectations:

Fix test expectations.

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::isViewportDocument const):

Make the lambda function from Document::updateViewportArguments a member
function so we can call it in WebPage::resetViewportDefaultConfiguration
as well.

Also, slight smart pointer hygiene improvements.

(WebCore::Document::updateViewportArguments):
* Source/WebCore/dom/Document.h:

* Source/WebCore/dom/ViewportArguments.h:

Rearrange the ViewportArguments::Type cases to reflect that viewport
arguments obtained from a meta tag are prioritized over XHTML-MP.

* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::resetViewportDefaultConfiguration):

If we have received a mobile doctype, and we have a viewport document,
update the viewport configuration to reflect that of the XHTML-MP. Call
WebPage::viewportPropertiesDidChange to propagate these changes.

Also, slight smart pointer hygiene improvements.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to