Bug 129671 - inSynchronizationOfLazyAttribute is making setAttributeInternal incomprehensible
Summary: inSynchronizationOfLazyAttribute is making setAttributeInternal incomprehensible
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on: 129550
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-04 01:37 PST by Ryosuke Niwa
Modified: 2016-04-29 20:25 PDT (History)
7 users (show)

See Also:


Attachments
Cleanup (2.50 KB, patch)
2014-03-04 02:15 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2014-03-04 01:37:23 PST
inSynchronizationOfLazyAttribute is evaluated 4 times in various conditions even though
all can just call ensureUniqueElementData().attributeAt(index).setValue(newValue) and exit early when it's true.

Just do that so that the rest of code is more readable.
Comment 1 Ryosuke Niwa 2014-03-04 02:15:19 PST
Created attachment 225764 [details]
Cleanup
Comment 2 Andreas Kling 2014-03-04 02:21:08 PST
Comment on attachment 225764 [details]
Cleanup

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

> Source/WebCore/dom/Element.cpp:1032
> +    if (UNLIKELY(inSynchronizationOfLazyAttribute)) {
> +        ensureUniqueElementData().attributeAt(index).setValue(newValue);
> +        return;
> +    }

I think you have a bug here. If there is an Attr node, you will no longer reset its text children.
Comment 3 Ryosuke Niwa 2014-03-04 02:32:07 PST
Comment on attachment 225764 [details]
Cleanup

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

>> Source/WebCore/dom/Element.cpp:1032
>> +    }
> 
> I think you have a bug here. If there is an Attr node, you will no longer reset its text children.

It comes from http://trac.webkit.org/changeset/139100. I can add a comment if you'd like.
Comment 4 Ryosuke Niwa 2016-04-29 20:25:00 PDT
Comment on attachment 225764 [details]
Cleanup

Too old.