|
|
Created:
4 years, 5 months ago by Mr. Kevin Modified:
4 years, 5 months ago CC:
chromium-reviews, blink-reviews-style_chromium.org, blink-reviews-css, dglazkov+blink, apavlov+blink_chromium.org, darktears, blink-reviews, rwlbuis Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionFix getComputedStyle for non-box-layout elements
This fixes a crash introduced by https://codereview.chromium.org/1826423003/
Code that treated a layout object as a Box layout were not properly
guarded by isBox. This caused a crash when calling getComputedStyle on
positioned non-box elements, e.g. <ruby>.
R=mstensho@opera.com
BUG=610986
Committed: https://crrev.com/86d16a615d6e9abf6d991f430b496c26a4271d10
Cr-Commit-Position: refs/heads/master@{#404336}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Fix getComputedStyle for non-box-layout elements #Patch Set 3 : Fix getComputedStyle for non-box-layout elements #
Messages
Total messages: 33 (13 generated)
Description was changed from ========== Fix getComputedStyle for non-box-layout elements This fixes a crash introduced by https://codereview.chromium.org/1826423003/ Code that treated a layout object as a Box layout were not properly guarded by isBox. This caused a crash when calling getComputedStyle on positioned non-box elements, e.g. <ruby>. R=mstensho@opera.com BUG=610986 ========== to ========== Fix getComputedStyle for non-box-layout elements This fixes a crash introduced by https://codereview.chromium.org/1826423003/ Code that treated a layout object as a Box layout were not properly guarded by isBox. This caused a crash when calling getComputedStyle on positioned non-box elements, e.g. <ruby>. R=mstensho@opera.com BUG=610986 ==========
khart@codeaurora.org changed reviewers: + inferno@chromium.org
The CQ bit was checked by khart@codeaurora.org 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 unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
https://codereview.chromium.org/2102843002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp (right): https://codereview.chromium.org/2102843002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp:218: opposite *= -1.f; This looks like it might hit an ASSERT if the value is something like calc(1px + 2%)?
https://codereview.chromium.org/2102843002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp (right): https://codereview.chromium.org/2102843002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp:218: opposite *= -1.f; On 2016/06/28 00:20:29, Timothy Loh wrote: > This looks like it might hit an ASSERT if the value is something like calc(1px + > 2%)? Good catch. I'll see what I can come up with.
On 2016/06/28 00:55:52, Mr. Kevin wrote: > https://codereview.chromium.org/2102843002/diff/1/third_party/WebKit/Source/c... > File third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp > (right): > > https://codereview.chromium.org/2102843002/diff/1/third_party/WebKit/Source/c... > third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp:218: > opposite *= -1.f; > On 2016/06/28 00:20:29, Timothy Loh wrote: > > This looks like it might hit an ASSERT if the value is something like calc(1px > + > > 2%)? > > Good catch. I'll see what I can come up with. Fixed the ASSERT, but relative-positioned inline objects are not returning used values as they should per the spec. I've tried every variant of container and width I could think of, but I can't get the width of the container of a non-box layout object. (everything returns 0). So I can't calculate the used value for a % or calc value for left or right. layoutObject->containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadding) seems to work for the height. If you could point me in the right direction I'd love to get everything returning used values
The CQ bit was checked by khart@codeaurora.org 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 unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
khart@codeaurora.org changed reviewers: + timloh@chromium.org
On 2016/06/29 17:54:59, commit-bot: I haz the power wrote: > Dry run: Try jobs failed on following builders: > win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, > http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...) It doesn't look like these failures are related to my patch. Any suggestions?
On 2016/06/30 17:01:45, Mr. Kevin wrote: > On 2016/06/29 17:54:59, commit-bot: I haz the power wrote: > > Dry run: Try jobs failed on following builders: > > win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, > > > http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...) > > It doesn't look like these failures are related to my patch. Any suggestions? unexpected_failures: fast/css/getComputedStyle/getComputedStyle-resolved-values.html seems related
timloh@chromium.org changed reviewers: + eae@chromium.org
+eae, Kevin had some questions about getting the width of non-box containers, maybe you could help?
On 2016/06/29 02:11:06, Mr. Kevin wrote: > On 2016/06/28 00:55:52, Mr. Kevin wrote: > > > https://codereview.chromium.org/2102843002/diff/1/third_party/WebKit/Source/c... > > File third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp > > (right): > > > > > https://codereview.chromium.org/2102843002/diff/1/third_party/WebKit/Source/c... > > third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp:218: > > opposite *= -1.f; > > On 2016/06/28 00:20:29, Timothy Loh wrote: > > > This looks like it might hit an ASSERT if the value is something like > calc(1px > > + > > > 2%)? > > > > Good catch. I'll see what I can come up with. > > Fixed the ASSERT, but relative-positioned inline objects are not returning used > values as they should per the spec. I've tried every variant of container and > width I could think of, but I can't get the width of the container of a non-box > layout object. (everything returns 0). So I can't calculate the used value for > a % or calc value for left or right. > layoutObject->containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadding) > seems to work for the height. If you could point me in the right direction I'd > love to get everything returning used values InlineBox::width should do the trick, does it not work here?
On 2016/06/30 23:54:53, eae wrote: > On 2016/06/29 02:11:06, Mr. Kevin wrote: > > On 2016/06/28 00:55:52, Mr. Kevin wrote: > > > > > > https://codereview.chromium.org/2102843002/diff/1/third_party/WebKit/Source/c... > > > File third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp > > > (right): > > > > > > > > > https://codereview.chromium.org/2102843002/diff/1/third_party/WebKit/Source/c... > > > third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp:218: > > > opposite *= -1.f; > > > On 2016/06/28 00:20:29, Timothy Loh wrote: > > > > This looks like it might hit an ASSERT if the value is something like > > calc(1px > > > + > > > > 2%)? > > > > > > Good catch. I'll see what I can come up with. > > > > Fixed the ASSERT, but relative-positioned inline objects are not returning > used > > values as they should per the spec. I've tried every variant of container and > > width I could think of, but I can't get the width of the container of a > non-box > > layout object. (everything returns 0). So I can't calculate the used value > for > > a % or calc value for left or right. > > > layoutObject->containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadding) > > seems to work for the height. If you could point me in the right direction > I'd > > love to get everything returning used values > > InlineBox::width should do the trick, does it not work here? Maybe? Given const LayoutInline* layoutInline=toLayoutInline(layoutObject), then layoutInline->linesBoundingBox() has width() and height() equal to 0.0, and layoutInline->lineBoxes()->firstLineBox() is nullptr. Is there a different way to get an InlineBox that I'm not seeing? BTW, The render tree for the LayoutInline of interest looks like this: layer at (23,23) size 61x19 LayoutInline (relative positioned) {EM} at (0,0) size 61x19 [bgcolor=#008000] LayoutText {#text} at (35,0) size 61x19 text run at (35,0) width 61: "should be"
The CQ bit was checked by khart@codeaurora.org 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 unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
ok, LGTM
On 2016/07/05 23:25:32, eae wrote: > ok, LGTM Is anything else needed for this to go forward?
On 2016/07/07 00:33:58, Mr. Kevin wrote: > On 2016/07/05 23:25:32, eae wrote: > > ok, LGTM > > Is anything else needed for this to go forward? I don't think so
The CQ bit was checked by khart@codeaurora.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Fix getComputedStyle for non-box-layout elements This fixes a crash introduced by https://codereview.chromium.org/1826423003/ Code that treated a layout object as a Box layout were not properly guarded by isBox. This caused a crash when calling getComputedStyle on positioned non-box elements, e.g. <ruby>. R=mstensho@opera.com BUG=610986 ========== to ========== Fix getComputedStyle for non-box-layout elements This fixes a crash introduced by https://codereview.chromium.org/1826423003/ Code that treated a layout object as a Box layout were not properly guarded by isBox. This caused a crash when calling getComputedStyle on positioned non-box elements, e.g. <ruby>. R=mstensho@opera.com BUG=610986 ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== Fix getComputedStyle for non-box-layout elements This fixes a crash introduced by https://codereview.chromium.org/1826423003/ Code that treated a layout object as a Box layout were not properly guarded by isBox. This caused a crash when calling getComputedStyle on positioned non-box elements, e.g. <ruby>. R=mstensho@opera.com BUG=610986 ========== to ========== Fix getComputedStyle for non-box-layout elements This fixes a crash introduced by https://codereview.chromium.org/1826423003/ Code that treated a layout object as a Box layout were not properly guarded by isBox. This caused a crash when calling getComputedStyle on positioned non-box elements, e.g. <ruby>. R=mstensho@opera.com BUG=610986 Committed: https://crrev.com/86d16a615d6e9abf6d991f430b496c26a4271d10 Cr-Commit-Position: refs/heads/master@{#404336} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/86d16a615d6e9abf6d991f430b496c26a4271d10 Cr-Commit-Position: refs/heads/master@{#404336} |