Bug 79313

Summary: IsSynchronizingStyleAttributeFlag could be purged
Product: WebKit Reporter: Hajime Morrita <morrita>
Component: DOMAssignee: Hajime Morrita <morrita>
Status: RESOLVED FIXED    
Severity: Normal CC: gns, kling, koivisto, pnormand, webkit.review.bot, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 77860    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
morrita: review-
Patch v2 none

Description Hajime Morrita 2012-02-22 17:58:44 PST
It looks this flag can be implemented in another way to save a bit.
Comment 1 Hajime Morrita 2012-02-22 21:48:22 PST
Created attachment 128389 [details]
Patch
Comment 2 Hajime Morrita 2012-02-22 21:49:43 PST
Kling, Antti, What do you think about this?
Comment 3 Antti Koivisto 2012-02-23 15:48:56 PST
Comment on attachment 128389 [details]
Patch

I don't see why this static needs be in Node. It should be pushed down to StyledElement. Even better would be figuring out how to get rid of this mechanism completely.
Comment 4 Hajime Morrita 2012-02-23 16:55:58 PST
Created attachment 128608 [details]
Patch
Comment 5 Hajime Morrita 2012-02-23 16:57:19 PST
(In reply to comment #3)
> I don't see why this static needs be in Node. It should be pushed down to StyledElement. Even better would be figuring out how to get rid of this mechanism completely.
Right. I pushed down the flag to StyledElement. 
At this time, I yet found no good way to eliminate this flag entirely.
Could you take another look?
Comment 6 Philippe Normand 2012-02-23 17:11:41 PST
Comment on attachment 128608 [details]
Patch

Attachment 128608 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/11600516
Comment 7 Hajime Morrita 2012-02-23 17:44:05 PST
Created attachment 128620 [details]
Patch
Comment 8 Andreas Kling 2012-02-25 20:45:10 PST
Seems like it would be even cleaner to remove the flag and devise a way to update the style attribute without causing attributeChanged() & friends to be called.
Comment 9 Hajime Morrita 2012-02-26 17:14:50 PST
Comment on attachment 128620 [details]
Patch

Hmm. Okay, I'll investigate later. Clearing r? for now.
Comment 10 Andreas Kling 2012-02-27 16:39:36 PST
Created attachment 129127 [details]
Patch

Alternate approach.
Comment 11 WebKit Review Bot 2012-02-27 16:42:35 PST
Attachment 129127 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/dom/ElementAttributeData.h:72:  The parameter name "name" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Hajime Morrita 2012-02-27 19:42:46 PST
Comment on attachment 129127 [details]
Patch

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

> Source/WebCore/dom/ElementAttributeData.cpp:205
> +

It's sad to have this kind of duplication.
How about to move Element::setAttributeInternal() here to ElementAttributeData::setAttribute() and pass an element for invoking callbacks?
So that we can pass it a null to suppress callbacks and we'd no longer need this code duplication.
Comment 13 Hajime Morrita 2012-02-28 17:46:44 PST
Comment on attachment 129127 [details]
Patch

r- for pinging purpose. Feel free to turn r? again. It looks we need to fix style error anyway.
Comment 14 Andreas Kling 2012-02-29 14:31:48 PST
Created attachment 129519 [details]
Patch v2

Add a 'notifyChanged' parameter to setAttribute() instead to minimize copypasta.
Comment 15 Andreas Kling 2012-02-29 17:03:40 PST
Comment on attachment 129519 [details]
Patch v2

Clearing flags on attachment: 129519

Committed r109285: <http://trac.webkit.org/changeset/109285>
Comment 16 Andreas Kling 2012-02-29 17:03:50 PST
All reviewed patches have been landed.  Closing bug.