Changeset 105772 in webkit


Ignore:
Timestamp:
Jan 24, 2012 12:24:11 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

REGRESSION (r73385): Marquee with behavior="alternate" is not working
https://bugs.webkit.org/show_bug.cgi?id=64230

Patch by Parag Radke <nrqv63@motorola.com> on 2012-01-24
Reviewed by Simon Fraser.

Source/WebCore:

This patch gives correct content width for marquee, which computes
correct start position to scroll marquee.

Test: fast/html/marquee-alternate.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::computePreferredLogicalWidths):
We need(style()->marqueeBehavior() != MALTERNATE) check as we always need the marquee's
actual content width to compute the initial/end position in case of 'MALTERNATE'.
So we need to calculate the logical width in Alternate case even if fixed width is specified
as content has to animate between renderBox().right().x() - contentWidth() and
renderBox().left().x() + contentWidth().

  • rendering/RenderMarquee.cpp:

(WebCore::RenderMarquee::computePosition):
Using PreferredLogicalWidth in place of LayoutOverflow for calculating correct content width.

LayoutTests:

Added a test case to check marquee alternate behavior with fixed width.

  • fast/html/marquee-alternate-expected.txt: Added.
  • fast/html/marquee-alternate.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r105769 r105772  
     12012-01-24  Parag Radke  <nrqv63@motorola.com>
     2
     3        REGRESSION (r73385): Marquee with behavior="alternate" is not working
     4        https://bugs.webkit.org/show_bug.cgi?id=64230
     5
     6        Reviewed by Simon Fraser.
     7
     8        Added a test case to check marquee alternate behavior with fixed width.
     9
     10        * fast/html/marquee-alternate-expected.txt: Added.
     11        * fast/html/marquee-alternate.html: Added.
     12
    1132012-01-24  Abhishek Arya  <inferno@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r105771 r105772  
     12012-01-24  Parag Radke  <nrqv63@motorola.com>
     2
     3        REGRESSION (r73385): Marquee with behavior="alternate" is not working
     4        https://bugs.webkit.org/show_bug.cgi?id=64230
     5
     6        Reviewed by Simon Fraser.
     7
     8        This patch gives correct content width for marquee, which computes
     9        correct start position to scroll marquee.
     10
     11        Test: fast/html/marquee-alternate.html
     12
     13        * rendering/RenderBlock.cpp:
     14        (WebCore::RenderBlock::computePreferredLogicalWidths):
     15        We need(style()->marqueeBehavior() != MALTERNATE) check as we always need the marquee's
     16        actual content width to compute the initial/end position in case of 'MALTERNATE'.
     17        So we need to calculate the logical width in Alternate case even if fixed width is specified
     18        as content has to animate between renderBox().right().x() - contentWidth() and
     19        renderBox().left().x() + contentWidth().
     20       
     21        * rendering/RenderMarquee.cpp:
     22        (WebCore::RenderMarquee::computePosition):
     23        Using PreferredLogicalWidth in place of LayoutOverflow for calculating correct content width.
     24
    1252012-01-24  Andreas Kling  <awesomekling@apple.com>
    226
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r105769 r105772  
    49514951
    49524952    RenderStyle* styleToUse = style();
    4953     if (!isTableCell() && styleToUse->logicalWidth().isFixed() && styleToUse->logicalWidth().value() > 0)
     4953    if (!isTableCell() && styleToUse->logicalWidth().isFixed() && styleToUse->logicalWidth().value() > 0 && style()->marqueeBehavior() != MALTERNATE)
    49544954        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(styleToUse->logicalWidth().value());
    49554955    else {
  • trunk/Source/WebCore/rendering/RenderMarquee.cpp

    r95911 r105772  
    117117        bool ltr = s->isLeftToRightDirection();
    118118        int clientWidth = box->clientWidth();
    119         int contentWidth = ltr ? box->maxXLayoutOverflow() : box->minXLayoutOverflow();
     119        int contentWidth = ltr ? box->maxPreferredLogicalWidth() : box->minPreferredLogicalWidth();
    120120        if (ltr)
    121121            contentWidth += (box->paddingRight() - box->borderLeft());
Note: See TracChangeset for help on using the changeset viewer.