| Summary: | Web Inspector: Improve runtime of pseudo-element sidebar style ordering | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Devin Rousso <hi> | ||||||||
| Component: | Web Inspector | Assignee: | Devin Rousso <hi> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | commit-queue, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer | ||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||
| Version: | 528+ (Nightly build) | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Devin Rousso
2015-07-10 18:55:21 PDT
Created attachment 256636 [details]
Patch
Comment on attachment 256636 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=256636&action=review > Source/WebInspectorUI/UserInterface/Models/CSSRule.js:83 > + this._mostSpecificSelector = this._determineMostSpecificSelector(); This could be in the getter and called when !this._mostSpecificSelector. That way it is as lazy as possible. > Source/WebInspectorUI/UserInterface/Models/CSSRule.js:193 > + if (!this._mostSpecificSelector) This would need to use the getter if you make it lazy. > Source/WebInspectorUI/UserInterface/Models/CSSRule.js:196 > + return this._mostSpecificSelector.isGreaterThan(otherSelector); Ditto. > Source/WebInspectorUI/UserInterface/Models/CSSRule.js:211 > + return; This should be: return null; Created attachment 256651 [details]
Patch
Comment on attachment 256651 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=256651&action=review > Source/WebInspectorUI/UserInterface/Models/CSSRule.js:199 > + return; return false; or return true;? Comment on attachment 256651 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=256651&action=review >> Source/WebInspectorUI/UserInterface/Models/CSSRule.js:199 >> + return; > > return false; or return true;? This is meant to be "return false;". Is it necessary to specify false (since undefined is falsy)? Comment on attachment 256651 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=256651&action=review >>> Source/WebInspectorUI/UserInterface/Models/CSSRule.js:199 >>> + return; >> >> return false; or return true;? > > This is meant to be "return false;". Is it necessary to specify false (since undefined is falsy)? The JIT is happier when types don't change in the flow. We also like to be explicit. Created attachment 256667 [details]
Patch
Comment on attachment 256667 [details] Patch Clearing flags on attachment: 256667 Committed r186717: <http://trac.webkit.org/changeset/186717> All reviewed patches have been landed. Closing bug. |