Bug 64290 - The layout of RenderBox should be calculated using fixedLayoutSize instead of viewport when the fixedLayoutSize is set.
Summary: The layout of RenderBox should be calculated using fixedLayoutSize instead of...
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 70559
  Show dependency treegraph
 
Reported: 2011-07-11 09:42 PDT by Young Han Lee
Modified: 2011-12-01 13:41 PST (History)
8 users (show)

See Also:


Attachments
Patch (3.12 KB, patch)
2011-07-11 09:51 PDT, Young Han Lee
simon.fraser: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Young Han Lee 2011-07-11 09:42:23 PDT
The layout of an RenderBox should be calculated using fixedLayoutSize instead of viewport when the fixedLayoutSize is set.
Comment 1 Young Han Lee 2011-07-11 09:51:56 PDT
Created attachment 100314 [details]
Patch
Comment 2 Eric Seidel (no email) 2011-08-17 11:35:04 PDT
This would be a simple patch for simon or hyatt to review.
Comment 3 Eric Seidel (no email) 2011-08-17 11:36:09 PDT
Comment on attachment 100314 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=100314&action=review

> Source/WebCore/ChangeLog:18
> +        No tests because this change affects only when fixedLayoutSize is set. Since our dumpRenderTree doesn't set it, we can't test this.

DumpRenderTree has a layoutConstroller.overridePreference() which can be used to toggle a setting for a single test.  Seems if your DRT supports that (which ideally it should), it would be easy to write a test for this.
Comment 4 Simon Fraser (smfr) 2011-08-17 11:36:52 PDT
Comment on attachment 100314 [details]
Patch

r- for lack of test.
Comment 5 Young Han Lee 2011-08-21 08:30:05 PDT
(In reply to comment #3)
> (From update of attachment 100314 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=100314&action=review
> 
> > Source/WebCore/ChangeLog:18
> > +        No tests because this change affects only when fixedLayoutSize is set. Since our dumpRenderTree doesn't set it, we can't test this.
> 
> DumpRenderTree has a layoutConstroller.overridePreference() which can be used to toggle a setting for a single test.  Seems if your DRT supports that (which ideally it should), it would be easy to write a test for this.

No. layoutController.overridePreference() is not helpful because it toggles only settings of WebSettings.

To turn on the fixedLayoutSize feature, to test this patch, FrameView::setUseFixedLayout(true) have to be called.

I think there is no easy way to turn on this feature for a single test.
Comment 6 Antonio Gomes 2011-08-21 08:55:53 PDT
> No. layoutController.overridePreference() is not helpful because it toggles only settings of WebSettings.
> 
> To turn on the fixedLayoutSize feature, to test this patch, FrameView::setUseFixedLayout(true) have to be called.
> 
> I think there is no easy way to turn on this feature for a single test.

It raises an interesting point. I do not think it should be necessary to set the fixedLayoutSize and set useFixedLayoutSize to TRUE.

Maybe once it is set to something different than 0x0, it should be used.

There could be a logicalLayoutSize in ScrollView that abstracts this for the call sites.

IntSize ScrollView::logicalLayoutSize() const
{
  if (m_fixedLayoutSize.isValid()) // != 0x0, and has non zero values
    return m_fixedLayoutSize;

  return viewportSize;
}
Comment 7 Young Han Lee 2011-08-23 09:34:26 PDT
(In reply to comment #6)
> > No. layoutController.overridePreference() is not helpful because it toggles only settings of WebSettings.
> > 
> > To turn on the fixedLayoutSize feature, to test this patch, FrameView::setUseFixedLayout(true) have to be called.
> > 
> > I think there is no easy way to turn on this feature for a single test.
> 
> It raises an interesting point. I do not think it should be necessary to set the fixedLayoutSize and set useFixedLayoutSize to TRUE.
> 
> Maybe once it is set to something different than 0x0, it should be used.
> 
> There could be a logicalLayoutSize in ScrollView that abstracts this for the call sites.
> 
> IntSize ScrollView::logicalLayoutSize() const
> {
>   if (m_fixedLayoutSize.isValid()) // != 0x0, and has non zero values
>     return m_fixedLayoutSize;
> 
>   return viewportSize;
> }

Here is the implementation of the layoutWidth().

int ScrollView::layoutWidth() const
{
    return m_fixedLayoutSize.isEmpty() || !m_useFixedLayout ? visibleWidth() : m_fixedLayoutSize.width();
}

As you can see, m_fixedLayoutSize is not returned, even if it isn't empty, when m_useFixedLayout is not TRUE.

Unfortunately there is also no function like you said in ScrollView. For now, we have to set both fixedLayoutSize and useFixedLayoutSize.
Comment 8 Kenneth Rohde Christiansen 2011-08-23 10:29:38 PDT
> It raises an interesting point. I do not think it should be necessary to set the fixedLayoutSize and set useFixedLayoutSize to TRUE.

Alex Faeroy has a patch up for review that removes the need for useFixedLayoutSize.
Comment 9 Young Han Lee 2011-08-24 01:56:33 PDT
(In reply to comment #8)
> > It raises an interesting point. I do not think it should be necessary to set the fixedLayoutSize and set useFixedLayoutSize to TRUE.
> 
> Alex Faeroy has a patch up for review that removes the need for useFixedLayoutSize.

Good. Can you point me to the patch?

If it is true, I should wait for the patch to land.
Comment 10 Antonio Gomes 2011-09-14 14:05:36 PDT
(In reply to comment #8)
> > It raises an interesting point. I do not think it should be necessary to set the fixedLayoutSize and set useFixedLayoutSize to TRUE.
> 
> Alex Faeroy has a patch up for review that removes the need for useFixedLayoutSize.

Kenneth, Alex, will this patch be submitted? Otherwise I can submit it myself?
Comment 11 Kenneth Rohde Christiansen 2011-09-14 14:56:05 PDT
(In reply to comment #10)
> (In reply to comment #8)
> > > It raises an interesting point. I do not think it should be necessary to set the fixedLayoutSize and set useFixedLayoutSize to TRUE.
> > 
> > Alex Faeroy has a patch up for review that removes the need for useFixedLayoutSize.
> 
> Kenneth, Alex, will this patch be submitted? Otherwise I can submit it myself?

I can talk to Alex tomorrow; he is ahf on the #qtwebkit channel. I'm afraid that he is winded up in something pretty critical though. Did you have the bug id for the patch he was working on?
Comment 12 Fady Samuel 2011-12-01 13:41:50 PST
Comment on attachment 100314 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=100314&action=review

>>> Source/WebCore/ChangeLog:18
>>> +        No tests because this change affects only when fixedLayoutSize is set. Since our dumpRenderTree doesn't set it, we can't test this.
>> 
>> DumpRenderTree has a layoutConstroller.overridePreference() which can be used to toggle a setting for a single test.  Seems if your DRT supports that (which ideally it should), it would be easy to write a test for this.
> 
> No. layoutController.overridePreference() is not helpful because it toggles only settings of WebSettings.
> 
> To turn on the fixedLayoutSize feature, to test this patch, FrameView::setUseFixedLayout(true) have to be called.
> 
> I think there is no easy way to turn on this feature for a single test.

It just so happens that I have two layout tests that address precisely this problem and I added fixedLayout to the chromium DRT (I'm not sure if it's in other DRTs at the moment). I will move this to window.internals, I guess.