RESOLVED FIXED 88420
Web Inspector: Provide source data for all known rule types in CSSParser, except "keyframe" and "region"
https://bugs.webkit.org/show_bug.cgi?id=88420
Summary Web Inspector: Provide source data for all known rule types in CSSParser, exc...
Alexander Pavlov (apavlov)
Reported 2012-06-06 08:32:59 PDT
This patch does not intend to refactor the protocol, so some new code will be in an intermediate state to mask the actual rule tree structure (along with non-style rules) when pushing it over the WIP.
Attachments
Patch (88.77 KB, patch)
2012-06-06 10:40 PDT, Alexander Pavlov (apavlov)
no flags
Patch (50.10 KB, patch)
2012-06-07 06:19 PDT, Alexander Pavlov (apavlov)
no flags
Patch (49.21 KB, patch)
2012-06-07 07:18 PDT, Alexander Pavlov (apavlov)
no flags
Patch (49.89 KB, patch)
2012-06-07 09:49 PDT, Alexander Pavlov (apavlov)
no flags
Patch (41.32 KB, patch)
2012-06-25 06:32 PDT, Alexander Pavlov (apavlov)
no flags
Patch (40.18 KB, patch)
2012-06-25 09:05 PDT, Alexander Pavlov (apavlov)
no flags
Patch (39.44 KB, patch)
2012-06-29 04:08 PDT, Alexander Pavlov (apavlov)
koivisto: review+
Alexander Pavlov (apavlov)
Comment 1 2012-06-06 10:40:38 PDT
Alexander Pavlov (apavlov)
Comment 2 2012-06-06 10:45:19 PDT
Need to mention that Tools/Scripts/run-perf-tests Parser/css-parser-yui.html didn't show any impact of this change at all...
Vsevolod Vlasov
Comment 3 2012-06-07 04:53:00 PDT
Comment on attachment 146060 [details] Patch Please split this patch.
Alexander Pavlov (apavlov)
Comment 4 2012-06-07 06:19:20 PDT
Vsevolod Vlasov
Comment 5 2012-06-07 07:10:54 PDT
Comment on attachment 146272 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=146272&action=review > Source/WebCore/css/CSSParser.cpp:305 > +void CSSParser::parseSheet(StyleSheetContents* sheet, const String& string, int startLineNumber, Vector<RefPtr<CSSRuleSourceData> >* ruleSourceDataResult) You could use RuleSourceDataList here. > Source/WebCore/css/CSSParser.h:317 > + Vector<SourceRange> m_ruleBodyRangeStack; Why do you need two stacks?
Alexander Pavlov (apavlov)
Comment 6 2012-06-07 07:18:57 PDT
Alexander Pavlov (apavlov)
Comment 7 2012-06-07 09:49:17 PDT
Alexander Pavlov (apavlov)
Comment 8 2012-06-25 06:32:32 PDT
Vsevolod Vlasov
Comment 9 2012-06-25 08:28:48 PDT
Comment on attachment 149281 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149281&action=review > Source/WebCore/css/CSSGrammar.y:492 > + | before_import_rule IMPORT_SYM error ';' { I don't think you need to gather any data for errors. This change should be reverted. > Source/WebCore/css/CSSGrammar.y:496 > + | before_import_rule IMPORT_SYM error invalid_block { Ditto, should be reverted. > Source/WebCore/css/CSSGrammar.y:684 > + CSSParser* p = static_cast<CSSParser*>(parser); This should probably be in the end of keyframes action. > Source/WebCore/css/CSSGrammar.y:685 > + if (p->isExtractingSourceData()) I would move this check inside the method. > Source/WebCore/css/CSSGrammar.y:744 > + | before_page_rule PAGE_SYM error invalid_block { Ditto, should be reverted. > Source/WebCore/css/CSSGrammar.y:748 > + | before_page_rule PAGE_SYM error ';' { Ditto, should be reverted. > Source/WebCore/css/CSSGrammar.y:856 > + | before_font_face_rule FONT_FACE_SYM error invalid_block { Ditto, should be reverted. > Source/WebCore/css/CSSGrammar.y:860 > + | before_font_face_rule FONT_FACE_SYM error ';' { Ditto, should be reverted. > Source/WebCore/css/CSSParser.cpp:1156 > + RefPtr<CSSRuleSourceData> ruleSourceDataRef = ruleSourceData; prpRuleSourceData / ruleSourceData? > Source/WebCore/css/CSSParser.cpp:1175 > + if (ruleSourceDataRef) { I would add an assertion that stack size is correct here. > Source/WebCore/css/CSSParser.cpp:9375 > + ASSERT(!m_currentRuleDataStack->isEmpty()); We can probably extract these 4-5 lines to one method. > Source/WebCore/css/CSSParser.cpp:9681 > +void CSSParser::markAtRuleHeaderStart(CSSRuleSourceData::Type ruleType) Looks like markStyleRuleHeaderStart and markAtRuleHeaderStart are identical.
Alexander Pavlov (apavlov)
Comment 10 2012-06-25 09:05:55 PDT
Vsevolod Vlasov
Comment 11 2012-06-25 09:52:04 PDT
Comment on attachment 149301 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149301&action=review > Source/WebCore/css/CSSParser.cpp:9339 > +void CSSParser::updateTopRuleBodyEnd() Could this be replaced by markRuleBodyEnd? > Source/WebCore/css/CSSParser.cpp:9344 > + if (m_currentRuleDataStack->isEmpty()) The stack is never empty at this point. > Source/WebCore/css/CSSParser.cpp:9350 > + if (!data) You are already asserting data is not null on the line above.
Alexander Pavlov (apavlov)
Comment 12 2012-06-29 04:08:56 PDT
Vsevolod Vlasov
Comment 13 2012-06-29 04:25:49 PDT
Comment on attachment 150133 [details] Patch This looks good to me now inspector-wise.
Antti Koivisto
Comment 14 2012-06-29 04:43:40 PDT
Comment on attachment 150133 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=150133&action=review r=me > Source/WebCore/ChangeLog:9 > + No new tests, as there is no client-visible behavior change. Existing Inspector tests will be modified > + to test the new data provided, along with the necessary Inspector plumbing. You could add a word about performance (which I hear progresses)
Antti Koivisto
Comment 15 2012-06-29 04:45:26 PDT
Comment on attachment 150133 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=150133&action=review >> Source/WebCore/ChangeLog:9 >> + to test the new data provided, along with the necessary Inspector plumbing. > > You could add a word about performance (which I hear progresses) And some motivation too.
Alexander Pavlov (apavlov)
Comment 16 2012-06-29 05:06:30 PDT
Note You need to log in before you can comment on or make changes to this bug.