WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
82847
Add mechanism for mapping from StyleRules back to fully constructed CSSStyleRules
https://bugs.webkit.org/show_bug.cgi?id=82847
Summary
Add mechanism for mapping from StyleRules back to fully constructed CSSStyleR...
Antti Koivisto
Reported
2012-04-01 12:28:57 PDT
Inspector is using CSSStyleSelector to calculate the CSS rules matched by a given element and expects to be able to walk the parent chain. After 82728 the stylesheet object tree won't have parent pointers and we are going to need another mechanism to support this.
Attachments
patch
(17.04 KB, patch)
2012-04-01 12:52 PDT
,
Antti Koivisto
kling
: review-
Details
Formatted Diff
Diff
with bug url
(17.06 KB, patch)
2012-04-01 13:09 PDT
,
Antti Koivisto
kling
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Antti Koivisto
Comment 1
2012-04-01 12:52:24 PDT
Created
attachment 135012
[details]
patch
Andreas Kling
Comment 2
2012-04-01 12:55:04 PDT
Comment on
attachment 135012
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=135012&action=review
> Source/WebCore/ChangeLog:3 > + Add mechanism for mapping from StyleRules back to fully constructed CSSStyleRules
NO BUG NUMBER R- BRO
Antti Koivisto
Comment 3
2012-04-01 13:09:38 PDT
Created
attachment 135013
[details]
with bug url
WebKit Review Bot
Comment 4
2012-04-01 13:11:18 PDT
Attachment 135013
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/css/CSSStyleSelector.cpp:2927: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Andreas Kling
Comment 5
2012-04-01 13:17:18 PDT
Comment on
attachment 135013
[details]
with bug url View in context:
https://bugs.webkit.org/attachment.cgi?id=135013&action=review
> Source/WebCore/css/CSSStyleSelector.cpp:292 > +static CSSStyleSheet* fullscreenStyleSheet;
fullScreenStylesheet;
> Source/WebCore/css/CSSStyleSelector.h:495 > + HashMap<StyleRule*, RefPtr<CSSStyleRule> > m_styleRuleToCSSOMWrapperMap;
Style: Two spaces after >.
Andreas Kling
Comment 6
2012-04-01 13:17:31 PDT
Comment on
attachment 135013
[details]
with bug url TD;DR
Sam Weinig
Comment 7
2012-04-01 19:25:52 PDT
Would it make sense to just switch the inspector to using the internal representation?
Antti Koivisto
Comment 8
2012-04-02 03:55:17 PDT
(In reply to
comment #7
)
> Would it make sense to just switch the inspector to using the internal representation?
Sure but that's a separate refactoring. It also doesn't solve this particular problem.
Andreas Kling
Comment 9
2012-04-02 04:03:38 PDT
Comment on
attachment 135013
[details]
with bug url View in context:
https://bugs.webkit.org/attachment.cgi?id=135013&action=review
r=me. Let's do this thing.
> Source/WebCore/css/CSSStyleSelector.cpp:2905 > + const Vector<RefPtr<StyleSheet> >& styleSheets = document->styleSheets()->vector(); > + for (unsigned i = 0; i < styleSheets.size(); ++i) {
You could use the iteration helpers of StyleSheetList directly here instead of grabbing the Vector. NABD.
> Source/WebCore/css/CSSStyleSelector.h:247 > + CSSStyleRule* ensureFullCSSOMWrapperForStyleRule(StyleRule*);
As you mentioned, this could do with a scarier name, e.g ensureFullCSSOMWrapperForInspectorWhileUsingTerabytesOfMemory().
Antti Koivisto
Comment 10
2012-04-02 06:09:15 PDT
http://trac.webkit.org/changeset/112858
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug