summaryrefslogtreecommitdiffstats
path: root/layout/tables/nsTableCellFrame.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-02-07 09:52:57 +0100
committerGitHub <noreply@github.com>2020-02-07 09:52:57 +0100
commita6ef90b1830e263fefda7bcb6e7b74464044a678 (patch)
tree85fc59a89d370d98e2c132e2b4b77343eb507ff0 /layout/tables/nsTableCellFrame.cpp
parent99aa809cb850a19d09cb7fc3b92899085b4b447e (diff)
parent3a7d5d01cccf6abb3b83db8cf31ca213724f3ee7 (diff)
downloadUXP-a6ef90b1830e263fefda7bcb6e7b74464044a678.tar
UXP-a6ef90b1830e263fefda7bcb6e7b74464044a678.tar.gz
UXP-a6ef90b1830e263fefda7bcb6e7b74464044a678.tar.lz
UXP-a6ef90b1830e263fefda7bcb6e7b74464044a678.tar.xz
UXP-a6ef90b1830e263fefda7bcb6e7b74464044a678.zip
Merge pull request #1388 from win7-7/devirtualize-pr
Merging this in even without a test performed since the code change looks sane. real-world testing will have to be performed.
Diffstat (limited to 'layout/tables/nsTableCellFrame.cpp')
-rw-r--r--layout/tables/nsTableCellFrame.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp
index 2862bb201..cd846efa2 100644
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -711,16 +711,18 @@ nsTableCellFrame::GetCellBaseline() const
borderPadding;
}
-int32_t nsTableCellFrame::GetRowSpan()
+int32_t
+nsTableCellFrame::GetRowSpan()
{
int32_t rowSpan=1;
- nsGenericHTMLElement *hc = nsGenericHTMLElement::FromContent(mContent);
// Don't look at the content's rowspan if we're a pseudo cell
- if (hc && !StyleContext()->GetPseudo()) {
- const nsAttrValue* attr = hc->GetParsedAttr(nsGkAtoms::rowspan);
+ if (!StyleContext()->GetPseudo()) {
+ dom::Element* elem = mContent->AsElement();
+ const nsAttrValue* attr = elem->GetParsedAttr(nsGkAtoms::rowspan);
// Note that we don't need to check the tag name, because only table cells
- // and table headers parse the "rowspan" attribute into an integer.
+ // (including MathML <mtd>) and table headers parse the "rowspan" attribute
+ // into an integer.
if (attr && attr->Type() == nsAttrValue::eInteger) {
rowSpan = attr->GetIntegerValue();
}
@@ -728,16 +730,20 @@ int32_t nsTableCellFrame::GetRowSpan()
return rowSpan;
}
-int32_t nsTableCellFrame::GetColSpan()
+int32_t
+nsTableCellFrame::GetColSpan()
{
int32_t colSpan=1;
- nsGenericHTMLElement *hc = nsGenericHTMLElement::FromContent(mContent);
// Don't look at the content's colspan if we're a pseudo cell
- if (hc && !StyleContext()->GetPseudo()) {
- const nsAttrValue* attr = hc->GetParsedAttr(nsGkAtoms::colspan);
+ if (!StyleContext()->GetPseudo()) {
+ dom::Element* elem = mContent->AsElement();
+ const nsAttrValue* attr = elem->GetParsedAttr(
+ MOZ_UNLIKELY(elem->IsMathMLElement()) ? nsGkAtoms::columnspan_
+ : nsGkAtoms::colspan);
// Note that we don't need to check the tag name, because only table cells
- // and table headers parse the "colspan" attribute into an integer.
+ // (including MathML <mtd>) and table headers parse the "colspan" attribute
+ // into an integer.
if (attr && attr->Type() == nsAttrValue::eInteger) {
colSpan = attr->GetIntegerValue();
}