⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 294888 in webkit


Ignore:
Timestamp:
May 26, 2022, 12:50:46 PM (4 years ago)
Author:
Devin Rousso
Message:

spurious RELEASE_LOG when creating a WKWebView with an empty frame
​https://bugs.webkit.org/show_bug.cgi?id=240959

Reviewed by Tim Horton.

  • Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _recalculateViewportSizesWithMinimumViewportInset:maximumViewportInset:throwOnInvalidInput:]):
Don't RELEASE_LOG (or throw) unless a minimumViewportInset/maximumViewportInset has been specified.

Canonical link: ​https://commits.webkit.org/251015@main

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r294790 r294888  
    16031603    auto frame = WebCore::FloatSize(self.frame.size);
    16041604
    1605     auto minimumUnobscuredSize = frame - WebCore::FloatSize(maximumViewportInset.left + maximumViewportInset.right, maximumViewportInset.top + maximumViewportInset.bottom);
     1605    auto maximumViewportInsetSize = WebCore::FloatSize(maximumViewportInset.left + maximumViewportInset.right, maximumViewportInset.top + maximumViewportInset.bottom);
     1606    auto minimumUnobscuredSize = frame - maximumViewportInsetSize;
    16061607    if (minimumUnobscuredSize.isEmpty()) {
    1607         if (throwOnInvalidInput) {
    1608             [NSException raise:NSInvalidArgumentException format:@"maximumViewportInset cannot be larger than frame"];
    1609             return;
     1608        if (!maximumViewportInsetSize.isEmpty()) {
     1609            if (throwOnInvalidInput) {
     1610                [NSException raise:NSInvalidArgumentException format:@"maximumViewportInset cannot be larger than frame"];
     1611                return;
     1612            }
     1613
     1614            RELEASE_LOG_ERROR(ViewportSizing, "maximumViewportInset cannot be larger than frame");
    16101615        }
    16111616
    1612         RELEASE_LOG_ERROR(ViewportSizing, "maximumViewportInset cannot be larger than frame");
    16131617        minimumUnobscuredSize = frame;
    16141618    }
    16151619
    1616     auto maximumUnobscuredSize = frame - WebCore::FloatSize(minimumViewportInset.left + minimumViewportInset.right, minimumViewportInset.top + minimumViewportInset.bottom);
     1620    auto minimumViewportInsetSize = WebCore::FloatSize(minimumViewportInset.left + minimumViewportInset.right, minimumViewportInset.top + minimumViewportInset.bottom);
     1621    auto maximumUnobscuredSize = frame - minimumViewportInsetSize;
    16171622    if (maximumUnobscuredSize.isEmpty()) {
    1618         if (throwOnInvalidInput) {
    1619             [NSException raise:NSInvalidArgumentException format:@"minimumViewportInset cannot be larger than frame"];
    1620             return;
     1623        if (!minimumViewportInsetSize.isEmpty()) {
     1624            if (throwOnInvalidInput) {
     1625                [NSException raise:NSInvalidArgumentException format:@"minimumViewportInset cannot be larger than frame"];
     1626                return;
     1627            }
     1628
     1629            RELEASE_LOG_ERROR(ViewportSizing, "minimumViewportInset cannot be larger than frame");
    16211630        }
    16221631
    1623         RELEASE_LOG_ERROR(ViewportSizing, "minimumViewportInset cannot be larger than frame");
    16241632        maximumUnobscuredSize = frame;
    16251633    }
Note: See TracChangeset for help on using the changeset viewer.