Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4db09a03542040dba6c022e7d217d3eb526654d7
      
https://github.com/WebKit/WebKit/commit/4db09a03542040dba6c022e7d217d3eb526654d7
  Author: Ahmad Saleem <[email protected]>
  Date:   2022-12-15 (Thu, 15 Dec 2022)

  Changed paths:
    A LayoutTests/fast/images/img-dimensions-styled-expected.txt
    A LayoutTests/fast/images/img-dimensions-styled.html
    M Source/WebCore/html/HTMLImageElement.cpp
    M Source/WebCore/html/HTMLImageElement.h

  Log Message:
  -----------
  HTMLImageElement width/height should update renderer first

HTMLImageElement width/height should update renderer first
https://bugs.webkit.org/show_bug.cgi?id=249056

Reviewed by Simon Fraser.

This patch is to align Webkit with Gecko / Firefox and Blink / Chromium.

Merge - 
https://chromium.googlesource.com/chromium/blink/+/d3adbd3a3f1bcbebdf515ac15a8c250873a2a1d9

HTMLImageElement::width/height were not updating layout first before checking 
for the
renderer, which means that we fall back to the attribute when we shouldn't. 
We're also
using the renderer method instead of updateLayoutIgnorePendingStylesheets which 
should be
used for all JS APIs. It also enabled us to remove unused bool.

We also make sure to check if we're in the document before causing a layout so 
checking
for a disconnected image's width/height before drawing to a canvas doesn't 
cause a sync layout.

* Source/WebCore/HTMLImageElement.h: Remove unused 'boolean'
* Source/WebCore/HTMLImageElement.cpp:
(HTMLImageElement::width): Update to account for renderer
(HTMLImageElement::height): Ditto
* LayoutTests/fast/image/img-dimensions-styled.html: Add Test Case
* LayoutTests/fast/image/img-dimensions-styled-expected.txt: Add Test Case 
Expectation

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to