| Summary: | Fix inconsistent LengthMode definition for 'textLength' | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | sabouhallawa, webkit-bug-importer, zimmermann |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
Ahmad Saleem
2023-09-05 14:58:52 PDT
Although this commit deleted other use: https://github.com/WebKit/WebKit/commit/4c53eb1e29f8c451411f0ef7f5f47d84adeb3118 Chromium Source: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/svg/svg_text_content_element.cc;l=67?q=SVGAnimatedTextLength and class SVGAnimatedTextLength final : public SVGAnimatedLength { public: SVGAnimatedTextLength(SVGTextContentElement* context_element) : SVGAnimatedLength(context_element, svg_names::kTextLengthAttr, SVGLengthMode::kWidth, <----- HERE SVGLength::Initial::kUnitlessZero) {} We don't crash in --debug build on top of WebKit ToT and running this test via --debug flag. In WebKit we do not have inconsistency in the LengthMode when changing the baseVal of 'textLength'.
This is how we create the textLength in SVGTextContentElement:
Ref<SVGAnimatedLength> m_textLength { SVGAnimatedLength::create(this, SVGLengthMode::Other) };
And this is how we change its baseVal
m_textLength->setBaseValInternal(SVGLengthValue::construct(SVGLengthMode::Other, newValue, parseError, SVGLengthNegativeValuesMode::Forbid));
So the LengthMode is always SVGLengthMode::Other.
If you want to change the LengthMode to be SVGLengthMode::Width, please retitle this bug. Otherwise please close it.
|