Changeset 151451 in webkit
- Timestamp:
- Jun 11, 2013, 12:03:09 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r151448 r151451 1 2013-05-27 Robert Hogan <robert@webkit.org> 2 3 Positioned Replaced Elements That Aren't RenderReplaced get Incorrect Width 4 https://bugs.webkit.org/show_bug.cgi?id=93735 5 6 Reviewed by Darin Adler. 7 8 * fast/forms/onselect-textfield-expected.txt: 9 * fast/replaced/width-and-height-of-positioned-replaced-elements-expected.png: Added. 10 * fast/replaced/width-and-height-of-positioned-replaced-elements-expected.txt: Added. 11 * fast/replaced/width-and-height-of-positioned-replaced-elements.html: Added. 12 * platform/mac-wk2/fast/replaced/width-and-height-of-positioned-replaced-elements-expected.txt: Added. 13 * platform/mac/fast/forms/button-positioned-expected.txt: 14 * platform/mac/fast/forms/input-appearance-preventDefault-expected.txt: 15 * platform/mac/fast/replaced/width-and-height-of-positioned-replaced-elements-expected.txt: Added. 16 * platform/qt/fast/forms/button-positioned-expected.txt: 17 * platform/qt/fast/forms/input-appearance-preventDefault-expected.txt: 18 1 19 2013-06-11 Robert Hogan <robert@webkit.org> 2 20 -
trunk/LayoutTests/fast/forms/onselect-textfield-expected.txt
r25234 r151451 10 10 Double clicking to make selection for text field 11 11 onselect fired for text field 12 After double clicking: text field selection start: 6 end: 1012 After double clicking: text field selection start: 0 end: 5 13 13 14 14 Calling blur on text field 15 After blur: text field selection start: 6 end: 1015 After blur: text field selection start: 0 end: 5 16 16 17 17 Calling focus on text field 18 After focus: text field selection start: 6 end: 1018 After focus: text field selection start: 0 end: 5 19 19 -
trunk/LayoutTests/platform/mac/fast/forms/button-positioned-expected.txt
r149210 r151451 4 4 RenderBlock {HTML} at (0,0) size 800x600 5 5 RenderBody {BODY} at (8,8) size 784x584 6 layer at (10,10) size 1 54x187 RenderButton {BUTTON} at (10,10) size 1 54x18[bgcolor=#C0C0C0] [border: none (2px outset #C0C0C0) none (2px outset #C0C0C0)]8 RenderBlock (anonymous) at (8,2) size 1 38x139 RenderText {#text} at ( 0,0) size 138x1310 text run at ( 0,0) width 138: "This button is positioned."11 layer at (10,10) size 1 75x1812 RenderButton {INPUT} at (10,10) size 1 75x18 [bgcolor=#C0C0C0]13 RenderBlock (anonymous) at (8,2) size 1 59x1314 RenderText at ( 0,0) size 159x1315 text run at ( 0,0) width 159: "This button is also positioned"6 layer at (10,10) size 170x15 7 RenderButton {BUTTON} at (10,10) size 170x15 [bgcolor=#C0C0C0] [border: none (2px outset #C0C0C0) none (2px outset #C0C0C0)] 8 RenderBlock (anonymous) at (8,2) size 154x13 9 RenderText {#text} at (8,0) size 138x13 10 text run at (8,0) width 138: "This button is positioned." 11 layer at (10,10) size 191x18 12 RenderButton {INPUT} at (10,10) size 191x18 [bgcolor=#C0C0C0] 13 RenderBlock (anonymous) at (8,2) size 175x13 14 RenderText at (8,0) size 159x13 15 text run at (8,0) width 159: "This button is also positioned" -
trunk/LayoutTests/platform/mac/fast/forms/input-appearance-preventDefault-expected.txt
r117673 r151451 9 9 RenderText {#text} at (0,0) size 0x0 10 10 RenderText {#text} at (0,0) size 0x0 11 layer at (12,52) size 12 3x1912 RenderTextControl {INPUT} at (12,52) size 12 3x19[bgcolor=#FFFFFF] [border: (2px inset #000000)]13 layer at (15,5 5) size 117x13 scrollWidth 13014 RenderBlock {DIV} at (3, 3) size 117x1311 layer at (12,52) size 129x25 12 RenderTextControl {INPUT} at (12,52) size 129x25 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 13 layer at (15,58) size 123x13 scrollWidth 130 14 RenderBlock {DIV} at (3,6) size 123x13 15 15 RenderText {#text} at (0,0) size 129x13 16 16 text run at (0,0) width 129: "No caret should be here" -
trunk/LayoutTests/platform/qt/fast/forms/button-positioned-expected.txt
r122879 r151451 4 4 RenderBlock {HTML} at (0,0) size 800x600 5 5 RenderBody {BODY} at (8,8) size 784x584 6 layer at (10,10) size 1 62x317 RenderButton {BUTTON} at (10,10) size 1 62x31[bgcolor=#C0C0C0]8 RenderBlock (anonymous) at (6,6) size 1 50x199 RenderText {#text} at ( 0,0) size 150x1910 text run at ( 0,0) width 150: "This button is positioned."11 layer at (10,10) size 1 86x3112 RenderButton {INPUT} at (10,10) size 1 86x31[bgcolor=#C0C0C0]13 RenderBlock (anonymous) at (6,6) size 1 74x1914 RenderText at ( 0,0) size 174x1915 text run at ( 0,0) width 174: "This button is also positioned"6 layer at (10,10) size 174x29 7 RenderButton {BUTTON} at (10,10) size 174x29 [bgcolor=#C0C0C0] 8 RenderBlock (anonymous) at (6,6) size 162x19 9 RenderText {#text} at (6,0) size 150x19 10 text run at (6,0) width 150: "This button is positioned." 11 layer at (10,10) size 198x29 12 RenderButton {INPUT} at (10,10) size 198x29 [bgcolor=#C0C0C0] 13 RenderBlock (anonymous) at (6,6) size 186x19 14 RenderText at (6,0) size 174x19 15 text run at (6,0) width 174: "This button is also positioned" -
trunk/LayoutTests/platform/qt/fast/forms/input-appearance-preventDefault-expected.txt
r122879 r151451 9 9 RenderText {#text} at (0,0) size 0x0 10 10 RenderText {#text} at (0,0) size 0x0 11 layer at (12,52) size 19 2x2312 RenderTextControl {INPUT} at (12,52) size 19 2x2313 layer at (14,5 4) size 188x1914 RenderBlock {DIV} at (2, 2) size 188x1911 layer at (12,52) size 196x27 12 RenderTextControl {INPUT} at (12,52) size 196x27 13 layer at (14,56) size 192x19 14 RenderBlock {DIV} at (2,4) size 192x19 15 15 RenderText {#text} at (0,0) size 146x19 16 16 text run at (0,0) width 146: "No caret should be here" -
trunk/Source/WebCore/ChangeLog
r151449 r151451 1 2013-05-27 Robert Hogan <robert@webkit.org> 2 3 Positioned Replaced Elements That Aren't RenderReplaced get Incorrect Width 4 https://bugs.webkit.org/show_bug.cgi?id=93735 5 6 Reviewed by Darin Adler. 7 8 Replaced elements that aren't RenderReplaced aren't |isReplaced| and don't have an 9 intrinsic height or width. This causes them to go down the wrong height and width computation 10 path in RenderBox when they are absolute positioned. 11 12 The notion of |isReplaced| is entwined with the notion of being |isInline| so it isn't really 13 possible to make them isReplaced without re-wiring a lot of code. So instead use an ad-hoc definition 14 of isReplacedElement in RenderBox to bring all replaced elements into the height and width calculation. 15 To make sure we get the right height and width in there, give non-RenderReplaced replaced renderers 16 the helpers for returning their approximation of intrinsic height and width. 17 18 Test: fast/replaced/width-and-height-of-positioned-replaced-elements.html 19 20 * rendering/RenderBox.cpp: 21 (WebCore::isReplacedElement): 22 (WebCore::RenderBox::computePositionedLogicalWidth): 23 (WebCore::RenderBox::computePositionedLogicalHeight): 24 * rendering/RenderBox.h: 25 (WebCore::RenderBox::intrinsicSize): 26 * rendering/RenderButton.h: 27 * rendering/RenderListBox.cpp: 28 (WebCore::RenderListBox::RenderListBox): 29 (WebCore::RenderListBox::computeLogicalHeight): 30 * rendering/RenderListBox.h: 31 * rendering/RenderMenuList.h: 32 * rendering/RenderReplaced.h: 33 * rendering/RenderTextControl.cpp: 34 (WebCore::RenderTextControl::RenderTextControl): 35 (WebCore::RenderTextControl::computeLogicalHeight): 36 * rendering/RenderTextControl.h: 37 1 38 2013-06-11 Ryosuke Niwa <rniwa@webkit.org> 2 39 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r151402 r151451 3035 3035 } 3036 3036 3037 static bool isReplacedElement(const RenderBox* child) 3038 { 3039 // FIXME: Bug 117267, we should make form control elements isReplaced too so that we can just check for that. 3040 return child->isReplaced() || (child->node() && child->node()->isElementNode() && toElement(child->node())->isFormControlElement() && !child->isFieldset()); 3041 } 3042 3037 3043 void RenderBox::computePositionedLogicalWidth(LogicalExtentComputedValues& computedValues, RenderRegion* region) const 3038 3044 { 3039 if (isReplaced ()) {3045 if (isReplacedElement(this)) { 3040 3046 // FIXME: Positioned replaced elements inside a flow thread are not working properly 3041 3047 // with variable width regions (see https://bugs.webkit.org/show_bug.cgi?id=69896 ). … … 3379 3385 void RenderBox::computePositionedLogicalHeight(LogicalExtentComputedValues& computedValues) const 3380 3386 { 3381 if (isReplaced ()) {3387 if (isReplacedElement(this)) { 3382 3388 computePositionedLogicalHeightReplaced(computedValues); 3383 3389 return; -
trunk/Source/WebCore/rendering/RenderBox.h
r151402 r151451 400 400 } 401 401 402 virtual LayoutSize intrinsicSize() const { return LayoutSize(); }403 402 LayoutUnit intrinsicLogicalWidth() const { return style()->isHorizontalWritingMode() ? intrinsicSize().width() : intrinsicSize().height(); } 404 403 LayoutUnit intrinsicLogicalHeight() const { return style()->isHorizontalWritingMode() ? intrinsicSize().height() : intrinsicSize().width(); } … … 642 641 LayoutUnit viewLogicalHeightForPercentages() const; 643 642 643 virtual LayoutSize intrinsicSize() const { return LayoutSize(); } 644 644 void computePositionedLogicalHeight(LogicalExtentComputedValues&) const; 645 645 void computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection, -
trunk/Source/WebCore/rendering/RenderButton.h
r150312 r151451 68 68 void timerFired(Timer<RenderButton>*); 69 69 70 virtual LayoutSize intrinsicSize() const OVERRIDE FINAL { return LayoutSize(maxPreferredLogicalWidth(), LayoutUnit()); } 71 70 72 RenderTextFragment* m_buttonText; 71 73 RenderBlock* m_inner; -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r150796 r151451 90 90 , m_optionsWidth(0) 91 91 , m_indexOffset(0) 92 , m_intrinsicLogicalHeight(0) 92 93 { 93 94 ASSERT(element); … … 270 271 void RenderListBox::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const 271 272 { 272 LayoutUnit height = itemHeight() * size() - rowSpacing + borderAndPaddingHeight();273 RenderBox::computeLogicalHeight( height, logicalTop, computedValues);273 m_intrinsicLogicalHeight = itemHeight() * size() - rowSpacing + borderAndPaddingHeight(); 274 RenderBox::computeLogicalHeight(m_intrinsicLogicalHeight, logicalTop, computedValues); 274 275 } 275 276 -
trunk/Source/WebCore/rendering/RenderListBox.h
r150399 r151451 89 89 virtual void stopAutoscroll(); 90 90 91 virtual LayoutSize intrinsicSize() const OVERRIDE FINAL { return LayoutSize(maxPreferredLogicalWidth(), m_intrinsicLogicalHeight); } 92 91 93 virtual bool shouldPanScroll() const { return true; } 92 94 virtual void panScroll(const IntPoint&); … … 150 152 int m_optionsWidth; 151 153 int m_indexOffset; 154 mutable LayoutUnit m_intrinsicLogicalHeight; 152 155 153 156 RefPtr<Scrollbar> m_vBar; -
trunk/Source/WebCore/rendering/RenderMenuList.h
r150312 r151451 76 76 virtual const char* renderName() const { return "RenderMenuList"; } 77 77 78 virtual LayoutSize intrinsicSize() const OVERRIDE FINAL { return LayoutSize(maxPreferredLogicalWidth(), logicalHeight()); } 78 79 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const OVERRIDE; 79 80 virtual void computePreferredLogicalWidths() OVERRIDE; -
trunk/Source/WebCore/rendering/RenderReplaced.h
r150312 r151451 44 44 virtual void layout(); 45 45 46 virtual LayoutSize intrinsicSize() const OVERRIDE { return m_intrinsicSize; }46 virtual LayoutSize intrinsicSize() const OVERRIDE FINAL { return m_intrinsicSize; } 47 47 virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio, bool& isPercentageIntrinsicSize) const; 48 48 -
trunk/Source/WebCore/rendering/RenderTextControl.cpp
r150716 r151451 39 39 RenderTextControl::RenderTextControl(Element* element) 40 40 : RenderBlock(element) 41 , m_intrinsicLogicalHeight(0) 41 42 { 42 43 ASSERT(isHTMLTextFormControlElement(element)); … … 143 144 } 144 145 145 void RenderTextControl::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const146 void RenderTextControl::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const 146 147 { 147 148 HTMLElement* innerText = innerTextElement(); … … 149 150 if (RenderBox* innerTextBox = innerText->renderBox()) { 150 151 LayoutUnit nonContentHeight = innerTextBox->borderAndPaddingHeight() + innerTextBox->marginHeight(); 151 logicalHeight = computeControlLogicalHeight(innerTextBox->lineHeight(true, HorizontalLine, PositionOfInteriorLineBoxes), nonContentHeight) + borderAndPaddingHeight();152 m_intrinsicLogicalHeight = computeControlLogicalHeight(innerTextBox->lineHeight(true, HorizontalLine, PositionOfInteriorLineBoxes), nonContentHeight) + borderAndPaddingHeight(); 152 153 153 154 // We are able to have a horizontal scrollbar if the overflow style is scroll, or if its auto and there's no word wrap. 154 155 if ((isHorizontalWritingMode() && (style()->overflowX() == OSCROLL || (style()->overflowX() == OAUTO && innerText->renderer()->style()->overflowWrap() == NormalOverflowWrap))) 155 156 || (!isHorizontalWritingMode() && (style()->overflowY() == OSCROLL || (style()->overflowY() == OAUTO && innerText->renderer()->style()->overflowWrap() == NormalOverflowWrap)))) 156 logicalHeight += scrollbarThickness(); 157 } 158 159 RenderBox::computeLogicalHeight(logicalHeight, logicalTop, computedValues); 157 m_intrinsicLogicalHeight += scrollbarThickness(); 158 } 159 RenderBox::computeLogicalHeight(m_intrinsicLogicalHeight, logicalTop, computedValues); 160 160 } 161 161 -
trunk/Source/WebCore/rendering/RenderTextControl.h
r150312 r151451 82 82 83 83 virtual bool requiresForcedStyleRecalcPropagation() const { return true; } 84 85 virtual LayoutSize intrinsicSize() const OVERRIDE FINAL { return LayoutSize(maxPreferredLogicalWidth(), m_intrinsicLogicalHeight); } 86 87 mutable LayoutUnit m_intrinsicLogicalHeight; 84 88 }; 85 89
Note:
See TracChangeset
for help on using the changeset viewer.