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