Bug 125527

Summary: Clean up SVGScriptElement
Product: WebKit Reporter: Rob Buis <rwlbuis>
Component: SVGAssignee: Rob Buis <rwlbuis>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, cdumez, commit-queue, d-r, esprehn+autocc, fmalita, gyuyoung.kim, kondapallykalyan, pdr, schenney, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 125670    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch darin: review+

Description Rob Buis 2013-12-10 11:49:10 PST
There seems to be no need for m_type or the type getter/setters to be there.
Comment 1 Rob Buis 2013-12-10 11:54:25 PST
Created attachment 218888 [details]
Patch
Comment 2 Sam Weinig 2013-12-10 13:05:19 PST
Comment on attachment 218888 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=218888&action=review

> Source/WebCore/svg/SVGScriptElement.idl:29
> +    [TreatNullAs=NullString, ImplementedAs=typeAttributeValue] attribute DOMString type;

Can this use Reflect?
Comment 3 Rob Buis 2013-12-10 13:38:24 PST
(In reply to comment #2)
> (From update of attachment 218888 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=218888&action=review
> 
> > Source/WebCore/svg/SVGScriptElement.idl:29
> > +    [TreatNullAs=NullString, ImplementedAs=typeAttributeValue] attribute DOMString type;
> 
> Can this use Reflect?

Hi Sam, I was concerned that Reflect would not be able to tell it is the svg type attribute, not the html type attribute, but it is. Will make a new patch.
Comment 4 Rob Buis 2013-12-10 13:46:19 PST
Created attachment 218904 [details]
Patch
Comment 5 Sam Weinig 2013-12-10 13:51:56 PST
Comment on attachment 218904 [details]
Patch

r=me
Comment 6 WebKit Commit Bot 2013-12-10 14:25:07 PST
Comment on attachment 218904 [details]
Patch

Clearing flags on attachment: 218904

Committed r160389: <http://trac.webkit.org/changeset/160389>
Comment 7 WebKit Commit Bot 2013-12-10 14:25:10 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Darin Adler 2013-12-12 00:03:15 PST
Comment on attachment 218904 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=218904&action=review

> Source/WebCore/svg/SVGScriptElement.idl:29
> +    [TreatNullAs=NullString, Reflect] attribute DOMString type;

This is more than a cleanup. It’s a bug fix.

The old setter code would not set the content attribute when you set the type attribute from JavaScript. The reverse would work, setting the content attribute would affect what you see from JavaScript. We should have a regression test demonstrating this improvement in behavior.
Comment 9 Rob Buis 2013-12-12 14:24:48 PST
Reopening to attach new patch.
Comment 10 Rob Buis 2013-12-12 14:24:59 PST
Created attachment 219119 [details]
Patch
Comment 11 Rob Buis 2013-12-12 14:40:08 PST
(In reply to comment #8)
> (From update of attachment 218904 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=218904&action=review
> 
> > Source/WebCore/svg/SVGScriptElement.idl:29
> > +    [TreatNullAs=NullString, Reflect] attribute DOMString type;
> 
> This is more than a cleanup. It’s a bug fix.
> 
> The old setter code would not set the content attribute when you set the type attribute from JavaScript. The reverse would work, setting the content attribute would affect what you see from JavaScript. We should have a regression test demonstrating this improvement in behavior.

Makes sense, I'll work on adding a test.
Comment 12 Rob Buis 2013-12-12 15:23:40 PST
Comment on attachment 219119 [details]
Patch

Clear review flag since I want to add the test as well.
Comment 13 Rob Buis 2013-12-12 15:52:15 PST
Created attachment 219131 [details]
Patch
Comment 14 Rob Buis 2013-12-12 16:00:36 PST
A further datapoint, FireFox syncs the type JS property and the content attribute too.
Comment 15 Brent Fulgham 2013-12-12 21:30:33 PST
I'd love to get this landed; I think it will clear up four build bot test failures on our Debug machines.
Comment 16 Rob Buis 2013-12-13 07:04:46 PST
(In reply to comment #15)
> I'd love to get this landed; I think it will clear up four build bot test failures on our Debug machines.

It landed in r160544, sorry about the test failures.
Comment 17 Brent Fulgham 2013-12-13 08:53:43 PST
(In reply to comment #16)
> (In reply to comment #15)
> > I'd love to get this landed; I think it will clear up four build bot test failures on our Debug machines.
> 
> It landed in r160544, sorry about the test failures.

Excellent!  And it did clear those failures.  Nice and green again. :-)