- Revision
- 199998
- Author
- [email protected]
- Date
- 2016-04-25 05:48:23 -0700 (Mon, 25 Apr 2016)
Log Message
Merge r199512 - Non-resizable text field looks resizable
https://bugs.webkit.org/show_bug.cgi?id=152271
Reviewed by Darin Adler.
Source/WebCore:
The 'resizability' of an HTML element is controlled by its 'resize' CSS property value.
By default it is 'none', but certain HTML elements, including <textarea>, have it
set to 'both' by default (defined in html.css). These values mean no resize at all, and
resizable in both vertical and horizontal axis, respectively.
Additionally, 'vertical' and 'horizontal' values are also valid.
Problem here is that the way WebKit handles the 'resize' property on single line
input elements (e.g. <input>) is different than other engines (read Gecko, Blink and Presto):
- Match: WebKit, Firefox, Presto and Blink all force single line input elements to be non-resizable,
regardless of either the 'resize' properly is set or not.
- Mismatch: WebKit is the only engine that actually paints the resize control on single line
input elements, even it having no effect.
On WebKit, this happens because the 'resize' property is wrongly implemented as 'inheritable',
differently from other engines. In the way WebKit contructs its RenderTree, 'resize' property
ends up spilling out of <input> and entering its shadow representation, carrying the 'resize'
property on.
Patch fixes this by making the 'resize' properly be non-inherited, matching other vendors
and the spec [1].
[1] https://drafts.csswg.org/css-ui/#resize
Tests: fast/css/resize-not-inherited.html
fast/css/resize-single-line-input-no-paint.html
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
LayoutTests:
* fast/css/resize-not-inherited-expected.html: Added.
* fast/css/resize-not-inherited.html: Added.
* fast/css/resize-single-line-input-no-paint-expected.html: Added.
* fast/css/resize-single-line-input-no-paint.html: Added.
Modified Paths
Added Paths
Diff
Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (199997 => 199998)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog 2016-04-25 12:36:42 UTC (rev 199997)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog 2016-04-25 12:48:23 UTC (rev 199998)
@@ -1,3 +1,15 @@
+2016-04-13 Antonio Gomes <[email protected]>
+
+ Non-resizable text field looks resizable
+ https://bugs.webkit.org/show_bug.cgi?id=152271
+
+ Reviewed by Darin Adler.
+
+ * fast/css/resize-not-inherited-expected.html: Added.
+ * fast/css/resize-not-inherited.html: Added.
+ * fast/css/resize-single-line-input-no-paint-expected.html: Added.
+ * fast/css/resize-single-line-input-no-paint.html: Added.
+
2016-04-11 Jiewen Tan <[email protected]>
fast/loader/opaque-base-url.html crashing during mac and ios debug tests
Added: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/css/resize-not-inherited-expected.html (0 => 199998)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/css/resize-not-inherited-expected.html (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/css/resize-not-inherited-expected.html 2016-04-25 12:48:23 UTC (rev 199998)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<style>
+.container {
+ width:100px;
+ height:100px;
+ overflow:hidden;
+ position:absolute;
+ background-color:pink;
+}
+</style>
+
+<p>Test ensures that a 'resize' property is not inherited by its children. Test passes if the resizer (green square) is not seen at the bottom right.</p>
+<div>
+ <div class="container"></div>
+</div>
Added: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/css/resize-not-inherited.html (0 => 199998)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/css/resize-not-inherited.html (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/css/resize-not-inherited.html 2016-04-25 12:48:23 UTC (rev 199998)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<style>
+.container {
+ width:100px;
+ height:100px;
+ overflow:hidden;
+ position:absolute;
+ background-color:pink;
+}
+
+.container::-webkit-resizer {
+ background-color: rgba(0, 127, 0, 0.5);
+}
+</style>
+
+<p>Test ensures that a 'resize' property is not inherited by its children. Test passes if the resizer (green square) is not seen at the bottom right.</p>
+<div style="resize:vertical;">
+ <div class="container"></div>
+</div>
Added: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/css/resize-single-line-input-no-paint-expected.html (0 => 199998)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/css/resize-single-line-input-no-paint-expected.html (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/css/resize-single-line-input-no-paint-expected.html 2016-04-25 12:48:23 UTC (rev 199998)
@@ -0,0 +1,4 @@
+<input type="text">
+<input type="text">
+<input type="text">
+<input type="text">
Added: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/css/resize-single-line-input-no-paint.html (0 => 199998)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/css/resize-single-line-input-no-paint.html (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/css/resize-single-line-input-no-paint.html 2016-04-25 12:48:23 UTC (rev 199998)
@@ -0,0 +1,4 @@
+<input type="text" style="resize:vertical">
+<input type="text" style="resize:horizontal">
+<input type="text" style="resize:both">
+<input type="text" style="resize:none">
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (199997 => 199998)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog 2016-04-25 12:36:42 UTC (rev 199997)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog 2016-04-25 12:48:23 UTC (rev 199998)
@@ -1,3 +1,48 @@
+2016-04-13 Antonio Gomes <[email protected]>
+
+ Non-resizable text field looks resizable
+ https://bugs.webkit.org/show_bug.cgi?id=152271
+
+ Reviewed by Darin Adler.
+
+ The 'resizability' of an HTML element is controlled by its 'resize' CSS property value.
+ By default it is 'none', but certain HTML elements, including <textarea>, have it
+ set to 'both' by default (defined in html.css). These values mean no resize at all, and
+ resizable in both vertical and horizontal axis, respectively.
+ Additionally, 'vertical' and 'horizontal' values are also valid.
+
+ Problem here is that the way WebKit handles the 'resize' property on single line
+ input elements (e.g. <input>) is different than other engines (read Gecko, Blink and Presto):
+
+ - Match: WebKit, Firefox, Presto and Blink all force single line input elements to be non-resizable,
+ regardless of either the 'resize' properly is set or not.
+
+ - Mismatch: WebKit is the only engine that actually paints the resize control on single line
+ input elements, even it having no effect.
+
+ On WebKit, this happens because the 'resize' property is wrongly implemented as 'inheritable',
+ differently from other engines. In the way WebKit contructs its RenderTree, 'resize' property
+ ends up spilling out of <input> and entering its shadow representation, carrying the 'resize'
+ property on.
+
+ Patch fixes this by making the 'resize' properly be non-inherited, matching other vendors
+ and the spec [1].
+
+ [1] https://drafts.csswg.org/css-ui/#resize
+
+ Tests: fast/css/resize-not-inherited.html
+ fast/css/resize-single-line-input-no-paint.html
+
+ * rendering/style/RenderStyle.h:
+ * rendering/style/StyleRareInheritedData.cpp:
+ (WebCore::StyleRareInheritedData::StyleRareInheritedData):
+ (WebCore::StyleRareInheritedData::operator==):
+ * rendering/style/StyleRareInheritedData.h:
+ * rendering/style/StyleRareNonInheritedData.cpp:
+ (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+ (WebCore::StyleRareNonInheritedData::operator==):
+ * rendering/style/StyleRareNonInheritedData.h:
+
2016-04-12 Konstantin Tokarev <[email protected]>
Fixed uninitialization of Node::DataUnion with GCC 4.8.
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/RenderStyle.h (199997 => 199998)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/RenderStyle.h 2016-04-25 12:36:42 UTC (rev 199997)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/RenderStyle.h 2016-04-25 12:48:23 UTC (rev 199998)
@@ -998,7 +998,7 @@
const AtomicString& hyphenationString() const { return rareInheritedData->hyphenationString; }
const AtomicString& locale() const { return fontDescription().locale(); }
EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); }
- EResize resize() const { return static_cast<EResize>(rareInheritedData->resize); }
+ EResize resize() const { return static_cast<EResize>(rareNonInheritedData->m_resize); }
ColumnAxis columnAxis() const { return static_cast<ColumnAxis>(rareNonInheritedData->m_multiCol->m_axis); }
bool hasInlineColumnAxis() const {
ColumnAxis axis = columnAxis();
@@ -1575,7 +1575,7 @@
void setHyphenationLimitLines(short limit) { SET_VAR(rareInheritedData, hyphenationLimitLines, limit); }
void setHyphenationString(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenationString, h); }
void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); }
- void setResize(EResize r) { SET_VAR(rareInheritedData, resize, r); }
+ void setResize(EResize r) { SET_VAR(rareNonInheritedData, m_resize, r); }
void setColumnAxis(ColumnAxis axis) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_axis, axis); }
void setColumnProgression(ColumnProgression progression) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_progression, progression); }
void setColumnWidth(float f) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_autoWidth, false); SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_width, f); }
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/StyleRareInheritedData.cpp (199997 => 199998)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/StyleRareInheritedData.cpp 2016-04-25 12:36:42 UTC (rev 199997)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/StyleRareInheritedData.cpp 2016-04-25 12:48:23 UTC (rev 199998)
@@ -85,7 +85,6 @@
, overflowWrap(RenderStyle::initialOverflowWrap())
, nbspMode(NBNORMAL)
, lineBreak(LineBreakAuto)
- , resize(RenderStyle::initialResize())
, userSelect(RenderStyle::initialUserSelect())
, speak(SpeakNormal)
, hyphens(HyphensManual)
@@ -168,7 +167,6 @@
, overflowWrap(o.overflowWrap)
, nbspMode(o.nbspMode)
, lineBreak(o.lineBreak)
- , resize(o.resize)
, userSelect(o.userSelect)
, speak(o.speak)
, hyphens(o.hyphens)
@@ -269,7 +267,6 @@
#if ENABLE(IOS_TEXT_AUTOSIZING)
&& textSizeAdjust == o.textSizeAdjust
#endif
- && resize == o.resize
&& userSelect == o.userSelect
&& speak == o.speak
&& hyphens == o.hyphens
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/StyleRareInheritedData.h (199997 => 199998)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/StyleRareInheritedData.h 2016-04-25 12:36:42 UTC (rev 199997)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/StyleRareInheritedData.h 2016-04-25 12:48:23 UTC (rev 199998)
@@ -92,7 +92,6 @@
unsigned overflowWrap : 1; // EOverflowWrap
unsigned nbspMode : 1; // ENBSPMode
unsigned lineBreak : 3; // LineBreak
- unsigned resize : 2; // EResize
unsigned userSelect : 2; // EUserSelect
unsigned colorSpace : 1; // ColorSpace
unsigned speak : 3; // ESpeak
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (199997 => 199998)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp 2016-04-25 12:36:42 UTC (rev 199997)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp 2016-04-25 12:48:23 UTC (rev 199998)
@@ -107,6 +107,7 @@
, m_breakBefore(RenderStyle::initialBreakBetween())
, m_breakAfter(RenderStyle::initialBreakBetween())
, m_breakInside(RenderStyle::initialBreakInside())
+ , m_resize(RenderStyle::initialResize())
{
m_maskBoxImage.setMaskDefaults();
}
@@ -199,6 +200,7 @@
, m_breakBefore(o.m_breakBefore)
, m_breakAfter(o.m_breakAfter)
, m_breakInside(o.m_breakInside)
+ , m_resize(o.m_resize)
{
}
@@ -301,7 +303,8 @@
&& m_objectFit == o.m_objectFit
&& m_breakAfter == o.m_breakAfter
&& m_breakBefore == o.m_breakBefore
- && m_breakInside == o.m_breakInside;
+ && m_breakInside == o.m_breakInside
+ && m_resize == o.m_resize;
}
bool StyleRareNonInheritedData::contentDataEquivalent(const StyleRareNonInheritedData& o) const
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (199997 => 199998)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/StyleRareNonInheritedData.h 2016-04-25 12:36:42 UTC (rev 199997)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/StyleRareNonInheritedData.h 2016-04-25 12:48:23 UTC (rev 199998)
@@ -223,6 +223,7 @@
unsigned m_breakBefore : 4; // BreakBetween
unsigned m_breakAfter : 4;
unsigned m_breakInside : 3; // BreakInside
+ unsigned m_resize : 2; // EResize
private:
StyleRareNonInheritedData();