Commit dc3165be authored by Manuel Rego Casasnovas's avatar Manuel Rego Casasnovas Committed by Commit Bot

Check MayHaveMargin() in HasMarginBefore|AfterQuirk()

This patch avoids calling MarginBefore|After().Quirk()
if the element has no margins.

This is try to improve performance in
perf_test/layout/abspos.html, however we're not sure
if this will have a real impact as pinpoint tryjobs
are not being very clear about the results.

BUG=1098231

Change-Id: I48eba7d0f42cc2822556661164e4f42a831b2c37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2498586Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Manuel Rego <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#824365}
parent 78f2dc21
......@@ -1540,8 +1540,12 @@ class ComputedStyle : public ComputedStyleBase,
MutableMarginLeftInternal() = v;
}
}
bool HasMarginBeforeQuirk() const { return MarginBefore().Quirk(); }
bool HasMarginAfterQuirk() const { return MarginAfter().Quirk(); }
bool HasMarginBeforeQuirk() const {
return MayHaveMargin() && MarginBefore().Quirk();
}
bool HasMarginAfterQuirk() const {
return MayHaveMargin() && MarginAfter().Quirk();
}
const Length& MarginBefore() const { return MarginBeforeUsing(*this); }
const Length& MarginAfter() const { return MarginAfterUsing(*this); }
const Length& MarginStart() const { return MarginStartUsing(*this); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment