Closed Bug 1974057 Opened 2 months ago Closed 2 months ago

[wpt-sync] Sync PR 53392 - [SVG] Fixing nullptr exception during SVG style and layout recalculation

Categories

(Core :: SVG, task, P4)

task

Tracking

()

RESOLVED FIXED
142 Branch
Tracking Status
firefox142 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 53392 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/53392
Details from upstream follow.

Divyansh Mangal <dmangal@microsoft.com> wrote:

[SVG] Fixing nullptr exception during SVG style and layout recalculation

CSS properties like {position:absolute} are not applied for
inner svg elements as inner svg elements don't follow CSS box model.
Below piece of code in StyleAdjuster::AdjustStyleForSvgElement
to used to handle this for inner svg elements

bool is_svg_root = element.IsOutermostSVGSVGElement();
if (!is_svg_root) {
builder.SetPosition(ComputedStyleInitialValues::InitialPosition());
}

However, if the style calculation is forced and CSS styles like
{position:absolute} are applied to svg elements along with
\<use> a nullptr exception is observed. (see the new test added in
this CL). This exception become more pronounced due to our change
in CL:6623901 which made it possible to replicate the crash.

In this CL, we remedy this problem by updating the above condition
based on the element that is actually being styled.

Bug: 425405650
Change-Id: Idf0b6e162d7017660ae46580a8154c521526922a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6653468
Reviewed-by: Fredrik Söderquist \<fs@opera.com>
Commit-Queue: Divyansh Mangal \<dmangal@microsoft.com>
Reviewed-by: Kurt Catti-Schmidt \<kschmi@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1478629}

Component: web-platform-tests → SVG
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests

Status Summary

Firefox

PASS : 1

Chrome

CRASH: 1

Safari

PASS : 1

Links

GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/47d3253ac4b0 https://hg.mozilla.org/integration/autoland/rev/729716b05a7b [wpt PR 53392] - [SVG] Fixing nullptr exception during SVG style and layout recalculation, a=testonly
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 142 Branch
You need to log in before you can comment on or make changes to this bug.