Bug 1211858 - Add a hint for the Restyle label when the id is unavailable. r=roc,benwa

This commit is contained in:
Vivien Nicolas 2015-10-07 02:14:00 +02:00
parent b05796f04f
commit 3a3fa87417

View File

@ -4346,20 +4346,16 @@ ElementRestyler::ComputeStyleChangeFor(nsIFrame* aFrame,
aSwappedStructOwners)
{
nsIContent* content = aFrame->GetContent();
nsAutoCString idStr;
nsAutoCString localDescriptor;
if (profiler_is_active() && content) {
nsIAtom* id = content->GetID();
if (id) {
id->ToUTF8String(idStr);
} else {
idStr.AssignLiteral("?");
}
std::string elemDesc = ToString(*content);
localDescriptor.Assign(elemDesc.c_str());
}
PROFILER_LABEL_PRINTF("ElementRestyler", "ComputeStyleChangeFor",
js::ProfileEntry::Category::CSS,
content ? "Element: %s" : "%s",
content ? idStr.get() : "");
content ? localDescriptor.get() : "");
if (aMinChange) {
aChangeList->AppendChange(aFrame, content, aMinChange);
}