Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix <input type=image> with CSS content
The LayoutObject creation was previously being performed via a call to LayoutObjectFactory::CreateBlockFlow() and a conditional on the style to LayoutInline(). This CL replaces all of that with a call to LayoutObject::CreateObject(), which handles creating the correct LayoutObject type, plus it also (now) handles CSS content pointing to an image. Previous attempts to do this [1][2] fixed some of these issues, but left a UAF in ImageResourceContent::RemoveObserver() [3]. To fix this, an unnecessary call to SetImageResource() in ImageInputType::OnAttachWithLayoutObject() was removed. Test coverage: Fallback content display type: external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/input-image-inline-alt.html UAF: external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/input-image-content-crash.html CSS content (new test): external/wpt/html/rendering/replaced-elements/images/input-image-content.html [1] crrev.com/779108 [2] crrev.com/780992 [3] https://bugs.chromium.org/p/chromium/issues/detail?id=1226558#c7 Fixed: 1226558 Change-Id: I64c61ebed91670b5fac665f1c4be9337f0814a9a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3064330 Commit-Queue: Ian Kilpatrick <[email protected]> Auto-Submit: Mason Freed <[email protected]> Reviewed-by: Ian Kilpatrick <[email protected]> Cr-Commit-Position: refs/heads/master@{#908495}
- Loading branch information