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.
<rdar://problem/13356715>
Created attachment 191703 [details] Patch
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);
Created attachment 191952 [details] Patch for landing
(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); }
Comment on attachment 191952 [details] Patch for landing Clearing flags on attachment: 191952 Committed r145057: <http://trac.webkit.org/changeset/145057>
All reviewed patches have been landed. Closing bug.