WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 111551
Web Inspector: identify layers for CSS generated content in LayerTreeAgent
https://bugs.webkit.org/show_bug.cgi?id=111551
Summary
Web Inspector: identify layers for CSS generated content in LayerTreeAgent
Antoine Quint
Reported
2013-03-06 02:54:39 PST
Some layers are created for pseudo elements, content created by CSS via the ::before or ::after pseudo-classes. Since these layers' renderer are not directly associated to a Node in the DOM tree, we'll probably want to identify as such in the UI, we should clearly identify such layers as generated content.
Attachments
Patch
(22.93 KB, patch)
2013-03-06 03:14 PST
,
Antoine Quint
no flags
Details
Formatted Diff
Diff
Patch for landing
(24.07 KB, patch)
2013-03-07 01:58 PST
,
Antoine Quint
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2013-03-06 02:55:05 PST
<
rdar://problem/13356715
>
Antoine Quint
Comment 2
2013-03-06 03:14:47 PST
Created
attachment 191703
[details]
Patch
Simon Fraser (smfr)
Comment 3
2013-03-06 14:30:45 PST
Comment on
attachment 191703
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=191703&action=review
> Source/WebCore/inspector/InspectorLayerTreeAgent.cpp:250 > + return "";
It's better to use emptyString().
> Source/WebCore/inspector/InspectorLayerTreeAgent.cpp:268 > + String identifier = m_pseudoElementToIdMap.get(pseudoElement); > + if (identifier.isNull()) > + return; > + > + m_pseudoElementToIdMap.remove(pseudoElement); > + m_idToPseudoElement.remove(identifier);
get() and remove() both do hash lookups. It would be better to find(), compare with != .end() to know if you found anything, then use remove(iterator);
Antoine Quint
Comment 4
2013-03-07 01:58:59 PST
Created
attachment 191952
[details]
Patch for landing
Antoine Quint
Comment 5
2013-03-07 01:59:55 PST
(In reply to
comment #3
)
> (From update of
attachment 191703
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=191703&action=review
> > > Source/WebCore/inspector/InspectorLayerTreeAgent.cpp:250 > > + return ""; > > It's better to use emptyString().
Will fix in landing patch.
> > Source/WebCore/inspector/InspectorLayerTreeAgent.cpp:268 > > + String identifier = m_pseudoElementToIdMap.get(pseudoElement); > > + if (identifier.isNull()) > > + return; > > + > > + m_pseudoElementToIdMap.remove(pseudoElement); > > + m_idToPseudoElement.remove(identifier); > > get() and remove() both do hash lookups. It would be better to find(), compare with != .end() to know if you found anything, then use remove(iterator);
Good point. I rewrote the method as follows for landing: void InspectorLayerTreeAgent::unbindPseudoElement(PseudoElement* pseudoElement) { HashMap<PseudoElement*, String>::iterator iterator = m_pseudoElementToIdMap.find(pseudoElement); if (iterator == m_pseudoElementToIdMap.end()) return; m_idToPseudoElement.remove(iterator->value); m_pseudoElementToIdMap.remove(iterator); }
WebKit Review Bot
Comment 6
2013-03-07 02:41:23 PST
Comment on
attachment 191952
[details]
Patch for landing Clearing flags on attachment: 191952 Committed
r145057
: <
http://trac.webkit.org/changeset/145057
>
WebKit Review Bot
Comment 7
2013-03-07 02:41:27 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.
Top of Page
Format For Printing
XML
Clone This Bug