Changeset 53420 in webkit


Ignore:
Timestamp:
Jan 18, 2010 12:55:25 PM (14 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/6892207> REGRESSION (Safari 4): Menus at sciencedirect.com push the main article context down the page
<rdar://problem/7546035> Second right floated image misplacment
https://bugs.webkit.org/show_bug.cgi?id=33245

Reviewed by Darin Adler.

WebCore:

Test: fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2.html

When the last line of a block contains a line break and there are floats
after the line break, it is incorrect to put those floats in the last line's
floats vector (along with floats from before the break). Instead, create
an additional line box (a TrailingFloatsRootInlineBox) and put those floats
in its floats vector.

  • WebCore.vcproj/WebCore.vcproj: Added TrailingFloatsRootInlineBox.h
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::markLinesDirtyInVerticalRange): Added an optional
parameter, which is the highest line to dirty.

  • rendering/RenderBlock.h:
  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlock::layoutInlineChildren): Create a TrailingFloatsRootInlineBox
for the floats occurring after the line break on the last line.
(WebCore::RenderBlock::determineStartPosition): Prevent dirtying of lines
above the first dirty line.

  • rendering/TrailingFloatsRootInlineBox.h: Added.

(WebCore::TrailingFloatsRootInlineBox::TrailingFloatsRootInlineBox): Call
setHasVirtualHeight().
(WebCore::TrailingFloatsRootInlineBox::virtualHeight): Return 0.

LayoutTests:

  • fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2.html: Added.
  • fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.checksum: Added.
  • fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.png: Added.
  • fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt: Added.
Location:
trunk
Files:
5 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r53419 r53420  
     12010-01-18  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        <rdar://problem/6892207> REGRESSION (Safari 4): Menus at sciencedirect.com push the main article context down the page
     6        <rdar://problem/7546035> Second right floated image misplacment
     7        https://bugs.webkit.org/show_bug.cgi?id=33245
     8
     9        * fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2.html: Added.
     10        * fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.checksum: Added.
     11        * fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.png: Added.
     12        * fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2-expected.txt: Added.
     13
    1142010-01-18  Alexey Proskuryakov  <ap@apple.com>
    215
  • trunk/WebCore/ChangeLog

    r53418 r53420  
     12010-01-18  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        <rdar://problem/6892207> REGRESSION (Safari 4): Menus at sciencedirect.com push the main article context down the page
     6        <rdar://problem/7546035> Second right floated image misplacment
     7        https://bugs.webkit.org/show_bug.cgi?id=33245
     8
     9        Test: fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2.html
     10
     11        When the last line of a block contains a line break and there are floats
     12        after the line break, it is incorrect to put those floats in the last line’s
     13        floats vector (along with floats from before the break). Instead, create
     14        an additional line box (a TrailingFloatsRootInlineBox) and put those floats
     15        in its floats vector.
     16
     17        * WebCore.vcproj/WebCore.vcproj: Added TrailingFloatsRootInlineBox.h
     18        * WebCore.xcodeproj/project.pbxproj: Ditto.
     19        * rendering/RenderBlock.cpp:
     20        (WebCore::RenderBlock::markLinesDirtyInVerticalRange): Added an optional
     21        parameter, which is the highest line to dirty.
     22        * rendering/RenderBlock.h:
     23        * rendering/RenderBlockLineLayout.cpp:
     24        (WebCore::RenderBlock::layoutInlineChildren): Create a TrailingFloatsRootInlineBox
     25        for the floats occurring after the line break on the last line.
     26        (WebCore::RenderBlock::determineStartPosition): Prevent dirtying of lines
     27        above the first dirty line.
     28        * rendering/TrailingFloatsRootInlineBox.h: Added.
     29        (WebCore::TrailingFloatsRootInlineBox::TrailingFloatsRootInlineBox): Call
     30        setHasVirtualHeight().
     31        (WebCore::TrailingFloatsRootInlineBox::virtualHeight): Return 0.
     32
    1332010-01-18  Gavin Barraclough  <barraclough@apple.com>
    234
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r53328 r53420  
    2780027800                        </File>
    2780127801                        <File
     27802                                RelativePath="..\rendering\TrailingFloatsRootInlineBox.h"
     27803                                >
     27804                        </File>
     27805                        <File
    2780227806                                RelativePath="..\rendering\TransformState.cpp"
    2780327807                                >
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r53412 r53420  
    59835983                37F818FB0D657606005E1F05 /* WebCoreURLResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreURLResponse.h; sourceTree = "<group>"; };
    59845984                37F818FC0D657606005E1F05 /* WebCoreURLResponse.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreURLResponse.mm; sourceTree = "<group>"; };
     5985                37FC96DA1104ED71003E1FAD /* TrailingFloatsRootInlineBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrailingFloatsRootInlineBox.h; sourceTree = "<group>"; };
    59855986                41002CCB0F66EDEF009E660D /* ScriptFunctionCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptFunctionCall.h; sourceTree = "<group>"; };
    59865987                41002CCC0F66EDEF009E660D /* ScriptFunctionCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptFunctionCall.cpp; sourceTree = "<group>"; };
     
    1564115642                                AB014DE10E689A4300E10445 /* TextControlInnerElements.cpp */,
    1564215643                                AB014DE20E689A4300E10445 /* TextControlInnerElements.h */,
     15644                                37FC96DA1104ED71003E1FAD /* TrailingFloatsRootInlineBox.h */,
    1564315645                                0F500AB00F54DB3100EEF928 /* TransformState.cpp */,
    1564415646                                0F500AAE0F54DB1B00EEF928 /* TransformState.h */,
  • trunk/WebCore/rendering/RenderBlock.cpp

    r53218 r53420  
    33 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
    44 *           (C) 2007 David Smith (catfish.man@gmail.com)
    5  * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
     5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
    66 *
    77 * This library is free software; you can redistribute it and/or
     
    29292929}
    29302930
    2931 void RenderBlock::markLinesDirtyInVerticalRange(int top, int bottom)
     2931void RenderBlock::markLinesDirtyInVerticalRange(int top, int bottom, RootInlineBox* highest)
    29322932{
    29332933    if (top >= bottom)
     
    29412941    }
    29422942
    2943     while (afterLowest && afterLowest->blockHeight() >= top) {
     2943    while (afterLowest && afterLowest != highest && afterLowest->blockHeight() >= top) {
    29442944        afterLowest->markDirty();
    29452945        afterLowest = afterLowest->prevRootBox();
  • trunk/WebCore/rendering/RenderBlock.h

    r52632 r53420  
    33 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
    44 *           (C) 2007 David Smith (catfish.man@gmail.com)
    5  * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
     5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
    66 *
    77 * This library is free software; you can redistribute it and/or
     
    3535class InlineIterator;
    3636class RenderInline;
    37 class RootInlineBox;
    3837
    3938struct BidiRun;
     
    357356    void adjustForBorderFit(int x, int& left, int& right) const; // Helper function for borderFitAdjust
    358357
    359     void markLinesDirtyInVerticalRange(int top, int bottom);
     358    void markLinesDirtyInVerticalRange(int top, int bottom, RootInlineBox* highest = 0);
    360359
    361360    void newLine(EClear);
  • trunk/WebCore/rendering/RenderBlockLineLayout.cpp

    r52931 r53420  
    11/*
    22 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
    3  * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009 Apple Inc. All right reserved.
     3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All right reserved.
    44 * Copyright (C) 2010 Google Inc. All rights reserved.
    55 *
     
    3131#include "RenderListMarker.h"
    3232#include "RenderView.h"
     33#include "TrailingFloatsRootInlineBox.h"
    3334#include "break_lines.h"
    3435#include <wtf/AlwaysInline.h>
     
    11261127            // This has to be done before adding in the bottom border/padding, or the float will
    11271128            // include the padding incorrectly. -dwh
     1129            if (checkForFloatsFromLastLine) {
     1130                TrailingFloatsRootInlineBox* trailingFloatsLineBox = new (renderArena()) TrailingFloatsRootInlineBox(this);
     1131                m_lineBoxes.appendLineBox(trailingFloatsLineBox);
     1132                trailingFloatsLineBox->setConstructed();
     1133                trailingFloatsLineBox->verticallyAlignBoxes(height());
     1134                trailingFloatsLineBox->setBlockHeight(height());
     1135            }
    11281136            if (lastFloat) {
    11291137                for (FloatingObject* f = m_floatingObjects->last(); f != lastFloat; f = m_floatingObjects->prev()) {
     
    11881196                        int floatTop = floats[floatIndex].rect.y();
    11891197                        curr->markDirty();
    1190                         markLinesDirtyInVerticalRange(curr->blockHeight(), floatTop + max(floats[floatIndex].rect.height(), newSize.height()));
     1198                        markLinesDirtyInVerticalRange(curr->blockHeight(), floatTop + max(floats[floatIndex].rect.height(), newSize.height()), curr);
    11911199                        floats[floatIndex].rect.setSize(newSize);
    11921200                        dirtiedByFloat = true;
Note: See TracChangeset for help on using the changeset viewer.