Bug 1211858 - Add a hint for the Restyle label when the id is unavailable. r=roc,benwa
This commit is contained in:
@@ -4346,20 +4346,16 @@ ElementRestyler::ComputeStyleChangeFor(nsIFrame* aFrame,
|
|||||||
aSwappedStructOwners)
|
aSwappedStructOwners)
|
||||||
{
|
{
|
||||||
nsIContent* content = aFrame->GetContent();
|
nsIContent* content = aFrame->GetContent();
|
||||||
nsAutoCString idStr;
|
nsAutoCString localDescriptor;
|
||||||
if (profiler_is_active() && content) {
|
if (profiler_is_active() && content) {
|
||||||
nsIAtom* id = content->GetID();
|
std::string elemDesc = ToString(*content);
|
||||||
if (id) {
|
localDescriptor.Assign(elemDesc.c_str());
|
||||||
id->ToUTF8String(idStr);
|
|
||||||
} else {
|
|
||||||
idStr.AssignLiteral("?");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PROFILER_LABEL_PRINTF("ElementRestyler", "ComputeStyleChangeFor",
|
PROFILER_LABEL_PRINTF("ElementRestyler", "ComputeStyleChangeFor",
|
||||||
js::ProfileEntry::Category::CSS,
|
js::ProfileEntry::Category::CSS,
|
||||||
content ? "Element: %s" : "%s",
|
content ? "Element: %s" : "%s",
|
||||||
content ? idStr.get() : "");
|
content ? localDescriptor.get() : "");
|
||||||
if (aMinChange) {
|
if (aMinChange) {
|
||||||
aChangeList->AppendChange(aFrame, content, aMinChange);
|
aChangeList->AppendChange(aFrame, content, aMinChange);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user