Node.baseURI should not be nullable
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-08-07  Chris Dumez  <cdumez@apple.com>
2
3         Node.baseURI should not be nullable
4         https://bugs.webkit.org/show_bug.cgi?id=160649
5
6         Reviewed by Darin Adler.
7
8         Node.baseURI should not be nullable as per the latest DOM specification:
9         - https://dom.spec.whatwg.org/#dom-node-baseuri
10
11         It is not nullable in Firefox. It is supposed to fallback to using the
12         document's URL. The document's URL is "about:blank" by default so
13         baseURI() now returns "about:blank" in the internal URL is null,
14         similarly to what we do for Document.URL (c.g. urlForBindings()).
15
16         No new tests, rebaselined existing test.
17
18         * dom/Node.cpp:
19         (WebCore::Node::baseURI):
20         * dom/Node.h:
21         * dom/Node.idl:
22
23 2016-08-07  Chris Dumez  <cdumez@apple.com>
24
25         Drop SVGDocument as per the SVG2 specification
26         https://bugs.webkit.org/show_bug.cgi?id=160361
27
28         Reviewed by Darin Adler.
29
30         Drop SVGDocument as per the SVG2 specification:
31         - https://www.w3.org/TR/SVG2/struct.html#InterfaceDocumentExtensions
32
33         SVGDocument has been merged into Document.
34
35         Chrome and Edge have dropped SVGDocument already, Firefox has not.
36
37         No new tests, rebaselined existing test.
38
39         * accessibility/AccessibilityRenderObject.cpp:
40         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
41         * bindings/js/JSDocumentCustom.cpp:
42         (WebCore::createNewDocumentWrapper): Deleted.
43         * bindings/js/JSXMLDocumentCustom.cpp:
44         (WebCore::toJSNewlyCreated):
45         (WebCore::toJS): Deleted.
46         * page/DOMWindow.idl:
47         * page/FrameView.cpp:
48         (WebCore::FrameView::scrollToAnchor):
49         * svg/SVGDocument.cpp:
50         (WebCore::SVGDocument::rootElement):
51         (WebCore::SVGDocument::zoomAndPanEnabled):
52         (WebCore::SVGDocument::startPan):
53         (WebCore::SVGDocument::updatePan):
54         * svg/SVGDocument.h:
55         * svg/SVGDocument.idl:
56         * svg/graphics/SVGImage.cpp:
57         (WebCore::SVGImage::rootElement):
58
59 2016-08-07  Chris Dumez  <cdumez@apple.com>
60
61         Un-expose DOMSettableTokenList
62         https://bugs.webkit.org/show_bug.cgi?id=160643
63
64         Reviewed by Darin Adler.
65
66         Un-expose DOMSettableTokenList. We merged DOMSettableTokenList into
67         DOMTokenList a while back, as per the specification. At the time, we
68         kept DOMSettableTokenList on Window, as an alias to DOMTokenList.
69         However, Firefox and Chrome dropped DOMSettableTokenList completely.
70         We now do the same as other browsers.
71
72         No new tests, rebaselined existing test.
73
74         * page/DOMWindow.idl:
75
76 2016-08-07  Andreas Kling  <akling@apple.com>
77
78         DocumentRuleSets::collectFeatures() should shrink-to-fit.
79         <https://webkit.org/b/160646>
80
81         Reviewed by Darin Adler.
82
83         We forgot to shrink-wrap the RuleFeatureSet in DocumentRuleSets
84         after collecting the document-wide features.
85
86         * css/DocumentRuleSets.cpp:
87         (WebCore::DocumentRuleSets::collectFeatures):
88
89 2016-08-06  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
90
91         Purge all uses of PassRefPtr in WebCore/Modules
92         https://bugs.webkit.org/show_bug.cgi?id=159965
93
94         Reviewed by Chris Dumez.
95
96         Final clean up in Modules directory.
97
98         No new tests, no behavior changes.
99
100         * Modules/gamepad/deprecated/GamepadList.cpp:
101         (WebCore::GamepadList::set):
102         * Modules/gamepad/deprecated/GamepadList.h:
103         * Modules/indexeddb/IDBGetResult.h:
104         (WebCore::IDBGetResult::IDBGetResult):
105         * Modules/indieui/UIRequestEvent.cpp:
106         (WebCore::UIRequestEvent::create):
107         (WebCore::UIRequestEvent::UIRequestEvent):
108         * Modules/indieui/UIRequestEvent.h:
109         (WebCore::UIRequestEvent::receiver):
110         * Modules/mediasource/MediaSourceRegistry.h:
111         * Modules/mediasource/SampleMap.cpp:
112         (WebCore::SampleMap::addSample):
113         * Modules/mediasource/SampleMap.h:
114         (WebCore::SampleMap::addRange):
115         * Modules/mediasource/SourceBuffer.cpp:
116         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
117         (WebCore::SourceBuffer::textTrackAddCue):
118         (WebCore::SourceBuffer::textTrackRemoveCue):
119         * Modules/mediasource/SourceBuffer.h:
120         * Modules/mediastream/CaptureDeviceManager.cpp:
121         (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
122         * Modules/mediastream/CaptureDeviceManager.h:
123         * Modules/mediastream/MediaDevicesRequest.h:
124         * Modules/mediastream/MediaStream.cpp:
125         (WebCore::MediaStream::internalAddTrack):
126         (WebCore::MediaStream::internalRemoveTrack):
127         * Modules/mediastream/MediaStreamRegistry.h:
128         * Modules/mediastream/MediaStreamTrackEvent.cpp:
129         (WebCore::MediaStreamTrackEvent::create):
130         (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
131         (WebCore::MediaStreamTrackEvent::track):
132         * Modules/mediastream/MediaStreamTrackEvent.h:
133         * Modules/mediastream/MediaTrackConstraints.cpp:
134         (WebCore::MediaTrackConstraints::create):
135         (WebCore::MediaTrackConstraints::MediaTrackConstraints):
136         (WebCore::MediaTrackConstraints::optional):
137         * Modules/mediastream/MediaTrackConstraints.h:
138         * Modules/mediastream/RTCDTMFSender.cpp:
139         (WebCore::RTCDTMFSender::create):
140         (WebCore::RTCDTMFSender::RTCDTMFSender):
141         * Modules/mediastream/RTCDTMFSender.h:
142         * Modules/mediastream/RTCDataChannelEvent.cpp:
143         (WebCore::RTCDataChannelEvent::create):
144         (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
145         (WebCore::RTCDataChannelEvent::channel):
146         * Modules/mediastream/RTCDataChannelEvent.h:
147         * Modules/mediastream/RTCIceServer.h:
148         * Modules/mediastream/RTCStatsReport.h:
149         * Modules/mediastream/SourceInfo.cpp:
150         (WebCore::SourceInfo::create):
151         (WebCore::SourceInfo::SourceInfo):
152         * Modules/mediastream/SourceInfo.h:
153         * Modules/mediastream/UserMediaClient.h:
154         * Modules/mediastream/UserMediaRequest.cpp:
155         (WebCore::UserMediaRequest::UserMediaRequest):
156         (WebCore::UserMediaRequest::didCreateStream):
157         * Modules/mediastream/UserMediaRequest.h:
158         * Modules/webdatabase/Database.cpp:
159         (WebCore::Database::~Database):
160         * html/HTMLMediaElement.cpp:
161         (WebCore::HTMLMediaElement::textTrackAddCue):
162         (WebCore::HTMLMediaElement::textTrackRemoveCue):
163         * html/HTMLMediaElement.h:
164         * html/HTMLTrackElement.cpp:
165         (WebCore::HTMLTrackElement::textTrackAddCue):
166         (WebCore::HTMLTrackElement::textTrackRemoveCue):
167         * html/HTMLTrackElement.h:
168         * html/track/TextTrack.h:
169         * platform/graphics/SourceBufferPrivateClient.h:
170         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
171         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
172         * platform/mediastream/MediaStreamCreationClient.h:
173         * platform/mediastream/mac/AVCaptureDeviceManager.h:
174         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
175         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints):
176         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
177         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
178         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
179         (WebCore::MockSourceBufferPrivate::didReceiveSample):
180
181 2016-08-06  Chris Dumez  <cdumez@apple.com>
182
183         a.replaceChild(a, a) should throw a HierarchyRequestError
184         https://bugs.webkit.org/show_bug.cgi?id=160640
185
186         Reviewed by Darin Adler.
187
188         a.replaceChild(a, a) should throw a HierarchyRequestError, because 'a'
189         is a host-including inclusive ancestor of 'a':
190         - https://dom.spec.whatwg.org/#concept-node-replace
191
192         However, the call is merely ignored in WebKit.
193
194         No new tests, rebaselined existing test.
195
196         * dom/ContainerNode.cpp:
197         (WebCore::ContainerNode::replaceChild):
198
199 2016-08-06  Chris Dumez  <cdumez@apple.com>
200
201         Drop legacy Text.replaceWholeText() API
202         https://bugs.webkit.org/show_bug.cgi?id=160641
203
204         Reviewed by Darin Adler.
205
206         Drop legacy Text.replaceWholeText() API, which is no longer in the
207         specification:
208         - https://dom.spec.whatwg.org/#interface-text
209
210         Firefox and Chrome already dropped support for it.
211
212         No new tests, rebaselined existing test.
213
214         * dom/Text.idl:
215
216 2016-08-06  Chris Dumez  <cdumez@apple.com>
217
218         Align Range.createContextualFragment() input validation with the specification
219         https://bugs.webkit.org/show_bug.cgi?id=160634
220
221         Reviewed by Darin Adler.
222
223         Align Range.createContextualFragment() input validation with the specification:
224         - https://w3c.github.io/DOM-Parsing/#idl-def-range-createcontextualfragment(domstring) (Step 2)
225
226         In particular, we were throwing a NOT_SUPPORTED_ERR when element had localname
227         "html" but was not in the HTML namespace. We should not throw in this case.
228
229         Firefox complies with the specification here.
230
231         No new tests, rebaselined existing test.
232
233         * dom/Range.cpp:
234         (WebCore::Range::createContextualFragment): Deleted.
235
236 2016-08-06  Chris Dumez  <cdumez@apple.com>
237
238         [Web IDL] Add support for [Unscopable] extended attribute
239         https://bugs.webkit.org/show_bug.cgi?id=160637
240
241         Reviewed by Darin Adler.
242
243         Add support for [Unscopable] extended attribute:
244         - http://heycam.github.io/webidl/#Unscopable
245
246         No new tests, rebaselined existing test.
247
248         * bindings/scripts/CodeGeneratorJS.pm:
249         (addUnscopableProperties):
250         (GenerateImplementation):
251         * bindings/scripts/IDLAttributes.txt:
252         * bindings/scripts/test/JS/JSTestObj.cpp:
253         (WebCore::JSTestObjPrototype::finishCreation):
254         * bindings/scripts/test/TestObj.idl:
255         * dom/ChildNode.idl:
256         * dom/ParentNode.idl:
257
258 2016-08-06  Darin Adler  <darin@apple.com>
259
260         Simplify valueToUSVString
261         https://bugs.webkit.org/show_bug.cgi?id=160628
262
263         Reviewed by Sam Weinig.
264
265         * bindings/js/JSDOMBinding.cpp:
266         (WebCore::isUnmatchedSurrogatePair): Deleted. This function was incorrectly named,
267         since it actually returned true if any surrogate code unit was passed.
268         (WebCore::valueToUSVString): Added a fast path for 8-bit characters that doesn't
269         bother iterating the string at all. Changed the fast path to actually check for
270         surrogate pairs. Use StringView::codePoints rather than writing our own loop that
271         does the same thing. In the slow path, use StringView::codePoints to make the logic
272         clear rather than writing out exactly what the specification says. This gets rid of
273         all the many constants the old version of the function contained.
274
275 2016-08-06  Youenn Fablet  <youenn@apple.com>
276
277         [Fetch API] Fetching with a FormData body should reject until it is implemented
278         https://bugs.webkit.org/show_bug.cgi?id=160595
279
280         Reviewed by Alex Christensen.
281
282         Covered by updated tests.
283
284         This patch ensures that fetch will throw if trying to upload something that is not supported.
285         This is the case of BufferSource (FetchBody does not yet extract it) and FormData (no upload support yet).
286
287         * Modules/fetch/FetchBody.cpp:
288         (WebCore::FetchBody::extract): Added a FIXME.
289         * Modules/fetch/FetchBodyOwner.h:
290         (WebCore::FetchBodyOwner::bodyType): Getter used by FetchResponse.
291         * Modules/fetch/FetchRequest.cpp:
292         (WebCore::FetchRequest::setBody): Throwing if given body parameter cannot be extracted by FetchBody.
293         This ensures that a fetch with a body that cannot be uploaded will fail.
294         This is the case of BufferSource which is not yet supported.
295         * Modules/fetch/FetchResponse.cpp:
296         (WebCore::FetchResponse::fetch): Rejecting fetch promise if trying to upload a FormData as it is not implemented.
297
298 2016-08-06  Youenn Fablet  <youenn@apple.com>
299
300         [Fetch API] Fetch API should strip fragment and credentials from URLs used as referrer
301         https://bugs.webkit.org/show_bug.cgi?id=160593
302
303         Reviewed by Alex Christensen.
304
305         Covered by updated tests.
306
307         Stripping of referrer value before sending a load request.
308
309         Fixing bug in workers as referrer value was overwritten by WorkerThreadableLoader.
310         The current handling of referrer values as HTTP header is not great as this may trigger unnecessary preflighting.
311         Refactoring should allow passing it as a separate parameter and setting it after preflighting as per
312         https://fetch.spec.whatwg.org/#http-network-or-cache-fetch.
313
314         Also a newly added test is failing, as SubresourceLoader is removing the referer header in case of a cross-origin redirection.
315         But none is added back.
316
317         * Modules/fetch/FetchRequest.cpp:
318         (WebCore::FetchRequest::internalRequest): Stripping referrer value.
319         * loader/WorkerThreadableLoader.cpp:
320         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Do not override referrer value if one is defined.
321         * page/SecurityPolicy.cpp:
322         (WebCore::SecurityPolicy::generateReferrerHeader): Adding assertion to ensure referrer value does not contain
323         credentials and/or fragment identifiers.
324
325 2016-08-05  Yusuke Suzuki  <utatane.tea@gmail.com>
326
327         [ES6] Add ScriptElement::determineScriptType
328         https://bugs.webkit.org/show_bug.cgi?id=149576
329
330         Reviewed by Ryosuke Niwa.
331
332         Change ScriptElement::isScriptTypeSupported to ScriptElement::determineScriptType.
333         And introduce ScriptType, which is either "classic" or "module".
334         And support "module" type in ScriptElement[1, 2].
335         But this patch does not contain any module tag support code.
336         This will be implemented in the subsequent patch.
337
338         [1]: https://html.spec.whatwg.org/multipage/webappapis.html#integration-with-the-javascript-module-system
339         [2]: https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type
340
341         * dom/ScriptElement.cpp:
342         (WebCore::ScriptElement::determineScriptType):
343         (WebCore::ScriptElement::prepareScript):
344         (WebCore::ScriptElement::isScriptTypeSupported): Deleted.
345         * dom/ScriptElement.h:
346
347 2016-08-05  Jonathan Bedard  <jbedard@apple.com>
348
349         NULL Reference Error in ElementRuleCollector
350         https://bugs.webkit.org/show_bug.cgi?id=160362
351
352         Reviewed by Darin Adler.
353
354         No new tests, existing CSS tests cover this change.
355
356         Undefined behavior sanitizer found a reference bound to a NULL pointer.
357         The root cause of this issue was a discrepancy between whether an author style needed to be defined.  In some logic, an undefined author style was considered acceptable, but in other logic, author style was always assumed to be defined.  To fix this, a variable was added so that while author style is always defined, there is a flag indicating if this definition occurred in the constructor for use by functions which allow an undefined author style.
358
359         * css/DocumentRuleSets.cpp:
360         (WebCore::DocumentRuleSets::DocumentRuleSets): Define author style by default.
361         (WebCore::DocumentRuleSets::resetAuthorStyle): Switch author style flag.
362         * css/DocumentRuleSets.h: Added author style flag, changed authorStyle accessor to reference from pointer.
363         * css/ElementRuleCollector.cpp:
364         (WebCore::ElementRuleCollector::ElementRuleCollector): Original location of undefined behavior.
365         (WebCore::ElementRuleCollector::matchHostPseudoClassRules): Changed pointer to reference.
366         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules): Changed pointer to reference.
367         * css/PageRuleCollector.cpp:
368         (WebCore::PageRuleCollector::matchAllPageRules): Check new flag, changed pointer to reference.
369
370         * css/StyleResolver.cpp: Changed pointer to reference.
371         * dom/Document.cpp: Dito.
372         * style/AttributeChangeInvalidation.cpp: Dito.
373         * style/ClassChangeInvalidation.cpp: Dito.
374         * style/IdChangeInvalidation.cpp: Dito.
375         * style/StyleSharingResolver.cpp: Dito.
376
377 2016-08-05  Chris Dumez  <cdumez@apple.com>
378
379         DOMException should be constructible
380         https://bugs.webkit.org/show_bug.cgi?id=160626
381
382         Reviewed by Darin Adler.
383
384         DOMException should be constructible:
385         - http://heycam.github.io/webidl/#dfn-DOMException
386         - http://heycam.github.io/webidl/#es-DOMException-constructor-object
387
388         DOMException already has a constructor in Firefox and Chrome so this
389         aligns our behavior with other browsers.
390
391         Test: imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor.html
392
393         * dom/DOMCoreException.cpp:
394         (WebCore::errorCodeFromName):
395         (WebCore::DOMCoreException::create):
396         (WebCore::DOMCoreException::DOMCoreException):
397         * dom/DOMCoreException.h:
398         * dom/DOMCoreException.idl:
399         * dom/ExceptionBase.cpp:
400         (WebCore::ExceptionBase::ExceptionBase):
401         * dom/ExceptionBase.h:
402
403 2016-08-05  Chris Dumez  <cdumez@apple.com>
404
405         Align Range.insertNode() input validation with the specification
406         https://bugs.webkit.org/show_bug.cgi?id=160624
407
408         Reviewed by Sam Weinig.
409
410         Align Range.insertNode() input validation with the specification:
411         - https://dom.spec.whatwg.org/#dom-range-insertnode
412         - https://dom.spec.whatwg.org/#concept-range-insert (step 1)
413
414         In particular, if range’s start node is a ProcessingInstruction or
415         Comment node, is a Text node whose parent is null, or is node, then
416         we should throw a HierarchyRequestError.
417
418         Chrome behaves according to the specification.
419
420         No new tests, rebaselined existing test.
421
422         * dom/Range.cpp:
423         (WebCore::Range::insertNode):
424
425 2016-08-05  Chris Dumez  <cdumez@apple.com>
426
427         [Web IDL] Add support for 'any' type in dictionaries
428         https://bugs.webkit.org/show_bug.cgi?id=160511
429
430         Reviewed by Sam Weinig.
431
432         Add support for 'any' type in dictionaries. It will pass the value as
433         a JSValue to the implementation. If the member is not present, it will
434         pass jsUndefined() to the implementation.
435
436         Having 'any' support in dictionaries is a convenient workaround for
437         types we don't support yet (e.g. union types).
438
439         No new tests, updated bindings tests.
440
441         * bindings/js/JSDOMConvert.h:
442         (WebCore::Converter<JSC::JSValue>::convert):
443         * bindings/scripts/test/JS/JSTestObj.cpp:
444         (WebCore::convert<TestObj::Dictionary>):
445         * bindings/scripts/test/TestObj.idl:
446
447 2016-08-05  Chris Dumez  <cdumez@apple.com>
448
449         [Web IDL] Add support for USVString type
450         https://bugs.webkit.org/show_bug.cgi?id=160608
451
452         Reviewed by Sam Weinig.
453
454         Add support for USVString type in our bindings generator:
455         - http://heycam.github.io/webidl/#idl-USVString
456
457         Also start using USVString instead of DOMString when suitable as per
458         the following specifications:
459         - http://dom.spec.whatwg.org
460         - http://html.spec.whatwg.org
461         - http://url.spec.whatwg.org
462
463         Test: js/dom/webidl-type-mapping.html
464
465         * Modules/websockets/CloseEvent.idl:
466         * Modules/websockets/WebSocket.idl:
467         * bindings/js/JSDOMBinding.cpp:
468         (WebCore::isUnmatchedSurrogatePair):
469         (WebCore::valueToUSVString):
470         (WebCore::valueToUSVStringTreatingNullAsEmptyString):
471         (WebCore::valueToUSVStringWithUndefinedOrNullCheck):
472         * bindings/js/JSDOMBinding.h:
473         * bindings/js/JSDOMWindowCustom.cpp:
474         (WebCore::JSDOMWindow::open):
475         (WebCore::handlePostMessage):
476         * bindings/js/JSHistoryCustom.cpp:
477         (WebCore::JSHistory::pushState):
478         (WebCore::JSHistory::replaceState):
479         * bindings/js/JSMessageEventCustom.cpp:
480         (WebCore::handleInitMessageEvent):
481         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
482         (WebCore::JSWorkerGlobalScope::importScripts):
483         * bindings/scripts/CodeGenerator.pm:
484         (SkipIncludeHeader):
485         (IsStringOrEnumType):
486         (IsStringType):
487         (IsRefPtrType):
488         * bindings/scripts/CodeGeneratorJS.pm:
489         (GenerateParametersCheck):
490         (JSValueToNative):
491         (NativeToJSValue):
492         * bindings/scripts/IDLParser.pm:
493         (parseNonAnyType):
494         * dom/Document.idl:
495         * dom/ErrorEvent.idl:
496         * dom/HashChangeEvent.idl:
497         * dom/MessageEvent.idl:
498         * dom/Node.idl:
499         * html/DOMFormData.idl:
500         * html/DOMURL.idl:
501         * html/HTMLAnchorElement.idl:
502         * html/HTMLAppletElement.idl:
503         * html/HTMLAreaElement.idl:
504         * html/HTMLBaseElement.idl:
505         * html/HTMLButtonElement.idl:
506         * html/HTMLEmbedElement.idl:
507         * html/HTMLFormElement.idl:
508         * html/HTMLFrameElement.idl:
509         * html/HTMLHyperlinkElementUtils.idl:
510         * html/HTMLIFrameElement.idl:
511         * html/HTMLImageElement.idl:
512         * html/HTMLInputElement.idl:
513         * html/HTMLLinkElement.idl:
514         * html/HTMLMediaElement.idl:
515         * html/HTMLModElement.idl:
516         * html/HTMLObjectElement.idl:
517         * html/HTMLQuoteElement.idl:
518         * html/HTMLScriptElement.idl:
519         * html/HTMLSourceElement.idl:
520         * html/HTMLTrackElement.idl:
521         * html/HTMLVideoElement.idl:
522         * html/URLUtils.idl:
523         * page/DOMWindow.idl:
524         * page/EventSource.idl:
525         * page/History.idl:
526         * page/Location.idl:
527         * storage/StorageEvent.idl:
528         * testing/TypeConversions.h:
529         (WebCore::TypeConversions::testString):
530         (WebCore::TypeConversions::setTestString):
531         (WebCore::TypeConversions::testUSVString):
532         (WebCore::TypeConversions::setTestUSVString):
533         * testing/TypeConversions.idl:
534         * workers/Worker.idl:
535         * workers/WorkerGlobalScope.idl:
536
537 2016-08-05  Jeremy Jones  <jeremyj@apple.com>
538
539         revert r202466 r202546 this causes regressions in media loading with temporary redirects.
540         https://bugs.webkit.org/show_bug.cgi?id=160613
541
542         Reviewed by Jon Lee.
543
544         No new tests. Skipping two tests.
545
546         This reverts a change that attempted to fix temporary redirects with media loading.
547         The change introduced problems. Reverting this to require media stack to properly
548         handle redirects.
549
550         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
551         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin):
552         * platform/network/cocoa/WebCoreNSURLSession.h:
553         * platform/network/cocoa/WebCoreNSURLSession.mm:
554         (-[WebCoreNSURLSession initWithResourceLoader:delegate:delegateQueue:]): Deleted.
555         (-[WebCoreNSURLSession updateHasSingleSecurityOrigin:]): Deleted.
556         (-[WebCoreNSURLSession dataTaskWithRequest:]): Deleted.
557         (-[WebCoreNSURLSession dataTaskWithURL:]): Deleted.
558         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.
559         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]): Deleted.
560
561 2016-08-05  Simon Fraser  <simon.fraser@apple.com>
562
563         Add a tiny bit more image logging
564         https://bugs.webkit.org/show_bug.cgi?id=160621
565
566         Reviewed by Tim Horton.
567
568         Add logging related to image subsampling.
569
570         * platform/graphics/BitmapImage.cpp:
571         (WebCore::BitmapImage::frameImageAtIndex):
572
573 2016-08-05  Nan Wang  <n_wang@apple.com>
574
575         AX: Asking for group members of radio button that has no name attribute will cause crash
576         https://bugs.webkit.org/show_bug.cgi?id=160583
577
578         Reviewed by Chris Fleizach.
579
580         The NameToGroupMap is null when there's no name attribute on the radio buttons. Added a 
581         check so that we don't try to get a value from a null HashSet.
582
583         Test: accessibility/mac/radio-button-no-name-crash.html
584
585         * dom/RadioButtonGroups.cpp:
586         (WebCore::RadioButtonGroups::groupMembers):
587
588 2016-08-05  Brent Fulgham  <bfulgham@apple.com>
589
590         ASSERTION FAILED: observer in WebCore::BitmapImage::drawPattern
591         https://bugs.webkit.org/show_bug.cgi?id=141637
592         <rdar://problem/27709864>
593
594         Reviewed by Tim Horton.
595
596         Test: fast/images/image-source-assert.html
597
598         * platform/graphics/BitmapImage.cpp:
599         (WebCore::BitmapImage::drawPattern): Remove invalid assertion.
600
601 2016-08-05  Simon Fraser  <simon.fraser@apple.com>
602
603         marquee with "truespeed" animates at > 60fps, hogging CPU
604         https://bugs.webkit.org/show_bug.cgi?id=160609
605
606         Reviewed by David Hyatt.
607         
608         A <marquee truespeed="" scrollDelay="0"> would fire a zero-delay timer and also
609         fail to animate, hogging CPU.
610         
611         Fix to cap the timer at 16ms intervals. We don't believe it's necessary to
612         maintain web compatibility here.
613
614         Tested by existing tests.
615
616         * html/HTMLMarqueeElement.cpp:
617         (WebCore::HTMLMarqueeElement::minimumDelay):
618         * html/HTMLMarqueeElement.h:
619
620 2016-08-05  Ryan Haddad  <ryanhaddad@apple.com>
621
622         Unreviewed, rolling out r204181.
623
624         This change caused an existing LayoutTest to fail on WK1
625
626         Reverted changeset:
627
628         "Don't set document.domain to an IP address fragment"
629         https://bugs.webkit.org/show_bug.cgi?id=126045
630         http://trac.webkit.org/changeset/204181
631
632 2016-08-05  Commit Queue  <commit-queue@webkit.org>
633
634         Unreviewed, rolling out r204128.
635         https://bugs.webkit.org/show_bug.cgi?id=160607
636
637         Solve the issue by removing the workaround for static files
638         (Requested by jonlee_ on #webkit).
639
640         Reverted changeset:
641
642         "Temporary redirected m3u8 streaming stopped working."
643         https://bugs.webkit.org/show_bug.cgi?id=160472
644         http://trac.webkit.org/changeset/204128
645
646 2016-08-05  Brent Fulgham  <bfulgham@apple.com>
647
648         validity assertion fails after removing a child of an <optgroup> element
649         https://bugs.webkit.org/show_bug.cgi?id=155720
650         <rdar://problem/27720746>
651
652         Reviewed by Brent Fulgham.
653
654         All calls to HTMLSelectElement::setRecalcListItems also need to call HTMLSelectElement::updateValidity.
655
656         Test: fast/dom/HTMLSelectElement/select-remove-from-optgroup.html
657
658         * html/HTMLOptGroupElement.cpp:
659         (WebCore::HTMLOptGroupElement::recalcSelectOptions): Call 'updateValidity' after 'setRecalcListItems'.
660         * html/HTMLOptionElement.cpp:
661         (WebCore::HTMLOptionElement::insertedInto): Ditto.
662         * html/HTMLSelectElement.cpp:
663         (WebCore::HTMLSelectElement::parseAttribute): Ditto.
664
665 2016-08-05  Ryan Haddad  <ryanhaddad@apple.com>
666
667         Unreviewed, rolling out r204174.
668
669         The test for this change is failing on WK1
670
671         Reverted changeset:
672
673         "Popups opened from a sandboxed iframe should themselves be
674         sandboxed"
675         https://bugs.webkit.org/show_bug.cgi?id=134850
676         http://trac.webkit.org/changeset/204174
677
678 2016-08-05  John Wilander  <wilander@apple.com>
679
680         Don't set document.domain to an IP address fragment
681         https://bugs.webkit.org/show_bug.cgi?id=126045
682         <rdar://problem/27331794>
683
684         Reviewed by Daniel Bates.
685
686         This patch matches the following Blink one:
687         https://chromium.googlesource.com/chromium/blink/+/b19a57fdb323d5a80d3a1cb0a6b343558c4237b0
688
689         IP address octets should not be treated as subdomains when setting
690         document.domain. The specs say:
691         'The domain attribute's setter must run these steps: ...
692         7. If host is not equal to effectiveDomain, then run these substeps:
693             1. If host or effectiveDomain is not a domain, then throw a
694             "SecurityError" DOMException.'
695         https://html.spec.whatwg.org/multipage/browsers.html#relaxing-the-same-origin-restriction
696         Last Updated 5 August 2016
697
698         'A host is a domain, an IPv4 address, or an IPv6 address.'
699         https://url.spec.whatwg.org/#concept-domain
700         Last Updated 28 July 2016
701
702         Test: http/tests/security/set-domain-remove-subdomain-for-ip-address.html
703
704         * dom/Document.cpp:
705         (WebCore::Document::setDomain):
706             Now checks whether the security origin is allowed to remove
707             subdomains. If not, it throws a security error.
708         * page/OriginAccessEntry.cpp:
709         (WebCore::OriginAccessEntry::OriginAccessEntry):
710             Constructor now expects an IP address setting.
711         (WebCore::OriginAccessEntry::matchesOrigin):
712             Now also checks whether the host in an IP address and returns
713             false if IP addresses aren't configured to be treated as domains.
714         * page/OriginAccessEntry.h:
715             Introduced new enum for IP address setting.
716             Constructor now expects an IP address setting.
717         (WebCore::OriginAccessEntry::ipAddressSettings):
718             New getter.
719         (WebCore::operator==):
720             Now also requires IP address settings to match.
721         * page/SecurityPolicy.cpp:
722         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
723             Changes to match OriginAccessEntry's new constructor.
724         (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
725             Changes to match OriginAccessEntry's new constructor.
726         * page/Settings.in:
727             Added a setting to allow IP address octets to be treated as
728             subdomains. This way our existing tests setting document.domain
729             still work.
730
731 2016-08-05  Chris Dumez  <cdumez@apple.com>
732
733         Window's named properties should be exposed on a WindowProperties object in its prototype
734         https://bugs.webkit.org/show_bug.cgi?id=160354
735
736         Reviewed by Gavin Barraclough.
737
738         Window's named properties should be exposed on a WindowProperties object
739         in its prototype:
740         - http://heycam.github.io/webidl/#named-properties-object
741
742         Firefox and Chrome both comply with the specification. However, WebKit
743         had no "WindowProperties" object in the Window prototype chain and the
744         named properties are exposed on the Window object itself.
745
746         No new tests, rebaselined existing tests.
747
748         * CMakeLists.txt:
749         * WebCore.xcodeproj/project.pbxproj:
750         * bindings/js/JSBindingsAllInOne.cpp:
751         * bindings/js/JSDOMWindowCustom.cpp:
752         (WebCore::JSDOMWindow::getOwnPropertySlot):
753         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
754         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): Deleted.
755         (WebCore::JSDOMWindow::put): Deleted.
756         (WebCore::JSDOMWindow::putByIndex): Deleted.
757         (WebCore::JSDOMWindow::getEnumerableLength): Deleted.
758         * bindings/js/JSDOMWindowProperties.cpp: Added.
759         (WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter):
760         (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
761         (WebCore::JSDOMWindowProperties::getOwnPropertySlotByIndex):
762         * bindings/js/JSDOMWindowProperties.h: Added.
763         (WebCore::JSDOMWindowProperties::create):
764         (WebCore::JSDOMWindowProperties::createStructure):
765         (WebCore::JSDOMWindowProperties::JSDOMWindowProperties):
766         * bindings/js/JSDOMWindowShell.cpp:
767         (WebCore::JSDOMWindowShell::setWindow):
768
769 2016-08-05  Brady Eidson  <beidson@apple.com>
770
771         Create platform/gamepad directory, and make GamepadProvider pure virtual (with a default empty implementation).
772         https://bugs.webkit.org/show_bug.cgi?id=160599
773
774         Reviewed by Alex Christensen.
775
776         No new tests (No behavior change).
777
778         Except for the GamepadProvider/EmptyGamepadProvider split, this is just moving files around.
779
780         * CMakeLists.txt:
781         * PlatformEfl.cmake:
782         * PlatformGTK.cmake:
783         * WebCore.xcodeproj/project.pbxproj:
784         * platform/Linux.cmake:
785
786         * platform/gamepad.h: Removed.
787         
788         * platform/gamepad/EmptyGamepadProvider.cpp: 
789         (WebCore::EmptyGamepadProvider::startMonitoringGamepads):
790         (WebCore::EmptyGamepadProvider::stopMonitoringGamepads):
791         (WebCore::EmptyGamepadProvider::platformGamepads):
792         * platform/gamepad/EmptyGamepadProvider.h:
793         
794         * platform/gamepad/GamepadProvider.cpp: Renamed from Source/WebCore/platform/GamepadProvider.cpp.
795         (WebCore::GamepadProvider::singleton):
796         (WebCore::GamepadProvider::setSharedProvider):
797         * platform/gamepad/GamepadProvider.h: Renamed from Source/WebCore/platform/GamepadProvider.h.
798         (WebCore::GamepadProvider::~GamepadProvider):
799         
800         * platform/gamepad/GamepadProviderClient.h: Renamed from Source/WebCore/platform/GamepadProviderClient.h.
801         (WebCore::GamepadProviderClient::~GamepadProviderClient):
802         
803         * platform/gamepad/PlatformGamepad.h: Renamed from Source/WebCore/platform/PlatformGamepad.h.
804         (WebCore::PlatformGamepad::~PlatformGamepad):
805         (WebCore::PlatformGamepad::id):
806         (WebCore::PlatformGamepad::index):
807         (WebCore::PlatformGamepad::lastUpdateTime):
808         (WebCore::PlatformGamepad::connectTime):
809         (WebCore::PlatformGamepad::PlatformGamepad):
810
811         * platform/gamepad/deprecated/Gamepads.h: Renamed from Source/WebCore/platform/Gamepads.h.
812
813         * platform/gamepad/efl/GamepadsEfl.cpp: Renamed from Source/WebCore/platform/efl/GamepadsEfl.cpp.
814         (WebCore::GamepadDeviceEfl::resetFdHandler):
815         (WebCore::GamepadDeviceEfl::deviceFile):
816         (WebCore::GamepadDeviceEfl::GamepadDeviceEfl):
817         (WebCore::GamepadDeviceEfl::~GamepadDeviceEfl):
818         (WebCore::GamepadDeviceEfl::readCallback):
819         (WebCore::GamepadsEfl::onGamePadChange):
820         (WebCore::GamepadsEfl::GamepadsEfl):
821         (WebCore::GamepadsEfl::~GamepadsEfl):
822         (WebCore::GamepadsEfl::registerDevice):
823         (WebCore::GamepadsEfl::unregisterDevice):
824         (WebCore::GamepadsEfl::updateGamepadList):
825         (WebCore::sampleGamepads):
826         
827         * platform/gamepad/glib/GamepadsGlib.cpp: Renamed from Source/WebCore/platform/glib/GamepadsGlib.cpp.
828         (WebCore::GamepadDeviceGlib::GamepadDeviceGlib):
829         (WebCore::GamepadDeviceGlib::~GamepadDeviceGlib):
830         (WebCore::GamepadDeviceGlib::readCallback):
831         (WebCore::GamepadsGlib::GamepadsGlib):
832         (WebCore::GamepadsGlib::~GamepadsGlib):
833         (WebCore::GamepadsGlib::registerDevice):
834         (WebCore::GamepadsGlib::unregisterDevice):
835         (WebCore::GamepadsGlib::updateGamepadList):
836         (WebCore::GamepadsGlib::onUEventCallback):
837         (WebCore::GamepadsGlib::isGamepadDevice):
838         (WebCore::sampleGamepads):
839         
840         * platform/gamepad/linux/GamepadDeviceLinux.cpp: Renamed from Source/WebCore/platform/linux/GamepadDeviceLinux.cpp.
841         (WebCore::GamepadDeviceLinux::GamepadDeviceLinux):
842         (WebCore::GamepadDeviceLinux::~GamepadDeviceLinux):
843         (WebCore::GamepadDeviceLinux::updateForEvent):
844         (WebCore::GamepadDeviceLinux::normalizeAxisValue):
845         (WebCore::GamepadDeviceLinux::normalizeButtonValue):
846         * platform/gamepad/linux/GamepadDeviceLinux.h: Renamed from Source/WebCore/platform/linux/GamepadDeviceLinux.h.
847         (WebCore::GamepadDeviceLinux::connected):
848         (WebCore::GamepadDeviceLinux::id):
849         (WebCore::GamepadDeviceLinux::timestamp):
850         (WebCore::GamepadDeviceLinux::axesCount):
851         (WebCore::GamepadDeviceLinux::axesData):
852         (WebCore::GamepadDeviceLinux::buttonsCount):
853         (WebCore::GamepadDeviceLinux::buttonsData):
854         
855         * platform/gamepad/mac/HIDGamepad.cpp: Renamed from Source/WebCore/platform/mac/HIDGamepad.cpp.
856         (WebCore::HIDGamepad::HIDGamepad):
857         (WebCore::HIDGamepad::getCurrentValueForElement):
858         (WebCore::HIDGamepad::initElements):
859         (WebCore::HIDGamepad::initElementsFromArray):
860         (WebCore::HIDGamepad::maybeAddButton):
861         (WebCore::HIDGamepad::maybeAddAxis):
862         (WebCore::HIDGamepad::valueChanged):
863         * platform/gamepad/mac/HIDGamepad.h: Renamed from Source/WebCore/platform/mac/HIDGamepad.h.
864         (WebCore::HIDGamepadElement::HIDGamepadElement):
865         (WebCore::HIDGamepadElement::~HIDGamepadElement):
866         (WebCore::HIDGamepadElement::isButton):
867         (WebCore::HIDGamepadElement::isAxis):
868         (WebCore::HIDGamepadButton::HIDGamepadButton):
869         (WebCore::HIDGamepadAxis::HIDGamepadAxis):
870         (WebCore::HIDGamepad::hidDevice):
871         
872         * platform/gamepad/mac/HIDGamepadProvider.cpp: Renamed from Source/WebCore/platform/mac/HIDGamepadProvider.cpp.
873         (WebCore::deviceMatchingDictionary):
874         (WebCore::deviceAddedCallback):
875         (WebCore::deviceRemovedCallback):
876         (WebCore::deviceValuesChangedCallback):
877         (WebCore::HIDGamepadProvider::singleton):
878         (WebCore::HIDGamepadProvider::HIDGamepadProvider):
879         (WebCore::HIDGamepadProvider::indexForNewlyConnectedDevice):
880         (WebCore::HIDGamepadProvider::connectionDelayTimerFired):
881         (WebCore::HIDGamepadProvider::openAndScheduleManager):
882         (WebCore::HIDGamepadProvider::closeAndUnscheduleManager):
883         (WebCore::HIDGamepadProvider::startMonitoringGamepads):
884         (WebCore::HIDGamepadProvider::stopMonitoringGamepads):
885         (WebCore::HIDGamepadProvider::deviceAdded):
886         (WebCore::HIDGamepadProvider::deviceRemoved):
887         (WebCore::HIDGamepadProvider::valuesChanged):
888         (WebCore::HIDGamepadProvider::inputNotificationTimerFired):
889         (WebCore::HIDGamepadProvider::removeGamepadForDevice):
890         * platform/gamepad/mac/HIDGamepadProvider.h: Renamed from Source/WebCore/platform/mac/HIDGamepadProvider.h.
891         (WebCore::HIDGamepadProvider::platformGamepads):
892
893 2016-08-05  Commit Queue  <commit-queue@webkit.org>
894
895         Unreviewed, rolling out r204147.
896         https://bugs.webkit.org/show_bug.cgi?id=160602
897
898         Considering another implementation (Requested by eric_carlson
899         on #webkit).
900
901         Reverted changeset:
902
903         "Add long, boolean, double, and String Media Constraint
904         classes"
905         https://bugs.webkit.org/show_bug.cgi?id=160524
906         http://trac.webkit.org/changeset/204147
907
908 2016-08-05  John Wilander  <wilander@apple.com>
909
910         Popups opened from a sandboxed iframe should themselves be sandboxed
911         https://bugs.webkit.org/show_bug.cgi?id=134850
912         <rdar://problem/27375388>
913
914         Reviewed by Brent Fulgham.
915
916         This replicates the behavior in Chrome, Firefox, and according to the reporter
917         also in Internet Explorer. See the Mozilla bug report:
918         https://bugzilla.mozilla.org/show_bug.cgi?id=1037381#c1
919
920         Test: http/tests/security/window-opened-from-sandboxed-iframe-should-inherit-sandbox.html
921
922         * page/Chrome.cpp:
923         (WebCore::Chrome::createWindow):
924             Now copies the opener's frame loader effective sandbox flags to the new
925             frame loader.
926
927 2016-08-05  Darin Adler  <darin@apple.com>
928
929         * DerivedSources.make: Fix all places that were using tabs instead of spaces outside
930         the actual make rules, where tabs are required as part of make syntax.
931
932 2016-08-05  Youenn Fablet  <youenn@apple.com>
933
934         [Fetch API] SubresourceLoader::checkRedirectionCrossOriginAccessControl should not always assert in SameOrigin mode
935         https://bugs.webkit.org/show_bug.cgi?id=160594
936
937         Reviewed by Alex Christensen.
938
939         Covered by rebased tests.
940
941         * loader/SubresourceLoader.cpp:
942         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
943         It should not throw is mode is SameOrigin and resource is same origin.
944
945 2016-08-05  Youenn Fablet  <youenn@apple.com>
946
947         [Fetch API] Response.blob should not assert in case the created blob is empty
948         https://bugs.webkit.org/show_bug.cgi?id=160592
949
950         Reviewed by Alex Christensen.
951
952         Covered bu updated test.
953
954         * Modules/fetch/FetchBodyConsumer.cpp:
955         (WebCore::FetchBodyConsumer::takeAsBlob): Removing assertion as a response may have a body but with no data in it.
956
957 2016-08-05  Commit Queue  <commit-queue@webkit.org>
958
959         Unreviewed, rolling out r203935.
960         https://bugs.webkit.org/show_bug.cgi?id=160596
961
962         looks like a 1-2% PLUM regression on iPhone 6s (Requested by
963         kling_ on #webkit).
964
965         Reverted changeset:
966
967         "Window's named properties should be exposed on a
968         WindowProperties object in its prototype"
969         https://bugs.webkit.org/show_bug.cgi?id=160354
970         http://trac.webkit.org/changeset/203935
971
972 2016-08-05  Youenn Fablet  <youenn@apple.com>
973
974         [Fetch API] Activate CSP checks
975         https://bugs.webkit.org/show_bug.cgi?id=160445
976
977         Reviewed by Daniel Bates.
978
979         Tests: http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-insecure-fetch-in-main-frame.html
980                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-insecure-fetch-in-worker.html
981
982         * Modules/fetch/FetchLoader.cpp:
983         (WebCore::FetchLoader::start): Adding CSP and URL upgrade checks.
984
985 2016-08-05  Youenn Fablet  <youenn@apple.com>
986
987         DocumentThreadableLoader should report an error when getting a null CachedResource
988         https://bugs.webkit.org/show_bug.cgi?id=160444
989
990         Reviewed by Alex Christensen.
991
992         Covered by existing and rebased tests.
993
994         * loader/DocumentThreadableLoader.cpp:
995         (WebCore::DocumentThreadableLoader::loadRequest): Calling didFail with an AccessControl error if unable to have a CachedResource.
996         The resource error type AccessControl is important as it indicates to some clients that they should not retry loading the same resource (EventSource notably).
997         * xml/XMLHttpRequest.cpp:
998         (WebCore::XMLHttpRequest::createRequest): Removed handling of ThreadableLoader::create returning null.
999         This should be handled in didFail callback. This allows aligning behavior of
1000         WorkerThreadableLoaderi::MainThreadBridge and XMLHttpRequest as ThreadableLoader clients.
1001         (WebCore::XMLHttpRequest::didFail): Handle the case of didFail being called synchronously from ThreadableLoader::create.
1002         In that case, use a timer to dispatch network events asynchronously.
1003
1004 2016-08-04  Chris Dumez  <cdumez@apple.com>
1005
1006         Add support for DOMTokenList.replace()
1007         https://bugs.webkit.org/show_bug.cgi?id=160573
1008
1009         Reviewed by Alex Christensen.
1010
1011         Add support for DOMTokenList.replace():
1012         https://dom.spec.whatwg.org/#dom-domtokenlist-replace
1013
1014         No new tests, rebaselined existing tests.
1015
1016         * html/DOMTokenList.cpp:
1017         (WebCore::tokenContainsHTMLSpace):
1018         (WebCore::DOMTokenList::validateToken):
1019         (WebCore::DOMTokenList::replace):
1020         * html/DOMTokenList.h:
1021         * html/DOMTokenList.idl:
1022
1023 2016-08-04  Myles C. Maxfield  <mmaxfield@apple.com>
1024
1025         [iOS] Some videos in iBooks erroneously go fullscreen
1026         https://bugs.webkit.org/show_bug.cgi?id=160582
1027         <rdar://problem/27669831>
1028
1029         Reviewed by Jon Lee.
1030
1031         No new tests because we can't currently mock the iBooks application bundle ID.
1032
1033         * html/MediaElementSession.cpp:
1034         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
1035
1036 2016-08-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1037
1038         [Fontconfig] Segmentation fault in WebCore::FontCache::lastResortFallbackFont
1039         https://bugs.webkit.org/show_bug.cgi?id=141432
1040
1041         Reviewed by Myles C. Maxfield.
1042
1043         Crash more cleanly when we can't find any last resort fallback font.
1044
1045         * platform/graphics/freetype/FontCacheFreeType.cpp:
1046         (WebCore::FontCache::lastResortFallbackFont):
1047
1048 2016-08-04  Chris Dumez  <cdumez@apple.com>
1049
1050         Move insertAdjacent*() API from HTMLElement to Element
1051         https://bugs.webkit.org/show_bug.cgi?id=160567
1052
1053         Reviewed by Sam Weinig.
1054
1055         Move insertAdjacent*() API from HTMLElement to Element:
1056         - https://w3c.github.io/DOM-Parsing/#extensions-to-the-element-interface
1057         - https://dom.spec.whatwg.org/#element
1058
1059         Firefox and Chrome both have insertAdjacentHTML() on Element.
1060         Chrome has insertAdjacentText() / insertAdjacentElement() on Element as
1061         well. Firefox does not have this API at all.
1062
1063         Also align insertAdjacentHTML() with the specification so that we
1064         now throw a NO_MODIFICATION_ALLOWED_ERR if called with "beforebegin" /
1065         "afterend" on a parent-less element. This is as per:
1066         - https://w3c.github.io/DOM-Parsing/#dom-element-insertadjacenthtml
1067
1068         Previously, WebKit would just silently ignore such calls. The new
1069         behavior with consistent with both Firefox and Chrome.
1070
1071         No new tests, rebaselined existing tests.
1072
1073         * dom/Element.cpp:
1074         (WebCore::Element::insertAdjacent):
1075         (WebCore::Element::insertAdjacentElement):
1076         (WebCore::contextElementForInsertion):
1077         (WebCore::Element::insertAdjacentHTML):
1078         (WebCore::Element::insertAdjacentText):
1079         * dom/Element.h:
1080         * dom/Element.idl:
1081         * html/HTMLElement.cpp:
1082         (WebCore::HTMLElement::insertAdjacent): Deleted.
1083         (WebCore::HTMLElement::insertAdjacentElement): Deleted.
1084         (WebCore::contextElementForInsertion): Deleted.
1085         (WebCore::HTMLElement::insertAdjacentHTML): Deleted.
1086         (WebCore::HTMLElement::insertAdjacentText): Deleted.
1087         * html/HTMLElement.h:
1088         * html/HTMLElement.idl:
1089
1090 2016-08-04  Anders Carlsson  <andersca@apple.com>
1091
1092         Another build fix attempt.
1093
1094         * bindings/gobject/WebKitDOMDeprecated.cpp:
1095
1096 2016-08-04  George Ruan  <gruan@apple.com>
1097
1098         Add long, boolean, double, and String Media Constraint classes
1099         https://bugs.webkit.org/show_bug.cgi?id=160524
1100         <rdar://problem/27685132>
1101
1102         Reviewed by Eric Carlson.
1103
1104         No new tests. The current patch is untestable, but functionality
1105         will be tested in a future patch.
1106
1107         * WebCore.xcodeproj/project.pbxproj:
1108         * platform/mediastream/MediaConstraints.cpp: Added.
1109         (WebCore::BaseConstraint::create): Initializes min, max, exact, ideal
1110         value of constraint with dictionary.
1111         (WebCore::BaseConstraint::createEmptyDerivedConstraint): Factory 
1112         for all derived constraints.
1113         (WebCore::LongConstraint::create): Creates LongConstraint with name.
1114         (WebCore::LongConstraint::setMin): Sets mandatory min constraint value.
1115         (WebCore::LongConstraint::setMax): Sets mandatory max constraint value.
1116         (WebCore::LongConstraint::setExact): Sets mandatory exact constraint
1117         value.
1118         (WebCore::LongConstraint::setIdeal): Sets optional ideal constraint
1119         value.
1120         (WebCore::LongConstraint::initializeWithDictionary): Parses user input
1121         and sets min, max, exact, ideal values.
1122         (WebCore::DoubleConstraint::create): Ditto.
1123         (WebCore::DoubleConstraint::setMin): Ditto.
1124         (WebCore::DoubleConstraint::setMax): Ditto.
1125         (WebCore::DoubleConstraint::setExact): Ditto.
1126         (WebCore::DoubleConstraint::setIdeal): Ditto.
1127         (WebCore::DoubleConstraint::initializeWithDictionary): Ditto.
1128         (WebCore::BooleanConstraint::create): Ditto.
1129         (WebCore::BooleanConstraint::setExact): Ditto.
1130         (WebCore::BooleanConstraint::setIdeal): Ditto.
1131         (WebCore::BooleanConstraint::initializeWithDictionary): Ditto.
1132         (WebCore::StringConstraint::create): Ditto.
1133         (WebCore::StringConstraint::setExact): Ditto.
1134         (WebCore::StringConstraint::setIdeal): Ditto.
1135         (WebCore::StringConstraint::initializeWithDictionary): Ditto.
1136         * platform/mediastream/MediaConstraints.h: Add abstract classes
1137         BaseConstraint and NumericConstraint, and final classes
1138         DoubleConstraint, LongConstraint, BooleanConstraint, and
1139         StringConstraint.
1140         (WebCore::BaseConstraint::~BaseConstraint):
1141         (WebCore::BaseConstraint::name): Name of constraint associated with.
1142         (WebCore::BaseConstraint::BaseConstraint):
1143         (WebCore::NumericConstraint::setHasMin): Sets min constraint value.
1144         (WebCore::NumericConstraint::setHasMax): Sets max constraint value.
1145         (WebCore::NumericConstraint::setHasExact): Sets exact constraint
1146         value.
1147         (WebCore::NumericConstraint::setHasIdeal): Sets ideal constraint
1148         value.
1149         (WebCore::NumericConstraint::hasMin): Determines whether constraint
1150         has a minimum value.
1151         (WebCore::NumericConstraint::hasMax): Determines whether constraint
1152         has a maximum value.
1153         (WebCore::NumericConstraint::hasExact): Determines whether constraint
1154         has an exact value.
1155         (WebCore::NumericConstraint::NumericConstraint):
1156
1157 2016-08-04  Anders Carlsson  <andersca@apple.com>
1158
1159         Try to fix the GTK+ build.
1160
1161         * bindings/gobject/WebKitDOMDeprecated.cpp:
1162         (webkit_dom_document_get_elements_by_tag_name):
1163         (webkit_dom_document_get_elements_by_tag_name_ns):
1164         (webkit_dom_document_get_elements_by_class_name):
1165         (webkit_dom_element_get_elements_by_tag_name):
1166         (webkit_dom_element_get_elements_by_tag_name_ns):
1167         (webkit_dom_element_get_elements_by_class_name):
1168
1169 2016-08-04  Chris Dumez  <cdumez@apple.com>
1170
1171         Add support for wrapper types in dictionaries
1172         https://bugs.webkit.org/show_bug.cgi?id=160487
1173
1174         Reviewed by Sam Weinig.
1175
1176         Add support for nullable wrapper types in dictionaries.
1177         A TypeError is thrown if the conversion fails.
1178
1179         No new tests, updated bindings tests.
1180
1181         * bindings/js/JSDOMConvert.h:
1182         (WebCore::convertWrapperType):
1183         * bindings/scripts/CodeGeneratorJS.pm:
1184         (GenerateDictionaryImplementationContent):
1185         * bindings/scripts/IDLParser.pm:
1186         (parseDictionaryMember):
1187         * bindings/scripts/test/JS/JSTestObj.cpp:
1188         (WebCore::convert<TestObj::Dictionary>):
1189         * bindings/scripts/test/TestObj.idl:
1190
1191 2016-08-04  Csaba Osztrogonác  <ossy@webkit.org>
1192
1193         [Mac][cmake] Fix the build after Objective-C bindings generator removal
1194         https://bugs.webkit.org/show_bug.cgi?id=160545
1195
1196         Reviewed by Alex Christensen.
1197
1198         * CMakeLists.txt:
1199         * PlatformMac.cmake:
1200
1201 2016-08-04  Ryan Haddad  <ryanhaddad@apple.com>
1202
1203         Attempt to fix Windows build after r204134.
1204
1205         Unreviewed build fix.
1206
1207         * dom/DOMAllInOne.cpp:
1208
1209 2016-08-04  Anders Carlsson  <andersca@apple.com>
1210
1211         Remove more Objective-C specific bindings code
1212         https://bugs.webkit.org/show_bug.cgi?id=160564
1213
1214         Reviewed by Sam Weinig.
1215
1216         * CMakeLists.txt:
1217         * DerivedSources.make:
1218         * WebCore.xcodeproj/project.pbxproj:
1219         * bindings/js/JSNodeCustom.cpp:
1220         * bindings/objc/DOMDocument.mm:
1221         * bindings/objc/DOMEntity.mm:
1222         (-[DOMEntity publicId]):
1223         (-[DOMEntity systemId]):
1224         (-[DOMEntity notationName]):
1225         * bindings/objc/DOMEntityReference.mm:
1226         (kit): Deleted.
1227         * bindings/objc/DOMEntityReferenceInternal.h: Removed.
1228         * bindings/objc/DOMNodeIterator.mm:
1229         (-[DOMNodeIterator expandEntityReferences]):
1230         * bindings/objc/DOMTreeWalker.mm:
1231         (-[DOMTreeWalker expandEntityReferences]):
1232         * dom/Document.idl:
1233         * dom/Entity.h: Removed.
1234         (WebCore::Entity::publicId): Deleted.
1235         (WebCore::Entity::systemId): Deleted.
1236         (WebCore::Entity::notationName): Deleted.
1237         (WebCore::Entity::Entity): Deleted.
1238         * dom/Entity.idl: Removed.
1239         * dom/EntityReference.cpp: Removed.
1240         (WebCore::EntityReference::EntityReference): Deleted.
1241         * dom/EntityReference.h: Removed.
1242         * dom/EntityReference.idl: Removed.
1243         * dom/NodeIterator.idl:
1244         * dom/Traversal.h:
1245         (WebCore::NodeIteratorBase::expandEntityReferences): Deleted.
1246         * dom/TreeWalker.idl:
1247
1248 2016-08-04  Chris Dumez  <cdumez@apple.com>
1249
1250         Simplify overloads for HTMLSelectElement.add() / HTMLOptionsCollection.add()
1251         https://bugs.webkit.org/show_bug.cgi?id=160527
1252
1253         Reviewed by Ryosuke Niwa.
1254
1255         Simplify overloads for HTMLSelectElement.add() / HTMLOptionsCollection.add().
1256         We now have 2 overloads instead of 3 while achieving the same web-facing
1257         behavior.
1258
1259         * html/HTMLOptionsCollection.h:
1260         * html/HTMLOptionsCollection.idl:
1261         * html/HTMLSelectElement.h:
1262         (WebCore::HTMLSelectElement::add): Deleted.
1263         * html/HTMLSelectElement.idl:
1264
1265 2016-08-04  Anders Carlsson  <andersca@apple.com>
1266
1267         Move Objective-C bindings specific code into the bindings
1268         https://bugs.webkit.org/show_bug.cgi?id=160561
1269
1270         Reviewed by Tim Horton.
1271
1272         * bindings/objc/DOMDocument.mm:
1273         (-[DOMDocument createEntityReference:]):
1274         (-[DOMDocument getElementsByTagName:]):
1275         (-[DOMDocument getElementsByTagNameNS:localName:]):
1276         (-[DOMDocument getElementsByClassName:]):
1277         * bindings/objc/DOMElement.mm:
1278         (-[DOMElement getElementsByTagName:]):
1279         (-[DOMElement getElementsByTagNameNS:localName:]):
1280         (-[DOMElement getElementsByClassName:]):
1281         * css/CSSCharsetRule.idl:
1282         * dom/ContainerNode.cpp:
1283         (WebCore::ContainerNode::getElementsByTagNameForObjC): Deleted.
1284         (WebCore::ContainerNode::getElementsByTagNameNSForObjC): Deleted.
1285         (WebCore::ContainerNode::getElementsByClassNameForObjC): Deleted.
1286         * dom/ContainerNode.h:
1287         * dom/Document.cpp:
1288         (WebCore::Document::createEntityReference): Deleted.
1289         * dom/Document.h:
1290         * dom/Document.idl:
1291         * dom/Element.idl:
1292
1293 2016-08-04  Anders Carlsson  <andersca@apple.com>
1294
1295         Clean up the deprecated Objective-C binding methods
1296         https://bugs.webkit.org/show_bug.cgi?id=160558
1297
1298         Reviewed by Tim Horton.
1299
1300         Put the deprecated methods in their respective category @implementation, and
1301         simply have them call their non-deprecated counterparts.
1302
1303         * bindings/objc/DOMCSSMediaRule.mm:
1304         (-[DOMCSSMediaRule deleteRule:]):
1305         (-[DOMCSSMediaRule insertRule::]):
1306         * bindings/objc/DOMCSSPrimitiveValue.mm:
1307         (-[DOMCSSPrimitiveValue setFloatValue::]):
1308         (-[DOMCSSPrimitiveValue setStringValue::]):
1309         * bindings/objc/DOMCSSStyleDeclaration.mm:
1310         (-[DOMCSSStyleDeclaration setProperty:::]):
1311         * bindings/objc/DOMCSSStyleSheet.mm:
1312         (-[DOMCSSStyleSheet insertRule::]):
1313         * bindings/objc/DOMCharacterData.mm:
1314         (-[DOMCharacterData deleteData:length:]):
1315         (-[DOMCharacterData replaceData:length:data:]):
1316         (-[DOMCharacterData remove]):
1317         (-[DOMCharacterData substringData::]):
1318         (-[DOMCharacterData insertData::]):
1319         (-[DOMCharacterData deleteData::]):
1320         (-[DOMCharacterData replaceData:::]):
1321         * bindings/objc/DOMDocument.mm:
1322         (-[DOMDocument createProcessingInstruction::]):
1323         (-[DOMDocument importNode::]):
1324         (-[DOMDocument createElementNS::]):
1325         (-[DOMDocument createAttributeNS::]):
1326         (-[DOMDocument getElementsByTagNameNS::]):
1327         (-[DOMDocument createNodeIterator::::]):
1328         (-[DOMDocument createTreeWalker::::]):
1329         (-[DOMDocument getOverrideStyle::]):
1330         (-[DOMDocument createExpression::]):
1331         (-[DOMDocument evaluate:::::]):
1332         (-[DOMDocument getComputedStyle::]):
1333         * bindings/objc/DOMElement.mm:
1334         (-[DOMElement setAttribute::]):
1335         (-[DOMElement getAttributeNS::]):
1336         (-[DOMElement setAttributeNS:::]):
1337         (-[DOMElement removeAttributeNS::]):
1338         (-[DOMElement getElementsByTagNameNS::]):
1339         (-[DOMElement getAttributeNodeNS::]):
1340         (-[DOMElement hasAttributeNS::]):
1341         * bindings/objc/DOMEvent.mm:
1342         (-[DOMEvent stopImmediatePropagation]):
1343         (-[DOMEvent initEvent:::]):
1344         * bindings/objc/DOMHTMLSelectElement.mm:
1345         (-[DOMHTMLSelectElement remove:]):
1346         (-[DOMHTMLSelectElement add::]):
1347         * bindings/objc/DOMMouseEvent.mm:
1348         (-[DOMMouseEvent initMouseEvent:::::::::::::::]):
1349         * bindings/objc/DOMMutationEvent.mm:
1350         (-[DOMMutationEvent initMutationEvent::::::::]):
1351         * bindings/objc/DOMNamedNodeMap.mm:
1352         (-[DOMNamedNodeMap getNamedItemNS::]):
1353         (-[DOMNamedNodeMap removeNamedItemNS::]):
1354         * bindings/objc/DOMNode.mm:
1355         (-[DOMNode insertBefore::]):
1356         (-[DOMNode replaceChild::]):
1357         (-[DOMNode isSupported::]):
1358         * bindings/objc/DOMRange.mm:
1359         (-[DOMRange setStart::]):
1360         (-[DOMRange setEnd::]):
1361         (-[DOMRange compareBoundaryPoints::]):
1362         * bindings/objc/DOMUIEvent.mm:
1363         (-[DOMUIEvent initUIEvent:::::]):
1364         * bindings/objc/DOMXPathExpression.mm:
1365         (-[DOMXPathExpression evaluate:::]):
1366
1367 2016-08-04  Jeremy Jones  <jeremyj@apple.com>
1368
1369         Temporary redirected m3u8 streaming stopped working.
1370         https://bugs.webkit.org/show_bug.cgi?id=160472
1371         rdar://problem/27592694
1372
1373         Reviewed by Alex Christensen.
1374
1375         Test: http/tests/media/hls/hls-redirect.html
1376
1377         The change for https://trac.webkit.org/changeset/202466 hides knowledge of the temporary redirected URL from 
1378         WebCoreNSURLSession clients. MPEG playlists (e.g. .m3u8) can contain paths relative to the redirected URL.
1379
1380         This change exposes the redirected URL for MPEG playlists.
1381
1382         * platform/MIMETypeRegistry.cpp:
1383         (WebCore::initializeMPEGPlaylistMIMETypes): Added.
1384         (WebCore::initializeMIMETypeRegistry):
1385         (WebCore::MIMETypeRegistry::isMPEGPlaylistMIMEType): Added.
1386         * platform/MIMETypeRegistry.h:
1387         * platform/network/cocoa/WebCoreNSURLSession.mm:
1388         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Add MPEG playlist condition.
1389         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]): Add MPEG playlist condition.
1390
1391 2016-08-04  Alex Christensen  <achristensen@webkit.org>
1392
1393         Content Blocker cannot block WebSocket connections
1394         https://bugs.webkit.org/show_bug.cgi?id=160159
1395
1396         Reviewed by Brady Eidson.
1397
1398         Tests: http/tests/websocket/tests/hybi/contentextensions/block-cookies-worker.php
1399                http/tests/websocket/tests/hybi/contentextensions/block-cookies.php
1400                http/tests/websocket/tests/hybi/contentextensions/block-worker.html
1401                http/tests/websocket/tests/hybi/contentextensions/block.html
1402                http/tests/websocket/tests/hybi/contentextensions/display-none-worker.html
1403                http/tests/websocket/tests/hybi/contentextensions/display-none.html
1404                http/tests/websocket/tests/hybi/contentextensions/upgrade-worker.html
1405                http/tests/websocket/tests/hybi/contentextensions/upgrade.html
1406
1407         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
1408         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageError):
1409         (WebCore::ThreadableWebSocketChannelClientWrapper::didUpgradeURL):
1410         (WebCore::ThreadableWebSocketChannelClientWrapper::suspend):
1411         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
1412         * Modules/websockets/WebSocket.cpp:
1413         (WebCore::WebSocket::didClose):
1414         (WebCore::WebSocket::didUpgradeURL):
1415         (WebCore::WebSocket::getFramingOverhead):
1416         * Modules/websockets/WebSocket.h:
1417         
1418         Added didUpgradeURL to WebSocketChannelClient so the WebSocketChannel can tell the WebSocket
1419         that it has upgraded a ws: url to a wss: url.
1420         
1421         * Modules/websockets/WebSocketChannel.cpp:
1422         (WebCore::WebSocketChannel::~WebSocketChannel):
1423         (WebCore::WebSocketChannel::connect):
1424         
1425         If content extensions are being used, run the URL through the content extension and apply its actions
1426         before connecting the WebSocket.  This is done in WebSocketChannel instead of WebSocket like the CSP checks
1427         because we need access to the Document in order to get access to the main document's URL for if-domain and
1428         unless-domain rules, and to apply any display:none css to the Document.
1429         
1430         (WebCore::WebSocketChannel::disconnect):
1431         * Modules/websockets/WebSocketChannelClient.h:
1432         (WebCore::WebSocketChannelClient::~WebSocketChannelClient):
1433         (WebCore::WebSocketChannelClient::WebSocketChannelClient):
1434         (WebCore::WebSocketChannelClient::didConnect):
1435         (WebCore::WebSocketChannelClient::didReceiveMessage):
1436         (WebCore::WebSocketChannelClient::didReceiveBinaryData):
1437         (WebCore::WebSocketChannelClient::didReceiveMessageError):
1438         (WebCore::WebSocketChannelClient::didUpdateBufferedAmount):
1439         (WebCore::WebSocketChannelClient::didStartClosingHandshake):
1440         (WebCore::WebSocketChannelClient::didClose):
1441         
1442         Made WebSocketChannelClient purely virtual to avoid accidentally making an implementation that is missing functionality.
1443         
1444         (WebCore::WebSocketChannelClient::didUpgradeURL): Added.
1445         * Modules/websockets/WebSocketHandshake.cpp:
1446         (WebCore::WebSocketHandshake::getExpectedWebSocketAccept):
1447         (WebCore::WebSocketHandshake::WebSocketHandshake):
1448         (WebCore::WebSocketHandshake::clientOrigin):
1449         (WebCore::WebSocketHandshake::clientLocation):
1450         (WebCore::WebSocketHandshake::clientHandshakeMessage):
1451         
1452         Only put cookies on the WebSocket's handshake if we are allowed to use cookies.
1453         
1454         (WebCore::WebSocketHandshake::clientHandshakeRequest):
1455         
1456         A WebSocketHandshake always has a Document* for its ScriptExecutionContext, so I replaced m_context with 
1457         m_document and removed a suspicious-looking check for is<Document> that turned out to not be suspicious at all.
1458         
1459         (WebCore::WebSocketHandshake::reset):
1460         (WebCore::WebSocketHandshake::clearDocument):
1461         (WebCore::WebSocketHandshake::readServerHandshake):
1462         (WebCore::WebSocketHandshake::clearScriptExecutionContext): Deleted.
1463         * Modules/websockets/WebSocketHandshake.h:
1464         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
1465         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
1466         (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpgradeURL):
1467         (WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge):
1468         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
1469         * contentextensions/ContentExtensionActions.h:
1470         
1471         Before this change we would pass a ResourceRequest as a parameter to the content extension engine.
1472         The ResourceRequest would be used to get the URL, and it would be modified by possibly disabling cookies
1473         or making the URL https.  Any display:none CSS rules added were put into the Document through the DocumentLoader.
1474         The only information it needed to return was whether the load was blocked.
1475         To make content extensions work with WebSockets, we need to pass a URL as a parameter instead of a ResourceRequest
1476         because there is no ResourceRequest with WebSockets, only a URL.  We can still put CSS rules in through the DocumentLoader,
1477         but the rest of the actions need to be returned through the return value, which is then processed by the callers.
1478         BlockedStatus is now a struct containing a set of actions to apply, and applyBlockedStatusToRequest is a helper function
1479         that applies the actions to the ResourceRequests we have at all previously existing call sites of processContentExtensionRulesForLoad.
1480         
1481         * contentextensions/ContentExtensionsBackend.cpp:
1482         (WebCore::ContentExtensions::ContentExtensionsBackend::globalDisplayNoneStyleSheet):
1483         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
1484         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
1485         (WebCore::ContentExtensions::applyBlockedStatusToRequest):
1486         * contentextensions/ContentExtensionsBackend.h:
1487         * html/HTMLMediaElement.cpp:
1488         (WebCore::HTMLMediaElement::loadResource):
1489         
1490         Here, we also only had a URL.  Before, we were making a ResourceRequest from the URL just for the content extension engine,
1491         but now we can just pass the URL.
1492         
1493         * loader/FrameLoader.cpp:
1494         (WebCore::FrameLoader::loadResourceSynchronously):
1495         * loader/PingLoader.cpp:
1496         (WebCore::processContentExtensionRulesForLoad):
1497         (WebCore::PingLoader::loadImage):
1498         (WebCore::PingLoader::sendPing):
1499         (WebCore::PingLoader::sendViolationReport):
1500         * loader/ResourceLoader.cpp:
1501         (WebCore::ResourceLoader::willSendRequestInternal):
1502         * loader/cache/CachedResourceLoader.cpp:
1503         (WebCore::CachedResourceLoader::requestResource):
1504         * page/UserContentProvider.cpp:
1505         (WebCore::contentExtensionsEnabled):
1506         (WebCore::UserContentProvider::processContentExtensionRulesForLoad):
1507         (WebCore::UserContentProvider::actionsForResourceLoad):
1508         * page/UserContentProvider.h:
1509
1510 2016-08-04  Chris Dumez  <cdumez@apple.com>
1511
1512         [[Prototype]] property of an interface object for a callback interface must be the Object.prototype object
1513         https://bugs.webkit.org/show_bug.cgi?id=160555
1514
1515         Reviewed by Geoffrey Garen.
1516
1517         [[Prototype]] property of an interface object for a callback interface
1518         must be the Object.prototype object:
1519         - http://heycam.github.io/webidl/#interface-object
1520
1521         This impacts NodeFilter, which is a callback interface.
1522
1523         No new tests, rebaselined existing test.
1524
1525         * bindings/scripts/CodeGeneratorJS.pm:
1526         (GenerateConstructorHelperMethods):
1527
1528 2016-08-04  Chris Dumez  <cdumez@apple.com>
1529
1530         Element.insertAdjacent*() should throw a SYNTAX_ERR for invalid "where" parameter
1531         https://bugs.webkit.org/show_bug.cgi?id=160514
1532
1533         Reviewed by Alex Christensen.
1534
1535         Element.insertAdjacent*() should throw a SYNTAX_ERR for invalid "where" parameter:
1536         - https://dom.spec.whatwg.org/#insert-adjacent
1537
1538         We were throwing a NOT_SUPPORTED_ERR instead.
1539
1540         No new tests, rebaselined existing tests.
1541
1542         * html/HTMLElement.cpp:
1543         (WebCore::HTMLElement::insertAdjacent):
1544
1545 2016-08-04  Alejandro G. Castro  <alex@igalia.com>
1546
1547         WebRTC: OWR: Add support for the muted state in the mediaplayer
1548         https://bugs.webkit.org/show_bug.cgi?id=160502
1549
1550         Modified the load, play and stop methods to handle the new
1551         situation where the mediaSource could be empty, until the remote
1552         side sends the information to create the receiver.
1553
1554         Reviewed by Philippe Normand.
1555
1556         No new tests, we need to upstream the owr endpoint to check this
1557         situation.
1558
1559         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
1560         (WebCore::MediaPlayerPrivateGStreamerOwr::play): Check the muted
1561         state of the tracks if required, we do it using the new
1562         maybeHandleChangeMutedState function.
1563         (WebCore::MediaPlayerPrivateGStreamerOwr::load): Add always the
1564         observer of the track to check when it is unmuted, and we delay
1565         enabling/setting the source until the play or the unmute.
1566         (WebCore::MediaPlayerPrivateGStreamerOwr::internalLoad): Removed,
1567         we now do all in the load method.
1568         (WebCore::MediaPlayerPrivateGStreamerOwr::stop): Remove the
1569         mediasource when disabling. Removed the m_stopped state, it was
1570         there because the internalLoad was called multiple times.
1571         (WebCore::MediaPlayerPrivateGStreamerOwr::trackMutedChanged):
1572         Check the muted state and handle it, we use the new method
1573         maybeHandleChangeMutedState.
1574         (WebCore::MediaPlayerPrivateGStreamerOwr::maybeHandleChangeMutedState):
1575         Check if the track is muted or not, in case it is muted disable
1576         the the renderer and remove its mediasource. If it is not muted
1577         enable the renderer and set the mediasource.
1578         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink): Move
1579         the workaround for the renderer to this method when it is created.
1580         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
1581         Removed internalLoad method and the m_stopped attribute used to
1582         call internalLoad multiple times.
1583
1584 2016-08-04  Youenn Fablet  <youenn@apple.com>
1585
1586         DocumentThreadableLoader should pass the fetch mode to underlying loader code
1587         https://bugs.webkit.org/show_bug.cgi?id=160399
1588
1589         Reviewed by Alex Christensen.
1590
1591         Tests: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-origin-worker.html
1592                imported/w3c/web-platform-tests/fetch/api/redirect/redirect-origin.html
1593         Covered by existing and rebased tests.
1594
1595         DocumentThredableLoader was previously loading resources in NoCors mode and doing the cors checks on it own.
1596         This was duplicating code and increasing the risk of being not consistent.
1597         DocumentThreadableLoader is now passing the fetch mode given by client to underlying loader code.
1598         This allows removing some CORS checks in DocumentThreadableLoader code for redirections.
1599
1600         Updated SubresourceLoader redirection CORS checks to be on par with DocumentThreadableLoader.
1601         In particular, aligning the code with https://fetch.spec.whatwg.org/#http-redirect-fetch.
1602
1603         The error logging situation is not perfect as some errors are properly logged in the console while some others are not.
1604         For instance blockedError (due to forbidden port for instance) reason is not logged on the console.
1605
1606         * loader/DocumentThreadableLoader.cpp:
1607         (WebCore::DocumentThreadableLoader::redirectReceived): Updating redirection checking as SubresourceLoader is already doing most of the checks.
1608         (WebCore::DocumentThreadableLoader::didReceiveResponse): Removing temp hack as tainting is now computed by underlying loader code.
1609         (WebCore::DocumentThreadableLoader::loadRequest): Removing fetch mode change.
1610         * loader/SubresourceLoader.cpp:
1611         (WebCore::SubresourceLoader::willSendRequestInternal): Updating cancellation error and improve error logging.
1612         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl): Improved the checks and error reporting.
1613         Tried to align as much as possible to https://fetch.spec.whatwg.org/#http-redirect-fetch.
1614         * loader/SubresourceLoader.h:
1615         * xml/XMLHttpRequest.cpp:
1616         (WebCore::XMLHttpRequest::didFail): Added an error message to the console in case of access control error.
1617
1618 2016-08-03  Chris Dumez  <cdumez@apple.com>
1619
1620         Object.getOwnPropertyNames() on NamedNodeMap fails to return named properties
1621         https://bugs.webkit.org/show_bug.cgi?id=160517
1622
1623         Reviewed by Alex Christensen.
1624
1625         Object.getOwnPropertyNames() on NamedNodeMap should return named
1626         properties' names as per:
1627         - https://dom.spec.whatwg.org/#dom-namednodemap-item
1628
1629         No new tests, rebaselined existing tests.
1630
1631         * dom/NamedNodeMap.cpp:
1632         (WebCore::NamedNodeMap::supportedPropertyNames):
1633         * dom/NamedNodeMap.h:
1634
1635 2016-08-03  Chris Dumez  <cdumez@apple.com>
1636
1637         Drop DocumentType.internalSubset attribute
1638         https://bugs.webkit.org/show_bug.cgi?id=160530
1639
1640         Reviewed by Alex Christensen.
1641
1642         Drop DocumentType.internalSubset attribute.
1643
1644         It is no longer in the DOM specification:
1645         - https://dom.spec.whatwg.org/#documenttype
1646         - https://w3c.github.io/DOM-Parsing/#xml-serializing-a-documenttype-node
1647
1648         Other browsers have already dropped it. In WebKit, it was always null
1649         anyway.
1650
1651         No new tests, rebaselined existing test.
1652
1653         * bindings/objc/DOMDocumentType.mm:
1654         (-[DOMDocumentType internalSubset]):
1655         * dom/DocumentType.h:
1656         * dom/DocumentType.idl:
1657         * dom/Node.cpp:
1658         (WebCore::Node::isEqualNode): Deleted.
1659         * editing/MarkupAccumulator.cpp:
1660         (WebCore::MarkupAccumulator::appendDocumentType): Deleted.
1661         * inspector/InspectorDOMAgent.cpp:
1662         (WebCore::InspectorDOMAgent::buildObjectForNode): Deleted.
1663
1664 2016-08-03  Chris Dumez  <cdumez@apple.com>
1665
1666         Drop legacy Document.defaultCharset attribute
1667         https://bugs.webkit.org/show_bug.cgi?id=160536
1668
1669         Reviewed by Alex Christensen.
1670
1671         Drop legacy Document.defaultCharset attribute.
1672
1673         It is no longer in the specification:
1674         - https://dom.spec.whatwg.org/#interface-document
1675
1676         Firefox and Chrome have already dropped it.
1677
1678         No new tests, rebaselined existing test.
1679
1680         * bindings/objc/DOMDocument.mm:
1681         (-[DOMDocument defaultCharset]):
1682         * dom/Document.cpp:
1683         (WebCore::Document::defaultCharsetForBindings):
1684         * dom/Document.h:
1685         * dom/Document.idl:
1686
1687 2016-08-03  Anders Carlsson  <andersca@apple.com>
1688
1689         Remove some unneeded #ifs now that the Objective-C bindings are frozen
1690         https://bugs.webkit.org/show_bug.cgi?id=160532
1691
1692         Reviewed by Tim Horton.
1693
1694         * DerivedSources.make:
1695         * Modules/mediasession/HTMLMediaElementMediaSession.idl:
1696         * Modules/mediastream/HTMLMediaElementMediaStream.idl:
1697         * WebCore.xcodeproj/project.pbxproj:
1698         * animation/DocumentAnimation.idl:
1699         * dom/ChildNode.idl:
1700         * dom/Document.idl:
1701         * dom/Element.idl:
1702         * dom/Event.idl:
1703         * dom/ParentNode.idl:
1704         * fileapi/Blob.idl:
1705         * fileapi/FileError.idl:
1706         * html/DOMSettableTokenList.h: Removed.
1707         * html/DOMSettableTokenList.idl: Removed.
1708         * html/HTMLCanvasElement.idl:
1709         * html/HTMLEmbedElement.idl:
1710         * html/HTMLFrameElement.idl:
1711         * html/HTMLIFrameElement.idl:
1712         * html/HTMLMediaElement.idl:
1713         * html/HTMLObjectElement.idl:
1714         * html/HTMLOptionsCollection.idl:
1715         * html/HTMLVideoElement.idl:
1716
1717 2016-08-03  Myles C. Maxfield  <mmaxfield@apple.com>
1718
1719         [iOS] SF-Heavy is not accessible from web content
1720         https://bugs.webkit.org/show_bug.cgi?id=160522
1721         <rdar://problem/27685273>
1722
1723         Reviewed by Simon Fraser.
1724
1725         The mappings we were using from CSS font-weight to CoreText font weight were inaccurate.
1726         Instead, these new mappings should be used.
1727
1728         Test: fast/text/system-font-weight.html
1729
1730         * platform/graphics/ios/FontCacheIOS.mm:
1731         (WebCore::systemFontModificationAttributes):
1732
1733 2016-08-03  Anders Carlsson  <andersca@apple.com>
1734
1735         Remove the Objective-C bindings generator
1736         https://bugs.webkit.org/show_bug.cgi?id=160526
1737
1738         Reviewed by Sam Weinig.
1739
1740         * DerivedSources.make:
1741         * WebCore.xcodeproj/project.pbxproj:
1742         * bindings/objc/PublicDOMInterfaces.h: Removed.
1743         * bindings/scripts/CodeGeneratorObjC.pm: Removed.
1744         * bindings/scripts/test/ObjC/DOMFloat64Array.h: Removed.
1745         * bindings/scripts/test/ObjC/DOMFloat64Array.mm: Removed.
1746         * bindings/scripts/test/ObjC/DOMFloat64ArrayInternal.h: Removed.
1747         * bindings/scripts/test/ObjC/DOMInterfaceName.h: Removed.
1748         * bindings/scripts/test/ObjC/DOMInterfaceName.mm: Removed.
1749         * bindings/scripts/test/ObjC/DOMInterfaceNameInternal.h: Removed.
1750         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.h: Removed.
1751         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm: Removed.
1752         * bindings/scripts/test/ObjC/DOMTestActiveDOMObjectInternal.h: Removed.
1753         * bindings/scripts/test/ObjC/DOMTestCallback.h: Removed.
1754         * bindings/scripts/test/ObjC/DOMTestCallback.mm: Removed.
1755         * bindings/scripts/test/ObjC/DOMTestCallbackFunction.h: Removed.
1756         * bindings/scripts/test/ObjC/DOMTestCallbackFunction.mm: Removed.
1757         * bindings/scripts/test/ObjC/DOMTestCallbackFunctionInternal.h: Removed.
1758         * bindings/scripts/test/ObjC/DOMTestCallbackInternal.h: Removed.
1759         * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructor.h: Removed.
1760         * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructor.mm: Removed.
1761         * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorInternal.h: Removed.
1762         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.h: Removed.
1763         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm: Removed.
1764         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObjectInternal.h: Removed.
1765         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.h: Removed.
1766         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.mm: Removed.
1767         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetterInternal.h: Removed.
1768         * bindings/scripts/test/ObjC/DOMTestEventConstructor.h: Removed.
1769         * bindings/scripts/test/ObjC/DOMTestEventConstructor.mm: Removed.
1770         * bindings/scripts/test/ObjC/DOMTestEventConstructorInternal.h: Removed.
1771         * bindings/scripts/test/ObjC/DOMTestEventTarget.h: Removed.
1772         * bindings/scripts/test/ObjC/DOMTestEventTarget.mm: Removed.
1773         * bindings/scripts/test/ObjC/DOMTestEventTargetInternal.h: Removed.
1774         * bindings/scripts/test/ObjC/DOMTestException.h: Removed.
1775         * bindings/scripts/test/ObjC/DOMTestException.mm: Removed.
1776         * bindings/scripts/test/ObjC/DOMTestExceptionInternal.h: Removed.
1777         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.h: Removed.
1778         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.mm: Removed.
1779         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachableInternal.h: Removed.
1780         * bindings/scripts/test/ObjC/DOMTestGlobalObject.h: Removed.
1781         * bindings/scripts/test/ObjC/DOMTestGlobalObject.mm: Removed.
1782         * bindings/scripts/test/ObjC/DOMTestGlobalObjectInternal.h: Removed.
1783         * bindings/scripts/test/ObjC/DOMTestImplements.cpp: Removed.
1784         * bindings/scripts/test/ObjC/DOMTestImplements.h: Removed.
1785         * bindings/scripts/test/ObjC/DOMTestInterface.h: Removed.
1786         * bindings/scripts/test/ObjC/DOMTestInterface.mm: Removed.
1787         * bindings/scripts/test/ObjC/DOMTestInterfaceInternal.h: Removed.
1788         * bindings/scripts/test/ObjC/DOMTestIterable.h: Removed.
1789         * bindings/scripts/test/ObjC/DOMTestIterable.mm: Removed.
1790         * bindings/scripts/test/ObjC/DOMTestIterableInternal.h: Removed.
1791         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.h: Removed.
1792         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.mm: Removed.
1793         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructorInternal.h: Removed.
1794         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h: Removed.
1795         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm: Removed.
1796         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h: Removed.
1797         * bindings/scripts/test/ObjC/DOMTestNamedConstructor.h: Removed.
1798         * bindings/scripts/test/ObjC/DOMTestNamedConstructor.mm: Removed.
1799         * bindings/scripts/test/ObjC/DOMTestNamedConstructorInternal.h: Removed.
1800         * bindings/scripts/test/ObjC/DOMTestNode.h: Removed.
1801         * bindings/scripts/test/ObjC/DOMTestNode.mm: Removed.
1802         * bindings/scripts/test/ObjC/DOMTestNodeInternal.h: Removed.
1803         * bindings/scripts/test/ObjC/DOMTestNondeterministic.h: Removed.
1804         * bindings/scripts/test/ObjC/DOMTestNondeterministic.mm: Removed.
1805         * bindings/scripts/test/ObjC/DOMTestNondeterministicInternal.h: Removed.
1806         * bindings/scripts/test/ObjC/DOMTestObj.h: Removed.
1807         * bindings/scripts/test/ObjC/DOMTestObj.mm: Removed.
1808         * bindings/scripts/test/ObjC/DOMTestObjInternal.h: Removed.
1809         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.h: Removed.
1810         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.mm: Removed.
1811         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructorsInternal.h: Removed.
1812         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltins.h: Removed.
1813         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltins.mm: Removed.
1814         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltinsInternal.h: Removed.
1815         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h: Removed.
1816         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm: Removed.
1817         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterfaceInternal.h: Removed.
1818         * bindings/scripts/test/ObjC/DOMTestSupplemental.cpp: Removed.
1819         * bindings/scripts/test/ObjC/DOMTestSupplemental.h: Removed.
1820         * bindings/scripts/test/ObjC/DOMTestTypedefs.h: Removed.
1821         * bindings/scripts/test/ObjC/DOMTestTypedefs.mm: Removed.
1822         * bindings/scripts/test/ObjC/DOMTestTypedefsInternal.h: Removed.
1823         * bindings/scripts/test/ObjC/DOMattribute.h: Removed.
1824         * bindings/scripts/test/ObjC/DOMattribute.mm: Removed.
1825         * bindings/scripts/test/ObjC/DOMattributeInternal.h: Removed.
1826         * bindings/scripts/test/ObjC/DOMreadonly.h: Removed.
1827         * bindings/scripts/test/ObjC/DOMreadonly.mm: Removed.
1828         * bindings/scripts/test/ObjC/DOMreadonlyInternal.h: Removed.
1829         * bindings/scripts/test/ObjC/ObjCTestSupplemental.cpp: Removed.
1830         * bindings/scripts/test/ObjC/ObjCTestSupplemental.h: Removed.
1831
1832 2016-08-03  Anders Carlsson  <andersca@apple.com>
1833
1834         Remove dead bindings code
1835         https://bugs.webkit.org/show_bug.cgi?id=160521
1836
1837         Reviewed by Tim Horton.
1838
1839         * WebCore.xcodeproj/project.pbxproj:
1840         * bindings/objc/DOMBlob.mm:
1841         (core): Deleted.
1842         * bindings/objc/DOMBlobInternal.h:
1843         * bindings/objc/DOMCDATASection.mm:
1844         (core): Deleted.
1845         * bindings/objc/DOMCDATASectionInternal.h:
1846         * bindings/objc/DOMCSSCharsetRule.mm:
1847         (core): Deleted.
1848         (kit): Deleted.
1849         * bindings/objc/DOMCSSCharsetRuleInternal.h: Removed.
1850         * bindings/objc/DOMCSSFontFaceRule.mm:
1851         (core): Deleted.
1852         (kit): Deleted.
1853         * bindings/objc/DOMCSSFontFaceRuleInternal.h: Removed.
1854         * bindings/objc/DOMCSSImportRule.mm:
1855         (core): Deleted.
1856         (kit): Deleted.
1857         * bindings/objc/DOMCSSImportRuleInternal.h: Removed.
1858         * bindings/objc/DOMCSSMediaRule.mm:
1859         (core): Deleted.
1860         (kit): Deleted.
1861         * bindings/objc/DOMCSSMediaRuleInternal.h: Removed.
1862         * bindings/objc/DOMCSSPageRule.mm:
1863         (core): Deleted.
1864         (kit): Deleted.
1865         * bindings/objc/DOMCSSPageRuleInternal.h: Removed.
1866         * bindings/objc/DOMCSSPrimitiveValue.mm:
1867         (core): Deleted.
1868         * bindings/objc/DOMCSSPrimitiveValueInternal.h:
1869         * bindings/objc/DOMCSSRule.mm:
1870         (core): Deleted.
1871         * bindings/objc/DOMCSSRuleInternal.h:
1872         * bindings/objc/DOMCSSRuleList.mm:
1873         (core): Deleted.
1874         * bindings/objc/DOMCSSRuleListInternal.h:
1875         * bindings/objc/DOMCSSStyleRule.mm:
1876         (core): Deleted.
1877         (kit): Deleted.
1878         * bindings/objc/DOMCSSStyleRuleInternal.h: Removed.
1879         * bindings/objc/DOMCSSStyleSheet.mm:
1880         (core): Deleted.
1881         * bindings/objc/DOMCSSStyleSheetInternal.h:
1882         * bindings/objc/DOMCSSUnknownRule.mm:
1883         (core): Deleted.
1884         (kit): Deleted.
1885         * bindings/objc/DOMCSSUnknownRuleInternal.h: Removed.
1886         * bindings/objc/DOMCSSValue.mm:
1887         (core): Deleted.
1888         * bindings/objc/DOMCSSValueInternal.h:
1889         * bindings/objc/DOMCSSValueList.mm:
1890         (core): Deleted.
1891         (kit): Deleted.
1892         * bindings/objc/DOMCSSValueListInternal.h: Removed.
1893         * bindings/objc/DOMCharacterData.mm:
1894         (core): Deleted.
1895         (kit): Deleted.
1896         * bindings/objc/DOMCharacterDataInternal.h: Removed.
1897         * bindings/objc/DOMComment.mm:
1898         (core): Deleted.
1899         * bindings/objc/DOMCommentInternal.h:
1900         * bindings/objc/DOMCounter.mm:
1901         (core): Deleted.
1902         * bindings/objc/DOMCounterInternal.h:
1903         * bindings/objc/DOMDOMImplementation.mm:
1904         (core): Deleted.
1905         * bindings/objc/DOMDOMImplementationInternal.h:
1906         * bindings/objc/DOMDOMTokenList.mm:
1907         (core): Deleted.
1908         * bindings/objc/DOMDOMTokenListInternal.h:
1909         * bindings/objc/DOMEntity.mm:
1910         (core): Deleted.
1911         (kit): Deleted.
1912         * bindings/objc/DOMEntityInternal.h: Removed.
1913         * bindings/objc/DOMEntityReference.mm:
1914         (core): Deleted.
1915         * bindings/objc/DOMEntityReferenceInternal.h:
1916         * bindings/objc/DOMFile.mm:
1917         (core): Deleted.
1918         * bindings/objc/DOMFileInternal.h:
1919         * bindings/objc/DOMHTMLAnchorElement.mm:
1920         (core): Deleted.
1921         (kit): Deleted.
1922         * bindings/objc/DOMHTMLAnchorElementInternal.h: Removed.
1923         * bindings/objc/DOMHTMLAppletElement.mm:
1924         (core): Deleted.
1925         (kit): Deleted.
1926         * bindings/objc/DOMHTMLAppletElementInternal.h: Removed.
1927         * bindings/objc/DOMHTMLAreaElement.mm:
1928         (kit): Deleted.
1929         * bindings/objc/DOMHTMLAreaElementInternal.h:
1930         * bindings/objc/DOMHTMLBRElement.mm:
1931         (core): Deleted.
1932         (kit): Deleted.
1933         * bindings/objc/DOMHTMLBRElementInternal.h: Removed.
1934         * bindings/objc/DOMHTMLBaseElement.mm:
1935         (core): Deleted.
1936         (kit): Deleted.
1937         * bindings/objc/DOMHTMLBaseElementInternal.h: Removed.
1938         * bindings/objc/DOMHTMLBaseFontElement.mm:
1939         (core): Deleted.
1940         (kit): Deleted.
1941         * bindings/objc/DOMHTMLBaseFontElementInternal.h: Removed.
1942         * bindings/objc/DOMHTMLBodyElement.mm:
1943         (core): Deleted.
1944         (kit): Deleted.
1945         * bindings/objc/DOMHTMLBodyElementInternal.h: Removed.
1946         * bindings/objc/DOMHTMLButtonElement.mm:
1947         (core): Deleted.
1948         (kit): Deleted.
1949         * bindings/objc/DOMHTMLButtonElementInternal.h: Removed.
1950         * bindings/objc/DOMHTMLCanvasElement.mm:
1951         (core): Deleted.
1952         (kit): Deleted.
1953         * bindings/objc/DOMHTMLCanvasElementInternal.h: Removed.
1954         * bindings/objc/DOMHTMLCollection.mm:
1955         (core): Deleted.
1956         * bindings/objc/DOMHTMLCollectionInternal.h:
1957         * bindings/objc/DOMHTMLDListElement.mm:
1958         (core): Deleted.
1959         (kit): Deleted.
1960         * bindings/objc/DOMHTMLDListElementInternal.h: Removed.
1961         * bindings/objc/DOMHTMLDirectoryElement.mm:
1962         (core): Deleted.
1963         (kit): Deleted.
1964         * bindings/objc/DOMHTMLDirectoryElementInternal.h: Removed.
1965         * bindings/objc/DOMHTMLDivElement.mm:
1966         (core): Deleted.
1967         (kit): Deleted.
1968         * bindings/objc/DOMHTMLDivElementInternal.h: Removed.
1969         * bindings/objc/DOMHTMLEmbedElement.mm:
1970         (core): Deleted.
1971         (kit): Deleted.
1972         * bindings/objc/DOMHTMLEmbedElementInternal.h: Removed.
1973         * bindings/objc/DOMHTMLFieldSetElement.mm:
1974         (core): Deleted.
1975         (kit): Deleted.
1976         * bindings/objc/DOMHTMLFieldSetElementInternal.h: Removed.
1977         * bindings/objc/DOMHTMLFontElement.mm:
1978         (core): Deleted.
1979         (kit): Deleted.
1980         * bindings/objc/DOMHTMLFontElementInternal.h: Removed.
1981         * bindings/objc/DOMHTMLFormElement.mm:
1982         (core): Deleted.
1983         * bindings/objc/DOMHTMLFormElementInternal.h:
1984         * bindings/objc/DOMHTMLFrameElement.mm:
1985         (core): Deleted.
1986         (kit): Deleted.
1987         * bindings/objc/DOMHTMLFrameElementInternal.h: Removed.
1988         * bindings/objc/DOMHTMLFrameSetElement.mm:
1989         (core): Deleted.
1990         (kit): Deleted.
1991         * bindings/objc/DOMHTMLFrameSetElementInternal.h: Removed.
1992         * bindings/objc/DOMHTMLHRElement.mm:
1993         (core): Deleted.
1994         (kit): Deleted.
1995         * bindings/objc/DOMHTMLHRElementInternal.h: Removed.
1996         * bindings/objc/DOMHTMLHeadElement.mm:
1997         (core): Deleted.
1998         * bindings/objc/DOMHTMLHeadElementInternal.h:
1999         * bindings/objc/DOMHTMLHeadingElement.mm:
2000         (core): Deleted.
2001         (kit): Deleted.
2002         * bindings/objc/DOMHTMLHeadingElementInternal.h: Removed.
2003         * bindings/objc/DOMHTMLHtmlElement.mm:
2004         (core): Deleted.
2005         (kit): Deleted.
2006         * bindings/objc/DOMHTMLHtmlElementInternal.h: Removed.
2007         * bindings/objc/DOMHTMLIFrameElement.mm:
2008         (core): Deleted.
2009         (kit): Deleted.
2010         * bindings/objc/DOMHTMLIFrameElementInternal.h: Removed.
2011         * bindings/objc/DOMHTMLImageElement.mm:
2012         (kit): Deleted.
2013         * bindings/objc/DOMHTMLImageElementInternal.h:
2014         * bindings/objc/DOMHTMLLIElement.mm:
2015         (core): Deleted.
2016         (kit): Deleted.
2017         * bindings/objc/DOMHTMLLIElementInternal.h: Removed.
2018         * bindings/objc/DOMHTMLLabelElement.mm:
2019         (core): Deleted.
2020         (kit): Deleted.
2021         * bindings/objc/DOMHTMLLabelElementInternal.h: Removed.
2022         * bindings/objc/DOMHTMLLegendElement.mm:
2023         (core): Deleted.
2024         (kit): Deleted.
2025         * bindings/objc/DOMHTMLLegendElementInternal.h: Removed.
2026         * bindings/objc/DOMHTMLLinkElement.mm:
2027         (kit): Deleted.
2028         * bindings/objc/DOMHTMLLinkElementInternal.h:
2029         * bindings/objc/DOMHTMLMapElement.mm:
2030         (core): Deleted.
2031         (kit): Deleted.
2032         * bindings/objc/DOMHTMLMapElementInternal.h: Removed.
2033         * bindings/objc/DOMHTMLMarqueeElement.mm:
2034         (core): Deleted.
2035         (kit): Deleted.
2036         * bindings/objc/DOMHTMLMarqueeElementInternal.h: Removed.
2037         * bindings/objc/DOMHTMLMediaElement.mm:
2038         (core): Deleted.
2039         (kit): Deleted.
2040         * bindings/objc/DOMHTMLMediaElementInternal.h: Removed.
2041         * bindings/objc/DOMHTMLMenuElement.mm:
2042         (core): Deleted.
2043         (kit): Deleted.
2044         * bindings/objc/DOMHTMLMenuElementInternal.h: Removed.
2045         * bindings/objc/DOMHTMLMetaElement.mm:
2046         (core): Deleted.
2047         (kit): Deleted.
2048         * bindings/objc/DOMHTMLMetaElementInternal.h: Removed.
2049         * bindings/objc/DOMHTMLModElement.mm:
2050         (core): Deleted.
2051         (kit): Deleted.
2052         * bindings/objc/DOMHTMLModElementInternal.h: Removed.
2053         * bindings/objc/DOMHTMLOListElement.mm:
2054         (core): Deleted.
2055         (kit): Deleted.
2056         * bindings/objc/DOMHTMLOListElementInternal.h: Removed.
2057         * bindings/objc/DOMHTMLObjectElement.mm:
2058         (core): Deleted.
2059         (kit): Deleted.
2060         * bindings/objc/DOMHTMLObjectElementInternal.h: Removed.
2061         * bindings/objc/DOMHTMLOptGroupElement.mm:
2062         (core): Deleted.
2063         (kit): Deleted.
2064         * bindings/objc/DOMHTMLOptGroupElementInternal.h: Removed.
2065         * bindings/objc/DOMHTMLOptionsCollection.mm:
2066         (core): Deleted.
2067         * bindings/objc/DOMHTMLOptionsCollectionInternal.h:
2068         * bindings/objc/DOMHTMLParagraphElement.mm:
2069         (core): Deleted.
2070         (kit): Deleted.
2071         * bindings/objc/DOMHTMLParagraphElementInternal.h: Removed.
2072         * bindings/objc/DOMHTMLParamElement.mm:
2073         (core): Deleted.
2074         (kit): Deleted.
2075         * bindings/objc/DOMHTMLParamElementInternal.h: Removed.
2076         * bindings/objc/DOMHTMLPreElement.mm:
2077         (core): Deleted.
2078         (kit): Deleted.
2079         * bindings/objc/DOMHTMLPreElementInternal.h: Removed.
2080         * bindings/objc/DOMHTMLQuoteElement.mm:
2081         (core): Deleted.
2082         (kit): Deleted.
2083         * bindings/objc/DOMHTMLQuoteElementInternal.h: Removed.
2084         * bindings/objc/DOMHTMLScriptElement.mm:
2085         (core): Deleted.
2086         * bindings/objc/DOMHTMLScriptElementInternal.h:
2087         * bindings/objc/DOMHTMLSelectElement.mm:
2088         (kit): Deleted.
2089         * bindings/objc/DOMHTMLSelectElementInternal.h:
2090         * bindings/objc/DOMHTMLStyleElement.mm:
2091         (kit): Deleted.
2092         * bindings/objc/DOMHTMLStyleElementInternal.h:
2093         * bindings/objc/DOMHTMLTableColElement.mm:
2094         (kit): Deleted.
2095         * bindings/objc/DOMHTMLTableColElementInternal.h:
2096         * bindings/objc/DOMHTMLTableElement.mm:
2097         (core): Deleted.
2098         (kit): Deleted.
2099         * bindings/objc/DOMHTMLTableElementInternal.h: Removed.
2100         * bindings/objc/DOMHTMLTableRowElement.mm:
2101         (core): Deleted.
2102         (kit): Deleted.
2103         * bindings/objc/DOMHTMLTableRowElementInternal.h: Removed.
2104         * bindings/objc/DOMHTMLTitleElement.mm:
2105         (core): Deleted.
2106         (kit): Deleted.
2107         * bindings/objc/DOMHTMLTitleElementInternal.h: Removed.
2108         * bindings/objc/DOMHTMLUListElement.mm:
2109         (core): Deleted.
2110         (kit): Deleted.
2111         * bindings/objc/DOMHTMLUListElementInternal.h: Removed.
2112         * bindings/objc/DOMHTMLVideoElement.mm:
2113         (core): Deleted.
2114         (kit): Deleted.
2115         * bindings/objc/DOMHTMLVideoElementInternal.h: Removed.
2116         * bindings/objc/DOMKeyboardEvent.mm:
2117         (core): Deleted.
2118         (kit): Deleted.
2119         * bindings/objc/DOMKeyboardEventInternal.h: Removed.
2120         * bindings/objc/DOMMediaError.mm:
2121         (core): Deleted.
2122         * bindings/objc/DOMMediaErrorInternal.h:
2123         * bindings/objc/DOMMediaList.mm:
2124         (core): Deleted.
2125         * bindings/objc/DOMMediaListInternal.h:
2126         * bindings/objc/DOMMouseEvent.mm:
2127         (core): Deleted.
2128         (kit): Deleted.
2129         * bindings/objc/DOMMouseEventInternal.h: Removed.
2130         * bindings/objc/DOMMutationEvent.mm:
2131         (core): Deleted.
2132         (kit): Deleted.
2133         * bindings/objc/DOMMutationEventInternal.h: Removed.
2134         * bindings/objc/DOMNamedNodeMap.mm:
2135         (core): Deleted.
2136         * bindings/objc/DOMNamedNodeMapInternal.h:
2137         * bindings/objc/DOMNodeIterator.mm:
2138         (core): Deleted.
2139         * bindings/objc/DOMNodeIteratorInternal.h:
2140         * bindings/objc/DOMNodeList.mm:
2141         (core): Deleted.
2142         * bindings/objc/DOMNodeListInternal.h:
2143         * bindings/objc/DOMOverflowEvent.mm:
2144         (core): Deleted.
2145         (kit): Deleted.
2146         * bindings/objc/DOMOverflowEventInternal.h: Removed.
2147         * bindings/objc/DOMProgressEvent.mm:
2148         (core): Deleted.
2149         (kit): Deleted.
2150         * bindings/objc/DOMProgressEventInternal.h: Removed.
2151         * bindings/objc/DOMRGBColor.mm:
2152         (core): Deleted.
2153         * bindings/objc/DOMRGBColorInternal.h:
2154         * bindings/objc/DOMRect.mm:
2155         (core): Deleted.
2156         * bindings/objc/DOMRectInternal.h:
2157         * bindings/objc/DOMStyleSheet.mm:
2158         (core): Deleted.
2159         * bindings/objc/DOMStyleSheetInternal.h:
2160         * bindings/objc/DOMStyleSheetList.mm:
2161         (core): Deleted.
2162         * bindings/objc/DOMStyleSheetListInternal.h:
2163         * bindings/objc/DOMText.mm:
2164         (core): Deleted.
2165         * bindings/objc/DOMTextEvent.mm:
2166         (core): Deleted.
2167         (kit): Deleted.
2168         * bindings/objc/DOMTextEventInternal.h: Removed.
2169         * bindings/objc/DOMTextInternal.h:
2170         * bindings/objc/DOMTimeRanges.mm:
2171         (core): Deleted.
2172         * bindings/objc/DOMTimeRangesInternal.h:
2173         * bindings/objc/DOMTreeWalker.mm:
2174         (core): Deleted.
2175         * bindings/objc/DOMTreeWalkerInternal.h:
2176         * bindings/objc/DOMUIEvent.mm:
2177         (core): Deleted.
2178         (kit): Deleted.
2179         * bindings/objc/DOMUIEventInternal.h: Removed.
2180         * bindings/objc/DOMWheelEvent.mm:
2181         (kit): Deleted.
2182         * bindings/objc/DOMWheelEventInternal.h:
2183         * bindings/objc/DOMXPathExpression.mm:
2184         (core): Deleted.
2185         * bindings/objc/DOMXPathExpressionInternal.h:
2186
2187 2016-08-03  Eric Carlson  <eric.carlson@apple.com>
2188
2189         [Mac] Work around AVPlayer setMuted bug
2190         https://bugs.webkit.org/show_bug.cgi?id=160519
2191         <rdar://problem/27310475>
2192
2193         Reviewed by Dean Jackson.
2194
2195         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: Only override
2196         supportsMuting on iOS.
2197
2198 2016-08-03  Eric Carlson  <eric.carlson@apple.com>
2199
2200         Cleanup HTMLMediaElement track lists.
2201         https://bugs.webkit.org/show_bug.cgi?id=160470
2202
2203         Reviewed by Brent Fulgham.
2204
2205         * html/track/AudioTrack.cpp:
2206         (WebCore::AudioTrack::willRemove): Remove unnecessary ASSERT and NULL check.
2207
2208         * html/track/TextTrackList.cpp:
2209         (TextTrackList::~TextTrackList): Call clearElement so media element and client pointers are
2210         cleared.
2211
2212 2016-08-02  Ada Chan  <adachan@apple.com>
2213
2214         [Mac] media/pip-video-going-into-fullscreen.html is a flaky failure
2215         https://bugs.webkit.org/show_bug.cgi?id=160469
2216
2217         Reviewed by Eric Carlson.
2218
2219         When going from picture-in-picture directly to fullscreen, fix the issue where the
2220         presentation mode unexpectedly changes back to inline after changing to fullscreen.
2221
2222         On Mac, standard fullscreen is not handled by WebVideoFullscreenManager.
2223         When going from picture-in-picture directly to fullscreen, we call
2224         WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode().
2225         We should update m_mode to VideoFullscreenModeStandard there to keep it in sync
2226         with the fullscreen mode in HTMLMediaElement. Otherwise, we'll inadvertently
2227         update the mode to inline when we clear the VideoFullscreenModePictureInPicture mode
2228         in -[WebVideoFullscreenInterfaceMacObjC pipDidClose:].
2229
2230         Since standard fullscreen on Mac doesn't make use of the video fullscreen layer,
2231         we need to make sure we return the video layer back to inline when the presentation
2232         mode changes to "fullscreen". We only do this on Mac because iOS does use
2233         the video fullscreen layer for standard fullscreen.
2234
2235         * Modules/mediacontrols/MediaControlsHost.cpp:
2236         (WebCore::MediaControlsHost::setPreparedToReturnVideoLayerToInline):
2237         Renamed from MediaControlsHost::setPreparedForInline to make it clear this is about
2238         whether the video layer should be inline.
2239         (WebCore::MediaControlsHost::setPreparedForInline): Deleted.
2240         * Modules/mediacontrols/MediaControlsHost.h:
2241         * Modules/mediacontrols/MediaControlsHost.idl:
2242
2243         * Modules/mediacontrols/mediaControlsApple.js:
2244         (Controller.prototype.shouldReturnVideoLayerToInline):
2245         On Mac, the video layer is inline when the presentation mode is "inline" or "fullscreen".
2246         (Controller.prototype.handlePresentationModeChange):
2247         Call shouldReturnVideoLayerToInline() to determine whether the video layer should be inline.
2248
2249         * Modules/mediacontrols/mediaControlsiOS.js:
2250         (ControllerIOS.prototype.shouldReturnVideoLayerToInline):
2251         Override this method since on iOS, the video layer is only inline when the presentation
2252         mode is "inline".
2253
2254         * html/HTMLMediaElement.cpp:
2255         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
2256         (WebCore::HTMLMediaElement::setPreparedToReturnVideoLayerToInline):
2257         (WebCore::HTMLMediaElement::setPreparedForInline): Deleted.
2258         * html/HTMLMediaElement.h:
2259
2260         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2261         (WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen):
2262         Remove the assertion that the mode must be "picture-in-picture". I've run into this
2263         assertion in layout tests. Since the EnterFullscreen message is sent in a dispatch_async
2264         block in WebVideoFullscreenManager::didSetupFullscreen(), there's a chance that the
2265         fullscreen mode tracked in WebVideoFullscreenInterfaceMac has already changed to
2266         something else when WebVideoFullscreenInterfaceMac::enterFullscreen() is called.
2267         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode):
2268         If exiting to standard fullscreen, update m_mode to VideoFullscreenModeStandard.
2269
2270 2016-08-03  Youenn Fablet  <youenn@apple.com>
2271
2272         http/tests/fetch/fetch-in-worker-crash.html is sometimes crashing
2273         https://bugs.webkit.org/show_bug.cgi?id=160498
2274
2275         Reviewed by Chris Dumez.
2276
2277         Covered by http/tests/fetch/fetch-in-worker-crash.html.
2278
2279         * loader/WorkerThreadableLoader.cpp:
2280         (WebCore::WorkerThreadableLoader::MainThreadBridge::cancel): Taking a reference of the client wrapper to ensure it can be cleaned-up successfully.
2281
2282 2016-08-02  Anders Carlsson  <andersca@apple.com>
2283
2284         Freeze the last of the Objective-C bindings
2285         https://bugs.webkit.org/show_bug.cgi?id=160482
2286
2287         Reviewed by Darin Adler.
2288
2289         * WebCore.xcodeproj/project.pbxproj:
2290         * bindings/objc/DOMAttr.h: Added.
2291         * bindings/objc/DOMAttr.mm: Added.
2292         * bindings/objc/DOMAttrInternal.h: Added.
2293         * bindings/objc/DOMCDATASection.h: Added.
2294         * bindings/objc/DOMCDATASection.mm: Added.
2295         * bindings/objc/DOMCDATASectionInternal.h: Added.
2296         * bindings/objc/DOMCharacterData.h
2297         * bindings/objc/DOMCharacterData.mm: Added.
2298         * bindings/objc/DOMCharacterDataInternal.h: Added.
2299         * bindings/objc/DOMComment.h: Added.
2300         * bindings/objc/DOMComment.mm: Added.
2301         * bindings/objc/DOMCommentInternal.h: Added.
2302         * bindings/objc/DOMDOMImplementation.h: Added.
2303         * bindings/objc/DOMDOMImplementation.mm: Added.
2304         * bindings/objc/DOMDOMImplementationInternal.h: Added.
2305         * bindings/objc/DOMDocument.h: Added.
2306         * bindings/objc/DOMDocument.mm: Added.
2307         * bindings/objc/DOMDocumentFragment.h: Added.
2308         * bindings/objc/DOMDocumentFragment.mm: Added.
2309         * bindings/objc/DOMDocumentFragmentInternal.h: Added.
2310         * bindings/objc/DOMDocumentFragmentPrivate.h: Added.
2311         * bindings/objc/DOMDocumentInternal.h: Added.
2312         * bindings/objc/DOMDocumentPrivate.h: Added.
2313         * bindings/objc/DOMDocumentType.h: Added.
2314         * bindings/objc/DOMDocumentType.mm: Added.
2315         * bindings/objc/DOMDocumentTypeInternal.h: Added.
2316         * bindings/objc/DOMElement.h: Added.
2317         * bindings/objc/DOMElement.mm: Added.
2318         * bindings/objc/DOMElementInternal.h: Added.
2319         * bindings/objc/DOMEntity.h: Added.
2320         * bindings/objc/DOMEntity.mm: Added.
2321         * bindings/objc/DOMEntityInternal.h: Added.
2322         * bindings/objc/DOMEntityReference.h: Added.
2323         * bindings/objc/DOMEntityReference.mm: Added.
2324         * bindings/objc/DOMEntityReferenceInternal.h: Added.
2325         * bindings/objc/DOMNamedNodeMap.h: Added.
2326         * bindings/objc/DOMNamedNodeMap.mm: Added.
2327         * bindings/objc/DOMNamedNodeMapInternal.h: Added.
2328         * bindings/objc/DOMNode.h: Added.
2329         * bindings/objc/DOMNode.mm: Added.
2330         * bindings/objc/DOMNodeInternal.h: Added.
2331         * bindings/objc/DOMNodeList.h: Added.
2332         * bindings/objc/DOMNodeList.mm: Added.
2333         * bindings/objc/DOMNodeListInternal.h: Added.
2334         * bindings/objc/DOMNodePrivate.h: Added.
2335         * bindings/objc/DOMProcessingInstruction.h: Added.
2336         * bindings/objc/DOMProcessingInstruction.mm: Added.
2337         * bindings/objc/DOMProcessingInstructionInternal.h: Added.
2338         * bindings/objc/DOMText.h: Added.
2339         * bindings/objc/DOMText.mm: Added.
2340         * bindings/objc/DOMTextEvent.mm:
2341         * bindings/objc/DOMTextEventInternal.h:
2342         * bindings/objc/DOMTextInternal.h: Added.
2343
2344 2016-08-03  Eric Carlson  <eric.carlson@apple.com>
2345
2346         [Mac][iOS] Adopt MediaRemote "seek to playback position"
2347         https://bugs.webkit.org/show_bug.cgi?id=160405
2348         <rdar://problem/27547583>
2349
2350         Reviewed by Dean Jackson.
2351
2352         * platform/ios/RemoteCommandListenerIOS.mm:
2353         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS): Fix a typo.
2354
2355 2016-08-02  Frederic Wang  <fwang@igalia.com>
2356
2357         Move determination of operator direction into DOM class and reduce relayout
2358         https://bugs.webkit.org/show_bug.cgi?id=160339
2359
2360         Reviewed by Darin Adler.
2361
2362         We move the determination of operator direction into MathMLOperatorElement. We also simplify
2363         a bit RenderMathMLFencedOperator so that the update of operator properties are done
2364         immediately in updateOperatorContent and the resolution of to LayoutUnit is implemented
2365         in leadingSpace, trailingSpace, minSize and maxSize. After that, setOperatorProperties is no
2366         longer necessary and we can remove many calls that used to update operator properties and
2367         force relayout.
2368
2369         No new tests, already covered by existing tests.
2370
2371         * mathml/MathMLInlineContainerElement.cpp:
2372         (WebCore::MathMLInlineContainerElement::childrenChanged): No need to call updateOperatorProperties.
2373         * mathml/MathMLOperatorElement.cpp: Change names from "text" to "char".
2374         (WebCore::MathMLOperatorElement::parseOperatorChar): Parse character and isVertical in this function.
2375         (WebCore::MathMLOperatorElement::operatorChar):
2376         (WebCore::MathMLOperatorElement::childrenChanged):
2377         (WebCore::MathMLOperatorElement::computeDictionaryProperty): Call operatorChar().character.
2378         (WebCore::MathMLOperatorElement::parseOperatorText): Deleted.
2379         (WebCore::MathMLOperatorElement::operatorText): Deleted.
2380         * mathml/MathMLOperatorElement.h: Use a new structure to hold both the character and direction
2381         and change names from "text" to "char".
2382         * rendering/mathml/RenderMathMLFencedOperator.cpp:
2383         (WebCore::RenderMathMLFencedOperator::updateOperatorContent): Update both the character and
2384         direction using MathMLOperatorElement::parseOperatorChar. Then set the boolean properties
2385         and leading/trailing space using the operator dictionary. minsize and maxsize are constant
2386         so we do not need to set them any more.
2387         (WebCore::RenderMathMLFencedOperator::leadingSpace): Resolve the spacing read from the
2388         dictionary to LayoutUnit. Note that it can never be negative.
2389         (WebCore::RenderMathMLFencedOperator::trailingSpace): Ditto.
2390         (WebCore::RenderMathMLFencedOperator::RenderMathMLFencedOperator): Deleted.
2391         (WebCore::RenderMathMLFencedOperator::setOperatorProperties): Deleted.
2392         * rendering/mathml/RenderMathMLFencedOperator.h: We use the new OperatorChar structure for
2393         accessors and members. We make minSize and maxSize just return the default values and delete
2394         the corresponding members. Finally, leading and trailing space are now stored as unsigned
2395         short in MathUnit.
2396         * rendering/mathml/RenderMathMLOperator.cpp:
2397         (WebCore::RenderMathMLOperator::textContent): Use the new OperatorChar structure.
2398         (WebCore::RenderMathMLOperator::isVertical): Helper function forwarding to MathMLOperatorElement.
2399         (WebCore::RenderMathMLOperator::stretchTo): Use isVertical() and remove setOperatorProperties().
2400         (WebCore::RenderMathMLOperator::resetStretchSize): Ditto.
2401         (WebCore::RenderMathMLOperator::updateMathOperator): Rename rebuildTokenContent as this is
2402         now really only used to update MathOperator and hence replace the condition on
2403         useMathOperator() with an ASSERT.
2404         (WebCore::RenderMathMLOperator::updateTokenContent): Call updateMathOperator instead of
2405         rebuildTokenContent.
2406         (WebCore::RenderMathMLOperator::verticalStretchedOperatorShift): We use isVertical().
2407         (WebCore::RenderMathMLOperator::paint): Ditto.
2408         (WebCore::RenderMathMLOperator::setOperatorProperties): Deleted. This is no longer needed.
2409         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Deleted.
2410         (WebCore::RenderMathMLOperator::rebuildTokenContent): Deleted. Renamed updateMathOperator.
2411         (WebCore::RenderMathMLOperator::styleDidChange): No need to call updateOperatorProperties.
2412         (WebCore::RenderMathMLOperator::updateOperatorProperties): Ditto..
2413         * rendering/mathml/RenderMathMLOperator.h: Update some declaration and remove m_isVertical.
2414         (WebCore::RenderMathMLOperator::isVertical): Deleted.
2415         * rendering/mathml/RenderMathMLRow.cpp:
2416         (WebCore::RenderMathMLRow::updateOperatorProperties): Deleted. This is no longer needed.
2417         * rendering/mathml/RenderMathMLRow.h: Ditto.
2418
2419 2016-08-02  Chris Dumez  <cdumez@apple.com>
2420
2421         Drop custom bindings code for HTMLSelectElement.remove()
2422         https://bugs.webkit.org/show_bug.cgi?id=160477
2423
2424         Reviewed by Darin Adler.
2425
2426         Drop custom bindings code for HTMLSelectElement.remove() and use
2427         overloading instead.
2428
2429         * bindings/js/JSHTMLSelectElementCustom.cpp:
2430         (WebCore::JSHTMLSelectElement::remove): Deleted.
2431         * html/HTMLSelectElement.idl:
2432
2433 2016-08-02  Chris Dumez  <cdumez@apple.com>
2434
2435         Drop custom bindings code for HTMLOptionsCollection.remove()
2436         https://bugs.webkit.org/show_bug.cgi?id=160475
2437
2438         Reviewed by Darin Adler.
2439
2440         Drop custom bindings code for HTMLOptionsCollection.remove() and use
2441         overloading instead. The overload that take an HTMLOptionElement is
2442         WebKit-specific and should probably be dropped at some point:
2443         - https://html.spec.whatwg.org/multipage/infrastructure.html#htmloptionscollection
2444
2445         This patch also fixes several bugs:
2446         - The parameter is now mandatory. This is consistent with the
2447           specification, Firefox and Chrome.
2448         - HTMLOptionsCollection.prototype.remove.length is now 1 instead of 0.
2449
2450         No new tests, rebaselined existing tests.
2451
2452         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
2453         (WebCore::JSHTMLOptionsCollection::remove): Deleted.
2454         * html/HTMLOptionsCollection.idl:
2455
2456 2016-08-02  Nan Wang  <n_wang@apple.com>
2457
2458         AX: Simulated touch events are not working on iOS
2459         https://bugs.webkit.org/show_bug.cgi?id=160395
2460         <rdar://problem/27633597>
2461
2462         Reviewed by Chris Fleizach.
2463
2464         We should mark the simulated touch as a potential tap otherwise it won't
2465         be handled on iOS. Also, we need to dispatch both touch start and touch end
2466         to mimic the real touch events. Last, added a has event listeners check,
2467         because iOS is dispatching mouse click events for elements without touch event
2468         listeners.
2469
2470         Test: accessibility/ios-simulator/press-fires-touch-events.html
2471
2472         * accessibility/AccessibilityObject.cpp:
2473         (WebCore::AccessibilityObject::press):
2474         (WebCore::AccessibilityObject::dispatchTouchEvent):
2475         * page/ios/EventHandlerIOS.mm:
2476         (WebCore::EventHandler::dispatchSimulatedTouchEvent):
2477         * platform/ios/PlatformEventFactoryIOS.mm:
2478         (WebCore::PlatformTouchEventBuilder::PlatformTouchEventBuilder):
2479
2480 2016-08-02  Benjamin Poulain  <bpoulain@apple.com>
2481
2482         Clean up some useless AtomicString atoms
2483         https://bugs.webkit.org/show_bug.cgi?id=160471
2484
2485         Reviewed by Geoffrey Garen.
2486
2487         The only uses of "commentAtom" and "textAtom" where for their
2488         respective overload of Node::nodeName().
2489         Those methods return a string, we should not keep them in the atomic
2490         string table just to hold a small String alive. They were also the only
2491         two nodes to behave that way.
2492
2493         The atom xlinkAtom was only used by createForeignAttributesMap(), which
2494         is itself only invoked once. There is no need for the symbol xlinkAtom.
2495
2496         * dom/CDATASection.cpp:
2497         (WebCore::CDATASection::nodeName):
2498         * dom/Comment.cpp:
2499         (WebCore::Comment::nodeName):
2500         * dom/Document.cpp:
2501         (WebCore::Document::nodeName):
2502         * dom/Text.cpp:
2503         (WebCore::Text::nodeName):
2504         * html/parser/HTMLTreeBuilder.cpp:
2505         (WebCore::createForeignAttributesMap):
2506
2507 2016-08-02  Anders Carlsson  <andersca@apple.com>
2508
2509         Freeze the Objective-C DOM Event and CSS bindings
2510         https://bugs.webkit.org/show_bug.cgi?id=160476
2511
2512         Reviewed by Tim Horton.
2513
2514         * DerivedSources.make:
2515         * WebCore.xcodeproj/project.pbxproj:
2516         * bindings/objc/DOMCSSCharsetRule.h: Added.
2517         * bindings/objc/DOMCSSCharsetRule.mm: Added.
2518         * bindings/objc/DOMCSSCharsetRuleInternal.h: Added.
2519         * bindings/objc/DOMCSSFontFaceRule.h: Added.
2520         * bindings/objc/DOMCSSFontFaceRule.mm: Added.
2521         * bindings/objc/DOMCSSFontFaceRuleInternal.h: Added.
2522         * bindings/objc/DOMCSSImportRule.h: Added.
2523         * bindings/objc/DOMCSSImportRule.mm: Added.
2524         * bindings/objc/DOMCSSImportRuleInternal.h: Added.
2525         * bindings/objc/DOMCSSMediaRule.h: Added.
2526         * bindings/objc/DOMCSSMediaRule.mm: Added.
2527         * bindings/objc/DOMCSSMediaRuleInternal.h: Added.
2528         * bindings/objc/DOMCSSPageRule.h: Added.
2529         * bindings/objc/DOMCSSPageRule.mm: Added.
2530         * bindings/objc/DOMCSSPageRuleInternal.h: Added.
2531         * bindings/objc/DOMCSSPrimitiveValue.h: Added.
2532         * bindings/objc/DOMCSSPrimitiveValue.mm: Added.
2533         * bindings/objc/DOMCSSPrimitiveValueInternal.h: Added.
2534         * bindings/objc/DOMCSSRule.h: Added.
2535         * bindings/objc/DOMCSSRule.mm: Added.
2536         * bindings/objc/DOMCSSRuleInternal.h: Added.
2537         * bindings/objc/DOMCSSRuleList.h: Added.
2538         * bindings/objc/DOMCSSRuleList.mm: Added.
2539         * bindings/objc/DOMCSSRuleListInternal.h: Added.
2540         * bindings/objc/DOMCSSStyleDeclaration.h: Added.
2541         * bindings/objc/DOMCSSStyleDeclaration.mm: Added.
2542         * bindings/objc/DOMCSSStyleDeclarationInternal.h: Added.
2543         * bindings/objc/DOMCSSStyleRule.h: Added.
2544         * bindings/objc/DOMCSSStyleRule.mm: Added.
2545         * bindings/objc/DOMCSSStyleRuleInternal.h: Added.
2546         * bindings/objc/DOMCSSStyleSheet.h: Added.
2547         * bindings/objc/DOMCSSStyleSheet.mm: Added.
2548         * bindings/objc/DOMCSSStyleSheetInternal.h: Added.
2549         * bindings/objc/DOMCSSUnknownRule.h: Added.
2550         * bindings/objc/DOMCSSUnknownRule.mm: Added.
2551         * bindings/objc/DOMCSSUnknownRuleInternal.h: Added.
2552         * bindings/objc/DOMCSSValue.h: Added.
2553         * bindings/objc/DOMCSSValue.mm: Added.
2554         * bindings/objc/DOMCSSValueInternal.h: Added.
2555         * bindings/objc/DOMCSSValueList.h: Added.
2556         * bindings/objc/DOMCSSValueList.mm: Added.
2557         * bindings/objc/DOMCSSValueListInternal.h: Added.
2558         * bindings/objc/DOMCounter.h: Added.
2559         * bindings/objc/DOMCounter.mm: Added.
2560         * bindings/objc/DOMCounterInternal.h: Added.
2561         * bindings/objc/DOMEvent.h: Added.
2562         * bindings/objc/DOMEvent.mm: Added.
2563         * bindings/objc/DOMEventInternal.h: Added.
2564         * bindings/objc/DOMEventListener.h: Added.
2565         * bindings/objc/DOMEventTarget.h: Added.
2566         * bindings/objc/DOMKeyboardEvent.h: Added.
2567         * bindings/objc/DOMKeyboardEvent.mm: Added.
2568         * bindings/objc/DOMKeyboardEventInternal.h: Added.
2569         * bindings/objc/DOMMouseEvent.h: Added.
2570         * bindings/objc/DOMMouseEvent.mm: Added.
2571         * bindings/objc/DOMMouseEventInternal.h: Added.
2572         * bindings/objc/DOMMutationEvent.h: Added.
2573         * bindings/objc/DOMMutationEvent.mm: Added.
2574         * bindings/objc/DOMMutationEventInternal.h: Added.
2575         * bindings/objc/DOMOverflowEvent.h: Added.
2576         * bindings/objc/DOMOverflowEvent.mm: Added.
2577         * bindings/objc/DOMOverflowEventInternal.h: Added.
2578         * bindings/objc/DOMProgressEvent.h: Added.
2579         * bindings/objc/DOMProgressEvent.mm: Added.
2580         * bindings/objc/DOMProgressEventInternal.h: Added.
2581         * bindings/objc/DOMRGBColor.h: Added.
2582         * bindings/objc/DOMRGBColor.mm: Added.
2583         * bindings/objc/DOMRGBColorInternal.h: Added.
2584         * bindings/objc/DOMRect.h: Added.
2585         * bindings/objc/DOMRect.mm: Added.
2586         * bindings/objc/DOMRectInternal.h: Added.
2587         * bindings/objc/DOMTextEvent.h: Added.
2588         * bindings/objc/DOMTextEvent.mm: Added.
2589         (-[DOMTextEvent data]):
2590         (-[DOMTextEvent initTextEvent:canBubbleArg:cancelableArg:viewArg:dataArg:]):
2591         * bindings/objc/DOMTextEventInternal.h: Added.
2592         * bindings/objc/DOMUIEvent.h: Added.
2593         * bindings/objc/DOMUIEvent.mm: Added.
2594         * bindings/objc/DOMUIEventInternal.h: Added.
2595         * bindings/objc/DOMWheelEvent.h: Added.
2596         * bindings/objc/DOMWheelEvent.mm: Added.
2597         * bindings/objc/DOMWheelEventInternal.h: Added.
2598
2599 2016-08-02  Enrica Casucci  <enrica@apple.com>
2600
2601         Allow building with content filtering disabled.
2602         https://bugs.webkit.org/show_bug.cgi?id=160454
2603
2604         Reviewed by Simon Fraser.
2605
2606         * Configurations/FeatureDefines.xcconfig:
2607         * platform/PlatformContentFilter.h:
2608         (WebCore::PlatformContentFilter::unblockRequestDeniedScript):
2609         * platform/cocoa/NetworkExtensionContentFilter.h:
2610         * platform/cocoa/NetworkExtensionContentFilter.mm:
2611         (WebCore::NetworkExtensionContentFilter::unblockHandler):
2612         * platform/cocoa/ParentalControlsContentFilter.h:
2613         * testing/MockContentFilter.h:
2614
2615 2016-08-02  Dean Jackson  <dino@apple.com>
2616
2617         Reapply fixes for webkit.org/b/159450 and webkit.org/b/157569
2618         https://bugs.webkit.org/show_bug.cgi?id=160474
2619         <rdar://problem/27668170>
2620
2621         Reviewed by Simon Fraser.
2622
2623         The fixes are behaviour we want. They just caused a regression
2624         on medium.com (reverted in http://trac.webkit.org/r203380).
2625
2626         Now that we've branched, revert the reversion (which itself
2627         was a reversion), so we can fix the actual bug:
2628         https://bugs.webkit.org/show_bug.cgi?id=160478
2629
2630         * css/CSSParser.cpp:
2631         (WebCore::CSSParser::parseValue):
2632         (WebCore::CSSParser::parseAnimationShorthand):
2633         (WebCore::CSSParser::addPropertyWithPrefixingVariant):
2634         (WebCore::CSSParser::parseTransitionShorthand):
2635         * css/CSSPropertyNames.in:
2636         * css/PropertySetCSSStyleDeclaration.cpp:
2637         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
2638         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
2639         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
2640         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
2641         * css/StyleProperties.cpp:
2642         (WebCore::MutableStyleProperties::removeShorthandProperty):
2643         (WebCore::StyleProperties::asText):
2644         (WebCore::MutableStyleProperties::removeProperty): Deleted.
2645         (WebCore::MutableStyleProperties::removePrefixedOrUnprefixedProperty): Deleted.
2646         (WebCore::MutableStyleProperties::setProperty): Deleted.
2647         (WebCore::getIndexInShorthandVectorForPrefixingVariant): Deleted.
2648         (WebCore::MutableStyleProperties::appendPrefixingVariantProperty): Deleted.
2649         (WebCore::MutableStyleProperties::setPrefixingVariantProperty): Deleted.
2650         * css/StyleProperties.h:
2651
2652 2016-08-02  Eric Carlson  <eric.carlson@apple.com>
2653
2654         Cleanup HTMLMediaElement track lists.
2655         https://bugs.webkit.org/show_bug.cgi?id=160470
2656
2657         Reviewed by David Kilzer.
2658
2659         Test: media/range-extract-contents-crash.html
2660
2661         * html/HTMLMediaElement.cpp:
2662         (WebCore::HTMLMediaElement::~HTMLMediaElement): 
2663
2664         * html/track/AudioTrack.cpp:
2665         (WebCore::AudioTrack::willRemove): ASSERT if media element is NULL.
2666
2667         * html/track/TextTrackList.cpp:
2668         (TextTrackList::clearElement): Clear track media element pointers and client.
2669         * html/track/TextTrackList.h:
2670
2671         * html/track/TrackListBase.cpp:
2672         (TrackListBase::~TrackListBase): Call clearElement.
2673         (TrackListBase::clearElement): Clear track media element pointers and client.
2674         * html/track/TrackListBase.h:
2675
2676 2016-08-02  Anders Carlsson  <andersca@apple.com>
2677
2678         Remove more Objective-C bindings that are not used
2679         https://bugs.webkit.org/show_bug.cgi?id=160473
2680
2681         Reviewed by Sam Weinig.
2682
2683         * DerivedSources.make:
2684         * WebCore.xcodeproj/project.pbxproj:
2685         * bindings/objc/DOMCSS.mm:
2686         (kitClass):
2687         * dom/Document.idl:
2688
2689 2016-08-02  Chris Dumez  <cdumez@apple.com>
2690
2691         Drop custom bindings for FormData.append()
2692         https://bugs.webkit.org/show_bug.cgi?id=160466
2693
2694         Reviewed by Sam Weinig.
2695
2696         Drop custom bindings for FormData.append(). We no longer need them now
2697         that we have proper support for overloads after r204028.
2698
2699         This patch also fixes the fact that FormData.prototype.append.length
2700         was 0 instead of 2.
2701
2702         No new tests, rebaselined existing test.
2703
2704         * bindings/js/JSDOMFormDataCustom.cpp:
2705         (WebCore::JSDOMFormData::append): Deleted.
2706         * html/DOMFormData.cpp:
2707         (WebCore::DOMFormData::append):
2708         * html/DOMFormData.h:
2709         * html/DOMFormData.idl:
2710         * html/FileInputType.cpp:
2711         (WebCore::FileInputType::appendFormData):
2712         * html/FormDataList.cpp:
2713         (WebCore::FormDataList::appendBlob):
2714         * html/FormDataList.h:
2715         (WebCore::FormDataList::Item::Item):
2716         (WebCore::FormDataList::appendBlob):
2717
2718 2016-08-02  Commit Queue  <commit-queue@webkit.org>
2719
2720         Unreviewed, rolling out r203799.
2721         https://bugs.webkit.org/show_bug.cgi?id=160467
2722
2723         Decided on a different solution (Requested by jonlee_ on
2724         #webkit).
2725
2726         Reverted changeset:
2727
2728         "Captions do not render in PiP window when element is hidden"
2729         https://bugs.webkit.org/show_bug.cgi?id=160265
2730         http://trac.webkit.org/changeset/203799
2731
2732 2016-08-02  Alex Christensen  <achristensen@webkit.org>
2733
2734         Remove unused functions in URL
2735         https://bugs.webkit.org/show_bug.cgi?id=160468
2736
2737         Reviewed by Geoffrey Garen.
2738
2739         * page/SecurityOrigin.cpp:
2740         (WebCore::SecurityOrigin::extractInnerURL):
2741         * platform/URL.cpp:
2742         (WebCore::mimeTypeFromURL):
2743         (WebCore::URL::stringCenterEllipsizedToLength):
2744         (WebCore::URL::isSafeToSendToAnotherThread): Deleted.
2745         * platform/URL.h:
2746         (WebCore::URL::operator NSString*):
2747         (WebCore::URL::innerURL): Deleted.
2748
2749 2016-08-02  Chris Dumez  <cdumez@apple.com>
2750
2751         Named / Indexed properties should be configurable
2752         https://bugs.webkit.org/show_bug.cgi?id=160457
2753
2754         Reviewed by Darin Adler.
2755
2756         Report Named / Indexed properties as being configurable to comply with
2757         the Web IDL specification:
2758         - http://heycam.github.io/webidl/#getownproperty-guts (step 1. and 2.)
2759
2760         Firefox and Chrome also report them as being configurable.
2761
2762         No new tests, rebaselined existing tests.
2763
2764         * bindings/scripts/CodeGeneratorJS.pm:
2765         (GenerateGetOwnPropertySlotBody):
2766
2767 2016-08-02  Anders Carlsson  <andersca@apple.com>
2768
2769         Remove more unused/uninstalled Objective-C DOM bindings
2770         https://bugs.webkit.org/show_bug.cgi?id=160464
2771
2772         Reviewed by Darin Adler.
2773
2774         * Configurations/WebCore.xcconfig:
2775         * DerivedSources.make:
2776         * WebCore.xcodeproj/project.pbxproj:
2777         * bindings/objc/DOMCSS.mm:
2778         (kitClass):
2779         * bindings/objc/DOMEvents.h:
2780         * bindings/objc/DOMEvents.mm:
2781         (kitClass): Deleted.
2782         * dom/Document.idl:
2783
2784 2016-08-02  Chris Dumez  <cdumez@apple.com>
2785
2786         [WebIDL] Extend new overload resolution algorithm support to constructors
2787         https://bugs.webkit.org/show_bug.cgi?id=160455
2788
2789         Reviewed by Ryosuke Niwa.
2790
2791         Extend new overload resolution algorithm support (added in r204028) to
2792         constructors as well. It was only used for operations. Remove code that
2793         is now dead from the bindings generator.
2794
2795         We now share the same code of generating the overload resolution code
2796         for operations and constructors.
2797
2798         No new tests, rebaselined existing tests.
2799
2800         * bindings/scripts/CodeGenerator.pm:
2801         (LinkOverloadedFunctions):
2802         * bindings/scripts/CodeGeneratorJS.pm:
2803         (GenerateOverloadedFunctionOrConstructor):
2804         (GenerateImplementation):
2805         (GenerateConstructorDefinitions):
2806         (GenerateConstructorDefinition):
2807         (GetFunctionLength): Deleted.
2808         (LengthOfLongestFunctionParameterList): Deleted.
2809         (GetNativeTypeForConversions): Deleted.
2810         (GetGnuVTableNameForInterface): Deleted.
2811         (GetGnuMangledNameForInterface): Deleted.
2812         (GetGnuVTableOffsetForType): Deleted.
2813         (GenerateConstructorHelperMethods): Deleted.
2814         * bindings/scripts/IDLParser.pm:
2815         (applyExtendedAttributeList): Deleted.
2816         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2817         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
2818         * bindings/scripts/test/TestOverloadedConstructors.idl:
2819
2820 2016-08-02  Brady Eidson  <beidson@apple.com>
2821
2822         Removing IndexedDB WebsiteData can fail for some users.
2823         https://bugs.webkit.org/show_bug.cgi?id=160463
2824
2825         Reviewed by Alex Christensen.
2826
2827         Covered by changes to API test IndexedDB.StoreBlobThenDelete.
2828
2829         For a few months in trunk WebKit, deleting an IndexedDB using WebsiteDataStore API would only
2830         delete the "IndexedDB.sqlite3" file, but would leave the "-wal" and "-shm" files behind.
2831         
2832         We'd then fail to delete the directory itself, tricking API clients to think there are still
2833         databases in the given origin.
2834         
2835         Furthermore, the code to delete a database first checks for the existence of "IndexedDB.sqlite3"
2836         then refuses to do any further cleanup if it doesn't exist.
2837         
2838         We should just always run the entire delete procedure even if IndexedDB.sqlite does not exist.
2839         
2840         * Modules/indexeddb/server/IDBServer.cpp:
2841         (WebCore::IDBServer::removeAllDatabasesForOriginPath):
2842
2843         * platform/sql/SQLiteFileSystem.cpp:
2844         (WebCore::SQLiteFileSystem::deleteDatabaseFile):
2845
2846 2016-08-02  Alex Christensen  <achristensen@webkit.org>
2847
2848         Fix Mac CMake build.
2849
2850         * PlatformMac.cmake:
2851         Some ObjC bindings have been frozen.
2852
2853 2016-08-02  Frederic Wang  <fwang@igalia.com>
2854
2855         More cleanup of MathML operator parsing
2856         https://bugs.webkit.org/show_bug.cgi?id=160336
2857
2858         Reviewed by Darin Adler.
2859
2860         No new tests, behavior is unchanged.
2861
2862         * rendering/mathml/RenderMathMLBlock.cpp:
2863         (WebCore::parseMathMLLength): Deleted. This function is no longer used.
2864         * rendering/mathml/RenderMathMLBlock.h: Ditto.
2865         * rendering/mathml/RenderMathMLFencedOperator.h: Move some length members from
2866         RenderMathMLOperator and override the accessors. Also override useMathOperator() since it is
2867         always true for anonymous mfenced operators.
2868         * rendering/mathml/RenderMathMLOperator.cpp:
2869         (WebCore::RenderMathMLOperator::textContent): No need to ASSERT !isAnonymous since this
2870         function is overriden by RenderMathMLFencedOperator.
2871         (WebCore::RenderMathMLOperator::isInvisibleOperator): Use a temporary variable to call
2872         textContent only once.
2873         (WebCore::RenderMathMLOperator::leadingSpace): Helper function to determine the leading space.
2874         (WebCore::RenderMathMLOperator::trailingSpace): Helper function to determine the trailing space.
2875         (WebCore::RenderMathMLOperator::minSize): Helper function to determine the min space.
2876         (WebCore::RenderMathMLOperator::maxSize): Helper function to determine the max space.
2877         (WebCore::RenderMathMLOperator::setOperatorProperties): This is now only used to set m_isVertical.
2878         (WebCore::RenderMathMLOperator::stretchTo): Call maxSize and minSize when necessary.
2879         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Call leadingSpace and trailingSpace.
2880         (WebCore::RenderMathMLOperator::layoutBlock): Ditto.
2881         (WebCore::RenderMathMLOperator::useMathOperator): Remove the case for anonymous operators as
2882         this is now handled in the derived class.
2883         (WebCore::RenderMathMLOperator::paint): Call leadingSpace.
2884         * rendering/mathml/RenderMathMLOperator.h: Remove length members and declare helper functions
2885         to get these lengths from MathMLOperatorElement.
2886         (WebCore::RenderMathMLOperator::setLeadingSpace): Deleted. This is no longer used.
2887         (WebCore::RenderMathMLOperator::setTrailingSpace): Deleted. This is no longer used.
2888
2889 2016-08-02  Frederic Wang  <fwang@igalia.com>
2890
2891         Move parsing of operator length attributes to MathMLOperatorElement
2892         https://bugs.webkit.org/show_bug.cgi?id=160301
2893
2894         Reviewed by Darin Adler.
2895
2896         We move parsing of operator attributes lspace, rspace minsize, maxsize into the class
2897         MathMLOperatorElement. We rely on the existing MathMLElement::Length structure and expand
2898         it to handle the "infinity" case of maxsize that we always resolve as intMaxForLayoutUnit.
2899         We also improve the resolution of a negative value for minsize and maxsize since the MathML
2900         recommendation says it should be rounded up to the nearest valid value (which is zero)
2901         instead of ignoring the attribute and using the default value. This is similar to r203285
2902         for mfrac@linethickness. We also update the existing test for minsize/maxsize to take into
2903         account that change.
2904
2905         No new tests, already covered by existing tests.
2906
2907         * mathml/MathMLElement.h: Add an "Infinity" type for MathML Length.
2908         * mathml/MathMLOperatorElement.cpp:
2909         (WebCore::MathMLOperatorElement::leadingSpace): Helper function to retrieve the cached value
2910         for the lspace attribute, parse it if necessary.
2911         (WebCore::MathMLOperatorElement::trailingSpace): Ditto for rspace.
2912         (WebCore::MathMLOperatorElement::minSize): Ditto for minsize.
2913         (WebCore::MathMLOperatorElement::maxSize): Ditto for maxsize. This attribute also accepts the
2914         "infinity" value.
2915         (WebCore::MathMLOperatorElement::parseAttribute): Mark attributes dirty.
2916         * mathml/MathMLOperatorElement.h: Declare Length members and accessors.
2917         * rendering/mathml/RenderMathMLBlock.cpp:
2918         (WebCore::toUserUnits): Resolve Infinity as intMaxForLayoutUnit.
2919         * rendering/mathml/RenderMathMLOperator.cpp:
2920         (WebCore::RenderMathMLOperator::setOperatorProperties): We use toUserUnits to resolve the
2921         lengths. Negative maxsize and minsize values now fallback to 0 instead of their default
2922         values. We also remove the !isAnonymous() check since setOperatorProperties is overriden
2923         in the RenderMathMLFencedOperator class.
2924
2925 2016-08-02  Frederic Wang  <fred.wang@free.fr>
2926
2927         Unreviewed build error fix.
2928
2929         * mathml/MathMLOperatorElement.cpp:
2930         (WebCore::propertyFlagToAttributeName): Return a nullQName to avoid warnings on some platforms.
2931
2932 2016-08-02  Anders Carlsson  <andersca@apple.com>
2933
2934         Stop building Objective-C bindings that aren't exposed anywhere
2935         https://bugs.webkit.org/show_bug.cgi?id=160458
2936
2937         Reviewed by Darin Adler.
2938
2939         * DerivedSources.make:
2940         * WebCore.xcodeproj/project.pbxproj:
2941
2942 2016-08-02  Chris Dumez  <cdumez@apple.com>
2943
2944         HTMLCollection's named getter should only do 'name' attribute matching for HTMLElements
2945         https://bugs.webkit.org/show_bug.cgi?id=160456
2946
2947         Reviewed by Darin Adler.
2948
2949         HTMLCollection's named getter should only do 'name' attribute matching for HTMLElements:
2950         - https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem
2951
2952         Our slow path which relies on HTMLCollection::updateNamedElementCache() does the right
2953         thing. However, we have a fast path in 
2954         CachedHTMLCollection<HTMLCollectionClass, traversalType>::namedItem() that was missing a
2955         check.
2956
2957         Firefox and Chrome both behave correctly here.
2958
2959         No new tests, rebaselined existing tests.
2960
2961         * html/CachedHTMLCollection.h:
2962         (WebCore::traversalType>::namedItem):
2963
2964 2016-08-02  Chris Dumez  <cdumez@apple.com>
2965
2966         Kill [StrictTypeChecking] IDL extended attribute
2967         https://bugs.webkit.org/show_bug.cgi?id=160382
2968
2969         Reviewed by Darin Adler.
2970
2971         Kill [StrictTypeChecking] IDL extended attribute. Its only remaining
2972         use was on DOMString parameters for a few CanvasRenderingContext2D
2973         operations in order to work around a bug in our overload resolution.
2974
2975         However, as of r204028, we implement the Web IDL overload resolution
2976         algorithm and [StrictTypeChecking] is now a no-op and is no longer
2977         needed.
2978
2979         * bindings/scripts/CodeGeneratorJS.pm:
2980         (GenerateParametersCheckExpression):
2981         * bindings/scripts/IDLAttributes.txt:
2982         * bindings/scripts/test/TestObj.idl:
2983         * bindings/scripts/test/TestTypedefs.idl:
2984         * html/canvas/CanvasRenderingContext2D.idl:
2985
2986 2016-08-02  Frederic Wang  <fwang@igalia.com>
2987
2988         Move parsing of boolean operator properties into MathMLOperatorElement
2989         https://bugs.webkit.org/show_bug.cgi?id=160190
2990
2991         Reviewed by Darin Adler.
2992
2993         No new tests, already covered by existing tests.
2994
2995         * mathml/MathMLOperatorDictionary.h: Add a bit mask with all the property flags set.
2996         * mathml/MathMLOperatorElement.cpp:
2997         (WebCore::attributeNameToPropertyFlag): helper function to map from attribute name to flag.
2998         (WebCore::MathMLOperatorElement::computeOperatorFlag): Helper function to update one
2999         bit of m_properties.flags from the corresponding boolean attribute. The default value is
3000         taken from the operator dictionary data stored in m_dictionaryProperty.flags.
3001         (WebCore::MathMLOperatorElement::hasProperty): Returns whether the operator has a property,
3002         parsing it again if the corresponding attribute is dirty.
3003         (WebCore::MathMLOperatorElement::childrenChanged): Make all properties dirty.
3004         (WebCore::propertyFlagToAttributeName): helper function to map from flag to attribute name.
3005         (WebCore::MathMLOperatorElement::parseAttribute): Make all properties dirty if the form
3006         attribute changed. Make each property dirty when the corresponding attribute changed.
3007         (WebCore::MathMLOperatorElement::flags): Deleted. Replaced with the finer hasProperty function.
3008         * mathml/MathMLOperatorElement.h: Define new structure, member and functions to handle
3009         operator properties.
3010         * rendering/mathml/RenderMathMLFencedOperator.cpp:
3011         (WebCore::RenderMathMLFencedOperator::RenderMathMLFencedOperator): Move m_operatorFlags from
3012         the base class to the derived class.
3013         * rendering/mathml/RenderMathMLFencedOperator.h: Ditto.
3014         * rendering/mathml/RenderMathMLOperator.cpp:
3015         (WebCore::RenderMathMLOperator::RenderMathMLOperator): Ditto.
3016         (WebCore::RenderMathMLOperator::hasOperatorFlag): Just call hasOperatorFlag from the
3017         MathMLOperatorElement class.
3018         (WebCore::RenderMathMLOperator::setOperatorProperties): We do not initialize m_operatorFlags
3019         since it has been removed from the base class. We also do not parse attributes since this
3020         has been moved to the MathMLOperatorElement class.
3021         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute): Deleted.
3022         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttributeValue): Deleted.
3023         * rendering/mathml/RenderMathMLOperator.h: Move m_operatorFlags from the base class to the
3024         derived class, remove some parsing helper functions and update hasOperatorFlag to make it
3025         overridable.
3026
3027 2016-08-01  Anders Carlsson  <andersca@apple.com>
3028
3029         Freeze another bunch of Objective-C binding files
3030         https://bugs.webkit.org/show_bug.cgi?id=160435
3031
3032         Reviewed by Alex Christensen.
3033
3034         * DerivedSources.make:
3035         * WebCore.xcodeproj/project.pbxproj:
3036         * bindings/objc/DOMAbstractView.h: Added.
3037         * bindings/objc/DOMAbstractView.mm:
3038         * bindings/objc/DOMAbstractViewInternal.h: Added.
3039         * bindings/objc/DOMMediaList.h: Added.
3040         * bindings/objc/DOMMediaList.mm: Added.
3041         * bindings/objc/DOMMediaListInternal.h: Added.
3042         * bindings/objc/DOMNodeFilter.h: Added.
3043         * bindings/objc/DOMNodeIterator.h: Added.
3044         * bindings/objc/DOMNodeIterator.mm: Added.
3045         * bindings/objc/DOMNodeIteratorInternal.h: Added.
3046         * bindings/objc/DOMRange.h: Added.
3047         * bindings/objc/DOMRange.mm: Added.
3048         * bindings/objc/DOMRangeInternal.h: Added.
3049         * bindings/objc/DOMStyleSheet.h: Added.
3050         * bindings/objc/DOMStyleSheet.mm: Added.
3051         * bindings/objc/DOMStyleSheetInternal.h: Added.
3052         * bindings/objc/DOMStyleSheetList.h: Added.
3053         * bindings/objc/DOMStyleSheetList.mm: Added.
3054         * bindings/objc/DOMStyleSheetListInternal.h: Added.
3055         * bindings/objc/DOMTreeWalker.h: Added.
3056         * bindings/objc/DOMTreeWalker.mm: Added.
3057         * bindings/objc/DOMTreeWalkerInternal.h: Added.
3058         * bindings/objc/DOMXPathExpression.h: Added.
3059         * bindings/objc/DOMXPathExpression.mm: Added.
3060         * bindings/objc/DOMXPathExpressionInternal.h: Added.
3061         * bindings/objc/DOMXPathNSResolver.h: Added.
3062         * bindings/objc/DOMXPathResult.h: Added.
3063         * bindings/objc/DOMXPathResult.mm: Added.
3064         * bindings/objc/DOMXPathResultInternal.h: Added.
3065
3066 2016-08-02  Frederic Wang  <fwang@igalia.com>
3067
3068         [MathML] Use more auto for local variables
3069         https://bugs.webkit.org/show_bug.cgi?id=160453
3070
3071         Reviewed by Darin Adler.
3072
3073         No new tests, behavior is unchanged.
3074
3075         * mathml/MathMLElement.cpp:
3076         (WebCore::MathMLElement::colSpan):
3077         (WebCore::MathMLElement::rowSpan):
3078         (WebCore::MathMLElement::childShouldCreateRenderer):
3079         (WebCore::MathMLElement::defaultEventHandler):
3080         * mathml/MathMLSelectElement.cpp:
3081         (WebCore::MathMLSelectElement::getSelectedActionChild):
3082         (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
3083         * rendering/mathml/RenderMathMLFenced.cpp:
3084         (WebCore::RenderMathMLFenced::updateFromElement):
3085
3086 2016-08-02  Ryan Haddad  <ryanhaddad@apple.com>
3087
3088         Attempt to fix build after r204014.
3089
3090         Unreviewed build fix.
3091
3092         * loader/mac/ResourceLoaderMac.mm:
3093         (WebCore::ResourceLoader::willCacheResponse):
3094
3095 2016-08-02  Chris Dumez  <cdumez@apple.com>
3096
3097         [WebIDL] Implement overload resolution algorithm
3098         https://bugs.webkit.org/show_bug.cgi?id=160394
3099
3100         Reviewed by Darin Adler.
3101
3102         Implement overload resolution algorithm:
3103         - http://heycam.github.io/webidl/#es-overloads
3104
3105         This means that our support for operation overloading in our IDL is
3106         now a lot more extensive than it used to be and is now compliant with
3107         the Web IDL specification.
3108
3109         In particular, overloading should now work for a lot more parameter
3110         types which means that:
3111         - We should be able to drop some custom bindings code in a follow-up patch.
3112         - We will be able to drop the [StrictTypeChecking] attribute which was
3113           a hack used to make overloading work for parameters of type DOMString.
3114
3115         Also, the order of the overloads in the IDL no longer impacts the
3116         generated bindings code. It used to be that you needed to put the
3117         overloads with the more specific parameter types first in order for the
3118         generated bindings code to be somewhat correct.
3119
3120         No new tests, rebaselined bindings tests.
3121
3122         * bindings/scripts/CodeGenerator.pm:
3123         (IsStringOrEnumType):
3124         * bindings/scripts/CodeGeneratorJS.pm:
3125         (IsNullableType):
3126         (StripNullable):
3127         (ComputeEffectiveOverloadSet):
3128         (AreTypesDistinguishableForOverloadResolution):
3129         (GetDistinguishingArgumentIndex):
3130         (GetOverloadThatMatches):
3131         (GenerateOverloadedFunction):
3132         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3133         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
3134         * bindings/scripts/test/JS/JSTestObj.cpp:
3135         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
3136         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
3137         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
3138         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
3139         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
3140         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
3141         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12): Deleted.
3142         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise): Deleted.
3143         * bindings/scripts/test/TestObj.idl:
3144         * dom/EventTarget.h:
3145         * dom/EventTarget.idl:
3146         * html/HTMLOptionsCollection.h:
3147         * html/HTMLOptionsCollection.idl:
3148         * html/HTMLSelectElement.h:
3149         (WebCore::HTMLSelectElement::add):
3150         * html/HTMLSelectElement.idl:
3151
3152 2016-08-02  Myles C. Maxfield  <mmaxfield@apple.com>
3153
3154         [macOS] Guard workaround in r203314 for only OSes which need it
3155         https://bugs.webkit.org/show_bug.cgi?id=160440
3156
3157         Reviewed by Simon Fraser.
3158
3159         The workarond introduced in r203314 only needs to be applied on
3160         certain OSes.
3161
3162         No new tests because there is no behavior change.
3163
3164         * platform/text/mac/TextBoundaries.mm:
3165         (WebCore::findNextWordFromIndex):
3166
3167 2016-08-02  Youenn Fablet  <youenn@apple.com>
3168
3169         Remove CachedResourceRequest initiatingDocumentLoader
3170         https://bugs.webkit.org/show_bug.cgi?id=160449
3171
3172         Reviewed by Alex Christensen.
3173
3174         No change of behavior.
3175
3176         * loader/DocumentLoader.cpp:
3177         (WebCore::DocumentLoader::startLoadingMainResource): Removing call to setInitiator.
3178         * loader/cache/CachedResourceRequest.cpp:
3179         (WebCore::CachedResourceRequest::setInitiator): Deleted.
3180         * loader/cache/CachedResourceRequest.h:
3181         (WebCore::CachedResourceRequest::initiatingDocumentLoader): Deleted.
3182
3183 2016-07-28  Frederic Wang  <fwang@igalia.com>
3184
3185         Move parsing of the form attribute to MathMLOperatorElement
3186         https://bugs.webkit.org/show_bug.cgi?id=160239
3187
3188         Reviewed by Darin Adler.
3189
3190         We move the parsing of the mo@form attribute to the MathMLOperatorElement class. Note that
3191         when the attribute is not explicit, the form may also be guessed by searching into the
3192         operator dictionary. Hence we also start moving the determination of the default dictionary
3193         properties. Moving the actual parsing of the corresponding attributes will be done in
3194         follow-up commits.
3195
3196         No new tests, already covered by existing tests.
3197
3198         * mathml/MathMLInlineContainerElement.cpp:
3199         (WebCore::MathMLInlineContainerElement::childrenChanged): Make the form of operators dirty
3200         if its siblings have changed.
3201         * mathml/MathMLOperatorDictionary.cpp:
3202         (WebCore::MathMLOperatorDictionary::search): Merge old getEntry functions into one helper
3203         function that returns an Optional<Entry>.
3204         (WebCore::MathMLOperatorDictionary::getEntry): Deleted
3205         * mathml/MathMLOperatorDictionary.h: Declare MathMLOperatorDictionary::find.
3206         * mathml/MathMLOperatorElement.cpp:
3207         (WebCore::MathMLOperatorElement::dictionaryProperty): We determine the operator form by
3208         parsing the corresponding attribute or by using heuristics if that attribute is not
3209         specified. We also read dictionary the corresponding dictionary properties.
3210         (WebCore::MathMLOperatorElement::flags): Return the flags read from the dictionary.
3211         (WebCore::MathMLOperatorElement::defaultLeadingSpace): Return the space read from the dictionary.
3212         (WebCore::MathMLOperatorElement::defaultTrailingSpace): Return the space read from the dictionary.
3213         (WebCore::MathMLOperatorElement::childrenChanged): Make the dictionary properties dirty.
3214         (WebCore::MathMLOperatorElement::parseAttribute): Make the dictionary properties dirty when
3215         the form changes.
3216         * mathml/MathMLOperatorElement.h: New member to store dictionary properties and expose them.
3217         * rendering/mathml/RenderMathMLFencedOperator.cpp:
3218         (WebCore::RenderMathMLFencedOperator::setOperatorProperties): We implement the case specific
3219         to anonymous mfenced operators here.
3220         * rendering/mathml/RenderMathMLFencedOperator.h: Move the m_operatorForm member here and
3221         declare the overriden function setOperatorProperties.
3222         * rendering/mathml/RenderMathMLOperator.cpp:
3223         (WebCore::RenderMathMLOperator::setOperatorProperties): Simplify this code since the logic
3224         has been moved to the element classes.
3225         (WebCore::RenderMathMLOperator::setOperatorPropertiesFromOpDictEntry): Deleted.
3226         * rendering/mathml/RenderMathMLOperator.h: Remove setOperatorPropertiesFromOpDictEntry, make
3227         members accessible to RenderMathMLFencedOperator and remove m_operatorForm.
3228
3229 2016-08-02  Frederic Wang  <fwang.igalia.com>
3230
3231         Use Optional members to store parsed MathML attributes.
3232         https://bugs.webkit.org/show_bug.cgi?id=160400
3233
3234         Reviewed by Darin Adler.
3235
3236         Parsed MathML attributes are stored on the element classes using the memoize pattern to
3237         minimize the number of parsing updates. Currently, a dirty flag for each member
3238         indicate when it must be parsed again. We change this to wrap these members into an
3239         Optional<T> container instead, where a null value indicates that the member is dirty.
3240
3241         No new tests, behavior is unchanged.
3242
3243         * mathml/MathMLElement.cpp:
3244         (WebCore::MathMLElement::cachedMathMLLength):
3245         (WebCore::MathMLElement::cachedBooleanAttribute):
3246         (WebCore::MathMLElement::parseMathVariantAttribute):
3247         (WebCore::MathMLElement::specifiedDisplayStyle):
3248         (WebCore::MathMLElement::specifiedMathVariant):
3249         * mathml/MathMLElement.h:
3250         * mathml/MathMLFractionElement.cpp:
3251         (WebCore::MathMLFractionElement::lineThickness):
3252         (WebCore::MathMLFractionElement::cachedFractionAlignment):
3253         (WebCore::MathMLFractionElement::parseAttribute):
3254         * mathml/MathMLFractionElement.h:
3255         * mathml/MathMLInlineContainerElement.cpp:
3256         (WebCore::MathMLInlineContainerElement::parseAttribute):
3257         * mathml/MathMLMathElement.cpp:
3258         (WebCore::MathMLMathElement::specifiedDisplayStyle):
3259         (WebCore::MathMLMathElement::parseAttribute):
3260         * mathml/MathMLOperatorElement.cpp:
3261         (WebCore::MathMLOperatorElement::operatorText):
3262         * mathml/MathMLPaddedElement.cpp:
3263         (WebCore::MathMLPaddedElement::parseAttribute):
3264         * mathml/MathMLPaddedElement.h:
3265         * mathml/MathMLScriptsElement.cpp:
3266         (WebCore::MathMLScriptsElement::parseAttribute):
3267         * mathml/MathMLScriptsElement.h:
3268         * mathml/MathMLSpaceElement.cpp:
3269         (WebCore::MathMLSpaceElement::parseAttribute):
3270         * mathml/MathMLSpaceElement.h:
3271         * mathml/MathMLTextElement.cpp:
3272         (WebCore::MathMLTextElement::parseAttribute):
3273         * mathml/MathMLUnderOverElement.cpp:
3274         (WebCore::MathMLUnderOverElement::parseAttribute):
3275         * mathml/MathMLUnderOverElement.h:
3276         * rendering/mathml/MathMLStyle.cpp:
3277         (WebCore::MathMLStyle::resolveMathMLStyle):
3278         * rendering/mathml/MathMLStyle.h:
3279         * rendering/mathml/RenderMathMLToken.cpp:
3280         (WebCore::mathVariant):
3281         (WebCore::RenderMathMLToken::updateMathVariantGlyph):
3282
3283 2016-08-02  Youenn Fablet  <youenn@apple.com>
3284
3285         [Fetch API] Fetch promises should not reject or resolve when ActiveDOMObjects are being stopped
3286         https://bugs.webkit.org/show_bug.cgi?id=160420
3287
3288         Reviewed by Alex Christensen.
3289
3290         Test: http/tests/fetch/fetch-in-worker-crash.html
3291
3292         Promises should not be rejected when FetchResponse/FetchRequest are stopped as ActiveDOMObject.
3293
3294         * Modules/fetch/FetchBody.h:
3295         (WebCore::FetchBody::cleanConsumePromise): Allowing to nullify the promise used to consume body.
3296         * Modules/fetch/FetchBodyOwner.cpp:
3297         (WebCore::FetchBodyOwner::stop): Nullifying the body consume promise if any.
3298         * Modules/fetch/FetchResponse.cpp:
3299         (WebCore::FetchResponse::BodyLoader::stop): Nullifying the fetch promise if any.
3300
3301 2016-08-02  Youenn Fablet  <youenn@apple.com>
3302
3303         [Fetch API] Add support to ReferrerPolicy
3304         https://bugs.webkit.org/show_bug.cgi?id=160404
3305
3306         Reviewed by Alex Christensen.
3307
3308         Tests: imported/w3c/web-platform-tests/fetch/api/basic/referrer-worker.html
3309                imported/w3c/web-platform-tests/fetch/api/basic/referrer.html
3310
3311         Refactored ThreadableLoader API to take more references.
3312
3313         Updated loading code in CachedResource to take into account referrer policy, that can be set by fetch API.
3314         To enable correct handling of OriginWhenCrossOrigin policy, the computation of the cross-origin status of a request is
3315         moved from ResourceLoader to CachedResource.
3316
3317         Referrer is passed to the loading code through HTTP headers.
3318         This was triggering preflighting for Workers request as WorkerThreadableLoader was setting the referrer.
3319         It is now done in DocumentThreadableLoader::loadRequest so that preflighting is done before setting the referrer.
3320         Note that this referrer setting is only a way to pass a specific referrer value to the loading code.
3321         CachedResource code will compute the actual referer value based on the referrer policy.
3322         It might be good in the future to have a different way of conveying this information to CachedResource, maybe
3323         through CachedResourceRequest.
3324
3325         * Modules/fetch/FetchLoader.cpp:
3326         (WebCore::FetchLoader::start): Refactoring of ThreadableLoader API.
3327         * Modules/fetch/FetchRequest.cpp:
3328         (WebCore::FetchRequest::internalRequest): Setting referrer if it has a specific value.
3329         * fileapi/FileReaderLoader.cpp:
3330         (WebCore::FileReaderLoader::start): Ractoring of ThreadableLoader API.
3331         * loader/CrossOriginPreflightChecker.cpp:
3332         (WebCore::CrossOriginPreflightChecker::startPreflight): Set referrer in the preflight request if any.
3333         (WebCore::CrossOriginPreflightChecker::doPreflight): Ditto.
3334         * loader/DocumentThreadableLoader.cpp:
3335         (WebCore::DocumentThreadableLoader::loadResourceSynchronously): Refactoring of ThreadableLoader API.
3336         (WebCore::DocumentThreadableLoader::create): Ditto.
3337         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Ditto.
3338         (WebCore::DocumentThreadableLoader::loadRequest): Ditto.
3339         * loader/DocumentThreadableLoader.h:
3340         (WebCore::DocumentThreadableLoader::referrer): Storing referrer in case one is defined.
3341         * loader/SubresourceLoader.cpp:
3342         (WebCore::SubresourceLoader::init): Removing of cross origin computation since it is done earlier in CachedResource.
3343         * loader/ThreadableLoader.cpp:
3344         (WebCore::ThreadableLoader::create): Refactoring of ThreadableLoader API.
3345         (WebCore::ThreadableLoader::loadResourceSynchronously): Ditto.
3346         * loader/ThreadableLoader.h:
3347         * loader/ThreadableLoaderClientWrapper.h:
3348         (WebCore::ThreadableLoaderClientWrapper::create): Ditto.
3349         (WebCore::ThreadableLoaderClientWrapper::ThreadableLoaderClientWrapper): Ditto.
3350         * loader/WorkerThreadableLoader.cpp:
3351         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader): Ditto.
3352         (WebCore::WorkerThreadableLoader::loadResourceSynchronously): Removing setting of referrer in header and passing
3353         it as a parameter.
3354         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Ditto.
3355         * loader/WorkerThreadableLoader.h:
3356         (WebCore::WorkerThreadableLoader::create): Refactoring of ThreadableLoader API.
3357         * loader/cache/CachedResource.cpp:
3358         (WebCore::addAdditionalRequestHeadersToRequest): Computation of referrer based on referrer policy.
3359         (WebCore::CachedResource::addAdditionalRequestHeaders): Ditto.
3360         (WebCore::CachedResource::load): Computation of cross origin status.
3361         (WebCore::CachedResource::varyHeaderValuesMatch):
3362         * loader/cache/CachedResource.h:
3363         (WebCore::CachedResource::options):
3364         * page/EventSource.cpp:
3365         (WebCore::EventSource::connect): Refactoring of ThreadableLoader API.
3366         * workers/WorkerScriptLoader.cpp:
3367         (WebCore::WorkerScriptLoader::loadSynchronously): Ditto.
3368         (WebCore::WorkerScriptLoader::loadAsynchronously): Ditto.
3369         * xml/XMLHttpRequest.cpp:
3370         (WebCore::XMLHttpRequest::createRequest): Ditto.
3371
3372 2016-08-02  Brady Eidson  <beidson@apple.com>
3373
3374         Refactor data passed along for a "GetRecord" request.
3375         https://bugs.webkit.org/show_bug.cgi?id=160352
3376
3377         Reviewed by Tim Horton.
3378
3379         No new tests (No behavior change).
3380
3381         Adding this new object lets us easily add new data passed along for GetRecord
3382         requests going forward.
3383
3384         * WebCore.xcodeproj/project.pbxproj:
3385         * CMakeLists.txt:
3386
3387         * Modules/indexeddb/IDBObjectStore.cpp:
3388         (WebCore::IDBObjectStore::get):
3389
3390         * Modules/indexeddb/IDBTransaction.cpp:
3391         (WebCore::IDBTransaction::requestGetRecord):
3392         (WebCore::IDBTransaction::requestIndexRecord):
3393         (WebCore::IDBTransaction::getRecordOnServer):
3394         * Modules/indexeddb/IDBTransaction.h:
3395
3396         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3397         (WebCore::IDBClient::IDBConnectionProxy::getRecord):
3398         * Modules/indexeddb/client/IDBConnectionProxy.h:
3399
3400         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3401         (WebCore::IDBClient::IDBConnectionToServer::getRecord):
3402         * Modules/indexeddb/client/IDBConnectionToServer.h:
3403         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
3404
3405         * Modules/indexeddb/server/IDBServer.cpp:
3406         (WebCore::IDBServer::IDBServer::getRecord):
3407         * Modules/indexeddb/server/IDBServer.h:
3408
3409         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3410         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
3411         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3412
3413         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3414         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
3415         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
3416
3417         * Modules/indexeddb/shared/IDBGetRecordData.cpp: Added.
3418         (WebCore::IDBGetRecordData::isolatedCopy):
3419         * Modules/indexeddb/shared/IDBGetRecordData.h: Added.
3420         (WebCore::IDBGetRecordData::encode):
3421         (WebCore::IDBGetRecordData::decode):
3422
3423         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
3424         (WebCore::InProcessIDBServer::getRecord):
3425         * Modules/indexeddb/shared/InProcessIDBServer.h:
3426
3427 2016-08-01  Youenn Fablet  <youenn@apple.com>
3428
3429         [Fetch API] Pass directly FetchRequest fetch options to ThreadableLoader
3430         https://bugs.webkit.org/show_bug.cgi?id=160407
3431
3432         Reviewed by Sam Weinig.
3433
3434