|
|
DescriptionSupport calc(...) in ConsumeAngleOrPercent / for conic-gradient
Because of the explicit check for <percentage-token>, calc(...) would
not be properly handled for percentages. CSSGradientValue also wasn't
checking for calc() values when evaluating stops.
Rewrite ConsumeAngleOrPercent in a vein similar to
ConsumeLengthOrPercent.
Make CSSPrimitiveValue::IsAngle() consider resolved type, and update
CSSRotation TypedOM implementation to counter this.
BUG=709730
Review-Url: https://codereview.chromium.org/2813583002
Cr-Commit-Position: refs/heads/master@{#463585}
Committed: https://chromium.googlesource.com/chromium/src/+/cc50825cf637990a4edfa90c9610ad072885c74d
Patch Set 1 #Patch Set 2 : Fix up IsAngle #
Total comments: 6
Patch Set 3 : TypedOM CSSRotation fixup #
Messages
Total messages: 29 (19 generated)
The CQ bit was checked by fs@opera.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by fs@opera.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Support calc(<percentage>) in ConsumeAngleOrPercent / for conic-gradient Because of the explicit check for <percentage-token>, calc(...) would not be properly handled for percentages. Rewrite ConsumeAngleOrPercent in a vain similar to ConsumeLengthOrPercent. BUG=709730 ========== to ========== Support calc(<percentage>) in ConsumeAngleOrPercent / for conic-gradient Because of the explicit check for <percentage-token>, calc(...) would not be properly handled for percentages. Rewrite ConsumeAngleOrPercent in a vein similar to ConsumeLengthOrPercent. BUG=709730 ==========
Description was changed from ========== Support calc(<percentage>) in ConsumeAngleOrPercent / for conic-gradient Because of the explicit check for <percentage-token>, calc(...) would not be properly handled for percentages. Rewrite ConsumeAngleOrPercent in a vein similar to ConsumeLengthOrPercent. BUG=709730 ========== to ========== Support calc(<percentage>) in ConsumeAngleOrPercent / for conic-gradient Because of the explicit check for <percentage-token>, calc(...) would not be properly handled for percentages. Rewrite ConsumeAngleOrPercent in a vein similar to ConsumeLengthOrPercent. Make CSSPrimitiveValue::IsAngle() consider resolved type. BUG=709730 ==========
fs@opera.com changed reviewers: + alancutter@chromium.org, fmalita@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
https://codereview.chromium.org/2813583002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp (right): https://codereview.chromium.org/2813583002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp:948: CalcParser calc_parser(range, value_range); Both ConsumePercent and ConsumeAngle perform type checks and handle calc values internally. So I *think* it's safe to just cascade-invoke, like this https://codereview.chromium.org/2814453002/diff/1/third_party/WebKit/Source/c...
https://codereview.chromium.org/2813583002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp (right): https://codereview.chromium.org/2813583002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp:948: CalcParser calc_parser(range, value_range); On 2017/04/10 at 14:07:03, f(malita) wrote: > Both ConsumePercent and ConsumeAngle perform type checks and handle calc values internally. So I *think* it's safe to just cascade-invoke, like this https://codereview.chromium.org/2814453002/diff/1/third_party/WebKit/Source/c... Yes, but then we can end up parsing calc() twice (depending on order and actual type.) https://codereview.chromium.org/2813583002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp:951: // TODO(fs): Add and support kCalcPercentAngle? +alancutter for thoughts on this
https://codereview.chromium.org/2813583002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/css/CSSPrimitiveValue.h (right): https://codereview.chromium.org/2813583002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/css/CSSPrimitiveValue.h:167: bool IsAngle() const { return IsAngle(TypeWithCalcResolved()); } All IsFoo() helpers seem to ignore calc values at this point. For consistency, I suggest we leave IsAngle() as-is for now and update the test in CSSGradientValue::AddStops() instead: stop.offset_->IsAngle() => CSSPrimitiveValue::IsAngle(stop.offset_->TypeWithCalcResolved()) https://codereview.chromium.org/2813583002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp (right): https://codereview.chromium.org/2813583002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp:948: CalcParser calc_parser(range, value_range); On 2017/04/10 14:09:08, fs wrote: > On 2017/04/10 at 14:07:03, f(malita) wrote: > > Both ConsumePercent and ConsumeAngle perform type checks and handle calc > values internally. So I *think* it's safe to just cascade-invoke, like this > https://codereview.chromium.org/2814453002/diff/1/third_party/WebKit/Source/c... > > Yes, but then we can end up parsing calc() twice (depending on order and actual > type.) Ack, this approach is more efficient.
https://codereview.chromium.org/2813583002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/css/CSSPrimitiveValue.h (right): https://codereview.chromium.org/2813583002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/css/CSSPrimitiveValue.h:167: bool IsAngle() const { return IsAngle(TypeWithCalcResolved()); } On 2017/04/10 at 14:16:26, f(malita) wrote: > All IsFoo() helpers seem to ignore calc values at this point. For consistency, I suggest we leave IsAngle() as-is for now and update the test in CSSGradientValue::AddStops() instead: > > stop.offset_->IsAngle() => CSSPrimitiveValue::IsAngle(stop.offset_->TypeWithCalcResolved()) Hmm, IsLength, IsNumber and IsPercentage (the non-static versions) all use TypeWithCalcResolved()?
On 2017/04/10 14:22:58, fs wrote: > https://codereview.chromium.org/2813583002/diff/20001/third_party/WebKit/Sour... > File third_party/WebKit/Source/core/css/CSSPrimitiveValue.h (right): > > https://codereview.chromium.org/2813583002/diff/20001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/css/CSSPrimitiveValue.h:167: bool IsAngle() const > { return IsAngle(TypeWithCalcResolved()); } > On 2017/04/10 at 14:16:26, f(malita) wrote: > > All IsFoo() helpers seem to ignore calc values at this point. For > consistency, I suggest we leave IsAngle() as-is for now and update the test in > CSSGradientValue::AddStops() instead: > > > > stop.offset_->IsAngle() => > CSSPrimitiveValue::IsAngle(stop.offset_->TypeWithCalcResolved()) > > Hmm, IsLength, IsNumber and IsPercentage (the non-static versions) all use > TypeWithCalcResolved()? Heh, let me rephrase: "all helpers in my narrow editor view" :) LGTM
The CQ bit was checked by fs@opera.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
fs@opera.com changed reviewers: + meade@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm
lgtm
Description was changed from ========== Support calc(<percentage>) in ConsumeAngleOrPercent / for conic-gradient Because of the explicit check for <percentage-token>, calc(...) would not be properly handled for percentages. Rewrite ConsumeAngleOrPercent in a vein similar to ConsumeLengthOrPercent. Make CSSPrimitiveValue::IsAngle() consider resolved type. BUG=709730 ========== to ========== Support calc(...) in ConsumeAngleOrPercent / for conic-gradient Because of the explicit check for <percentage-token>, calc(...) would not be properly handled for percentages. CSSGradientValue also wasn't checking for calc() values when evaluating stops. Rewrite ConsumeAngleOrPercent in a vein similar to ConsumeLengthOrPercent. Make CSSPrimitiveValue::IsAngle() consider resolved type, and update CSSRotation TypedOM implementation to counter this. BUG=709730 ==========
The CQ bit was checked by fs@opera.com
The patchset sent to the CQ was uploaded after l-g-t-m from fmalita@chromium.org Link to the patchset: https://codereview.chromium.org/2813583002/#ps40001 (title: "TypedOM CSSRotation fixup")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 40001, "attempt_start_ts": 1491902089044900, "parent_rev": "61312491232439beddbbd347cf86bf95f99aedb2", "commit_rev": "cc50825cf637990a4edfa90c9610ad072885c74d"}
Message was sent while issue was closed.
Description was changed from ========== Support calc(...) in ConsumeAngleOrPercent / for conic-gradient Because of the explicit check for <percentage-token>, calc(...) would not be properly handled for percentages. CSSGradientValue also wasn't checking for calc() values when evaluating stops. Rewrite ConsumeAngleOrPercent in a vein similar to ConsumeLengthOrPercent. Make CSSPrimitiveValue::IsAngle() consider resolved type, and update CSSRotation TypedOM implementation to counter this. BUG=709730 ========== to ========== Support calc(...) in ConsumeAngleOrPercent / for conic-gradient Because of the explicit check for <percentage-token>, calc(...) would not be properly handled for percentages. CSSGradientValue also wasn't checking for calc() values when evaluating stops. Rewrite ConsumeAngleOrPercent in a vein similar to ConsumeLengthOrPercent. Make CSSPrimitiveValue::IsAngle() consider resolved type, and update CSSRotation TypedOM implementation to counter this. BUG=709730 Review-Url: https://codereview.chromium.org/2813583002 Cr-Commit-Position: refs/heads/master@{#463585} Committed: https://chromium.googlesource.com/chromium/src/+/cc50825cf637990a4edfa90c9610... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/cc50825cf637990a4edfa90c9610... |