RESOLVED FIXED 171909
Simplify relationship between Attr and Element now that Attr is childless
https://bugs.webkit.org/show_bug.cgi?id=171909
Summary Simplify relationship between Attr and Element now that Attr is childless
Chris Dumez
Reported 2017-05-09 20:21:01 PDT
No need to invalidate Attr node childNodeLists caches when its value changes since Attr Nodes can no longer have children after Bug 171688.
Attachments
Patch (9.89 KB, patch)
2017-05-09 20:35 PDT, Chris Dumez
no flags
Patch (14.25 KB, patch)
2017-05-09 22:40 PDT, Chris Dumez
no flags
Patch (15.40 KB, patch)
2017-05-09 22:48 PDT, Chris Dumez
no flags
Patch (15.42 KB, patch)
2017-05-10 08:29 PDT, Chris Dumez
no flags
Patch (15.42 KB, patch)
2017-05-10 08:40 PDT, Chris Dumez
no flags
Patch (26.07 KB, patch)
2017-05-10 14:27 PDT, Chris Dumez
no flags
Patch (26.07 KB, patch)
2017-05-10 14:52 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2017-05-09 20:35:28 PDT
Chris Dumez
Comment 2 2017-05-09 22:40:09 PDT
Ryosuke Niwa
Comment 3 2017-05-09 22:41:43 PDT
Comment on attachment 309580 [details] Patch I think we should hold off on these refactorings until next STP goes out to make reverting Attr node change is possible.
Chris Dumez
Comment 4 2017-05-09 22:48:28 PDT
Chris Dumez
Comment 5 2017-05-09 22:55:08 PDT
(In reply to Ryosuke Niwa from comment #3) > Comment on attachment 309580 [details] > Patch > > I think we should hold off on these refactorings until next STP goes out to > make reverting Attr node change is possible. Chrome and Firefox have done this a while back already without trouble so it seems very unlikely STP would cause this change to be reverted. That said, even if it does need to be reverted manually. It wouldn't been difficult. We are not talking about a lot of code.
Ryosuke Niwa
Comment 6 2017-05-09 23:31:11 PDT
Comment on attachment 309581 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=309581&action=review > Source/WebCore/dom/Node.cpp:894 > + for (auto* node = this; node; node = node->parentNode()) { > + if (auto* lists = node->nodeLists()) > + lists->invalidateCaches(attrName); This refactoring would result in a pref regression. It's very important for hasRareData() check to be inlined in this loop.
Chris Dumez
Comment 7 2017-05-10 07:02:00 PDT
(In reply to Ryosuke Niwa from comment #6) > Comment on attachment 309581 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=309581&action=review > > > Source/WebCore/dom/Node.cpp:894 > > + for (auto* node = this; node; node = node->parentNode()) { > > + if (auto* lists = node->nodeLists()) > > + lists->invalidateCaches(attrName); > > This refactoring would result in a pref regression. It's very important for > hasRareData() check to be inlined in this loop. Oh I did not realize that. I’ll revert this part, thanks.
Antti Koivisto
Comment 8 2017-05-10 07:40:02 PDT
Comment on attachment 309581 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=309581&action=review > Source/WebCore/dom/Element.cpp:-1281 > - // FIXME: Refactor this so it makes some sense. Nice!
Chris Dumez
Comment 9 2017-05-10 08:29:48 PDT
Chris Dumez
Comment 10 2017-05-10 08:40:53 PDT
Chris Dumez
Comment 11 2017-05-10 13:04:29 PDT
Comment on attachment 309608 [details] Patch Ryosuke made some improvement suggestions offline. I am trying them out.
Chris Dumez
Comment 12 2017-05-10 14:27:21 PDT
Ryosuke Niwa
Comment 13 2017-05-10 14:38:14 PDT
Comment on attachment 309635 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=309635&action=review > Source/WebCore/ChangeLog:18 > + Attr::setValueForBindings() wa thus renamed to setValue(). Its implementation Typo: wa -> was. > Source/WebCore/ChangeLog:21 > + Element::setAttributeInternal(). Maybe you can put this in the pervious line to make it read better? > Source/WebCore/dom/Node.cpp:841 > +bool Document::shouldInvalidateNodeListAndCollectionCaches() const Add inline here? > Source/WebCore/dom/Node.cpp:850 > +bool Document::shouldInvalidateNodeListAndCollectionCachesForAttribute(const QualifiedName& attrName) const Add inline here?
Chris Dumez
Comment 14 2017-05-10 14:52:42 PDT
WebKit Commit Bot
Comment 15 2017-05-10 15:25:46 PDT
Comment on attachment 309642 [details] Patch Clearing flags on attachment: 309642 Committed r216632: <http://trac.webkit.org/changeset/216632>
WebKit Commit Bot
Comment 16 2017-05-10 15:25:48 PDT
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.