Modified: trunk/LayoutTests/ChangeLog (203233 => 203234)
--- trunk/LayoutTests/ChangeLog 2016-07-14 19:29:13 UTC (rev 203233)
+++ trunk/LayoutTests/ChangeLog 2016-07-14 19:30:09 UTC (rev 203234)
@@ -1,3 +1,13 @@
+2016-07-14 Youenn Fablet <[email protected]>
+
+ Remove support for value iterators from JSDOMIterator
+ https://bugs.webkit.org/show_bug.cgi?id=159293
+
+ Reviewed by Chris Dumez.
+
+ * fast/text/font-face-set-_javascript_-expected.txt:
+ * fast/text/font-face-set-_javascript_.html:
+
2016-07-14 Ryan Haddad <[email protected]>
Land test expectations for rdar://problem/27353750.
Modified: trunk/LayoutTests/fast/text/font-face-set-_javascript_-expected.txt (203233 => 203234)
--- trunk/LayoutTests/fast/text/font-face-set-_javascript_-expected.txt 2016-07-14 19:29:13 UTC (rev 203233)
+++ trunk/LayoutTests/fast/text/font-face-set-_javascript_-expected.txt 2016-07-14 19:30:09 UTC (rev 203234)
@@ -4,7 +4,7 @@
PASS fontFaceSet.status is "loaded"
PASS item.done is false
PASS item.value.length is 2
-PASS item.value[0] is 0
+PASS item.value[0] is fontFace1
PASS item.value[1] is fontFace1
PASS item.done is true
PASS item.value is undefined
@@ -14,6 +14,8 @@
PASS item.done is false
PASS item.value is fontFace1
PASS item.done is true
+PASS fontFaceSet is set
+PASS value1 is value2
PASS fontFaceSet.add(fontFace2) is fontFaceSet
PASS fontFaceSet.size is 2
PASS fontFaceSet.add(null) threw exception TypeError: Argument 1 ('font') to FontFaceSet.add must be an instance of FontFace.
Modified: trunk/LayoutTests/fast/text/font-face-set-_javascript_.html (203233 => 203234)
--- trunk/LayoutTests/fast/text/font-face-set-_javascript_.html 2016-07-14 19:29:13 UTC (rev 203233)
+++ trunk/LayoutTests/fast/text/font-face-set-_javascript_.html 2016-07-14 19:30:09 UTC (rev 203234)
@@ -24,7 +24,7 @@
var item = iterator.next();
shouldBeFalse("item.done");
shouldBe("item.value.length", "2");
-shouldBe("item.value[0]", "0");
+shouldBe("item.value[0]", "fontFace1");
shouldBe("item.value[1]", "fontFace1");
item = iterator.next();
shouldBeTrue("item.done");
@@ -44,6 +44,15 @@
item = iterator.next();
shouldBeTrue("item.done");
+var value1, value2, set;
+fontFaceSet.forEach(function(v1, v2, s){
+ value1 = v1;
+ value2 = v2;
+ set = s;
+ shouldBe("fontFaceSet", "set");
+ shouldBe("value1", "value2");
+});
+
shouldBe("fontFaceSet.add(fontFace2)", "fontFaceSet");
shouldBe("fontFaceSet.size", "2");
Modified: trunk/Source/WebCore/ChangeLog (203233 => 203234)
--- trunk/Source/WebCore/ChangeLog 2016-07-14 19:29:13 UTC (rev 203233)
+++ trunk/Source/WebCore/ChangeLog 2016-07-14 19:30:09 UTC (rev 203234)
@@ -1,3 +1,22 @@
+2016-07-14 Youenn Fablet <[email protected]>
+
+ Remove support for value iterators from JSDOMIterator
+ https://bugs.webkit.org/show_bug.cgi?id=159293
+
+ Reviewed by Chris Dumez.
+
+ Value iterators are now handled without using DOMIterator.
+ Since FontFaceSet is using DOMIterator as an intermediate step towards supporting set-like,
+ entries and forEach implementation should be made compliant with set-like.
+ This means that item value should be passed instead of an index in entries iterator and forEach callback.
+
+ Covered by updated test.
+
+ * bindings/js/JSDOMIterator.h:
+ (WebCore::JSDOMIterator<JSWrapper>::asJS): Pass set item as entries value field.
+ (WebCore::appendForEachArguments): Pass set item as second parameter.
+ (WebCore::iteratorForEach): Remove index handling.
+
2016-07-14 Csaba Osztrogonác <[email protected]>
Fix the !ENABLE(MATHML) build after r201739
Modified: trunk/Source/WebCore/bindings/js/JSDOMIterator.h (203233 => 203234)
--- trunk/Source/WebCore/bindings/js/JSDOMIterator.h 2016-07-14 19:29:13 UTC (rev 203233)
+++ trunk/Source/WebCore/bindings/js/JSDOMIterator.h 2016-07-14 19:30:09 UTC (rev 203234)
@@ -119,7 +119,6 @@
Optional<typename DOMWrapped::Iterator> m_iterator;
IterationKind m_kind;
- size_t m_index { 0 };
};
template<typename JSWrapper>
@@ -157,11 +156,11 @@
if (m_kind != IterationKind::KeyValue)
return result;
- return jsPair(state, globalObject(), JSC::jsNumber(m_index++), result);
+ return jsPair(state, globalObject(), result, result);
}
template<typename IteratorValue> typename std::enable_if<IteratorInspector<IteratorValue>::isMap, void>::type
-appendForEachArguments(JSC::ExecState& state, JSDOMGlobalObject* globalObject, JSC::MarkedArgumentBuffer& arguments, IteratorValue& value, size_t&)
+appendForEachArguments(JSC::ExecState& state, JSDOMGlobalObject* globalObject, JSC::MarkedArgumentBuffer& arguments, IteratorValue& value)
{
ASSERT(value);
arguments.append(toJS(&state, globalObject, value->value));
@@ -169,12 +168,12 @@
}
template<typename IteratorValue> typename std::enable_if<IteratorInspector<IteratorValue>::isSet, void>::type
-appendForEachArguments(JSC::ExecState& state, JSDOMGlobalObject* globalObject, JSC::MarkedArgumentBuffer& arguments, IteratorValue& value, size_t& index)
+appendForEachArguments(JSC::ExecState& state, JSDOMGlobalObject* globalObject, JSC::MarkedArgumentBuffer& arguments, IteratorValue& value)
{
ASSERT(value);
JSC::JSValue argument = toJS(&state, globalObject, *value);
arguments.append(argument);
- arguments.append(JSC::jsNumber(index++));
+ arguments.append(argument);
}
template<typename JSWrapper>
@@ -192,11 +191,10 @@
if (callType == JSC::CallType::None)
return throwVMTypeError(&state);
- size_t index = 0;
auto iterator = wrapper->wrapped().createIterator();
while (auto value = iterator.next()) {
JSC::MarkedArgumentBuffer arguments;
- appendForEachArguments(state, wrapper->globalObject(), arguments, value, index);
+ appendForEachArguments(state, wrapper->globalObject(), arguments, value);
arguments.append(wrapper);
JSC::call(&state, callback, callType, callData, thisValue, arguments);
if (state.hadException())