Bug 1738663 - Remove some unneeded special-cases in GenerateComputedDOMStyleGenerated. r=layout-reviewers,mats

Depends on D130018

Differential Revision: https://phabricator.services.mozilla.com/D130026
This commit is contained in:
Emilio Cobos Álvarez 2021-11-02 14:21:38 +00:00
Родитель 7c1b2c19fd
Коммит 72849955db
3 изменённых файлов: 17 добавлений и 31 удалений

Просмотреть файл

@ -34,22 +34,9 @@ static constexpr Entry kEntries[] = {
return False return False
return True return True
# Some special cases we may get rid of later. See bug 1471423.
def method(p):
if p.id.startswith("margin_"):
return "{}Width".format(p.method)
if p.id.startswith("_moz_"):
method = p.method[3:]
else:
method = p.method
if p.id.startswith("_moz_outline_radius_"):
method = method.replace("left", "Left")
method = method.replace("right", "Right")
return method
def getter_entry(p): def getter_entry(p):
if has_cpp_getter(p): if has_cpp_getter(p):
return "DoGet" + method(p) return "DoGet" + p.method
# Put a dummy getter here instead of nullptr because MSVC seems # Put a dummy getter here instead of nullptr because MSVC seems
# to have bug which ruins the table when we put nullptr for # to have bug which ruins the table when we put nullptr for
# pointer-to-member-function. See bug 1471426. # pointer-to-member-function. See bug 1471426.

Просмотреть файл

@ -1317,7 +1317,7 @@ already_AddRefed<nsROCSSPrimitiveValue> nsComputedDOMStyle::MatrixToCSSValue(
return val.forget(); return val.forget();
} }
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetOsxFontSmoothing() { already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetMozOsxFontSmoothing() {
if (nsContentUtils::ShouldResistFingerprinting( if (nsContentUtils::ShouldResistFingerprinting(
mPresShell->GetPresContext()->GetDocShell())) { mPresShell->GetPresContext()->GetDocShell())) {
return nullptr; return nullptr;
@ -1794,20 +1794,20 @@ already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetBorderRightWidth() {
return GetBorderWidthFor(eSideRight); return GetBorderWidthFor(eSideRight);
} }
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetMarginTopWidth() { already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetMarginTop() {
return GetMarginWidthFor(eSideTop); return GetMarginFor(eSideTop);
} }
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetMarginBottomWidth() { already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetMarginBottom() {
return GetMarginWidthFor(eSideBottom); return GetMarginFor(eSideBottom);
} }
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetMarginLeftWidth() { already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetMarginLeft() {
return GetMarginWidthFor(eSideLeft); return GetMarginFor(eSideLeft);
} }
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetMarginRightWidth() { already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetMarginRight() {
return GetMarginWidthFor(eSideRight); return GetMarginFor(eSideRight);
} }
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetLineHeight() { already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetLineHeight() {
@ -2174,8 +2174,7 @@ already_AddRefed<CSSValue> nsComputedDOMStyle::GetBorderWidthFor(
return val.forget(); return val.forget();
} }
already_AddRefed<CSSValue> nsComputedDOMStyle::GetMarginWidthFor( already_AddRefed<CSSValue> nsComputedDOMStyle::GetMarginFor(Side aSide) {
mozilla::Side aSide) {
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue; RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
auto& margin = StyleMargin()->mMargin.Get(aSide); auto& margin = StyleMargin()->mMargin.Get(aSide);

Просмотреть файл

@ -193,7 +193,7 @@ class nsComputedDOMStyle final : public nsDOMCSSDeclaration,
already_AddRefed<CSSValue> GetBorderWidthFor(mozilla::Side aSide); already_AddRefed<CSSValue> GetBorderWidthFor(mozilla::Side aSide);
already_AddRefed<CSSValue> GetMarginWidthFor(mozilla::Side aSide); already_AddRefed<CSSValue> GetMarginFor(mozilla::Side aSide);
already_AddRefed<CSSValue> GetTransformValue(const mozilla::StyleTransform&); already_AddRefed<CSSValue> GetTransformValue(const mozilla::StyleTransform&);
@ -230,7 +230,7 @@ class nsComputedDOMStyle final : public nsDOMCSSDeclaration,
already_AddRefed<CSSValue> DoGetBottom(); already_AddRefed<CSSValue> DoGetBottom();
/* Font properties */ /* Font properties */
already_AddRefed<CSSValue> DoGetOsxFontSmoothing(); already_AddRefed<CSSValue> DoGetMozOsxFontSmoothing();
/* Grid properties */ /* Grid properties */
already_AddRefed<CSSValue> DoGetGridTemplateColumns(); already_AddRefed<CSSValue> DoGetGridTemplateColumns();
@ -259,10 +259,10 @@ class nsComputedDOMStyle final : public nsDOMCSSDeclaration,
already_AddRefed<CSSValue> DoGetBorderRightWidth(); already_AddRefed<CSSValue> DoGetBorderRightWidth();
/* Margin Properties */ /* Margin Properties */
already_AddRefed<CSSValue> DoGetMarginTopWidth(); already_AddRefed<CSSValue> DoGetMarginTop();
already_AddRefed<CSSValue> DoGetMarginBottomWidth(); already_AddRefed<CSSValue> DoGetMarginBottom();
already_AddRefed<CSSValue> DoGetMarginLeftWidth(); already_AddRefed<CSSValue> DoGetMarginLeft();
already_AddRefed<CSSValue> DoGetMarginRightWidth(); already_AddRefed<CSSValue> DoGetMarginRight();
/* Text Properties */ /* Text Properties */
already_AddRefed<CSSValue> DoGetLineHeight(); already_AddRefed<CSSValue> DoGetLineHeight();