RESOLVED FIXED 154035
Fix the !(ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT)) after r196281
https://bugs.webkit.org/show_bug.cgi?id=154035
Summary Fix the !(ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT)) after r196281
Csaba Osztrogonác
Reported 2016-02-09 09:31:10 PST
https://trac.webkit.org/r196281 broke the !(ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT)) build: In file included from ../../Source/WebCore/dom/ComposedTreeIterator.cpp:27:0: ../../Source/WebCore/dom/ComposedTreeIterator.h: In constructor 'WebCore::ComposedTreeIterator::Context::Context(WebCore::ContainerNode&, WebCore::Node&, size_t)': ../../Source/WebCore/dom/ComposedTreeIterator.h:74:15: error: class 'WebCore::ComposedTreeIterator::Context' does not have any field named 'slotNodeIndex' slotNodeIndex is declared inside ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT) guard, but it is initialized unconditionally, which is incorrect and caused build failure.
Attachments
Patch (1.41 KB, patch)
2016-02-09 09:34 PST, Csaba Osztrogonác
no flags
Patch_option1 (2.28 KB, patch)
2016-02-10 09:45 PST, Csaba Osztrogonác
no flags
Patch_option2 (1.71 KB, patch)
2016-02-11 03:39 PST, Csaba Osztrogonác
no flags
Csaba Osztrogonác
Comment 1 2016-02-09 09:34:48 PST
WebKit Commit Bot
Comment 2 2016-02-10 02:28:26 PST
Comment on attachment 270936 [details] Patch Clearing flags on attachment: 270936 Committed r196365: <http://trac.webkit.org/changeset/196365>
WebKit Commit Bot
Comment 3 2016-02-10 02:28:30 PST
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 4 2016-02-10 09:06:14 PST
Comment on attachment 270936 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=270936&action=review > Source/WebCore/dom/ComposedTreeIterator.h:81 > +#if ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT) > , slotNodeIndex(slotNodeIndex) > { } > +#else > + { > + UNUSED_PARAM(slotNodeIndex); > + } > +#endif I should have caught you before landing this. I think we should have a style rule that #if should never introduce additional sets of braces unless it’s around an entire function. I also would have moved it outside the ComposedTreeIterator class definition because it starts to crud up the class definition and make it too hard to read. Thus I would have written this: Context(ContainerNode& root, Node&, size_t slotNodeIndex = notFound); ... inline ComposedTreeIterator::Context::Context(ContainerNode& root, Node& node, size_t slotNodeIndex) : iterator(root, &node) #if ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT) , slotNodeIndex(slotNodeIndex) #endif { #if !(ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT)) UNUSED_PARAM(slotNodeIndex); #endif }
Csaba Osztrogonác
Comment 5 2016-02-10 09:45:11 PST
Reopening to attach new patch.
Csaba Osztrogonác
Comment 6 2016-02-10 09:45:14 PST
Created attachment 270997 [details] Patch_option1 Style fix based on review comments. Not tested, let the EWS test ut.
WebKit Commit Bot
Comment 7 2016-02-10 09:46:13 PST
Attachment 270997 [details] did not pass style-queue: ERROR: Source/WebCore/dom/ComposedTreeIterator.h:72: The parameter name "node" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Antti Koivisto
Comment 8 2016-02-10 15:22:06 PST
I think a better fix is to just remove the #if around slotNodeIndex member. It doesn't really hurt to have it everywhere.
Csaba Osztrogonác
Comment 9 2016-02-11 03:39:47 PST
Created attachment 271056 [details] Patch_option2 It's all the same for me, please decide which one do you prefer.
WebKit Commit Bot
Comment 10 2016-02-11 10:19:03 PST
Comment on attachment 271056 [details] Patch_option2 Clearing flags on attachment: 271056 Committed r196422: <http://trac.webkit.org/changeset/196422>
WebKit Commit Bot
Comment 11 2016-02-11 10:19:08 PST
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.