Closed Bug 1742212 Opened 3 years ago Closed 2 years ago

[wpt-sync] Sync PR 31694 - Validate viewBox when it's value is changed in JavaScript

Categories

(Core :: SVG, task, P4)

task

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Xianzhu Wang <wangxianzhu@chromium.org> wrote:

Validate viewBox when it's value is changed in JavaScript

  • Change SVGFitToViewBox::IsKnownAttribute() to AttributeChanged()
    and validate viewBox when the attribute is changed. In case of
    viewBox.baseVal.width = -100, the viewBox value will be ignored
    instead of being treated as empty.

  • Rename IsValid() to IsSpecified() and CreateInvalid() to
    CreateUnspecified() to better reflect their purposes.

  • Keep invalid values in SVGRect so that initial values and values set
    by scripts are consistent. However, if the attribute string value is
    invalid, the rect will be still cleared to 0,0,0,0.

Bug: 1264175
Change-Id: I8aa9ecabf2055c0917bf4d66adc8400cf347c560

Reviewed-on: https://chromium-review.googlesource.com/3291094
WPT-Export-Revision: 79f70ecc50070b7155a68a251e040fdb42f38da7

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

CI Results

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

Total 3 tests

Status Summary

Firefox

PASS: 3

Chrome

PASS: 2
FAIL: 1

Safari

PASS: 2
FAIL: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1615b5a17c8a
[wpt PR 31694] - Validate viewBox when its value is changed in JavaScript, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
You need to log in before you can comment on or make changes to this bug.