Diff
Modified: trunk/LayoutTests/ChangeLog (210779 => 210780)
--- trunk/LayoutTests/ChangeLog 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/LayoutTests/ChangeLog 2017-01-15 20:05:20 UTC (rev 210780)
@@ -1,3 +1,20 @@
+2017-01-15 Sam Weinig <s...@webkit.org>
+
+ [WebIDL] Remove custom bindings for HTMLInputElement, HTMLFrameElement, HTMLMediaElement and HTMLOptionsCollection
+ https://bugs.webkit.org/show_bug.cgi?id=167039
+
+ Reviewed by Darin Adler.
+
+ * fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt:
+ * fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt:
+ * fast/dom/HTMLSelectElement/select-selectedIndex-multiple.html:
+ * fast/dom/HTMLSelectElement/select-selectedIndex.html:
+ Update tests / results now that negative lengths don't throw, but do log due to be converted
+ to a large number.
+
+ * fast/forms/select-max-length-expected.txt:
+ Update result now that a large length is not clamped, but rather, ignored.
+
2017-01-14 Yusuke Suzuki <utatane....@gmail.com>
Annotate large string tests with largeHeap
Modified: trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt (210779 => 210780)
--- trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt 2017-01-15 20:05:20 UTC (rev 210780)
@@ -1,6 +1,6 @@
+CONSOLE MESSAGE: line 17: Blocked attempt to expand the option list to 4294967295 items. The maximum number of items allowed is 10000.
1) setting length to a negative length
-PASS mySelect.options.length = -1; threw exception IndexSizeError (DOM Exception 1): The index is not in the allowed range..
PASS mySelect.options.length is 2
PASS mySelect.selectedIndex is 1
2) setting length to a larger length
Modified: trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt (210779 => 210780)
--- trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt 2017-01-15 20:05:20 UTC (rev 210780)
@@ -1,6 +1,6 @@
+CONSOLE MESSAGE: line 17: Blocked attempt to expand the option list to 4294967295 items. The maximum number of items allowed is 10000.
1) setting length to a negative length
-PASS mySelect.options.length = -1; threw exception IndexSizeError (DOM Exception 1): The index is not in the allowed range..
PASS mySelect.options.length is 2
PASS mySelect.selectedIndex is 0
2) setting length to a larger length
Modified: trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex-multiple.html (210779 => 210780)
--- trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex-multiple.html 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex-multiple.html 2017-01-15 20:05:20 UTC (rev 210780)
@@ -14,7 +14,7 @@
var i = 0;
debug((++i) + ") setting length to a negative length");
-shouldThrow("mySelect.options.length = -1;");
+mySelect.options.length = -1;
shouldBe("mySelect.options.length", "2");
shouldBe("mySelect.selectedIndex", "0");
Modified: trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex.html (210779 => 210780)
--- trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex.html 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex.html 2017-01-15 20:05:20 UTC (rev 210780)
@@ -14,7 +14,7 @@
var i = 0;
debug((++i) + ") setting length to a negative length");
-shouldThrow("mySelect.options.length = -1;");
+mySelect.options.length = -1;
shouldBe("mySelect.options.length", "2");
shouldBe("mySelect.selectedIndex", "1");
Modified: trunk/LayoutTests/fast/forms/select-max-length-expected.txt (210779 => 210780)
--- trunk/LayoutTests/fast/forms/select-max-length-expected.txt 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/LayoutTests/fast/forms/select-max-length-expected.txt 2017-01-15 20:05:20 UTC (rev 210780)
@@ -1,10 +1,11 @@
+CONSOLE MESSAGE: line 18: Blocked attempt to expand the option list to 20000 items. The maximum number of items allowed is 10000.
This test that setting HTMLSelectElement.length is capped to 10,000, but that you can add additional Option elements by calling add.
Select length is 0
Trying: - sel.length = 20000;
-Select length is 10000
+Select length is 0
Trying: - sel.add(new Option, 0);
-Select length is 10001
+Select length is 1
Trying: - sel.length = 0;
Select length is 0
Modified: trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt (210779 => 210780)
--- trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt 2017-01-15 20:05:20 UTC (rev 210780)
@@ -516,19 +516,19 @@
DISPLAYABLE PROPERTIES:
0
+ length
selectedIndex
- length
__proto__
ALL PROPERTIES:
0
constructor
+ length
selectedIndex
- length
+ add
+ remove
item
namedItem
- add
- remove
toString
toLocaleString
valueOf
Modified: trunk/Source/WebCore/CMakeLists.txt (210779 => 210780)
--- trunk/Source/WebCore/CMakeLists.txt 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/CMakeLists.txt 2017-01-15 20:05:20 UTC (rev 210780)
@@ -1124,10 +1124,7 @@
bindings/js/JSHTMLElementCustom.cpp
bindings/js/JSHTMLEmbedElementCustom.cpp
bindings/js/JSHTMLFormControlsCollectionCustom.cpp
- bindings/js/JSHTMLFrameElementCustom.cpp
bindings/js/JSHTMLFrameSetElementCustom.cpp
- bindings/js/JSHTMLInputElementCustom.cpp
- bindings/js/JSHTMLMediaElementCustom.cpp
bindings/js/JSHTMLObjectElementCustom.cpp
bindings/js/JSHTMLOptionsCollectionCustom.cpp
bindings/js/JSHTMLSelectElementCustom.cpp
Modified: trunk/Source/WebCore/ChangeLog (210779 => 210780)
--- trunk/Source/WebCore/ChangeLog 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/ChangeLog 2017-01-15 20:05:20 UTC (rev 210780)
@@ -1,3 +1,54 @@
+2017-01-15 Sam Weinig <s...@webkit.org>
+
+ [WebIDL] Remove custom bindings for HTMLInputElement, HTMLFrameElement, HTMLMediaElement and HTMLOptionsCollection
+ https://bugs.webkit.org/show_bug.cgi?id=167039
+
+ Reviewed by Darin Adler.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSBindingsAllInOne.cpp:
+ * bindings/js/JSHTMLFrameElementCustom.cpp: Removed.
+ * bindings/js/JSHTMLInputElementCustom.cpp: Removed.
+ * bindings/js/JSHTMLMediaElementCustom.cpp: Removed.
+ Remove files.
+
+ * html/HTMLOptionsCollection.idl:
+ * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
+ (WebCore::JSHTMLOptionsCollection::setLength): Deleted.
+ Remove custom setLength. The bindings generator can handle this now.
+
+ * html/HTMLFrameElement.idl:
+ Resort to match spec. Replace custom annotation for location with SetterCallWith=ScriptState.
+
+ * html/HTMLFrameElementBase.cpp:
+ (WebCore::HTMLFrameElementBase::setLocation):
+ * html/HTMLFrameElementBase.h:
+ Add implementation of setLocation.
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::selectionStartForBindings):
+ (WebCore::HTMLInputElement::setSelectionStartForBindings):
+ (WebCore::HTMLInputElement::selectionEndForBindings):
+ (WebCore::HTMLInputElement::setSelectionEndForBindings):
+ (WebCore::HTMLInputElement::selectionDirectionForBindings):
+ (WebCore::HTMLInputElement::setSelectionDirectionForBindings):
+ (WebCore::HTMLInputElement::setSelectionRangeForBindings):
+ * html/HTMLInputElement.h:
+ * html/HTMLInputElement.idl:
+ Add variants of the selection properties that throw using the 'forBindings' suffix to differentiate.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::setControllerForBindings):
+ * html/HTMLMediaElement.h:
+ (WebCore::HTMLMediaElement::controllerForBindings):
+ * html/HTMLMediaElement.idl:
+ Add a variant of the controller property that unsets the media group, using the 'forBindings' suffix to differentiate.
+
+ * html/HTMLSelectElement.cpp:
+ (WebCore::HTMLSelectElement::setLength):
+ Match other implementations by ignoring attempts to set large lengths (> 10000) rather than clamping.
+
2017-01-15 Tim Horton <timothy_hor...@apple.com>
De-duplicate more (nearly) identical code in Editor(Mac|IOS).mm
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (210779 => 210780)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-01-15 20:05:20 UTC (rev 210780)
@@ -5211,7 +5211,6 @@
BC2CBF7B140F1D58003879BE /* JSWebGLContextEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2CBF7A140F1D58003879BE /* JSWebGLContextEvent.cpp */; };
BC2ED5550C6B9BD300920BFF /* JSElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */; };
BC2ED6BC0C6BD2F000920BFF /* JSAttrCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */; };
- BC2ED7A50C6C0F3600920BFF /* JSHTMLFrameElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2ED7A40C6C0F3600920BFF /* JSHTMLFrameElementCustom.cpp */; };
BC305C790C076BB300CD20F0 /* JSHTMLObjectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC305C770C076BB300CD20F0 /* JSHTMLObjectElement.cpp */; };
BC305C7A0C076BB300CD20F0 /* JSHTMLObjectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC305C780C076BB300CD20F0 /* JSHTMLObjectElement.h */; };
BC305CA40C0781BB00CD20F0 /* JSHTMLObjectElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC305CA30C0781BB00CD20F0 /* JSHTMLObjectElementCustom.cpp */; };
@@ -5445,7 +5444,6 @@
BCC0658A0F3CE2A700CD2D87 /* JSClientRectList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC065860F3CE2A700CD2D87 /* JSClientRectList.h */; };
BCC0E8751BFE70E9008F7F50 /* HTMLPictureElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC0E8731BFE70E9008F7F50 /* HTMLPictureElement.cpp */; };
BCC0E8761BFE70E9008F7F50 /* HTMLPictureElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC0E8741BFE70E9008F7F50 /* HTMLPictureElement.h */; };
- BCC438780E886CC700533DD5 /* JSHTMLInputElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC438770E886CC700533DD5 /* JSHTMLInputElementCustom.cpp */; };
BCC5BE000C0E93110011C2DB /* JSCSSStyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC5BDFE0C0E93110011C2DB /* JSCSSStyleSheet.cpp */; };
BCC5BE010C0E93110011C2DB /* JSCSSStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC5BDFF0C0E93110011C2DB /* JSCSSStyleSheet.h */; };
BCCBAD3B0C18BFF800CE890F /* JSHTMLCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCCBAD3A0C18BFF800CE890F /* JSHTMLCollectionCustom.cpp */; };
@@ -5864,7 +5862,6 @@
CDCD41E81C3DDB0A00965D99 /* ParsedContentRange.h in Headers */ = {isa = PBXBuildFile; fileRef = CDCD41E61C3DDB0900965D99 /* ParsedContentRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
CDCFABBD18C0AF78006F8450 /* SelectionSubtreeRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = CDCFABBB18C0AE31006F8450 /* SelectionSubtreeRoot.h */; settings = {ATTRIBUTES = (Private, ); }; };
CDCFABBE18C0AF84006F8450 /* SelectionSubtreeRoot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDCFABBC18C0AF19006F8450 /* SelectionSubtreeRoot.cpp */; };
- CDD525D7145B6DD0008D204D /* JSHTMLMediaElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDF65CCC145B6AFE00C4C7AA /* JSHTMLMediaElementCustom.cpp */; };
CDD7089618359F6F002B3DC6 /* SampleMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDD7089418359F6E002B3DC6 /* SampleMap.cpp */; };
CDD7089718359F6F002B3DC6 /* SampleMap.h in Headers */ = {isa = PBXBuildFile; fileRef = CDD7089518359F6F002B3DC6 /* SampleMap.h */; };
CDDC1E7A18A952F30027A9D4 /* MediaSourcePrivateClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CDDC1E7918A952F30027A9D4 /* MediaSourcePrivateClient.h */; };
@@ -13089,7 +13086,6 @@
BC2CBF7A140F1D58003879BE /* JSWebGLContextEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLContextEvent.cpp; sourceTree = "<group>"; };
BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSElementCustom.cpp; sourceTree = "<group>"; };
BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAttrCustom.cpp; sourceTree = "<group>"; };
- BC2ED7A40C6C0F3600920BFF /* JSHTMLFrameElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFrameElementCustom.cpp; sourceTree = "<group>"; };
BC305C770C076BB300CD20F0 /* JSHTMLObjectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLObjectElement.cpp; sourceTree = "<group>"; };
BC305C780C076BB300CD20F0 /* JSHTMLObjectElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLObjectElement.h; sourceTree = "<group>"; };
BC305CA30C0781BB00CD20F0 /* JSHTMLObjectElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLObjectElementCustom.cpp; sourceTree = "<group>"; };
@@ -13347,7 +13343,6 @@
BCC065860F3CE2A700CD2D87 /* JSClientRectList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSClientRectList.h; sourceTree = "<group>"; };
BCC0E8731BFE70E9008F7F50 /* HTMLPictureElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLPictureElement.cpp; sourceTree = "<group>"; };
BCC0E8741BFE70E9008F7F50 /* HTMLPictureElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLPictureElement.h; sourceTree = "<group>"; };
- BCC438770E886CC700533DD5 /* JSHTMLInputElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLInputElementCustom.cpp; sourceTree = "<group>"; };
BCC5BDFE0C0E93110011C2DB /* JSCSSStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSStyleSheet.cpp; sourceTree = "<group>"; };
BCC5BDFF0C0E93110011C2DB /* JSCSSStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSStyleSheet.h; sourceTree = "<group>"; };
BCC8CFCA0986CD2400140BF2 /* ColorData.gperf */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ColorData.gperf; sourceTree = "<group>"; };
@@ -13895,7 +13890,6 @@
CDF4B72D1E03CA4A00E235A2 /* JSMockCDMFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMockCDMFactory.cpp; sourceTree = "<group>"; };
CDF4B72E1E03CA4A00E235A2 /* JSMockCDMFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMockCDMFactory.h; sourceTree = "<group>"; };
CDF65CC9145B43A700C4C7AA /* MediaControllerInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaControllerInterface.h; sourceTree = "<group>"; };
- CDF65CCC145B6AFE00C4C7AA /* JSHTMLMediaElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLMediaElementCustom.cpp; sourceTree = "<group>"; };
CDF7483C18FEBCEC0006ECC0 /* GridPositionsResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GridPositionsResolver.cpp; sourceTree = "<group>"; };
CDF7483D18FEBCEC0006ECC0 /* GridPositionsResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GridPositionsResolver.h; sourceTree = "<group>"; };
CDFC360118CA61630026E56F /* RemoteCommandListenerIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteCommandListenerIOS.h; sourceTree = "<group>"; };
@@ -22129,10 +22123,7 @@
BC5823F40C0A98DF0053F1B5 /* JSHTMLElementCustom.cpp */,
BC6D44BD0C07EFB60072D2C9 /* JSHTMLEmbedElementCustom.cpp */,
9B1AB07B1648C7C40051F3F2 /* JSHTMLFormControlsCollectionCustom.cpp */,
- BC2ED7A40C6C0F3600920BFF /* JSHTMLFrameElementCustom.cpp */,
BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */,
- BCC438770E886CC700533DD5 /* JSHTMLInputElementCustom.cpp */,
- CDF65CCC145B6AFE00C4C7AA /* JSHTMLMediaElementCustom.cpp */,
BC305CA30C0781BB00CD20F0 /* JSHTMLObjectElementCustom.cpp */,
448AD27A0A4813790023D179 /* JSHTMLOptionsCollectionCustom.cpp */,
BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */,
@@ -30023,7 +30014,6 @@
9B1AB07C1648C7C40051F3F2 /* JSHTMLFormControlsCollectionCustom.cpp in Sources */,
A8D064FB0A23C0CC005E7203 /* JSHTMLFormElement.cpp in Sources */,
BC4918C60BFEA050009D6316 /* JSHTMLFrameElement.cpp in Sources */,
- BC2ED7A50C6C0F3600920BFF /* JSHTMLFrameElementCustom.cpp in Sources */,
BC926F800C0552470082776B /* JSHTMLFrameSetElement.cpp in Sources */,
BCD41ABB0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp in Sources */,
A80E7B140A19D606007FB8C5 /* JSHTMLHeadElement.cpp in Sources */,
@@ -30034,7 +30024,6 @@
BC4918C80BFEA050009D6316 /* JSHTMLIFrameElement.cpp in Sources */,
1AE2AA970A1CDD2D00B42B25 /* JSHTMLImageElement.cpp in Sources */,
A80E7E980A1A83E3007FB8C5 /* JSHTMLInputElement.cpp in Sources */,
- BCC438780E886CC700533DD5 /* JSHTMLInputElementCustom.cpp in Sources */,
A6148A7812E41E3B0044A784 /* JSHTMLKeygenElement.cpp in Sources */,
1AE2AB210A1CE63B00B42B25 /* JSHTMLLabelElement.cpp in Sources */,
1AE2AB230A1CE63B00B42B25 /* JSHTMLLegendElement.cpp in Sources */,
@@ -30043,7 +30032,6 @@
1AE2AB270A1CE63B00B42B25 /* JSHTMLMapElement.cpp in Sources */,
BC491B780C023EFD009D6316 /* JSHTMLMarqueeElement.cpp in Sources */,
E44614390CD689C700FADA75 /* JSHTMLMediaElement.cpp in Sources */,
- CDD525D7145B6DD0008D204D /* JSHTMLMediaElementCustom.cpp in Sources */,
1AE2AE5B0A1D26F200B42B25 /* JSHTMLMenuElement.cpp in Sources */,
A80E7A170A19C3D6007FB8C5 /* JSHTMLMetaElement.cpp in Sources */,
A7BBE26611AFB3F20005EA03 /* JSHTMLMeterElement.cpp in Sources */,
Modified: trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (210779 => 210780)
--- trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp 2017-01-15 20:05:20 UTC (rev 210780)
@@ -72,10 +72,7 @@
#include "JSHTMLElementCustom.cpp"
#include "JSHTMLEmbedElementCustom.cpp"
#include "JSHTMLFormControlsCollectionCustom.cpp"
-#include "JSHTMLFrameElementCustom.cpp"
#include "JSHTMLFrameSetElementCustom.cpp"
-#include "JSHTMLInputElementCustom.cpp"
-#include "JSHTMLMediaElementCustom.cpp"
#include "JSHTMLObjectElementCustom.cpp"
#include "JSHTMLOptionsCollectionCustom.cpp"
#include "JSHTMLSelectElementCustom.cpp"
Deleted: trunk/Source/WebCore/bindings/js/JSHTMLFrameElementCustom.cpp (210779 => 210780)
--- trunk/Source/WebCore/bindings/js/JSHTMLFrameElementCustom.cpp 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/bindings/js/JSHTMLFrameElementCustom.cpp 2017-01-15 20:05:20 UTC (rev 210780)
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSHTMLFrameElement.h"
-
-#include "Document.h"
-#include "HTMLFrameElement.h"
-#include "HTMLParserIdioms.h"
-#include "JSDOMBinding.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-void JSHTMLFrameElement::setLocation(ExecState& state, JSValue value)
-{
- HTMLFrameElement& element = wrapped();
- String locationValue = value.isNull() ? String() : value.toWTFString(&state);
- if (protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(locationValue))) {
- if (!BindingSecurity::shouldAllowAccessToNode(state, element.contentDocument()))
- return;
- }
- element.setLocation(locationValue);
-}
-
-} // namespace WebCore
Deleted: trunk/Source/WebCore/bindings/js/JSHTMLInputElementCustom.cpp (210779 => 210780)
--- trunk/Source/WebCore/bindings/js/JSHTMLInputElementCustom.cpp 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/bindings/js/JSHTMLInputElementCustom.cpp 2017-01-15 20:05:20 UTC (rev 210780)
@@ -1,130 +0,0 @@
-/*
- * Copyright (C) 2008, 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSHTMLInputElement.h"
-
-#include "HTMLInputElement.h"
-#include <runtime/Error.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSHTMLInputElement::selectionStart(ExecState& state) const
-{
- VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- HTMLInputElement& input = wrapped();
- if (!input.canHaveSelection())
- return throwTypeError(&state, scope);
-
- return jsNumber(input.selectionStart());
-}
-
-void JSHTMLInputElement::setSelectionStart(ExecState& state, JSValue value)
-{
- VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- HTMLInputElement& input = wrapped();
- if (!input.canHaveSelection())
- throwTypeError(&state, scope);
-
- input.setSelectionStart(value.toInt32(&state));
-}
-
-JSValue JSHTMLInputElement::selectionEnd(ExecState& state) const
-{
- VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- HTMLInputElement& input = wrapped();
- if (!input.canHaveSelection())
- return throwTypeError(&state, scope);
-
- return jsNumber(input.selectionEnd());
-}
-
-void JSHTMLInputElement::setSelectionEnd(ExecState& state, JSValue value)
-{
- VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- HTMLInputElement& input = wrapped();
- if (!input.canHaveSelection())
- throwTypeError(&state, scope);
-
- input.setSelectionEnd(value.toInt32(&state));
-}
-
-JSValue JSHTMLInputElement::selectionDirection(ExecState& state) const
-{
- VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- HTMLInputElement& input = wrapped();
- if (!input.canHaveSelection())
- return throwTypeError(&state, scope);
-
- return jsStringWithCache(&state, input.selectionDirection());
-}
-
-void JSHTMLInputElement::setSelectionDirection(ExecState& state, JSValue value)
-{
- VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- HTMLInputElement& input = wrapped();
- if (!input.canHaveSelection()) {
- throwTypeError(&state, scope);
- return;
- }
-
- input.setSelectionDirection(value.toWTFString(&state));
-}
-
-JSValue JSHTMLInputElement::setSelectionRange(ExecState& state)
-{
- VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- if (UNLIKELY(state.argumentCount() < 2))
- return throwException(&state, scope, createNotEnoughArgumentsError(&state));
-
- HTMLInputElement& input = wrapped();
- if (!input.canHaveSelection())
- return throwTypeError(&state, scope);
-
- int start = state.uncheckedArgument(0).toInt32(&state);
- int end = state.uncheckedArgument(1).toInt32(&state);
- String direction = state.argument(2).toWTFString(&state);
-
- input.setSelectionRange(start, end, direction);
- return jsUndefined();
-}
-
-} // namespace WebCore
Deleted: trunk/Source/WebCore/bindings/js/JSHTMLMediaElementCustom.cpp (210779 => 210780)
--- trunk/Source/WebCore/bindings/js/JSHTMLMediaElementCustom.cpp 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/bindings/js/JSHTMLMediaElementCustom.cpp 2017-01-15 20:05:20 UTC (rev 210780)
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#if ENABLE(VIDEO)
-
-#include "JSHTMLMediaElement.h"
-
-#include "JSMediaController.h"
-
-namespace WebCore {
-
-using namespace JSC;
-
-void JSHTMLMediaElement::setController(ExecState&, JSValue value)
-{
- // 4.8.10.11.2 Media controllers: controller attribute.
- // On setting, it must first remove the element's mediagroup attribute, if any,
- wrapped().setMediaGroup(String());
- // and then set the current media controller to the given value.
- wrapped().setController(JSMediaController::toWrapped(value));
-}
-
-}
-#endif
Modified: trunk/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp (210779 => 210780)
--- trunk/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp 2017-01-15 20:05:20 UTC (rev 210780)
@@ -31,23 +31,6 @@
namespace WebCore {
-void JSHTMLOptionsCollection::setLength(ExecState& state, JSValue value)
-{
- CustomElementReactionStack customElementReactionStack;
- VM& vm = state.vm();
- auto throwScope = DECLARE_THROW_SCOPE(vm);
- double number = value.toNumber(&state);
- RETURN_IF_EXCEPTION(throwScope, void());
- unsigned length;
- if (!std::isfinite(number))
- length = 0;
- else if (number < 0)
- return throwIndexSizeError(state, throwScope);
- else
- length = static_cast<unsigned>(std::min<double>(number, UINT_MAX));
- propagateException(state, throwScope, wrapped().setLength(length));
-}
-
void JSHTMLOptionsCollection::indexSetter(ExecState* state, unsigned index, JSValue value)
{
CustomElementReactionStack customElementReactionStack;
Modified: trunk/Source/WebCore/html/HTMLFrameElement.idl (210779 => 210780)
--- trunk/Source/WebCore/html/HTMLFrameElement.idl 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/html/HTMLFrameElement.idl 2017-01-15 20:05:20 UTC (rev 210780)
@@ -19,26 +19,23 @@
*/
interface HTMLFrameElement : HTMLElement {
+ [Reflect] attribute DOMString name;
+ [Reflect] attribute DOMString scrolling;
+ [Reflect, URL] attribute USVString src;
[Reflect] attribute DOMString frameBorder;
[Reflect, URL] attribute USVString longDesc;
+ [Reflect] attribute boolean noResize;
+ [CheckSecurityForNode] readonly attribute Document contentDocument;
+ readonly attribute DOMWindow contentWindow;
[Reflect, TreatNullAs=EmptyString] attribute DOMString marginHeight;
[Reflect, TreatNullAs=EmptyString] attribute DOMString marginWidth;
- [Reflect] attribute DOMString name;
- [Reflect] attribute boolean noResize;
- [Reflect] attribute DOMString scrolling;
- [Reflect, URL] attribute USVString src;
-
- [CheckSecurityForNode] readonly attribute Document contentDocument;
-
- readonly attribute DOMWindow contentWindow;
-
[CheckSecurityForNode, MayThrowException] Document getSVGDocument();
- // FIXME: No other browser has this attribute.
- [CustomSetter] attribute DOMString location;
-
readonly attribute long width;
readonly attribute long height;
+
+ // FIXME: No other browser has this attribute.
+ [SetterCallWith=ScriptState] attribute DOMString? location;
};
Modified: trunk/Source/WebCore/html/HTMLFrameElementBase.cpp (210779 => 210780)
--- trunk/Source/WebCore/html/HTMLFrameElementBase.cpp 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/html/HTMLFrameElementBase.cpp 2017-01-15 20:05:20 UTC (rev 210780)
@@ -32,12 +32,13 @@
#include "FrameView.h"
#include "HTMLNames.h"
#include "HTMLParserIdioms.h"
-#include "URL.h"
+#include "JSDOMBinding.h"
#include "Page.h"
#include "RenderWidget.h"
#include "ScriptController.h"
#include "Settings.h"
#include "SubframeLoader.h"
+#include "URL.h"
namespace WebCore {
@@ -184,6 +185,16 @@
openURL(LockHistory::No, LockBackForwardList::No);
}
+void HTMLFrameElementBase::setLocation(JSC::ExecState& state, const String& newLocation)
+{
+ if (protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(newLocation))) {
+ if (!BindingSecurity::shouldAllowAccessToNode(state, contentDocument()))
+ return;
+ }
+
+ setLocation(newLocation);
+}
+
bool HTMLFrameElementBase::supportsFocus() const
{
return true;
Modified: trunk/Source/WebCore/html/HTMLFrameElementBase.h (210779 => 210780)
--- trunk/Source/WebCore/html/HTMLFrameElementBase.h 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/html/HTMLFrameElementBase.h 2017-01-15 20:05:20 UTC (rev 210780)
@@ -26,6 +26,10 @@
#include "FrameLoaderTypes.h"
#include "HTMLFrameOwnerElement.h"
+namespace JSC {
+class ExecState;
+}
+
namespace WebCore {
class HTMLFrameElementBase : public HTMLFrameOwnerElement {
@@ -32,6 +36,7 @@
public:
WEBCORE_EXPORT URL location() const;
WEBCORE_EXPORT void setLocation(const String&);
+ void setLocation(JSC::ExecState&, const String&);
ScrollbarMode scrollingMode() const final { return m_scrolling; }
Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (210779 => 210780)
--- trunk/Source/WebCore/html/HTMLInputElement.cpp 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp 2017-01-15 20:05:20 UTC (rev 210780)
@@ -1943,6 +1943,66 @@
return document().focusedElement() != this && style.textOverflow() == TextOverflowEllipsis;
}
+ExceptionOr<int> HTMLInputElement::selectionStartForBindings() const
+{
+ if (!canHaveSelection())
+ return Exception { TypeError };
+
+ return selectionStart();
+}
+
+ExceptionOr<void> HTMLInputElement::setSelectionStartForBindings(int start)
+{
+ if (!canHaveSelection())
+ return Exception { TypeError };
+
+ setSelectionStart(start);
+ return { };
+}
+
+ExceptionOr<int> HTMLInputElement::selectionEndForBindings() const
+{
+ if (!canHaveSelection())
+ return Exception { TypeError };
+
+ return selectionEnd();
+}
+
+ExceptionOr<void> HTMLInputElement::setSelectionEndForBindings(int end)
+{
+ if (!canHaveSelection())
+ return Exception { TypeError };
+
+ setSelectionEnd(end);
+ return { };
+}
+
+ExceptionOr<String> HTMLInputElement::selectionDirectionForBindings() const
+{
+ if (!canHaveSelection())
+ return Exception { TypeError };
+
+ return String { selectionDirection() };
+}
+
+ExceptionOr<void> HTMLInputElement::setSelectionDirectionForBindings(const String& direction)
+{
+ if (!canHaveSelection())
+ return Exception { TypeError };
+
+ setSelectionDirection(direction);
+ return { };
+}
+
+ExceptionOr<void> HTMLInputElement::setSelectionRangeForBindings(int start, int end, const String& direction)
+{
+ if (!canHaveSelection())
+ return Exception { TypeError };
+
+ setSelectionRange(start, end, direction);
+ return { };
+}
+
RenderStyle HTMLInputElement::createInnerTextStyle(const RenderStyle& style) const
{
auto textBlockStyle = RenderStyle::create();
Modified: trunk/Source/WebCore/html/HTMLInputElement.h (210779 => 210780)
--- trunk/Source/WebCore/html/HTMLInputElement.h 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/html/HTMLInputElement.h 2017-01-15 20:05:20 UTC (rev 210780)
@@ -323,6 +323,17 @@
bool shouldTruncateText(const RenderStyle&) const;
+ ExceptionOr<int> selectionStartForBindings() const;
+ ExceptionOr<void> setSelectionStartForBindings(int);
+
+ ExceptionOr<int> selectionEndForBindings() const;
+ ExceptionOr<void> setSelectionEndForBindings(int);
+
+ ExceptionOr<String> selectionDirectionForBindings() const;
+ ExceptionOr<void> setSelectionDirectionForBindings(const String&);
+
+ ExceptionOr<void> setSelectionRangeForBindings(int start, int end, const String& direction);
+
protected:
HTMLInputElement(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser);
Modified: trunk/Source/WebCore/html/HTMLInputElement.idl (210779 => 210780)
--- trunk/Source/WebCore/html/HTMLInputElement.idl 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/html/HTMLInputElement.idl 2017-01-15 20:05:20 UTC (rev 210780)
@@ -77,14 +77,14 @@
readonly attribute NodeList labels;
void select();
- [Custom] attribute long selectionStart;
- [Custom] attribute long selectionEnd;
- [Custom] attribute DOMString selectionDirection;
+ [ImplementedAs=selectionStartForBindings, GetterMayThrowException, SetterMayThrowException] attribute long selectionStart;
+ [ImplementedAs=selectionEndForBindings, GetterMayThrowException, SetterMayThrowException] attribute long selectionEnd;
+ [ImplementedAs=selectionDirectionForBindings, GetterMayThrowException, SetterMayThrowException] attribute DOMString selectionDirection;
[MayThrowException] void setRangeText(DOMString replacement);
[MayThrowException] void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional DOMString selectionMode);
- [Custom] void setSelectionRange(long start, long end, optional DOMString direction);
+ [ImplementedAs=setSelectionRangeForBindings, MayThrowException] void setSelectionRange(long start, long end, optional DOMString direction);
[Reflect] attribute DOMString align;
[Reflect] attribute DOMString useMap;
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (210779 => 210780)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2017-01-15 20:05:20 UTC (rev 210780)
@@ -6100,6 +6100,15 @@
mediaControls()->setMediaController(m_mediaController ? m_mediaController.get() : static_cast<MediaControllerInterface*>(this));
}
+void HTMLMediaElement::setControllerForBindings(MediaController* controller)
+{
+ // 4.8.10.11.2 Media controllers: controller attribute.
+ // On setting, it must first remove the element's mediagroup attribute, if any,
+ setMediaGroup({ });
+ // and then set the current media controller to the given value.
+ setController(controller);
+}
+
void HTMLMediaElement::updateMediaController()
{
if (m_mediaController)
Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (210779 => 210780)
--- trunk/Source/WebCore/html/HTMLMediaElement.h 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h 2017-01-15 20:05:20 UTC (rev 210780)
@@ -421,6 +421,9 @@
MediaController* controller() const;
void setController(RefPtr<MediaController>&&);
+ MediaController* controllerForBindings() const { return controller(); }
+ void setControllerForBindings(MediaController*);
+
void enteredOrExitedFullscreen() { configureMediaControls(); }
unsigned long long fileSize() const;
Modified: trunk/Source/WebCore/html/HTMLMediaElement.idl (210779 => 210780)
--- trunk/Source/WebCore/html/HTMLMediaElement.idl 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/html/HTMLMediaElement.idl 2017-01-15 20:05:20 UTC (rev 210780)
@@ -105,7 +105,7 @@
[Reflect] attribute DOMString mediaGroup;
- [CustomSetter] attribute MediaController controller;
+ [ImplementedAs=controllerForBindings] attribute MediaController? controller;
[Conditional=MEDIA_SOURCE] VideoPlaybackQuality getVideoPlaybackQuality();
Modified: trunk/Source/WebCore/html/HTMLOptionsCollection.idl (210779 => 210780)
--- trunk/Source/WebCore/html/HTMLOptionsCollection.idl 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/html/HTMLOptionsCollection.idl 2017-01-15 20:05:20 UTC (rev 210780)
@@ -24,16 +24,15 @@
GenerateIsReachable=ImplOwnerNodeRoot,
JSGenerateToNativeObject,
] interface HTMLOptionsCollection : HTMLCollection {
+ [CEReactions, SetterMayThrowException] attribute unsigned long length;
+ // [CEReactions] setter void (unsigned long index, HTMLOptionElement? option);
+ [CEReactions, MayThrowException] void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
+ [CEReactions] void remove(long index);
+ [CEReactions] void remove(HTMLOptionElement option); // FIXME: This overload is not in the specification and has been dropped from Blink.
+
attribute long selectedIndex;
- [CEReactions, CustomSetter, SetterMayThrowException] attribute unsigned long length;
+ // FIXME: Can these just be inherited from HTMLCollection like in the spec?
getter HTMLOptionElement? item(unsigned long index);
getter HTMLOptionElement? namedItem(DOMString name);
-
- [CEReactions, MayThrowException] void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
-
- [CEReactions] void remove(long index);
-
- // FIXME: This overload is not in the specification and has been dropped from Blink.
- [CEReactions] void remove(HTMLOptionElement option);
};
Modified: trunk/Source/WebCore/html/HTMLSelectElement.cpp (210779 => 210780)
--- trunk/Source/WebCore/html/HTMLSelectElement.cpp 2017-01-15 19:39:39 UTC (rev 210779)
+++ trunk/Source/WebCore/html/HTMLSelectElement.cpp 2017-01-15 20:05:20 UTC (rev 210780)
@@ -462,8 +462,10 @@
ExceptionOr<void> HTMLSelectElement::setLength(unsigned newLength)
{
- if (newLength > maxSelectItems)
- newLength = maxSelectItems;
+ if (newLength > length() && newLength > maxSelectItems) {
+ document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, String::format("Blocked attempt to expand the option list to %u items. The maximum number of items allowed is %u.", newLength, maxSelectItems));
+ return { };
+ }
int diff = length() - newLength;