Changeset 80814 in webkit
- Timestamp:
- Mar 10, 2011 9:36:37 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r80812 r80814 1 2011-03-10 Jeremy Moskovich <jeremy@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Fix navigation menus on a bunch of sites in WebKit. 6 https://bugs.webkit.org/show_bug.cgi?id=52535 7 8 Add test to make sure that offsetLeft matches FF/IE for a relatively 9 positioned TD and IFRAME elements. 10 Testcase is a reduction from doula.co.il. 11 12 * fast/block/positioning/offsetLeft-relative-iframe-expected.txt: Added. 13 * fast/block/positioning/offsetLeft-relative-iframe.html: Added. 14 * fast/block/positioning/offsetLeft-relative-td-expected.txt: Added. 15 * fast/block/positioning/offsetLeft-relative-td.html: Added. 16 1 17 2011-03-10 Adam Barth <abarth@webkit.org> 2 18 -
trunk/Source/WebCore/ChangeLog
r80812 r80814 1 2011-03-10 Jeremy Moskovich <jeremy@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Fix navigation menus on a bunch of sites in WebKit. 6 https://bugs.webkit.org/show_bug.cgi?id=52535 7 8 WebKit doesn't support position:relative for several table elements and 9 overwrites the style internally when position:relative is encountered. 10 Unfortunately position:relative affects the choice of nodes returned by 11 offsetParent. 12 13 This CL adds a bit to RenderStyle to track whether position:relative was 14 overwritten. The value is then consulted in offsetParent which makes us 15 match FF/IE. 16 17 Tests: fast/block/positioning/offsetLeft-relative-iframe.html 18 fast/block/positioning/offsetLeft-relative-td.html 19 20 * css/CSSStyleSelector.cpp: 21 (WebCore::CSSStyleSelector::adjustRenderStyle): 22 * rendering/RenderObject.cpp: 23 (WebCore::RenderObject::isOriginallyRelPositioned): 24 (WebCore::RenderObject::offsetParent): 25 * rendering/RenderObject.h: 26 * rendering/style/RenderStyle.h: Add a bit to track the original value of position:relative. 27 (WebCore::InheritedFlags::positionWasRelative): 28 (WebCore::InheritedFlags::setPositionWasRelative): 29 * rendering/style/StyleRareNonInheritedData.cpp: 30 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): 31 (WebCore::StyleRareNonInheritedData::operator==): 32 * rendering/style/StyleRareNonInheritedData.h: 33 1 34 2011-03-10 Adam Barth <abarth@webkit.org> 2 35 -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r80811 r80814 1893 1893 // fix a crash where a site tries to position these objects. They also never honor display. 1894 1894 if (e && (e->hasTagName(frameTag) || e->hasTagName(framesetTag))) { 1895 if (style->position() == RelativePosition) 1896 style->setPositionWasRelative(true); 1895 1897 style->setPosition(StaticPosition); 1896 1898 style->setDisplay(BLOCK); … … 1935 1937 if ((style->display() == TABLE_HEADER_GROUP || style->display() == TABLE_ROW_GROUP || 1936 1938 style->display() == TABLE_FOOTER_GROUP || style->display() == TABLE_ROW || style->display() == TABLE_CELL) && 1937 style->position() == RelativePosition) 1939 style->position() == RelativePosition) { 1940 style->setPositionWasRelative(true); 1938 1941 style->setPosition(StaticPosition); 1942 } 1939 1943 1940 1944 // writing-mode does not apply to table row groups, table column groups, table rows, and table columns. -
trunk/Source/WebCore/rendering/RenderObject.cpp
r80559 r80814 2153 2153 } 2154 2154 2155 bool RenderObject::wasOriginallyRelativePositioned() const 2156 { 2157 return isRelPositioned() || style()->positionWasRelative(); 2158 } 2159 2155 2160 bool RenderObject::isSelectionBorder() const 2156 2161 { … … 2611 2616 // is one of the following HTML elements: td, th, or table. 2612 2617 // * Our own extension: if there is a difference in the effective zoom 2613 bool skipTables = isPositioned() || isRelPositioned(); 2618 2619 bool skipTables = isPositioned() || wasOriginallyRelativePositioned(); 2614 2620 float currZoom = style()->effectiveZoom(); 2615 2621 RenderObject* curr = parent(); 2616 2622 while (curr && (!curr->node() || 2617 (!curr->isPositioned() && !curr-> isRelPositioned() && !curr->isBody()))) {2623 (!curr->isPositioned() && !curr->wasOriginallyRelativePositioned() && !curr->isBody()))) { 2618 2624 Node* element = curr->node(); 2619 2625 if (!skipTables && element) { -
trunk/Source/WebCore/rendering/RenderObject.h
r80798 r80814 401 401 bool isPositioned() const { return m_positioned; } // absolute or fixed positioning 402 402 bool isRelPositioned() const { return m_relPositioned; } // relative positioning 403 404 // WebKit overwrites the position:relative style for certain elements for which such positioning is illegal or behavior is undefined. 405 // This function returns the value specified in the source, even if it was corrected by WebKit. 406 bool wasOriginallyRelativePositioned() const; 407 403 408 bool isText() const { return m_isText; } 404 409 bool isBox() const { return m_isBox; } -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r80582 r80814 599 599 short counterIncrement() const { return rareNonInheritedData->m_counterIncrement; } 600 600 short counterReset() const { return rareNonInheritedData->m_counterReset; } 601 602 bool positionWasRelative() const { return rareNonInheritedData->m_positionWasRelative; } 601 603 602 604 EListStyleType listStyleType() const { return static_cast<EListStyleType>(inherited_flags._list_style_type); } … … 971 973 void setCounterIncrement(short v) { SET_VAR(rareNonInheritedData, m_counterIncrement, v) } 972 974 void setCounterReset(short v) { SET_VAR(rareNonInheritedData, m_counterReset, v) } 975 976 void setPositionWasRelative(bool v) { SET_VAR(rareNonInheritedData, m_positionWasRelative, v) } 973 977 974 978 void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; } -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r75848 r80814 47 47 , m_counterIncrement(0) 48 48 , m_counterReset(0) 49 , m_positionWasRelative(0) 49 50 #if USE(ACCELERATED_COMPOSITING) 50 51 , m_runningAcceleratedAnimation(false) … … 84 85 , m_counterIncrement(o.m_counterIncrement) 85 86 , m_counterReset(o.m_counterReset) 87 , m_positionWasRelative(o.m_positionWasRelative) 86 88 #if USE(ACCELERATED_COMPOSITING) 87 89 , m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation) … … 130 132 && m_counterIncrement == o.m_counterIncrement 131 133 && m_counterReset == o.m_counterReset 134 && m_positionWasRelative == o.m_positionWasRelative 132 135 #if USE(ACCELERATED_COMPOSITING) 133 136 && !m_runningAcceleratedAnimation && !o.m_runningAcceleratedAnimation -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
r74098 r80814 109 109 short m_counterReset; 110 110 111 // This flag preserves the fact that the position attribute was originally specified as relative. 112 unsigned m_positionWasRelative : 1; 113 111 114 #if USE(ACCELERATED_COMPOSITING) 112 115 bool m_runningAcceleratedAnimation : 1;
Note: See TracChangeset
for help on using the changeset viewer.