RESOLVED FIXED 28828
Make SVGStyleElement title/media/type setters do something
https://bugs.webkit.org/show_bug.cgi?id=28828
Summary Make SVGStyleElement title/media/type setters do something
Cameron McCormack (:heycam)
Reported Saturday, August 29, 2009 9:47:09 AM UTC
setTitle(), setMedia() and setType() on SVGStyleElement should do something other than just throwing a NOT_MODIFIED_ERR. Also remove the "setter raises" clauses from the IDL, since an exception should never be thrown.
Attachments
Patch v1 (6.99 KB, patch)
2009-08-29 05:11 PDT, Cameron McCormack (:heycam)
eric: review-
Patch v2 (7.39 KB, patch)
2009-08-31 06:19 PDT, Cameron McCormack (:heycam)
eric: review-
Patch v3 (6.86 KB, patch)
2009-09-02 17:49 PDT, Cameron McCormack (:heycam)
no flags
Patch v4 (6.17 KB, patch)
2009-09-02 21:51 PDT, Cameron McCormack (:heycam)
no flags
Patch v4a (6.17 KB, patch)
2009-09-02 22:02 PDT, Cameron McCormack (:heycam)
no flags
Cameron McCormack (:heycam)
Comment 1 Saturday, August 29, 2009 1:11:26 PM UTC
Created attachment 38774 [details] Patch v1
Eric Seidel (no email)
Comment 2 Monday, August 31, 2009 11:17:14 AM UTC
Comment on attachment 38774 [details] Patch v1 shouldBeEqualToString will make your life easier here: 5 shouldBe("style.type", "'text/css'"); shouldBeEqualToString("style.type", "text/css"); Normally we would use longer argument names here: 53 void SVGStyleElement::setXmlspace(const AtomicString& s, ExceptionCode&) like "space" and "type": 65 void SVGStyleElement::setType(const AtomicString& s) Why not just remove "setter raises()"? 33 /*setter raises(DOMException)*/; Are these spec'd to raise, but they never should? If so, please explain in your ChangeLog. In general this looks great! If you were a committer, I would r+ and you could land with changes.
Cameron McCormack (:heycam)
Comment 3 Monday, August 31, 2009 2:19:17 PM UTC
Created attachment 38811 [details] Patch v2 (In reply to comment #2) > shouldBeEqualToString will make your life easier here: > 5 shouldBe("style.type", "'text/css'"); > > shouldBeEqualToString("style.type", "text/css"); OK, changed to use that. I just copied some other test that was using shouldBe() in this manner. > Normally we would use longer argument names here: > 53 void SVGStyleElement::setXmlspace(const AtomicString& s, ExceptionCode&) > like "space" > > and "type": > 65 void SVGStyleElement::setType(const AtomicString& s) Changed. > Why not just remove "setter raises()"? > 33 /*setter raises(DOMException)*/; > > Are these spec'd to raise, but they never should? If so, please explain in > your ChangeLog. The spec says to raise these in case the DOM node is read only, but in reality this is never the case. Strictly, it can happen if the <style> is a descendant of an Entity or EntityReference node. Various methods would need to check isReadOnly() and throw a NO_MODIFICATION_ALLOWED_ERR in this case. Does XMLTokenizerLibxml2 ever cause parsed XML documents to include EntityReference nodes instead of expanding them? I couldn't tell from a quick look. > In general this looks great! If you were a committer, I would r+ and you could > land with changes. Thanks! WebKit code is pretty nice to work with. :-)
Eric Seidel (no email)
Comment 4 Tuesday, September 1, 2009 4:08:58 PM UTC
Comment on attachment 38811 [details] Patch v2 Shouldn't we just pass the ec along to setAttribute? Then we future-proof ourselves against the read-only node case, no? void setAttribute(const QualifiedName&, const AtomicString& value, ExceptionCode&);
Eric Seidel (no email)
Comment 5 Wednesday, September 2, 2009 11:02:42 AM UTC
Comment on attachment 38811 [details] Patch v2 r- for the unanswered setter issue. Seems no reason to remove these exception codes if setAttribute can/should still throw.
Cameron McCormack (:heycam)
Comment 6 Thursday, September 3, 2009 1:49:08 AM UTC
Created attachment 38957 [details] Patch v3 OK, that's reasonable about passing along the ExceptionCode.
Cameron McCormack (:heycam)
Comment 7 Thursday, September 3, 2009 1:50:56 AM UTC
Comment on attachment 38957 [details] Patch v3 How about I test it first before requesting review...
Cameron McCormack (:heycam)
Comment 8 Thursday, September 3, 2009 5:51:41 AM UTC
Created attachment 38965 [details] Patch v4 Turns out I couldn't use [Reflect] for title, since there needs to be a title() method on SVGStyleElement to override the one on StyleElement. Oh well. I had some changes to the ObjC bindings generators to make them work with [Reflect]ed attributes with setter exceptions, but I might file them separately.
Cameron McCormack (:heycam)
Comment 9 Thursday, September 3, 2009 6:02:28 AM UTC
Created attachment 38966 [details] Patch v4a Sigh, don't edit patches by hand without checking them. :/
Eric Seidel (no email)
Comment 10 Thursday, September 3, 2009 9:43:59 AM UTC
Comment on attachment 38966 [details] Patch v4a Wonderful!
Eric Seidel (no email)
Comment 11 Thursday, September 3, 2009 10:12:31 AM UTC
Comment on attachment 38966 [details] Patch v4a Clearing flags on attachment: 38966 Committed r48010: <http://trac.webkit.org/changeset/48010>
Eric Seidel (no email)
Comment 12 Thursday, September 3, 2009 10:12:35 AM UTC
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.