Make CachedResourceLoader originsMatch check more efficient
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-10-26  Youenn Fablet  <youenn@apple.com>
2
3         Make CachedResourceLoader originsMatch check more efficient
4         https://bugs.webkit.org/show_bug.cgi?id=163938
5
6         Reviewed by Darin Adler.
7
8         No change of behavior.
9
10         * loader/cache/CachedResourceLoader.cpp:
11         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
12         (WebCore::originsMatch): Moved to SecurityOrigin.cpp.
13         * page/SecurityOrigin.cpp:
14         (WebCore::areOriginsMatching): Helper routine to check whether origins are matching.
15         (WebCore::originsMatch): Ensuring string comparison provides the same result as this function.
16         * page/SecurityOrigin.h:
17         (WebCore::SecurityOrigin::protocol):
18         (WebCore::SecurityOrigin::host):
19         (WebCore::SecurityOrigin::domain):
20
21 2016-10-25  Yusuke Suzuki  <utatane.tea@gmail.com>
22
23         [DOMJIT] Tell IDL result type to DFG to drop type checks in AI
24         https://bugs.webkit.org/show_bug.cgi?id=163900
25
26         Reviewed by Sam Weinig.
27
28         Add TestDOMJIT.idl for bindings generation tests.
29
30         * bindings/scripts/CodeGeneratorJS.pm:
31         (GetResultTypeFilter):
32         (GenerateImplementation):
33         * bindings/scripts/test/JS/JSTestDOMJIT.cpp: Added.
34         (WebCore::JSTestDOMJITPrototype::create):
35         (WebCore::JSTestDOMJITPrototype::createStructure):
36         (WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
37         (WebCore::JSTestDOMJITConstructor::prototypeForStructure):
38         (WebCore::JSTestDOMJITConstructor::initializeProperties):
39         (WebCore::JSTestDOMJITPrototype::finishCreation):
40         (WebCore::JSTestDOMJIT::JSTestDOMJIT):
41         (WebCore::JSTestDOMJIT::createPrototype):
42         (WebCore::JSTestDOMJIT::prototype):
43         (WebCore::BindingCaller<JSTestDOMJIT>::castForAttribute):
44         (WebCore::jsTestDOMJITAnyAttr):
45         (WebCore::jsTestDOMJITAnyAttrGetter):
46         (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT):
47         (WebCore::domJITGetterSetterForTestDOMJITAnyAttr):
48         (WebCore::jsTestDOMJITBooleanAttr):
49         (WebCore::jsTestDOMJITBooleanAttrGetter):
50         (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT):
51         (WebCore::domJITGetterSetterForTestDOMJITBooleanAttr):
52         (WebCore::jsTestDOMJITByteAttr):
53         (WebCore::jsTestDOMJITByteAttrGetter):
54         (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT):
55         (WebCore::domJITGetterSetterForTestDOMJITByteAttr):
56         (WebCore::jsTestDOMJITOctetAttr):
57         (WebCore::jsTestDOMJITOctetAttrGetter):
58         (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT):
59         (WebCore::domJITGetterSetterForTestDOMJITOctetAttr):
60         (WebCore::jsTestDOMJITShortAttr):
61         (WebCore::jsTestDOMJITShortAttrGetter):
62         (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT):
63         (WebCore::domJITGetterSetterForTestDOMJITShortAttr):
64         (WebCore::jsTestDOMJITUnsignedShortAttr):
65         (WebCore::jsTestDOMJITUnsignedShortAttrGetter):
66         (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT):
67         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr):
68         (WebCore::jsTestDOMJITLongAttr):
69         (WebCore::jsTestDOMJITLongAttrGetter):
70         (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT):
71         (WebCore::domJITGetterSetterForTestDOMJITLongAttr):
72         (WebCore::jsTestDOMJITUnsignedLongAttr):
73         (WebCore::jsTestDOMJITUnsignedLongAttrGetter):
74         (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT):
75         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr):
76         (WebCore::jsTestDOMJITLongLongAttr):
77         (WebCore::jsTestDOMJITLongLongAttrGetter):
78         (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT):
79         (WebCore::domJITGetterSetterForTestDOMJITLongLongAttr):
80         (WebCore::jsTestDOMJITUnsignedLongLongAttr):
81         (WebCore::jsTestDOMJITUnsignedLongLongAttrGetter):
82         (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT):
83         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr):
84         (WebCore::jsTestDOMJITFloatAttr):
85         (WebCore::jsTestDOMJITFloatAttrGetter):
86         (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT):
87         (WebCore::domJITGetterSetterForTestDOMJITFloatAttr):
88         (WebCore::jsTestDOMJITUnrestrictedFloatAttr):
89         (WebCore::jsTestDOMJITUnrestrictedFloatAttrGetter):
90         (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT):
91         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr):
92         (WebCore::jsTestDOMJITDoubleAttr):
93         (WebCore::jsTestDOMJITDoubleAttrGetter):
94         (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT):
95         (WebCore::domJITGetterSetterForTestDOMJITDoubleAttr):
96         (WebCore::jsTestDOMJITUnrestrictedDoubleAttr):
97         (WebCore::jsTestDOMJITUnrestrictedDoubleAttrGetter):
98         (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT):
99         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr):
100         (WebCore::jsTestDOMJITDomStringAttr):
101         (WebCore::jsTestDOMJITDomStringAttrGetter):
102         (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT):
103         (WebCore::domJITGetterSetterForTestDOMJITDomStringAttr):
104         (WebCore::jsTestDOMJITByteStringAttr):
105         (WebCore::jsTestDOMJITByteStringAttrGetter):
106         (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT):
107         (WebCore::domJITGetterSetterForTestDOMJITByteStringAttr):
108         (WebCore::jsTestDOMJITUsvStringAttr):
109         (WebCore::jsTestDOMJITUsvStringAttrGetter):
110         (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT):
111         (WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr):
112         (WebCore::jsTestDOMJITNodeAttr):
113         (WebCore::jsTestDOMJITNodeAttrGetter):
114         (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT):
115         (WebCore::domJITGetterSetterForTestDOMJITNodeAttr):
116         (WebCore::jsTestDOMJITBooleanNullableAttr):
117         (WebCore::jsTestDOMJITBooleanNullableAttrGetter):
118         (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT):
119         (WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr):
120         (WebCore::jsTestDOMJITByteNullableAttr):
121         (WebCore::jsTestDOMJITByteNullableAttrGetter):
122         (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT):
123         (WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr):
124         (WebCore::jsTestDOMJITOctetNullableAttr):
125         (WebCore::jsTestDOMJITOctetNullableAttrGetter):
126         (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT):
127         (WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr):
128         (WebCore::jsTestDOMJITShortNullableAttr):
129         (WebCore::jsTestDOMJITShortNullableAttrGetter):
130         (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT):
131         (WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr):
132         (WebCore::jsTestDOMJITUnsignedShortNullableAttr):
133         (WebCore::jsTestDOMJITUnsignedShortNullableAttrGetter):
134         (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT):
135         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr):
136         (WebCore::jsTestDOMJITLongNullableAttr):
137         (WebCore::jsTestDOMJITLongNullableAttrGetter):
138         (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT):
139         (WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr):
140         (WebCore::jsTestDOMJITUnsignedLongNullableAttr):
141         (WebCore::jsTestDOMJITUnsignedLongNullableAttrGetter):
142         (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT):
143         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr):
144         (WebCore::jsTestDOMJITLongLongNullableAttr):
145         (WebCore::jsTestDOMJITLongLongNullableAttrGetter):
146         (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT):
147         (WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr):
148         (WebCore::jsTestDOMJITUnsignedLongLongNullableAttr):
149         (WebCore::jsTestDOMJITUnsignedLongLongNullableAttrGetter):
150         (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT):
151         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr):
152         (WebCore::jsTestDOMJITFloatNullableAttr):
153         (WebCore::jsTestDOMJITFloatNullableAttrGetter):
154         (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT):
155         (WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr):
156         (WebCore::jsTestDOMJITUnrestrictedFloatNullableAttr):
157         (WebCore::jsTestDOMJITUnrestrictedFloatNullableAttrGetter):
158         (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT):
159         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr):
160         (WebCore::jsTestDOMJITDoubleNullableAttr):
161         (WebCore::jsTestDOMJITDoubleNullableAttrGetter):
162         (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT):
163         (WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr):
164         (WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttr):
165         (WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttrGetter):
166         (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT):
167         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr):
168         (WebCore::jsTestDOMJITDomStringNullableAttr):
169         (WebCore::jsTestDOMJITDomStringNullableAttrGetter):
170         (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT):
171         (WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr):
172         (WebCore::jsTestDOMJITByteStringNullableAttr):
173         (WebCore::jsTestDOMJITByteStringNullableAttrGetter):
174         (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT):
175         (WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr):
176         (WebCore::jsTestDOMJITUsvStringNullableAttr):
177         (WebCore::jsTestDOMJITUsvStringNullableAttrGetter):
178         (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT):
179         (WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr):
180         (WebCore::jsTestDOMJITNodeNullableAttr):
181         (WebCore::jsTestDOMJITNodeNullableAttrGetter):
182         (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT):
183         (WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr):
184         (WebCore::jsTestDOMJITConstructor):
185         (WebCore::setJSTestDOMJITConstructor):
186         (WebCore::JSTestDOMJIT::getConstructor):
187         (WebCore::JSTestDOMJIT::visitChildren):
188         * bindings/scripts/test/JS/JSTestDOMJIT.h: Added.
189         (WebCore::JSTestDOMJIT::create):
190         (WebCore::JSTestDOMJIT::createStructure):
191         (WebCore::JSTestDOMJIT::wrapped):
192         (WebCore::JSTestDOMJIT::finishCreation):
193         * bindings/scripts/test/TestDOMJIT.idl: Added.
194
195 2016-10-25  Brent Fulgham  <bfulgham@apple.com>
196
197         [Win] Unreviewed build fix.
198
199         * platform/graphics/GraphicsContext.h: Add missing declaration.
200
201 2016-10-25  Ryosuke Niwa  <rniwa@webkit.org>
202
203         Updating attribute by textContent must create a single mutation record and custom element reaction
204         https://bugs.webkit.org/show_bug.cgi?id=164003
205
206         Reviewed by Chris Dumez.
207
208         The bug was caused by setTextContent not invoking setNodeValue for Attr nodes.
209         Use setNodeValue to match the specification: https://dom.spec.whatwg.org/#dom-node-textcontent
210
211         Test: fast/dom/MutationObserver/text-content-on-attr.html
212
213         * dom/Node.cpp:
214         (WebCore::Node::setTextContent):
215
216 2016-10-25  Brent Fulgham  <bfulgham@apple.com>
217
218         [Win][Direct2D] Use smart pointers for Direct2D Path types
219         https://bugs.webkit.org/show_bug.cgi?id=163994
220
221         Reviewed by Alex Christensen.
222
223         Tested by existing path tests.
224
225         * platform/graphics/Path.h:
226         (WebCore::Path::platformPath): Use a COMPtr for m_path.
227         * platform/graphics/win/GraphicsContextDirect2D.cpp:
228         (WebCore::GraphicsContext::systemFactory): Present better D2D debug output
229         when running a debug build.
230         (WebCore::GraphicsContext::platformInit): Initialize a D2D device from a
231         native GDI device context.
232         (WebCore::GraphicsContext::platformStrokeStyle): Added.
233         (WebCore::GraphicsContext::clipBounds): Simplify clip boundary calculations and
234         avoid doing math on infinities.
235         * platform/graphics/win/PathDirect2D.cpp:
236         (WebCore::scratchRenderTarget): Added.
237         (WebCore::Path::~Path): Switch to COMPtr implementation.
238         (WebCore::Path::ensurePlatformPath): Ditto.
239         (WebCore::Path::appendGeometry): Ditto.
240         (WebCore::Path::operator=): Ditto.
241         (WebCore::Path::initializePathState): Ditto.
242         (WebCore::Path::strokeContains): Provide an implementation.
243         (WebCore::Path::transform): Ditto.
244         (WebCore::Path::addEllipse): No need for explicit construction of the
245         D2D1::Point2F object.
246         (WebCore::Path::clear): Switch to COMPtr implementation.
247
248 2016-10-25  Nan Wang  <n_wang@apple.com>
249
250         LayoutTest accessibility/mac/meter-gauge-value-description.html failing
251         https://bugs.webkit.org/show_bug.cgi?id=163997
252         <rdar://problem/28948637>
253
254         Reviewed by Chris Fleizach.
255
256         I hand-edited the Localizable.strings file in a previous patch and my changes
257         were replaced by running update-webkit-localizable-strings script. Changed the
258         key to be the same as the value to keep consistency with other entries.
259
260         Re-enabled the failing test.
261
262         * English.lproj/Localizable.strings:
263         * platform/LocalizedStrings.cpp:
264         (WebCore::AXMeterGaugeRegionOptimumText):
265         (WebCore::AXMeterGaugeRegionSuboptimalText):
266         (WebCore::AXMeterGaugeRegionLessGoodText):
267
268 2016-10-25  Filip Pizlo  <fpizlo@apple.com>
269
270         HeapTimer should not hardcode all of its subclasses and USE(CF) shouldn't be a bizarre special case
271         https://bugs.webkit.org/show_bug.cgi?id=163947
272
273         Reviewed by Geoffrey Garen.
274
275         No new tests because no new behavior.
276
277         * platform/ios/WebSafeGCActivityCallbackIOS.h:
278         * platform/ios/WebSafeIncrementalSweeperIOS.h:
279
280 2016-10-25  Dave Hyatt  <hyatt@apple.com>
281
282         [CSS Parser] Improvements to selector parsing
283         https://bugs.webkit.org/show_bug.cgi?id=163964
284
285         Reviewed by Zalan Bujtas.
286
287         * css/CSSSelector.cpp:
288         (WebCore::CSSSelector::setAttribute):
289         (WebCore::CSSSelector::setNth):
290         * css/CSSSelector.h:
291         (WebCore::CSSSelector::setAttributeValueMatchingIsCaseInsensitive):
292         * css/StyleSheetContents.cpp:
293         (WebCore::StyleSheetContents::StyleSheetContents):
294         (WebCore::StyleSheetContents::parserAppendRule):
295         (WebCore::StyleSheetContents::ruleAt):
296         (WebCore::StyleSheetContents::ruleCount):
297         (WebCore::StyleSheetContents::clearRules):
298         (WebCore::StyleSheetContents::wrapperInsertRule):
299         (WebCore::StyleSheetContents::wrapperDeleteRule):
300         * css/StyleSheetContents.h:
301         * css/parser/CSSParser.cpp:
302         (WebCore::CSSParserContext::CSSParserContext):
303         (WebCore::CSSParser::parseSelector):
304         * css/parser/CSSParserValues.h:
305         (WebCore::CSSParserSelector::setAttribute):
306         (WebCore::CSSParserSelector::setArgument):
307         (WebCore::CSSParserSelector::setNth):
308         * css/parser/CSSSelectorParser.cpp:
309         (WebCore::consumeLangArgumentList):
310         (WebCore::CSSSelectorParser::consumeCompoundSelector):
311         (WebCore::CSSSelectorParser::consumeAttribute):
312         (WebCore::isPseudoClassFunction):
313         (WebCore::isPseudoElementFunction):
314         (WebCore::CSSSelectorParser::consumePseudo):
315         (WebCore::CSSSelectorParser::consumeCombinator):
316
317 2016-10-25  Beth Dakin  <bdakin@apple.com>
318
319         Numbered list should be represented without ‘…’
320         https://bugs.webkit.org/show_bug.cgi?id=163992
321         -and corresponding-
322         rdar://problem/28911337
323
324         Reviewed by Darin Adler.
325
326         * English.lproj/Localizable.strings:
327         * platform/LocalizedStrings.cpp:
328         (WebCore::insertListTypeNumbered):
329
330 2016-10-25  Daniel Bates  <dabates@apple.com>
331
332         REGRESSION (r178265): XSS Auditor fails to block document.write() of incomplete tag
333         https://bugs.webkit.org/show_bug.cgi?id=163978
334         <rdar://problem/25962131>
335
336         Reviewed by Darin Adler.
337
338         During the tokenization process of an HTML tag the start and end positions of each of its
339         attributes is tracked so that the XSS Auditor can request a snippet around a suspected
340         injected attribute. We need to take care to consider document.write() boundaries when
341         tracking the start and end positions of each HTML tag and attribute so that the XSS Auditor
342         receives the correct snippet. Following r178265 we no longer consider document.write()
343         boundaries when tracking the start and end positions of attributes. So, the substring
344         represented by the start and end positions of an attribute may correspond to some other
345         attribute in the tag. Therefore the XSS Auditor may fail to block an injection because the
346         snippet it requested may not be the snippet that it intended to request.
347
348         Tests: http/tests/security/xssAuditor/dom-write-location-dom-write-open-img-onerror.html
349                http/tests/security/xssAuditor/dom-write-location-open-img-onerror.html
350                http/tests/security/xssAuditor/nested-dom-write-location-open-img-onerror.html
351
352         * html/parser/HTMLSourceTracker.cpp:
353         (WebCore::HTMLSourceTracker::startToken): Set the attribute base offset to be the token
354         start position.
355         (WebCore::HTMLSourceTracker::source): Use the specified attribute start position as-is. We no
356         longer adjust it here because it was adjusted with respect to the attribute base offset, which
357         takes into account document.write() boundaries.
358         * html/parser/HTMLToken.h:
359         (WebCore::HTMLToken::setAttributeBaseOffset): Added.
360         (WebCore::HTMLToken::beginAttribute): Subtract attribute base offset from the specified offset.
361         (WebCore::HTMLToken::endAttribute): Ditto.
362         * html/parser/HTMLTokenizer.h:
363         (WebCore::HTMLTokenizer::setTokenAttributeBaseOffset): Added.
364
365 2016-10-25  Chris Dumez  <cdumez@apple.com>
366
367         IDBDatabase.transaction() should take a union in parameter
368         https://bugs.webkit.org/show_bug.cgi?id=163966
369
370         Reviewed by Sam Weinig.
371
372         IDBDatabase.transaction() should take a union in parameter:
373         - https://www.w3.org/TR/IndexedDB/#widl-IDBDatabase-transaction-IDBTransaction-DOMString-sequence-DOMString--storeNames-IDBTransactionMode-mode
374
375         No new tests, no expected Web-exposed behavior change.
376
377         * Modules/indexeddb/IDBDatabase.cpp:
378         (WebCore::IDBDatabase::transaction):
379         * Modules/indexeddb/IDBDatabase.h:
380         * Modules/indexeddb/IDBDatabase.idl:
381
382 2016-10-25  Brady Eidson  <beidson@apple.com>
383
384         IndexedDB 2.0: Support IDBObjectStore openKeyCursor.
385         <rdar://problem/28806930> and https://bugs.webkit.org/show_bug.cgi?id=163954
386
387         Reviewed by Andy Estes.
388
389         No new tests (Covered by changes to existing tests)
390
391         * Modules/indexeddb/IDBCursor.cpp:
392         (WebCore::IDBCursor::create):
393         * Modules/indexeddb/IDBCursor.h:
394
395         * Modules/indexeddb/IDBObjectStore.cpp:
396         (WebCore::IDBObjectStore::openCursor):
397         (WebCore::IDBObjectStore::openKeyCursor):
398         * Modules/indexeddb/IDBObjectStore.h:
399         * Modules/indexeddb/IDBObjectStore.idl:
400
401         * Modules/indexeddb/IDBTransaction.cpp:
402         (WebCore::IDBTransaction::requestOpenCursor):
403
404         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
405         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData): Only grab the current value
406           if the cursor is KeyAndValue.
407
408         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
409         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
410         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce): Only save off the data for an
411           object store cursor if it's both KeyAndValue.
412         * Modules/indexeddb/server/SQLiteIDBCursor.h:
413
414         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
415         (WebCore::IDBCursorInfo::objectStoreCursor): Allow for a KeyOnly ObjectStoreCursor.
416         * Modules/indexeddb/shared/IDBCursorInfo.h:
417
418 2016-10-25  Wenson Hsieh  <wenson_hsieh@apple.com>
419
420         Support InputEvent.dataTransfer for the InputEvent spec
421         https://bugs.webkit.org/show_bug.cgi?id=163213
422         <rdar://problem/28700407>
423
424         Reviewed by Ryosuke Niwa.
425
426         Adds support for the dataTransfer attribute of InputEvent, which contains both HTML and plain text
427         representations of inserted content corresponding to input types "insertFromPaste", "insertFromDrop" and
428         "insertReplacementText". The specification calls for the data transfer's drag data item list to contain this
429         information via two entries with type strings "text/html" and "text/plain". However, WebKit does not yet support
430         the DataTransfer.items -- in lieu of this, we will provide this information for now via getData("text/plain")
431         and getData("text/html"), respectively.
432
433         To support this attribute, we need a special type of DataTransfer which is readonly and returns canned data
434         given a type string. To implement this, we introduce StaticPasteboard, a type of Pasteboard which is initialized
435         with a map of type string to data. When asked for its data via getData, the StaticPasteboard searches its map
436         for the requested type and returns the result, if any.
437
438         An editing command may now create a new DataTransfer via DataTransfer::createForInputEvent from HTML and
439         plaintext strings, and then vend this information to its dispatched input events by overriding
440         CompositeEditCommand::inputEventDataTransfer.
441
442         Some further work will be needed to ensure that all information exposed via this DataTransfer does not contain
443         hidden content. To do this, we should create a new Document, "paste" the contents of our copied HTML string into
444         it, then simulate selecting the content and generating markup from the selection to create a sanitized
445         DocumentFragment corresponding to the original copied HTML. This will be addressed in a future patch.
446
447         Tests: fast/events/input-events-paste-rich-datatransfer.html
448                fast/events/input-events-spell-checking-datatransfer.html
449
450         * PlatformEfl.cmake:
451         * PlatformGTK.cmake:
452         * PlatformWin.cmake:
453
454         Add StaticPasteboard.cpp.
455
456         * WebCore.xcodeproj/project.pbxproj:
457         * dom/DataTransfer.cpp:
458         (WebCore::DataTransfer::DataTransfer):
459         (WebCore::DataTransfer::createForInputEvent):
460
461         Initializes a new DataTransfer for the purposes of input events. This takes a HTML and plain text
462         representations of the data being inserted and creates a new readonly DataTransfer backed by a StaticPasteboard
463         that only knows how to map the "text/plain" data type to the given plaintext string and "text/html" to the
464         given HTML text.
465
466         * dom/DataTransfer.h:
467         * dom/InputEvent.cpp:
468         (WebCore::InputEvent::create):
469         (WebCore::InputEvent::InputEvent):
470         (WebCore::InputEvent::dataTransfer):
471         * dom/InputEvent.h:
472         * dom/InputEvent.idl:
473
474         Add the InputEvent.dataTransfer attribute.
475
476         * dom/Node.cpp:
477         * editing/CompositeEditCommand.cpp:
478         (WebCore::CompositeEditCommand::inputEventDataTransfer):
479
480         Add a new hook for CompositeEditCommands to vend a DataTransfer for the purposes of input events. By default,
481         this is null.
482
483         * editing/CompositeEditCommand.h:
484         * editing/Editor.cpp:
485         (WebCore::dispatchBeforeInputEvent):
486         (WebCore::dispatchInputEvent):
487         (WebCore::dispatchBeforeInputEvents):
488         (WebCore::dispatchInputEvents):
489         (WebCore::Editor::willApplyEditing):
490         (WebCore::Editor::appliedEditing):
491         * editing/ReplaceRangeWithTextCommand.cpp:
492         (WebCore::ReplaceRangeWithTextCommand::willApplyCommand):
493         (WebCore::ReplaceRangeWithTextCommand::doApply):
494         (WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer):
495         * editing/ReplaceRangeWithTextCommand.h:
496         * editing/ReplaceSelectionCommand.cpp:
497         (WebCore::ReplaceSelectionCommand::willApplyCommand):
498
499         Initialize the ReplacementFragment here before applying the command, adjusting the DocumentFragment to be
500         inserted in the process.
501
502         (WebCore::ReplaceSelectionCommand::doApply):
503         (WebCore::ReplaceSelectionCommand::inputEventDataTransfer):
504         (WebCore::ReplaceSelectionCommand::ensureReplacementFragment):
505
506         Returns the ReplacementFragment used to apply the command, initializing it if necessary and stripping extraneous
507         nodes off of the document fragment in the process. Since ReplaceSelectionCommand may be used as a top-level
508         editing command or a child of another CompositeEditCommand such as the ReplaceRangeWithTextCommand, the
509         ReplacementFragment may be initialized either in willApplyCommand or in doApply.
510
511         * editing/ReplaceSelectionCommand.h:
512         * editing/SpellingCorrectionCommand.cpp:
513         (WebCore::SpellingCorrectionCommand::willApplyCommand):
514         (WebCore::SpellingCorrectionCommand::doApply):
515         (WebCore::SpellingCorrectionCommand::inputEventDataTransfer):
516         * editing/SpellingCorrectionCommand.h:
517
518         Using the replacement text fragment, create and return a DataTransfer for input events.
519
520         * platform/Pasteboard.h:
521         * platform/StaticPasteboard.cpp: Added.
522         (WebCore::StaticPasteboard::create):
523         (WebCore::StaticPasteboard::StaticPasteboard):
524         (WebCore::StaticPasteboard::hasData):
525         (WebCore::StaticPasteboard::types):
526         (WebCore::StaticPasteboard::readString):
527         * platform/StaticPasteboard.h: Copied from Source/WebCore/dom/InputEvent.cpp.
528         * platform/efl/PasteboardEfl.cpp:
529         (WebCore::Pasteboard::writeMarkup):
530         (WebCore::Pasteboard::write):
531         (WebCore::Pasteboard::read):
532         * platform/gtk/PasteboardGtk.cpp:
533         (WebCore::Pasteboard::writeMarkup):
534         * platform/ios/PasteboardIOS.mm:
535         (WebCore::Pasteboard::writeMarkup):
536         * platform/mac/PasteboardMac.mm:
537         (WebCore::Pasteboard::Pasteboard):
538         (WebCore::Pasteboard::writeMarkup):
539         * platform/win/PasteboardWin.cpp:
540         (WebCore::Pasteboard::write):
541         (WebCore::Pasteboard::read):
542
543         To account for virtual methods on Pasteboard, add implementations for methods that were previously defined but
544         unimplemented on these platforms.
545
546 2016-10-25  Andy Estes  <aestes@apple.com>
547
548         Implement rel=noopener
549         https://bugs.webkit.org/show_bug.cgi?id=155166
550         <rdar://problem/25193787>
551
552         Reviewed by Brent Fulgham.
553
554         Added support for rel=noopener to a and area elements.
555
556         Tests: fast/dom/Window/a-rel-noopener.html
557                fast/dom/Window/area-rel-noopener.html
558
559         * html/HTMLAnchorElement.cpp:
560         (WebCore::HTMLAnchorElement::HTMLAnchorElement): Stopped initializing m_linkRelations to 0.
561         (WebCore::HTMLAnchorElement::parseAttribute): Declared static AtomicStrings for "noreferrer"
562         and "noopener", and created a SpaceSplitString from the rel attribute value to test for these
563         two values.
564         (WebCore::HTMLAnchorElement::hasRel): Updated to use OptionSet::contains().
565         (WebCore::HTMLAnchorElement::relList): Added a check for "noopener".
566         (WebCore::HTMLAnchorElement::handleClick): Passed NewFrameOpenerPolicy::Suppress to
567         FrameLoader::urlSelected() if rel=noopener was specified.
568         * html/HTMLAnchorElement.h: Changed the Relation enum to an enum class, removed unused enum
569         values, and changed m_linkRelations from a 30-bit unsigned integer to an OptionSet<Relation>
570         (HTMLAnchorElement is still 128 bytes on 64-bit).
571         * loader/FrameLoader.cpp:
572         (WebCore::FrameLoader::urlSelected): Changed to only compute a NewFrameOpenerPolicy from the
573         referrer policy if an explicit NewFrameOpenerPolicy isn't specified. Removed the version of
574         urlSelected() that did not take a downloadAttribute parameter.
575         * loader/FrameLoader.h: Added an Optional<NewFrameOpenerPolicy> parameter to urlSelected(),
576         and set a default argument for downloadAttribute instead of having a second version of
577         urlSelected().
578
579 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
580
581         [MediaStream] Add "has capture device" bit to media state flags
582         https://bugs.webkit.org/show_bug.cgi?id=163952
583
584         Reviewed by Jer Noble.
585
586         No new tests, updated fast/mediastream/MediaStream-page-muted.html, media/muted-video-is-playing-audio.html,
587         and webaudio/web-audio-is-playing.html.
588
589         * Modules/mediastream/MediaStream.cpp:
590         (WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when
591           actually producing data.
592
593         * page/MediaProducer.h: Add HasMediaCaptureDevice bit.
594
595         * testing/Internals.cpp:
596         (WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags.
597         (WebCore::Internals::isPagePlayingAudio): Deleted.
598         * testing/Internals.h:
599         * testing/Internals.idl:
600
601 2016-10-25  Commit Queue  <commit-queue@webkit.org>
602
603         Unreviewed, rolling out r207827 and r207828.
604         https://bugs.webkit.org/show_bug.cgi?id=163965
605
606         Caused LayoutTest webaudio/web-audio-is-playing.html to time
607         out on macOS. (Requested by ryanhaddad on #webkit).
608
609         Reverted changesets:
610
611         "[MediaStream] Add "has capture device" bit to media state
612         flags"
613         https://bugs.webkit.org/show_bug.cgi?id=163952
614         http://trac.webkit.org/changeset/207827
615
616         "[MediaStream] Add "has capture device" bit to media state
617         flags"
618         https://bugs.webkit.org/show_bug.cgi?id=163952
619         http://trac.webkit.org/changeset/207828
620
621 2016-10-25  Antoine Quint  <graouts@apple.com>
622
623         [Modern Media Controls] Media Controller: skip back support
624         https://bugs.webkit.org/show_bug.cgi?id=163725
625         <rdar://problem/27989480>
626
627         Reviewed by Dean Jackson.
628
629         We introduce the SkipBackSupport class which brings support for skipping back
630         30 seconds into the media by clicking on the skip back button in the media controls.
631
632         Test: http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html
633
634         * Modules/modern-media-controls/js-files:
635         * Modules/modern-media-controls/media/media-controller.js:
636         (MediaController):
637         * Modules/modern-media-controls/media/skip-back-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
638         (SkipBackSupport.prototype.get control):
639         (SkipBackSupport.prototype.buttonWasClicked):
640         (SkipBackSupport):
641         * WebCore.xcodeproj/project.pbxproj:
642
643 2016-10-25  Commit Queue  <commit-queue@webkit.org>
644
645         Unreviewed, rolling out r207578.
646         https://bugs.webkit.org/show_bug.cgi?id=163962
647
648         Broke quip.com so that user can no longer type a space
649         (Requested by rniwa on #webkit).
650
651         Reverted changeset:
652
653         "Add a plain space instead of &nbsp; between text nodes"
654         https://bugs.webkit.org/show_bug.cgi?id=123163
655         http://trac.webkit.org/changeset/207578
656
657 2016-10-25  Chris Dumez  <cdumez@apple.com>
658
659         LOG_WITH_STREAM() macro should not have a semi colon at the end
660         https://bugs.webkit.org/show_bug.cgi?id=163951
661
662         Reviewed by Simon Fraser.
663
664         * platform/LogMacros.h:
665
666 2016-10-25  Chris Dumez  <cdumez@apple.com>
667
668         IDBObjectStore.createIndex() should take a union in parameter
669         https://bugs.webkit.org/show_bug.cgi?id=163935
670
671         Reviewed by Darin Adler.
672
673         IDBObjectStore.createIndex() should take a union in parameter:
674         - https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStore
675
676         No new tests, no expected Web-exposed behavior change.
677
678         * Modules/indexeddb/IDBDatabase.cpp:
679         (WebCore::IDBDatabase::createObjectStore):
680         * Modules/indexeddb/IDBKeyPath.cpp:
681         (WebCore::isIDBKeyPathValid):
682         (WebCore::IDBKeyPath::isValid): Deleted.
683         * Modules/indexeddb/IDBKeyPath.h:
684         (WebCore::IDBKeyPath::isNull):
685         * Modules/indexeddb/IDBObjectStore.cpp:
686         (WebCore::IDBObjectStore::createIndex):
687         * Modules/indexeddb/IDBObjectStore.h:
688         * Modules/indexeddb/IDBObjectStore.idl:
689
690 2016-10-24  Sam Weinig  <sam@webkit.org>
691
692         [WebIDL] Move more types over to the new JSConverter based toJS functions
693         https://bugs.webkit.org/show_bug.cgi?id=163920
694
695         Reviewed by Darin Adler.
696
697         - Adds WebIDL-extension type IDLDate, and use it for Date conversions.
698         - Move JSDOMIterator over to using IDLType based conversions. Make them more
699           explicit by adding a traits template argument which describes the iterator.
700         - Add correct parsing for WebIDL iterable, parsing the parameter types into
701           domTypes.
702         - Support non-Optional nullable types via trait-like functions on IDLTypes.
703
704
705         * bindings/generic/IDLTypes.h:
706         (WebCore::IDLType::isNullValue):
707         (WebCore::IDLType::extractValueFromNullable):
708         (WebCore::IDLString::isNullValue):
709         (WebCore::IDLString::extractValueFromNullable):
710         (WebCore::IDLInterface::isNullValue):
711         (WebCore::IDLInterface::extractValueFromNullable):
712         (WebCore::IDLDate::isNullValue):
713         (WebCore::IDLDate::extractValueFromNullable):
714         Add isNullValue and extractValueFromNullable functions to allow non-Optional
715         based nullable types.
716         
717         * Modules/plugins/QuickTimePluginReplacement.mm:
718         (WebCore::QuickTimePluginReplacement::installReplacement):
719         * bindings/js/IDBBindingUtilities.cpp:
720         (WebCore::toJS):
721         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
722         (WebCore::stylePropertyGetter):
723         * bindings/js/JSCustomElementInterface.cpp:
724         (WebCore::JSCustomElementInterface::invokeAttributeChangedCallback):
725         Switch to IDLType based toJS.
726
727         * bindings/js/JSDOMBinding.cpp:
728         (WebCore::jsStringOrNull): Deleted.
729         (WebCore::jsDateOrNull): Deleted.
730         * bindings/js/JSDOMBinding.h:
731         (WebCore::jsPair): Deleted.
732         (WebCore::toJSNullableString): Deleted.
733         Remove now unusued toJS functions.
734
735         * bindings/js/JSDOMConvert.h:
736         (WebCore::JSConverter<IDLNullable<T>>::convert):
737         Use new functions to detect and extract nullable values.
738
739         (WebCore::Converter<IDLBufferSource>::convert):
740         Moved to be with the other converters.
741
742         (WebCore::Converter<IDLDate>::convert):
743         (WebCore::JSConverter<IDLDate>::convert):
744         Added.
745
746         * bindings/js/JSDOMIterator.h:
747         (WebCore::jsPair):
748         (WebCore::iteratorCreate):
749         (WebCore::IteratorTraits>::asJS):
750         (WebCore::appendForEachArguments):
751         (WebCore::iteratorForEach):
752         (WebCore::IteratorTraits>::destroy):
753         (WebCore::IteratorTraits>::next):
754         (WebCore::IteratorTraits>::finishCreation):
755         (WebCore::IteratorInspector::decltype): Deleted.
756         (WebCore::IteratorInspector::test): Deleted.
757         (WebCore::JSDOMIterator<JSWrapper>::asJS): Deleted.
758         (WebCore::JSDOMIterator<JSWrapper>::destroy): Deleted.
759         (WebCore::JSDOMIterator<JSWrapper>::next): Deleted.
760         (WebCore::JSDOMIteratorPrototype<JSWrapper>::next): Deleted.
761         (WebCore::JSDOMIteratorPrototype<JSWrapper>::finishCreation): Deleted.
762         Switch to new Traits based model, and have the generated code pass in 
763         the type (map or set) and key/value types. With the explicit types known,
764         we can use the new toJS functions.
765         
766         Also, moved the jsPair functions here from JSDOMBinding.h, since this was
767         the only place it was used.
768
769         * bindings/scripts/CodeGeneratorJS.pm:
770         (GenerateImplementationIterableFunctions):
771         Add iterator trait definition and update for new parameters to JSDOMIterator
772         and JSDOMIteratorPrototype.
773
774         (GetBaseIDLType):
775         Add IDLDate, and move IDLBufferSource up to the simple path.
776
777         (JSValueToNativeIsHandledByDOMConvert):
778         Allow Date.
779
780         (JSValueToNative):
781         Remove special case for Date.
782
783         (NativeToJSValueIsHandledByDOMConvert):
784         Allow Date and remove restriction of nullable string-like types.
785
786         (NativeToJSValueDOMConvertNeedsState):
787         Add Date to list of types needing state.
788
789         (NativeToJSValue):
790         Remove special cases for Date and nullable-strings.
791
792         * bindings/scripts/IDLParser.pm:
793         (parseOptionalIterableInterface):
794         Add correct parsing of iterable.
795
796         * bindings/scripts/test/JS/JSTestIterable.cpp:
797         * bindings/scripts/test/JS/JSTestNode.cpp:
798         * bindings/scripts/test/JS/JSTestObj.cpp:
799         Update test results.
800
801 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
802
803         [MediaStream] Add "has capture device" bit to media state flags
804         https://bugs.webkit.org/show_bug.cgi?id=163952
805
806         Reviewed by Jer Noble.
807
808         No new tests, updated fast/mediastream/MediaStream-page-muted.html and media/muted-video-is-playing-audio.html.
809
810         * Modules/mediastream/MediaStream.cpp:
811         (WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when
812           actually producing data.
813
814         * page/MediaProducer.h: Add HasMediaCaptureDevice bit.
815
816         * testing/Internals.cpp:
817         (WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags.
818         (WebCore::Internals::isPagePlayingAudio): Deleted.
819         * testing/Internals.h:
820         * testing/Internals.idl:
821
822 2016-10-25  Brady Eidson  <beidson@apple.com>
823
824         IndexedDB 2.0: Support new IDBTransaction interfaces.
825         <rdar://problem/28806928> and https://bugs.webkit.org/show_bug.cgi?id=163927
826
827         Reviewed by Sam Weinig.
828
829         Tests: storage/indexeddb/modern/idbtransaction-objectstores-1-private.html
830                storage/indexeddb/modern/idbtransaction-objectstores-1.html
831                At least partially passing results on 5 previously failed W3C tests.
832
833         The "new IDBTransaction interfaces" really just means adding the property IDBTransaction.objectStoreNames.
834
835         * Modules/indexeddb/IDBTransaction.cpp:
836         (WebCore::IDBTransaction::objectStoreNames):
837         * Modules/indexeddb/IDBTransaction.h:
838         * Modules/indexeddb/IDBTransaction.idl:
839
840 2016-10-25  Youenn Fablet  <youenn@apple.com>
841
842         MediaEndpointConfiguration does not need to be refcounted
843         https://bugs.webkit.org/show_bug.cgi?id=163888
844
845         Reviewed by Eric Carlson.
846
847         No change of behavior.
848
849         Updating MediaEndpoint to take a MediaEndpointConfiguration&& instead of a RefPtr<MediaEndpointConfiguration>&&.
850         This allows ensuring that the configuration is not null and removes the need to ref-count it.
851
852         Removing ref-counting from MediaEndpointConfiguration and its related IceServer that is now a struct.
853         Updated MediaEndpointOwr and mock implementations accordingly.
854
855         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
856         (WebCore::MediaEndpointPeerConnection::setConfiguration):
857         * platform/mediastream/MediaEndpoint.cpp:
858         * platform/mediastream/MediaEndpoint.h:
859         * platform/mediastream/MediaEndpointConfiguration.cpp:
860         (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
861         * platform/mediastream/MediaEndpointConfiguration.h:
862         (WebCore::MediaEndpointConfiguration::iceServers):
863         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
864         (WebCore::MediaEndpointOwr::setConfiguration):
865         (WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
866         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
867         * platform/mock/MockMediaEndpoint.cpp:
868         * platform/mock/MockMediaEndpoint.h:
869
870 2016-10-25  Youenn Fablet  <youenn@apple.com>
871
872         CachedResourceLoader should set headers of the HTTP request prior checking for the cache
873         https://bugs.webkit.org/show_bug.cgi?id=163103
874
875         Reviewed by Darin Adler.
876
877         No expected change of behavior.
878
879         Moved referrer, user-agent, and origin headers setting to CachedResourceRequest/CachedResourceLoader before checking the cache.
880         This allows simplifying vary header checks and is more inline with the fetch specification.
881
882         To compute the referrer value, we need to know whether the request is cross-origin.
883         A helper function isRequestCrossOrigin is added for that purpose and is also used in CachedResource to set its initial response tainting.
884
885         We should disable setting user-agent and origin headers by FrameLoader for subresources since this is now done in CachedResourceLoader.
886         This could be done as a follow-up patch.
887
888         * loader/cache/CachedResource.cpp:
889         (WebCore::CachedResource::CachedResource):
890         (WebCore::CachedResource::load):
891         (WebCore::CachedResource::varyHeaderValuesMatch):
892         (WebCore::addAdditionalRequestHeadersToRequest): Deleted.
893         (WebCore::CachedResource::addAdditionalRequestHeaders): Deleted.
894         * loader/cache/CachedResource.h:
895         * loader/cache/CachedResourceLoader.cpp:
896         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
897         (WebCore::CachedResourceLoader::requestResource):
898         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
899         * loader/cache/CachedResourceLoader.h:
900         * loader/cache/CachedResourceRequest.cpp:
901         (WebCore::CachedResourceRequest::updateForAccessControl):
902         (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
903         (WebCore::isRequestCrossOrigin):
904         * loader/cache/CachedResourceRequest.h:
905         (WebCore::CachedResourceRequest::setOrigin):
906
907 2016-10-25  Andreas Kling  <akling@apple.com>
908
909         More PassRefPtr purging in WebCore.
910         <https://webkit.org/b/163895>
911
912         Reviewed by Antti Koivisto.
913
914         Remove PassRefPtr usage in RenderStyle, RenderTheme and Scrollbar, then fix up all the fallout.
915
916         * css/CSSComputedStyleDeclaration.cpp:
917         (WebCore::contentToCSSValue):
918         (WebCore::shapePropertyValue):
919         (WebCore::ComputedStyleExtractor::propertyValue):
920         * css/StyleBuilderConverter.h:
921         (WebCore::StyleBuilderConverter::convertQuotes):
922         * html/HTMLSelectElement.cpp:
923         (WebCore::HTMLSelectElement::usesMenuList):
924         (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
925         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
926         * html/InputType.cpp:
927         (WebCore::InputType::themeSupportsDataListUI):
928         * html/TextFieldInputType.cpp:
929         (WebCore::TextFieldInputType::shouldHaveSpinButton):
930         (WebCore::TextFieldInputType::shouldHaveCapsLockIndicator):
931         * loader/SubframeLoader.cpp:
932         (WebCore::SubframeLoader::loadPlugin):
933         * page/FrameView.cpp:
934         (WebCore::FrameView::createScrollbar):
935         * page/FrameView.h:
936         * page/animation/CSSPropertyAnimation.cpp:
937         (WebCore::RefCountedPropertyWrapper::RefCountedPropertyWrapper):
938         (WebCore::PropertyWrapperClipPath::PropertyWrapperClipPath):
939         (WebCore::PropertyWrapperShape::PropertyWrapperShape):
940         (WebCore::StyleImagePropertyWrapper::StyleImagePropertyWrapper):
941         (WebCore::FillLayerRefCountedPropertyWrapper::FillLayerRefCountedPropertyWrapper):
942         (WebCore::FillLayerStyleImagePropertyWrapper::FillLayerStyleImagePropertyWrapper):
943         * platform/PopupMenuClient.h:
944         * platform/ScrollView.cpp:
945         (WebCore::ScrollView::createScrollbar):
946         * platform/ScrollView.h:
947         * platform/Scrollbar.cpp:
948         (WebCore::Scrollbar::createNativeScrollbar):
949         * platform/Scrollbar.h:
950         * rendering/FilterEffectRenderer.cpp:
951         (WebCore::FilterEffectRenderer::buildReferenceFilter):
952         * rendering/FilterEffectRenderer.h:
953         * rendering/RenderLayer.cpp:
954         (WebCore::RenderLayer::createScrollbar):
955         (WebCore::RenderLayer::createLocalTransformState):
956         (WebCore::RenderLayer::hitTestLayerByApplyingTransform):
957         * rendering/RenderLayer.h:
958         * rendering/RenderListBox.cpp:
959         (WebCore::RenderListBox::createScrollbar):
960         * rendering/RenderListBox.h:
961         * rendering/RenderMenuList.cpp:
962         (RenderMenuList::createScrollbar):
963         * rendering/RenderMenuList.h:
964         * rendering/RenderScrollbar.cpp:
965         (WebCore::RenderScrollbar::createCustomScrollbar):
966         * rendering/RenderScrollbar.h:
967         * rendering/RenderSearchField.cpp:
968         (WebCore::RenderSearchField::createScrollbar):
969         * rendering/RenderSearchField.h:
970         * rendering/RenderTheme.h:
971         (WebCore::RenderTheme::defaultTheme):
972         * rendering/RenderThemeEfl.cpp:
973         (WebCore::RenderThemeEfl::create):
974         (WebCore::RenderTheme::themeForPage):
975         * rendering/RenderThemeEfl.h:
976         * rendering/RenderThemeGtk.cpp:
977         (WebCore::RenderTheme::themeForPage):
978         * rendering/RenderThemeIOS.mm:
979         (WebCore::RenderTheme::themeForPage):
980         * rendering/RenderThemeMac.mm:
981         (WebCore::RenderTheme::themeForPage):
982         * rendering/RenderThemeWin.cpp:
983         (WebCore::RenderTheme::themeForPage):
984         * rendering/RenderWidget.cpp:
985         (WebCore::RenderWidget::setWidget):
986         * rendering/RenderWidget.h:
987         * rendering/style/CursorData.h:
988         (WebCore::CursorData::CursorData):
989         (WebCore::CursorData::setImage):
990         * rendering/style/FillLayer.h:
991         (WebCore::FillLayer::setImage):
992         * rendering/style/QuotesData.cpp:
993         (WebCore::QuotesData::create):
994         * rendering/style/QuotesData.h:
995         * rendering/style/RenderStyle.cpp:
996         (WebCore::RenderStyle::addCursor):
997         (WebCore::RenderStyle::setCursorList):
998         (WebCore::RenderStyle::setQuotes):
999         (WebCore::RenderStyle::setWillChange):
1000         (WebCore::RenderStyle::setContent):
1001         (WebCore::RenderStyle::setListStyleImage):
1002         (WebCore::RenderStyle::setBorderImageSource):
1003         * rendering/style/RenderStyle.h:
1004         (WebCore::RenderStyle::setMaskImage):
1005         (WebCore::RenderStyle::setMaskBoxImageSource):
1006         (WebCore::RenderStyle::setBoxReflect):
1007         (WebCore::RenderStyle::setShapeOutside):
1008         (WebCore::RenderStyle::setClipPath):
1009         * rendering/style/StyleCachedImage.cpp:
1010         (WebCore::StyleCachedImage::cssValue):
1011         * rendering/style/StyleCachedImage.h:
1012         * rendering/style/StyleGeneratedImage.cpp:
1013         (WebCore::StyleGeneratedImage::cssValue):
1014         * rendering/style/StyleGeneratedImage.h:
1015         * rendering/style/StyleImage.h:
1016         * rendering/style/StyleMultiColData.h:
1017         * rendering/style/StyleRareInheritedData.h:
1018
1019 2016-10-24  Ryosuke Niwa  <rniwa@webkit.org>
1020
1021         Custom elements reactions should have a queue per element
1022         https://bugs.webkit.org/show_bug.cgi?id=163878
1023
1024         Reviewed by Antti Koivisto.
1025
1026         This patch splits the custom elements reaction queue into per element to match the latest HTML specifications:
1027         https://html.spec.whatwg.org/multipage/scripting.html#custom-element-reaction-queue
1028         and introduces the backup element queue:
1029         https://html.spec.whatwg.org/multipage/scripting.html#backup-element-queue
1030
1031         In terms of code changes, CustomElementReactionStack now holds onto ElementQueue, an ordered list of elements,
1032         and make each ElementRareData keep its own CustomElementReactionQueue. CustomElementReactionQueue is created
1033         for each custom element when it is synchronously constructed or enqueued to upgrade.
1034
1035         Because each reaction queue is now specific to each element, CustomElementReactionQueue instead of
1036         CustomElementReactionQueueItem stores JSCustomElementInterface.
1037
1038         The backup element queue is created as a singleton returned by CustomElementReactionStack's backupElementQueue,
1039         and ensureBackupQueue() schedules a new mirotask to process the backup queue when there isn't already one.
1040
1041         ensureCurrentQueue() now returns a reference to CustomElementReactionQueue instead of a pointer since it can
1042         fallback to the backup queue when the stack is empty as specified:
1043         https://html.spec.whatwg.org/multipage/scripting.html#enqueue-an-element-on-the-appropriate-element-queue
1044
1045         Note that ensureCurrentQueue() may insert the same element multiple times into the element queue for now since
1046         avoiding this duplication would require either doing O(n) iteration on m_elements or adding a HashSet.
1047         We can revisit this in the future if the reaction queue is found to grow beyond a few entries since elements in
1048         the element queue will have duplicates only when each reaction queue has more than one item.
1049
1050         Tests: fast/custom-elements/backup-element-queue.html
1051                fast/custom-elements/custom-element-reaction-queue.html
1052
1053         * bindings/js/JSCustomElementInterface.cpp:
1054         (WebCore::JSCustomElementInterface::upgradeElement):
1055         * dom/CustomElementReactionQueue.cpp:
1056         (WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem):
1057         (WebCore::CustomElementReactionQueueItem::invoke): Removed the check for isFailedCustomElement since the queue
1058         is explicitly cleared in Element::setIsFailedCustomElement.
1059         (WebCore::CustomElementReactionQueue::CustomElementReactionQueue): Now takes JSCustomElementInterface since
1060         each item in the queue no longer stores Element or JSCustomElementInterface.
1061         (WebCore::CustomElementReactionQueue::clear):
1062         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
1063         (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined):
1064         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
1065         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
1066         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
1067         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
1068         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
1069         (WebCore::CustomElementReactionQueue::invokeAll):
1070         (WebCore::CustomElementReactionStack::ElementQueue::add): Added.
1071         (WebCore::CustomElementReactionStack::ElementQueue::invokeAll): Added.
1072         (WebCore::CustomElementReactionStack::ensureCurrentQueue):
1073         (WebCore::BackupElementQueueMicrotask): Added.
1074         (WebCore::CustomElementReactionStack::ensureBackupQueue): Added.
1075         (WebCore::CustomElementReactionStack::processBackupQueue): Added.
1076         (WebCore::CustomElementReactionStack::backupElementQueue): Added.
1077         * dom/CustomElementReactionQueue.h:
1078         * dom/CustomElementRegistry.cpp:
1079         (WebCore::enqueueUpgradeInShadowIncludingTreeOrder):
1080         * dom/Document.cpp:
1081         (WebCore::createFallbackHTMLElement):
1082         * dom/Element.cpp:
1083         (WebCore::Element::setIsDefinedCustomElement): Create a new reaction queue if there isn't already one; when
1084         this element had been upgraded, the reaction queue have already been created in Element::enqueueToUpgrade.
1085         (WebCore::Element::setIsFailedCustomElement): Clear the reaction queue when the upgrading had failed.
1086         (WebCore::Element::enqueueToUpgrade): Added.
1087         (WebCore::Element::reactionQueue): Added.
1088         * dom/Element.h:
1089         * dom/ElementRareData.h:
1090         (WebCore::ElementRareData::customElementReactionQueue): Replaced customElementInterface.
1091         (WebCore::ElementRareData::setCustomElementReactionQueue): Replaced setCustomElementReactionQueue.
1092
1093 2016-10-24  Jiewen Tan  <jiewen_tan@apple.com>
1094
1095         Update SubtleCrypto::generateKey to match the latest spec
1096         https://bugs.webkit.org/show_bug.cgi?id=163718
1097         <rdar://problem/28864380>
1098
1099         Reviewed by Chris Dumez.
1100
1101         This patch does following few things:
1102         1. It updates the SubtleCrypto::generateKey method to match the latest spec:
1103            https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-generateKey.
1104            It also refers to the latest Editor's Draft at a certain degree:
1105            https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-generateKey.
1106         2. It implements generateKey operations of following algorithms: AES-CBC, AES-KW,
1107            HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP.
1108         3. It replaces SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS with
1109         SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS_DEPRECATED for deprecated params.
1110         4. It fixes https://bugs.webkit.org/show_bug.cgi?id=129750 as well.
1111
1112         Tests: crypto/subtle/aes-cbc-generate-key-length-128.html
1113                crypto/subtle/aes-cbc-generate-key-length-192.html
1114                crypto/subtle/aes-cbc-generate-key-length-256.html
1115                crypto/subtle/aes-generate-key-malformed-parameters.html
1116                crypto/subtle/aes-kw-generate-key.html
1117                crypto/subtle/generate-key-malformed-paramters.html
1118                crypto/subtle/hmac-generate-key-customized-length.html
1119                crypto/subtle/hmac-generate-key-hash-object.html
1120                crypto/subtle/hmac-generate-key-malformed-parameters.html
1121                crypto/subtle/hmac-generate-key-sha1.html
1122                crypto/subtle/hmac-generate-key-sha224.html
1123                crypto/subtle/hmac-generate-key-sha256.html
1124                crypto/subtle/hmac-generate-key-sha384.html
1125                crypto/subtle/hmac-generate-key-sha512.html
1126                crypto/subtle/rsa-generate-key-malformed-parameters.html
1127                crypto/subtle/rsa-oaep-generate-key.html
1128                crypto/subtle/rsaes-pkcs1-v1_5-generate-key-extractable.html
1129                crypto/subtle/rsaes-pkcs1-v1_5-generate-key.html
1130                crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html
1131                crypto/webkitSubtle/hmac-generate-key.html:
1132                crypto/workers/subtle/aes-generate-key.html
1133                crypto/workers/subtle/hmac-generate-key.html
1134                crypto/workers/subtle/rsa-generate-key.html
1135
1136         * CMakeLists.txt:
1137         * DerivedSources.make:
1138         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
1139         * WebCore.xcodeproj/project.pbxproj:
1140         * bindings/js/JSSubtleCryptoCustom.cpp: Added.
1141         (WebCore::toHashIdentifier):
1142         (WebCore::normalizeCryptoAlgorithmParameters):
1143         (WebCore::cryptoKeyUsagesFromJSValue):
1144         (WebCore::createAlgorithm):
1145         (WebCore::rejectWithException):
1146         (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
1147         (WebCore::JSSubtleCrypto::generateKey):
1148         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
1149         (WebCore::JSWebKitSubtleCrypto::generateKey):
1150         * crypto/CryptoAlgorithm.cpp:
1151         (WebCore::CryptoAlgorithm::generateKey):
1152         * crypto/CryptoAlgorithm.h:
1153         * crypto/CryptoAlgorithmParameters.h: Added.
1154         (WebCore::CryptoAlgorithmParameters::CryptoAlgorithmParameters):
1155         (WebCore::CryptoAlgorithmParameters::~CryptoAlgorithmParameters):
1156         (WebCore::CryptoAlgorithmParameters::parametersClass):
1157         * crypto/CryptoAlgorithmParameters.idl: Added.
1158         * crypto/CryptoAlgorithmParametersDeprecated.h:
1159         * crypto/CryptoKey.cpp:
1160         (WebCore::CryptoKey::setUsagesBitmap):
1161         * crypto/CryptoKey.h:
1162         * crypto/CryptoKeyPair.idl:
1163         * crypto/SubtleCrypto.idl:
1164         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
1165         (WebCore::CryptoAlgorithmAES_CBC::generateKey):
1166         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
1167         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
1168         (WebCore::CryptoAlgorithmAES_KW::generateKey):
1169         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
1170         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1171         (WebCore::CryptoAlgorithmHMAC::generateKey):
1172         * crypto/algorithms/CryptoAlgorithmHMAC.h:
1173         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1174         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
1175         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
1176         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1177         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
1178         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
1179         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1180         (WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
1181         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
1182         * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
1183         (WebCore::CryptoKeyRSA::generatePair):
1184         * crypto/keys/CryptoKeyAES.cpp:
1185         (WebCore::CryptoKeyAES::generate):
1186         * crypto/keys/CryptoKeyHMAC.cpp:
1187         (WebCore::CryptoKeyHMAC::generate):
1188         * crypto/keys/CryptoKeyRSA.h:
1189         * crypto/mac/CryptoKeyRSAMac.cpp:
1190         (WebCore::CryptoKeyRSA::generatePair):
1191         * crypto/parameters/AesKeyGenParams.idl: Added.
1192         * crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h:
1193         * crypto/parameters/CryptoAlgorithmAesKeyGenParams.h: Added.
1194         * crypto/parameters/CryptoAlgorithmAesKeyGenParamsDeprecated.h:
1195         * crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h: Added.
1196         * crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h:
1197         * crypto/parameters/CryptoAlgorithmHmacParamsDeprecated.h:
1198         * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h: Added.
1199         * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: Added.
1200         (WebCore::CryptoAlgorithmRsaKeyGenParams::arrayToVector):
1201         * crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h:
1202         * crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h:
1203         * crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h:
1204         * crypto/parameters/CryptoAlgorithmRsaSsaParamsDeprecated.h:
1205         * crypto/parameters/HmacKeyGenParams.idl: Added.
1206         * crypto/parameters/RsaHashedKeyGenParams.idl: Added.
1207         * crypto/parameters/RsaKeyGenParams.idl: Added.
1208
1209 2016-10-24  Chris Dumez  <cdumez@apple.com>
1210
1211         IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter
1212         https://bugs.webkit.org/show_bug.cgi?id=163916
1213
1214         Reviewed by Darin Adler.
1215
1216         IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter:
1217         - https://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabase
1218         - https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStoreParameters
1219
1220         Align our IDL with the specification.
1221
1222         No new tests, no expected Web-exposed behavior change.
1223
1224         * Modules/indexeddb/IDBDatabase.cpp:
1225         (WebCore::IDBDatabase::createObjectStore):
1226         * Modules/indexeddb/IDBDatabase.h:
1227         * Modules/indexeddb/IDBDatabase.idl:
1228         * Modules/indexeddb/IDBKeyPath.cpp:
1229         (WebCore::IDBKeyPath::IDBKeyPath):
1230         * Modules/indexeddb/IDBKeyPath.h:
1231         * WebCore.xcodeproj/project.pbxproj:
1232         * bindings/js/IDBBindingUtilities.cpp:
1233         (WebCore::idbKeyPathFromValue): Deleted.
1234         * bindings/js/IDBBindingUtilities.h:
1235         * bindings/js/JSIDBDatabaseCustom.cpp: Removed.
1236         * bindings/scripts/CodeGeneratorJS.pm:
1237         (GenerateParametersCheck):
1238         (GenerateConstructorDefinition):
1239         * dom/MessageEvent.cpp:
1240         (WebCore::MessageEvent::MessageEvent):
1241         (WebCore::MessageEvent::create):
1242         * dom/MessageEvent.h:
1243         * testing/TypeConversions.h:
1244         (WebCore::TypeConversions::setTypeConversionsDictionary):
1245
1246 2016-10-24  Alex Christensen  <achristensen@webkit.org>
1247
1248         URLParser should match old URL::parse with %2E in path
1249         https://bugs.webkit.org/show_bug.cgi?id=163929
1250
1251         Reviewed by Alexey Proskuryakov.
1252
1253         Covered by updated API tests, which show that URLParser now matches URL::parse in these cases.
1254         Also covered by newly failing web platform tests, which were failing before URLParser was enabled.
1255         If https://github.com/whatwg/url/issues/87 is resolved we can change behavior to match.
1256
1257         * platform/URLParser.cpp:
1258         (WebCore::URLParser::isSingleDotPathSegment):
1259         (WebCore::URLParser::isDoubleDotPathSegment):
1260         (WebCore::URLParser::consumeSingleDotPathSegment):
1261         (WebCore::URLParser::consumeDoubleDotPathSegment):
1262         (WebCore::URLParser::parse):
1263         (WebCore::URLParser::isPercentEncodedDot): Deleted.
1264
1265 2016-10-24  Zalan Bujtas  <zalan@apple.com>
1266
1267         Do not update selection rect on dirty lineboxes.
1268         https://bugs.webkit.org/show_bug.cgi?id=163862
1269         <rdar://problem/28813156>
1270
1271         Reviewed by Simon Fraser.
1272
1273         In certain cases RenderBlock::updateFirstLetter() triggers
1274         unwanted render tree mutation while the caller assumes intact renderers.
1275         This patch ensures that no renderers gets destroyed while computing the preferred widths
1276         when we are outside of layout context.
1277
1278         Test: fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html
1279
1280         * rendering/RenderBlock.cpp:
1281         (WebCore::RenderBlock::computePreferredLogicalWidths):
1282         (WebCore::RenderBlock::updateFirstLetter):
1283         * rendering/RenderBlock.h:
1284         * rendering/RenderListItem.cpp:
1285         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
1286         * rendering/RenderRubyRun.cpp:
1287         (WebCore::RenderRubyRun::updateFirstLetter):
1288         * rendering/RenderRubyRun.h:
1289         * rendering/RenderTable.cpp:
1290         (WebCore::RenderTable::updateFirstLetter):
1291         * rendering/RenderTable.h:
1292         * rendering/svg/RenderSVGText.cpp:
1293         (WebCore::RenderSVGText::updateFirstLetter):
1294         * rendering/svg/RenderSVGText.h:
1295
1296 2016-10-24  Ryan Haddad  <ryanhaddad@apple.com>
1297
1298         Unreviewed, rolling out r207795.
1299
1300         Introduced API test failures on iOS and macOS.
1301
1302         Reverted changeset:
1303
1304         "URLParser should match old URL::parse with %2E in path"
1305         https://bugs.webkit.org/show_bug.cgi?id=163929
1306         http://trac.webkit.org/changeset/207795
1307
1308 2016-10-24  Yusuke Suzuki  <utatane.tea@gmail.com>
1309
1310         Unreviewed, attempt to fix Windows build after r207787
1311         https://bugs.webkit.org/show_bug.cgi?id=163657
1312
1313         Make the constructor public in DOMJIT::AbstractHeapRepository to make Windows bot green.
1314         It's a bit unfortunate that we need to introduce a workaround here.
1315
1316         * domjit/DOMJITAbstractHeapRepository.h:
1317
1318 2016-10-24  Chris Dumez  <cdumez@apple.com>
1319
1320         event.(dataTransfer|clipboardData).getData('text/html') (onpaste, ondrop)
1321         https://bugs.webkit.org/show_bug.cgi?id=19893
1322         <rdar://problem/6055546>
1323
1324         Reviewed by Ryosuke Niwa.
1325
1326         We now write selection as HTML as well to the pasteboard so that
1327         event.(dataTransfer|clipboardData).getData('text/html') now works.
1328
1329         I have verified manually that it is still possible to copy text from
1330         Safari and paste it to Excel 2011 Mac after this change. The text is
1331         now pasted as HTML instead of text, which is fine because Excel can
1332         display HTML.
1333
1334         No new tests, unskipped existing tests.
1335
1336         * editing/Editor.h:
1337         * editing/mac/EditorMac.mm:
1338         (WebCore::Editor::selectionInHTMLFormat):
1339         (WebCore::Editor::writeSelectionToPasteboard):
1340         * platform/Pasteboard.h:
1341         * platform/mac/PasteboardMac.mm:
1342         (WebCore::Pasteboard::write):
1343
1344 2016-10-24  Alex Christensen  <achristensen@webkit.org>
1345
1346         URLParser should match old URL::parse with %2E in path
1347         https://bugs.webkit.org/show_bug.cgi?id=163929
1348
1349         Reviewed by Alexey Proskuryakov.
1350
1351         Covered by updated API tests, which show that URLParser now matches URL::parse in these cases.
1352         Also covered by newly failing web platform tests, which were failing before URLParser was enabled.
1353         If https://github.com/whatwg/url/issues/87 is resolved we can change behavior to match.
1354
1355         * platform/URLParser.cpp:
1356         (WebCore::URLParser::isSingleDotPathSegment):
1357         (WebCore::URLParser::isDoubleDotPathSegment):
1358         (WebCore::URLParser::consumeSingleDotPathSegment):
1359         (WebCore::URLParser::consumeDoubleDotPathSegment):
1360         (WebCore::URLParser::parse):
1361         (WebCore::URLParser::isPercentEncodedDot): Deleted.
1362
1363 2016-10-24  Per Arne Vollan  <pvollan@apple.com>
1364
1365         [Win] CMake build type is not set.
1366         https://bugs.webkit.org/show_bug.cgi?id=163917
1367
1368         Reviewed by Alex Christensen.
1369
1370         The CMAKE_BUILD_TYPE variable should be set to Debug or Release.
1371
1372         * WebCore.vcxproj/WebCore.proj:
1373
1374 2016-10-24  Yusuke Suzuki  <utatane.tea@gmail.com>
1375
1376         Unreviewed, attempt to fix Windows build after r207787
1377         https://bugs.webkit.org/show_bug.cgi?id=163657
1378
1379         According to the similar code in WebKit, I guess that
1380         Visual C++ requires friend class declaration is done
1381         in the private section to access private members.
1382
1383         And I also changed ::instance to ::shared to align to
1384         the existing WebCore code.
1385
1386         * domjit/DOMJITAbstractHeapRepository.cpp:
1387         (WebCore::DOMJIT::AbstractHeapRepository::shared):
1388         (WebCore::DOMJIT::AbstractHeapRepository::instance): Deleted.
1389         * domjit/DOMJITAbstractHeapRepository.h:
1390         * domjit/JSNodeDOMJIT.cpp:
1391         (WebCore::NodeFirstChildDOMJIT::callDOM):
1392         (WebCore::NodeLastChildDOMJIT::callDOM):
1393         (WebCore::NodeNextSiblingDOMJIT::callDOM):
1394         (WebCore::NodePreviousSiblingDOMJIT::callDOM):
1395         (WebCore::NodeParentNodeDOMJIT::callDOM):
1396
1397 2016-10-24  Simon Fraser  <simon.fraser@apple.com>
1398
1399         Fix the lifetime of strings used in LOG_WITH_STREAM
1400         https://bugs.webkit.org/show_bug.cgi?id=163923
1401
1402         Reviewed by Brent Fulgham.
1403
1404         Make sure the const char* passed to WTFLog() outlives the call.
1405
1406         Removed logFunctionResult which wasn't used anywhere else, and encourages this bad
1407         pattern.
1408
1409         * platform/LogMacros.h:
1410         * platform/Logging.cpp:
1411         (WebCore::logFunctionResult): Deleted.
1412
1413 2016-10-24  Chris Dumez  <cdumez@apple.com>
1414
1415         Reduce special handling for typed arrays in JSDOMConvert.h
1416         https://bugs.webkit.org/show_bug.cgi?id=163907
1417
1418         Reviewed by Sam Weinig.
1419
1420         Reduce special handling for typed arrays in JSDOMConvert.h by adding a toWrapped() static
1421         function on JSGenericTypedArrayView, similarly to other wrapper types.
1422
1423         No new tests, no web-exposed behavior change.
1424
1425         * bindings/js/JSDOMConvert.h:
1426         (WebCore::Converter<IDLInterface<JSC::GenericTypedArrayView<Adaptor>>>::convert): Deleted.
1427
1428 2016-10-24  Ryan Haddad  <ryanhaddad@apple.com>
1429
1430         Unreviewed, rolling out r207783.
1431
1432         This change appears to have caused fast/selectors/invalid-
1433         functional-pseudo-class.html to crash on iOS and macOS
1434
1435         Reverted changeset:
1436
1437         "[CSS Parser] Fix :lang argument parsing"
1438         https://bugs.webkit.org/show_bug.cgi?id=163913
1439         http://trac.webkit.org/changeset/207783
1440
1441 2016-10-24  Brady Eidson  <beidson@apple.com>
1442
1443         IndexedDB 2.0: Support new IDBKeyRange interfaces.
1444         <rdar://problem/28806929> and https://bugs.webkit.org/show_bug.cgi?id=163910
1445
1446         Reviewed by Andy Estes.
1447
1448         No new tests (Covered by additions to existing test)
1449
1450         The "new IDBKeyRanges interfaces" really just means adding the instance method IDBKeyRange.contains.
1451
1452         * Modules/indexeddb/IDBKeyRange.cpp:
1453         (WebCore::IDBKeyRange::contains):
1454         * Modules/indexeddb/IDBKeyRange.h:
1455         * Modules/indexeddb/IDBKeyRange.idl:
1456
1457 2016-10-23  Yusuke Suzuki  <utatane.tea@gmail.com>
1458
1459         [DOMJIT] Add a way for DOMJIT::Patchpoint to express effects
1460         https://bugs.webkit.org/show_bug.cgi?id=163657
1461
1462         Reviewed by Saam Barati.
1463
1464         CallDOMPatchpoint now has the way to tell its effects to DFG and FTL compilers.
1465         WebCore DOMJIT::AbstractHeapRepository will construct the hierarchy of the abstract
1466         heap. And then it encodes these information into the pairs of the integers.
1467
1468         And this patch also changes the DOMJIT::PatchpointParams' parameter order.
1469         So we change them in all the DOMJIT::CallDOMPatchpoint sites.
1470
1471         * CMakeLists.txt:
1472         * ForwardingHeaders/domjit/DOMJITAbstractHeap.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
1473         * ForwardingHeaders/domjit/DOMJITEffect.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
1474         * ForwardingHeaders/domjit/DOMJITHeapRange.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
1475         * WebCore.xcodeproj/project.pbxproj:
1476         * domjit/DOMJITAbstractHeapRepository.cpp: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
1477         (WebCore::DOMJIT::AbstractHeapRepository::AbstractHeapRepository):
1478         (WebCore::DOMJIT::AbstractHeapRepository::instance):
1479         * domjit/DOMJITAbstractHeapRepository.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
1480         * domjit/DOMJITHelpers.h:
1481         (WebCore::DOMJITHelpers::branchIfNotWorldIsNormal): Deleted.
1482         (WebCore::DOMJITHelpers::branchIfNotWeakIsLive): Deleted.
1483         (WebCore::DOMJITHelpers::tryLookUpWrapperCache): Deleted.
1484         (WebCore::DOMJITHelpers::toWrapper): Deleted.
1485         (WebCore::DOMJITHelpers::branchIfDOMWrapper): Deleted.
1486         (WebCore::DOMJITHelpers::branchIfNotDOMWrapper): Deleted.
1487         (WebCore::DOMJITHelpers::branchIfNode): Deleted.
1488         (WebCore::DOMJITHelpers::branchIfNotNode): Deleted.
1489         (WebCore::DOMJITHelpers::branchIfElement): Deleted.
1490         (WebCore::DOMJITHelpers::branchIfNotElement): Deleted.
1491         (WebCore::DOMJITHelpers::branchIfDocumentWrapper): Deleted.
1492         (WebCore::DOMJITHelpers::branchIfNotDocumentWrapper): Deleted.
1493         * domjit/JSNodeDOMJIT.cpp:
1494         (WebCore::createCallDOMForOffsetAccess):
1495         (WebCore::checkNode):
1496         (WebCore::NodeFirstChildDOMJIT::checkDOM):
1497         (WebCore::NodeFirstChildDOMJIT::callDOM):
1498         (WebCore::NodeLastChildDOMJIT::checkDOM):
1499         (WebCore::NodeLastChildDOMJIT::callDOM):
1500         (WebCore::NodeNextSiblingDOMJIT::checkDOM):
1501         (WebCore::NodeNextSiblingDOMJIT::callDOM):
1502         (WebCore::NodePreviousSiblingDOMJIT::checkDOM):
1503         (WebCore::NodePreviousSiblingDOMJIT::callDOM):
1504         (WebCore::NodeParentNodeDOMJIT::checkDOM):
1505         (WebCore::NodeParentNodeDOMJIT::callDOM):
1506         (WebCore::NodeNodeTypeDOMJIT::checkDOM):
1507         (WebCore::NodeNodeTypeDOMJIT::callDOM):
1508
1509 2016-10-24  Dave Hyatt  <hyatt@apple.com>
1510
1511         [CSS Parser] Fix :lang argument parsing
1512         https://bugs.webkit.org/show_bug.cgi?id=163913
1513
1514         Reviewed by Zalan Bujtas.
1515
1516         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
1517         Modify the map to support versions of the function pseudos
1518         without the left paren included.
1519
1520         * css/parser/CSSParserValues.cpp:
1521         (WebCore::CSSParserSelector::setLangArgumentList):
1522         * css/parser/CSSParserValues.h:
1523         Add a helper to just directly pass an AtomicString Vector through.
1524
1525         * css/parser/CSSSelectorParser.cpp:
1526         (WebCore::consumeLangArgumentList):
1527         (WebCore::CSSSelectorParser::consumePseudo):
1528         Add a new consumeLangArgumentList to collect the languages into
1529         an AtomicString Vector.
1530
1531 2016-10-24  Alex Christensen  <achristensen@webkit.org>
1532
1533         Fix AppleWin build after r207720.
1534
1535         * html/canvas/OESVertexArrayObject.cpp:
1536
1537 2016-10-24  Alex Christensen  <achristensen@webkit.org>
1538
1539         Fix AppleWin build after r207720.
1540
1541         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
1542
1543 2016-10-24  Alex Christensen  <achristensen@webkit.org>
1544
1545         Fix Windows build after r207767 and r207769
1546
1547         * css/CSSAllInOne.cpp:
1548         * platform/network/curl/ResourceHandleManager.cpp:
1549         (WebCore::getProtectionSpace):
1550
1551 2016-10-24  Per Arne Vollan  <pvollan@apple.com>
1552
1553         [Win] AVCF based media engine does not block cross-site/cross-domain loads.
1554         https://bugs.webkit.org/show_bug.cgi?id=163783
1555
1556         Reviewed by Brent Fulgham.
1557
1558         Prevent cross-site/cross-domain loads by setting appropriate AVCF options.
1559
1560         No new tests; covered by media/video-canvas-source.html. Media tests are
1561         currently skipped on Windows.
1562
1563         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h:
1564         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1565         (WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURL):
1566         (WebCore::MediaPlayerPrivateAVFoundationCF::hasSingleSecurityOrigin):
1567         (WebCore::AVFWrapper::createAssetForURL):
1568         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1569
1570 2016-10-24  Anders Carlsson  <andersca@apple.com>
1571
1572         Fix build with newer versions of clang
1573         https://bugs.webkit.org/show_bug.cgi?id=163908
1574         rdar://problem/28852016
1575
1576         Reviewed by Tim Horton.
1577
1578         Use the macros that names the soft-linked functions in such a way that they won't conflict with actual functions.
1579
1580         * platform/ios/PlatformScreenIOS.mm:
1581         (WebCore::screenIsMonochrome):
1582         (WebCore::screenHasInvertedColors):
1583         (WebCore::screenSize):
1584         (WebCore::availableScreenSize):
1585         (WebCore::screenScaleFactor):
1586
1587 2016-10-24  Joseph Pecoraro  <pecoraro@apple.com>
1588
1589         Remove unnecessary unused variable stubs
1590         https://bugs.webkit.org/show_bug.cgi?id=163688
1591
1592         Reviewed by Simon Fraser.
1593
1594         * Modules/applepay/cocoa/PaymentCocoa.mm:
1595         (WebCore::toDictionary):
1596         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1597         (WebCore::toDictionary):
1598
1599 2016-10-24  Alex Christensen  <achristensen@webkit.org>
1600
1601         Try to fix Windows build after r207767
1602         https://bugs.webkit.org/show_bug.cgi?id=163891
1603
1604         * DerivedSources.cpp:
1605
1606 2016-10-24  Zan Dobersek  <zdobersek@igalia.com>
1607
1608         [CodeGenerator] Only allow a single interface or standalone dictionary per WebIDL file
1609         https://bugs.webkit.org/show_bug.cgi?id=163889
1610
1611         Reviewed by Chris Dumez.
1612
1613         Assert that there's only one interface or standalone dictionary
1614         per WebIDL input file, and exit from the generator otherwise.
1615
1616         This avoids potential linking issues where multiple enumeration
1617         and dictionary bindings code can be generated if the source
1618         WebIDL for them is specified in a file that contains multiple
1619         interfaces or standalone dictionaries.
1620
1621         Additionally, the generator now also exits if it fails to
1622         generate code for any interface of standalone dictionary. This
1623         should avoid processing WebIDL files that are empty in
1624         substance.
1625
1626         TestException.idl and TestInterface.idl files have their second
1627         interfaces removed. In place of those a new testing IDL file is
1628         added, TestInterfaceLeadingUnderscore.idl. Like the two removed
1629         interfaces, it tests that the leading underscode in the
1630         identifier is removed by the generator.
1631
1632         * bindings/scripts/CodeGenerator.pm:
1633         (ProcessDocument):
1634         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: Added.
1635         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::create):
1636         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::createStructure):
1637         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype):
1638         (WebCore::JSTestInterfaceLeadingUnderscoreConstructor::prototypeForStructure):
1639         (WebCore::JSTestInterfaceLeadingUnderscoreConstructor::initializeProperties):
1640         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation):
1641         (WebCore::JSTestInterfaceLeadingUnderscore::JSTestInterfaceLeadingUnderscore):
1642         (WebCore::JSTestInterfaceLeadingUnderscore::createPrototype):
1643         (WebCore::JSTestInterfaceLeadingUnderscore::prototype):
1644         (WebCore::JSTestInterfaceLeadingUnderscore::destroy):
1645         (WebCore::BindingCaller<JSTestInterfaceLeadingUnderscore>::castForAttribute):
1646         (WebCore::jsTestInterfaceLeadingUnderscoreReadonly):
1647         (WebCore::jsTestInterfaceLeadingUnderscoreReadonlyGetter):
1648         (WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
1649         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
1650         (WebCore::JSTestInterfaceLeadingUnderscore::getConstructor):
1651         (WebCore::JSTestInterfaceLeadingUnderscoreOwner::isReachableFromOpaqueRoots):
1652         (WebCore::JSTestInterfaceLeadingUnderscoreOwner::finalize):
1653         (WebCore::toJSNewlyCreated):
1654         (WebCore::toJS):
1655         (WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
1656         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h: Renamed from Source/WebCore/bindings/scripts/test/JS/JSreadonly.h.
1657         (WebCore::JSTestInterfaceLeadingUnderscore::create):
1658         (WebCore::JSTestInterfaceLeadingUnderscore::createStructure):
1659         (WebCore::JSTestInterfaceLeadingUnderscore::finishCreation):
1660         (WebCore::wrapperOwner):
1661         (WebCore::wrapperKey):
1662         (WebCore::toJS):
1663         (WebCore::toJSNewlyCreated):
1664         * bindings/scripts/test/JS/JSattribute.cpp: Removed.
1665         * bindings/scripts/test/JS/JSattribute.h: Removed.
1666         * bindings/scripts/test/JS/JSreadonly.cpp: Removed.
1667         * bindings/scripts/test/TestException.idl:
1668         * bindings/scripts/test/TestInterface.idl:
1669         * bindings/scripts/test/TestInterfaceLeadingUnderscore.idl: Copied from Source/WebCore/bindings/scripts/test/TestException.idl.
1670
1671 2016-10-21  Alex Christensen  <achristensen@webkit.org>
1672
1673         URL::port should return Optional<uint16_t>
1674         https://bugs.webkit.org/show_bug.cgi?id=163806
1675
1676         Reviewed by Darin Adler.
1677
1678         A URL without a port is different than a URL with port 0.
1679         This matches the spec, Chrome, and Firefox.
1680
1681         Covered by newly-passing web platform tests.
1682
1683         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1684         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
1685         (WebCore::IDBDatabaseIdentifier::isHashTableDeletedValue):
1686         (WebCore::IDBDatabaseIdentifier::hash):
1687         (WebCore::IDBDatabaseIdentifier::isValid):
1688         (WebCore::IDBDatabaseIdentifier::isEmpty):
1689         * Modules/websockets/WebSocket.cpp:
1690         (WebCore::WebSocket::connect):
1691         * Modules/websockets/WebSocketHandshake.cpp:
1692         (WebCore::hostName):
1693         * contentextensions/ContentExtensionsBackend.cpp:
1694         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
1695         (WebCore::ContentExtensions::applyBlockedStatusToRequest):
1696         * html/HTMLPlugInImageElement.cpp:
1697         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
1698         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
1699         * html/URLUtils.h:
1700         (WebCore::URLUtils<T>::protocol):
1701         (WebCore::URLUtils<T>::host):
1702         (WebCore::URLUtils<T>::port):
1703         * loader/CrossOriginAccessControl.cpp:
1704         (WebCore::isValidCrossOriginRedirectionURL):
1705         * loader/DocumentLoader.cpp:
1706         (WebCore::DocumentLoader::responseReceived):
1707         (WebCore::isRemoteWebArchive):
1708         (WebCore::DocumentLoader::maybeLoadEmpty):
1709         * loader/DocumentThreadableLoader.cpp:
1710         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
1711         * loader/ResourceLoader.cpp:
1712         (WebCore::ResourceLoader::didReceiveResponse):
1713         * loader/cache/CachedResource.cpp:
1714         (WebCore::shouldCacheSchemeIndefinitely):
1715         (WebCore::CachedResource::freshnessLifetime):
1716         * page/Location.cpp:
1717         (WebCore::Location::protocol):
1718         (WebCore::Location::host):
1719         (WebCore::Location::port):
1720         * page/Page.cpp:
1721         (WebCore::Page::userStyleSheetLocationChanged):
1722         * page/SecurityOrigin.cpp:
1723         (WebCore::shouldTreatAsUniqueOrigin):
1724         (WebCore::SecurityOrigin::SecurityOrigin):
1725         (WebCore::SecurityOrigin::isSecure):
1726         (WebCore::SecurityOrigin::canDisplay):
1727         (WebCore::SecurityOrigin::toRawString):
1728         (WebCore::SecurityOrigin::create):
1729         (WebCore::SecurityOrigin::databaseIdentifier):
1730         * page/SecurityOrigin.h:
1731         (WebCore::SecurityOrigin::port):
1732         * page/SecurityOriginData.cpp:
1733         (WebCore::SecurityOriginData::debugString):
1734         * page/SecurityOriginData.h:
1735         (): Deleted.
1736         * page/SecurityOriginHash.h:
1737         (WebCore::SecurityOriginHash::hash):
1738         * page/csp/ContentSecurityPolicy.cpp:
1739         (WebCore::ContentSecurityPolicy::allowObjectFromSource):
1740         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource):
1741         (WebCore::ContentSecurityPolicy::allowResourceFromSource):
1742         (WebCore::ContentSecurityPolicy::allowConnectToSource):
1743         (WebCore::ContentSecurityPolicy::allowBaseURI):
1744         (WebCore::stripURLForUseInReport):
1745         (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded):
1746         * page/csp/ContentSecurityPolicySource.cpp:
1747         (WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
1748         (WebCore::ContentSecurityPolicySource::portMatches):
1749         * page/csp/ContentSecurityPolicySource.h:
1750         * page/csp/ContentSecurityPolicySourceList.cpp:
1751         (WebCore::ContentSecurityPolicySourceList::parse):
1752         (WebCore::ContentSecurityPolicySourceList::parseSource):
1753         (WebCore::ContentSecurityPolicySourceList::parsePort):
1754         * page/csp/ContentSecurityPolicySourceList.h:
1755         * platform/SchemeRegistry.h:
1756         * platform/URL.cpp:
1757         (WebCore::URL::protocol):
1758         (WebCore::URL::port):
1759         (WebCore::URL::serialize):
1760         (WebCore::portAllowed):
1761         (WebCore::defaultPortsMap): Deleted.
1762         (WebCore::defaultPortForProtocol): Deleted.
1763         (WebCore::isDefaultPortForProtocol): Deleted.
1764         * platform/URL.h:
1765         (WebCore::URL::hasPort): Deleted.
1766         * platform/URLParser.cpp:
1767         (WebCore::defaultPortForProtocol):
1768         (WebCore::isDefaultPortForProtocol):
1769         (WebCore::URLParser::parsePort):
1770         (WebCore::isDefaultPort): Deleted.
1771         * platform/network/CredentialStorage.cpp:
1772         (WebCore::originStringFromURL):
1773         * platform/network/ResourceHandle.cpp:
1774         (WebCore::ResourceHandle::create):
1775         (WebCore::ResourceHandle::loadResourceSynchronously):
1776         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1777         (WebCore::SocketStreamHandleImpl::platformClose):
1778         (WebCore::SocketStreamHandleImpl::port):
1779         * workers/WorkerLocation.cpp:
1780         (WebCore::WorkerLocation::protocol):
1781         (WebCore::WorkerLocation::host):
1782         (WebCore::WorkerLocation::port):
1783
1784 2016-10-24  Zan Dobersek  <zdobersek@igalia.com>
1785
1786         [CodeGeneratorJS] Support enums for standalone dictionaries
1787         https://bugs.webkit.org/show_bug.cgi?id=163885
1788
1789         Reviewed by Youenn Fablet.
1790
1791         Add support for enumerations in WebIDL files that specify
1792         standalone dictionaries. Implementation of this is pretty
1793         straight-forward and mirrors interface and callback generators
1794         by calling GenerateEnumerations{Header,Implementation}Content()
1795         functions in GenerateDictionary{Header,Implementation}().
1796
1797         In GenerateEnumerationsImplementationContent(), the
1798         NeverDestroyed.h header is added to the implementation includes
1799         since that class is used to hold an array of possible enum
1800         values.
1801
1802         A test enum is added to the TestStandaloneDictionary.idl file
1803         and the baselines are updated to reflect the new capability.
1804
1805         * bindings/scripts/CodeGenerator.pm:
1806         (ProcessDocument):
1807         * bindings/scripts/CodeGeneratorJS.pm:
1808         (GenerateDictionary):
1809         (GenerateEnumerationsImplementationContent):
1810         (GenerateDictionaryHeader):
1811         (GenerateDictionaryImplementation):
1812         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
1813         (WebCore::convertEnumerationToJS):
1814         (WebCore::parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
1815         (WebCore::convertEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
1816         (WebCore::expectedEnumerationValues<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
1817         (WebCore::convertDictionary<DictionaryImplName>):
1818         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
1819         * bindings/scripts/test/TestStandaloneDictionary.idl:
1820
1821 2016-10-24  Dave Hyatt  <hyatt@apple.com>
1822
1823         Remove CSSCharsetRule from the CSS OM
1824         https://bugs.webkit.org/show_bug.cgi?id=163891
1825
1826         Reviewed by Darin Adler.
1827
1828         Remove CSSCharsetRule from the CSS OM. All other browser engines have made this
1829         change. This eliminates the weird overloading of isCharsetRule to match both
1830         CSSCharsetRule and StyleRuleCharset (only used by the new parser).
1831
1832         Fix the destroy() method in StyleRuleBase to clean up StyleRuleCharsets created
1833         by the new parser properly.
1834
1835         * CMakeLists.txt:
1836         * DerivedSources.make:
1837         * WebCore.xcodeproj/project.pbxproj:
1838         * bindings/js/JSCSSRuleCustom.cpp:
1839         (WebCore::toJSNewlyCreated):
1840         * css/CSSCharsetRule.cpp: Removed.
1841         * css/CSSCharsetRule.h: Removed.
1842         * css/CSSCharsetRule.idl: Removed.
1843         * css/CSSPropertySourceData.h:
1844         * css/CSSStyleSheet.cpp:
1845         (WebCore::CSSStyleSheet::item):
1846         (WebCore::CSSStyleSheet::rules):
1847         * css/CSSStyleSheet.h:
1848         * css/StyleRule.cpp:
1849         (WebCore::StyleRuleBase::destroy):
1850         * inspector/InspectorStyleSheet.cpp:
1851         (WebCore::asCSSRuleList):
1852
1853 2016-10-24  Zan Dobersek  <zdobersek@igalia.com>
1854
1855         [CodeGeneratorJS] Standalone dictionaries have misplaced build guards
1856         https://bugs.webkit.org/show_bug.cgi?id=163881
1857
1858         Reviewed by Chris Dumez.
1859
1860         Build guards that are generated from the Conditional attribute
1861         on WebIDL dictionary declarations properly guard the relevant
1862         convertDictionary() functions for WebIDL files that also specify
1863         interfaces. But for standalone dictionaries these build guards
1864         should guard the complete header and implementation files, much
1865         like this is done for files that originate from interfaces or
1866         callbacks.
1867
1868         Before this patch, guarding a standalone dictionary resulted in
1869         malformed output because GenerateHeaderContentHeader() and
1870         GenerateImplementationContentHeader() functions both generated
1871         the #if macro that would guard the whole file, but
1872         GenerateDictionary{Header,Implementation}() didn't generate the
1873         closing #endif.
1874
1875         CodeGeneratorJS.pm now passes the conditional string, if any,
1876         to GenerateDictionary{Header,Implementation}Content() functions
1877         in case of a non-standalone dictionary. Otherwise, the
1878         conditional string, if any, is used to guard the complete
1879         header and implementation files.
1880
1881         Generator tests are updated to cover various build guard
1882         combinations on dictionaries in TestObj.idl, and the standalone
1883         dictionary WebIDL file now has a Conditional attribute to check
1884         that the build guards cover complete generated header and
1885         implementation files.
1886
1887         * bindings/scripts/CodeGeneratorJS.pm:
1888         (GenerateDictionaryHeaderContent):
1889         (GenerateDictionariesHeaderContent):
1890         (GenerateDictionaryImplementationContent):
1891         (GenerateDictionariesImplementationContent):
1892         (GenerateDictionaryHeader):
1893         (GenerateDictionaryImplementation):
1894         * bindings/scripts/test/JS/JSTestObj.cpp:
1895         (WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
1896         (WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
1897         (WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):
1898         * bindings/scripts/test/JS/JSTestObj.h:
1899         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
1900         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
1901         * bindings/scripts/test/TestObj.idl:
1902         * bindings/scripts/test/TestStandaloneDictionary.idl:
1903
1904 2016-10-24  Eric Carlson  <eric.carlson@apple.com>
1905
1906         [MediaStream] Separate media capture and audio playback muting
1907         https://bugs.webkit.org/show_bug.cgi?id=163855
1908         <rdar://problem/28827186>
1909
1910         Reviewed by Darin Adler.
1911
1912         Test: fast/mediastream/MediaStream-page-muted.html
1913
1914         Change page.muted from a bool to a bitfield so audio and media capture muted are independent.
1915         Fix a couple of bugs in the mock media capture device uncovered by new test case.
1916         
1917         * Modules/mediastream/MediaStream.cpp:
1918         (WebCore::MediaStream::pageMutedStateDidChange): page.isMuted -> page.mutedState.
1919
1920         * Modules/webaudio/AudioContext.cpp:
1921         (WebCore::AudioContext::pageMutedStateDidChange): Ditto.
1922
1923         * html/HTMLMediaElement.cpp:
1924         (WebCore::HTMLMediaElement::updateVolume): Ditto.
1925         (WebCore::HTMLMediaElement::effectiveMuted): Ditto.
1926
1927         * page/MediaProducer.h: Add MutedState enum.
1928
1929         * page/Page.cpp:
1930         (WebCore::Page::Page):
1931         (WebCore::Page::setMuted): Take MutedStateFlags instead of bool. m_muted -> m_mutedState.
1932         * page/Page.h:
1933
1934         * platform/mock/MockRealtimeMediaSource.cpp:
1935         (WebCore::MockRealtimeMediaSource::startProducingData): Call setMuted.
1936         (WebCore::MockRealtimeMediaSource::stopProducingData): Ditto.
1937         * platform/mock/MockRealtimeMediaSource.h:
1938
1939         * platform/mock/MockRealtimeVideoSource.cpp:
1940         (WebCore::MockRealtimeVideoSource::stopProducingData): Call correct base class method.
1941
1942         * testing/Internals.cpp:
1943         (WebCore::Internals::setPageMuted): Change parameter from a bool to a string.
1944         * testing/Internals.h:
1945
1946         * testing/Internals.idl:
1947
1948 2016-10-24  Darin Adler  <darin@apple.com>
1949
1950         Try to fix Windows build.
1951
1952         * bindings/js/JSWebGL2RenderingContextCustom.cpp: Rearranged includes
1953         so they are inside the conditional as they should be.
1954
1955 2016-10-24  Youenn Fablet  <youenn@apple.com>
1956
1957         Activate WEB_RTC compilation flags for Mac bots
1958         https://bugs.webkit.org/show_bug.cgi?id=163886
1959
1960         Reviewed by Eric Carlson.
1961
1962         Covered by existing tests.
1963
1964         Fixing compilation errors due to missing WEBCORE_EXPORT, missing method and missing override keywords.
1965
1966         * Configurations/FeatureDefines.xcconfig:
1967         * DerivedSources.make:
1968         * Modules/mediastream/MediaEndpointPeerConnection.h:
1969         * Modules/mediastream/RTCPeerConnection.h:
1970         * Modules/mediastream/RTCPeerConnection.idl:
1971         * Modules/mediastream/SDPProcessor.cpp:
1972         (WebCore::SDPProcessor::generate):
1973         (WebCore::SDPProcessor::parse):
1974         * WebCore.xcodeproj/project.pbxproj:
1975         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
1976         (WebCore::MockRealtimeVideoSource::createMuted):
1977
1978 2016-10-24  Brady Eidson  <beidson@apple.com>
1979
1980         IndexedDB 2.0: Support IDBIndex name assignment.
1981         <rdar://problem/28806932> and https://bugs.webkit.org/show_bug.cgi?id=163805
1982
1983         Reviewed by Alex Christensen.
1984
1985         Tests: storage/indexeddb/modern/index-rename-1-private.html
1986                storage/indexeddb/modern/index-rename-1.html
1987
1988         Touches a *lot* of code sites, but none of them are particularly interesting.
1989         They are all just getting the new name spread out to all of the various objects that need it.
1990
1991         * Modules/indexeddb/IDBDatabase.cpp:
1992         (WebCore::IDBDatabase::renameIndex):
1993         * Modules/indexeddb/IDBDatabase.h:
1994
1995         * Modules/indexeddb/IDBIndex.cpp:
1996         (WebCore::IDBIndex::IDBIndex):
1997         (WebCore::IDBIndex::setName):
1998         (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
1999         * Modules/indexeddb/IDBIndex.h:
2000         * Modules/indexeddb/IDBIndex.idl:
2001
2002         * Modules/indexeddb/IDBObjectStore.cpp:
2003         (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
2004         (WebCore::IDBObjectStore::renameReferencedIndex):
2005         (WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort): Deleted.
2006         * Modules/indexeddb/IDBObjectStore.h:
2007
2008         * Modules/indexeddb/IDBTransaction.cpp:
2009         (WebCore::IDBTransaction::internalAbort):
2010         (WebCore::IDBTransaction::renameIndex):
2011         (WebCore::IDBTransaction::renameIndexOnServer):
2012         (WebCore::IDBTransaction::didRenameIndexOnServer):
2013         * Modules/indexeddb/IDBTransaction.h:
2014
2015         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2016         (WebCore::IDBClient::IDBConnectionProxy::renameIndex):
2017         * Modules/indexeddb/client/IDBConnectionProxy.h:
2018
2019         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2020         (WebCore::IDBClient::IDBConnectionToServer::renameIndex):
2021         (WebCore::IDBClient::IDBConnectionToServer::didRenameIndex):
2022         * Modules/indexeddb/client/IDBConnectionToServer.h:
2023         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2024
2025         * Modules/indexeddb/client/TransactionOperation.h:
2026         (WebCore::IDBClient::createTransactionOperation):
2027
2028         * Modules/indexeddb/server/IDBBackingStore.h:
2029
2030         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2031         (WebCore::IDBServer::IDBConnectionToClient::didRenameIndex):
2032         * Modules/indexeddb/server/IDBConnectionToClient.h:
2033         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2034
2035         * Modules/indexeddb/server/IDBServer.cpp:
2036         (WebCore::IDBServer::IDBServer::renameIndex):
2037         * Modules/indexeddb/server/IDBServer.h:
2038
2039         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
2040         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexRenamed):
2041         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
2042         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
2043
2044         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2045         (WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
2046         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2047
2048         * Modules/indexeddb/server/MemoryIndex.h:
2049         (WebCore::IDBServer::MemoryIndex::rename):
2050
2051         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2052         (WebCore::IDBServer::MemoryObjectStore::renameIndex):
2053         * Modules/indexeddb/server/MemoryObjectStore.h:
2054
2055         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2056         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
2057         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2058
2059         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2060         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
2061         (WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex):
2062         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameIndex):
2063         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2064
2065         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
2066         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex):
2067         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
2068
2069         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
2070         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
2071         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2072
2073         * Modules/indexeddb/shared/IDBIndexInfo.h:
2074         (WebCore::IDBIndexInfo::rename):
2075
2076         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
2077         (WebCore::IDBObjectStoreInfo::infoForExistingIndex):
2078         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
2079
2080         * Modules/indexeddb/shared/IDBResultData.cpp:
2081         (WebCore::IDBResultData::renameIndexSuccess):
2082         * Modules/indexeddb/shared/IDBResultData.h:
2083
2084         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2085         (WebCore::InProcessIDBServer::didRenameIndex):
2086         (WebCore::InProcessIDBServer::renameIndex):
2087         * Modules/indexeddb/shared/InProcessIDBServer.h:
2088
2089 2016-10-24  Dave Hyatt  <hyatt@apple.com>
2090
2091         [CSS Parser] Fix -webkit-box-reflect parsing
2092         https://bugs.webkit.org/show_bug.cgi?id=163890
2093
2094         Reviewed by Zalan Bujtas.
2095
2096         * css/parser/CSSPropertyParser.cpp:
2097         (WebCore::consumeReflect):
2098         Do a WTFMove on the mask instead of a .releaseNonNull(), since mask can be a nullptr.
2099         Exactly matches the old parser.
2100
2101         * css/parser/CSSPropertyParserHelpers.cpp:
2102         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeValue):
2103         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
2104         (WebCore::CSSPropertyParserHelpers::consumeInteger):
2105         (WebCore::CSSPropertyParserHelpers::consumeNumber):
2106         (WebCore::CSSPropertyParserHelpers::consumeLength):
2107         (WebCore::CSSPropertyParserHelpers::consumePercent):
2108         (WebCore::CSSPropertyParserHelpers::consumeAngle):
2109         (WebCore::CSSPropertyParserHelpers::consumeTime):
2110         (WebCore::CSSPropertyParserHelpers::consumeUrl):
2111         (WebCore::CSSPropertyParserHelpers::consumeColor):
2112         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint):
2113         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
2114         (WebCore::CSSPropertyParserHelpers::consumeCrossFade):
2115         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
2116         Clean up all instances of CSSPrimitiveValue::create to use the CSSValuePool.
2117
2118 2016-10-21  Antoine Quint  <graouts@apple.com>
2119
2120         [Modern Media Controls] Concatenate JS and CSS files into a single JS and CSS resources
2121         https://bugs.webkit.org/show_bug.cgi?id=163785
2122         <rdar://problem/28890058>
2123
2124         Reviewed by Darin Adler.
2125
2126         Concatenate CSS and JS resources for modern media controls into single JS and CSS files
2127         during build and load these single resources alone at runtime.
2128
2129         * Modules/modern-media-controls/js-files: Added.
2130         * WebCore.xcodeproj/project.pbxproj:
2131         * rendering/RenderThemeMac.mm:
2132         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
2133         (WebCore::RenderThemeMac::mediaControlsScript):
2134
2135 2016-10-24  Dave Hyatt  <hyatt@apple.com>
2136
2137         [CSS Parser] Unprefix -webkit-writing-mode
2138         https://bugs.webkit.org/show_bug.cgi?id=163870
2139
2140         Reviewed by Zalan Bujtas.
2141
2142         * css/CSSComputedStyleDeclaration.cpp:
2143         (WebCore::ComputedStyleExtractor::propertyValue):
2144         Change -webkit-writing mode to writing-mode.
2145
2146         * css/CSSPrimitiveValueMappings.h:
2147         (WebCore::CSSPrimitiveValue::operator WritingMode):
2148         (WebCore::CSSPrimitiveValue::operator SVGWritingMode): Deleted.
2149         Eliminate the SVGWritingMode converters. Add support for the unique SVG-specific
2150         values to the WritingMode converters.
2151
2152         * css/CSSPropertyNames.in:
2153         Alias -webkit-writing-mode to writing-mode. Move writing-mode up to be
2154         high priority like -webkit-writing mode was. Alias -epub-writing-mode to writing-mode
2155         instead of to -webkit-writing-mode.
2156
2157         * css/SVGCSSComputedStyleDeclaration.cpp:
2158         (WebCore::ComputedStyleExtractor::svgPropertyValue):
2159         Remove writing-mode from SVG computed style, since the base CSSComputedStyleDeclaration handles it.
2160
2161         * css/StyleBuilderCustom.h:
2162         (WebCore::StyleBuilderCustom::applyValueWritingMode):
2163         (WebCore::StyleBuilderCustom::applyValueWebkitWritingMode): Deleted.
2164         Renamed applyValueWebkitWritingMode to applyValueWritingMode. Removed the SVG code, since
2165         the underlying converter for WritingMode now handles those values.
2166
2167         * css/StyleResolver.cpp:
2168         (WebCore::extractDirectionAndWritingMode):
2169         Rename -webkit-writing-mode to writing-mode.
2170
2171         * css/parser/CSSParser.cpp:
2172         (WebCore::isValidKeywordPropertyAndValue):
2173         Eliminate -webkit-writing-mode and make sure writing-mode handles both the SVG values
2174         and the normal values.
2175
2176         * css/parser/CSSParserFastPaths.cpp:
2177         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2178         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2179         Same deal here.
2180
2181         * html/track/TextTrackCueGeneric.cpp:
2182         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
2183         * html/track/VTTCue.cpp:
2184         (WebCore::VTTCueBox::applyCSSProperties):
2185         Cue stuff was setting -webkit-writing-mode, so make it set writing-mode instead now.
2186
2187         * rendering/RenderLineBreak.cpp:
2188         (WebCore::RenderLineBreak::collectSelectionRects):
2189         * rendering/RenderText.cpp:
2190         (WebCore::RenderText::collectSelectionRects):
2191         Switch the SVG-specific code here over to accessing the RenderStyle writing-mode and not
2192         the SVG-specific one.
2193
2194         * rendering/style/RenderStyle.h:
2195         (WebCore::RenderStyle::isVerticalWritingMode):
2196         Add a helper function for asking if something is vertical writing mode.
2197
2198         * rendering/style/SVGRenderStyle.cpp:
2199         * rendering/style/SVGRenderStyle.h:
2200         * rendering/style/SVGRenderStyleDefs.h:
2201         (WebCore::SVGRenderStyle::diff):
2202         Remove the SVG writing mode code.
2203
2204         * rendering/svg/RenderSVGInlineText.cpp:
2205         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
2206         Make sure to force SVG font descriptions to be horizontal, since SVG controls
2207         its own glyph orientation.
2208
2209         * rendering/svg/SVGRenderTreeAsText.cpp:
2210         (WebCore::writeSVGInlineTextBox):
2211         * rendering/svg/SVGTextChunk.cpp:
2212         (WebCore::SVGTextChunk::SVGTextChunk):
2213         * rendering/svg/SVGTextLayoutEngine.cpp:
2214         (WebCore::SVGTextLayoutEngine::layoutInlineTextBox):
2215         * rendering/svg/SVGTextQuery.cpp:
2216         (WebCore::SVGTextQuery::executeQuery):
2217         Changed to access the RenderStyle writing mode instead of the SVG-specific one.
2218
2219 2016-10-23  Antti Koivisto  <antti@apple.com>
2220
2221         Avoid unnecessary full style resolution in getComputedStyle for non-inherited properties
2222         https://bugs.webkit.org/show_bug.cgi?id=163875
2223
2224         Reviewed by Andreas Kling.
2225
2226         Test: fast/css/getComputedStyle/getComputedStyle-style-resolution.html
2227
2228         * css/CSSComputedStyleDeclaration.cpp:
2229         (WebCore::hasValidStyleForProperty):
2230
2231             For non-inherited properties we don't need to update style even if some ancestor style is invalid
2232             as long as explicit 'inherit' is not being used.
2233             We still need to update if we find out that the whole subtree we are in is invalid.
2234
2235         (WebCore::updateStyleIfNeededForProperty):
2236
2237             Pass the property.
2238
2239         (WebCore::ComputedStyleExtractor::customPropertyValue):
2240         (WebCore::ComputedStyleExtractor::propertyValue):
2241         (WebCore::CSSComputedStyleDeclaration::length):
2242         (WebCore::elementOrItsAncestorNeedsStyleRecalc): Deleted.
2243         (WebCore::updateStyleIfNeededForElement): Deleted.
2244         * css/StyleResolver.cpp:
2245         (WebCore::StyleResolver::colorFromPrimitiveValue):
2246
2247             Mark style as using explicit inheritance if 'currentcolor' value is used.
2248
2249 2016-10-24  Youenn Fablet  <youenn@apple.com>
2250
2251         ASSERTION FAILED: canvas()->securityOrigin()->toString() == cachedImage.origin()->toString()
2252         https://bugs.webkit.org/show_bug.cgi?id=163242
2253
2254         Reviewed by Darin Adler.
2255
2256         Test: http/tests/security/cross-origin-cached-images-canvas.html
2257
2258         We were previously on Origin HTTP header to check whether requests were made from different origins.
2259         This is fine for CORS enabled requests but not for GET no CORS requests since they will not have any Origin header.
2260
2261         Now that CachedResource and CachedResourceRequest own their origin, it is best to use these directly.
2262
2263         * loader/cache/CachedResourceLoader.cpp:
2264         (WebCore::isRequestMatchingResourceOrigin):
2265         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
2266
2267 2016-10-24  Youenn Fablet  <youenn@apple.com>
2268
2269         Remove CachedResource::passesSameOriginPolicyCheck
2270         https://bugs.webkit.org/show_bug.cgi?id=163593
2271
2272         Reviewed by Andreas Kling.
2273
2274         No change of behavior.
2275
2276         Removing no-longer used code.
2277
2278         * loader/cache/CachedResource.cpp:
2279         (WebCore::CachedResource::redirectReceived):
2280         (WebCore::CachedResource::passesAccessControlCheck): Deleted.
2281         (WebCore::CachedResource::passesSameOriginPolicyCheck): Deleted.
2282         (WebCore::CachedResource::responseForSameOriginPolicyChecks): Deleted.
2283         * loader/cache/CachedResource.h:
2284         (WebCore::CachedResource::response):
2285
2286 2016-10-24  Youenn Fablet  <youenn@apple.com>
2287
2288         Redirections should be upgraded if CSP policy says so
2289         https://bugs.webkit.org/show_bug.cgi?id=163544
2290
2291         Reviewed by Darin Adler.
2292
2293         Test: http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/basic-upgrade-after-redirect.https.html
2294
2295         Introducing CachedResourceLoader::updateRequestAfterRedirection to do the checks that CachedResourceLoader is doing
2296         to the initial request, but for redirection requests.
2297
2298         Implemented URL upgrade according CSP policy, as specified by fetch algorithm.
2299         Minor refactoring in CachedResourceRequest to share some code.
2300         Fixing some constness issues.
2301
2302         * loader/SubresourceLoader.cpp:
2303         (WebCore::SubresourceLoader::willSendRequestInternal):
2304         * loader/cache/CachedResourceLoader.cpp:
2305         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
2306         (WebCore::CachedResourceLoader::canRequestAfterRedirection):
2307         (WebCore::CachedResourceLoader::updateRequestAfterRedirection):
2308         * loader/cache/CachedResourceLoader.h:
2309         * loader/cache/CachedResourceRequest.cpp:
2310         (WebCore::upgradeInsecureResourceRequestIfNeeded):
2311         (WebCore::CachedResourceRequest::upgradeInsecureRequestIfNeeded):
2312         * loader/cache/CachedResourceRequest.h:
2313
2314 2016-10-22  Sam Weinig  <sam@webkit.org>
2315
2316         [WebIDL] Add IDLType based toJS conversion
2317         https://bugs.webkit.org/show_bug.cgi?id=163861
2318
2319         Reviewed by Darin Adler.
2320
2321         Adds toJS<IDLType>() functions to be the new way of converting
2322         from implementation types to JS types. These are implemented via
2323         a similar mechanism to the convert<IDL>() functions, though specializations
2324         of a JSConverter struct (rather than the Converter structs). This allows
2325         us to support arbitrarily complex aggregate types easily (e.g. sequence<(Node or DOMString?)>).
2326
2327         * Modules/geolocation/Geoposition.idl:
2328         * dom/Event.idl:
2329         Add typedef for DOMTimeStamp. Eventually, our IDLParser should do this for us, but
2330         for now it allows us to simplify the type system.
2331
2332         * bindings/js/JSDOMBinding.h:
2333         (WebCore::JSValueTraits::arrayJSValue): Deleted.
2334         (WebCore::JSValueTraits<String>::arrayJSValue): Deleted.
2335         (WebCore::JSValueTraits<double>::arrayJSValue): Deleted.
2336         (WebCore::JSValueTraits<float>::arrayJSValue): Deleted.
2337         (WebCore::jsArray): Deleted.
2338         (WebCore::jsFrozenArray): Deleted.
2339         (WebCore::NativeValueTraits<String>::nativeValue): Deleted.
2340         (WebCore::NativeValueTraits<unsigned>::nativeValue): Deleted.
2341         (WebCore::NativeValueTraits<float>::nativeValue): Deleted.
2342         (WebCore::NativeValueTraits<double>::nativeValue): Deleted.
2343         (WebCore::toNullableJSNumber): Deleted.
2344         (WebCore::toJSArray): Deleted.
2345         (WebCore::toJSBoolean): Deleted.
2346         (WebCore::toJSNumber): Deleted.
2347         (WebCore::toJSString): Deleted.
2348         Remove many now-unneeded conversion functions.
2349
2350         * bindings/js/JSDOMConvert.h:
2351         (WebCore::toJS):
2352         Add 5 primary toJS functions which take combinations of the following
2353         arguments: ExecState, JSDOMGlobalObject, ThrowScope.  All take the value 
2354         to be converted as well, except in the case of the throwScope ones, where
2355         they take the value in an ExceptionOr<>.
2356
2357         To simplify the implementations of the JSConverter specializations, avoiding
2358         the need for each one to implement their conversion up to 3 times (one for just
2359         the value, one for the value and the ExecState, and one for the value, the ExecState
2360         and the global object), each JSConverter instead specifies whether it's converter
2361         needs an ExecState or global object via a static constexpr. We then use the 
2362         JSConverterOverloader template, to call the correct function. This can probably be
2363         improved in the future, by inferring the number of arguments needed via SFINAE, but
2364         this seemed like a more straightforward first cut.
2365
2366         (WebCore::JSConverter<IDLNullable<T>>::convert):
2367         (WebCore::JSConverter<IDLBoolean>::convert):
2368         (WebCore::JSConverter<IDLInterface<T>>::convert):
2369         (WebCore::JSConverter<IDLAny>::convert):
2370         (WebCore::JSConverter<IDLByte>::convert):
2371         (WebCore::JSConverter<IDLOctet>::convert):
2372         (WebCore::JSConverter<IDLShort>::convert):
2373         (WebCore::JSConverter<IDLUnsignedShort>::convert):
2374         (WebCore::JSConverter<IDLLong>::convert):
2375         (WebCore::JSConverter<IDLUnsignedLong>::convert):
2376         (WebCore::JSConverter<IDLLongLong>::convert):
2377         (WebCore::JSConverter<IDLUnsignedLongLong>::convert):
2378         (WebCore::JSConverter<IDLFloat>::convert):
2379         (WebCore::JSConverter<IDLUnrestrictedFloat>::convert):
2380         (WebCore::JSConverter<IDLDouble>::convert):
2381         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
2382         (WebCore::JSConverter<IDLDOMString>::convert):
2383         (WebCore::JSConverter<IDLUSVString>::convert):
2384         (WebCore::JSConverter<IDLSequence<T>>::convert):
2385         (WebCore::JSConverter<IDLFrozenArray<T>>::convert):
2386         (WebCore::JSConverter<IDLEnumeration<T>>::convert):
2387         (WebCore::JSConverter<IDLUnion<T...>>::convert):
2388         There is slightly more duplication than I would have liked, for instance we have a
2389         specialization for each numeric type, even though they are all the same, but that is
2390         something that can be improved going forward.
2391
2392         (WebCore::Converter<IDLUnion<T...>>::convert)
2393         Fix the normal IDLUnion converter to work with boolean types. This was caught by the
2394         test case I added via TypeConversions.idl.
2395         
2396         * bindings/js/JSDOMStringMapCustom.cpp:
2397         (WebCore::JSDOMStringMap::getOwnPropertySlotDelegate):
2398         * bindings/js/JSDOMWindowCustom.cpp:
2399         (WebCore::JSDOMWindow::setTimeout):
2400         (WebCore::JSDOMWindow::setInterval):
2401         * bindings/js/JSDataTransferCustom.cpp:
2402         (WebCore::JSDataTransfer::types):
2403         * bindings/js/JSMediaStreamTrackCustom.cpp:
2404         (WebCore::JSMediaStreamTrack::getCapabilities):
2405         * bindings/js/JSMutationCallback.cpp:
2406         (WebCore::JSMutationCallback::call):
2407         * bindings/js/JSSVGLengthCustom.cpp:
2408         (WebCore::JSSVGLength::value):
2409         Switch to use new toJS<> functions.
2410
2411         * bindings/scripts/CodeGeneratorJS.pm:
2412         (AddStringifierOperationIfNeeded):
2413         Fix stringifier function signature to contain an idlType.
2414
2415         (GenerateEnumerationsHeaderContent):
2416         Remove now unnecessary JSValueTraits specializations.
2417
2418         (JSValueToNativeIsHandledByDOMConvert):
2419         Renamed from IsHandledByDOMConvert, since that name is now ambiguous.
2420
2421         (JSValueToNative):
2422         Update for new name of IsHandledByDOMConvert.
2423
2424         (NativeToJSValueIsHandledByDOMConvert):
2425         Predicate guarding what types currently work with the new conversion system.
2426
2427         (NativeToJSValueDOMConvertNeedsState):
2428         Predicate for determining if the ExecState is needed in the conversion function.
2429
2430         (NativeToJSValueDOMConvertNeedsGlobalObject):
2431         Predicate for determining if the global object is needed in the conversion function.
2432
2433         (NativeToJSValue):
2434         Move things around a little bit and start converting use the new toJS<> when possible.
2435
2436         * bindings/scripts/IDLParser.pm:
2437         (parseAttributeOrOperationRest):
2438         Fix a missing place where were not setting the idlType.
2439  
2440         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2441         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2442         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2443         * bindings/scripts/test/JS/JSTestCallback.cpp:
2444         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
2445         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2446         * bindings/scripts/test/JS/JSTestException.cpp:
2447         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2448         * bindings/scripts/test/JS/JSTestInterface.cpp:
2449         * bindings/scripts/test/JS/JSTestNode.cpp:
2450         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2451         * bindings/scripts/test/JS/JSTestObj.cpp:
2452         * bindings/scripts/test/JS/JSTestObj.h:
2453         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2454         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2455         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2456         * bindings/scripts/test/JS/JSattribute.cpp:
2457         Update test results.
2458
2459         * testing/TypeConversions.h:
2460         (WebCore::TypeConversions::testUnion):
2461         (WebCore::TypeConversions::setTestUnion):
2462         (WebCore::TypeConversions::typeConversionsDictionarySequenceValue):
2463         (WebCore::TypeConversions::typeConversionsDictionaryUnionValue):
2464         * testing/TypeConversions.idl:
2465         Add a testUnion attribute, now that we can return unions to JS.
2466
2467 2016-10-23  Zalan Bujtas  <zalan@apple.com>
2468
2469         Unreviewed, rolling out r207727.
2470
2471         broke 15 selection test cases.
2472
2473         Reverted changeset:
2474
2475         "Do not update selection rect on dirty lineboxes."
2476         https://bugs.webkit.org/show_bug.cgi?id=163862
2477         http://trac.webkit.org/changeset/207727
2478
2479 2016-10-23  Chris Dumez  <cdumez@apple.com>
2480
2481         addEventListener() / removeEventListener() should use a union for last parameter
2482         https://bugs.webkit.org/show_bug.cgi?id=163863
2483
2484         Reviewed by Darin Adler.
2485
2486         addEventListener() / removeEventListener() should use a union for last parameter:
2487         - https://dom.spec.whatwg.org/#eventtarget
2488
2489         No new tests, no Web-exposed behavior change.
2490
2491         * bindings/js/JSDOMConvert.h:
2492         * dom/EventTarget.cpp:
2493         (WebCore::EventTarget::addEventListenerForBindings):
2494         (WebCore::EventTarget::removeEventListenerForBindings):
2495         * dom/EventTarget.h:
2496         * dom/EventTarget.idl:
2497
2498 2016-10-23  Zalan Bujtas  <zalan@apple.com>
2499
2500         Do not update selection rect on dirty lineboxes.
2501         https://bugs.webkit.org/show_bug.cgi?id=163862
2502         <rdar://problem/28813156>
2503
2504         Reviewed by Simon Fraser.
2505
2506         In addition to checking whether the renderer needs layout, we also need to check if its preferred
2507         width is clean and stop computing the selection rects, if needed (while adding a renderer to the tree,
2508         there's a transition phase where the parent's preferred width dirty bit is already set, but it does
2509         not yet need layout).
2510
2511         Tests: fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html
2512
2513         * rendering/RenderObject.cpp:
2514         (WebCore::RenderObject::canUpdateSelectionOnRootLineBoxes):
2515
2516 2016-10-22  Myles C. Maxfield  <mmaxfield@apple.com>
2517
2518         ASSERTION FAILED: m_fonts in &WebCore::FontCascade::primaryFont
2519         https://bugs.webkit.org/show_bug.cgi?id=163459
2520
2521         Reviewed by Darin Adler.
2522
2523         The CSS Units and Values spec states that font-relative units, when used
2524         in the font-size property, are resolved against the parent element. When
2525         calc() is specified, we were trying to resolve them against the current
2526         element, which is impossible because of the circular dependency. Instead,
2527         we should resolve against the parent style the same way as when calc() 
2528         isn't specified.
2529
2530         Test: fast/text/font-size-calc.html
2531
2532         * css/StyleBuilderCustom.h:
2533         (WebCore::StyleBuilderCustom::applyValueFontSize):
2534
2535 2016-10-22  Chris Dumez  <cdumez@apple.com>
2536
2537         [Web IDL] Two types are distinguishable for overload resolution if at most one of the two includes a nullable type
2538         https://bugs.webkit.org/show_bug.cgi?id=163791
2539
2540         Reviewed by Sam Weinig.
2541
2542         Update overload resolution in the bindings generator so that 2 nullable types
2543         are no longer considered as distinguishable, as per Web IDL:
2544         - https://heycam.github.io/webidl/#dfn-distinguishable
2545
2546         * bindings/scripts/CodeGeneratorJS.pm:
2547         (AreTypesDistinguishableForOverloadResolution):
2548         * bindings/scripts/test/JS/JSTestObj.cpp:
2549         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter1):
2550         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter1Caller):
2551         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter2):
2552         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter2Caller):
2553         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter):
2554         * bindings/scripts/test/TestObj.idl:
2555
2556 2016-10-22  Chris Dumez  <cdumez@apple.com>
2557
2558         WebGLRenderingContextBase.texSubImage2D() should use a union instead of overloading
2559         https://bugs.webkit.org/show_bug.cgi?id=163859
2560
2561         Reviewed by Darin Adler.
2562
2563         WebGLRenderingContextBase.texSubImage2D() should use a union instead of overloading:
2564         - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
2565
2566         No new tests, no Web-exposed behavior change.
2567
2568         * html/canvas/WebGL2RenderingContext.cpp:
2569         (WebCore::WebGL2RenderingContext::texSubImage2D):
2570         * html/canvas/WebGL2RenderingContext.h:
2571         * html/canvas/WebGLRenderingContext.cpp:
2572         (WebCore::WebGLRenderingContext::texSubImage2D):
2573         * html/canvas/WebGLRenderingContext.h:
2574         * html/canvas/WebGLRenderingContextBase.h:
2575         * html/canvas/WebGLRenderingContextBase.idl:
2576
2577 2016-10-22  Dan Bernstein  <mitz@apple.com>
2578
2579         Dynamically-added backdrop filter to clip-path'd element with 3D transform renders incorrectly (without clip)
2580         https://bugs.webkit.org/show_bug.cgi?id=163497
2581
2582         Reviewed by Simon Fraser.
2583
2584         Test: css3/filters/backdrop/dynamic-with-clip-path.html
2585
2586         * platform/graphics/ca/GraphicsLayerCA.cpp:
2587         (WebCore::GraphicsLayerCA::ensureStructuralLayer): Added MaskLayerChanged to
2588           structuralLayerChangeFlags to ensure that the mask layer is updated.
2589
2590 2016-10-22  Simon Fraser  <simon.fraser@apple.com>
2591
2592         Backdrop filter doesn't show if removed then re-added
2593         https://bugs.webkit.org/show_bug.cgi?id=163860
2594
2595         Reviewed by Dan Bernstein.
2596
2597         When a backdrop filter is removed the re-added, updateBackdropFiltersRect() never
2598         runs the second time because m_backdropFiltersRect doesn't change. However, we need
2599         to run that code to size and position the newly re-created backdrop layer, so run
2600         it explicitly if we just created the backdrop layer. This is similar to how
2601         updateContentsImage() calls updateContentsRects().
2602
2603         Test: css3/filters/backdrop/add-remove-add-backdrop-filter.html
2604
2605         * platform/graphics/ca/GraphicsLayerCA.cpp:
2606         (WebCore::GraphicsLayerCA::setBackdropFilters):
2607         (WebCore::GraphicsLayerCA::updateBackdropFilters):
2608
2609 2016-10-22  Simon Fraser  <simon.fraser@apple.com>
2610
2611         Fix repainting of slow repaint objects in WK1 when page scale is applied
2612         https://bugs.webkit.org/show_bug.cgi?id=163854
2613
2614         Reviewed by Zalan Bujtas.
2615         
2616         RenderObject::repaintSlowRepaintObject() always set the repaint container to the RenderView
2617         if it was null. This is before the call to clippedOverflowRectForRepaint(). If that function
2618         is called with a null repaintContainer, it maps the rect up through the RenderView's transform
2619         (which represents page scale), which is what we want here. Passing the RenderView itself
2620         stops the transform from being applied, which led to the bug.
2621         
2622         WebKit2 doesn't suffer from this bug because containerForRepaint() always returns the
2623         composited RenderView.
2624
2625         Test: fast/repaint/zoomed-fixed-background.html
2626
2627         * rendering/RenderObject.cpp:
2628         (WebCore::RenderObject::repaintSlowRepaintObject):
2629
2630 2016-10-22  Darin Adler  <darin@apple.com>
2631
2632         Move HTML canvas and tracks from ExceptionCode to Exception
2633         https://bugs.webkit.org/show_bug.cgi?id=163853
2634
2635         Reviewed by Chris Dumez.
2636
2637         * WebCore.xcodeproj/project.pbxproj: Added CanvasPath.idl.
2638
2639         * bindings/js/JSWebGL2RenderingContextCustom.cpp: Tweaked a bit.
2640
2641         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
2642         (WebCore::JSWebGLRenderingContextBase::getExtension): Tweaked a bit.
2643         (WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
2644         Removed unneeded exception handling.
2645         (WebCore::JSWebGLRenderingContextBase::getParameter): Ditto.
2646         (WebCore::JSWebGLRenderingContextBase::getProgramParameter): Ditto.
2647         (WebCore::JSWebGLRenderingContextBase::getShaderParameter): Ditto.
2648         (WebCore::JSWebGLRenderingContextBase::getSupportedExtensions): Use a
2649         modern for loop.
2650         (WebCore::JSWebGLRenderingContextBase::getUniform): Removed unneeded
2651         exception handling.
2652
2653         * html/HTMLCanvasElement.cpp:
2654         (WebCore::HTMLCanvasElement::getContext): Pass a reference.
2655         (WebCore::HTMLCanvasElement::reset): Use is<CanvasRenderingContext2D>.
2656         (WebCore::HTMLCanvasElement::setUsesDisplayListDrawing): Ditto.
2657         (WebCore::HTMLCanvasElement::setTracksDisplayListReplay) Ditto.:
2658         (WebCore::HTMLCanvasElement::displayListAsText): Ditto.
2659         (WebCore::HTMLCanvasElement::replayDisplayListAsText): Ditto.
2660         (WebCore::HTMLCanvasElement::clearImageBuffer): Ditto.
2661
2662         * html/canvas/CanvasGradient.cpp:
2663         (WebCore::CanvasGradient::CanvasGradient): Streamlined.
2664         (WebCore::CanvasGradient::addColorStop): Use ExceptionOr.
2665         * html/canvas/CanvasGradient.h: Updated for above changes.
2666         * html/canvas/CanvasGradient.idl: Use non-legacy exception.
2667
2668         * html/canvas/CanvasPath.cpp:
2669         (WebCore::CanvasPath::arcTo): Use ExceptionOr.
2670         (WebCore::CanvasPath::arc): Ditto.
2671         (WebCore::CanvasPath::ellipse): Ditto.
2672         * html/canvas/CanvasPath.h: Updated for above changes.
2673         * html/canvas/CanvasPath.idl: Use non-legacy exceptions.
2674
2675         * html/canvas/CanvasPattern.cpp:
2676         (WebCore::CanvasPattern::create): Use Ref&&.
2677         (WebCore::CanvasPattern::CanvasPattern): Ditto.
2678         (WebCore::CanvasPattern::parseRepetitionType): Return a boolean
2679         instead of using an ExceptionCode.
2680         * html/canvas/CanvasPattern.h: Updated for above changes.
2681
2682         * html/canvas/CanvasRenderingContext.cpp:
2683         (CanvasRenderingContext::wouldTaintOrigin): Reordered function so
2684         that it's safe to call it on an image element without a cached
2685         image, or a cached image without an underlying image.
2686
2687         * html/canvas/CanvasRenderingContext2D.cpp:
2688         (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
2689         Take a reference.
2690         (WebCore::CanvasRenderingContext2D::drawImage): Use ExceptionOr.
2691         (WebCore::CanvasRenderingContext2D::drawImageFromRect): Ditto.
2692         (WebCore::CanvasRenderingContext2D::createLinearGradient): Ditto.
2693         (WebCore::CanvasRenderingContext2D::createRadialGradient): Ditto.
2694         (WebCore::CanvasRenderingContext2D::createPattern): Ditto.
2695         (WebCore::CanvasRenderingContext2D::createImageData): Ditto.
2696         (WebCore::CanvasRenderingContext2D::getImageData): Ditto.
2697         (WebCore::CanvasRenderingContext2D::webkitGetImageDataHD): Ditto.
2698         (WebCore::CanvasRenderingContext2D::putImageData): Removed unneeded
2699         ExceptionCode because this does not throw exceptions; the only one
2700         was for non-finite numeric values but this is now handled by bindings.
2701         (WebCore::CanvasRenderingContext2D::webkitPutImageDataHD): Ditto.
2702         * html/canvas/CanvasRenderingContext2D.h: Updated for above.
2703         * html/canvas/CanvasRenderingContext2D.idl: Use non-legacy exceptions
2704         and removed exceptions entirely in other cases.
2705
2706         * html/canvas/OESVertexArrayObject.cpp:
2707         (WebCore::OESVertexArrayObject::OESVertexArrayObject): Take a reference.
2708         (WebCore::OESVertexArrayObject::~OESVertexArrayObject): Deleted.
2709         (WebCore::OESVertexArrayObject::isVertexArrayOES): Use && instead of
2710         multiple return statements.
2711         (WebCore::OESVertexArrayObject::bindVertexArrayOES): Removed unneeded
2712         ExceptionCode since this does not throw an exception.
2713         * html/canvas/OESVertexArrayObject.h: Updated for above.
2714         * html/canvas/OESVertexArrayObject.idl: Removed unneeded exception.
2715
2716         * html/canvas/WebGL2RenderingContext.cpp:
2717         (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
2718         Removed unneeded ExceptionCode since this does not throw an exception.
2719         (WebCore::WebGL2RenderingContext::texSubImage2DBase): Ditto.
2720         (WebCore::WebGL2RenderingContext::texSubImage2DImpl): Ditto.
2721         (WebCore::WebGL2RenderingContext::texSubImage2D): Removed unneeded
2722         ExceptionCode for some overloads, for the others, use ExceptionOr
2723         for the security exception. Moved security exception code here from
2724         the validate functions.
2725         (WebCore::WebGL2RenderingContext::validateTexFuncParameters): Removed
2726         unneeded ExceptionCode.
2727         (WebCore::WebGL2RenderingContext::getParameter): Ditto.
2728         * html/canvas/WebGL2RenderingContext.h: Updated for above.
2729
2730         * html/canvas/WebGLRenderingContext.cpp:
2731         (WebCore::WebGLRenderingContext::getExtension): Pass a reference.
2732         (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
2733         Remvoed unneeded ExceptionCode since this does not throw an exception.
2734         (WebCore::WebGLRenderingContext::texSubImage2DBase): Ditto.
2735         (WebCore::WebGLRenderingContext::texSubImage2DImpl): Ditto.
2736         (WebCore::WebGLRenderingContext::texSubImage2D): Removed unneeded
2737         ExceptionCode for some overloads, for the others, use ExceptionOr
2738         for the security exception. Moved security exception code here from
2739         the validate functions.
2740         (WebCore::WebGLRenderingContext::getParameter): Removed unneeded
2741         ExceptionCode.
2742         * html/canvas/WebGLRenderingContext.h: Updated for above changes.
2743
2744         * html/canvas/WebGLRenderingContextBase.cpp:
2745         (WebCore::WebGLRenderingContextBase::texImage2DBase):
2746         Remvoed unneeded ExceptionCode since this does not throw an exception.
2747         (WebCore::WebGLRenderingContextBase::texImage2DImpl): Ditto.
2748         (WebCore::WebGLRenderingContextBase::texImage2D): Removed unneeded
2749         ExceptionCode for some overloads, for the others, use ExceptionOr
2750         for the security exception. Moved security exception code here from
2751         the validate functions.
2752         (WebCore::WebGLRenderingContextBase::validateHTMLImageElement):
2753         Moved the security exception out of here to the call sites.
2754         (WebCore::WebGLRenderingContextBase::validateHTMLCanvasElement): Ditto.
2755         (WebCore::WebGLRenderingContextBase::validateHTMLVideoElement): Ditto.
2756         * html/canvas/WebGLRenderingContextBase.h: Updated for above changes.
2757         * html/canvas/WebGLRenderingContextBase.idl: Use non-legacy exceptions
2758         in some cases and no exceptions at all in many others.
2759
2760         * html/shadow/MediaControlElements.cpp:
2761         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
2762         Use a reference instead of a pointer.
2763
2764         * html/track/DataCue.h: Use pragma once.
2765         * html/track/DataCue.idl: Use non-legacy exception for constructor
2766         attribute, even though it is custom and so it has no effect.
2767
2768         * html/track/InbandDataTextTrack.cpp:
2769         (WebCore::InbandDataTextTrack::create): Use RefPtr&&.
2770         (WebCore::InbandDataTextTrack::InbandDataTextTrack): Ditto.
2771         (WebCore::InbandDataTextTrack::addDataCue): Stop using
2772         ASSERT_NO_EXCEPTION.
2773         (WebCore::InbandDataTextTrack::removeDataCue): Stop using
2774         IGNORE_EXCEPTION.
2775         (WebCore::InbandDataTextTrack::removeCue): Use ExceptionOr.
2776         Also use remove instead of find/remove.
2777         * html/track/InbandDataTextTrack.h: Updated for above changes.
2778
2779         * html/track/InbandGenericTextTrack.cpp:
2780         (WebCore::GenericTextTrackCueMap::GenericTextTrackCueMap): Deleted.
2781         (WebCore::GenericTextTrackCueMap::~GenericTextTrackCueMap): Deleted.
2782         (WebCore::GenericTextTrackCueMap::add): Take references intead of
2783         pointers.
2784         (WebCore::GenericTextTrackCueMap::find): Ditto. Also use get
2785         instead of find.
2786         (WebCore::GenericTextTrackCueMap::remove): Ditto. Also use take
2787         instead of double hashing to both find and remove.
2788         (WebCore::InbandGenericTextTrack::updateCueFromCueData): Stop using
2789         IGNORE_EXCEPTION. Also got rid of code that is converting a double
2790         to a long and then back to a double by using lround. Instead just
2791         use std::round, which keeps it a double. But also, why does this need
2792         to round?!
2793         (WebCore::InbandGenericTextTrack::addGenericCue): Updated to use
2794         reference to work with m_cueMap.
2795         (WebCore::InbandGenericTextTrack::updateGenericCue): Ditto.
2796         (WebCore::InbandGenericTextTrack::removeGenericCue): Ditto.
2797         (WebCore::InbandGenericTextTrack::removeCue): Use ExceptionOr.
2798         (WebCore::InbandGenericTextTrack::newCuesParsed): Removed
2799         ASSERT_NO_EXCEPTION.
2800         * html/track/InbandGenericTextTrack.h: Updated for above changes.
2801
2802         * html/track/InbandWebVTTTextTrack.cpp:
2803         (WebCore::InbandWebVTTTextTrack::newCuesParsed): Removed
2804         ASSERT_NO_EXCEPTION.
2805
2806         * html/track/TextTrack.cpp:
2807         (WebCore::TextTrack::addCue): Use ExcepctionOr.
2808         (WebCore::TextTrack::removeCue): Ditto.
2809         (WebCore::TextTrack::addRegion): Ditto.
2810         (WebCore::TextTrack::removeRegion): Ditto.
2811         * html/track/TextTrack.h: Updated for above changes.
2812         * html/track/TextTrack.idl: Ditto.
2813
2814         * html/track/TextTrackCue.cpp:
2815         (WebCore::TextTrackCue::cueShadowPseudoId): Moved this here
2816         since it does not need to be inlined in the header.
2817         (WebCore::TextTrackCue::~TextTrackCue): Deleted.
2818         (WebCore::TextTrackCue::setStartTime): Removed ExceptionCode&
2819         since the exceptions were for non-finite values, but this is
2820         now handled by the bindings.
2821         (WebCore::TextTrackCue::setEndTime): Ditto.
2822         * html/track/TextTrackCue.h: Updated for the above.
2823         * html/track/TextTrackCue.idl: Removed SetterMayThrowLegacyException
2824         and made startTime and endTime be double rather than unrestricted double.
2825
2826         * html/track/TextTrackCueGeneric.cpp:
2827         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
2828         Use a reference instead of a pointer.
2829         (WebCore::TextTrackCueGeneric::TextTrackCueGeneric): Initialize
2830         m_defaultPosition in the class definition instead of here.
2831         (WebCore::TextTrackCueGeneric::createDisplayTree): Return a Ref.
2832         (WebCore::TextTrackCueGeneric::setLine): Use ExceptionOr.
2833         (WebCore::TextTrackCueGeneric::setPosition): Ditto.
2834         (WebCore::TextTrackCueGeneric::setFontSize): Updated since
2835         displayTreeInternal() now returns a reference.
2836         * html/track/TextTrackCueGeneric.h: Updated for above changes.
2837         Also fixed some arguument types and made some more things private.
2838
2839         * html/track/VTTCue.cpp:
2840         (WebCore::VTTCue::createDisplayTree): Return a Ref.
2841         (WebCore::VTTCue::displayTreeInternal): Return a reference.
2842         (WebCore::VTTCue::setVertical): Use ExceptionOr.
2843         (WebCore::VTTCue::setLine): Ditto.
2844         (WebCore::VTTCue::setPosition): Ditto.
2845         (WebCore::VTTCue::setSize): Ditto.
2846         (WebCore::VTTCue::setAlign): Ditto.
2847         (WebCore::VTTCue::getDisplayTree): Return a reference.
2848         (WebCore::VTTCue::removeDisplayTree): Updated since
2849         displayTreeInternal returns a reference.
2850         (WebCore::VTTCue::setFontSize): Ditto.
2851         * html/track/VTTCue.h: Updated for the above.
2852         * html/track/VTTCue.idl: Use non-legacy exceptions and also
2853         restricted doubles.
2854
2855         * html/track/VTTRegion.cpp:
2856         (WebCore::VTTRegion::VTTRegion): Moved default values all into
2857         the class definition.
2858         (WebCore::VTTRegion::setWidth): Removed the check for non-finite
2859         since the bindings now handle that. Use ExcpetionOr.
2860         (WebCore::VTTRegion::setHeight): Ditto.
2861         (WebCore::VTTRegion::setRegionAnchorX): Ditto.
2862         (WebCore::VTTRegion::setRegionAnchorY): Ditto.
2863         (WebCore::VTTRegion::setViewportAnchorX): Ditto.
2864         (WebCore::VTTRegion::setViewportAnchorY): Ditto.
2865         (WebCore::upKeyword): Added. Shared by the code below.
2866         (WebCore::VTTRegion::scroll): Rewrote to be simpler.
2867         (WebCore::VTTRegion::setScroll): Rewrote to be simpler.
2868         (WebCore::VTTRegion::updateParametersFromRegion): Read and
2869         write data members directly to avoid awkward code that is otherwise
2870         required just to copy from one object to the other. Also take a
2871         const& instead of a pointer for the thing to update from.
2872         (WebCore::VTTRegion::parseSettingValue): Use upKeyword.
2873         (WebCore::VTTRegion::appendTextTrackCueBox): Take a Ref&&.
2874         (WebCore::VTTRegion::getDisplayTree): Do the downcast to Document
2875         here instead of using the helper function.
2876         (WebCore::VTTRegion::prepareRegionDisplayTree): Ditto.
2877         * html/track/VTTRegion.h: Updated for the above.
2878         * html/track/VTTRegion.idl: Use non-legacy exceptions and also
2879         use restricted dobules, not unrestricted.
2880
2881 2016-10-22  Chris Dumez  <cdumez@apple.com>
2882
2883         WebGLRenderingContextBase.texImage2D() should use a union instead of overloading
2884         https://bugs.webkit.org/show_bug.cgi?id=163856
2885
2886         Reviewed by Darin Adler.
2887
2888         WebGLRenderingContextBase.texImage2D() should use a union instead of overloading:
2889         - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
2890
2891         * html/canvas/WebGLRenderingContextBase.cpp:
2892         (WebCore::WebGLRenderingContextBase::texImage2D):
2893         * html/canvas/WebGLRenderingContextBase.h:
2894         * html/canvas/WebGLRenderingContextBase.idl:
2895
2896 2016-10-22  Antti Koivisto  <antti@apple.com>
2897
2898         REGRESSION(r207669): Dromaeo/jslib-style-jquery.html regressed >20%
2899         https://bugs.webkit.org/show_bug.cgi?id=163851
2900
2901         Reviewed by Darin Adler.
2902
2903         The test calls Scope::flushPendingUpdate a lot and nothing ever happens there.
2904
2905         Add a separate invalidity bit for descendant scopes and inline the fast path.
2906
2907         * style/StyleScope.cpp:
2908         (WebCore::Style::Scope::flushPendingSelfUpdate):
2909         (WebCore::Style::Scope::flushPendingDescendantUpdates):
2910         (WebCore::Style::Scope::scheduleUpdate):
2911         (WebCore::Style::Scope::flushPendingUpdate): Deleted.
2912         * style/StyleScope.h:
2913         (WebCore::Style::Scope::hasPendingUpdate):
2914         (WebCore::Style::Scope::flushPendingUpdate):
2915
2916 2016-10-22  Darin Adler  <darin@apple.com>
2917
2918         Move SVG from ExceptionCode to Exception
2919         https://bugs.webkit.org/show_bug.cgi?id=163837
2920
2921         Reviewed by Chris Dumez.
2922
2923         * WebCore.xcodeproj/project.pbxproj: Added SVGGraphicsElement.idl.
2924
2925         * bindings/js/JSSVGLengthCustom.cpp:
2926         (WebCore::JSSVGLength::value): Use toJSNumber.
2927         (WebCore::JSSVGLength::setValue): Use propagateException.
2928         (WebCore::JSSVGLength::convertToSpecifiedUnits): Ditto.
2929
2930         * bindings/scripts/CodeGeneratorJS.pm:
2931         (GenerateImplementation): Properly handle SetterMayThrowException
2932         in the special case for SVG setters.
2933
2934         * rendering/style/SVGRenderStyle.h:
2935         (WebCore::SVGRenderStyle::initialBaselineShiftValue): Removed
2936         ASSERT_NO_EXCEPTION, no longer needed.
2937         (WebCore::SVGRenderStyle::initialKerning): Ditto.
2938
2939         * svg/SVGAltGlyphElement.cpp:
2940         (WebCore::SVGAltGlyphElement::setGlyphRef): Use ExceptionOr.
2941         (WebCore::SVGAltGlyphElement::setFormat): Ditto.
2942         (WebCore::SVGAltGlyphElement::hasValidGlyphElements): Tweaked a bit.
2943         * svg/SVGAltGlyphElement.h: Updated for above changes.
2944         * svg/SVGAltGlyphElement.idl: Use non-legacy exceptions.
2945
2946         * svg/SVGAngle.cpp:
2947         (WebCore::SVGAngle::valueAsString): Removed unneeded String globals.
2948         (WebCore::parseAngleType): Rewrote to be simpler and more direct.
2949         (WebCore::SVGAngle::setValueAsString): Use ExceptionOr.
2950         (WebCore::SVGAngle::newValueSpecifiedUnits): Ditto.
2951         (WebCore::SVGAngle::convertToSpecifiedUnits): Ditto.
2952         * svg/SVGAngle.h: Updated for above changes. Initialized data members
2953         here in the class definite and removed constructor; default now works.
2954         * svg/SVGAngle.idl: Use non-legacy exceptions.
2955
2956         * svg/SVGAnimateElementBase.cpp:
2957         (WebCore::SVGAnimateElementBase::calculateAnimatedValue): Update since
2958         CalcMode is now an enum class.
2959         * svg/SVGAnimateMotionElement.cpp:
2960         (WebCore::SVGAnimateMotionElement::SVGAnimateMotionElement): Ditto.
2961
2962         * svg/SVGAnimateTransformElement.cpp:
2963         (WebCore::SVGAnimateTransformElement::hasValidAttributeType): Update
2964         since AttributeType is now an enum class.
2965
2966         * svg/SVGAnimatedAngle.cpp:
2967         (WebCore::SVGAnimatedAngleAnimator::calculateDistance): Removed
2968         ASSERT_NO_EXCEPTION, no longer needed.
2969
2970         * svg/SVGAnimatedBoolean.idl: Use non-legacy exception.
2971         * svg/SVGAnimatedEnumeration.idl: Ditto.
2972         * svg/SVGAnimatedInteger.idl: Ditto.
2973
2974         * svg/SVGAnimatedLength.cpp:
2975         (WebCore::sharedSVGLength): Deleted.
2976         (WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes): Removed
2977         ASSERT_NO_EXCEPTION, no longer needed.
2978         (WebCore::parseLengthFromString): Ditto. Also rewrote to not use
2979         a shared SVGLength; no benefit to doing that.
2980         (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue): Ditto.
2981         * svg/SVGAnimatedLengthList.cpp:
2982         (WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes): Ditto.
2983         (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue): Ditto.
2984
2985         * svg/SVGAnimatedNumber.idl: Use non-legacy exception.
2986         * svg/SVGAnimatedString.idl: Ditto.
2987
2988         * svg/SVGAnimatedType.cpp:
2989         (WebCore::SVGAnimatedType::setValueAsString): Updated since
2990         setValueAsString now uses ExceptionOr.
2991
2992         * svg/SVGAnimationElement.cpp:
2993         (WebCore::SVGAnimationElement::SVGAnimationElement): Initialized scalars
2994         in the class definition instead of here.
2995         (WebCore::SVGAnimationElement::getSimpleDuration): Removed uneeded ExceptionCode&.
2996         (WebCore::SVGAnimationElement::setCalcMode): Updated since CalcMode is now an enum class.
2997         (WebCore::SVGAnimationElement::setAttributeType): Updated since AttributeType
2998         is now an enum class.
2999         (WebCore::SVGAnimationElement::shouldApplyAnimation): Ditto.
3000         (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced): Ditto.
3001         (WebCore::SVGAnimationElement::calculatePercentForSpline): Ditto.
3002         (WebCore::SVGAnimationElement::calculatePercentFromKeyPoints): Ditto.
3003         (WebCore::SVGAnimationElement::calculatePercentForFromTo): Ditto.
3004         (WebCore::SVGAnimationElement::currentValuesFromKeyPoints): Ditto.
3005         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): Ditto.
3006         (WebCore::SVGAnimationElement::startedActiveInterval): Ditto.
3007         (WebCore::SVGAnimationElement::updateAnimation): Ditto.
3008         (WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Ditto.
3009
3010         * svg/SVGAnimationElement.h: Changed CalcMode into an enum class.
3011         Updated for above changes.
3012
3013         * svg/SVGAnimationElement.idl: Removed MayThrowLegacyException from
3014         getSimpleDuration.
3015
3016         * svg/SVGColor.cpp:
3017         (WebCore::SVGColor::SVGColor): Updated to take scalar in the straightforward
3018         manner instead of constt SVGColorType&.
3019         (WebCore::SVGColor::setRGBColor): Use ExceptionOr.
3020         (WebCore::SVGColor::setRGBColorICCColor): Ditto.
3021         (WebCore::SVGColor::setColor): Ditto.
3022         * svg/SVGColor.h: Updated for above changes. Removed unneeded destructor.
3023         * svg/SVGColor.idl: Use non-legacy exceptions.
3024
3025         * svg/SVGGlyphRefElement.cpp:
3026         (WebCore::SVGGlyphRefElement::SVGGlyphRefElement): Initialize data members
3027         in class definition, not here.
3028         (WebCore::parseFloat): Added helper. Used in parseAttribute.
3029         (WebCore::SVGGlyphRefElement::parseAttribute): Updated to use parseFloat helper.
3030         (WebCore::SVGGlyphRefElement::glyphRef): Deleted.
3031         (WebCore::SVGGlyphRefElement::setGlyphRef): Deleted.
3032         (WebCore::SVGGlyphRefElement::setX): Removed unused Exception& argument.
3033         (WebCore::SVGGlyphRefElement::setY): Ditto.
3034         (WebCore::SVGGlyphRefElement::setDx): Ditto.
3035         (WebCore::SVGGlyphRefElement::setDy): Ditto.
3036         * svg/SVGGlyphRefElement.h: Updated for above changes.
3037         * svg/SVGGlyphRefElement.idl: Use Reflect on glyphRef. Removed incorrect
3038         SetterMayThrowLegacyException attributes for x, y, dx, and dy. Longer term
3039         it might be nice to use [Reflect] on these too.
3040
3041         * svg/SVGGraphicsElement.idl: Use non-legacy exception.
3042
3043         * svg/SVGLength.cpp:
3044         (WebCore::parseLengthType): Changed argument type since caller does not
3045         need to know how many characters are consumed.
3046         (WebCore::SVGLength::SVGLength): Removed IGNORE_EXCEPTION and ASSERT_NO_EXCEPTION.
3047         Also removed the copy constructor, letting the compiler generate the default.
3048         (WebCore::SVGLength::setValueAsString): Use ExceptionOr.
3049         (WebCore::SVGLength::construct): Updated since setValueAsString uses ExceptionOr.
3050         (WebCore::SVGLength::value): Ditto.
3051         (WebCore::SVGLength::valueForBindings): Use ExceptionOr. Also renamed to
3052         disambiguate with the version used outside of bindings.
3053         (WebCore::SVGLength::setValue): Use ExceptionOr.
3054         (WebCore::SVGLength::newValueSpecifiedUnits): Ditto.
3055         (WebCore::SVGLength::convertToSpecifiedUnits): Ditto.
3056         (WebCore::SVGLength::fromCSSPrimitiveValue): Updated since newValueSpecifiedUnits
3057         uses ExceptionOr.
3058         (WebCore::SVGLength::lengthModeForAnimatedLengthAttribute): Rewrote map generation
3059         code to be more efficient and not unrolled. Only do one hash table lookup.
3060         * svg/SVGLength.h: Updated for above changes.
3061         * svg/SVGLength.idl: Use non-legacy exceptions.
3062
3063         * svg/SVGLengthContext.cpp:
3064         (WebCore::SVGLengthContext::valueForLength): Update since function
3065         uses ExceptionOr.
3066         (WebCore::SVGLengthContext::convertValueToUserUnits): Use ExceptionOr.
3067         (WebCore::SVGLengthContext::convertValueFromUserUnits): Ditto.
3068         (WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage): Ditto.
3069         (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits): Ditto.
3070         (WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS): Ditto.
3071         (WebCore::SVGLengthContext::convertValueFromEMSToUserUnits): Ditto.
3072         (WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS): Ditto.
3073         (WebCore::SVGLengthContext::convertValueFromEXSToUserUnits): Ditto.
3074         * svg/SVGLengthContext.h: Updatedfor above changes.
3075
3076         * svg/SVGLengthList.cpp:
3077         (WebCore::SVGLengthList::parse): Updated since setValueAsString uses
3078         ExceptionOr now.
3079         * svg/SVGLengthList.h: Removed unneeded constructor.
3080         * svg/SVGLengthList.idl: Use non-legacy exceptions.
3081
3082         * svg/SVGLocatable.cpp:
3083         (WebCore::SVGLocatable::getTransformToElement): Use ExceptionOr.
3084         * svg/SVGLocatable.h: Updated for above change.
3085
3086         * svg/SVGMarkerElement.h:
3087         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
3088         Updated since setValueAsString uses ExceptionOr now.
3089
3090         * svg/SVGMatrix.h: Use ExceptionOr.
3091         * svg/SVGMatrix.idl: Use non-legacy exceptions.
3092
3093         * svg/SVGNumberList.h: Removed unneeded constructor.
3094         * svg/SVGNumberList.idl: Use non-legacy exceptions.
3095
3096         * svg/SVGPaint.cpp:
3097         (WebCore::SVGPaint::setPaint): Use ExceptionOr.
3098         * svg/SVGPaint.h: Updated for above chagne.
3099         * svg/SVGPaint.idl: Use non-legacy exception.
3100
3101         * svg/SVGPathSegList.h: Tweaked a bit.
3102         * svg/SVGPathSegList.idl: Use non-legacy exceptions.
3103
3104         * svg/SVGPointList.h: Removed unneeded constructor.
3105         * svg/SVGPointList.idl: Use non-legacy exceptions.
3106
3107         * svg/SVGPreserveAspectRatio.cpp:
3108         (WebCore::SVGPreserveAspectRatio::setAlign): Use ExceptionOr.
3109         (WebCore::SVGPreserveAspectRatio::setMeetOrSlice): Ditto.
3110         * svg/SVGPreserveAspectRatio.h: Updated for above changes.
3111         * svg/SVGPreserveAspectRatio.idl: Use non-legacy exceptions.
3112
3113         * svg/SVGSVGElement.cpp:
3114         (WebCore::SVGSVGElement::currentView): Pass a reference.
3115
3116         * svg/SVGStringList.h: Tweaked a bit.
3117         * svg/SVGStringList.idl: Use non-legacy exceptions.
3118
3119         * svg/SVGStyleElement.cpp:
3120         (WebCore::SVGStyleElement::setType): Removed unneeded ExceptionCode&.
3121         (WebCore::SVGStyleElement::setMedia): Ditto.
3122         (WebCore::SVGStyleElement::setTitle): Deleted.
3123         * svg/SVGStyleElement.h: Updated for above changes, and made the title
3124         function override be private.
3125         * svg/SVGStyleElement.idl: Use Reflect for title. Removed unneeded
3126         SetterMayThrowLegacyException on all attributes.
3127
3128         * svg/SVGTextContentElement.cpp:
3129         (WebCore::SVGTextContentElement::textLengthAnimated): Removed
3130         ASSERT_NO_EXCEPTION, won't work any more.
3131         (WebCore::SVGTextContentElement::getSubStringLength): Use ExceptionOr.
3132         Also remove redundant call to updateLayoutIgnorePendingStylesheets,
3133         called by getNumberOfChars.
3134         (WebCore::SVGTextContentElement::getStartPositionOfChar): Ditto.
3135         (WebCore::SVGTextContentElement::getEndPositionOfChar): Ditto.
3136         (WebCore::SVGTextContentElement::getExtentOfChar): Ditto.
3137         (WebCore::SVGTextContentElement::getRotationOfChar): Ditto.
3138         (WebCore::SVGTextContentElement::selectSubString): Ditto.
3139         * svg/SVGTextContentElement.h: Updated for above changes.
3140         * svg/SVGTextContentElement.idl: Use non-legacy exceptions.
3141
3142         * svg/SVGTransformList.h: Removed unneeded constructor.
3143         * svg/SVGTransformList.idl: Use non-legacy exceptions.
3144
3145         * svg/SVGViewSpec.cpp:
3146         (WebCore::SVGViewSpec::SVGViewSpec): Updated to take a reference.
3147         (WebCore::SVGViewSpec::setZoomAndPan): Use ExceptionOr.
3148         (WebCore::SVGViewSpec::setTransformString): Deleted.
3149         (WebCore::SVGViewSpec::viewBoxString): Use m_viewBox directly.
3150         (WebCore::SVGViewSpec::preserveAspectRatioString): Use
3151         m_preserveAspectRatio directly.
3152         (WebCore::SVGViewSpec::viewTarget): Use is<SVGElement>.
3153         (WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): Use
3154         m_contextElement directly.
3155         (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
3156         Ditto.
3157         (WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): Ditto.
3158         (WebCore::SVGViewSpec::parseViewSpec): Set m_viewTargetString directly.
3159         * svg/SVGViewSpec.h: Updated for above changes. Removed unneeded virtual
3160         destructor, unneeded using for ref/deref, unused functions including
3161         setTransformString, setViewTargetString, non-exception setZoomAndPan,
3162         contextElement, viewBoxBaseValue, and preserveAspectRatioBaseValue.
3163         * svg/SVGViewSpec.idl: Use non-legacy exceptions. Also specify
3164         ImplementationLacksVTable.
3165
3166         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
3167         Use ExceptionOr.
3168         * svg/properties/SVGAnimatedStaticPropertyTearOff.h: Ditto.
3169         * svg/properties/SVGListProperty.h: Ditto.
3170         * svg/properties/SVGListPropertyTearOff.h: Ditto.
3171          * svg/properties/SVGPathSegListPropertyTearOff.cpp:
3172         (WebCore::SVGPathSegListPropertyTearOff::clear): Ditto.
3173         (WebCore::SVGPathSegListPropertyTearOff::getItem): Ditto.
3174         (WebCore::SVGPathSegListPropertyTearOff::replaceItem): Ditto.
3175         (WebCore::SVGPathSegListPropertyTearOff::removeItem): Ditto.
3176         * svg/properties/SVGPathSegListPropertyTearOff.h: Ditto.
3177         * svg/properties/SVGPropertyTearOff.h: Ditto. Also added an overload
3178         of create that knows how to deal with exceptions.
3179         * svg/properties/SVGStaticListPropertyTearOff.h: Ditto.
3180         * svg/properties/SVGTransformListPropertyTearOff.h: Ditto.
3181
3182 2016-10-22  Chris Dumez  <cdumez@apple.com>
3183
3184         WebGLRenderingContextBase.bufferData() should use a union instead of overloading
3185         https://bugs.webkit.org/show_bug.cgi?id=163795
3186
3187         Reviewed by Darin Adler.
3188
3189         WebGLRenderingContextBase.bufferData() / bufferSubData() should use a union
3190         instead of overloading:
3191         - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
3192
3193         No new tests, no web-exposed behavior change.
3194
3195         * bindings/js/JSDOMConvert.h:
3196         (WebCore::Converter<IDLInterface<T>>::convert):
3197         * bindings/scripts/CodeGeneratorJS.pm:
3198         (GenerateHeader):
3199         * bindings/scripts/test/JS/JSInterfaceName.h:
3200         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3201         * bindings/scripts/test/JS/JSTestCEReactions.h:
3202         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
3203         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
3204         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
3205         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
3206         * bindings/scripts/test/JS/JSTestEventConstructor.h:
3207         * bindings/scripts/test/JS/JSTestEventTarget.h:
3208         * bindings/scripts/test/JS/JSTestException.h:
3209         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
3210         * bindings/scripts/test/JS/JSTestGlobalObject.h:
3211         * bindings/scripts/test/JS/JSTestInterface.h:
3212         * bindings/scripts/test/JS/JSTestIterable.h:
3213         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
3214         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
3215         * bindings/scripts/test/JS/JSTestNode.h:
3216         * bindings/scripts/test/JS/JSTestNondeterministic.h:
3217         * bindings/scripts/test/JS/JSTestObj.h:
3218         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
3219         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
3220         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
3221         * bindings/scripts/test/JS/JSTestSerialization.h:
3222         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
3223         * bindings/scripts/test/JS/JSTestTypedefs.h:
3224         * bindings/scripts/test/JS/JSattribute.h:
3225         * bindings/scripts/test/JS/JSreadonly.h:
3226         * html/canvas/WebGL2RenderingContext.cpp:
3227         (WebCore::WebGL2RenderingContext::bufferData):
3228         (WebCore::WebGL2RenderingContext::bufferSubData):
3229         * html/canvas/WebGLRenderingContextBase.cpp:
3230         (WebCore::WebGLRenderingContextBase::bufferData):
3231         (WebCore::WebGLRenderingContextBase::bufferSubData):
3232         * html/canvas/WebGLRenderingContextBase.h:
3233         * html/canvas/WebGLRenderingContextBase.idl:
3234
3235 2016-10-22  Darin Adler  <darin@apple.com>
3236
3237         [Cocoa] REGRESSION (r204508): Crash in init_WebCreateFragment when pasting (seen in multiple apps using legacy WebKit)
3238         https://bugs.webkit.org/show_bug.cgi?id=163839
3239
3240         Reviewed by Dan Bernstein.
3241
3242         * editing/cocoa/EditorCocoa.mm: Use the appropriate SOFT_LINK macros to find
3243         the WebKitLegacy platform in the correct location for iOS and macOS.
3244
3245 2016-10-22  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
3246
3247         Bindings error message for missing required dictionary member should be more explicit
3248         https://bugs.webkit.org/show_bug.cgi?id=163665
3249
3250         Reviewed by Darin Adler.
3251
3252         Add throwRequiredMemberTypeError function to throw a TypeError exception with an error
3253         message indicating the missing required member.
3254
3255         No new test required, rebase existing tests.
3256
3257         * bindings/js/JSDOMBinding.cpp:
3258         (WebCore::throwRequiredMemberTypeError):
3259         * bindings/js/JSDOMBinding.h:
3260         * bindings/scripts/CodeGeneratorJS.pm:
3261         (GenerateDictionaryImplementationContent):
3262         * bindings/scripts/test/JS/JSTestObj.cpp:
3263         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
3264
3265 2016-10-22  Ryosuke Niwa  <rniwa@webkit.org>
3266
3267         Upgrading custom element should enqueue attributeChanged and connected callbacks
3268         https://bugs.webkit.org/show_bug.cgi?id=163840
3269
3270         Reviewed by Darin Adler.
3271
3272         When upgrading a custom element, enqueue attributeChanged and connectedCallbacks as needed as specified
3273         in step 3 and 4 of: https://html.spec.whatwg.org/multipage/scripting.html#concept-upgrade-an-element
3274
3275         Test: fast/custom-elements/upgrading-enqueue-reactions.html
3276
3277         * bindings/js/JSCustomElementInterface.cpp:
3278         (WebCore::JSCustomElementInterface::upgradeElement): Enqueue 
3279         * dom/CustomElementReactionQueue.cpp:
3280         (WebCore::CustomElementReactionQueueItem::invoke): Don't invoke callbacks when the custom element had
3281         failed to upgrade.
3282         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions): Added.
3283         (WebCore::CustomElementReactionQueue::invokeAll): Upgrading a custom element may enqueue more reactions.
3284         Keep invoking reactions until the queue becomes empty.
3285         * dom/CustomElementReactionQueue.h:
3286         * dom/Range.idl: Added a forgotten CEReactions here.
3287
3288 2016-10-21  David Kilzer  <ddkilzer@apple.com>
3289
3290         Bug 163762: IntSize::area() should used checked arithmetic
3291         <https://webkit.org/b/163762>
3292
3293         Reviewed by Darin Adler.
3294
3295         No new tests since no change in nominal behavior.
3296
3297         * platform/graphics/IntSize.h:
3298         (WebCore::IntSize::area): Change to return a
3299         Checked<unsigned, T> value. Use WTF:: namespace to avoid
3300         including another header.
3301
3302         * platform/graphics/IntRect.h:
3303         (WebCore::IntRect::area): Ditto.
3304
3305         The remaining changes are to use the Checked<unsigned> return
3306         value of IntSize::area() and IntRect::area() correctly in
3307         context, in addition to items noted below.
3308
3309         * html/HTMLPlugInImageElement.cpp:
3310         (WebCore::HTMLPlugInImageElement::isTopLevelFullPagePlugin):
3311         Declare contentWidth and contentHeight as float values to
3312         prevent overflow when computing the area, and to make the
3313         inequality comparison in the return statement uses the same type
3314         for both sides.
3315         * html/ImageData.cpp:
3316         (WebCore::ImageData::ImageData):
3317         * html/MediaElementSession.cpp:
3318         (WebCore::isElementRectMostlyInMainFrame):
3319         * platform/graphics/ImageBackingStore.h:
3320         (WebCore::ImageBackingStore::setSize): Restructure logic to
3321         compute area only once.
3322         (WebCore::ImageBackingStore::clear):
3323         * platform/graphics/ImageFrame.h:
3324         (WebCore::ImageFrame::frameBytes):
3325         * platform/graphics/ImageSource.cpp:
3326         (WebCore::ImageSource::maximumSubsamplingLevel):
3327         * platform/graphics/ca/LayerPool.cpp:
3328         (WebCore::LayerPool::backingStoreBytesForSize):
3329         * platform/graphics/cg/ImageDecoderCG.cpp:
3330         (WebCore::ImageDecoder::frameBytesAtIndex):
3331         * platform/graphics/filters/FEGaussianBlur.cpp:
3332         (WebCore::FEGaussianBlur::platformApplySoftware):
3333         * platform/graphics/filters/FilterEffect.cpp:
3334         (WebCore::FilterEffect::asUnmultipliedImage):
3335         (WebCore::FilterEffect::asPremultipliedImage):
3336         (WebCore::FilterEffect::copyUnmultipliedImage):
3337         (WebCore::FilterEffect::copyPremultipliedImage):
3338         (WebCore::FilterEffect::createUnmultipliedImageResult):
3339         (WebCore::FilterEffect::createPremultipliedImageResult):
3340         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
3341         (WebCore::ImageBufferData::getData): Update overflow check,
3342         rename local variable to numBytes, and compute numBytes once.
3343         * platform/graphics/win/ImageDecoderDirect2D.cpp:
3344         (WebCore::ImageDecoder::frameBytesAtIndex):
3345         * platform/image-decoders/ImageDecoder.cpp:
3346         (WebCore::ImageDecoder::frameBytesAtIndex):
3347         * platform/ios/LegacyTileLayerPool.mm:
3348         (WebCore::LegacyTileLayerPool::bytesBackingLayerWithPixelSize):
3349         * rendering/RenderLayerCompositor.cpp:
3350         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
3351         * rendering/shapes/Shape.cpp:
3352         (WebCore::Shape::createRasterShape):
3353
3354 2016-10-21  Gavin Barraclough  <barraclough@apple.com>
3355
3356         WebPageProxy should not need PageActivityState
3357         https://bugs.webkit.org/show_bug.cgi?id=163821
3358
3359         Reviewed by Geoff Garen.
3360
3361         The PageActivityState is currently plumbed back from WebCore up to the UI process, to
3362         determine whether to enabled process suppression. However the information it contains
3363         (whether a page load is ongoing, whether audio is playing) is already available via
3364         other means. Remove this use of PageActivityState.
3365
3366         * html/HTMLMediaElement.cpp:
3367         (WebCore::HTMLMediaElement::mediaState):
3368             - Fix a bug in how we compute IsPlayingAudio - if the volume of the MediaElement is
3369               set to zero, then audio is not playing (we were already checking muted).
3370         * page/ChromeClient.h:
3371             - removed setPageActivityState
3372         * page/Page.cpp:
3373         (WebCore::Page::setPageActivityState): Deleted.
3374             - setPageActivityState -> pageActivityStateChanged, remove call to ChromeClient
3375         * page/Page.h:
3376         (WebCore::Page::pageActivityStateChanged):
3377             - setPageActivityState -> pageActivityStateChanged
3378         * page/PageThrottler.cpp:
3379         (WebCore::PageThrottler::setActivityFlag):
3380             - setPageActivityState -> pageActivityStateChanged
3381
3382 2016-10-21  Chris Dumez  <cdumez@apple.com>
3383
3384         [Web ID] Overload resolution is wrong if one of the types is a nullable union
3385         https://bugs.webkit.org/show_bug.cgi?id=163816
3386
3387         Reviewed by Alex Christensen.
3388
3389         Overload resolution was wrong if one of the types was a nullable union. This
3390         is because we never considered the union type itself, only its subtypes.
3391         Therefore, we checked if any of the union's subtypes were nullable but we
3392         failed to check if the union itself was nullable.
3393
3394         See:
3395         - https://heycam.github.io/webidl/#es-overloads (Step 11.3.)
3396
3397         No new tests, extended bindings tests.
3398
3399         * bindings/scripts/CodeGeneratorJS.pm:
3400         (GetOverloadThatMatchesIgnoringUnionSubtypes):
3401         (GenerateOverloadedFunctionOrConstructor):
3402         * bindings/scripts/test/JS/JSTestObj.cpp:
3403         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1):
3404         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1Caller):
3405         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2):
3406         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2Caller):
3407         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion):
3408         (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1):
3409         (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1Caller):
3410         (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2):
3411         (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2Caller):
3412         (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion):