RESOLVED FIXED Bug 94984
Make RenderBox::computePositionedLogicalHeight const
https://bugs.webkit.org/show_bug.cgi?id=94984
Summary Make RenderBox::computePositionedLogicalHeight const
Tony Chang
Reported 2012-08-24 17:04:48 PDT
Make RenderBox::computePositionedLogicalHeight const
Attachments
Patch (14.68 KB, patch)
2012-08-24 17:08 PDT, Tony Chang
no flags
Archive of layout-test-results from gce-cr-linux-08 (402.16 KB, application/zip)
2012-08-24 18:17 PDT, WebKit Review Bot
no flags
Patch (14.67 KB, patch)
2012-08-27 10:05 PDT, Tony Chang
no flags
Patch (14.87 KB, patch)
2012-08-27 11:42 PDT, Tony Chang
no flags
Patch (19.85 KB, patch)
2012-08-27 14:05 PDT, Tony Chang
no flags
Patch for landing (19.84 KB, patch)
2012-08-27 14:32 PDT, Tony Chang
no flags
Tony Chang
Comment 1 2012-08-24 17:08:30 PDT
Tony Chang
Comment 2 2012-08-24 17:09:25 PDT
A small patch just to get an idea.
WebKit Review Bot
Comment 3 2012-08-24 18:17:27 PDT
Comment on attachment 160526 [details] Patch Attachment 160526 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13603299 New failing tests: inspector/elements/highlight-node-scaled.html
WebKit Review Bot
Comment 4 2012-08-24 18:17:30 PDT
Created attachment 160536 [details] Archive of layout-test-results from gce-cr-linux-08 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: gce-cr-linux-08 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Ojan Vafai
Comment 5 2012-08-24 18:30:29 PDT
Comment on attachment 160526 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=160526&action=review R- until we agree about naming and general design of the struct. > Source/WebCore/rendering/RenderBox.cpp:1973 > + LogicalHeightComputedValues computedValues; You had mentioned maybe setting computedValues.m_logicalHeight = logicalHeight() and then only calling logicalHeight() in the top-level computeLogicalHeight function. WDYT of that now? I'm on the fence about it. Of course we can always do that later if we find we need it. > Source/WebCore/rendering/RenderBox.h:310 > + struct LogicalHeightComputedValues { > + LogicalHeightComputedValues() I imagine we'd want the same exact struct for computing width except s/Height/Width and s/Top/Left. Would be nice if we could just make these names a bit more generic. m_extent and m_positionedLocation? m_outOfFlowPosition? m_outOfFlowStart? m_outOfFlowLocation? One of those has to be good enough. :) > Source/WebCore/rendering/RenderBox.h:320 > + void applyToRenderBox(RenderBox*); I don't think we really gain anything by putting this method on the struct itself. RenderBox::computeLogicalHeight can do the setting directly. In the end, it will just be computeLogicalWidth and computeLogicalHeight that do the setting anyways, right?
Tony Chang
Comment 6 2012-08-27 10:05:54 PDT
Tony Chang
Comment 7 2012-08-27 10:06:14 PDT
Comment on attachment 160526 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=160526&action=review >> Source/WebCore/rendering/RenderBox.cpp:1973 >> + LogicalHeightComputedValues computedValues; > > You had mentioned maybe setting computedValues.m_logicalHeight = logicalHeight() and then only calling logicalHeight() in the top-level computeLogicalHeight function. WDYT of that now? I'm on the fence about it. > > Of course we can always do that later if we find we need it. I think we should still do it, but it should be in a separate patch. It's a logically different refactor. >> Source/WebCore/rendering/RenderBox.h:310 >> + LogicalHeightComputedValues() > > I imagine we'd want the same exact struct for computing width except s/Height/Width and s/Top/Left. Would be nice if we could just make these names a bit more generic. m_extent and m_positionedLocation? m_outOfFlowPosition? m_outOfFlowStart? m_outOfFlowLocation? > > One of those has to be good enough. :) I think for readability, it's less confusing to have m_logicalHeight and m_logicalTop. My current thinking is that we'll end up with 3 structs (one for width, one for height, one for margins). I'm not sure until I start looking into computeInlineDirectionMargins, which is why I dislike generalizing names before they need to be. The margin struct may also gain methods like setMargin*ForChild. I've renamed the struct to LogicalExtentComputedValues for now, but it'll probably end up changing. >> Source/WebCore/rendering/RenderBox.h:320 >> + void applyToRenderBox(RenderBox*); > > I don't think we really gain anything by putting this method on the struct itself. RenderBox::computeLogicalHeight can do the setting directly. In the end, it will just be computeLogicalWidth and computeLogicalHeight that do the setting anyways, right? If computeLogicalWidth and computeLogicalHeight both do the setting, it'll be duplicate code, right? Also, it makes the code diffs smaller since I'll be moving the applyToRenderBox code around during this refactoring process.
Ojan Vafai
Comment 8 2012-08-27 10:11:18 PDT
Comment on attachment 160739 [details] Patch You're right. We can easily change all these things once the refactor is done and we have a better picture of how things will look.
Tony Chang
Comment 9 2012-08-27 11:42:18 PDT
Tony Chang
Comment 10 2012-08-27 11:44:45 PDT
inspector/elements/highlight-node-scaled.html failing was real. We need to set the start/end margins rather than overwriting them with 0.
Dave Hyatt
Comment 11 2012-08-27 11:52:16 PDT
Comment on attachment 160762 [details] Patch We talked about this in IRC. I think we want a separate margin struct, and then I'd like a single common struct we can use for either width or height that contains a position, an extent, and the margins.
Ojan Vafai
Comment 12 2012-08-27 11:53:24 PDT
Comment on attachment 160762 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=160762&action=review We don't need to do this for marginBefore/marginAfter? > Source/WebCore/rendering/RenderBox.cpp:1976 > + computedValues.m_marginStart = marginStart(); > + computedValues.m_marginEnd = marginEnd(); We don't need to do this for marginBefore/marginAfter?
Tony Chang
Comment 13 2012-08-27 14:05:22 PDT
Ojan Vafai
Comment 14 2012-08-27 14:16:28 PDT
Comment on attachment 160800 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=160800&action=review > Source/WebCore/rendering/RenderBox.h:310 > + struct MarginsComputedValues { > + MarginsComputedValues() So many plurals. How about MarginComputedValues?
Tony Chang
Comment 15 2012-08-27 14:32:52 PDT
Created attachment 160807 [details] Patch for landing
Tony Chang
Comment 16 2012-08-27 14:33:17 PDT
(In reply to comment #14) > (From update of attachment 160800 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=160800&action=review > > > Source/WebCore/rendering/RenderBox.h:310 > > + struct MarginsComputedValues { > > + MarginsComputedValues() > > So many plurals. How about MarginComputedValues? Went with ComputedMarginValues.
WebKit Review Bot
Comment 17 2012-08-27 14:57:04 PDT
Comment on attachment 160807 [details] Patch for landing Clearing flags on attachment: 160807 Committed r126802: <http://trac.webkit.org/changeset/126802>
WebKit Review Bot
Comment 18 2012-08-27 14:57:08 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.