Bug 82682 - Clean up SelectorChecker::checkOneSelector()
Summary: Clean up SelectorChecker::checkOneSelector()
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Luke Macpherson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-29 17:38 PDT by Luke Macpherson
Modified: 2022-07-13 15:31 PDT (History)
11 users (show)

See Also:


Attachments
Patch (15.16 KB, patch)
2012-03-29 17:40 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff
Patch (15.10 KB, patch)
2012-03-29 18:02 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ec2-cr-linux-04 (12.60 MB, application/zip)
2012-03-30 00:47 PDT, WebKit Review Bot
no flags Details
Merge only (15.13 KB, patch)
2012-04-10 16:53 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff
Patch (15.09 KB, patch)
2012-04-10 17:41 PDT, Luke Macpherson
koivisto: review-
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ec2-cr-linux-03 (7.53 MB, application/zip)
2012-04-11 03:25 PDT, WebKit Review Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Macpherson 2012-03-29 17:38:01 PDT
Clean up SelectorChecker::checkOneSelector()
Comment 1 Luke Macpherson 2012-03-29 17:40:24 PDT
Created attachment 134703 [details]
Patch
Comment 2 Luke Macpherson 2012-03-29 17:42:05 PDT
Motivated by ap's comments on https://bugs.webkit.org/show_bug.cgi?id=82402
Comment 3 Build Bot 2012-03-29 17:57:00 PDT
Comment on attachment 134703 [details]
Patch

Attachment 134703 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/12263009
Comment 4 Luke Macpherson 2012-03-29 18:02:27 PDT
Created attachment 134706 [details]
Patch
Comment 5 Alexey Proskuryakov 2012-03-29 23:49:33 PDT
Generally speaking, my inclination would be to fix a bug first, and clean up afterwards - it's dangerous to clean up code that's doing a wrong thing. Do you think that it's better to do it in a different order here?
Comment 6 Luke Macpherson 2012-03-30 00:03:22 PDT
One advantage of this patch is that it now has two assertions, one when falling though from an invalid enum entry, and one for a valid enum that is unhandled.That should make the cause of hitting the assertion easier to track down.
Comment 7 Alexey Proskuryakov 2012-03-30 00:09:00 PDT
We have a repro case that can be just opened in a debugger - why is there a need to rely on indirect channels to gather information? I'd understand if this assertion was only seen on buildbots, and wasn't reproducible locally.
Comment 8 Luke Macpherson 2012-03-30 00:19:09 PDT
This patch brings the code into line with webkit style. A pleasant side effect is that it will make the code slightly easier to debug. I don't know what other justification is needed.
Comment 9 Alexey Proskuryakov 2012-03-30 00:36:15 PDT
Well yes, and this is exactly the wrong thing to do to buggy code, isn't it?
Comment 10 WebKit Review Bot 2012-03-30 00:47:02 PDT
Comment on attachment 134706 [details]
Patch

Attachment 134706 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12253137

New failing tests:
fast/css/pseudo-empty-dynamic-empty.html
css3/selectors3/html/css3-modsel-73b.html
css3/selectors3/xml/css3-modsel-73.xml
css3/flexbox/multiline-shrink-to-fit.html
css3/selectors3/xhtml/css3-modsel-73.xml
css3/selectors3/xml/css3-modsel-146a.xml
fast/css/nth-child-dynamic.html
css3/selectors3/html/css3-modsel-73.html
fast/dom/HTMLMeterElement/meter-appearances-capacity.html
css3/selectors3/xml/css3-modsel-73b.xml
css3/selectors3/xhtml/css3-modsel-146a.xml
css3/selectors3/html/css3-modsel-28.html
fast/dom/HTMLMeterElement/meter-appearances-rating-relevancy.html
css3/flexbox/multiline-reverse-wrap-baseline.html
css3/flexbox/multiline-line-pack.html
fast/css/css3-space-in-nth-and-lang.html
css3/selectors3/xml/css3-modsel-28.xml
fast/css/css3-nth-child.html
css3/selectors3/xhtml/css3-modsel-28.xml
css3/selectors3/xhtml/css3-modsel-73b.xml
Comment 11 WebKit Review Bot 2012-03-30 00:47:11 PDT
Created attachment 134740 [details]
Archive of layout-test-results from ec2-cr-linux-04

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-04  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 12 Kentaro Hara 2012-04-10 05:13:45 PDT
Comment on attachment 134706 [details]
Patch

r- due to ap's comment.
Comment 13 Luke Macpherson 2012-04-10 16:53:46 PDT
Created attachment 136574 [details]
Merge only
Comment 14 Luke Macpherson 2012-04-10 16:54:14 PDT
(In reply to comment #12)
> (From update of attachment 134706 [details])
> r- due to ap's comment.

AP is wrong. He can't point to any known bugs in the code that I'm actually changing here, and we can't stop all work on webkit because there might be a bug somewhere else in the codebase.
Comment 15 Gustavo Noronha (kov) 2012-04-10 17:01:04 PDT
Comment on attachment 136574 [details]
Merge only

Attachment 136574 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/12382524
Comment 16 Alexey Proskuryakov 2012-04-10 17:01:32 PDT
Comment on attachment 136574 [details]
Merge only

It's not "might be a bug". There is a known bug, but you complicate fixing it with useless code churn. This is not a way to deal with bugs.
Comment 17 Luke Macpherson 2012-04-10 17:23:25 PDT
(In reply to comment #16)
> (From update of attachment 136574 [details])
> It's not "might be a bug". There is a known bug, but you complicate fixing it with useless code churn. This is not a way to deal with bugs.

I think it's important to distinguish between a bug in this code, and a bug in a caller of this code. I don't think I've seen any evidence that there is a bug here.

Are you worried that stack traces will no longer match up in some internal bug reporting tool or something?
Comment 18 Luke Macpherson 2012-04-10 17:38:09 PDT
Just want to make sure it's 100% clear to any onlookers - this code cleanup is not intended to fix https://bugs.webkit.org/show_bug.cgi?id=82402 .

All it does is replace the default case with a complete list of enum values, and use early returns instead of breaks in the switch.
Comment 19 Luke Macpherson 2012-04-10 17:41:14 PDT
Created attachment 136584 [details]
Patch
Comment 20 Kentaro Hara 2012-04-10 23:54:37 PDT
(In reply to comment #18)
> Just want to make sure it's 100% clear to any onlookers - this code cleanup is not intended to fix https://bugs.webkit.org/show_bug.cgi?id=82402 .

I think this is a problem. As ap pointed out, we do not want to refactor the code before fixing a known bug (e.g. the refactoring might "hide" the bug), unless the refactoring helps us fix the bug.

Would you dig into the bug first before refactoring?
Comment 21 WebKit Review Bot 2012-04-11 03:25:23 PDT
Comment on attachment 136584 [details]
Patch

Attachment 136584 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12386306

New failing tests:
fast/css/pseudo-empty-dynamic-empty.html
css3/selectors3/html/css3-modsel-73b.html
css3/selectors3/xml/css3-modsel-73.xml
css3/flexbox/multiline-shrink-to-fit.html
css3/selectors3/xhtml/css3-modsel-73.xml
css3/selectors3/xml/css3-modsel-146a.xml
fast/css/nth-child-dynamic.html
css3/selectors3/html/css3-modsel-73.html
fast/dom/HTMLMeterElement/meter-appearances-capacity.html
css3/selectors3/xml/css3-modsel-73b.xml
css3/selectors3/xhtml/css3-modsel-146a.xml
css3/selectors3/html/css3-modsel-28.html
fast/dom/HTMLMeterElement/meter-appearances-rating-relevancy.html
css3/flexbox/multiline-reverse-wrap-baseline.html
css3/flexbox/multiline-line-pack.html
fast/css/css3-space-in-nth-and-lang.html
css3/selectors3/xml/css3-modsel-28.xml
fast/css/css3-nth-child.html
css3/selectors3/xhtml/css3-modsel-28.xml
css3/selectors3/xhtml/css3-modsel-73b.xml
Comment 22 WebKit Review Bot 2012-04-11 03:25:30 PDT
Created attachment 136653 [details]
Archive of layout-test-results from ec2-cr-linux-03

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-03  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 23 Antti Koivisto 2012-04-11 06:56:57 PDT
Comment on attachment 136584 [details]
Patch

Alexey is right. There is an actual bug to fix. Low-value cleanup patches like this, without context (a bug fix or a new feature) are just noise.
Comment 24 Brent Fulgham 2022-07-13 15:31:46 PDT
This code has been significantly refactored since this patch was proposed. There doesn't seem to be any action we can take here.