Bug 17568 - SVGForeignObjectElement can't react to width/height SVG DOM changes
Summary: SVGForeignObjectElement can't react to width/height SVG DOM changes
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nikolas Zimmermann
Depends on:
Reported: 2008-02-27 04:46 PST by Nikolas Zimmermann
Modified: 2008-03-01 05:47 PST (History)
1 user (show)

See Also:

Initial patch (45.79 KB, patch)
2008-02-27 04:58 PST, Nikolas Zimmermann
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolas Zimmermann 2008-02-27 04:46:34 PST
In the process of creating the SVG dynamic updates testsuite, we're supposed to add 'svgAttributeChanged' implementation to all SVG*Elements. SVGForeignObjectElement/SVGImageElement/SVGSVGElement have a special case that width/height attributes are mapped to CSS_PROP_WIDTH / CSS_PROP_HEIGHT using the usual addCSSProperty() logic called from parseMappedAttribute.

As SVG DOM updates never go through the parseMappedAttribute/attributeChanged route, but instead of svgAttributeChanged directly, we'll need a special trick to be able to unify the updating logic for these cases.

- remove addCSSProperty calls from SVGForeignObjectElement::parseMappedAttributes

The idea was to just move them into svgAttributeChanged - though that's not going to work as StyledElement::attributeChanged uses a special logic to map these attributes to CSS properties.
We need to duplicate a subset of this logic, I called it "addCSSPropertyAndNotifyAttributeMap".

It's a new helper function that's now living in SVGForeignObjectElement, and needs to be moved down into a SVG*Element subclass, as soon as SVGImageElement/SVGSVGElement are fixed, too.

Remember, this is _ONLY_ need to support SVG DOM updates, otherwhise the HTML-style of calling addCSSProperty from parseMappedAttribute would be sufficient!

Uploading patch soon.
Just adding
Comment 1 Nikolas Zimmermann 2008-02-27 04:58:22 PST
Created attachment 19401 [details]
Initial patch

Code changes are low. Mostly new tests (8 in total)
Comment 2 Nikolas Zimmermann 2008-03-01 05:47:50 PST
Landed in r30695.