[Mac] media/pip-video-going-into-fullscreen.html is a flaky failure
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-08-02  Ada Chan  <adachan@apple.com>
2
3         [Mac] media/pip-video-going-into-fullscreen.html is a flaky failure
4         https://bugs.webkit.org/show_bug.cgi?id=160469
5
6         Reviewed by Eric Carlson.
7
8         When going from picture-in-picture directly to fullscreen, fix the issue where the
9         presentation mode unexpectedly changes back to inline after changing to fullscreen.
10
11         On Mac, standard fullscreen is not handled by WebVideoFullscreenManager.
12         When going from picture-in-picture directly to fullscreen, we call
13         WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode().
14         We should update m_mode to VideoFullscreenModeStandard there to keep it in sync
15         with the fullscreen mode in HTMLMediaElement. Otherwise, we'll inadvertently
16         update the mode to inline when we clear the VideoFullscreenModePictureInPicture mode
17         in -[WebVideoFullscreenInterfaceMacObjC pipDidClose:].
18
19         Since standard fullscreen on Mac doesn't make use of the video fullscreen layer,
20         we need to make sure we return the video layer back to inline when the presentation
21         mode changes to "fullscreen". We only do this on Mac because iOS does use
22         the video fullscreen layer for standard fullscreen.
23
24         * Modules/mediacontrols/MediaControlsHost.cpp:
25         (WebCore::MediaControlsHost::setPreparedToReturnVideoLayerToInline):
26         Renamed from MediaControlsHost::setPreparedForInline to make it clear this is about
27         whether the video layer should be inline.
28         (WebCore::MediaControlsHost::setPreparedForInline): Deleted.
29         * Modules/mediacontrols/MediaControlsHost.h:
30         * Modules/mediacontrols/MediaControlsHost.idl:
31
32         * Modules/mediacontrols/mediaControlsApple.js:
33         (Controller.prototype.shouldReturnVideoLayerToInline):
34         On Mac, the video layer is inline when the presentation mode is "inline" or "fullscreen".
35         (Controller.prototype.handlePresentationModeChange):
36         Call shouldReturnVideoLayerToInline() to determine whether the video layer should be inline.
37
38         * Modules/mediacontrols/mediaControlsiOS.js:
39         (ControllerIOS.prototype.shouldReturnVideoLayerToInline):
40         Override this method since on iOS, the video layer is only inline when the presentation
41         mode is "inline".
42
43         * html/HTMLMediaElement.cpp:
44         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
45         (WebCore::HTMLMediaElement::setPreparedToReturnVideoLayerToInline):
46         (WebCore::HTMLMediaElement::setPreparedForInline): Deleted.
47         * html/HTMLMediaElement.h:
48
49         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
50         (WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen):
51         Remove the assertion that the mode must be "picture-in-picture". I've run into this
52         assertion in layout tests. Since the EnterFullscreen message is sent in a dispatch_async
53         block in WebVideoFullscreenManager::didSetupFullscreen(), there's a chance that the
54         fullscreen mode tracked in WebVideoFullscreenInterfaceMac has already changed to
55         something else when WebVideoFullscreenInterfaceMac::enterFullscreen() is called.
56         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode):
57         If exiting to standard fullscreen, update m_mode to VideoFullscreenModeStandard.
58
59 2016-08-03  Youenn Fablet  <youenn@apple.com>
60
61         http/tests/fetch/fetch-in-worker-crash.html is sometimes crashing
62         https://bugs.webkit.org/show_bug.cgi?id=160498
63
64         Reviewed by Chris Dumez.
65
66         Covered by http/tests/fetch/fetch-in-worker-crash.html.
67
68         * loader/WorkerThreadableLoader.cpp:
69         (WebCore::WorkerThreadableLoader::MainThreadBridge::cancel): Taking a reference of the client wrapper to ensure it can be cleaned-up successfully.
70
71 2016-08-02  Anders Carlsson  <andersca@apple.com>
72
73         Freeze the last of the Objective-C bindings
74         https://bugs.webkit.org/show_bug.cgi?id=160482
75
76         Reviewed by Darin Adler.
77
78         * WebCore.xcodeproj/project.pbxproj:
79         * bindings/objc/DOMAttr.h: Added.
80         * bindings/objc/DOMAttr.mm: Added.
81         * bindings/objc/DOMAttrInternal.h: Added.
82         * bindings/objc/DOMCDATASection.h: Added.
83         * bindings/objc/DOMCDATASection.mm: Added.
84         * bindings/objc/DOMCDATASectionInternal.h: Added.
85         * bindings/objc/DOMCharacterData.h
86         * bindings/objc/DOMCharacterData.mm: Added.
87         * bindings/objc/DOMCharacterDataInternal.h: Added.
88         * bindings/objc/DOMComment.h: Added.
89         * bindings/objc/DOMComment.mm: Added.
90         * bindings/objc/DOMCommentInternal.h: Added.
91         * bindings/objc/DOMDOMImplementation.h: Added.
92         * bindings/objc/DOMDOMImplementation.mm: Added.
93         * bindings/objc/DOMDOMImplementationInternal.h: Added.
94         * bindings/objc/DOMDocument.h: Added.
95         * bindings/objc/DOMDocument.mm: Added.
96         * bindings/objc/DOMDocumentFragment.h: Added.
97         * bindings/objc/DOMDocumentFragment.mm: Added.
98         * bindings/objc/DOMDocumentFragmentInternal.h: Added.
99         * bindings/objc/DOMDocumentFragmentPrivate.h: Added.
100         * bindings/objc/DOMDocumentInternal.h: Added.
101         * bindings/objc/DOMDocumentPrivate.h: Added.
102         * bindings/objc/DOMDocumentType.h: Added.
103         * bindings/objc/DOMDocumentType.mm: Added.
104         * bindings/objc/DOMDocumentTypeInternal.h: Added.
105         * bindings/objc/DOMElement.h: Added.
106         * bindings/objc/DOMElement.mm: Added.
107         * bindings/objc/DOMElementInternal.h: Added.
108         * bindings/objc/DOMEntity.h: Added.
109         * bindings/objc/DOMEntity.mm: Added.
110         * bindings/objc/DOMEntityInternal.h: Added.
111         * bindings/objc/DOMEntityReference.h: Added.
112         * bindings/objc/DOMEntityReference.mm: Added.
113         * bindings/objc/DOMEntityReferenceInternal.h: Added.
114         * bindings/objc/DOMNamedNodeMap.h: Added.
115         * bindings/objc/DOMNamedNodeMap.mm: Added.
116         * bindings/objc/DOMNamedNodeMapInternal.h: Added.
117         * bindings/objc/DOMNode.h: Added.
118         * bindings/objc/DOMNode.mm: Added.
119         * bindings/objc/DOMNodeInternal.h: Added.
120         * bindings/objc/DOMNodeList.h: Added.
121         * bindings/objc/DOMNodeList.mm: Added.
122         * bindings/objc/DOMNodeListInternal.h: Added.
123         * bindings/objc/DOMNodePrivate.h: Added.
124         * bindings/objc/DOMProcessingInstruction.h: Added.
125         * bindings/objc/DOMProcessingInstruction.mm: Added.
126         * bindings/objc/DOMProcessingInstructionInternal.h: Added.
127         * bindings/objc/DOMText.h: Added.
128         * bindings/objc/DOMText.mm: Added.
129         * bindings/objc/DOMTextEvent.mm:
130         * bindings/objc/DOMTextEventInternal.h:
131         * bindings/objc/DOMTextInternal.h: Added.
132
133 2016-08-03  Eric Carlson  <eric.carlson@apple.com>
134
135         [Mac][iOS] Adopt MediaRemote "seek to playback position"
136         https://bugs.webkit.org/show_bug.cgi?id=160405
137         <rdar://problem/27547583>
138
139         Reviewed by Dean Jackson.
140
141         * platform/ios/RemoteCommandListenerIOS.mm:
142         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS): Fix a typo.
143
144 2016-08-02  Frederic Wang  <fwang@igalia.com>
145
146         Move determination of operator direction into DOM class and reduce relayout
147         https://bugs.webkit.org/show_bug.cgi?id=160339
148
149         Reviewed by Darin Adler.
150
151         We move the determination of operator direction into MathMLOperatorElement. We also simplify
152         a bit RenderMathMLFencedOperator so that the update of operator properties are done
153         immediately in updateOperatorContent and the resolution of to LayoutUnit is implemented
154         in leadingSpace, trailingSpace, minSize and maxSize. After that, setOperatorProperties is no
155         longer necessary and we can remove many calls that used to update operator properties and
156         force relayout.
157
158         No new tests, already covered by existing tests.
159
160         * mathml/MathMLInlineContainerElement.cpp:
161         (WebCore::MathMLInlineContainerElement::childrenChanged): No need to call updateOperatorProperties.
162         * mathml/MathMLOperatorElement.cpp: Change names from "text" to "char".
163         (WebCore::MathMLOperatorElement::parseOperatorChar): Parse character and isVertical in this function.
164         (WebCore::MathMLOperatorElement::operatorChar):
165         (WebCore::MathMLOperatorElement::childrenChanged):
166         (WebCore::MathMLOperatorElement::computeDictionaryProperty): Call operatorChar().character.
167         (WebCore::MathMLOperatorElement::parseOperatorText): Deleted.
168         (WebCore::MathMLOperatorElement::operatorText): Deleted.
169         * mathml/MathMLOperatorElement.h: Use a new structure to hold both the character and direction
170         and change names from "text" to "char".
171         * rendering/mathml/RenderMathMLFencedOperator.cpp:
172         (WebCore::RenderMathMLFencedOperator::updateOperatorContent): Update both the character and
173         direction using MathMLOperatorElement::parseOperatorChar. Then set the boolean properties
174         and leading/trailing space using the operator dictionary. minsize and maxsize are constant
175         so we do not need to set them any more.
176         (WebCore::RenderMathMLFencedOperator::leadingSpace): Resolve the spacing read from the
177         dictionary to LayoutUnit. Note that it can never be negative.
178         (WebCore::RenderMathMLFencedOperator::trailingSpace): Ditto.
179         (WebCore::RenderMathMLFencedOperator::RenderMathMLFencedOperator): Deleted.
180         (WebCore::RenderMathMLFencedOperator::setOperatorProperties): Deleted.
181         * rendering/mathml/RenderMathMLFencedOperator.h: We use the new OperatorChar structure for
182         accessors and members. We make minSize and maxSize just return the default values and delete
183         the corresponding members. Finally, leading and trailing space are now stored as unsigned
184         short in MathUnit.
185         * rendering/mathml/RenderMathMLOperator.cpp:
186         (WebCore::RenderMathMLOperator::textContent): Use the new OperatorChar structure.
187         (WebCore::RenderMathMLOperator::isVertical): Helper function forwarding to MathMLOperatorElement.
188         (WebCore::RenderMathMLOperator::stretchTo): Use isVertical() and remove setOperatorProperties().
189         (WebCore::RenderMathMLOperator::resetStretchSize): Ditto.
190         (WebCore::RenderMathMLOperator::updateMathOperator): Rename rebuildTokenContent as this is
191         now really only used to update MathOperator and hence replace the condition on
192         useMathOperator() with an ASSERT.
193         (WebCore::RenderMathMLOperator::updateTokenContent): Call updateMathOperator instead of
194         rebuildTokenContent.
195         (WebCore::RenderMathMLOperator::verticalStretchedOperatorShift): We use isVertical().
196         (WebCore::RenderMathMLOperator::paint): Ditto.
197         (WebCore::RenderMathMLOperator::setOperatorProperties): Deleted. This is no longer needed.
198         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Deleted.
199         (WebCore::RenderMathMLOperator::rebuildTokenContent): Deleted. Renamed updateMathOperator.
200         (WebCore::RenderMathMLOperator::styleDidChange): No need to call updateOperatorProperties.
201         (WebCore::RenderMathMLOperator::updateOperatorProperties): Ditto..
202         * rendering/mathml/RenderMathMLOperator.h: Update some declaration and remove m_isVertical.
203         (WebCore::RenderMathMLOperator::isVertical): Deleted.
204         * rendering/mathml/RenderMathMLRow.cpp:
205         (WebCore::RenderMathMLRow::updateOperatorProperties): Deleted. This is no longer needed.
206         * rendering/mathml/RenderMathMLRow.h: Ditto.
207
208 2016-08-02  Chris Dumez  <cdumez@apple.com>
209
210         Drop custom bindings code for HTMLSelectElement.remove()
211         https://bugs.webkit.org/show_bug.cgi?id=160477
212
213         Reviewed by Darin Adler.
214
215         Drop custom bindings code for HTMLSelectElement.remove() and use
216         overloading instead.
217
218         * bindings/js/JSHTMLSelectElementCustom.cpp:
219         (WebCore::JSHTMLSelectElement::remove): Deleted.
220         * html/HTMLSelectElement.idl:
221
222 2016-08-02  Chris Dumez  <cdumez@apple.com>
223
224         Drop custom bindings code for HTMLOptionsCollection.remove()
225         https://bugs.webkit.org/show_bug.cgi?id=160475
226
227         Reviewed by Darin Adler.
228
229         Drop custom bindings code for HTMLOptionsCollection.remove() and use
230         overloading instead. The overload that take an HTMLOptionElement is
231         WebKit-specific and should probably be dropped at some point:
232         - https://html.spec.whatwg.org/multipage/infrastructure.html#htmloptionscollection
233
234         This patch also fixes several bugs:
235         - The parameter is now mandatory. This is consistent with the
236           specification, Firefox and Chrome.
237         - HTMLOptionsCollection.prototype.remove.length is now 1 instead of 0.
238
239         No new tests, rebaselined existing tests.
240
241         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
242         (WebCore::JSHTMLOptionsCollection::remove): Deleted.
243         * html/HTMLOptionsCollection.idl:
244
245 2016-08-02  Nan Wang  <n_wang@apple.com>
246
247         AX: Simulated touch events are not working on iOS
248         https://bugs.webkit.org/show_bug.cgi?id=160395
249         <rdar://problem/27633597>
250
251         Reviewed by Chris Fleizach.
252
253         We should mark the simulated touch as a potential tap otherwise it won't
254         be handled on iOS. Also, we need to dispatch both touch start and touch end
255         to mimic the real touch events. Last, added a has event listeners check,
256         because iOS is dispatching mouse click events for elements without touch event
257         listeners.
258
259         Test: accessibility/ios-simulator/press-fires-touch-events.html
260
261         * accessibility/AccessibilityObject.cpp:
262         (WebCore::AccessibilityObject::press):
263         (WebCore::AccessibilityObject::dispatchTouchEvent):
264         * page/ios/EventHandlerIOS.mm:
265         (WebCore::EventHandler::dispatchSimulatedTouchEvent):
266         * platform/ios/PlatformEventFactoryIOS.mm:
267         (WebCore::PlatformTouchEventBuilder::PlatformTouchEventBuilder):
268
269 2016-08-02  Benjamin Poulain  <bpoulain@apple.com>
270
271         Clean up some useless AtomicString atoms
272         https://bugs.webkit.org/show_bug.cgi?id=160471
273
274         Reviewed by Geoffrey Garen.
275
276         The only uses of "commentAtom" and "textAtom" where for their
277         respective overload of Node::nodeName().
278         Those methods return a string, we should not keep them in the atomic
279         string table just to hold a small String alive. They were also the only
280         two nodes to behave that way.
281
282         The atom xlinkAtom was only used by createForeignAttributesMap(), which
283         is itself only invoked once. There is no need for the symbol xlinkAtom.
284
285         * dom/CDATASection.cpp:
286         (WebCore::CDATASection::nodeName):
287         * dom/Comment.cpp:
288         (WebCore::Comment::nodeName):
289         * dom/Document.cpp:
290         (WebCore::Document::nodeName):
291         * dom/Text.cpp:
292         (WebCore::Text::nodeName):
293         * html/parser/HTMLTreeBuilder.cpp:
294         (WebCore::createForeignAttributesMap):
295
296 2016-08-02  Anders Carlsson  <andersca@apple.com>
297
298         Freeze the Objective-C DOM Event and CSS bindings
299         https://bugs.webkit.org/show_bug.cgi?id=160476
300
301         Reviewed by Tim Horton.
302
303         * DerivedSources.make:
304         * WebCore.xcodeproj/project.pbxproj:
305         * bindings/objc/DOMCSSCharsetRule.h: Added.
306         * bindings/objc/DOMCSSCharsetRule.mm: Added.
307         * bindings/objc/DOMCSSCharsetRuleInternal.h: Added.
308         * bindings/objc/DOMCSSFontFaceRule.h: Added.
309         * bindings/objc/DOMCSSFontFaceRule.mm: Added.
310         * bindings/objc/DOMCSSFontFaceRuleInternal.h: Added.
311         * bindings/objc/DOMCSSImportRule.h: Added.
312         * bindings/objc/DOMCSSImportRule.mm: Added.
313         * bindings/objc/DOMCSSImportRuleInternal.h: Added.
314         * bindings/objc/DOMCSSMediaRule.h: Added.
315         * bindings/objc/DOMCSSMediaRule.mm: Added.
316         * bindings/objc/DOMCSSMediaRuleInternal.h: Added.
317         * bindings/objc/DOMCSSPageRule.h: Added.
318         * bindings/objc/DOMCSSPageRule.mm: Added.
319         * bindings/objc/DOMCSSPageRuleInternal.h: Added.
320         * bindings/objc/DOMCSSPrimitiveValue.h: Added.
321         * bindings/objc/DOMCSSPrimitiveValue.mm: Added.
322         * bindings/objc/DOMCSSPrimitiveValueInternal.h: Added.
323         * bindings/objc/DOMCSSRule.h: Added.
324         * bindings/objc/DOMCSSRule.mm: Added.
325         * bindings/objc/DOMCSSRuleInternal.h: Added.
326         * bindings/objc/DOMCSSRuleList.h: Added.
327         * bindings/objc/DOMCSSRuleList.mm: Added.
328         * bindings/objc/DOMCSSRuleListInternal.h: Added.
329         * bindings/objc/DOMCSSStyleDeclaration.h: Added.
330         * bindings/objc/DOMCSSStyleDeclaration.mm: Added.
331         * bindings/objc/DOMCSSStyleDeclarationInternal.h: Added.
332         * bindings/objc/DOMCSSStyleRule.h: Added.
333         * bindings/objc/DOMCSSStyleRule.mm: Added.
334         * bindings/objc/DOMCSSStyleRuleInternal.h: Added.
335         * bindings/objc/DOMCSSStyleSheet.h: Added.
336         * bindings/objc/DOMCSSStyleSheet.mm: Added.
337         * bindings/objc/DOMCSSStyleSheetInternal.h: Added.
338         * bindings/objc/DOMCSSUnknownRule.h: Added.
339         * bindings/objc/DOMCSSUnknownRule.mm: Added.
340         * bindings/objc/DOMCSSUnknownRuleInternal.h: Added.
341         * bindings/objc/DOMCSSValue.h: Added.
342         * bindings/objc/DOMCSSValue.mm: Added.
343         * bindings/objc/DOMCSSValueInternal.h: Added.
344         * bindings/objc/DOMCSSValueList.h: Added.
345         * bindings/objc/DOMCSSValueList.mm: Added.
346         * bindings/objc/DOMCSSValueListInternal.h: Added.
347         * bindings/objc/DOMCounter.h: Added.
348         * bindings/objc/DOMCounter.mm: Added.
349         * bindings/objc/DOMCounterInternal.h: Added.
350         * bindings/objc/DOMEvent.h: Added.
351         * bindings/objc/DOMEvent.mm: Added.
352         * bindings/objc/DOMEventInternal.h: Added.
353         * bindings/objc/DOMEventListener.h: Added.
354         * bindings/objc/DOMEventTarget.h: Added.
355         * bindings/objc/DOMKeyboardEvent.h: Added.
356         * bindings/objc/DOMKeyboardEvent.mm: Added.
357         * bindings/objc/DOMKeyboardEventInternal.h: Added.
358         * bindings/objc/DOMMouseEvent.h: Added.
359         * bindings/objc/DOMMouseEvent.mm: Added.
360         * bindings/objc/DOMMouseEventInternal.h: Added.
361         * bindings/objc/DOMMutationEvent.h: Added.
362         * bindings/objc/DOMMutationEvent.mm: Added.
363         * bindings/objc/DOMMutationEventInternal.h: Added.
364         * bindings/objc/DOMOverflowEvent.h: Added.
365         * bindings/objc/DOMOverflowEvent.mm: Added.
366         * bindings/objc/DOMOverflowEventInternal.h: Added.
367         * bindings/objc/DOMProgressEvent.h: Added.
368         * bindings/objc/DOMProgressEvent.mm: Added.
369         * bindings/objc/DOMProgressEventInternal.h: Added.
370         * bindings/objc/DOMRGBColor.h: Added.
371         * bindings/objc/DOMRGBColor.mm: Added.
372         * bindings/objc/DOMRGBColorInternal.h: Added.
373         * bindings/objc/DOMRect.h: Added.
374         * bindings/objc/DOMRect.mm: Added.
375         * bindings/objc/DOMRectInternal.h: Added.
376         * bindings/objc/DOMTextEvent.h: Added.
377         * bindings/objc/DOMTextEvent.mm: Added.
378         (-[DOMTextEvent data]):
379         (-[DOMTextEvent initTextEvent:canBubbleArg:cancelableArg:viewArg:dataArg:]):
380         * bindings/objc/DOMTextEventInternal.h: Added.
381         * bindings/objc/DOMUIEvent.h: Added.
382         * bindings/objc/DOMUIEvent.mm: Added.
383         * bindings/objc/DOMUIEventInternal.h: Added.
384         * bindings/objc/DOMWheelEvent.h: Added.
385         * bindings/objc/DOMWheelEvent.mm: Added.
386         * bindings/objc/DOMWheelEventInternal.h: Added.
387
388 2016-08-02  Enrica Casucci  <enrica@apple.com>
389
390         Allow building with content filtering disabled.
391         https://bugs.webkit.org/show_bug.cgi?id=160454
392
393         Reviewed by Simon Fraser.
394
395         * Configurations/FeatureDefines.xcconfig:
396         * platform/PlatformContentFilter.h:
397         (WebCore::PlatformContentFilter::unblockRequestDeniedScript):
398         * platform/cocoa/NetworkExtensionContentFilter.h:
399         * platform/cocoa/NetworkExtensionContentFilter.mm:
400         (WebCore::NetworkExtensionContentFilter::unblockHandler):
401         * platform/cocoa/ParentalControlsContentFilter.h:
402         * testing/MockContentFilter.h:
403
404 2016-08-02  Dean Jackson  <dino@apple.com>
405
406         Reapply fixes for webkit.org/b/159450 and webkit.org/b/157569
407         https://bugs.webkit.org/show_bug.cgi?id=160474
408         <rdar://problem/27668170>
409
410         Reviewed by Simon Fraser.
411
412         The fixes are behaviour we want. They just caused a regression
413         on medium.com (reverted in http://trac.webkit.org/r203380).
414
415         Now that we've branched, revert the reversion (which itself
416         was a reversion), so we can fix the actual bug:
417         https://bugs.webkit.org/show_bug.cgi?id=160478
418
419         * css/CSSParser.cpp:
420         (WebCore::CSSParser::parseValue):
421         (WebCore::CSSParser::parseAnimationShorthand):
422         (WebCore::CSSParser::addPropertyWithPrefixingVariant):
423         (WebCore::CSSParser::parseTransitionShorthand):
424         * css/CSSPropertyNames.in:
425         * css/PropertySetCSSStyleDeclaration.cpp:
426         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
427         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
428         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
429         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
430         * css/StyleProperties.cpp:
431         (WebCore::MutableStyleProperties::removeShorthandProperty):
432         (WebCore::StyleProperties::asText):
433         (WebCore::MutableStyleProperties::removeProperty): Deleted.
434         (WebCore::MutableStyleProperties::removePrefixedOrUnprefixedProperty): Deleted.
435         (WebCore::MutableStyleProperties::setProperty): Deleted.
436         (WebCore::getIndexInShorthandVectorForPrefixingVariant): Deleted.
437         (WebCore::MutableStyleProperties::appendPrefixingVariantProperty): Deleted.
438         (WebCore::MutableStyleProperties::setPrefixingVariantProperty): Deleted.
439         * css/StyleProperties.h:
440
441 2016-08-02  Eric Carlson  <eric.carlson@apple.com>
442
443         Cleanup HTMLMediaElement track lists.
444         https://bugs.webkit.org/show_bug.cgi?id=160470
445
446         Reviewed by David Kilzer.
447
448         Test: media/range-extract-contents-crash.html
449
450         * html/HTMLMediaElement.cpp:
451         (WebCore::HTMLMediaElement::~HTMLMediaElement): 
452
453         * html/track/AudioTrack.cpp:
454         (WebCore::AudioTrack::willRemove): ASSERT if media element is NULL.
455
456         * html/track/TextTrackList.cpp:
457         (TextTrackList::clearElement): Clear track media element pointers and client.
458         * html/track/TextTrackList.h:
459
460         * html/track/TrackListBase.cpp:
461         (TrackListBase::~TrackListBase): Call clearElement.
462         (TrackListBase::clearElement): Clear track media element pointers and client.
463         * html/track/TrackListBase.h:
464
465 2016-08-02  Anders Carlsson  <andersca@apple.com>
466
467         Remove more Objective-C bindings that are not used
468         https://bugs.webkit.org/show_bug.cgi?id=160473
469
470         Reviewed by Sam Weinig.
471
472         * DerivedSources.make:
473         * WebCore.xcodeproj/project.pbxproj:
474         * bindings/objc/DOMCSS.mm:
475         (kitClass):
476         * dom/Document.idl:
477
478 2016-08-02  Chris Dumez  <cdumez@apple.com>
479
480         Drop custom bindings for FormData.append()
481         https://bugs.webkit.org/show_bug.cgi?id=160466
482
483         Reviewed by Sam Weinig.
484
485         Drop custom bindings for FormData.append(). We no longer need them now
486         that we have proper support for overloads after r204028.
487
488         This patch also fixes the fact that FormData.prototype.append.length
489         was 0 instead of 2.
490
491         No new tests, rebaselined existing test.
492
493         * bindings/js/JSDOMFormDataCustom.cpp:
494         (WebCore::JSDOMFormData::append): Deleted.
495         * html/DOMFormData.cpp:
496         (WebCore::DOMFormData::append):
497         * html/DOMFormData.h:
498         * html/DOMFormData.idl:
499         * html/FileInputType.cpp:
500         (WebCore::FileInputType::appendFormData):
501         * html/FormDataList.cpp:
502         (WebCore::FormDataList::appendBlob):
503         * html/FormDataList.h:
504         (WebCore::FormDataList::Item::Item):
505         (WebCore::FormDataList::appendBlob):
506
507 2016-08-02  Commit Queue  <commit-queue@webkit.org>
508
509         Unreviewed, rolling out r203799.
510         https://bugs.webkit.org/show_bug.cgi?id=160467
511
512         Decided on a different solution (Requested by jonlee_ on
513         #webkit).
514
515         Reverted changeset:
516
517         "Captions do not render in PiP window when element is hidden"
518         https://bugs.webkit.org/show_bug.cgi?id=160265
519         http://trac.webkit.org/changeset/203799
520
521 2016-08-02  Alex Christensen  <achristensen@webkit.org>
522
523         Remove unused functions in URL
524         https://bugs.webkit.org/show_bug.cgi?id=160468
525
526         Reviewed by Geoffrey Garen.
527
528         * page/SecurityOrigin.cpp:
529         (WebCore::SecurityOrigin::extractInnerURL):
530         * platform/URL.cpp:
531         (WebCore::mimeTypeFromURL):
532         (WebCore::URL::stringCenterEllipsizedToLength):
533         (WebCore::URL::isSafeToSendToAnotherThread): Deleted.
534         * platform/URL.h:
535         (WebCore::URL::operator NSString*):
536         (WebCore::URL::innerURL): Deleted.
537
538 2016-08-02  Chris Dumez  <cdumez@apple.com>
539
540         Named / Indexed properties should be configurable
541         https://bugs.webkit.org/show_bug.cgi?id=160457
542
543         Reviewed by Darin Adler.
544
545         Report Named / Indexed properties as being configurable to comply with
546         the Web IDL specification:
547         - http://heycam.github.io/webidl/#getownproperty-guts (step 1. and 2.)
548
549         Firefox and Chrome also report them as being configurable.
550
551         No new tests, rebaselined existing tests.
552
553         * bindings/scripts/CodeGeneratorJS.pm:
554         (GenerateGetOwnPropertySlotBody):
555
556 2016-08-02  Anders Carlsson  <andersca@apple.com>
557
558         Remove more unused/uninstalled Objective-C DOM bindings
559         https://bugs.webkit.org/show_bug.cgi?id=160464
560
561         Reviewed by Darin Adler.
562
563         * Configurations/WebCore.xcconfig:
564         * DerivedSources.make:
565         * WebCore.xcodeproj/project.pbxproj:
566         * bindings/objc/DOMCSS.mm:
567         (kitClass):
568         * bindings/objc/DOMEvents.h:
569         * bindings/objc/DOMEvents.mm:
570         (kitClass): Deleted.
571         * dom/Document.idl:
572
573 2016-08-02  Chris Dumez  <cdumez@apple.com>
574
575         [WebIDL] Extend new overload resolution algorithm support to constructors
576         https://bugs.webkit.org/show_bug.cgi?id=160455
577
578         Reviewed by Ryosuke Niwa.
579
580         Extend new overload resolution algorithm support (added in r204028) to
581         constructors as well. It was only used for operations. Remove code that
582         is now dead from the bindings generator.
583
584         We now share the same code of generating the overload resolution code
585         for operations and constructors.
586
587         No new tests, rebaselined existing tests.
588
589         * bindings/scripts/CodeGenerator.pm:
590         (LinkOverloadedFunctions):
591         * bindings/scripts/CodeGeneratorJS.pm:
592         (GenerateOverloadedFunctionOrConstructor):
593         (GenerateImplementation):
594         (GenerateConstructorDefinitions):
595         (GenerateConstructorDefinition):
596         (GetFunctionLength): Deleted.
597         (LengthOfLongestFunctionParameterList): Deleted.
598         (GetNativeTypeForConversions): Deleted.
599         (GetGnuVTableNameForInterface): Deleted.
600         (GetGnuMangledNameForInterface): Deleted.
601         (GetGnuVTableOffsetForType): Deleted.
602         (GenerateConstructorHelperMethods): Deleted.
603         * bindings/scripts/IDLParser.pm:
604         (applyExtendedAttributeList): Deleted.
605         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
606         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
607         * bindings/scripts/test/TestOverloadedConstructors.idl:
608
609 2016-08-02  Brady Eidson  <beidson@apple.com>
610
611         Removing IndexedDB WebsiteData can fail for some users.
612         https://bugs.webkit.org/show_bug.cgi?id=160463
613
614         Reviewed by Alex Christensen.
615
616         Covered by changes to API test IndexedDB.StoreBlobThenDelete.
617
618         For a few months in trunk WebKit, deleting an IndexedDB using WebsiteDataStore API would only
619         delete the "IndexedDB.sqlite3" file, but would leave the "-wal" and "-shm" files behind.
620         
621         We'd then fail to delete the directory itself, tricking API clients to think there are still
622         databases in the given origin.
623         
624         Furthermore, the code to delete a database first checks for the existence of "IndexedDB.sqlite3"
625         then refuses to do any further cleanup if it doesn't exist.
626         
627         We should just always run the entire delete procedure even if IndexedDB.sqlite does not exist.
628         
629         * Modules/indexeddb/server/IDBServer.cpp:
630         (WebCore::IDBServer::removeAllDatabasesForOriginPath):
631
632         * platform/sql/SQLiteFileSystem.cpp:
633         (WebCore::SQLiteFileSystem::deleteDatabaseFile):
634
635 2016-08-02  Alex Christensen  <achristensen@webkit.org>
636
637         Fix Mac CMake build.
638
639         * PlatformMac.cmake:
640         Some ObjC bindings have been frozen.
641
642 2016-08-02  Frederic Wang  <fwang@igalia.com>
643
644         More cleanup of MathML operator parsing
645         https://bugs.webkit.org/show_bug.cgi?id=160336
646
647         Reviewed by Darin Adler.
648
649         No new tests, behavior is unchanged.
650
651         * rendering/mathml/RenderMathMLBlock.cpp:
652         (WebCore::parseMathMLLength): Deleted. This function is no longer used.
653         * rendering/mathml/RenderMathMLBlock.h: Ditto.
654         * rendering/mathml/RenderMathMLFencedOperator.h: Move some length members from
655         RenderMathMLOperator and override the accessors. Also override useMathOperator() since it is
656         always true for anonymous mfenced operators.
657         * rendering/mathml/RenderMathMLOperator.cpp:
658         (WebCore::RenderMathMLOperator::textContent): No need to ASSERT !isAnonymous since this
659         function is overriden by RenderMathMLFencedOperator.
660         (WebCore::RenderMathMLOperator::isInvisibleOperator): Use a temporary variable to call
661         textContent only once.
662         (WebCore::RenderMathMLOperator::leadingSpace): Helper function to determine the leading space.
663         (WebCore::RenderMathMLOperator::trailingSpace): Helper function to determine the trailing space.
664         (WebCore::RenderMathMLOperator::minSize): Helper function to determine the min space.
665         (WebCore::RenderMathMLOperator::maxSize): Helper function to determine the max space.
666         (WebCore::RenderMathMLOperator::setOperatorProperties): This is now only used to set m_isVertical.
667         (WebCore::RenderMathMLOperator::stretchTo): Call maxSize and minSize when necessary.
668         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Call leadingSpace and trailingSpace.
669         (WebCore::RenderMathMLOperator::layoutBlock): Ditto.
670         (WebCore::RenderMathMLOperator::useMathOperator): Remove the case for anonymous operators as
671         this is now handled in the derived class.
672         (WebCore::RenderMathMLOperator::paint): Call leadingSpace.
673         * rendering/mathml/RenderMathMLOperator.h: Remove length members and declare helper functions
674         to get these lengths from MathMLOperatorElement.
675         (WebCore::RenderMathMLOperator::setLeadingSpace): Deleted. This is no longer used.
676         (WebCore::RenderMathMLOperator::setTrailingSpace): Deleted. This is no longer used.
677
678 2016-08-02  Frederic Wang  <fwang@igalia.com>
679
680         Move parsing of operator length attributes to MathMLOperatorElement
681         https://bugs.webkit.org/show_bug.cgi?id=160301
682
683         Reviewed by Darin Adler.
684
685         We move parsing of operator attributes lspace, rspace minsize, maxsize into the class
686         MathMLOperatorElement. We rely on the existing MathMLElement::Length structure and expand
687         it to handle the "infinity" case of maxsize that we always resolve as intMaxForLayoutUnit.
688         We also improve the resolution of a negative value for minsize and maxsize since the MathML
689         recommendation says it should be rounded up to the nearest valid value (which is zero)
690         instead of ignoring the attribute and using the default value. This is similar to r203285
691         for mfrac@linethickness. We also update the existing test for minsize/maxsize to take into
692         account that change.
693
694         No new tests, already covered by existing tests.
695
696         * mathml/MathMLElement.h: Add an "Infinity" type for MathML Length.
697         * mathml/MathMLOperatorElement.cpp:
698         (WebCore::MathMLOperatorElement::leadingSpace): Helper function to retrieve the cached value
699         for the lspace attribute, parse it if necessary.
700         (WebCore::MathMLOperatorElement::trailingSpace): Ditto for rspace.
701         (WebCore::MathMLOperatorElement::minSize): Ditto for minsize.
702         (WebCore::MathMLOperatorElement::maxSize): Ditto for maxsize. This attribute also accepts the
703         "infinity" value.
704         (WebCore::MathMLOperatorElement::parseAttribute): Mark attributes dirty.
705         * mathml/MathMLOperatorElement.h: Declare Length members and accessors.
706         * rendering/mathml/RenderMathMLBlock.cpp:
707         (WebCore::toUserUnits): Resolve Infinity as intMaxForLayoutUnit.
708         * rendering/mathml/RenderMathMLOperator.cpp:
709         (WebCore::RenderMathMLOperator::setOperatorProperties): We use toUserUnits to resolve the
710         lengths. Negative maxsize and minsize values now fallback to 0 instead of their default
711         values. We also remove the !isAnonymous() check since setOperatorProperties is overriden
712         in the RenderMathMLFencedOperator class.
713
714 2016-08-02  Frederic Wang  <fred.wang@free.fr>
715
716         Unreviewed build error fix.
717
718         * mathml/MathMLOperatorElement.cpp:
719         (WebCore::propertyFlagToAttributeName): Return a nullQName to avoid warnings on some platforms.
720
721 2016-08-02  Anders Carlsson  <andersca@apple.com>
722
723         Stop building Objective-C bindings that aren't exposed anywhere
724         https://bugs.webkit.org/show_bug.cgi?id=160458
725
726         Reviewed by Darin Adler.
727
728         * DerivedSources.make:
729         * WebCore.xcodeproj/project.pbxproj:
730
731 2016-08-02  Chris Dumez  <cdumez@apple.com>
732
733         HTMLCollection's named getter should only do 'name' attribute matching for HTMLElements
734         https://bugs.webkit.org/show_bug.cgi?id=160456
735
736         Reviewed by Darin Adler.
737
738         HTMLCollection's named getter should only do 'name' attribute matching for HTMLElements:
739         - https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem
740
741         Our slow path which relies on HTMLCollection::updateNamedElementCache() does the right
742         thing. However, we have a fast path in 
743         CachedHTMLCollection<HTMLCollectionClass, traversalType>::namedItem() that was missing a
744         check.
745
746         Firefox and Chrome both behave correctly here.
747
748         No new tests, rebaselined existing tests.
749
750         * html/CachedHTMLCollection.h:
751         (WebCore::traversalType>::namedItem):
752
753 2016-08-02  Chris Dumez  <cdumez@apple.com>
754
755         Kill [StrictTypeChecking] IDL extended attribute
756         https://bugs.webkit.org/show_bug.cgi?id=160382
757
758         Reviewed by Darin Adler.
759
760         Kill [StrictTypeChecking] IDL extended attribute. Its only remaining
761         use was on DOMString parameters for a few CanvasRenderingContext2D
762         operations in order to work around a bug in our overload resolution.
763
764         However, as of r204028, we implement the Web IDL overload resolution
765         algorithm and [StrictTypeChecking] is now a no-op and is no longer
766         needed.
767
768         * bindings/scripts/CodeGeneratorJS.pm:
769         (GenerateParametersCheckExpression):
770         * bindings/scripts/IDLAttributes.txt:
771         * bindings/scripts/test/TestObj.idl:
772         * bindings/scripts/test/TestTypedefs.idl:
773         * html/canvas/CanvasRenderingContext2D.idl:
774
775 2016-08-02  Frederic Wang  <fwang@igalia.com>
776
777         Move parsing of boolean operator properties into MathMLOperatorElement
778         https://bugs.webkit.org/show_bug.cgi?id=160190
779
780         Reviewed by Darin Adler.
781
782         No new tests, already covered by existing tests.
783
784         * mathml/MathMLOperatorDictionary.h: Add a bit mask with all the property flags set.
785         * mathml/MathMLOperatorElement.cpp:
786         (WebCore::attributeNameToPropertyFlag): helper function to map from attribute name to flag.
787         (WebCore::MathMLOperatorElement::computeOperatorFlag): Helper function to update one
788         bit of m_properties.flags from the corresponding boolean attribute. The default value is
789         taken from the operator dictionary data stored in m_dictionaryProperty.flags.
790         (WebCore::MathMLOperatorElement::hasProperty): Returns whether the operator has a property,
791         parsing it again if the corresponding attribute is dirty.
792         (WebCore::MathMLOperatorElement::childrenChanged): Make all properties dirty.
793         (WebCore::propertyFlagToAttributeName): helper function to map from flag to attribute name.
794         (WebCore::MathMLOperatorElement::parseAttribute): Make all properties dirty if the form
795         attribute changed. Make each property dirty when the corresponding attribute changed.
796         (WebCore::MathMLOperatorElement::flags): Deleted. Replaced with the finer hasProperty function.
797         * mathml/MathMLOperatorElement.h: Define new structure, member and functions to handle
798         operator properties.
799         * rendering/mathml/RenderMathMLFencedOperator.cpp:
800         (WebCore::RenderMathMLFencedOperator::RenderMathMLFencedOperator): Move m_operatorFlags from
801         the base class to the derived class.
802         * rendering/mathml/RenderMathMLFencedOperator.h: Ditto.
803         * rendering/mathml/RenderMathMLOperator.cpp:
804         (WebCore::RenderMathMLOperator::RenderMathMLOperator): Ditto.
805         (WebCore::RenderMathMLOperator::hasOperatorFlag): Just call hasOperatorFlag from the
806         MathMLOperatorElement class.
807         (WebCore::RenderMathMLOperator::setOperatorProperties): We do not initialize m_operatorFlags
808         since it has been removed from the base class. We also do not parse attributes since this
809         has been moved to the MathMLOperatorElement class.
810         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute): Deleted.
811         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttributeValue): Deleted.
812         * rendering/mathml/RenderMathMLOperator.h: Move m_operatorFlags from the base class to the
813         derived class, remove some parsing helper functions and update hasOperatorFlag to make it
814         overridable.
815
816 2016-08-01  Anders Carlsson  <andersca@apple.com>
817
818         Freeze another bunch of Objective-C binding files
819         https://bugs.webkit.org/show_bug.cgi?id=160435
820
821         Reviewed by Alex Christensen.
822
823         * DerivedSources.make:
824         * WebCore.xcodeproj/project.pbxproj:
825         * bindings/objc/DOMAbstractView.h: Added.
826         * bindings/objc/DOMAbstractView.mm:
827         * bindings/objc/DOMAbstractViewInternal.h: Added.
828         * bindings/objc/DOMMediaList.h: Added.
829         * bindings/objc/DOMMediaList.mm: Added.
830         * bindings/objc/DOMMediaListInternal.h: Added.
831         * bindings/objc/DOMNodeFilter.h: Added.
832         * bindings/objc/DOMNodeIterator.h: Added.
833         * bindings/objc/DOMNodeIterator.mm: Added.
834         * bindings/objc/DOMNodeIteratorInternal.h: Added.
835         * bindings/objc/DOMRange.h: Added.
836         * bindings/objc/DOMRange.mm: Added.
837         * bindings/objc/DOMRangeInternal.h: Added.
838         * bindings/objc/DOMStyleSheet.h: Added.
839         * bindings/objc/DOMStyleSheet.mm: Added.
840         * bindings/objc/DOMStyleSheetInternal.h: Added.
841         * bindings/objc/DOMStyleSheetList.h: Added.
842         * bindings/objc/DOMStyleSheetList.mm: Added.
843         * bindings/objc/DOMStyleSheetListInternal.h: Added.
844         * bindings/objc/DOMTreeWalker.h: Added.
845         * bindings/objc/DOMTreeWalker.mm: Added.
846         * bindings/objc/DOMTreeWalkerInternal.h: Added.
847         * bindings/objc/DOMXPathExpression.h: Added.
848         * bindings/objc/DOMXPathExpression.mm: Added.
849         * bindings/objc/DOMXPathExpressionInternal.h: Added.
850         * bindings/objc/DOMXPathNSResolver.h: Added.
851         * bindings/objc/DOMXPathResult.h: Added.
852         * bindings/objc/DOMXPathResult.mm: Added.
853         * bindings/objc/DOMXPathResultInternal.h: Added.
854
855 2016-08-02  Frederic Wang  <fwang@igalia.com>
856
857         [MathML] Use more auto for local variables
858         https://bugs.webkit.org/show_bug.cgi?id=160453
859
860         Reviewed by Darin Adler.
861
862         No new tests, behavior is unchanged.
863
864         * mathml/MathMLElement.cpp:
865         (WebCore::MathMLElement::colSpan):
866         (WebCore::MathMLElement::rowSpan):
867         (WebCore::MathMLElement::childShouldCreateRenderer):
868         (WebCore::MathMLElement::defaultEventHandler):
869         * mathml/MathMLSelectElement.cpp:
870         (WebCore::MathMLSelectElement::getSelectedActionChild):
871         (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
872         * rendering/mathml/RenderMathMLFenced.cpp:
873         (WebCore::RenderMathMLFenced::updateFromElement):
874
875 2016-08-02  Ryan Haddad  <ryanhaddad@apple.com>
876
877         Attempt to fix build after r204014.
878
879         Unreviewed build fix.
880
881         * loader/mac/ResourceLoaderMac.mm:
882         (WebCore::ResourceLoader::willCacheResponse):
883
884 2016-08-02  Chris Dumez  <cdumez@apple.com>
885
886         [WebIDL] Implement overload resolution algorithm
887         https://bugs.webkit.org/show_bug.cgi?id=160394
888
889         Reviewed by Darin Adler.
890
891         Implement overload resolution algorithm:
892         - http://heycam.github.io/webidl/#es-overloads
893
894         This means that our support for operation overloading in our IDL is
895         now a lot more extensive than it used to be and is now compliant with
896         the Web IDL specification.
897
898         In particular, overloading should now work for a lot more parameter
899         types which means that:
900         - We should be able to drop some custom bindings code in a follow-up patch.
901         - We will be able to drop the [StrictTypeChecking] attribute which was
902           a hack used to make overloading work for parameters of type DOMString.
903
904         Also, the order of the overloads in the IDL no longer impacts the
905         generated bindings code. It used to be that you needed to put the
906         overloads with the more specific parameter types first in order for the
907         generated bindings code to be somewhat correct.
908
909         No new tests, rebaselined bindings tests.
910
911         * bindings/scripts/CodeGenerator.pm:
912         (IsStringOrEnumType):
913         * bindings/scripts/CodeGeneratorJS.pm:
914         (IsNullableType):
915         (StripNullable):
916         (ComputeEffectiveOverloadSet):
917         (AreTypesDistinguishableForOverloadResolution):
918         (GetDistinguishingArgumentIndex):
919         (GetOverloadThatMatches):
920         (GenerateOverloadedFunction):
921         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
922         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
923         * bindings/scripts/test/JS/JSTestObj.cpp:
924         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
925         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
926         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
927         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
928         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
929         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
930         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12): Deleted.
931         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise): Deleted.
932         * bindings/scripts/test/TestObj.idl:
933         * dom/EventTarget.h:
934         * dom/EventTarget.idl:
935         * html/HTMLOptionsCollection.h:
936         * html/HTMLOptionsCollection.idl:
937         * html/HTMLSelectElement.h:
938         (WebCore::HTMLSelectElement::add):
939         * html/HTMLSelectElement.idl:
940
941 2016-08-02  Myles C. Maxfield  <mmaxfield@apple.com>
942
943         [macOS] Guard workaround in r203314 for only OSes which need it
944         https://bugs.webkit.org/show_bug.cgi?id=160440
945
946         Reviewed by Simon Fraser.
947
948         The workarond introduced in r203314 only needs to be applied on
949         certain OSes.
950
951         No new tests because there is no behavior change.
952
953         * platform/text/mac/TextBoundaries.mm:
954         (WebCore::findNextWordFromIndex):
955
956 2016-08-02  Youenn Fablet  <youenn@apple.com>
957
958         Remove CachedResourceRequest initiatingDocumentLoader
959         https://bugs.webkit.org/show_bug.cgi?id=160449
960
961         Reviewed by Alex Christensen.
962
963         No change of behavior.
964
965         * loader/DocumentLoader.cpp:
966         (WebCore::DocumentLoader::startLoadingMainResource): Removing call to setInitiator.
967         * loader/cache/CachedResourceRequest.cpp:
968         (WebCore::CachedResourceRequest::setInitiator): Deleted.
969         * loader/cache/CachedResourceRequest.h:
970         (WebCore::CachedResourceRequest::initiatingDocumentLoader): Deleted.
971
972 2016-07-28  Frederic Wang  <fwang@igalia.com>
973
974         Move parsing of the form attribute to MathMLOperatorElement
975         https://bugs.webkit.org/show_bug.cgi?id=160239
976
977         Reviewed by Darin Adler.
978
979         We move the parsing of the mo@form attribute to the MathMLOperatorElement class. Note that
980         when the attribute is not explicit, the form may also be guessed by searching into the
981         operator dictionary. Hence we also start moving the determination of the default dictionary
982         properties. Moving the actual parsing of the corresponding attributes will be done in
983         follow-up commits.
984
985         No new tests, already covered by existing tests.
986
987         * mathml/MathMLInlineContainerElement.cpp:
988         (WebCore::MathMLInlineContainerElement::childrenChanged): Make the form of operators dirty
989         if its siblings have changed.
990         * mathml/MathMLOperatorDictionary.cpp:
991         (WebCore::MathMLOperatorDictionary::search): Merge old getEntry functions into one helper
992         function that returns an Optional<Entry>.
993         (WebCore::MathMLOperatorDictionary::getEntry): Deleted
994         * mathml/MathMLOperatorDictionary.h: Declare MathMLOperatorDictionary::find.
995         * mathml/MathMLOperatorElement.cpp:
996         (WebCore::MathMLOperatorElement::dictionaryProperty): We determine the operator form by
997         parsing the corresponding attribute or by using heuristics if that attribute is not
998         specified. We also read dictionary the corresponding dictionary properties.
999         (WebCore::MathMLOperatorElement::flags): Return the flags read from the dictionary.
1000         (WebCore::MathMLOperatorElement::defaultLeadingSpace): Return the space read from the dictionary.
1001         (WebCore::MathMLOperatorElement::defaultTrailingSpace): Return the space read from the dictionary.
1002         (WebCore::MathMLOperatorElement::childrenChanged): Make the dictionary properties dirty.
1003         (WebCore::MathMLOperatorElement::parseAttribute): Make the dictionary properties dirty when
1004         the form changes.
1005         * mathml/MathMLOperatorElement.h: New member to store dictionary properties and expose them.
1006         * rendering/mathml/RenderMathMLFencedOperator.cpp:
1007         (WebCore::RenderMathMLFencedOperator::setOperatorProperties): We implement the case specific
1008         to anonymous mfenced operators here.
1009         * rendering/mathml/RenderMathMLFencedOperator.h: Move the m_operatorForm member here and
1010         declare the overriden function setOperatorProperties.
1011         * rendering/mathml/RenderMathMLOperator.cpp:
1012         (WebCore::RenderMathMLOperator::setOperatorProperties): Simplify this code since the logic
1013         has been moved to the element classes.
1014         (WebCore::RenderMathMLOperator::setOperatorPropertiesFromOpDictEntry): Deleted.
1015         * rendering/mathml/RenderMathMLOperator.h: Remove setOperatorPropertiesFromOpDictEntry, make
1016         members accessible to RenderMathMLFencedOperator and remove m_operatorForm.
1017
1018 2016-08-02  Frederic Wang  <fwang.igalia.com>
1019
1020         Use Optional members to store parsed MathML attributes.
1021         https://bugs.webkit.org/show_bug.cgi?id=160400
1022
1023         Reviewed by Darin Adler.
1024
1025         Parsed MathML attributes are stored on the element classes using the memoize pattern to
1026         minimize the number of parsing updates. Currently, a dirty flag for each member
1027         indicate when it must be parsed again. We change this to wrap these members into an
1028         Optional<T> container instead, where a null value indicates that the member is dirty.
1029
1030         No new tests, behavior is unchanged.
1031
1032         * mathml/MathMLElement.cpp:
1033         (WebCore::MathMLElement::cachedMathMLLength):
1034         (WebCore::MathMLElement::cachedBooleanAttribute):
1035         (WebCore::MathMLElement::parseMathVariantAttribute):
1036         (WebCore::MathMLElement::specifiedDisplayStyle):
1037         (WebCore::MathMLElement::specifiedMathVariant):
1038         * mathml/MathMLElement.h:
1039         * mathml/MathMLFractionElement.cpp:
1040         (WebCore::MathMLFractionElement::lineThickness):
1041         (WebCore::MathMLFractionElement::cachedFractionAlignment):
1042         (WebCore::MathMLFractionElement::parseAttribute):
1043         * mathml/MathMLFractionElement.h:
1044         * mathml/MathMLInlineContainerElement.cpp:
1045         (WebCore::MathMLInlineContainerElement::parseAttribute):
1046         * mathml/MathMLMathElement.cpp:
1047         (WebCore::MathMLMathElement::specifiedDisplayStyle):
1048         (WebCore::MathMLMathElement::parseAttribute):
1049         * mathml/MathMLOperatorElement.cpp:
1050         (WebCore::MathMLOperatorElement::operatorText):
1051         * mathml/MathMLPaddedElement.cpp:
1052         (WebCore::MathMLPaddedElement::parseAttribute):
1053         * mathml/MathMLPaddedElement.h:
1054         * mathml/MathMLScriptsElement.cpp:
1055         (WebCore::MathMLScriptsElement::parseAttribute):
1056         * mathml/MathMLScriptsElement.h:
1057         * mathml/MathMLSpaceElement.cpp:
1058         (WebCore::MathMLSpaceElement::parseAttribute):
1059         * mathml/MathMLSpaceElement.h:
1060         * mathml/MathMLTextElement.cpp:
1061         (WebCore::MathMLTextElement::parseAttribute):
1062         * mathml/MathMLUnderOverElement.cpp:
1063         (WebCore::MathMLUnderOverElement::parseAttribute):
1064         * mathml/MathMLUnderOverElement.h:
1065         * rendering/mathml/MathMLStyle.cpp:
1066         (WebCore::MathMLStyle::resolveMathMLStyle):
1067         * rendering/mathml/MathMLStyle.h:
1068         * rendering/mathml/RenderMathMLToken.cpp:
1069         (WebCore::mathVariant):
1070         (WebCore::RenderMathMLToken::updateMathVariantGlyph):
1071
1072 2016-08-02  Youenn Fablet  <youenn@apple.com>
1073
1074         [Fetch API] Fetch promises should not reject or resolve when ActiveDOMObjects are being stopped
1075         https://bugs.webkit.org/show_bug.cgi?id=160420
1076
1077         Reviewed by Alex Christensen.
1078
1079         Test: http/tests/fetch/fetch-in-worker-crash.html
1080
1081         Promises should not be rejected when FetchResponse/FetchRequest are stopped as ActiveDOMObject.
1082
1083         * Modules/fetch/FetchBody.h:
1084         (WebCore::FetchBody::cleanConsumePromise): Allowing to nullify the promise used to consume body.
1085         * Modules/fetch/FetchBodyOwner.cpp:
1086         (WebCore::FetchBodyOwner::stop): Nullifying the body consume promise if any.
1087         * Modules/fetch/FetchResponse.cpp:
1088         (WebCore::FetchResponse::BodyLoader::stop): Nullifying the fetch promise if any.
1089
1090 2016-08-02  Youenn Fablet  <youenn@apple.com>
1091
1092         [Fetch API] Add support to ReferrerPolicy
1093         https://bugs.webkit.org/show_bug.cgi?id=160404
1094
1095         Reviewed by Alex Christensen.
1096
1097         Tests: imported/w3c/web-platform-tests/fetch/api/basic/referrer-worker.html
1098                imported/w3c/web-platform-tests/fetch/api/basic/referrer.html
1099
1100         Refactored ThreadableLoader API to take more references.
1101
1102         Updated loading code in CachedResource to take into account referrer policy, that can be set by fetch API.
1103         To enable correct handling of OriginWhenCrossOrigin policy, the computation of the cross-origin status of a request is
1104         moved from ResourceLoader to CachedResource.
1105
1106         Referrer is passed to the loading code through HTTP headers.
1107         This was triggering preflighting for Workers request as WorkerThreadableLoader was setting the referrer.
1108         It is now done in DocumentThreadableLoader::loadRequest so that preflighting is done before setting the referrer.
1109         Note that this referrer setting is only a way to pass a specific referrer value to the loading code.
1110         CachedResource code will compute the actual referer value based on the referrer policy.
1111         It might be good in the future to have a different way of conveying this information to CachedResource, maybe
1112         through CachedResourceRequest.
1113
1114         * Modules/fetch/FetchLoader.cpp:
1115         (WebCore::FetchLoader::start): Refactoring of ThreadableLoader API.
1116         * Modules/fetch/FetchRequest.cpp:
1117         (WebCore::FetchRequest::internalRequest): Setting referrer if it has a specific value.
1118         * fileapi/FileReaderLoader.cpp:
1119         (WebCore::FileReaderLoader::start): Ractoring of ThreadableLoader API.
1120         * loader/CrossOriginPreflightChecker.cpp:
1121         (WebCore::CrossOriginPreflightChecker::startPreflight): Set referrer in the preflight request if any.
1122         (WebCore::CrossOriginPreflightChecker::doPreflight): Ditto.
1123         * loader/DocumentThreadableLoader.cpp:
1124         (WebCore::DocumentThreadableLoader::loadResourceSynchronously): Refactoring of ThreadableLoader API.
1125         (WebCore::DocumentThreadableLoader::create): Ditto.
1126         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Ditto.
1127         (WebCore::DocumentThreadableLoader::loadRequest): Ditto.
1128         * loader/DocumentThreadableLoader.h:
1129         (WebCore::DocumentThreadableLoader::referrer): Storing referrer in case one is defined.
1130         * loader/SubresourceLoader.cpp:
1131         (WebCore::SubresourceLoader::init): Removing of cross origin computation since it is done earlier in CachedResource.
1132         * loader/ThreadableLoader.cpp:
1133         (WebCore::ThreadableLoader::create): Refactoring of ThreadableLoader API.
1134         (WebCore::ThreadableLoader::loadResourceSynchronously): Ditto.
1135         * loader/ThreadableLoader.h:
1136         * loader/ThreadableLoaderClientWrapper.h:
1137         (WebCore::ThreadableLoaderClientWrapper::create): Ditto.
1138         (WebCore::ThreadableLoaderClientWrapper::ThreadableLoaderClientWrapper): Ditto.
1139         * loader/WorkerThreadableLoader.cpp:
1140         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader): Ditto.
1141         (WebCore::WorkerThreadableLoader::loadResourceSynchronously): Removing setting of referrer in header and passing
1142         it as a parameter.
1143         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Ditto.
1144         * loader/WorkerThreadableLoader.h:
1145         (WebCore::WorkerThreadableLoader::create): Refactoring of ThreadableLoader API.
1146         * loader/cache/CachedResource.cpp:
1147         (WebCore::addAdditionalRequestHeadersToRequest): Computation of referrer based on referrer policy.
1148         (WebCore::CachedResource::addAdditionalRequestHeaders): Ditto.
1149         (WebCore::CachedResource::load): Computation of cross origin status.
1150         (WebCore::CachedResource::varyHeaderValuesMatch):
1151         * loader/cache/CachedResource.h:
1152         (WebCore::CachedResource::options):
1153         * page/EventSource.cpp:
1154         (WebCore::EventSource::connect): Refactoring of ThreadableLoader API.
1155         * workers/WorkerScriptLoader.cpp:
1156         (WebCore::WorkerScriptLoader::loadSynchronously): Ditto.
1157         (WebCore::WorkerScriptLoader::loadAsynchronously): Ditto.
1158         * xml/XMLHttpRequest.cpp:
1159         (WebCore::XMLHttpRequest::createRequest): Ditto.
1160
1161 2016-08-02  Brady Eidson  <beidson@apple.com>
1162
1163         Refactor data passed along for a "GetRecord" request.
1164         https://bugs.webkit.org/show_bug.cgi?id=160352
1165
1166         Reviewed by Tim Horton.
1167
1168         No new tests (No behavior change).
1169
1170         Adding this new object lets us easily add new data passed along for GetRecord
1171         requests going forward.
1172
1173         * WebCore.xcodeproj/project.pbxproj:
1174         * CMakeLists.txt:
1175
1176         * Modules/indexeddb/IDBObjectStore.cpp:
1177         (WebCore::IDBObjectStore::get):
1178
1179         * Modules/indexeddb/IDBTransaction.cpp:
1180         (WebCore::IDBTransaction::requestGetRecord):
1181         (WebCore::IDBTransaction::requestIndexRecord):
1182         (WebCore::IDBTransaction::getRecordOnServer):
1183         * Modules/indexeddb/IDBTransaction.h:
1184
1185         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1186         (WebCore::IDBClient::IDBConnectionProxy::getRecord):
1187         * Modules/indexeddb/client/IDBConnectionProxy.h:
1188
1189         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1190         (WebCore::IDBClient::IDBConnectionToServer::getRecord):
1191         * Modules/indexeddb/client/IDBConnectionToServer.h:
1192         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
1193
1194         * Modules/indexeddb/server/IDBServer.cpp:
1195         (WebCore::IDBServer::IDBServer::getRecord):
1196         * Modules/indexeddb/server/IDBServer.h:
1197
1198         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1199         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
1200         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1201
1202         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1203         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
1204         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
1205
1206         * Modules/indexeddb/shared/IDBGetRecordData.cpp: Added.
1207         (WebCore::IDBGetRecordData::isolatedCopy):
1208         * Modules/indexeddb/shared/IDBGetRecordData.h: Added.
1209         (WebCore::IDBGetRecordData::encode):
1210         (WebCore::IDBGetRecordData::decode):
1211
1212         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1213         (WebCore::InProcessIDBServer::getRecord):
1214         * Modules/indexeddb/shared/InProcessIDBServer.h:
1215
1216 2016-08-01  Youenn Fablet  <youenn@apple.com>
1217
1218         [Fetch API] Pass directly FetchRequest fetch options to ThreadableLoader
1219         https://bugs.webkit.org/show_bug.cgi?id=160407
1220
1221         Reviewed by Sam Weinig.
1222
1223         No change of behavior.
1224
1225         Added a ResourceLoaderOptions constructor that takes a FetchOptions as input.
1226         Removed setters and getters of ResourceLoaderOptions as it is a struct.
1227         Updated member fields accordingly.
1228
1229         Updated code accordingly.
1230         Removed explicit option setting if it is the same as the default value.
1231
1232         * Modules/fetch/FetchLoader.cpp:
1233         (WebCore::FetchLoader::start):
1234         * css/CSSFontFaceSrcValue.cpp:
1235         (WebCore::CSSFontFaceSrcValue::cachedFont):
1236         * css/CSSImageSetValue.cpp:
1237         (WebCore::CSSImageSetValue::cachedImageSet):
1238         * css/CSSImageValue.cpp:
1239         (WebCore::CSSImageValue::cachedImage):
1240         * dom/ScriptElement.cpp:
1241         (WebCore::ScriptElement::requestScript):
1242         * fileapi/FileReaderLoader.cpp:
1243         (WebCore::FileReaderLoader::start):
1244         * html/HTMLLinkElement.cpp:
1245         (WebCore::HTMLLinkElement::process):
1246         * inspector/InspectorNetworkAgent.cpp:
1247         (WebCore::InspectorNetworkAgent::loadResource):
1248         * loader/CrossOriginPreflightChecker.cpp:
1249         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
1250         (WebCore::CrossOriginPreflightChecker::startPreflight):
1251         * loader/DocumentThreadableLoader.cpp:
1252         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1253         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
1254         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
1255         (WebCore::DocumentThreadableLoader::redirectReceived):
1256         (WebCore::DocumentThreadableLoader::didReceiveResponse):
1257         (WebCore::DocumentThreadableLoader::preflightSuccess):
1258         (WebCore::DocumentThreadableLoader::loadRequest):
1259         * loader/ImageLoader.cpp:
1260         (WebCore::ImageLoader::updateFromElement):
1261         * loader/ResourceLoader.cpp:
1262         (WebCore::ResourceLoader::ResourceLoader):
1263         (WebCore::ResourceLoader::init):
1264         (WebCore::ResourceLoader::start):
1265         (WebCore::ResourceLoader::setDefersLoading):
1266         (WebCore::ResourceLoader::setDataBufferingPolicy):
1267         (WebCore::ResourceLoader::addDataOrBuffer):
1268         (WebCore::ResourceLoader::willSendRequestInternal):
1269         (WebCore::ResourceLoader::didReceiveResponse):
1270         (WebCore::ResourceLoader::didReceiveDataOrBuffer):
1271         (WebCore::ResourceLoader::didFinishLoadingOnePart):
1272         (WebCore::ResourceLoader::cleanupForError):
1273         (WebCore::ResourceLoader::shouldUseCredentialStorage):
1274         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
1275         * loader/ResourceLoader.h:
1276         (WebCore::ResourceLoader::shouldSendResourceLoadCallbacks):
1277         (WebCore::ResourceLoader::setSendCallbackPolicy):
1278         (WebCore::ResourceLoader::shouldSniffContent):
1279         (WebCore::ResourceLoader::shouldIncludeCertificateInfo):
1280         * loader/ResourceLoaderOptions.h:
1281         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
1282         (WebCore::ResourceLoaderOptions::sendLoadCallbacks): Deleted.
1283         (WebCore::ResourceLoaderOptions::setSendLoadCallbacks): Deleted.
1284         (WebCore::ResourceLoaderOptions::sniffContent): Deleted.
1285         (WebCore::ResourceLoaderOptions::setSniffContent): Deleted.
1286         (WebCore::ResourceLoaderOptions::dataBufferingPolicy): Deleted.
1287         (WebCore::ResourceLoaderOptions::setDataBufferingPolicy): Deleted.
1288         (WebCore::ResourceLoaderOptions::allowCredentials): Deleted.
1289         (WebCore::ResourceLoaderOptions::setAllowCredentials): Deleted.
1290         (WebCore::ResourceLoaderOptions::securityCheck): Deleted.
1291         (WebCore::ResourceLoaderOptions::setSecurityCheck): Deleted.
1292         (WebCore::ResourceLoaderOptions::certificateInfoPolicy): Deleted.
1293         (WebCore::ResourceLoaderOptions::setCertificateInfoPolicy): Deleted.
1294         (WebCore::ResourceLoaderOptions::contentSecurityPolicyImposition): Deleted.
1295         (WebCore::ResourceLoaderOptions::setContentSecurityPolicyImposition): Deleted.
1296         (WebCore::ResourceLoaderOptions::defersLoadingPolicy): Deleted.
1297         (WebCore::ResourceLoaderOptions::setDefersLoadingPolicy): Deleted.
1298         (WebCore::ResourceLoaderOptions::cachingPolicy): Deleted.
1299         (WebCore::ResourceLoaderOptions::setCachingPolicy): Deleted.
1300         * loader/SubresourceLoader.cpp:
1301         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
1302         * loader/TextTrackLoader.cpp:
1303         (WebCore::TextTrackLoader::load):
1304         * loader/cache/CachedRawResource.cpp:
1305         (WebCore::CachedRawResource::setDataBufferingPolicy):
1306         * loader/cache/CachedResource.cpp:
1307         (WebCore::CachedResource::load):
1308         * loader/cache/CachedResource.h:
1309         (WebCore::CachedResource::shouldSendResourceLoadCallbacks):
1310         (WebCore::CachedResource::dataBufferingPolicy):
1311         (WebCore::CachedResource::allowsCaching):
1312         * loader/cache/CachedResourceLoader.cpp:
1313         (WebCore::CachedResourceLoader::canRequest):
1314         * loader/cache/CachedResourceRequest.cpp:
1315         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
1316         * loader/cache/CachedResourceRequest.h:
1317         (WebCore::CachedResourceRequest::allowsCaching):
1318         * loader/cache/CachedResourceRequestInitiators.cpp:
1319         (WebCore::CachedResourceRequestInitiators::CachedResourceRequestInitiators):
1320         * loader/cache/CachedResourceRequestInitiators.h:
1321         * loader/mac/ResourceLoaderMac.mm:
1322         (WebCore::ResourceLoader::willCacheResponse):
1323         (WebCore::ResourceLoader::didReceiveDataArray):
1324         * page/EventSource.cpp:
1325         (WebCore::EventSource::connect):
1326         * style/StylePendingResources.cpp:
1327         (WebCore::Style::loadPendingImage):
1328         (WebCore::Style::loadPendingSVGFilters):
1329         * svg/SVGFEImageElement.cpp:
1330         (WebCore::SVGFEImageElement::requestImageResource):
1331         * svg/SVGFontFaceUriElement.cpp:
1332         (WebCore::SVGFontFaceUriElement::loadFont):
1333         * svg/SVGUseElement.cpp:
1334         (WebCore::SVGUseElement::updateExternalDocument):
1335         * workers/WorkerScriptLoader.cpp:
1336         (WebCore::WorkerScriptLoader::loadSynchronously):
1337         (WebCore::WorkerScriptLoader::loadAsynchronously):
1338         * xml/XMLHttpRequest.cpp:
1339         (WebCore::XMLHttpRequest::createRequest):
1340
1341 2016-08-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1342
1343         [GTK] Move the redirected XComposite window to the web process
1344         https://bugs.webkit.org/show_bug.cgi?id=160389
1345
1346         Reviewed by Žan Doberšek.
1347
1348         Add helper methods to PlatformDisplayX11 to query X extensions supported by the display.
1349
1350         * platform/graphics/x11/PlatformDisplayX11.cpp:
1351         (WebCore::PlatformDisplayX11::supportsXComposite):
1352         (WebCore::PlatformDisplayX11::supportsXDamage):
1353         * platform/graphics/x11/PlatformDisplayX11.h:
1354
1355 2016-08-01  Andreas Kling  <akling@apple.com>
1356
1357         Shrink MediaQuerySets to fit after parsing.
1358         <https://webkit.org/b/160419>
1359
1360         Reviewed by Antti Koivisto.
1361
1362         Add shrinkToFit() helpers to MediaQuerySet and MediaQuery
1363         and call it after parsing to remove extra capacity from their
1364         internal vectors.
1365
1366         This reduces memory usage by 1.24MB on theverge.com.
1367
1368         * css/CSSParser.cpp:
1369         (WebCore::CSSParser::createMediaRule):
1370         * css/MediaList.cpp:
1371         (WebCore::MediaQuerySet::parse):
1372         (WebCore::MediaQuerySet::shrinkToFit):
1373         * css/MediaList.h:
1374         * css/MediaQuery.h:
1375         (WebCore::MediaQuery::shrinkToFit):
1376
1377 2016-08-01  Tim Horton  <timothy_horton@apple.com>
1378
1379         <attachment> action label doesn't wrap, but needs to for some localizations
1380         https://bugs.webkit.org/show_bug.cgi?id=160431
1381         <rdar://problem/27526464>
1382
1383         Reviewed by Simon Fraser.
1384
1385         Test: fast/attachment/attachment-wrapping-action.html
1386
1387         * rendering/RenderThemeIOS.mm:
1388         (WebCore::AttachmentInfo::buildWrappedLines):
1389         (WebCore::AttachmentInfo::AttachmentInfo):
1390         (WebCore::AttachmentInfo::buildTitleLines): Deleted.
1391         Rework buildTitleLines into buildWrappedLines so that we have a
1392         generic way to add lines that wrap up to N lines and then center-truncate.
1393
1394         Make use of it for the action text, and follow the same rules/width as
1395         the title text already does.
1396
1397 2016-08-01  Anders Carlsson  <andersca@apple.com>
1398
1399         Build fix.
1400
1401         * WebCore.xcodeproj/project.pbxproj:
1402
1403 2016-08-01  Anders Carlsson  <andersca@apple.com>
1404
1405         Another build fix.
1406
1407         * WebCore.xcodeproj/project.pbxproj:
1408
1409 2016-08-01  Anders Carlsson  <andersca@apple.com>
1410
1411         Freeze the last of the HTML Objective-C bindings
1412         https://bugs.webkit.org/show_bug.cgi?id=160430
1413
1414         Reviewed by Tim Horton.
1415
1416         Also, remove a bunch of form validation related methods that were never exposed/used.
1417
1418         * DerivedSources.make:
1419         * WebCore.xcodeproj/project.pbxproj:
1420         * bindings/objc/DOMBlob.h: Added.
1421         * bindings/objc/DOMBlob.mm: Added.
1422         * bindings/objc/DOMBlobInternal.h: Added.
1423         * bindings/objc/DOMDOMTokenList.h: Added.
1424         * bindings/objc/DOMDOMTokenList.mm: Added.
1425         * bindings/objc/DOMDOMTokenListInternal.h: Added.
1426         * bindings/objc/DOMFile.h: Added.
1427         * bindings/objc/DOMFile.mm: Added.
1428         * bindings/objc/DOMFileInternal.h: Added.
1429         * bindings/objc/DOMFileList.h: Added.
1430         * bindings/objc/DOMFileList.mm: Added.
1431         * bindings/objc/DOMFileListInternal.h: Added.
1432         * bindings/objc/DOMHTMLButtonElement.mm:
1433         * bindings/objc/DOMHTMLFieldSetElement.mm:
1434         * bindings/objc/DOMHTMLInputElement.mm:
1435         * bindings/objc/DOMHTMLInputElementPrivate.h:
1436         * bindings/objc/DOMHTMLObjectElement.mm:
1437         * bindings/objc/DOMHTMLSelectElement.mm:
1438         * bindings/objc/DOMHTMLTextAreaElement.mm:
1439         * bindings/objc/DOMHTMLTextAreaElementPrivate.h:
1440         * bindings/objc/DOMMediaError.h: Added.
1441         * bindings/objc/DOMMediaError.mm: Added.
1442         * bindings/objc/DOMMediaErrorInternal.h: Added.
1443         * bindings/objc/DOMTimeRanges.h: Added.
1444         * bindings/objc/DOMTimeRanges.mm: Added.
1445         * bindings/objc/DOMTimeRangesInternal.h: Added.
1446
1447 2016-08-01  Anders Carlsson  <andersca@apple.com>
1448
1449         Fix build.
1450
1451         * WebCore.xcodeproj/project.pbxproj:
1452
1453 2016-08-01  Anders Carlsson  <andersca@apple.com>
1454
1455         Freeze all the DOMHTML* Objective-C bindings
1456         https://bugs.webkit.org/show_bug.cgi?id=160424
1457
1458         Reviewed by Tim Horton.
1459
1460         * DerivedSources.make:
1461         * WebCore.xcodeproj/project.pbxproj:
1462         * bindings/objc/DOMHTMLAnchorElement.h: Added.
1463         * bindings/objc/DOMHTMLAnchorElement.mm: Added.
1464         * bindings/objc/DOMHTMLAnchorElementInternal.h: Added.
1465         * bindings/objc/DOMHTMLAppletElement.h: Added.
1466         * bindings/objc/DOMHTMLAppletElement.mm: Added.
1467         * bindings/objc/DOMHTMLAppletElementInternal.h: Added.
1468         * bindings/objc/DOMHTMLAreaElement.h: Added.
1469         * bindings/objc/DOMHTMLAreaElement.mm: Added.
1470         * bindings/objc/DOMHTMLAreaElementInternal.h: Added.
1471         * bindings/objc/DOMHTMLBRElement.h: Added.
1472         * bindings/objc/DOMHTMLBRElement.mm: Added.
1473         * bindings/objc/DOMHTMLBRElementInternal.h: Added.
1474         * bindings/objc/DOMHTMLBaseElement.h: Added.
1475         * bindings/objc/DOMHTMLBaseElement.mm: Added.
1476         * bindings/objc/DOMHTMLBaseElementInternal.h: Added.
1477         * bindings/objc/DOMHTMLBaseFontElement.h: Added.
1478         * bindings/objc/DOMHTMLBaseFontElement.mm: Added.
1479         * bindings/objc/DOMHTMLBaseFontElementInternal.h: Added.
1480         * bindings/objc/DOMHTMLBodyElement.h: Added.
1481         * bindings/objc/DOMHTMLBodyElement.mm: Added.
1482         * bindings/objc/DOMHTMLBodyElementInternal.h: Added.
1483         * bindings/objc/DOMHTMLButtonElement.h: Added.
1484         * bindings/objc/DOMHTMLButtonElement.mm: Added.
1485         * bindings/objc/DOMHTMLButtonElementInternal.h: Added.
1486         * bindings/objc/DOMHTMLCanvasElement.h: Added.
1487         * bindings/objc/DOMHTMLCanvasElement.mm: Added.
1488         * bindings/objc/DOMHTMLCanvasElementInternal.h: Added.
1489         * bindings/objc/DOMHTMLCollection.h: Added.
1490         * bindings/objc/DOMHTMLCollection.mm: Added.
1491         * bindings/objc/DOMHTMLCollectionInternal.h: Added.
1492         * bindings/objc/DOMHTMLDListElement.h: Added.
1493         * bindings/objc/DOMHTMLDListElement.mm: Added.
1494         * bindings/objc/DOMHTMLDListElementInternal.h: Added.
1495         * bindings/objc/DOMHTMLDirectoryElement.h: Added.
1496         * bindings/objc/DOMHTMLDirectoryElement.mm: Added.
1497         * bindings/objc/DOMHTMLDirectoryElementInternal.h: Added.
1498         * bindings/objc/DOMHTMLDivElement.h: Added.
1499         * bindings/objc/DOMHTMLDivElement.mm: Added.
1500         * bindings/objc/DOMHTMLDivElementInternal.h: Added.
1501         * bindings/objc/DOMHTMLDocument.h: Added.
1502         * bindings/objc/DOMHTMLDocument.mm: Added.
1503         * bindings/objc/DOMHTMLDocumentInternal.h: Added.
1504         * bindings/objc/DOMHTMLElement.h: Added.
1505         * bindings/objc/DOMHTMLElement.mm: Added.
1506         * bindings/objc/DOMHTMLElementInternal.h: Added.
1507         * bindings/objc/DOMHTMLEmbedElement.h: Added.
1508         * bindings/objc/DOMHTMLEmbedElement.mm: Added.
1509         * bindings/objc/DOMHTMLEmbedElementInternal.h: Added.
1510         * bindings/objc/DOMHTMLFieldSetElement.h: Added.
1511         * bindings/objc/DOMHTMLFieldSetElement.mm: Added.
1512         * bindings/objc/DOMHTMLFieldSetElementInternal.h: Added.
1513         * bindings/objc/DOMHTMLFontElement.h: Added.
1514         * bindings/objc/DOMHTMLFontElement.mm: Added.
1515         * bindings/objc/DOMHTMLFontElementInternal.h: Added.
1516         * bindings/objc/DOMHTMLFormElement.h: Added.
1517         * bindings/objc/DOMHTMLFormElement.mm: Added.
1518         * bindings/objc/DOMHTMLFormElementInternal.h: Added.
1519         * bindings/objc/DOMHTMLFrameElement.h: Added.
1520         * bindings/objc/DOMHTMLFrameElement.mm: Added.
1521         * bindings/objc/DOMHTMLFrameElementInternal.h: Added.
1522         * bindings/objc/DOMHTMLFrameSetElement.h: Added.
1523         * bindings/objc/DOMHTMLFrameSetElement.mm: Added.
1524         * bindings/objc/DOMHTMLFrameSetElementInternal.h: Added.
1525         * bindings/objc/DOMHTMLHRElement.h: Added.
1526         * bindings/objc/DOMHTMLHRElement.mm: Added.
1527         * bindings/objc/DOMHTMLHRElementInternal.h: Added.
1528         * bindings/objc/DOMHTMLHeadElement.h: Added.
1529         * bindings/objc/DOMHTMLHeadElement.mm: Added.
1530         * bindings/objc/DOMHTMLHeadElementInternal.h: Added.
1531         * bindings/objc/DOMHTMLHeadingElement.h: Added.
1532         * bindings/objc/DOMHTMLHeadingElement.mm: Added.
1533         * bindings/objc/DOMHTMLHeadingElementInternal.h: Added.
1534         * bindings/objc/DOMHTMLHtmlElement.h: Added.
1535         * bindings/objc/DOMHTMLHtmlElement.mm: Added.
1536         * bindings/objc/DOMHTMLHtmlElementInternal.h: Added.
1537         * bindings/objc/DOMHTMLIFrameElement.h: Added.
1538         * bindings/objc/DOMHTMLIFrameElement.mm: Added.
1539         * bindings/objc/DOMHTMLIFrameElementInternal.h: Added.
1540         * bindings/objc/DOMHTMLImageElement.h: Added.
1541         * bindings/objc/DOMHTMLImageElement.mm: Added.
1542         * bindings/objc/DOMHTMLImageElementInternal.h: Added.
1543         * bindings/objc/DOMHTMLInputElement.h: Added.
1544         * bindings/objc/DOMHTMLInputElement.mm: Added.
1545         * bindings/objc/DOMHTMLInputElementInternal.h: Added.
1546         * bindings/objc/DOMHTMLInputElementPrivate.h: Added.
1547         * bindings/objc/DOMHTMLLIElement.h: Added.
1548         * bindings/objc/DOMHTMLLIElement.mm: Added.
1549         * bindings/objc/DOMHTMLLIElementInternal.h: Added.
1550         * bindings/objc/DOMHTMLLabelElement.h: Added.
1551         * bindings/objc/DOMHTMLLabelElement.mm: Added.
1552         * bindings/objc/DOMHTMLLabelElementInternal.h: Added.
1553         * bindings/objc/DOMHTMLLegendElement.h: Added.
1554         * bindings/objc/DOMHTMLLegendElement.mm: Added.
1555         * bindings/objc/DOMHTMLLegendElementInternal.h: Added.
1556         * bindings/objc/DOMHTMLLinkElement.h: Added.
1557         * bindings/objc/DOMHTMLLinkElement.mm: Added.
1558         * bindings/objc/DOMHTMLLinkElementInternal.h: Added.
1559         * bindings/objc/DOMHTMLMapElement.h: Added.
1560         * bindings/objc/DOMHTMLMapElement.mm: Added.
1561         * bindings/objc/DOMHTMLMapElementInternal.h: Added.
1562         * bindings/objc/DOMHTMLMarqueeElement.h: Added.
1563         * bindings/objc/DOMHTMLMarqueeElement.mm: Added.
1564         * bindings/objc/DOMHTMLMarqueeElementInternal.h: Added.
1565         * bindings/objc/DOMHTMLMediaElement.h: Added.
1566         * bindings/objc/DOMHTMLMediaElement.mm: Added.
1567         * bindings/objc/DOMHTMLMediaElementInternal.h: Added.
1568         * bindings/objc/DOMHTMLMenuElement.h: Added.
1569         * bindings/objc/DOMHTMLMenuElement.mm: Added.
1570         * bindings/objc/DOMHTMLMenuElementInternal.h: Added.
1571         * bindings/objc/DOMHTMLMetaElement.h: Added.
1572         * bindings/objc/DOMHTMLMetaElement.mm: Added.
1573         * bindings/objc/DOMHTMLMetaElementInternal.h: Added.
1574         * bindings/objc/DOMHTMLModElement.h: Added.
1575         * bindings/objc/DOMHTMLModElement.mm: Added.
1576         * bindings/objc/DOMHTMLModElementInternal.h: Added.
1577         * bindings/objc/DOMHTMLOListElement.h: Added.
1578         * bindings/objc/DOMHTMLOListElement.mm: Added.
1579         * bindings/objc/DOMHTMLOListElementInternal.h: Added.
1580         * bindings/objc/DOMHTMLObjectElement.h: Added.
1581         * bindings/objc/DOMHTMLObjectElement.mm: Added.
1582         * bindings/objc/DOMHTMLObjectElementInternal.h: Added.
1583         * bindings/objc/DOMHTMLObjectElementPrivate.h: Added.
1584         * bindings/objc/DOMHTMLOptGroupElement.h: Added.
1585         * bindings/objc/DOMHTMLOptGroupElement.mm: Added.
1586         * bindings/objc/DOMHTMLOptGroupElementInternal.h: Added.
1587         * bindings/objc/DOMHTMLOptionElement.h: Added.
1588         * bindings/objc/DOMHTMLOptionElement.mm: Added.
1589         * bindings/objc/DOMHTMLOptionElementInternal.h: Added.
1590         * bindings/objc/DOMHTMLOptionsCollection.h: Added.
1591         * bindings/objc/DOMHTMLOptionsCollection.mm: Added.
1592         * bindings/objc/DOMHTMLOptionsCollectionInternal.h: Added.
1593         * bindings/objc/DOMHTMLParagraphElement.h: Added.
1594         * bindings/objc/DOMHTMLParagraphElement.mm: Added.
1595         * bindings/objc/DOMHTMLParagraphElementInternal.h: Added.
1596         * bindings/objc/DOMHTMLParamElement.h: Added.
1597         * bindings/objc/DOMHTMLParamElement.mm: Added.
1598         * bindings/objc/DOMHTMLParamElementInternal.h: Added.
1599         * bindings/objc/DOMHTMLPreElement.h: Added.
1600         * bindings/objc/DOMHTMLPreElement.mm: Added.
1601         * bindings/objc/DOMHTMLPreElementInternal.h: Added.
1602         * bindings/objc/DOMHTMLQuoteElement.h: Added.
1603         * bindings/objc/DOMHTMLQuoteElement.mm: Added.
1604         * bindings/objc/DOMHTMLQuoteElementInternal.h: Added.
1605         * bindings/objc/DOMHTMLScriptElement.h: Added.
1606         * bindings/objc/DOMHTMLScriptElement.mm: Added.
1607         * bindings/objc/DOMHTMLScriptElementInternal.h: Added.
1608         * bindings/objc/DOMHTMLSelectElement.h: Added.
1609         * bindings/objc/DOMHTMLSelectElement.mm: Added.
1610         * bindings/objc/DOMHTMLSelectElementInternal.h: Added.
1611         * bindings/objc/DOMHTMLStyleElement.h: Added.
1612         * bindings/objc/DOMHTMLStyleElement.mm: Added.
1613         * bindings/objc/DOMHTMLStyleElementInternal.h: Added.
1614         * bindings/objc/DOMHTMLTableCaptionElement.h: Added.
1615         * bindings/objc/DOMHTMLTableCaptionElement.mm: Added.
1616         * bindings/objc/DOMHTMLTableCaptionElementInternal.h: Added.
1617         * bindings/objc/DOMHTMLTableCellElement.h: Added.
1618         * bindings/objc/DOMHTMLTableCellElement.mm: Added.
1619         * bindings/objc/DOMHTMLTableCellElementInternal.h: Added.
1620         * bindings/objc/DOMHTMLTableColElement.h: Added.
1621         * bindings/objc/DOMHTMLTableColElement.mm: Added.
1622         * bindings/objc/DOMHTMLTableColElementInternal.h: Added.
1623         * bindings/objc/DOMHTMLTableElement.h: Added.
1624         * bindings/objc/DOMHTMLTableElement.mm: Added.
1625         * bindings/objc/DOMHTMLTableElementInternal.h: Added.
1626         * bindings/objc/DOMHTMLTableRowElement.h: Added.
1627         * bindings/objc/DOMHTMLTableRowElement.mm: Added.
1628         * bindings/objc/DOMHTMLTableRowElementInternal.h: Added.
1629         * bindings/objc/DOMHTMLTableSectionElement.h: Added.
1630         * bindings/objc/DOMHTMLTableSectionElement.mm: Added.
1631         * bindings/objc/DOMHTMLTableSectionElementInternal.h: Added.
1632         * bindings/objc/DOMHTMLVideoElement.h: Added.
1633         * bindings/objc/DOMHTMLVideoElement.mm: Added.
1634         * bindings/objc/DOMHTMLVideoElementInternal.h: Added.
1635
1636 2016-08-01  Antti Koivisto  <antti@apple.com>
1637
1638         REGRESSION(r198943): drop-down menu navigation on fiddlevideo.com doesn't appear on iOS, works on OS X
1639         https://bugs.webkit.org/show_bug.cgi?id=160406
1640         rdar://problem/26310261
1641
1642         Reviewed by Simon Fraser.
1643
1644         On iOS we generate synthetic mouse events from taps. Click event is generated on tap only if the move event
1645         doesn't produce visible changes to the document. This is important to make certain types of drop down menus
1646         work.
1647
1648         The information on mutations is passed via WKContentObservation side channel which is updated from varous parts
1649         of the code. Newly visible elements are detected CheckForVisibilityChangeOnRecalcStyle during style resolution.
1650         This got broken by the style refactoring because it assumes that renderer is mutated along with style computation.
1651         However mutation is now a separate step performed by RenderTreeUpdater.
1652
1653         Fix by moving CheckForVisibilityChange to RenderTreeUpdater.
1654
1655         Test: fast/content-observation/click-event-suppression-on-content-change.html
1656
1657         * style/RenderTreeUpdater.cpp:
1658         (WebCore::RenderTreeUpdater::Parent::Parent):
1659         (WebCore::RenderTreeUpdater::updateElementRenderer):
1660         (WebCore::RenderTreeUpdater::tearDownRenderer):
1661         (WebCore::elementImplicitVisibility):
1662         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
1663         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
1664         * style/StyleTreeResolver.cpp:
1665         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1666         (WebCore::Style::TreeResolver::pushParent):
1667         (WebCore::Style::TreeResolver::resolveComposedTree):
1668         (WebCore::Style::elementImplicitVisibility): Deleted.
1669         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::CheckForVisibilityChangeOnRecalcStyle): Deleted.
1670         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::~CheckForVisibilityChangeOnRecalcStyle): Deleted.
1671
1672 2016-08-01  Eric Carlson  <eric.carlson@apple.com>
1673
1674         [iOS] A video element that does not pause after exiting from fullscreen should be allowed to continue playing inline
1675         https://bugs.webkit.org/show_bug.cgi?id=160416
1676         <rdar://problem/27409854>
1677
1678         Reviewed by Alex Christensen.
1679
1680         * html/HTMLMediaElement.cpp:
1681         (WebCore::HTMLMediaElement::exitFullscreen): If playback normally requires fullscreen but the 
1682         element was not paused when exiting from fullscreen, set the 'playsinline' attribute so we won't
1683         force fullscreen if playback is paused and resumes, and set the 'controls' attribute so the
1684         user can control playback.
1685
1686 2016-08-01  Anders Carlsson  <andersca@apple.com>
1687
1688         Build fix.
1689
1690         * WebCore.xcodeproj/project.pbxproj:
1691
1692 2016-08-01  Eric Carlson  <eric.carlson@apple.com>
1693
1694         [Mac][iOS] Adopt MediaRemote "seek to playback position"
1695         https://bugs.webkit.org/show_bug.cgi?id=160405
1696         <rdar://problem/27547583>
1697
1698         Reviewed by Dean Jackson.
1699
1700         Test: media/remote-control-command-seek.html
1701
1702         * Modules/webaudio/AudioContext.h: Update for didReceiveRemoteControlCommand argument change.
1703
1704         * html/HTMLMediaElement.cpp:
1705         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Support SeekToPlaybackPositionCommand.
1706         Drive by fix, support Stop command.
1707         (WebCore::HTMLMediaElement::supportsSeeking): New.
1708         * html/HTMLMediaElement.h:
1709
1710         * platform/RemoteCommandListener.h:
1711         (WebCore::RemoteCommandListenerClient::didReceiveRemoteControlCommand): Add command argument.
1712         (WebCore::RemoteCommandListenerClient::supportsSeeking): New.
1713         (WebCore::RemoteCommandListener::updateSupportedCommands): Ditto.
1714         (WebCore::RemoteCommandListener::client): Ditto.
1715
1716         * platform/audio/PlatformMediaSession.cpp:
1717         (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand): Add command argument.
1718         (WebCore::PlatformMediaSession::supportsSeeking): New, pass through to client.
1719         * platform/audio/PlatformMediaSession.h:
1720
1721         * platform/audio/PlatformMediaSessionManager.cpp:
1722         (WebCore::PlatformMediaSessionManager::setCurrentSession): Tell remote command listener to
1723         update supported commands.
1724         (WebCore::PlatformMediaSessionManager::currentSession): Make const.
1725         (WebCore::PlatformMediaSessionManager::didReceiveRemoteControlCommand): Add command argument.
1726         (WebCore::PlatformMediaSessionManager::supportsSeeking): New, pass through to session.
1727         * platform/audio/PlatformMediaSessionManager.h:
1728
1729         * platform/ios/RemoteCommandListenerIOS.h:
1730         (WebCore::RemoteCommandListenerIOS::createWeakPtr):
1731         * platform/ios/RemoteCommandListenerIOS.mm:
1732         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS): Support changePlaybackPositionCommand.
1733         (WebCore::RemoteCommandListenerIOS::~RemoteCommandListenerIOS): Remove seekToTime target.
1734         (WebCore::RemoteCommandListenerIOS::updateSupportedCommands): Update changePlaybackPositionCommand.
1735
1736         * platform/mac/MediaRemoteSoftLink.cpp:
1737         * platform/mac/MediaRemoteSoftLink.h:
1738
1739         * platform/mac/RemoteCommandListenerMac.h:
1740         * platform/mac/RemoteCommandListenerMac.mm:
1741         (WebCore::RemoteCommandListenerMac::updateSupportedCommands): New, split out of constructor.
1742         (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Split setup logic out into
1743         updateSupportedCommands. Support MRMediaRemoteCommandSeekToPlaybackPosition. Don't assert when
1744         receiving an unsupported command, it happens. Return error when a command isn't supported or
1745         fails.
1746
1747         * testing/Internals.cpp:
1748         (WebCore::Internals::postRemoteControlCommand): Add command argument parameter. Support
1749         seektoplaybackposition.
1750         * testing/Internals.h:
1751         * testing/Internals.idl:
1752
1753 2016-08-01  Anders Carlsson  <andersca@apple.com>
1754
1755         Freeze DOMHTMLTitleElement and DOMHTMLUListElement bindings
1756         https://bugs.webkit.org/show_bug.cgi?id=160415
1757
1758         Reviewed by Sam Weinig.
1759
1760         * DerivedSources.make:
1761         * WebCore.xcodeproj/project.pbxproj:
1762         * bindings/objc/DOMHTMLTitleElement.h: Added.
1763         * bindings/objc/DOMHTMLTitleElement.mm: Added.
1764         * bindings/objc/DOMHTMLTitleElementInternal.h: Added.
1765         * bindings/objc/DOMHTMLUListElement.h: Added.
1766         * bindings/objc/DOMHTMLUListElement.mm: Added.
1767         * bindings/objc/DOMHTMLUListElementInternal.h: Added.
1768
1769 2016-08-01  Antti Koivisto  <antti@apple.com>
1770
1771         REGRESSION (r196383): Drop down CSS menus not working on cnet.com, apmex.com
1772         https://bugs.webkit.org/show_bug.cgi?id=160390
1773
1774         Reviewed by Simon Fraser.
1775
1776         The case here is that we have a rule like
1777
1778             .enableHover:hover .child { ... }
1779
1780         and the "enableHover" class is added dynamically. The class change invalidation optimization code would figure out
1781         that nothing needs to be invalidated as the class change doesn't make the rule match (since :hover doesn't match).
1782
1783         However for event driven hover to actually work the hover element needs to have its childrenAffectedByHover bit set.
1784         This bits is set when the selector match is attempted, whether it actually matches or not. Since we optimized away
1785         the style invalidation we never set the bit either.
1786
1787         Fix by treating :hover as always matching (==ignored) when collecting rules for invalidation optimization purposes.
1788         Dynamic pseudo elements are already treated this way for similar reasons.
1789
1790         Test: fast/selectors/hover-invalidation-descendant-dynamic.html
1791
1792         * css/SelectorChecker.cpp:
1793         (WebCore::SelectorChecker::checkOne):
1794
1795             Match always in CollectingRulesIgnoringVirtualPseudoElements mode (now slightly misnamed).
1796
1797             This mode is used for optimization purposes in StyleInvalidationAnalysis (which we care about here) and
1798             StyleSharingResolver. The change is fine for both.
1799
1800         * cssjit/SelectorCompiler.cpp:
1801         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsHovered):
1802
1803             Same change for the slow path selector checker.
1804
1805 2016-08-01  Darin Adler  <darin@apple.com>
1806
1807         [Cocoa] Freeze Objective-C bindings and stop autogenerating them: Step 1 - Convert a single file
1808         https://bugs.webkit.org/show_bug.cgi?id=160386
1809
1810         Reviewed by Anders Carlsson.
1811
1812         No behavior change, no tests changed. I tested this locally by putting "#error" into the
1813         files in the DerivedSources directory to make sure the build doesn't use those files even
1814         if there are stale copies still sitting there.
1815
1816         Moving the bindings from WebCore to the legacy part of WebKit is something we also want to
1817         do, but that is quite challenging to do one file at a time, so we will do that later.
1818
1819         For this first file, I did some hand edits to make the code in a the file a little less
1820         peculiar. It's still awkward to have all those JSMainThreadNullState in there; should double
1821         check that we really need them.
1822
1823         An important follow up step will be to cut down on the bindings. We have lots of bindings
1824         that are only in the Private.h header, and it would be good to find a way to cut down on those.
1825         And on iOS we would like eliminate these bindings entirely since they are not API there.
1826
1827         * DerivedSources.make: Moved HTMLTextAreaElement from a list we use for both JavaScript and
1828         Objective-C DOM bindings to a list we use only for JavaScript bindings.
1829         * WebCore.xcodeproj/project.pbxproj: Removed references to generated DOMHTMLTextAreaElement
1830         files and instead reference the checked-in copies.
1831         * bindings/objc/DOMHTMLTextAreaElement.h: Added.
1832         * bindings/objc/DOMHTMLTextAreaElement.mm: Added.
1833         * bindings/objc/DOMHTMLTextAreaElementInternal.h: Added.
1834         * bindings/objc/DOMHTMLTextAreaElementPrivate.h: Added.
1835
1836 2016-08-01  Frederic Wang  <fwang@igalia.com>
1837
1838         Introduce a RenderMathMLFencedOperator class
1839         https://bugs.webkit.org/show_bug.cgi?id=160245
1840
1841         Reviewed by Darin Adler.
1842
1843         We introduce a class to handle all the code specific to anonymous mfenced operators. In
1844         particular many members of the RenderMathMLOperator class are going to be removed while
1845         fixing bug 156537 but they may still need to stored and exposed in some way by mfenced
1846         operators.
1847
1848         No new tests, behavior is unchanged.
1849
1850         * CMakeLists.txt: Add RenderMathMLFencedOperator.
1851         * WebCore.xcodeproj/project.pbxproj: Ditto.
1852         * rendering/RenderObject.h:
1853         (WebCore::RenderObject::isRenderMathMLFencedOperator): Function to allow casting to
1854         RenderMathMLFencedOperator.
1855         * rendering/mathml/RenderMathMLFenced.cpp: Use RenderMathMLFencedOperator instead of
1856         RenderMathMLOperator and use the new name updateOperatorContent.
1857         (WebCore::RenderMathMLFenced::updateFromElement):
1858         (WebCore::RenderMathMLFenced::createMathMLOperator):
1859         (WebCore::RenderMathMLFenced::makeFences):
1860         (WebCore::RenderMathMLFenced::addChild):
1861         * rendering/mathml/RenderMathMLFenced.h: Use RenderMathMLFencedOperator instead of
1862         RenderMathMLOperator.
1863         * rendering/mathml/RenderMathMLFencedOperator.cpp: New class derived from RenderMathMLOperator
1864         (WebCore::RenderMathMLFencedOperator::RenderMathMLFencedOperator): Init form and operator
1865         flags with the specified parameters and init the text content.
1866         (WebCore::RenderMathMLFencedOperator::updateOperatorContent): We move the
1867         RenderMathMLOperator::updateTokenContent function used by anonymous operators here. It is
1868         renamed to avoid build errors due to conflicts with the other
1869         RenderMathMLOperator::updateTokenContent function.
1870         * rendering/mathml/RenderMathMLFencedOperator.h: New class for anonymous mfenced operators
1871         with getter and setter for the m_textContent. Also override RenderMathMLFencedOperator to
1872         allow casting to RenderMathMLFencedOperator.
1873         * rendering/mathml/RenderMathMLOperator.cpp:
1874         (WebCore::RenderMathMLOperator::RenderMathMLOperator): Simplify the constructors. Some
1875         initializations is moved in RenderMathMLOperator.h while other code is moved to
1876         RenderMathMLFencedOperator.
1877         (WebCore::RenderMathMLOperator::textContent): No need to handle the anonymous case here since
1878         it is handled in RenderMathMLFencedOperator.
1879         (WebCore::RenderMathMLOperator::updateTokenContent): We delete the version used for anonymous
1880         operators and move it into RenderMathMLFencedOperator.
1881         * rendering/mathml/RenderMathMLOperator.h: Make the class and some members overridable and
1882         exposed to the derived RenderMathMLFencedOperator class. We also move initialization of some
1883         members here.
1884
1885 2016-08-01  Youenn Fablet  <youennf@gmail.com>
1886
1887         Reduce the number of ResourceRequest copies in DocumentThreadableLoader
1888         https://bugs.webkit.org/show_bug.cgi?id=160338
1889
1890         Reviewed by Darin Adler.
1891
1892         No observable change of behavior.
1893
1894         Updating one of CachedResourceReques constructor to take a ResourceRequest&&.
1895         This allows reducing a ResourceRequest copy in DocumentThreadableLoader.
1896         Updating DocumentLoader and MediaResourceLoader accordingly (future optimization steps may look at making these
1897         two loaders more efficient with regards to Resource Request).
1898
1899         Updating ThreadableLoader to take a ResourceRequest&&.
1900         This allows reducing the number of copies in DocumentThreadableLoader.
1901         Updating clients of ThreadableLoader accordingly.
1902
1903         * Modules/fetch/FetchLoader.cpp:
1904         (WebCore::FetchLoader::start):
1905         * dom/Document.cpp:
1906         (WebCore::Document::didLoadResourceSynchronously):
1907         * dom/Document.h:
1908         * dom/ScriptExecutionContext.cpp:
1909         (WebCore::ScriptExecutionContext::didLoadResourceSynchronously):
1910         * dom/ScriptExecutionContext.h:
1911         * fileapi/FileReaderLoader.cpp:
1912         (WebCore::FileReaderLoader::start):
1913         * inspector/InspectorNetworkAgent.cpp:
1914         (WebCore::InspectorNetworkAgent::loadResource):
1915         * loader/DocumentLoader.cpp:
1916         (WebCore::DocumentLoader::startLoadingMainResource):
1917         * loader/DocumentThreadableLoader.cpp:
1918         (WebCore::DocumentThreadableLoader::loadResourceSynchronously):
1919         (WebCore::DocumentThreadableLoader::create):
1920         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1921         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
1922         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
1923         (WebCore::DocumentThreadableLoader::redirectReceived):
1924         (WebCore::DocumentThreadableLoader::preflightSuccess):
1925         (WebCore::DocumentThreadableLoader::loadRequest):
1926         * loader/DocumentThreadableLoader.h:
1927         * loader/MediaResourceLoader.cpp:
1928         (WebCore::MediaResourceLoader::requestResource):
1929         * loader/ThreadableLoader.cpp:
1930         (WebCore::ThreadableLoader::create):
1931         (WebCore::ThreadableLoader::loadResourceSynchronously):
1932         * loader/ThreadableLoader.h:
1933         * loader/WorkerThreadableLoader.cpp:
1934         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
1935         (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
1936         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1937         * loader/WorkerThreadableLoader.h:
1938         (WebCore::WorkerThreadableLoader::create):
1939         * loader/cache/CachedResourceRequest.cpp:
1940         (WebCore::CachedResourceRequest::CachedResourceRequest):
1941         * loader/cache/CachedResourceRequest.h:
1942         * page/EventSource.cpp:
1943         (WebCore::EventSource::connect):
1944         * workers/WorkerScriptLoader.cpp:
1945         (WebCore::WorkerScriptLoader::loadSynchronously):
1946         (WebCore::WorkerScriptLoader::loadAsynchronously):
1947         * xml/XMLHttpRequest.cpp:
1948         (WebCore::XMLHttpRequest::createRequest):
1949
1950 2016-07-31  Youenn Fablet  <youenn@apple.com>
1951
1952         Fetch Response built-ins should use @makeThisTypeError
1953         https://bugs.webkit.org/show_bug.cgi?id=160290
1954
1955         Reviewed by Darin Adler.
1956
1957         Covered by updated test.
1958
1959         Fixed type error checks.
1960         Making use of @makeThisTypeError to have the correct error message.
1961         Updating arrayBuffer, blob, json and text to return rejected promises in lieu of throwing
1962         in case the 'this' value is not q Response object.
1963
1964         * Modules/fetch/FetchResponse.js:
1965         (clone): Updated instanceof check and making use of @makeThisTypeError.
1966         (arrayBuffer): Ditto.
1967         (blob): Ditto.
1968         (formData): Ditto.
1969         (json): Ditto.
1970         (text): Ditto.
1971
1972 2016-07-31  Adrian Perez de Castro  <aperez@igalia.com>
1973
1974         [GTK] Implement missing WebCore::moveFile() using GLib functions
1975         https://bugs.webkit.org/show_bug.cgi?id=160363
1976
1977         Reviewed by Carlos Garcia Campos.
1978
1979         * platform/glib/FileSystemGlib.cpp:
1980         (WebCore::moveFile): Function added.
1981
1982 2016-07-31  Chris Dumez  <cdumez@apple.com>
1983
1984         Drop [StrictTypeChecking] in cases where it is a no-op
1985         https://bugs.webkit.org/show_bug.cgi?id=160387
1986
1987         Reviewed by Darin Adler.
1988
1989         Drop [StrictTypeChecking] in cases where it is a no-op. After r203949 & r203950,
1990         [StrictTypeChecking] only has an impact when used on operation parameters of
1991         string types and is currently used as a workaround for bugs in our overload
1992         resolution algorithm.
1993
1994         * Modules/mediastream/RTCPeerConnection.idl:
1995         * Modules/mediastream/RTCRtpSender.idl:
1996         * bindings/scripts/test/TestObj.idl:
1997         * bindings/scripts/test/TestTypedefs.idl:
1998         * html/canvas/ANGLEInstancedArrays.idl:
1999         * html/canvas/OESVertexArrayObject.idl:
2000         * html/canvas/WebGL2RenderingContext.idl:
2001         * html/canvas/WebGLDebugShaders.idl:
2002         * html/canvas/WebGLLoseContext.idl:
2003         * html/canvas/WebGLRenderingContextBase.idl:
2004         * svg/SVGAngle.idl:
2005         * svg/SVGColor.idl:
2006         * svg/SVGLength.idl:
2007         * svg/SVGLengthList.idl:
2008         * svg/SVGMatrix.idl:
2009         * svg/SVGNumberList.idl:
2010         * svg/SVGPaint.idl:
2011         * svg/SVGPathSegList.idl:
2012         * svg/SVGPoint.idl:
2013         * svg/SVGPointList.idl:
2014         * svg/SVGStringList.idl:
2015         * svg/SVGTransform.idl:
2016         * svg/SVGTransformList.idl:
2017
2018 2016-07-31  Nan Wang  <n_wang@apple.com>
2019
2020         AX: Add a check for touch event listener on iOS accessibility object
2021         https://bugs.webkit.org/show_bug.cgi?id=160388
2022
2023         Reviewed by Chris Fleizach.
2024
2025         dispatchTouchEvent() is not working correctly within AXPress() sometimes. Need to 
2026         investigate it more in the future. Now, adding a check for the touch event listener
2027         on the object's node so that iOS can handle dispatching the touch event instead.
2028
2029         Test: accessibility/ios-simulator/has-touch-event-listener.html
2030
2031         * accessibility/AccessibilityObject.h:
2032         * accessibility/ios/AccessibilityObjectIOS.mm:
2033         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
2034         (WebCore::AccessibilityObject::hasTouchEventListener):
2035         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2036         (appendStringToResult):
2037         (-[WebAccessibilityObjectWrapper _accessibilityHasTouchEventListener]):
2038         (-[WebAccessibilityObjectWrapper _accessibilityValueIsAutofilled]):
2039
2040 2016-07-30  Chris Dumez  <cdumez@apple.com>
2041
2042         Unreviewed, rebaseline bindings tests.
2043
2044         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2045         (webkit_dom_test_obj_set_property): Deleted.
2046         (webkit_dom_test_obj_get_property): Deleted.
2047         (webkit_dom_test_obj_class_init): Deleted.
2048         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2049         * bindings/scripts/test/JS/JSTestObj.cpp:
2050         (WebCore::jsTestObjStrictTypeCheckingAttribute): Deleted.
2051         (WebCore::jsTestObjStrictFloat): Deleted.
2052         (WebCore::setJSTestObjStrictTypeCheckingAttribute): Deleted.
2053         (WebCore::setJSTestObjStrictFloat): Deleted.
2054         * bindings/scripts/test/ObjC/DOMTestObj.h:
2055         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2056         (-[DOMTestObj strictTypeCheckingAttribute]): Deleted.
2057         (-[DOMTestObj setStrictTypeCheckingAttribute:]): Deleted.
2058         (-[DOMTestObj strictFloat]): Deleted.
2059         (-[DOMTestObj setStrictFloat:]): Deleted.
2060
2061 2016-07-30  Chris Dumez  <cdumez@apple.com>
2062
2063         Enable strict type checking for Window dictionary members
2064         https://bugs.webkit.org/show_bug.cgi?id=160356
2065
2066         Reviewed by Darin Adler.
2067
2068         Enable strict type checking for Window dictionary members. Technically,
2069         we should do strict type checking of all wrapper types but this patch
2070         focuses on Window because it is common to pass a Window dictionary
2071         member to Event constructors.
2072
2073         By strict type checking, I mean that we should throw a TypeError is
2074         the value is not null/undefined and does not implement the Window
2075         interface:
2076         - http://heycam.github.io/webidl/#es-interface
2077
2078         Firefox and Chrome comply with the specification already.
2079
2080         No new tests, updated / rebaselined existing tests.
2081
2082         * bindings/js/JSDictionary.cpp:
2083         (WebCore::JSDictionary::convertValue):
2084
2085 2016-07-30  Chris Dumez  <cdumez@apple.com>
2086
2087         [WebIDL] Enable strict type checking for nullable attribute setters of wrapper types
2088         https://bugs.webkit.org/show_bug.cgi?id=160375
2089
2090         Reviewed by Darin Adler.
2091
2092         Enable strict type checking for nullable attribute setters of wrapper types:
2093         - http://heycam.github.io/webidl/#es-nullable-type
2094         - http://heycam.github.io/webidl/#es-interface
2095
2096         For such attributes, if the JS tries to assign a value that is not null /
2097         undefined and does not have the expected wrapper type, then we now throw a
2098         TypeError instead of silently converting the value to null.
2099
2100         This behavior is consistent with Chrome and Firefox. It also helps identify
2101         bugs in JavaScript code.
2102
2103         No new tests, updated existing tests.
2104
2105         * Modules/webaudio/AudioBufferSourceNode.idl:
2106         * bindings/scripts/CodeGeneratorJS.pm:
2107         (GenerateImplementation):
2108         * bindings/scripts/test/JS/JSTestObj.cpp:
2109         (WebCore::setJSTestObjTestNullableObjAttr):
2110         (WebCore::setJSTestObjMutablePoint):
2111         (WebCore::setJSTestObjImmutablePoint):
2112         * bindings/scripts/test/TestObj.idl:
2113         * dom/Document.idl:
2114         * html/HTMLTableElement.idl:
2115         * svg/SVGAngle.idl:
2116         * svg/SVGAnimatedBoolean.idl:
2117         * svg/SVGAnimatedEnumeration.idl:
2118         * svg/SVGAnimatedInteger.idl:
2119         * svg/SVGAnimatedNumber.idl:
2120         * svg/SVGLength.idl:
2121         * svg/SVGMatrix.idl:
2122         * svg/SVGNumber.idl:
2123         * svg/SVGPathSegArcAbs.idl:
2124         * svg/SVGPathSegArcRel.idl:
2125         * svg/SVGPathSegCurvetoCubicAbs.idl:
2126         * svg/SVGPathSegCurvetoCubicRel.idl:
2127         * svg/SVGPathSegCurvetoCubicSmoothAbs.idl:
2128         * svg/SVGPathSegCurvetoCubicSmoothRel.idl:
2129         * svg/SVGPathSegCurvetoQuadraticAbs.idl:
2130         * svg/SVGPathSegCurvetoQuadraticRel.idl:
2131         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl:
2132         * svg/SVGPathSegCurvetoQuadraticSmoothRel.idl:
2133         * svg/SVGPathSegLinetoAbs.idl:
2134         * svg/SVGPathSegLinetoHorizontalAbs.idl:
2135         * svg/SVGPathSegLinetoHorizontalRel.idl:
2136         * svg/SVGPathSegLinetoRel.idl:
2137         * svg/SVGPathSegLinetoVerticalAbs.idl:
2138         * svg/SVGPathSegLinetoVerticalRel.idl:
2139         * svg/SVGPathSegMovetoAbs.idl:
2140         * svg/SVGPathSegMovetoRel.idl:
2141         * svg/SVGPoint.idl:
2142         * svg/SVGPreserveAspectRatio.idl:
2143         * svg/SVGRect.idl:
2144
2145 2016-07-30  Youenn Fablet  <youenn@apple.com>
2146
2147         Synchronous preflight should check for successful responses
2148         https://bugs.webkit.org/show_bug.cgi?id=159350
2149
2150         Reviewed by Darin Adler.
2151
2152         Test: http/tests/xmlhttprequest/access-control-preflight-not-successful.html
2153
2154         * loader/CrossOriginPreflightChecker.cpp:
2155         (WebCore::CrossOriginPreflightChecker::doPreflight): Adding successful response check for synchronous
2156         preflighting.
2157
2158 2016-07-30  Chris Dumez  <cdumez@apple.com>
2159
2160         [WebIDL] Enable strict type checking for operations' nullable parameters of wrapper types
2161         https://bugs.webkit.org/show_bug.cgi?id=160374
2162
2163         Reviewed by Youenn Fablet.
2164
2165         Enable strict type checking for operations' nullable parameters of
2166         wrapper types to comply with the Web IDL specification:
2167         - http://heycam.github.io/webidl/#es-nullable-type
2168         - http://heycam.github.io/webidl/#es-interface
2169
2170         For such parameters, if the JS passes a value that is not null /
2171         undefined and does not have the expected wrapper type, then we now
2172         throw a TypeError instead of silently converting the value to null.
2173
2174         This behavior is consistent with Chrome and Firefox. It also helps
2175         identify bugs in JavaScript code.
2176
2177         No new tests, rebaselined existing tests.
2178
2179         * bindings/scripts/CodeGeneratorJS.pm:
2180         (GenerateParametersCheck):
2181         * bindings/scripts/test/JS/JSTestObj.cpp:
2182         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapper):
2183         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperIsNull):
2184         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver):
2185         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
2186         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
2187         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
2188         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
2189         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
2190         (WebCore::jsTestObjPrototypeFunctionConvert2):
2191         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
2192         (WebCore::jsTestObjPrototypeFunctionConditionalMethod3): Deleted.
2193         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5): Deleted.
2194         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod): Deleted.
2195         (WebCore::jsTestObjPrototypeFunctionOrange): Deleted.
2196
2197 2016-07-29  Chris Dumez  <cdumez@apple.com>
2198
2199         Window's named properties should be exposed on a WindowProperties object in its prototype
2200         https://bugs.webkit.org/show_bug.cgi?id=160354
2201
2202         Reviewed by Gavin Barraclough.
2203
2204         Window's named properties should be exposed on a WindowProperties object
2205         in its prototype:
2206         - http://heycam.github.io/webidl/#named-properties-object
2207
2208         Firefox and Chrome both comply with the specification. However, WebKit
2209         had no "WindowProperties" object in the Window prototype chain and the
2210         named properties are exposed on the Window object itself.
2211
2212         No new tests, rebaselined existing tests.
2213
2214         * CMakeLists.txt:
2215         * WebCore.xcodeproj/project.pbxproj:
2216         * bindings/js/JSBindingsAllInOne.cpp:
2217         * bindings/js/JSDOMWindowCustom.cpp:
2218         (WebCore::JSDOMWindow::getOwnPropertySlot):
2219         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2220         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): Deleted.
2221         (WebCore::JSDOMWindow::put): Deleted.
2222         (WebCore::JSDOMWindow::putByIndex): Deleted.
2223         (WebCore::JSDOMWindow::getEnumerableLength): Deleted.
2224         * bindings/js/JSDOMWindowProperties.cpp: Added.
2225         (WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter):
2226         (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
2227         (WebCore::JSDOMWindowProperties::getOwnPropertySlotByIndex):
2228         * bindings/js/JSDOMWindowProperties.h: Added.
2229         (WebCore::JSDOMWindowProperties::create):
2230         (WebCore::JSDOMWindowProperties::createStructure):
2231         (WebCore::JSDOMWindowProperties::JSDOMWindowProperties):
2232         * bindings/js/JSDOMWindowShell.cpp:
2233         (WebCore::JSDOMWindowShell::setWindow):
2234
2235 2016-07-29  Daniel Bates  <dabates@apple.com>
2236
2237         Crash under HTMLMediaElement::{resolve, reject}PendingPlayPromises() when playback is interrupted
2238         https://bugs.webkit.org/show_bug.cgi?id=160366
2239         <rdar://problem/27317407>
2240
2241         Reviewed by Eric Carlson.
2242
2243         Fixes a crash/assertion failure in DeferredWrapper::{resolve, rejectWithValue}() caused by a Promise
2244         being settled twice. In particular, if a system interruption occurs when media.play() is invoked
2245         the returned Promise may ultimately be settled twice upon cessation of the interruption.
2246
2247         A Promise can be settled (resolved) exactly once. When a system interruption occurs media
2248         playback is paused and resumes on cessation of the interruption. Currently we also immediately
2249         reject the Promise p retuned by media.play() if the interruption occurs during its invocation.
2250         So, when we resume playback on cessation of an interruption we try to resolve p again. But a
2251         Promise can only be resolved once and hence we violate the assertions that p has both a valid
2252         reference to a JSPromiseDeferred object and a reference to the global object of the page.
2253
2254         Tests: media/non-existent-video-playback-interrupted.html
2255                media/video-playback-interrupted.html
2256
2257         * html/HTMLMediaElement.cpp:
2258         (WebCore::HTMLMediaElement::play): Modified to reject the Promise and return immediately if
2259         playInternal() returns false.
2260         (WebCore::HTMLMediaElement::playInternal): Treat an interruption as success and return true
2261         so that HTMLMediaElement::play() adds the Promise to the end of the list of pending promises.
2262         We treat an interruption as a success because we will resume playback (assuming the media
2263         can be loaded and is well-formed) upon cessation of the interruption and therefore can either
2264         fulfill or reject the Promise object returned by media.play().
2265
2266 2016-07-29  Daniel Bates  <dabates@apple.com>
2267
2268         [iOS] HTMLMediaElement::updateVolume() calls MediaPlayer::volume() on null media player
2269         https://bugs.webkit.org/show_bug.cgi?id=160353
2270
2271         Reviewed by Eric Carlson.
2272
2273         Using testing functions HTMLMediaElement::updateVolume() can be called on a <video> element
2274         without an associated video. We should support this usage on iOS just as we do for non-iOS
2275         ports.
2276
2277         The use of testing functions to call HTMLMediaElement::updateVolume() on a <video> element
2278         without an associated video is demonstrated by the test LayoutTests/media/video-muted-after-setting-page-muted-state.html.
2279
2280         * html/HTMLMediaElement.cpp:
2281         (WebCore::HTMLMediaElement::updateVolume):
2282
2283 2016-07-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2284
2285         Media controls are not displayed for some autoplaying videos at certain browser dimensions
2286         https://bugs.webkit.org/show_bug.cgi?id=160360
2287         <rdar://problem/27179484>
2288
2289         Reviewed by Myles C. Maxfield.
2290
2291         Previously, if a video's aspect ratio fell outside of the range [0.5, 1.8], we would
2292         not consider it main content and would subsequently not show media controls for it.
2293         This meant that on many websites that scale video dimensions to match the mainframe,
2294         if the mainframe is too wide (e.g. full bounds on a widescreen display) we would not
2295         consider the video to be main content. To fix this, we only consider aspect ratio to
2296         be a requirement if the video does not already take up most of the space in the
2297         mainframe.
2298
2299         Covered by two new TestWebKitAPI unit tests.
2300
2301         * html/MediaElementSession.cpp:
2302         (WebCore::isElementLargeRelativeToMainFrame):
2303         (WebCore::isElementLargeEnoughForMainContent):
2304
2305 2016-07-29  Zalan Bujtas  <zalan@apple.com>
2306
2307         Do not set negative rate on AVSampleBufferRenderSynchronizer.
2308         https://bugs.webkit.org/show_bug.cgi?id=160326
2309         <rdar://problem/27355214>
2310
2311         Reviewed by Eric Carlson.
2312
2313         Test: http/tests/media/media-source/mediasource-play-then-seek-back-with-remote-control.html
2314
2315         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2316         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setRateDouble):
2317
2318 2016-07-29  Myles C. Maxfield  <mmaxfield@apple.com>
2319
2320         Backspace key removes only the rainbow from the rainbow flag
2321         https://bugs.webkit.org/show_bug.cgi?id=160349
2322         <rdar://problem/27594995>
2323
2324         Reviewed by Dean Jackson.
2325
2326         In r203330 I added support for new emoji group candidates. I accidentally
2327         missed one of the new emoji code points.
2328
2329         Test: editing/deleting/delete-emoji.html
2330
2331         * platform/text/CharacterProperties.h:
2332         (WebCore::isEmojiGroupCandidate):
2333
2334 2016-07-29  Nan Wang  <n_wang@apple.com>
2335
2336         AX: Media controls accessibility improvement
2337         https://bugs.webkit.org/show_bug.cgi?id=160223
2338         <rdar://problem/27558003>
2339
2340         Reviewed by Eric Carlson.
2341
2342         Changes in this patch:
2343         1. Added a change observer for volume slider so that it will handle accessibility 
2344            increment/decrement functions correctly.
2345         2. Update the timer div's aria-label when time changes.
2346         3. Added a keydown handler for left/right arrow adjusting the timeline, so that the
2347            value increment/decrement in a reasonable way.
2348         4. Changed the mute button's role to checkbox since it only has on/off states.
2349
2350         Test: media/media-controls-accessibility.html
2351
2352         * Modules/mediacontrols/mediaControlsApple.js:
2353         (Controller.prototype.createControls):
2354         (Controller.prototype.updatePictureInPictureButton):
2355         (Controller.prototype.timelineStepFromVideoDuration):
2356         (Controller.prototype.incrementTimelineValue):
2357         (Controller.prototype.decrementTimelineValue):
2358         (Controller.prototype.showInlinePlaybackPlaceholderWhenSafe):
2359         (Controller.prototype.handleTimelineMouseUp):
2360         (Controller.prototype.handleTimelineKeyDown):
2361         (Controller.prototype.handleMuteButtonClicked):
2362         (Controller.prototype.handleMinButtonClicked):
2363         (Controller.prototype.handleMaxButtonClicked):
2364         (Controller.prototype.updateVideoVolume):
2365         (Controller.prototype.handleVolumeSliderInput):
2366         (Controller.prototype.handleVolumeSliderChange):
2367         (Controller.prototype.handleVolumeSliderMouseDown):
2368         (Controller.prototype.updateTime):
2369         (Controller.prototype.updateControlsWhileScrubbing):
2370         (Controller.prototype.updateVolume):
2371
2372 2016-07-29  Mark Lam  <mark.lam@apple.com>
2373
2374         Remove an unused line of code.
2375         https://bugs.webkit.org/show_bug.cgi?id=160350
2376
2377         Reviewed by Simon Fraser.
2378
2379         No new tests because there's no behavior change.  Just removing dead code.
2380
2381         SVGInlineTextBox::paintText() instantiates a local variable selectionTextRun. 
2382         Thanks to analysis by Said Abou-Hallawa, we know that selectionTextRun
2383         was introduced in https://trac.webkit.org/changeset/61393, but was later
2384         rendered unused in https://trac.webkit.org/changeset/62099 because we
2385         switched to using paintTextWithShadows() with the selectionStyle.  Hence,
2386         selectionTextRun can be removed.
2387
2388         * rendering/svg/SVGInlineTextBox.cpp:
2389         (WebCore::SVGInlineTextBox::paintText):
2390
2391 2016-07-29  Eric Carlson  <eric.carlson@apple.com>
2392
2393         Change internal AVCaptureDeviceType typedef name
2394         https://bugs.webkit.org/show_bug.cgi?id=160345
2395         <rdar://problem/27610935>
2396
2397         Reviewed by Dean Jackson.
2398
2399         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2400         (WebCore::AVAudioCaptureSource::create): AVCaptureDeviceType -> AVCaptureDeviceTypedef
2401         (WebCore::AVAudioCaptureSource::AVAudioCaptureSource): Ditto.
2402
2403         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2404         (WebCore::AVCaptureDeviceManager::captureDeviceList): Ditto.
2405         (WebCore::shouldConsiderDeviceInDeviceList): Ditto.
2406         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Ditto.
2407         (WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints): Ditto.
2408         (WebCore::AVCaptureDeviceManager::deviceConnected): Ditto.
2409         (WebCore::AVCaptureDeviceManager::deviceDisconnected): Ditto.
2410         (-[WebCoreAVCaptureDeviceManagerObserver deviceDisconnected:]): Ditto.
2411
2412         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2413         (WebCore::globaVideoCaptureSerialQueue): Ditto.
2414         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Ditto.
2415
2416         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2417         (WebCore::AVVideoCaptureSource::create): Ditto.
2418         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
2419
2420 2016-07-28  Dean Jackson  <dino@apple.com>
2421
2422         color-gamut media query returns incorrect results
2423         https://bugs.webkit.org/show_bug.cgi?id=160166
2424         <rdar://problem/27537577>
2425
2426         Reviewed by Darin Adler.
2427
2428         While I was unable to reproduce the originator's issue,
2429         we communicated via email and it might have been related
2430         to a customized color space calibration on an external
2431         display.
2432
2433         Anyway, I took this opportunity to update to use the
2434         more appropriate API for detection on macOS Sierra.
2435
2436         Covered by the existing fast/media/mq-color-gamut.html test.
2437
2438         * platform/mac/PlatformScreenMac.mm:
2439         (WebCore::screenSupportsExtendedColor): Use NSScreen canRepresentDisplayGamut.
2440
2441 2016-07-29  George Ruan  <gruan@apple.com>
2442
2443         HTMLVideoElement with MediaStream src shows paused image when all video tracks are disabled
2444         https://bugs.webkit.org/show_bug.cgi?id=160222
2445         <rdar://problem/27557313>
2446
2447         Reviewed by Eric Carlson.
2448
2449         Tests: fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html
2450                fast/mediastream/MediaStream-video-element-video-tracks-disabled.html
2451
2452         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2453         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2454         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Change criteria to enqueue a
2455         Sample Buffer to the AVSampleBufferDisplayLayer to allow an initial frame to be shown.
2456         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::shouldEnqueueVideoSampleBuffer): Allow an initial frame to be shown.
2457         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushAndRemoveVideoSampleBuffers): Removes all buffers from the
2458         AVSampleBufferDisplayLayer.
2459         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Make the AVSampleBufferDisplayLayer's background black.
2460         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Remove all buffers from the AVSampleBufferDisplayLayer
2461         when state of MediaPlayerPrivateMediaStreamAVFObjC is changed to None of PaintItBlack.
2462         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage): Updates paused image.
2463         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Calls updatePausedImage.
2464         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): Allow an initial frame to be painted to canvas.
2465
2466 2016-07-29  Youenn Fablet  <youenn@apple.com>
2467
2468         [Fetch API] Activate credentials mode
2469         https://bugs.webkit.org/show_bug.cgi?id=160292
2470
2471         Reviewed by Alex Christensen.
2472
2473         Covered by updated and rebased tests.
2474
2475         Previously the allowCredentials option was computed by DocumentThreadableLoader clients.
2476         This option is really similar to the credentials flag in the fetch specification and should be handled at lower levels.
2477         In the future, it might be good to retire that option.
2478
2479         In case of Omit mode, we need to explicitely disable cookies in DocumentThreadableLoader.
2480         This should be updated so that ResourceLoader does it, depending on credential flag being set or not.
2481
2482         Updated DocumentThreadableLoader clients to only use FetchOptions::Credentials.
2483         This allows to link code more easely to specification.
2484
2485         * Modules/fetch/FetchLoader.cpp:
2486         (WebCore::FetchLoader::start): Removing use of allowCredentials option. Using FetchOptions::Credentials instead.
2487         * fileapi/FileReaderLoader.cpp:
2488         (WebCore::FileReaderLoader::start): Ditto.
2489         * inspector/InspectorNetworkAgent.cpp:
2490         (WebCore::InspectorNetworkAgent::loadResource): Ditto.
2491         * loader/DocumentThreadableLoader.cpp:
2492         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Computing allowCredentials from FetchOptions::Credentials.
2493         (WebCore::DocumentThreadableLoader::loadRequest): Enabling cookie only if allowed to use credentials. This is in
2494         particular useful for FetchOptions::Credentials::Omit mode.
2495         * page/EventSource.cpp:
2496         (WebCore::EventSource::connect): Removing use of allowCredentials option. Using FetchOptions::Credentials instead.
2497         * workers/WorkerScriptLoader.cpp:
2498         (WebCore::WorkerScriptLoader::loadSynchronously): Ditto.
2499         (WebCore::WorkerScriptLoader::loadAsynchronously): Ditto.
2500         * xml/XMLHttpRequest.cpp: Ditto.
2501         (WebCore::XMLHttpRequest::createRequest):
2502
2503 2016-07-29  Youenn Fablet  <youenn@apple.com>
2504
2505         CrossOrigin preflight checker should compute the right Access-Control-Request-Headers value
2506         https://bugs.webkit.org/show_bug.cgi?id=160028
2507
2508         Reviewed by Alex Christensen.
2509
2510         Covered by updated test.
2511
2512         Computing Access-Control-Request-Headers value according https://fetch.spec.whatwg.org/#cors-preflight-fetch:
2513         - Remove safe headers
2514         - lowercase header names
2515         - sort lexicographically header names
2516         The only difference is that we keep separating headers with ', ' instead of ',' as per the spec.
2517         Also, some headers that might be safe are still marked as unsafe (DPR, Downlink...).
2518
2519         Moved setting of Origin header after preflighting, consistently with fetch spec.
2520
2521         * loader/CrossOriginAccessControl.cpp:
2522         (WebCore::createAccessControlPreflightRequest): Implementing new computation of Access-Control-Request-Headers.
2523         * loader/DocumentThreadableLoader.cpp:
2524         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest): Removing call to updateRequestForAccessControl (which sets Origin header value).
2525         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest): Adding call to updateRequestForAccessControl.
2526         (WebCore::DocumentThreadableLoader::preflightSuccess): Ditto.
2527         * platform/network/HTTPParsers.cpp:
2528         (WebCore::isCrossOriginSafeRequestHeader): Helper routine to implement https://fetch.spec.whatwg.org/#cors-safelisted-request-header.
2529         * platform/network/HTTPParsers.h:
2530
2531 2016-07-29  Frederic Wang  <fwang@igalia.com>
2532
2533         Parse the operator text on the MathMLOperatorElement class.
2534         https://bugs.webkit.org/show_bug.cgi?id=160241
2535
2536         Reviewed by Darin Adler.
2537
2538         The text of the MathML operators is important to determine form or dictionary properties and
2539         hence provide default values when no explicit attributes are privided. Since that text only
2540         depends on the MathML DOM content, it makes sense to move its parsing into
2541         MathMLOperatorElement. Anonymous operators created by the mfenced elements still need to be
2542         handled specially and this will be true for all the operator properties that can just be
2543         determined in MathMLOperatorElement. Hence in a follow-up patch we will introduce a class
2544         to move all the code specific to mfenced in a class derived from RenderMathMLOperator while
2545         we continue to move the corresponding code for non-anonymous into MathMLOperatorElement.
2546
2547         No new tests, behavior is unchanged.
2548
2549         * mathml/MathMLOperatorElement.cpp: Include header for hyphenMinus/minusSign characters.
2550         (WebCore::MathMLOperatorElement::parseOperatorText): Move that code from rebuildTokenContent
2551         (WebCore::MathMLOperatorElement::operatorText): Helper function to get the cached text.
2552         (WebCore::MathMLOperatorElement::childrenChanged): Make the cached text dirty.
2553         * mathml/MathMLOperatorElement.h: Update defitions and add a member for the operator text.
2554         * mathml/MathMLTextElement.h: Make childrenChanged overridable.
2555         * rendering/mathml/RenderMathMLOperator.cpp:
2556         (WebCore::RenderMathMLOperator::element): Helper function to cast to a MathMLOperatorElement.
2557         (WebCore::RenderMathMLOperator::textContent): Helper function to call
2558         MathMLOperatorElement::operatorText or fallback to m_textContent for anonymous operators.
2559         m_textContent and this special case can be moved into a derived class later.
2560         (WebCore::RenderMathMLOperator::setOperatorProperties): Call textContent().
2561         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Ditto.
2562         (WebCore::RenderMathMLOperator::rebuildTokenContent): Remove the string parameter and the
2563         parsing of the operator text.
2564         (WebCore::RenderMathMLOperator::updateTokenContent): Call textContent(). The special function
2565         for anonymous operators also parses the text content but this could be moved into a derived
2566         class later.
2567         (WebCore::RenderMathMLOperator::shouldAllowStretching): Call textContent().
2568         (WebCore::RenderMathMLOperator::useMathOperator): Ditto.
2569         (WebCore::RenderMathMLOperator::RenderMathMLOperator): No need to initialize m_textContent
2570         as it is not used anymore for non-anonymous renderers.
2571         * rendering/mathml/RenderMathMLOperator.h: Update definitions and call textContent().
2572
2573 2016-07-28  Youenn Fablet  <youenn@apple.com>
2574
2575         Binding generator should expose the visible interface name in error messages
2576         https://bugs.webkit.org/show_bug.cgi?id=160192
2577
2578         Reviewed by Darin Adler.
2579
2580         Covered by updated layout and binding tests.
2581
2582         * bindings/scripts/CodeGeneratorJS.pm:
2583         (GenerateImplementation): Using visibleInterfaceName instead of interfaceName.
2584         (GenerateFunctionCastedThis): Ditto.
2585         (GenerateParametersCheck): Ditto.
2586         (GenerateConstructorDefinition): Ditto.
2587         * bindings/scripts/test/JS/JSTestObj.cpp: Rebased.
2588         * bindings/scripts/test/TestObj.idl: Adding ConstructorCallWith to exercice change in GenerateConstructorDefinition.
2589
2590 2016-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2591
2592         Split calculateCacheSizes in two methods
2593         https://bugs.webkit.org/show_bug.cgi?id=160237
2594
2595         Reviewed by Darin Adler.
2596
2597         Rename getVolumeFreeSizeForPath as volumeFreeSizeForPath and make it available to all platforms adding an
2598         implementation for mac.
2599
2600         * platform/FileSystem.h:
2601         * platform/efl/FileSystemEfl.cpp:
2602         (WebCore::volumeFreeSizeForPath):
2603         (WebCore::getVolumeFreeSizeForPath): Deleted.
2604         * platform/glib/FileSystemGlib.cpp:
2605         (WebCore::volumeFreeSizeForPath):
2606         (WebCore::getVolumeFreeSizeForPath): Deleted.
2607         * platform/mac/FileSystemMac.mm:
2608         (WebCore::volumeFreeSizeForPath):
2609         * platform/win/FileSystemWin.cpp:
2610         (WebCore::volumeFreeSizeForPath):
2611
2612 2016-07-28  Myles C. Maxfield  <mmaxfield@apple.com>
2613
2614         Remove deprecated SPI for video inline / fullscreen controls
2615         https://bugs.webkit.org/show_bug.cgi?id=160318
2616
2617         Reviewed by Tim Horton.
2618
2619         r203752 deprecated the SPI allowsInlineMediaPlaybackWithPlaysInlineAttribute
2620         and allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute (in favor of
2621         inlineMediaPlaybackRequiresPlaysInlineAttribute). This patch removes the
2622         deprecated SPI symbols.
2623
2624         No new tests because there is no behavior change.
2625
2626         * page/Settings.cpp:
2627         * page/Settings.in:
2628         * testing/InternalSettings.cpp:
2629         (WebCore::InternalSettings::Backup::Backup): Deleted.
2630         (WebCore::InternalSettings::Backup::restoreTo): Deleted.
2631         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackWithPlaysInlineAttribute): Deleted.
2632         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute): Deleted.
2633         * testing/InternalSettings.h:
2634         * testing/InternalSettings.idl:
2635
2636 2016-07-28  Chris Dumez  <cdumez@apple.com>
2637
2638         Add support for Element.getAttributeNames()
2639         https://bugs.webkit.org/show_bug.cgi?id=160327
2640
2641         Reviewed by Alex Christensen.
2642
2643         Add support for Element.getAttributeNames():
2644         - https://dom.spec.whatwg.org/#dom-element-getattributenames
2645
2646         Firefox already supports this, Chrome 52 does not yet.
2647
2648         Test: fast/dom/Element/getAttributeNames.html
2649
2650         * bindings/js/JSDOMBinding.h:
2651         (WebCore::JSValueTraits<AtomicString>::arrayJSValue):
2652         * dom/Element.cpp:
2653         (WebCore::Element::getAttributeNames):
2654         * dom/Element.h:
2655         * dom/Element.idl:
2656
2657 2016-07-28  Chris Dumez  <cdumez@apple.com>
2658
2659         window.open.length should be 0
2660         https://bugs.webkit.org/show_bug.cgi?id=160323
2661
2662         Reviewed by Darin Adler.
2663
2664         window.open.length should be 0 as all its parameters are optional:
2665         - https://html.spec.whatwg.org/multipage/browsers.html#the-window-object
2666
2667         It is 2 in WebKit. Firefox and Chrome agree with the specification and return 0.
2668
2669         No new tests, rebaselined existing test.
2670
2671         * bindings/js/JSDOMWindowCustom.cpp:
2672         (WebCore::JSDOMWindow::open):
2673         Minor code optimization.
2674
2675         * page/DOMWindow.idl:
2676         Update IDL to match the specification and our custom implementation.
2677         This makes us return the right "length" value.
2678
2679 2016-07-28  Chris Dumez  <cdumez@apple.com>
2680
2681         Parameters to Event.initEvent() should be mandatory
2682         https://bugs.webkit.org/show_bug.cgi?id=160320
2683
2684         Reviewed by Darin Adler.
2685
2686         Parameters to Event.initEvent() should be mandatory:
2687         - https://dom.spec.whatwg.org/#interface-event
2688
2689         Firefox agrees with the specification. Chrome does not.
2690
2691         No new tests, rebaselined existing tests.
2692
2693         * dom/Event.idl:
2694
2695 2016-07-28  Anders Carlsson  <andersca@apple.com>
2696
2697         Move a Mail.app workaround closer to where it's actually needed
2698         https://bugs.webkit.org/show_bug.cgi?id=160317
2699
2700         Reviewed by Tim Horton.
2701
2702         * loader/FrameLoader.cpp:
2703         (WebCore::FrameLoader::loadArchive):
2704         * platform/network/cf/ResourceRequest.h:
2705         * platform/network/cocoa/ResourceRequestCocoa.mm:
2706         (WebCore::ResourceRequest::applyWebArchiveHackForMail): Deleted.
2707         * platform/network/mac/ResourceRequestMac.mm:
2708         (WebCore::ResourceRequest::applyWebArchiveHackForMail): Deleted.
2709
2710 2016-07-28  Chris Dumez  <cdumez@apple.com>
2711
2712         2 first parameters to window.postMessage() should be mandatory
2713         https://bugs.webkit.org/show_bug.cgi?id=160319
2714
2715         Reviewed by Darin Adler.
2716
2717         2 first parameters to window.postMessage() should be mandatory:
2718         - https://html.spec.whatwg.org/multipage/browsers.html#the-window-object
2719
2720         Firefox and Chrome agree with the specification.
2721
2722         No new tests, rebaselined existing test.
2723
2724         * bindings/js/JSDOMWindowCustom.cpp:
2725         (WebCore::handlePostMessage):
2726
2727 2016-07-28  Chris Dumez  <cdumez@apple.com>
2728
2729         First parameter to canvas.getContext() / probablySupportsContext() should be mandatory
2730         https://bugs.webkit.org/show_bug.cgi?id=160312
2731
2732         Reviewed by Darin Adler.
2733
2734         First parameter to canvas.getContext() / probablySupportsContext()
2735         should be mandatory:
2736         - http://w3c.github.io/html/semantics-scripting.html#the-canvas-element
2737
2738         Firefox and Chrome agree with the specification for getContext().
2739         Neither of them supports probablySupportsContext().
2740
2741         No new tests, rebaselined existing tests.
2742
2743         * bindings/js/JSHTMLCanvasElementCustom.cpp:
2744         (WebCore::JSHTMLCanvasElement::getContext):
2745         (WebCore::JSHTMLCanvasElement::probablySupportsContext):
2746         * html/HTMLCanvasElement.idl:
2747
2748 2016-07-28  Chris Dumez  <cdumez@apple.com>
2749
2750         Parameter to table.deleteRow() / body.deleteRow() should be mandatory
2751         https://bugs.webkit.org/show_bug.cgi?id=160307
2752
2753         Reviewed by Ryosuke Niwa.
2754
2755         Parameter to table.deleteRow() / body.deleteRow() should be mandatory:
2756         - https://html.spec.whatwg.org/multipage/tables.html#the-table-element
2757         - https://html.spec.whatwg.org/multipage/tables.html#htmltablesectionelement
2758
2759         Firefox and Chrome agree with the specification.
2760
2761         No new tests, rebaselined existing test.
2762
2763         * html/HTMLTableElement.idl:
2764         * html/HTMLTableSectionElement.idl:
2765
2766 2016-07-28  Commit Queue  <commit-queue@webkit.org>
2767
2768         Unreviewed, rolling out r203826.
2769         https://bugs.webkit.org/show_bug.cgi?id=160314
2770
2771         The test added with this change fails on El Capitan WK2.
2772         (Requested by ryanhaddad on #webkit).
2773
2774         Reverted changeset:
2775
2776         "HTMLVideoElement with MediaStream src shows paused image when
2777         all video tracks are disabled"
2778         https://bugs.webkit.org/show_bug.cgi?id=160222
2779         http://trac.webkit.org/changeset/203826
2780
2781 2016-07-28  Chris Dumez  <cdumez@apple.com>
2782
2783         2 first parameters to input.setSelectionRange() should be mandatory
2784         https://bugs.webkit.org/show_bug.cgi?id=160310
2785
2786         Reviewed by Alex Christensen.
2787
2788         2 first parameters to input.setSelectionRange() should be mandatory:
2789         - https://html.spec.whatwg.org/multipage/forms.html#htmlinputelement
2790
2791         Calling this method without the 2 first parameters makes little
2792         sense.
2793
2794         Firefox agrees with the specification, Chrome does not.
2795
2796         No new tests, rebaselined existing test.
2797
2798         * bindings/js/JSHTMLInputElementCustom.cpp:
2799         (WebCore::JSHTMLInputElement::setSelectionRange):
2800         * html/HTMLInputElement.idl:
2801
2802 2016-07-28  Anders Carlsson  <andersca@apple.com>
2803
2804         Remove an unnecessary comment from UUID.h
2805         https://bugs.webkit.org/show_bug.cgi?id=160313
2806
2807         Reviewed by Simon Fraser.
2808
2809         * platform/UUID.h:
2810
2811 2016-07-28  Chris Dumez  <cdumez@apple.com>
2812
2813         Parameter to tr.deleteCell() should be mandatory
2814         https://bugs.webkit.org/show_bug.cgi?id=160308
2815
2816         Reviewed by Ryosuke Niwa.
2817
2818         Parameter to tr.deleteCell() should be mandatory:
2819         - https://html.spec.whatwg.org/multipage/tables.html#htmltablerowelement
2820
2821         Firefox and Chrome agree with the specification.
2822
2823         No new tests, rebaselined existing tests.
2824
2825         * html/HTMLTableRowElement.idl:
2826
2827 2016-07-28  Chris Dumez  <cdumez@apple.com>
2828
2829         [Bindings] "length" value of overloaded operations may be wrong
2830         https://bugs.webkit.org/show_bug.cgi?id=160303
2831
2832         Reviewed by Ryosuke Niwa.
2833
2834         "length" value of overloaded operations may be wrong because we fail to
2835         account for overloads when computing the length of a function:
2836         - https://heycam.github.io/webidl/#es-operations
2837
2838         No new tests, rebaselined existing test.
2839
2840         * bindings/scripts/CodeGeneratorJS.pm:
2841         (GetFunctionLength):
2842         * bindings/scripts/test/JS/JSTestObj.cpp:
2843
2844 2016-07-28  George Ruan  <gruan@apple.com>
2845
2846         HTMLVideoElement with MediaStream src shows paused image when all video tracks are disabled
2847         https://bugs.webkit.org/show_bug.cgi?id=160222
2848         <rdar://problem/27557313>
2849
2850         Reviewed by Eric Carlson.
2851
2852         Tests: fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html
2853                fast/mediastream/MediaStream-video-element-video-tracks-disabled.html
2854
2855         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2856         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2857         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Change criteria to enqueue a
2858         Sample Buffer to the AVSampleBufferDisplayLayer to allow an initial frame to be shown.
2859         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::shouldEnqueueVideoSampleBuffer): Allow an initial frame to be shown.
2860         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushAndRemoveVideoSampleBuffers): Removes all buffers from the
2861         AVSampleBufferDisplayLayer.
2862         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Make the AVSampleBufferDisplayLayer's background black.
2863         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Remove all buffers from the AVSampleBufferDisplayLayer
2864         when state of MediaPlayerPrivateMediaStreamAVFObjC is changed to None of PaintItBlack.
2865         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage): Updates paused image.
2866         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Calls updatePausedImage.
2867         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): Allow an initial frame to be painted to canvas.
2868
2869 2016-07-28  Dean Jackson  <dino@apple.com>
2870
2871         REGRESSION (r202880): Default controls pip glyph inverted
2872         https://bugs.webkit.org/show_bug.cgi?id=160304
2873         <rdar://problem/27578447>
2874
2875         Reviewed by Eric Carlson.
2876
2877         I accidentally committed the "Exit Picture-in-picture" glyph
2878         for the "Enter Picture-in-picture" buttons :(
2879
2880         * Modules/mediacontrols/mediaControlsApple.css:
2881         (video::-webkit-media-controls-panel .picture-in-picture-button):
2882         Use the correct artwork.
2883
2884 2016-07-28  Chris Dumez  <cdumez@apple.com>
2885
2886         First parameter to SVGDocument.createEvent() should be mandatory
2887         https://bugs.webkit.org/show_bug.cgi?id=160296
2888
2889         Reviewed by Alex Christensen.
2890
2891         First parameter to SVGDocument.createEvent() should be mandatory:
2892         - https://www.w3.org/TR/SVG2/struct.html#InterfaceDocumentExtensions
2893         - https://dom.spec.whatwg.org/#document
2894
2895         This patch drops createEvent() from SVGDocument so that the spec-compliant
2896         Document.createEvent() is used instead. In the specification, SVGDocument
2897         no longer exists and is a simple Document.
2898
2899         Firefox and Chrome agree with the specification.
2900
2901         Test: svg/dom/SVGDocument-createEvent.html
2902
2903         * svg/SVGDocument.idl:
2904
2905 2016-07-28  Chris Dumez  <cdumez@apple.com>
2906
2907         Parameters to CanvasGradient.addColorStop() should be mandatory
2908         https://bugs.webkit.org/show_bug.cgi?id=160297
2909
2910         Reviewed by Alex Christensen.
2911
2912         Parameters to CanvasGradient.addColorStop() should be mandatory:
2913         - https://html.spec.whatwg.org/multipage/scripting.html#canvasgradient
2914
2915         Firefox and Chrome agree with the specification.
2916
2917         No new tests, rebaselined existing test.
2918
2919         * html/canvas/CanvasGradient.idl:
2920
2921 2016-07-28  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2922
2923         [Streams API] Replace ReadableStreamController by ReadableStreamDefaultController
2924         https://bugs.webkit.org/show_bug.cgi?id=160242
2925
2926         Reviewed by Youenn Fablet.
2927
2928         Replaced ReadableStreamController by ReadableStreamDefaultController to align
2929         with updated Streams API specification.
2930
2931         No change in functionality.
2932
2933         * CMakeLists.txt:
2934         * DerivedSources.cpp:
2935         * DerivedSources.make:
2936         * Modules/streams/ReadableStream.js:
2937         (initializeReadableStream):
2938         * Modules/streams/ReadableStreamDefaultController.idl: Renamed from Source/WebCore/Modules/streams/ReadableStreamController.idl.
2939         * Modules/streams/ReadableStreamDefaultController.js: Renamed from Source/WebCore/Modules/streams/ReadableStreamController.js.
2940         (enqueue):
2941         (error):
2942         (close):
2943         (desiredSize):
2944         * Modules/streams/ReadableStreamInternals.js:
2945         (privateInitializeReadableStreamDefaultController):
2946         (isReadableStreamDefaultController):
2947         * Modules/streams/ReadableStreamSource.h:
2948         (WebCore::ReadableStreamSource::controller):
2949         (WebCore::ReadableStreamSource::start):
2950         * Modules/streams/ReadableStreamSource.idl:
2951         * WebCore.xcodeproj/project.pbxproj:
2952         * bindings/js/JSDOMGlobalObject.cpp:
2953         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2954         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
2955         (WebCore::constructJSReadableStreamDefaultController):
2956         (WebCore::JSBuiltinReadableStreamDefaultControllerPrivateConstructor::initializeExecutable):
2957         (WebCore::createReadableStreamDefaultControllerPrivateConstructor):
2958         * bindings/js/JSReadableStreamPrivateConstructors.h:
2959         * bindings/js/JSReadableStreamSourceCustom.cpp:
2960         (WebCore::JSReadableStreamSource::start):
2961         * bindings/js/ReadableStreamDefaultController.cpp: Renamed from Source/WebCore/bindings/js/ReadableStreamController.cpp.
2962         (WebCore::callFunction):
2963         (WebCore::ReadableStreamDefaultController::invoke):
2964         (WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked):
2965         * bindings/js/ReadableStreamDefaultController.h: Renamed from Source/WebCore/bindings/js/ReadableStreamController.h.
2966         (WebCore::ReadableStreamDefaultController::ReadableStreamDefaultController):
2967         (WebCore::ReadableStreamDefaultController::close):
2968         (WebCore::ReadableStreamDefaultController::error):
2969         (WebCore::ReadableStreamDefaultController::enqueue):
2970         (WebCore::ReadableStreamDefaultController::globalObject):
2971         (WebCore::ReadableStreamDefaultController::error<String>):
2972         * bindings/js/WebCoreBuiltinNames.h:
2973
2974 2016-07-28  Youenn Fablet  <youenn@apple.com>
2975
2976         Compute fetch response type in case of cross-origin requests
2977         https://bugs.webkit.org/show_bug.cgi?id=158565
2978
2979         Reviewed by Alex Christensen.
2980
2981         Covered by rebased tests.
2982
2983         Implementing Response filtering based on Response tainting in ResourceResponse.
2984         Refactoring code in FetchHeaders and CrossOriginAccessControl.cpp accordingly.
2985
2986         Computing response tainting in SubresourceLoader for all resources.
2987         This is used by DocumentThreadableLoader which now filters responses accordingly for all its clients including fetch and XHR.
2988
2989         Response tainting notably allows computing the response type and filtering out headers in case of cross origin responses.
2990
2991         Removing the filtering implemented in XMLHttpRequest as this is done before it gets access to the headers.
2992         This is triggering some rebasing in the XHR tests as error messages triggered by trying to access unsafe headers no longer happen.
2993
2994         This filtering currently requires creating a new ResourceResponse object from the one sent from CachedResource.
2995         This is done so as the same ResourceResponse may be reused accross loads and may be filtered differently by given to two different DocumentThreadableLoader
2996         This can be mitigated in the future by changing ThreadableLoaderClient API to pass a ResourceResponse&&.
2997
2998         * Modules/fetch/FetchHeaders.cpp: Moving header checking in HTTParsers.h/.cpp
2999         (WebCore::isForbiddenHeaderName): Deleted.
3000         (WebCore::isForbiddenResponseHeaderName): Deleted.
3001         (WebCore::isSimpleHeader): Deleted.
3002         * loader/CrossOriginAccessControl.cpp:
3003         (WebCore::parseAccessControlExposeHeadersAllowList): Deleted.
3004         * loader/CrossOriginAccessControl.h: Moving header checking in HTTParsers.h/.cpp
3005         * loader/DocumentThreadableLoader.cpp:
3006         (WebCore::DocumentThreadableLoader::responseReceived):
3007         (WebCore::DocumentThreadableLoader::didReceiveResponse): Doing response filtering. Since underlying loaders are
3008         not yet aware that fetch mode may be cors (it is always no-cors currently), the tainting needs to be updated.
3009         (WebCore::DocumentThreadableLoader::loadRequest): Computing response tainting in case of synchronous calls to ensure headers are filtered for synchronous XHR.
3010         * loader/DocumentThreadableLoader.h:
3011         * loader/SubresourceLoader.cpp:
3012         (WebCore::SubresourceLoader::init): Getting origin from its resource and setting response tainting accordingly
3013         (WebCore::SubresourceLoader::willSendRequestInternal): Always calling checkRedirectionCrossOriginAccessControl
3014         to ensure response tainting is computed, even for no-cors resources.
3015         (WebCore::SubresourceLoader::didReceiveResponse):
3016         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl): Computing response tainting in case of redirection.
3017         * loader/SubresourceLoader.h:
3018         * loader/cache/CachedResource.cpp:
3019         (WebCore::CachedResource::load): Computing resource origin from the HTTP headers or from the document if none is
3020         set in the HTTP headers.
3021         (WebCore::CachedResource::setCrossOrigin): Helper routine to set response tainting.
3022         (WebCore::CachedResource::isCrossOrigin): Helper routine to know whether resource is cross origin
3023         (WebCore::CachedResource::isClean):
3024         (WebCore::CachedResource::setResponse): Removing m_responseType
3025         * loader/cache/CachedResource.h:
3026         (WebCore::CachedResource::responseTainting):
3027         (WebCore::CachedResource::origin):
3028         (WebCore::CachedResource::setOpaqueRedirect): Deleted.
3029         * platform/network/HTTPParsers.cpp: Implementing safe response header checking
3030         (WebCore::parseAccessControlExposeHeadersAllowList):
3031         (WebCore::isForbiddenHeaderName):
3032         (WebCore::isForbiddenResponseHeaderName):
3033         (WebCore::isSimpleHeader):
3034         (WebCore::isCrossOriginSafeHeader):
3035         * platform/network/HTTPParsers.h:
3036         * platform/network/ResourceRequestBase.cpp:
3037         (WebCore::ResourceRequestBase::hasHTTPOrigin): Added.
3038         (WebCore::ResourceRequestBase::clearHTTPOrigin):
3039         * platform/network/ResourceRequestBase.h:
3040         * platform/network/ResourceResponseBase.cpp: Implementation of response filtering.
3041         (WebCore::ResourceResponseBase::filterResponse):
3042         * platform/network/ResourceResponseBase.h:
3043         * xml/XMLHttpRequest.cpp:
3044         (WebCore::isSetCookieHeader): Deleted.
3045         (WebCore::XMLHttpRequest::getAllResponseHeaders): Removing header filtering since DocumentThreadableLoader does it.
3046         (WebCore::XMLHttpRequest::getResponseHeader): Ditto.
3047
3048 2016-07-27  Romain Bellessort  <romain.bellessort@crf.canon.fr>
3049
3050         [Streams API] Use makeThisTypeError in ReadableStreamDefaultReader.js
3051         https://bugs.webkit.org/show_bug.cgi?id=160254
3052
3053         Reviewed by Darin Adler.
3054
3055         Use makeThisTypeError and makeGetterTypeError in ReadableStreamDefaultReader.js
3056
3057         No change in functionality.
3058
3059         * Modules/streams/ReadableStreamDefaultReader.js:
3060         (cancel):
3061         (read):
3062         (releaseLock):
3063         (closed):
3064
3065 2016-07-27  Fujii Hironori  <Hironori.Fujii@sony.com>
3066
3067         [soup] Incorrect usage of relaxAdoptionRequirement in the constructor of SocketStreamHandle
3068         https://bugs.webkit.org/show_bug.cgi?id=160281
3069
3070         Reviewed by Carlos Garcia Campos.
3071
3072         No new tests (No behavior change).
3073
3074         Incrementing refcount in a constructor causes an assertion failure
3075         that it's not adopted yet.  So, relaxAdoptionRequirement() was
3076         used to avoid the problem in the constructors of
3077         SocketStreamHandle.  This is a incorrect solution. The correct
3078         solution is to make SocketStreamHandle::create() increment the
3079         refcount after calling the constructor.
3080
3081         * platform/network/soup/SocketStreamHandle.h: Removed the second
3082         constructor of SocketStreamHandle which is not used anymore.
3083         Uninlined create() because this is not trivial anymore.
3084         * platform/network/soup/SocketStreamHandleSoup.cpp:
3085         (WebCore::SocketStreamHandle::create): Do the rest of jobs which
3086         was done by the constructors.
3087         (WebCore::SocketStreamHandle::SocketStreamHandle): Move the jobs
3088         after initialization to create().
3089         Removed the second constructor.
3090
3091 2016-07-27  Chris Dumez  <cdumez@apple.com>
3092
3093         First parameter to HTMLMediaElement.canPlayType() should be mandatory
3094         https://bugs.webkit.org/show_bug.cgi?id=160275
3095
3096         Reviewed by Ryosuke Niwa.
3097
3098         First parameter to HTMLMediaElement.canPlayType() should be mandatory:
3099         - https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement
3100
3101         Firefox and Chrome agree with the specification.
3102
3103         No new tests, rebaselined existing tests.
3104
3105         * html/HTMLMediaElement.idl:
3106
3107 2016-07-27  Chris Dumez  <cdumez@apple.com>
3108
3109         First parameter to setTimeout() / setInterval() should be mandatory
3110         https://bugs.webkit.org/show_bug.cgi?id=160277
3111
3112         Reviewed by Darin Adler.
3113
3114         First parameter to setTimeout() / setInterval() should be mandatory:
3115         - https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
3116
3117         Firefox and Chrome agree with the specification.
3118
3119         No new tests, rebaselined existing test.
3120
3121         * bindings/js/JSDOMWindowCustom.cpp:
3122         (WebCore::JSDOMWindow::setTimeout):
3123         (WebCore::JSDOMWindow::setInterval):
3124         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
3125         (WebCore::JSWorkerGlobalScope::setTimeout):
3126         (WebCore::JSWorkerGlobalScope::setInterval):
3127
3128 2016-07-27  Chris Dumez  <cdumez@apple.com>
3129
3130         Parameters to insertAdjacentText() / insertAdjacentHTML() should be mandatory
3131         https://bugs.webkit.org/show_bug.cgi?id=160274
3132
3133         Reviewed by Darin Adler.
3134
3135         Parameters to insertAdjacentText() / insertAdjacentHTML() should be mandatory:
3136         - https://dom.spec.whatwg.org/#element
3137         - https://www.w3.org/TR/DOM-Parsing/#extensions-to-the-element-interface
3138
3139         Firefox and Chrome agree with the specification (although Firefox does not
3140         have insertAdjacentText()).
3141
3142         Test: fast/dom/Element/insertAdjacentText-parameters.html
3143
3144         * html/HTMLElement.idl:
3145
3146 2016-07-27  Beth Dakin  <bdakin@apple.com>
3147
3148         Add localizable strings for inserting list types
3149         https://bugs.webkit.org/show_bug.cgi?id=160233
3150         -and corresponding-
3151         rdar://problem/26102954
3152
3153         Reviewed by Dan Bernstein.
3154
3155         * English.lproj/Localizable.strings:
3156         * platform/LocalizedStrings.cpp:
3157         (WebCore::insertListTypeNone):
3158         (WebCore::insertListTypeNoneAccessibilityTitle):
3159         (WebCore::insertListTypeBulleted):
3160         (WebCore::insertListTypeBulletedAccessibilityTitle):
3161         (WebCore::insertListTypeNumbered):
3162         (WebCore::insertListTypeNumberedAccessibilityTitle):
3163         * platform/LocalizedStrings.h:
3164
3165 2016-07-27  Chris Dumez  <cdumez@apple.com>
3166
3167         Parameters to DOMParser.parseFromString() should be mandatory
3168         https://bugs.webkit.org/show_bug.cgi?id=160268
3169
3170         Reviewed by Ryosuke Niwa.
3171
3172         Parameters to DOMParser.parseFromString() should be mandatory:
3173         - https://www.w3.org/TR/DOM-Parsing/#the-domparser-interface
3174
3175         Firefox and Chrome agree with the specification.
3176
3177         Test: fast/parser/DOMParser-parameters.html
3178
3179         * xml/DOMParser.idl:
3180
3181 2016-07-27  Eric Carlson  <eric.carlson@apple.com>
3182
3183         Captions do not render in PiP window when element is hidden
3184         https://bugs.webkit.org/show_bug.cgi?id=160265
3185         <rdar://problem/27556788>
3186
3187         Reviewed by Simon Fraser.
3188
3189         * html/shadow/MediaControlElements.cpp:
3190         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): Pass new flag so
3191         caption layers are always rendered.
3192
3193         * rendering/RenderLayer.cpp:
3194         (WebCore::RenderLayer::paintLayerContents): Paint non-visible layers when PaintLayerIgnoreVisibility
3195         flag is set.
3196         * rendering/RenderLayer.h: Define PaintLayerIgnoreVisibility.
3197
3198 2016-07-27  Chris Dumez  <cdumez@apple.com>
3199
3200         Parameter to named property getter should be mandatory
3201         https://bugs.webkit.org/show_bug.cgi?id=160269
3202
3203         Reviewed by Ryosuke Niwa.
3204
3205         Parameter to named property getter should be mandatory:
3206         - https://heycam.github.io/webidl/#idl-named-properties
3207
3208         No new tests, rebaselined existing test.
3209
3210         * Modules/mediastream/RTCStatsResponse.idl:
3211         * bindings/scripts/test/TestOverrideBuiltins.idl:
3212         * html/HTMLOptionsCollection.idl:
3213         * html/HTMLSelectElement.idl:
3214         * plugins/DOMMimeTypeArray.idl:
3215         * plugins/DOMPlugin.idl:
3216         * plugins/DOMPluginArray.idl:
3217
3218 2016-07-27  Chris Dumez  <cdumez@apple.com>
3219
3220         First parameter to Range.createContextualFragment() should be mandatory
3221         https://bugs.webkit.org/show_bug.cgi?id=160266
3222
3223         Reviewed by Ryosuke Niwa.
3224
3225         First parameter to Range.createContextualFragment() should be mandatory:
3226         - https://w3c.github.io/DOM-Parsing/#extensions-to-the-range-interface
3227
3228         Firefox and Chrome agree with the specification.
3229
3230         No new tests, rebaselined existing test.
3231
3232         * dom/Range.idl:
3233
3234 2016-07-27  Chris Dumez  <cdumez@apple.com>
3235
3236         Align MediaList with the CSSOM specification
3237         https://bugs.webkit.org/show_bug.cgi?id=160257
3238
3239         Reviewed by Ryosuke Niwa.
3240
3241         Align MediaList with the CSSOM specification:
3242         - https://www.w3.org/TR/cssom-1/#the-medialist-interface
3243
3244         In particular, the parameter to item() / deleteMedium() and
3245         appendMedium() is now mandatory.
3246
3247         Firefox and Chrome agree with the specification.
3248
3249         Test: fast/css/MediaList-mediaText-null.html
3250               fast/css/MediaList-parameters.html
3251
3252         * css/MediaList.idl:
3253
3254 2016-07-27  Jeremy Jones  <jeremyj@apple.com>
3255
3256         Fullscreen video zoom button does not work after rotating when aspect ratio matches display.
3257         https://bugs.webkit.org/show_bug.cgi?id=160263
3258         rdar://problem/27368872
3259
3260         Reviewed by Eric Carlson.
3261
3262         When video and display aspect ratio match, and rotating from landscape to protrait, the transform used in layout
3263         will be Identity. This means checking the transform for identity is an insufficient test to see if the bounds
3264         need to be resolved.
3265
3266         Instead, always attempt to resolve the bounds and do a more accurate test while doing so.
3267
3268         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3269         (-[WebAVPlayerLayer layoutSublayers]):
3270         (-[WebAVPlayerLayer resolveBounds]):
3271
3272 2016-07-27  Anders Carlsson  <andersca@apple.com>
3273
3274         Stop accepting the deprecated "requiredShippingAddressFields" and "requiredBillingAddressFields" properties
3275         https://bugs.webkit.org/show_bug.cgi?id=160264
3276         rdar://problem/27574519
3277
3278         Reviewed by Simon Fraser.
3279
3280         * Modules/applepay/ApplePaySession.cpp:
3281         (WebCore::createPaymentRequest):
3282         (WebCore::isValidPaymentRequestPropertyName):
3283
3284 2016-07-27  Chris Dumez  <cdumez@apple.com>
3285
3286         First parameter to indexed property getters should be mandatory
3287         https://bugs.webkit.org/show_bug.cgi?id=160259
3288
3289         Reviewed by Ryosuke Niwa.
3290
3291         First parameter to indexed property getters should be mandatory:
3292         - https://heycam.github.io/webidl/#idl-indexed-properties
3293
3294         No new tests, rebaselined existing tests.
3295
3296         * Modules/gamepad/deprecated/GamepadList.idl:
3297         * bindings/js/JSHTMLAllCollectionCustom.cpp:
3298         (WebCore::JSHTMLAllCollection::item):
3299         * css/CSSRuleList.idl:
3300         * css/CSSValueList.idl:
3301         * css/StyleSheetList.idl:
3302         * css/WebKitCSSFilterValue.idl:
3303         * css/WebKitCSSTransformValue.idl:
3304         * dom/ClientRectList.idl:
3305         * dom/DOMStringList.idl:
3306         * dom/DataTransferItemList.idl:
3307         * html/HTMLAllCollection.idl:
3308         * plugins/DOMMimeTypeArray.idl:
3309         * plugins/DOMPlugin.idl:
3310         * plugins/DOMPluginArray.idl:
3311
3312 2016-07-27  Javier Fernandez  <jfernandez@igalia.com>
3313
3314         [css-grid] The isValidTransition function must not alter the GridSizingData object
3315         https://bugs.webkit.org/show_bug.cgi?id=160252
3316
3317         Reviewed by Darin Adler.
3318
3319         It's not correct that a function which purpose is to check out the
3320         validity of a state modifies such state.
3321
3322         That code was there to allow the extra row track sizing iteration
3323         in the case of a grid container with indefinite height. We need to
3324         do that in order to figure out its intrinsic height, which will be
3325         used then to properly sizing the row tracks.
3326
3327         Since the intrinsic height computation uses directly the
3328         computeUsedBreadthOfGridTracks function, it does not alter the
3329         algorithm state-machine, hence, we can safely remove this code,
3330         which was incorrect in any case.
3331
3332         No new tests, it's just a refactoring with no functionality change.
3333
3334         * rendering/RenderGrid.cpp:
3335         (WebCore::RenderGrid::GridSizingData::isValidTransition):
3336
3337 2016-07-27  Chris Dumez  <cdumez@apple.com>
3338
3339         First parameter to Document.execCommand() / queryCommand*() should be mandatory
3340         https://bugs.webkit.org/show_bug.cgi?id=160258
3341
3342         Reviewed by Darin Adler.
3343
3344         First parameter to Document.execCommand() / queryCommand*() should be mandatory:
3345         - https://w3c.github.io/editing/execCommand.html
3346
3347         Firefox and Chrome agree with the specification.
3348
3349         Test: fast/dom/Document/editing-parameters.html
3350
3351         * dom/Document.idl:
3352
3353 2016-07-27  Chris Dumez  <cdumez@apple.com>
3354
3355         Align CSSSupportsRule with the specification
3356         https://bugs.webkit.org/show_bug.cgi?id=160256
3357
3358         Reviewed by Darin Adler.
3359
3360         Align CSSSupportsRule with the specification:
3361         - https://drafts.csswg.org/css-conditional-3/#csssupportsrule
3362
3363         In particular:
3364         - Make the parameters to insertRule() / deleteRule() mandatory
3365         - Expose CSSSupportsRule on the global Window object
3366
3367         Both Firefox and Chrome agree with the specification here.
3368
3369         Test: fast/css/CSSSupportsRule-parameters.html
3370
3371         * css/CSSSupportsRule.idl:
3372
3373 2016-07-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3374
3375         [Soup] Test http/tests/xmlhttprequest/auth-reject-protection-space.html fails since added in r203743
3376         https://bugs.webkit.org/show_bug.cgi?id=160235
3377
3378         Reviewed by Michael Catanzaro.
3379
3380         It times out in release and crashes in debug due to an ASSERT_NOT_REACHED(). The soup backend doesn't really
3381         support rejecting the protection space and continuing with the next one, but we can at least continue with the
3382         request without crendential to make the test pass.
3383
3384         * platform/network/soup/ResourceHandleSoup.cpp:
3385         (WebCore::ResourceHandle::receivedChallengeRejection):
3386
3387 2016-07-27  Romain Bellessort  <romain.bellessort@crf.canon.fr>
3388
3389         [Streams API] Replace ReadableStreamReader by ReadableStreamDefaultReader
3390         https://bugs.webkit.org/show_bug.cgi?id=160194
3391
3392         Reviewed by Youenn Fablet.
3393
3394         Replaced ReadableStreamReader by ReadableStreamDefaultReader to align
3395         with updated Streams API specification.
3396
3397         No change in functionality.
3398
3399         * CMakeLists.txt:
3400         * DerivedSources.cpp:
3401         * DerivedSources.make:
3402         * Modules/fetch/FetchInternals.js:
3403         (consumeStream):
3404         * Modules/fetch/FetchResponse.js:
3405         (body):
3406         * Modules/streams/ReadableStream.js:
3407         (getReader):
3408         * Modules/streams/ReadableStreamDefaultReader.idl: Renamed from Source/WebCore/Modules/streams/ReadableStreamReader.idl.
3409         * Modules/streams/ReadableStreamDefaultReader.js: Renamed from Source/WebCore/Modules/streams/ReadableStreamReader.js.
3410         (cancel):
3411         (read):
3412         (releaseLock):
3413         (closed):
3414         * Modules/streams/ReadableStreamInternals.js:
3415         (privateInitializeReadableStreamDefaultReader):
3416         (teeReadableStream):
3417        &nb