RESOLVED FIXED 173129
Move TreeScope::adoptIfNeeded to Node and rename it to setTreeScopeRecursively
https://bugs.webkit.org/show_bug.cgi?id=173129
Summary Move TreeScope::adoptIfNeeded to Node and rename it to setTreeScopeRecursively
Ryosuke Niwa
Reported 2017-06-08 22:13:35 PDT
We should move TreeScope::adoptIfNeeded to Nice and rename it to setTreeScopeRecursively. This basically brings back the code prior to https://trac.webkit.org/changeset/104528.
Attachments
Cleanup (23.43 KB, patch)
2017-06-08 22:34 PDT, Ryosuke Niwa
no flags
Fixed a typo (23.43 KB, patch)
2017-06-08 22:36 PDT, Ryosuke Niwa
no flags
Fixed relase builds (23.48 KB, patch)
2017-06-08 23:01 PDT, Ryosuke Niwa
no flags
Fixed release builds for real (23.54 KB, patch)
2017-06-08 23:47 PDT, Ryosuke Niwa
koivisto: review+
Ryosuke Niwa
Comment 1 2017-06-08 22:34:45 PDT
Ryosuke Niwa
Comment 2 2017-06-08 22:36:46 PDT
Created attachment 312384 [details] Fixed a typo
Radar WebKit Bug Importer
Comment 3 2017-06-08 22:38:07 PDT
Ryosuke Niwa
Comment 4 2017-06-08 23:01:29 PDT
Created attachment 312389 [details] Fixed relase builds
Ryosuke Niwa
Comment 5 2017-06-08 23:47:27 PDT
Created attachment 312394 [details] Fixed release builds for real
Antti Koivisto
Comment 6 2017-06-09 00:40:58 PDT
Comment on attachment 312394 [details] Fixed release builds for real View in context: https://bugs.webkit.org/attachment.cgi?id=312394&action=review > Source/WebCore/dom/Node.cpp:1926 > +#if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS) > +class DidMoveToNewDocumentAssertionScope { Maybe we should add NodeAssertions.h or similar at some point for this sort of things? The main files are pretty bloated already. > Source/WebCore/dom/Node.cpp:2019 > + if (!is<Element>(*node)) > + continue; It might make sense to add 'element' local right after this check and use it instead of 'node'. The following code will read better and may even get less branchy.
Ryosuke Niwa
Comment 7 2017-06-09 01:48:28 PDT
(In reply to Antti Koivisto from comment #6) > Comment on attachment 312394 [details] > Fixed release builds for real > > View in context: > https://bugs.webkit.org/attachment.cgi?id=312394&action=review > > > Source/WebCore/dom/Node.cpp:1926 > > +#if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS) > > +class DidMoveToNewDocumentAssertionScope { > > Maybe we should add NodeAssertions.h or similar at some point for this sort > of things? The main files are pretty bloated already. That sounds like a good idea. There's already NoEventDispatchAssertion.h so maybe we could rename hat to NodeAssertions.h and move all these assertions there. Although this particular one is local to Node.cpp so we probably don't need to put into the header. > > Source/WebCore/dom/Node.cpp:2019 > > + if (!is<Element>(*node)) > > + continue; > > It might make sense to add 'element' local right after this check and use it > instead of 'node'. The following code will read better and may even get less > branchy. Fixed that.
Ryosuke Niwa
Comment 8 2017-06-09 01:59:24 PDT
Note You need to log in before you can comment on or make changes to this bug.