mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-21 03:43:16 +09:00
Issue #1386 - Devirtualize GetRowSpan/GetColSpan
It's at ~1.5% on the perf log for the Netflix use case, which seems a bit too much.
This commit is contained in:
parent
2c6ab7ccd9
commit
a05c6a317b
7 changed files with 41 additions and 64 deletions
|
|
@ -1160,47 +1160,6 @@ nsMathMLmtdFrame::Init(nsIContent* aContent,
|
|||
RemoveStateBits(NS_FRAME_FONT_INFLATION_FLOW_ROOT);
|
||||
}
|
||||
|
||||
int32_t
|
||||
nsMathMLmtdFrame::GetRowSpan()
|
||||
{
|
||||
int32_t rowspan = 1;
|
||||
|
||||
// Don't look at the content's rowspan if we're not an mtd or a pseudo cell.
|
||||
if (mContent->IsMathMLElement(nsGkAtoms::mtd_) &&
|
||||
!StyleContext()->GetPseudo()) {
|
||||
nsAutoString value;
|
||||
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::rowspan, value);
|
||||
if (!value.IsEmpty()) {
|
||||
nsresult error;
|
||||
rowspan = value.ToInteger(&error);
|
||||
if (NS_FAILED(error) || rowspan < 0)
|
||||
rowspan = 1;
|
||||
rowspan = std::min(rowspan, MAX_ROWSPAN);
|
||||
}
|
||||
}
|
||||
return rowspan;
|
||||
}
|
||||
|
||||
int32_t
|
||||
nsMathMLmtdFrame::GetColSpan()
|
||||
{
|
||||
int32_t colspan = 1;
|
||||
|
||||
// Don't look at the content's colspan if we're not an mtd or a pseudo cell.
|
||||
if (mContent->IsMathMLElement(nsGkAtoms::mtd_) &&
|
||||
!StyleContext()->GetPseudo()) {
|
||||
nsAutoString value;
|
||||
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::columnspan_, value);
|
||||
if (!value.IsEmpty()) {
|
||||
nsresult error;
|
||||
colspan = value.ToInteger(&error);
|
||||
if (NS_FAILED(error) || colspan <= 0 || colspan > MAX_COLSPAN)
|
||||
colspan = 1;
|
||||
}
|
||||
}
|
||||
return colspan;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsMathMLmtdFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue