Changeset 154702 in webkit


Ignore:
Timestamp:
Aug 27, 2013 12:21:00 PM (11 years ago)
Author:
robert@webkit.org
Message:

cell width / offsetTop incorrect
https://bugs.webkit.org/show_bug.cgi?id=11582

Reviewed by David Hyatt.

Source/WebCore:

The offsetTop and offsetLeft of sections, rows and cells should include the table's border. There are separate
problems with the offset[Top|Left] of table sections and the offsetLeft of rows which are covered under bugs 119020
and 119021 respectively - here we stick to just fixing the inclusion of the border as it doesn't require rebaselining
a lot of tests.

Test: fast/table/offset-top-includes-border.html

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent):

  • rendering/RenderTableSection.cpp:

(WebCore::RenderTableSection::layoutRows):

LayoutTests:

  • fast/dom/Element/offsetTop-table-cell-expected.txt:
  • fast/dom/Element/offsetTop-table-cell.html:
  • fast/table/offset-top-includes-border-expected.txt: Added.
  • fast/table/offset-top-includes-border.html: Added.
  • platform/mac/editing/selection/5057506-2-expected.txt:
  • platform/mac/editing/selection/5057506-expected.txt:
  • platform/qt/editing/selection/5057506-2-expected.txt:
  • platform/qt/editing/selection/5057506-expected.txt:
Location:
trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r154698 r154702  
     12013-08-27  Robert Hogan  <robert@webkit.org>
     2
     3        cell width / offsetTop incorrect
     4        https://bugs.webkit.org/show_bug.cgi?id=11582
     5
     6        Reviewed by David Hyatt.
     7
     8        * fast/dom/Element/offsetTop-table-cell-expected.txt:
     9        * fast/dom/Element/offsetTop-table-cell.html:
     10        * fast/table/offset-top-includes-border-expected.txt: Added.
     11        * fast/table/offset-top-includes-border.html: Added.
     12        * platform/mac/editing/selection/5057506-2-expected.txt:
     13        * platform/mac/editing/selection/5057506-expected.txt:
     14        * platform/qt/editing/selection/5057506-2-expected.txt:
     15        * platform/qt/editing/selection/5057506-expected.txt:
     16
    1172013-08-27  Renata Hodovan  <reni@webkit.org>
    218
  • trunk/LayoutTests/fast/dom/Element/offsetTop-table-cell-expected.txt

    r40552 r154702  
    33Table 1 row 2 top offset:50
    44Table 1 cell 2 top offset:50
    5 Table 2 row 1 top offset:0
    6 Table 2 cell 1 top offset:0
    7 Table 2 cell 2 top offset:0
    8 Table 2 cell 3 top offset:0
     5Table 2 row 1 top offset:1
     6Table 2 cell 1 top offset:1
     7Table 2 cell 2 top offset:1
     8Table 2 cell 3 top offset:1
    99Table 3 cell 1 top offset:0
    1010Table 4 div 1 top offset:50
  • trunk/LayoutTests/fast/dom/Element/offsetTop-table-cell.html

    r120792 r154702  
    3333    console.innerText += "\n";
    3434    console.innerText += "Test result: "
    35     console.innerText += (rowOffset == 50 && cellOffset == 50 && tr1Offset == 0
     35    console.innerText += (rowOffset == 50 && cellOffset == 50 && tr1Offset == 1
    3636        && tr1Offset == td2Offset && tr1Offset == td3Offset && td4Offset == 0 && div5Offset == 50 ? "PASS" : "FAIL");
    3737}
  • trunk/LayoutTests/platform/mac/editing/selection/5057506-2-expected.txt

    r63291 r154702  
    1 ALERT: 34
    2 ALERT: 108
     1ALERT: 35
     2ALERT: 109
    33layer at (0,0) size 800x600
    44  RenderView at (0,0) size 800x600
  • trunk/LayoutTests/platform/mac/editing/selection/5057506-expected.txt

    r63291 r154702  
    1 ALERT: 34
    2 ALERT: 108
     1ALERT: 35
     2ALERT: 109
    33layer at (0,0) size 800x600
    44  RenderView at (0,0) size 800x600
  • trunk/LayoutTests/platform/qt/editing/selection/5057506-2-expected.txt

    r122716 r154702  
    1 ALERT: 33
    2 ALERT: 112.5
     1ALERT: 34
     2ALERT: 113.5
    33layer at (0,0) size 800x600
    44  RenderView at (0,0) size 800x600
  • trunk/LayoutTests/platform/qt/editing/selection/5057506-expected.txt

    r122716 r154702  
    1 ALERT: 33
    2 ALERT: 112.5
     1ALERT: 34
     2ALERT: 113.5
    33layer at (0,0) size 800x600
    44  RenderView at (0,0) size 800x600
     
    2727          RenderText {#text} at (0,0) size 20x19
    2828            text run at (0,0) width 20: "bar"
    29 selection start: position 0 of child 0 {#text} of child 0 {SPAN} of child 0 {TD} of child 0 {TR} of child 0 {TBODY} of child 1 {TABLE} of child 2 {DIV} of body
     29selection start: position 3 of child 0 {#text} of child 0 {SPAN} of child 0 {TD} of child 0 {TR} of child 0 {TBODY} of child 1 {TABLE} of child 2 {DIV} of body
    3030selection end:   position 0 of child 3 {DIV} of child 2 {DIV} of body
  • trunk/Source/WebCore/ChangeLog

    r154701 r154702  
     12013-08-27  Robert Hogan  <robert@webkit.org>
     2
     3        cell width / offsetTop incorrect
     4        https://bugs.webkit.org/show_bug.cgi?id=11582
     5
     6        Reviewed by David Hyatt.
     7
     8        The offsetTop and offsetLeft of sections, rows and cells should include the table's border. There are separate
     9        problems with the offset[Top|Left] of table sections and the offsetLeft of rows which are covered under bugs 119020
     10        and 119021 respectively - here we stick to just fixing the inclusion of the border as it doesn't require rebaselining
     11        a lot of tests.
     12
     13        Test: fast/table/offset-top-includes-border.html
     14
     15        * rendering/RenderBoxModelObject.cpp:
     16        (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent):
     17        * rendering/RenderTableSection.cpp:
     18        (WebCore::RenderTableSection::layoutRows):
     19
    1202013-08-27  Jacky Jiang  <zhajiang@blackberry.com>
    221
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r154688 r154702  
    3838#include "RenderNamedFlowThread.h"
    3939#include "RenderRegion.h"
     40#include "RenderTable.h"
    4041#include "RenderView.h"
    4142#include "ScrollingConstraints.h"
     
    491492    // of the element and stop this algorithm.
    492493    if (const RenderBoxModelObject* offsetParent = this->offsetParent()) {
    493         if (offsetParent->isBox() && !offsetParent->isBody())
     494        if (offsetParent->isBox() && !offsetParent->isBody() && !offsetParent->isTable())
    494495            referencePoint.move(-toRenderBox(offsetParent)->borderLeft(), -toRenderBox(offsetParent)->borderTop());
    495496        if (!isOutOfFlowPositioned() || flowThreadContainingBlock()) {
  • trunk/Source/WebCore/rendering/RenderTableSection.cpp

    r154580 r154702  
    525525        // Set the row's x/y position and width/height.
    526526        if (RenderTableRow* rowRenderer = m_grid[r].rowRenderer) {
     527            // FIXME: the x() position of the row should be table()->hBorderSpacing() so that it can
     528            // report the correct offsetLeft. However, that will require a lot of rebaselining of test results.
    527529            rowRenderer->setLocation(LayoutPoint(0, m_rowPos[r]));
    528530            rowRenderer->setLogicalWidth(logicalWidth());
Note: See TracChangeset for help on using the changeset viewer.