Update supported platforms in xcconfig files to match the sdk names.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-07-13  Enrica Casucci  <enrica@apple.com>
2
3         Update supported platforms in xcconfig files to match the sdk names.
4         https://bugs.webkit.org/show_bug.cgi?id=159728
5
6         Reviewed by Tim Horton.
7
8         * Configurations/Base.xcconfig:
9
10 2016-07-13  Anders Carlsson  <andersca@apple.com>
11
12         "requiredShippingAddressFields" has been deprecated error thrown when using "requiredBillingAddressFields"
13         https://bugs.webkit.org/show_bug.cgi?id=159729
14         rdar://problem/27314974
15
16         Reviewed by Tim Horton.
17
18         Fix a paste-o.
19
20         * Modules/applepay/ApplePaySession.cpp:
21         (WebCore::createPaymentRequest):
22
23 2016-07-13  Brent Fulgham  <bfulgham@apple.com>
24
25         [WK1][iOS] Crash when WebSocket attempts to dispatch a mixed content blocker event
26         https://bugs.webkit.org/show_bug.cgi?id=159680
27         <rdar://problem/22102028>
28
29         Reviewed by Zalan Bujtas.
30
31         WK1 on iOS should not use RunLoop::main(). Instead, it should be dispatching events
32         on the WebThread.
33
34         Test: http/tests/ssl/mixedContent/insecure-websocket.html
35
36         * Modules/websockets/WebSocket.cpp:
37         (WebCore::WebSocket::connect): Do not use RunLoop::main() when we should be using
38         the WebThread.
39
40 2016-07-13  Frederic Wang  <fwang@igalia.com>
41
42         The display property of many MathML elements can not be overriden by page authors
43         https://bugs.webkit.org/show_bug.cgi?id=139403
44
45         The mathml.css user agent stylesheet currently forces most MathML elements to render with
46         'display: block'. We remove the !important keyword so that users can override the display
47         property, for example to hide elements with 'display: none'. This is consistent with the
48         behavior for SVG or HTML elements.
49
50         Reviewed by Brent Fulgham.
51
52         Test: imported/mathml-in-html5/mathml/relations/css-styling/display-1.html
53
54         * css/mathml.css:
55         (math):
56         (math[display="block"]):
57         (ms, mspace, mtext, mi, mn, mo, mrow, mfenced, mfrac, msub, msup, msubsup, mmultiscripts, mprescripts, none, munder, mover, munderover, msqrt, mroot, merror, mphantom, mstyle, menclose, semantics, mpadded, maction):
58         (mtd > *):
59
60 2016-07-13  Youenn Fablet  <youenn@apple.com>
61
62         [Fetch API] Response should not become disturbed on the ReadableStream creation
63         https://bugs.webkit.org/show_bug.cgi?id=159714
64
65         Reviewed by Alex Christensen.
66
67         Covered by rebased test and existing tests.
68
69         * Modules/fetch/FetchResponse.cpp:
70         (WebCore::FetchResponse::stop): Making the response disturbed if cancelled.
71         * Modules/fetch/FetchResponseSource.cpp:
72         (WebCore::FetchResponseSource::firstReadCallback): Start enqueueing as soon as first read is made.
73         (WebCore::FetchResponseSource::doStart): Keep the start promise unresolved so that pull is not called.
74         FetchResponse is a push source.
75         * Modules/fetch/FetchResponseSource.h:
76         * Modules/streams/ReadableStreamInternals.js:
77         (readFromReadableStreamReader): Calling @firstReadCallback.
78         * Modules/streams/ReadableStreamSource.h:
79         (WebCore::ReadableStreamSource::firstReadCallback): Default implementation (does nothing).
80         * Modules/streams/ReadableStreamSource.idl: Adding firstReadCallback private method.
81         * bindings/js/WebCoreBuiltinNames.h: Adding @firstReadCallback.
82
83 2016-07-13  Philippe Normand  <pnormand@igalia.com>
84
85         [GStreamer][GL] crash within triggerRepaint
86         https://bugs.webkit.org/show_bug.cgi?id=159552
87
88         Reviewed by Xabier Rodriguez-Calvar.
89
90         Revert the un-needed changes introduced in r203056 and use the
91         MainThreadNotifier without redundant checks.
92
93         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
94         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
95         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
96         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
97         (WebCore::MediaPlayerPrivateGStreamer::createWeakPtr):
98         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
99         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
100         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
101         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
102         (WebCore::MediaPlayerPrivateGStreamerBase::createWeakPtr): Deleted.
103
104 2016-07-13  Carlos Garcia Campos  <cgarcia@igalia.com>
105
106         Unreviewed. Fix GObject DOM bindings API breaks after r203047-
107
108         webkit_dom_document_set_title() and webkit_dom_html_title_element_set_text() now can raise exceptions. 
109
110         * bindings/gobject/WebKitDOMDeprecated.cpp:
111         (webkit_dom_document_set_title):
112         (webkit_dom_html_title_element_set_text):
113         * bindings/gobject/WebKitDOMDeprecated.h:
114         * bindings/gobject/WebKitDOMDeprecated.symbols:
115         * bindings/gobject/webkitdom.symbols:
116         * bindings/scripts/CodeGeneratorGObject.pm:
117         (GenerateProperty):
118         (FunctionUsedToNotRaiseException):
119
120 2016-07-13  Carlos Garcia Campos  <cgarcia@igalia.com>
121
122         [Coordinated Graphics] Remove toCoordinatedGraphicsLayer and use downcast instead
123         https://bugs.webkit.org/show_bug.cgi?id=159469
124
125         Reviewed by Michael Catanzaro.
126
127         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
128         (WebCore::ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree):
129         (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateViewportConstrainedNode):
130         (WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange):
131         (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):
132         * platform/graphics/GraphicsLayer.h:
133         (WebCore::GraphicsLayer::isCoordinatedGraphicsLayer):
134         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
135         (WebCore::toCoordinatedLayerID):
136         (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
137         (WebCore::CoordinatedGraphicsLayer::removeFromParent):
138         (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
139         (WebCore::CoordinatedGraphicsLayer::flushCompositingState):
140         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
141         (WebCore::CoordinatedGraphicsLayer::findFirstDescendantWithContentsRecursively):
142         (WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
143         (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
144         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
145         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
146         (WebCore::toCoordinatedGraphicsLayer): Deleted.
147         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
148
149 2016-07-12  Youenn Fablet  <youenn@apple.com>
150
151         [Fetch API] isRedirected should be conveyed in workers
152         https://bugs.webkit.org/show_bug.cgi?id=159676
153
154         Reviewed by Alex Christensen.
155
156         Passing isRedirected value between threads.
157         Rebasing corresponding worker test, even though it is currently skipped (due to crashing flakiness).
158
159         * platform/network/ResourceResponseBase.cpp:
160         (WebCore::ResourceResponseBase::crossThreadData):
161         (WebCore::ResourceResponseBase::fromCrossThreadData):
162         * platform/network/ResourceResponseBase.h:
163
164 2016-07-12  Eric Carlson  <eric.carlson@apple.com>
165
166         REGRESSION (r202509): media controls controls enabled AirPlay placeholder is shown
167         https://bugs.webkit.org/show_bug.cgi?id=159685
168         <rdar://problem/27198899>
169
170         Reviewed by Dean Jackson.
171
172         Test: media/controls/airplay-controls.html
173
174         * Modules/mediacontrols/mediaControlsApple.js:
175         (Controller.prototype.shouldShowControls): Split some of the logic out of shouldHaveControls.
176         (Controller.prototype.shouldHaveControls): Having controls != showing controls.
177         (Controller.prototype.updateControls): Call shouldShowControls, not shouldHaveControls.
178         (Controller.prototype.updateWirelessPlaybackStatus): Add 'appletv' to the class when active.
179
180         * html/HTMLMediaElement.cpp:
181         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus): Call ensureMediaControlsShadowRoot
182         in case the controls haven't been created yet.
183
184 2016-07-12  Frederic Wang  <fwang@igalia.com>
185
186         Move parsing of mpadded attributes to a MathMLPaddedElement class
187         https://bugs.webkit.org/show_bug.cgi?id=159620
188
189         Reviewed by Brent Fulgham.
190
191         No new tests, behavior is unchanged.
192
193         * CMakeLists.txt: Add MathMLPaddedElement files.
194         * WebCore.xcodeproj/project.pbxproj: Ditto.
195         * mathml/MathMLAllInOne.cpp: Ditto.
196         * mathml/MathMLInlineContainerElement.cpp: Remove handling of mpadded.
197         * mathml/MathMLPaddedElement.cpp: Added.
198         (WebCore::MathMLPaddedElement::MathMLPaddedElement):
199         (WebCore::MathMLPaddedElement::create):
200         (WebCore::MathMLPaddedElement::width): Expose width attribute as a MathMLLength until mpadded
201         pseudo-units are supported.
202         (WebCore::MathMLPaddedElement::height): Ditto.
203         (WebCore::MathMLPaddedElement::depth): Ditto
204         (WebCore::MathMLPaddedElement::lspace): Ditto.
205         (WebCore::MathMLPaddedElement::voffset): Ditto.
206         (WebCore::MathMLPaddedElement::parseAttribute): Make length attribute dirty.
207         (WebCore::MathMLPaddedElement::createElementRenderer): Moved code from MathMLInlineContainerElement.
208         * mathml/MathMLPaddedElement.h: Added.
209         * mathml/mathtags.in: Map mapdded to MathMLPaddedElement.
210         * rendering/mathml/RenderMathMLPadded.cpp:
211         (WebCore::RenderMathMLPadded::resolveWidth): Helper function to resolve width.
212         (WebCore::RenderMathMLPadded::resolveAttributes): Helper function to resolve all attributes.
213         (WebCore::RenderMathMLPadded::computePreferredLogicalWidths): Use resolveWidth.
214         (WebCore::RenderMathMLPadded::layoutBlock): Use resolveAttributes.
215         * rendering/mathml/RenderMathMLPadded.h: Add new helper functions to access attributes from
216         the MathMLPaddedElement class.
217
218 2016-07-12  Andreas Kling  <akling@apple.com>
219
220         [Cocoa] Simulated memory warning doesn't trigger libcache purge.
221         <https://webkit.org/b/159688>
222
223         Reviewed by Chris Dumez.
224
225         Since simulated memory warnings will have the "is under memory pressure" flag set,
226         we were skipping the libcache purge call.
227
228         Add a separate flag that tracks whether we're under simulated pressure, and always
229         prod libcache in that case.
230
231         * platform/MemoryPressureHandler.h:
232         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
233         (WebCore::MemoryPressureHandler::platformReleaseMemory):
234         (WebCore::MemoryPressureHandler::install):
235
236 2016-07-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
237
238         Purge PassRefPtr in Modules/webdatabase
239         https://bugs.webkit.org/show_bug.cgi?id=159255
240
241         Reviewed by Benjamin Poulain.
242
243         As a step to remove PassRefPtr use, this patch cleans it up in Modules/webdatabase.
244
245         Additionally unnecessary spaces and tabs are removed too.
246
247         * Modules/webdatabase/ChangeVersionWrapper.cpp:
248         * Modules/webdatabase/DOMWindowWebDatabase.h:
249         * Modules/webdatabase/Database.cpp:
250         (WebCore::Database::Database):
251         (WebCore::Database::~Database):
252         (WebCore::Database::scheduleTransaction):
253         (WebCore::Database::runTransaction):
254         * Modules/webdatabase/Database.h:
255         * Modules/webdatabase/DatabaseAuthorizer.cpp:
256         (WebCore::DatabaseAuthorizer::allowRead):
257         * Modules/webdatabase/DatabaseManager.cpp:
258         (WebCore::DatabaseManager::openDatabase):
259         (WebCore::DatabaseManager::fullPathForDatabase):
260         (WebCore::DatabaseManager::detailsForNameAndOrigin):
261         * Modules/webdatabase/DatabaseManager.h:
262         * Modules/webdatabase/DatabaseTask.cpp:
263         (WebCore::DatabaseTransactionTask::DatabaseTransactionTask):
264         * Modules/webdatabase/DatabaseTask.h:
265         * Modules/webdatabase/SQLCallbackWrapper.h:
266         (WebCore::SQLCallbackWrapper::SQLCallbackWrapper):
267         * Modules/webdatabase/SQLResultSetRowList.h:
268         * Modules/webdatabase/SQLStatement.cpp:
269         (WebCore::SQLStatement::SQLStatement):
270         (WebCore::SQLStatement::sqlError):
271         (WebCore::SQLStatement::sqlResultSet):
272         * Modules/webdatabase/SQLStatement.h:
273         * Modules/webdatabase/SQLTransaction.h:
274         * Modules/webdatabase/SQLTransactionBackend.cpp:
275         (WebCore::SQLTransactionBackend::create):
276         (WebCore::SQLTransactionBackend::SQLTransactionBackend):
277         (WebCore::SQLTransactionBackend::transactionError):
278         * Modules/webdatabase/SQLTransactionBackend.h:
279
280 2016-07-11  Dean Jackson  <dino@apple.com>
281
282         REGRESSION (202694): Audio and Video playback controls: Cannot find a position slider to adjust playback position using VO.
283         https://bugs.webkit.org/show_bug.cgi?id=159661
284         <rdar://problem/27285135>
285
286         Reviewed by Eric Carlson.
287
288         The change in r202694 caused MediaDocuments to not always
289         show their scrubber. The fix is to reduce the minimum amount
290         of size needed to show the scrubber.
291
292         Test: media/controls/default-size-should-show-scrubber.html
293
294         * Modules/mediacontrols/mediaControlsApple.js: 80 pixels is enough
295         to show the scrubber.
296
297 2016-07-12  Frederic Wang  <fwang@igalia.com>
298
299         Move MathMLOperatorDictionary from rendering to DOM
300         https://bugs.webkit.org/show_bug.cgi?id=159619
301
302         Reviewed by Brent Fulgham.
303
304         No new tests, behavior is unchanged.
305
306         * CMakeLists.txt: Use the new location of MathMLOperatorDictionary files.
307         * WebCore.xcodeproj/project.pbxproj: Ditto.
308         * mathml/MathMLAllInOne.cpp: Add MathMLOperatorDictionary.cpp
309         * mathml/MathMLOperatorDictionary.cpp: Renamed from Source/WebCore/rendering/mathml/MathMLOperatorDictionary.cpp.
310         * mathml/MathMLOperatorDictionary.h: Renamed from Source/WebCore/rendering/mathml/MathMLOperatorDictionary.h.
311
312 2016-07-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
313
314         Remove ENABLE_CSS3_TEXT_LINE_BREAK flag
315         https://bugs.webkit.org/show_bug.cgi?id=159671
316
317         Reviewed by Csaba Osztrogonác.
318
319         ENABLE_CSS3_TEXT_LINE_BREAK feature was implemented without guards.
320         https://bugs.webkit.org/show_bug.cgi?id=89235
321
322         So this guard can be removed in build scripts.
323
324         * Configurations/FeatureDefines.xcconfig:
325
326 2016-07-12  Commit Queue  <commit-queue@webkit.org>
327
328         Unreviewed, rolling out r203059.
329         https://bugs.webkit.org/show_bug.cgi?id=159673
330
331         B and R channels now swapped on desktop GL builds (Requested
332         by philn on #webkit).
333
334         Reverted changeset:
335
336         "Red and blue colors are swapped in video rendered through
337         WebGL when GSTREAMER_GL is enabled"
338         https://bugs.webkit.org/show_bug.cgi?id=159621
339         http://trac.webkit.org/changeset/203059
340
341 2016-07-12  Yoav Weiss  <yoav@yoav.ws>
342
343         js/dom/global-constructors-attributes.html is flaky: ResourceTiming runtime feature leaks between tests
344         https://bugs.webkit.org/show_bug.cgi?id=158902
345
346         Reviewed by Benjamin Poulain.
347
348         Adds a new reset() mechanism to RuntimeEnabledFeatures so that they could be brought back to the initial state.
349         This reset() is then called from DumpRenderTree and WebKitTestRunner.
350
351         No new tests but hopefully current tests will be less flaky.
352
353         * bindings/generic/RuntimeEnabledFeatures.cpp:
354         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
355         (WebCore::RuntimeEnabledFeatures::reset):
356         * bindings/generic/RuntimeEnabledFeatures.h:
357         * testing/Internals.cpp:
358         (WebCore::Internals::resetToConsistentState): reset RuntimeEnabledFeatures.
359
360 2016-07-11  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
361
362         Purge PassRefPtr in platform/efl and platform/mac 
363         https://bugs.webkit.org/show_bug.cgi?id=159548
364
365         Reviewed by Alex Christensen.
366
367         Remove all use of PassRefPtr and clean up unnecessary tabs and spaces.
368         WebKit2 codes are also changed because of setBufferForType()'s modification.
369
370         No new tests, no behavior changes.
371
372         * platform/PasteboardStrategy.h:
373         * platform/PlatformPasteboard.h:
374         * platform/PlatformSpeechSynthesizer.h:
375         * platform/SerializedPlatformRepresentation.h:
376         * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
377         (WebCore::PlatformSpeechSynthesisProviderEfl::speak):
378         * platform/efl/PlatformSpeechSynthesisProviderEfl.h:
379         * platform/efl/PlatformSpeechSynthesizerEfl.cpp:
380         (WebCore::PlatformSpeechSynthesizer::speak):
381         * platform/ios/PlatformPasteboardIOS.mm:
382         (WebCore::PlatformPasteboard::setBufferForType):
383         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
384         (SOFT_LINK_CONSTANT):
385         (-[WebSpeechSynthesisWrapper initWithSpeechSynthesizer:]):
386         (-[WebSpeechSynthesisWrapper mapSpeechRateToPlatformRate:]):
387         (-[WebSpeechSynthesisWrapper speakUtterance:]):
388         (-[WebSpeechSynthesisWrapper pause]):
389         (-[WebSpeechSynthesisWrapper resume]):
390         (-[WebSpeechSynthesisWrapper cancel]):
391         (-[WebSpeechSynthesisWrapper speechSynthesizer:didStartSpeechUtterance:]):
392         (-[WebSpeechSynthesisWrapper speechSynthesizer:didFinishSpeechUtterance:]):
393         (-[WebSpeechSynthesisWrapper speechSynthesizer:didPauseSpeechUtterance:]):
394         (-[WebSpeechSynthesisWrapper speechSynthesizer:didContinueSpeechUtterance:]):
395         (-[WebSpeechSynthesisWrapper speechSynthesizer:didCancelSpeechUtterance:]):
396         (-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakRangeOfSpeechString:utterance:]):
397         (WebCore::PlatformSpeechSynthesizer::speak):
398         * platform/mac/PasteboardMac.mm:
399         (WebCore::Pasteboard::write):
400         * platform/mac/PlatformPasteboardMac.mm:
401         (WebCore::PlatformPasteboard::getTypes):
402         (WebCore::PlatformPasteboard::getPathnamesForType):
403         (WebCore::PlatformPasteboard::color):
404         (WebCore::PlatformPasteboard::copy):
405         (WebCore::PlatformPasteboard::setBufferForType):
406         (WebCore::PlatformPasteboard::setPathnamesForType):
407         * platform/mac/PlatformSpeechSynthesizerMac.mm:
408         (-[WebSpeechSynthesisWrapper initWithSpeechSynthesizer:]):
409         (-[WebSpeechSynthesisWrapper speakUtterance:]):
410         (-[WebSpeechSynthesisWrapper pause]):
411         (-[WebSpeechSynthesisWrapper resume]):
412         (-[WebSpeechSynthesisWrapper cancel]):
413         (-[WebSpeechSynthesisWrapper speechSynthesizer:didFinishSpeaking:]):
414         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
415         (WebCore::PlatformSpeechSynthesizer::speak):
416         * platform/mac/SerializedPlatformRepresentationMac.h:
417         * platform/mac/SerializedPlatformRepresentationMac.mm:
418         (WebCore::SerializedPlatformRepresentationMac::data):
419         (WebCore::jsValueWithValueInContext):
420         * platform/mock/PlatformSpeechSynthesizerMock.cpp:
421         (WebCore::PlatformSpeechSynthesizerMock::speakingFinished):
422         (WebCore::PlatformSpeechSynthesizerMock::speak):
423         (WebCore::PlatformSpeechSynthesizerMock::cancel):
424         * platform/mock/PlatformSpeechSynthesizerMock.h:
425
426 2016-07-11  Frederic Wang  <fwang@igalia.org>
427
428         Move parsing of mspace attributes to a MathMLSpaceElement class
429         https://bugs.webkit.org/show_bug.cgi?id=156795
430
431         Reviewed by Brent Fulgham.
432
433         No new tests, already covered by existing tests.
434
435         * CMakeLists.txt: Add MathMLSpaceElement to the build system.
436         * WebCore.xcodeproj/project.pbxproj: Ditto.
437         * mathml/MathMLElement.cpp:
438         (WebCore::MathMLElement::cachedMathMLLength): Helper function to returned the cached parsed
439         value of a MathML length and parsing the corresponding attribute value if the cache is dirty.
440         * mathml/MathMLElement.h: Add a dirty boolean to MathML Length structure. Declare cachedMathMLLength.
441         * mathml/MathMLSpaceElement.cpp: New class for the <mspace> element.
442         (WebCore::MathMLSpaceElement::MathMLSpaceElement):
443         (WebCore::MathMLSpaceElement::create):
444         (WebCore::MathMLSpaceElement::parseAttribute): Make width, height, depth attributes dirty.
445         (WebCore::MathMLSpaceElement::createElementRenderer):
446         * mathml/MathMLSpaceElement.h: New class for the <mspace> element.
447         We define MathML lengths for width, height and depth attributes are on the class and expose
448         with the corresponding helper functions via memoization.
449         * mathml/MathMLTextElement.cpp: Remove handling of mspace from this class.
450         (WebCore::MathMLTextElement::createElementRenderer):
451         * mathml/mathtags.in: Change the interface for mspace to use the new class.
452         * rendering/mathml/RenderMathMLSpace.cpp: Do not store width/height/depth values on the
453         renderer and instead just use the corresponding MathML lengths on the element class.
454         (WebCore::RenderMathMLSpace::RenderMathMLSpace): Use MathMLSpaceElement and remove member
455         initialization.
456         (WebCore::RenderMathMLSpace::computePreferredLogicalWidths): Use spaceWidth().
457         (WebCore::RenderMathMLSpace::spaceWidth): Helper function to resolve the width attribute value.
458         (WebCore::RenderMathMLSpace::getSpaceHeightAndDepth): Ditto for height and depth.
459         (WebCore::RenderMathMLSpace::layoutBlock): Use the helper functions to get the mspace metrics.
460         (WebCore::RenderMathMLSpace::firstLineBaseline): Ditto.
461         (WebCore::RenderMathMLSpace::updateFromElement): Deleted.
462         (WebCore::RenderMathMLSpace::styleDidChange): Deleted.
463         * rendering/mathml/RenderMathMLSpace.h: Use MathMLSpaceElement, replace members with helper
464         functions and and make element() usable from a const instance.
465
466 2016-07-11  Frederic Wang  <fwang@igalia.org>
467
468         Create a MathMLLength struct to handle the parsing of MathML length.
469         https://bugs.webkit.org/show_bug.cgi?id=156792
470
471         Reviewed by Brent Fulgham.
472
473         We introduce a structure for MathML lengths that will be used in the future to store the
474         parsed values in the MathElement class. We also rewrite the parsing function for MathML
475         lengths in order to improve efficiency and code reuse. This function is moved into the
476         MathElement class and only the conversion to LayoutUnit remains in the renderer classes.
477
478         No new tests, already covered by existing tests.
479
480         * mathml/MathMLElement.cpp:
481         (WebCore::parseNamedSpace): Helper function to parse a named space.
482         (WebCore::MathMLElement::parseMathMLLength): Parsing function for MathML lengths.
483         * mathml/MathMLElement.h: Declare new function and structure to handle MathML lengths.
484         * rendering/mathml/RenderMathMLBlock.cpp:
485         (WebCore::toUserUnits): Helper function to resolve a MathML length.
486         (WebCore::parseMathMLLength): Remove the old parsing code and just use MathMLElement::parseMathMLLength and toUserUnits instead.
487         (WebCore::parseMathMLNamedSpace): Deleted.
488         * rendering/mathml/RenderMathMLBlock.h: Remove unused function.
489
490 2016-07-11  Frederic Wang  <fwang@igalia.com>
491
492         Add support for @href attribute in MathML
493         https://bugs.webkit.org/show_bug.cgi?id=85733
494
495         Reviewed by Brent Fulgham.
496
497         We add support for the href attribute from MathML 3 but ignore the deprecated XLink version.
498         We also use the code from HTMLAnchorElement SVGAElement to make MathMLElement with a href
499         attribute behave as a link.
500         Finally, we adjust mathml.css based on rules from the html and svg user agent stylesheets.
501
502         Tests: mathml/mathml-in-html5/href-click-1.html
503                mathml/mathml-in-html5/href-click-2.html
504                mathml/presentation/href-enter.html
505                mathml/presentation/href-style.html
506                mathml/presentation/maction-toggle-href.html
507                mathml/presentation/semantics-href.html
508
509         * css/mathml.css:
510         (:any-link): Set color and mouse cursor of links.
511         (:any-link:active): Set color of active links.
512         (:focus): Set outline of focused links.
513         * mathml/MathMLElement.cpp:
514         (WebCore::MathMLElement::parseAttribute): Parse the href attribute.
515         (WebCore::MathMLElement::willRespondToMouseClickEvents): Based on HTMLAnchorElement/SVGAElement.
516         (WebCore::MathMLElement::defaultEventHandler): Based on HTMLAnchorElement/SVGAElement.
517         (WebCore::MathMLElement::canStartSelection): Based on HTMLAnchorElement/SVGAElement.
518         (WebCore::MathMLElement::isFocusable): Based on HTMLAnchorElement/SVGAElement.
519         (WebCore::MathMLElement::isKeyboardFocusable): Based on HTMLAnchorElement/SVGAElement.
520         (WebCore::MathMLElement::isMouseFocusable): Based on HTMLAnchorElement/SVGAElement.
521         (WebCore::MathMLElement::isURLAttribute): Based on HTMLAnchorElement/SVGAElement.
522         (WebCore::MathMLElement::supportsFocus): Based on HTMLAnchorElement/SVGAElement.
523         (WebCore::MathMLElement::tabIndex): Based on HTMLAnchorElement/SVGAElement.
524         * mathml/MathMLElement.h: Define new members.
525         * mathml/MathMLSelectElement.cpp:
526         (WebCore::MathMLSelectElement::willRespondToMouseClickEvents): We also verify whether
527         the parent class will respond.
528         * mathml/mathattrs.in: Add href attribute.
529
530 2016-07-11  Sam Weinig  <sam@webkit.org>
531
532         Speech Synthesis: getting list of voices no longer works
533         <rdar://problem/22954120>
534         https://bugs.webkit.org/show_bug.cgi?id=159656
535
536         Reviewed by Tim Horton.
537
538         * platform/PlatformSpeechSynthesizer.h:
539         * platform/mac/PlatformSpeechSynthesizerMac.mm:
540         Default initialize m_voiceListIsInitialized to false so it is
541         initialized on both Mac and iOS. Remove the explicit initialization
542         from the Mac.
543
544 2016-07-11  Simon Fraser  <simon.fraser@apple.com>
545
546         <rdar://problem/27285599> REGRESSION: Assertion under CertificateInfo::trust() every time I focus a text field
547
548         Reviewed by Sam Weinig.
549
550         The assertion added to CertificateInfo::trust() in r203040 is wrong, and is triggered when
551         focusing a form field via calls to -[WKWebProcessPlugInFrame _serverTrust], so remove it.
552
553         * platform/network/cf/CertificateInfo.h:
554         (WebCore::CertificateInfo::trust):
555
556 2016-07-11  Simon Fraser  <simon.fraser@apple.com>
557
558         Deleting in a text input inside an iframe causes the page to scroll incorrectly
559         https://bugs.webkit.org/show_bug.cgi?id=159654
560         rdar://problem/26805722
561
562         Reviewed by Zalan Bujtas.
563
564         Editor::revealSelectionAfterEditingOperation() needs the same iOS-specific reveal
565         behavior as was added for typing in r202295.
566
567         Test: fast/forms/ios/delete-in-input-in-iframe.html
568
569         * editing/Editor.cpp:
570         (WebCore::Editor::revealSelectionAfterEditingOperation):
571
572 2016-07-11  Andy Estes  <aestes@apple.com>
573
574         Fix indentation in FrameLoaderTypes.h
575         https://bugs.webkit.org/show_bug.cgi?id=159650
576
577         Reviewed by Brady Eidson.
578
579         * loader/FrameLoaderTypes.h:
580
581 2016-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
582
583         Honor the second argument to FontFaceSet.load and FontFaceSet.check
584         https://bugs.webkit.org/show_bug.cgi?id=159607
585         <rdar://problem/27284902>
586
587         Reviewed by Zalan Bujtas.
588
589         This second argument is used in conjunction with the unicode-range CSS property, so that
590         loading from a FontFaceSet only loads the fonts which actually match the characters given.
591         Previously, we hadn't implemented proper support for this unicode-range property, but now
592         that we have implemented it, we should honor this second argument.
593
594         Test: fast/text/unicode-range-javascript.html
595
596         * css/CSSFontFace.cpp:
597         (WebCore::CSSFontFace::rangesMatchCodePoint):
598         * css/CSSFontFace.h:
599         * css/CSSFontFaceSet.cpp:
600         (WebCore::codePointsFromString):
601         (WebCore::CSSFontFaceSet::matchingFaces):
602
603 2016-07-11  Zalan Bujtas  <zalan@apple.com>
604
605         Unable to edit fields or drag to select text in Dashboard widgets.
606         https://bugs.webkit.org/show_bug.cgi?id=159647
607         <rdar://problem/26941698>
608
609         Reviewed by Brent Fulgham.
610
611         RenderObject::computeAbsoluteRepaintRect's first paramenter is no longer in/out. Use the return
612         value to set the clip on the dashboard region.
613
614         Not testable.
615
616         * rendering/RenderInline.cpp:
617         (WebCore::RenderInline::addAnnotatedRegions):
618         * rendering/RenderObject.cpp:
619         (WebCore::RenderObject::addAnnotatedRegions):
620
621 2016-07-11  Chris Dumez  <cdumez@apple.com>
622
623         Potential null dereference under DocumentLoader::mainReceivedError()
624         https://bugs.webkit.org/show_bug.cgi?id=159640
625         <rdar://problem/27283372>
626
627         Reviewed by Brady Eidson.
628
629         Move frameLoader() null check a bit earlier in DocumentLoader::mainReceivedError()
630         as it was dereferenced before the check.
631
632         * loader/DocumentLoader.cpp:
633         (WebCore::DocumentLoader::mainReceivedError):
634
635 2016-07-11  Enrica Casucci  <enrica@apple.com>
636
637         Add synthetic click origin to WKNavigationAction.
638         https://bugs.webkit.org/show_bug.cgi?id=159584
639         rdar://problem/25610422
640
641         Reviewed by Tim Horton.
642
643         Adding plumbing code to pass synthetic click type
644         through WebCore.
645
646         * dom/Element.cpp:
647         (WebCore::Element::dispatchMouseEvent):
648         (WebCore::Element::dispatchMouseForceWillBegin):
649         * dom/MouseEvent.cpp:
650         (WebCore::MouseEvent::create):
651         (WebCore::MouseEvent::MouseEvent):
652         (WebCore::MouseEvent::initMouseEvent):
653         (WebCore::MouseEvent::cloneFor):
654         * dom/MouseEvent.h:
655         (WebCore::MouseEvent::createForBindings):
656         (WebCore::MouseEvent::button):
657         (WebCore::MouseEvent::syntheticClickType):
658         (WebCore::MouseEvent::buttonDown):
659         (WebCore::MouseEvent::setRelatedTarget):
660         * dom/SimulatedClick.cpp:
661         * dom/WheelEvent.cpp:
662         (WebCore::WheelEvent::WheelEvent):
663         * page/ContextMenuController.cpp:
664         (WebCore::ContextMenuController::showContextMenuAt):
665         * page/DragController.cpp:
666         (WebCore::createMouseEvent):
667         (WebCore::DragController::DragController):
668         * page/EventHandler.cpp:
669         (WebCore::EventHandler::dispatchDragEvent):
670         (WebCore::EventHandler::sendContextMenuEventForKey):
671         (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
672         * platform/PlatformMouseEvent.h:
673         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
674         (WebCore::PlatformMouseEvent::clickCount):
675         (WebCore::PlatformMouseEvent::modifierFlags):
676         (WebCore::PlatformMouseEvent::force):
677         (WebCore::PlatformMouseEvent::syntheticClickType):
678         * replay/SerializationMethods.cpp:
679         (JSC::EncodingTraits<PlatformMouseEvent>::decodeValue):
680
681 2016-07-11  Anders Carlsson  <andersca@apple.com>
682
683         Able to open multiple payment sheets in Safari at the same time
684         https://bugs.webkit.org/show_bug.cgi?id=159637
685         rdar://problem/26411339
686
687         Reviewed by Beth Dakin.
688
689         Fold PaymentCoordinator::showPaymentUI into PaymentCoordinator::beginPaymentSession and
690         change the return value of the latter member function to a bool to indicate whether the
691         payment UI could be shown (or whether it's already showing).
692
693         * Modules/applepay/ApplePaySession.cpp:
694         (WebCore::ApplePaySession::begin):
695         Check the return value of beginPaymentSession.
696
697         * Modules/applepay/PaymentCoordinator.cpp:
698         (WebCore::PaymentCoordinator::beginPaymentSession):
699         This now takes a payment session and returns a boolean.
700         (WebCore::PaymentCoordinator::showPaymentUI): Deleted.
701
702         * Modules/applepay/PaymentCoordinator.h:
703         * Modules/applepay/PaymentCoordinatorClient.h:
704         * loader/EmptyClients.cpp:
705         The showPaymentUI client function now returns a bool.
706
707 2016-07-11  Nan Wang  <n_wang@apple.com>
708
709         AX: Crash when backspacing in number field with spin button
710         https://bugs.webkit.org/show_bug.cgi?id=157830
711
712         Reviewed by Chris Fleizach.
713
714         It's possible to access spin button parts after they've been detached from their parent, which can lead to crashes.
715         This adds in a number of redundant safeguards to prevent this and other cases in the future.
716
717         Test: accessibility/spinbutton-crash.html
718
719         * accessibility/AccessibilitySpinButton.cpp:
720         (WebCore::AccessibilitySpinButton::incrementButton):
721         (WebCore::AccessibilitySpinButton::decrementButton):
722         (WebCore::AccessibilitySpinButton::addChildren):
723
724 2016-07-11  Chris Dumez  <cdumez@apple.com>
725
726         Possible null dereference under EventHandler::dispatchMouseEvent()
727         https://bugs.webkit.org/show_bug.cgi?id=159632
728         <rdar://problem/27247619>
729
730         Reviewed by Andreas Kling.
731
732         FrameSelection::toNormalizedRange() can return null even when FrameSelection::isRange()
733         returns true so add a null check.
734
735         * page/EventHandler.cpp:
736         (WebCore::EventHandler::dispatchMouseEvent):
737
738 2016-07-11  Commit Queue  <commit-queue@webkit.org>
739
740         Unreviewed, rolling out r203064.
741         https://bugs.webkit.org/show_bug.cgi?id=159642
742
743         This change causes LayoutTest crashes on WK1 ASan (Requested
744         by ryanhaddad on #webkit).
745
746         Reverted changeset:
747
748         "Use refs for ResourceLoaders"
749         https://bugs.webkit.org/show_bug.cgi?id=159592
750         http://trac.webkit.org/changeset/203064
751
752 2016-07-11  Brent Fulgham  <bfulgham@apple.com>
753
754         [WebGL] Check for existing buffer exists for enabled vertex array attributes before permitting glDrawArrays to execute
755         https://bugs.webkit.org/show_bug.cgi?id=159590
756         <rdar://problem/26865535>
757
758         Reviewed by Dean Jackson.
759
760         Test: fast/canvas/webgl/webgl-drawarrays-crash-2.html
761
762         * html/canvas/WebGLRenderingContextBase.cpp:
763         (WebCore::WebGLRenderingContextBase::validateVertexAttributes): If enabled array buffer attributes exist,
764         ensure that an array buffer has been bound.
765
766 2016-07-11  Nan Wang  <n_wang@apple.com>
767
768         AX: WKWebView should have API to prevent pinch-to-zoom always being allowed
769         https://bugs.webkit.org/show_bug.cgi?id=158364
770
771         Reviewed by Anders Carlsson.
772
773         Removed the internals settings for viewport force always user scalable.
774
775         Changes are covered in modified tests.
776
777         * testing/Internals.cpp:
778         (WebCore::Internals::resetToConsistentState):
779         (WebCore::Internals::Internals):
780         (WebCore::Internals::composedTreeAsText):
781         (WebCore::Internals::setLinkPreloadSupport):
782         (WebCore::Internals::setViewportForceAlwaysUserScalable): Deleted.
783         * testing/Internals.h:
784         * testing/Internals.idl:
785
786 2016-07-11  Frederic Wang  <fwang@igalia.com>
787
788         Use parameters from the OpenType MATH table for <munderover>
789         https://bugs.webkit.org/show_bug.cgi?id=155756
790
791         Reviewed by Brent Fulgham.
792
793         We follow the description from the MathML in HTML5 implementation
794         to improve the layout of <munderover> using some constants from the MATH table.
795
796         Tests: imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-1.html
797                imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-2.html
798                imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-3.html
799                imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-4.html
800                mathml/presentation/attributes-accent-accentunder-dynamic.html
801
802         * mathml/mathattrs.in: Add accentunder attribute.
803         * rendering/mathml/MathMLOperatorDictionary.h: Remove FIXME comment.
804         * rendering/mathml/RenderMathMLUnderOver.cpp:
805         (WebCore::RenderMathMLUnderOver::hasAccent): Helper function to determine whether
806         the over/under script should be treated as an accent.
807         (WebCore::RenderMathMLUnderOver::getVerticalParameters): Helper function to read
808         some vertical parameters from the MATH table.
809         (WebCore::RenderMathMLUnderOver::layoutBlock): Take into account the new vertical
810         parameters for the layout of <munderover>.
811         * rendering/mathml/RenderMathMLUnderOver.h: Define new helper functions.
812
813 2016-07-11  Frederic Wang  <fwang@igalia.com>
814
815         Use Stack* parameters from the OpenType MATH table
816         https://bugs.webkit.org/show_bug.cgi?id=155714
817
818         Reviewed by Brent Fulgham.
819
820         Test: mathml/mathml-in-html5/frac-parameters-2.html
821
822         * rendering/mathml/RenderMathMLFraction.cpp:
823         (WebCore::RenderMathMLFraction::updateFromElement): Set the stack parameters when
824         the line thickness is zero.
825         (WebCore::RenderMathMLFraction::layoutBlock): Correctly set the <mfrac> ascent and
826         the denominator vertical offset when the line thickness is zero.
827         (WebCore::RenderMathMLFraction::paint): Early return when we actually do not need to
828         paint any fraction bar.
829         * rendering/mathml/RenderMathMLFraction.h: Define an isStack helper function and define
830         members corresponding to stack parameters.
831
832 2016-07-11  Frederic Wang  <fwang@igalia.com>
833
834         Add support for mathvariants that cannot be emulated via CSS.
835         https://bugs.webkit.org/show_bug.cgi?id=108778
836
837         Reviewed by Brent Fulgham.
838
839         Tests: mathml/mathml-in-html5/mathvariant-transforms-1.html
840                mathml/mathml-in-html5/mathvariant-transforms-2.html
841                mathml/presentation/mathvariant-inheritance.html
842                mathml/presentation/mathvariant-tokens.html
843
844         We remove the old code to emulate partial mathvariant support via CSS and add support
845         for all mathvariant values using the technique used for implicit italic on <mi> element.
846         We also rely on the MathMLStyle class introduced earlier to support custome MathML style
847         and manage inheritance of mathvariant values.
848         The function that tries and converts one base character into a transformed mathvariant
849         character is based on similar code from Gecko:
850         http://hg.mozilla.org/mozilla-central/file/tip/layout/generic/MathMLTextRunFactory.cpp
851         Note that we only support transform on token elements with a single character, which
852         should cover the most important use cases.
853
854         * css/mathml.css: Remove the CSS rules to emulate some mathvariant values.
855         (math[mathvariant="normal"], mstyle[mathvariant="normal"], mo[mathvariant="normal"], mn[mathvariant="normal"], mi[mathvariant="normal"], mtext[mathvariant="normal"], mspace[mathvariant="normal"], ms[mathvariant="normal"]): Deleted.
856         (math[mathvariant="bold"], mstyle[mathvariant="bold"], mo[mathvariant="bold"], mn[mathvariant="bold"], mi[mathvariant="bold"], mtext[mathvariant="bold"], mspace[mathvariant="bold"], ms[mathvariant="bold"]): Deleted.
857         (math[mathvariant="italic"], mstyle[mathvariant="italic"], mo[mathvariant="italic"], mn[mathvariant="italic"], mi[mathvariant="italic"], mtext[mathvariant="italic"], mspace[mathvariant="italic"], ms[mathvariant="italic"]): Deleted.
858         (math[mathvariant="bold-italic"], mstyle[mathvariant="bold-italic"], mo[mathvariant="bold-italic"], mn[mathvariant="bold-italic"], mi[mathvariant="bold-italic"], mtext[mathvariant="bold-italic"], mspace[mathvariant="bold-italic"], ms[mathvariant="bold-italic"]): Deleted.
859         * mathml/MathMLInlineContainerElement.cpp: We resolve mathml style when mathvariant changes.
860         (WebCore::MathMLInlineContainerElement::parseAttribute):
861         * mathml/MathMLMathElement.cpp: ditto.
862         (WebCore::MathMLMathElement::parseAttribute):
863         * mathml/MathMLTextElement.cpp: ditto.
864         (WebCore::MathMLTextElement::parseAttribute):
865         * rendering/mathml/MathMLStyle.cpp: Add mathvariant property to the MathML style.
866         (WebCore::MathMLStyle::MathMLStyle): Init mathvariant to none.
867         (WebCore::MathMLStyle::getMathMLStyle): Helper function to retrieve the MathML style on a renderer.
868         (WebCore::MathMLStyle::updateStyleIfNeeded): Take into account change of mathvariant.
869         (WebCore::MathMLStyle::parseMathVariant): Helper function to parse a mathvariant attribute.
870         (WebCore::MathMLStyle::resolveMathMLStyle): Take into account mathvariant value: it is None
871         by default, inherited and can be modified via an attribute on <math>, <mstyle> or token
872         elements. We also refactor a bit to share logic between displaystyle and mathvariant.
873         (WebCore::MathMLStyle::setDisplayStyle): Deleted.
874         * rendering/mathml/MathMLStyle.h: Add mathvariant members and update declarations.
875         * rendering/mathml/RenderMathMLOperator.cpp:
876         (WebCore::RenderMathMLOperator::updateTokenContent): Call the function from the parent class
877         to consider mathvariant on <mo>.
878         * rendering/mathml/RenderMathMLToken.cpp:
879         We implement a mathVariant function to transform a base character into its transformed mathvariant:
880         - There are some regularity that allows to perform this via simple linear transforms.
881         - However, there are also many exceptions and we rely on some sorted MathVariantMapping
882         tables to handle these cases.
883         (WebCore::ExtractKey): Helper function to perform binary searches on MathVariant tables.
884         (WebCore::MathVariantMappingSearch): ditto.
885         (WebCore::mathVariant): New function to perform mathvariant transforms.
886         (WebCore::RenderMathMLToken::updateMathVariantGlyph): Use the mathVariant function to
887         perform all transformations, not just the italic one.
888         (WebCore::transformToItalic): Deleted. Replaced with the more general mathVariant function.
889
890 2016-07-11  Jeremy Jones  <jeremyj@apple.com>
891
892         Pause small video elements when returning to inline.
893         https://bugs.webkit.org/show_bug.cgi?id=159535
894
895         Reviewed by Jer Noble.
896
897         Will add a test in a later commit.
898
899         When exiting fullscreen, don't allow playback to continue inline if video is too small.
900
901         * html/HTMLMediaElement.cpp:
902         (WebCore::HTMLMediaElement::isVideoTooSmallForInlinePlayback): Added.
903         (WebCore::HTMLMediaElement::exitFullscreen): Pause if video is too small.
904         * html/HTMLMediaElement.h:
905
906 2016-07-11  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
907
908         toNative functions in JSDOMBinding.h should take an ExecState reference instead of pointer
909         https://bugs.webkit.org/show_bug.cgi?id=159298
910
911         Reviewed by Youenn Fablet.
912
913         Pass ExecState by reference instead of pointer.
914
915         * bindings/js/IDBBindingUtilities.cpp:
916         (WebCore::idbKeyPathFromValue):
917         * bindings/js/JSBlobCustom.cpp:
918         (WebCore::constructJSBlob):
919         * bindings/js/JSDOMBinding.h: Pass ExecState by reference instead of pointer.
920         (WebCore::toJSSequence):
921         (WebCore::NativeValueTraits<String>::nativeValue):
922         (WebCore::NativeValueTraits<unsigned>::nativeValue):
923         (WebCore::NativeValueTraits<float>::nativeValue):
924         (WebCore::NativeValueTraits<double>::nativeValue):
925         (WebCore::toNativeArray):
926         (WebCore::toNativeArguments):
927         * bindings/js/JSDOMConvert.h:
928         (WebCore::Converter<Vector<T>>::convert):
929         * bindings/js/JSDictionary.cpp:
930         (WebCore::JSDictionary::convertValue):
931         * bindings/js/JSFileCustom.cpp:
932         (WebCore::constructJSFile):
933         * bindings/js/JSMessagePortCustom.cpp:
934         (WebCore::fillMessagePortArray):
935         * bindings/scripts/CodeGeneratorJS.pm:
936         (GenerateParametersCheck):
937         (JSValueToNative):
938         * bindings/scripts/test/JS/JSTestObj.cpp:
939         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
940         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArray):
941         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArrayIsEmpty):
942         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
943         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
944         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
945         (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
946         (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
947         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
948         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence2):
949         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
950         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
951         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
952         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
953         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
954         (WebCore::constructJSTestOverloadedConstructors5):
955         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
956         (WebCore::jsTestTypedefsPrototypeFunctionFunc):
957         (WebCore::jsTestTypedefsPrototypeFunctionNullableArrayArg):
958         (WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction):
959         (WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction2):
960
961 2016-07-08  Alex Christensen  <achristensen@webkit.org>
962
963         Use refs for ResourceLoaders
964         https://bugs.webkit.org/show_bug.cgi?id=159592
965
966         Reviewed by Chris Dumez.
967
968         No new tests.  No change in behavior except a fixed memory leak in WebKit1.
969
970         * loader/LoaderStrategy.h:
971         * loader/ResourceLoader.cpp:
972         (WebCore::ResourceLoader::finishNetworkLoad):
973         (WebCore::ResourceLoader::setDefersLoading):
974         (WebCore::ResourceLoader::frameLoader):
975         (WebCore::ResourceLoader::willSwitchToSubstituteResource):
976         (WebCore::ResourceLoader::willSendRequestInternal):
977
978 2016-07-11  Fujii Hironori  <Hironori.Fujii@sony.com>
979
980         Using dpi unit in sizes attribute raises SIGSEGV
981         https://bugs.webkit.org/show_bug.cgi?id=159412
982
983         Reviewed by Darin Adler.
984
985         CSSParser::sourceSize returns a invalid CSSParser::SourceSize
986         whose length is a null value for a dpi unit value.  Because
987         CSSParserValue::createCSSValue returns null for a dpi value.
988
989         Tests:
990             fast/dom/HTMLImageElement/sizes/image-sizes-invalids.html
991             imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html
992
993         * css/CSSParser.cpp:
994         (WebCore::CSSParser::sourceSize): Create a CSSPrimitiveValue of
995         CSS_UNKNOWN if CSSParserValue::createCSSValue returns null.
996
997 2016-07-11  Olivier Blin  <olivier.blin@softathome.com>
998
999         Red and blue colors are swapped in video rendered through WebGL when GSTREAMER_GL is enabled
1000         https://bugs.webkit.org/show_bug.cgi?id=159621
1001
1002         Reviewed by Philippe Normand.
1003
1004         When a video is rendered through WebGL, and GSTREAMER_GL is enabled, red and blue colors are swapped.
1005         This occurs for example with the following videos:
1006         http://www.scirra.com/labs/bugs/webglvideo/
1007         http://www.dailymotion.com/embed/video/x4jiicp?autoplay=1
1008
1009         This is because ImageGStreamerCairo expects video frames in either
1010         BGRA or ARGB, while when GSTREAMER_GL is enabled,
1011         createVideoSinkGL() forces a RGBA format.
1012
1013         Without GSTREAMER_GL, the rendering is fine since
1014         VideoSinkGStreamer uses either BGRA or ARGB.
1015
1016         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1017         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
1018
1019 2016-07-11  Philippe Normand  <pnormand@igalia.com>
1020
1021         [GStreamer] remove WEBKIT_DEBUG support
1022         https://bugs.webkit.org/show_bug.cgi?id=159553
1023
1024         Reviewed by Xabier Rodriguez-Calvar.
1025
1026         Remove the *_MEDIA_MESSAGE macros specific to the GStreamer
1027         platform code and replace them with standard GST_DEBUG macros. In
1028         Debug builds the WEBKIT_DEBUG=Media logs now only contain logs
1029         related with the cross-platform Media element code. If GStreamer
1030         logs are needed, the GST_DEBUG=webkit*:5 environment variable can
1031         be used.
1032
1033         * platform/graphics/gstreamer/GStreamerUtilities.h:
1034         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
1035         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
1036         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfStreamChanged):
1037         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1038         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
1039         (WebCore::MediaPlayerPrivateGStreamer::load):
1040         (WebCore::MediaPlayerPrivateGStreamer::commitLoad):
1041         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
1042         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
1043         (WebCore::MediaPlayerPrivateGStreamer::play):
1044         (WebCore::MediaPlayerPrivateGStreamer::pause):
1045         (WebCore::MediaPlayerPrivateGStreamer::duration):
1046         (WebCore::MediaPlayerPrivateGStreamer::seek):
1047         (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
1048         (WebCore::MediaPlayerPrivateGStreamer::paused):
1049         (WebCore::MediaPlayerPrivateGStreamer::newTextSample):
1050         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1051         (WebCore::MediaPlayerPrivateGStreamer::processBufferingStats):
1052         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
1053         (WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable):
1054         (WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded):
1055         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress):
1056         (WebCore::MediaPlayerPrivateGStreamer::totalBytes):
1057         (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
1058         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
1059         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
1060         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
1061         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
1062         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1063         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1064         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize):
1065         (WebCore::MediaPlayerPrivateGStreamerBase::setVolume):
1066         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
1067         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1068         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
1069         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
1070         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
1071         (WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
1072         (WebCore::MediaPlayerPrivateGStreamerOwr::play):
1073         (WebCore::MediaPlayerPrivateGStreamerOwr::pause):
1074         (WebCore::MediaPlayerPrivateGStreamerOwr::currentTime):
1075         (WebCore::MediaPlayerPrivateGStreamerOwr::load):
1076         (WebCore::MediaPlayerPrivateGStreamerOwr::internalLoad):
1077         (WebCore::MediaPlayerPrivateGStreamerOwr::stop):
1078         (WebCore::MediaPlayerPrivateGStreamerOwr::createGSTAudioSinkBin):
1079         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded):
1080         (WebCore::MediaPlayerPrivateGStreamerOwr::trackMutedChanged):
1081         (WebCore::MediaPlayerPrivateGStreamerOwr::trackSettingsChanged):
1082         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
1083         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
1084         (WebCore::TrackPrivateBaseGStreamer::getLanguageCode):
1085         (WebCore::TrackPrivateBaseGStreamer::getTag):
1086
1087 2016-07-11  Eric Carlson  <eric.carlson@apple.com>
1088
1089         Add a test for media control dropoff
1090         https://bugs.webkit.org/show_bug.cgi?id=151287
1091         <rdar://problem/23544666>
1092
1093         Reviewed by Antoine Quint.
1094
1095         Test: media/controls/inline-elements-dropoff-order.html
1096
1097         * Modules/mediacontrols/mediaControlsApple.js: Expose more state to testing.
1098         * testing/InternalSettings.cpp:
1099         (WebCore::InternalSettings::setAllowsAirPlayForMediaPlayback): Renamed from setWirelessPlaybackDisabled.
1100         (WebCore::InternalSettings::setWirelessPlaybackDisabled): Deleted.
1101         * testing/InternalSettings.h:
1102         * testing/InternalSettings.idl:
1103
1104
1105 2016-07-11  Philippe Normand  <pnormand@igalia.com>
1106
1107         [GStreamer][GL] crash within triggerRepaint
1108         https://bugs.webkit.org/show_bug.cgi?id=159552
1109
1110         Reviewed by Xabier Rodriguez-Calvar.
1111
1112         Ensure the sizeChanged notification is emitted from the main
1113         thread. When GStreamer-GL rendering is enabled the appsink draw
1114         callbacks are fired in a non-main thread.
1115
1116         The WeakPtr support was moved to the player base class so that it
1117         can be used there as well as in the MediaPlayerPrivateGStreamer
1118         sub-class.
1119
1120         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1121         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1122         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Deleted.
1123         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1124         (WebCore::MediaPlayerPrivateGStreamer::createWeakPtr): Deleted.
1125         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1126         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
1127         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1128         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1129         (WebCore::MediaPlayerPrivateGStreamerBase::createWeakPtr):
1130
1131 2016-07-10  Chris Dumez  <cdumez@apple.com>
1132
1133         Setting document.title reuses <title>'s textnode child
1134         https://bugs.webkit.org/show_bug.cgi?id=28864
1135         <rdar://problem/7186473>
1136
1137         Reviewed by Benjamin Poulain.
1138
1139         Setting document.title should be equivalent to setting the 'textContent'
1140         IDL attribute of the <title> element:
1141         - https://html.spec.whatwg.org/multipage/dom.html#document.title
1142
1143         In particular, this means we should always create a new Text node and
1144         replace all the <title>'s children with this new Node, as per:
1145         - https://dom.spec.whatwg.org/#dom-node-textcontent
1146
1147         Previously, WebKit would in some cases reuse the existing <title>'s
1148         Text node and merely update its data.
1149
1150         Firefox and Chrome behave as per the specification so this aligns our
1151         behavior with other major browsers as well.
1152
1153         Test: fast/dom/title-setter-new-text-node.html
1154
1155         * dom/Document.cpp:
1156         (WebCore::Document::setTitle):
1157         - Call Node::setTextContent() instead of HTMLTitleElement::setText(),
1158           as per the specification.
1159         - Take an ExceptionCode parameter and pass it to Node::setTextContent()
1160           as it may throw.
1161
1162         * dom/Document.h:
1163         * dom/Document.idl:
1164
1165         * html/HTMLTitleElement.cpp:
1166         (WebCore::HTMLTitleElement::setText):
1167         Update implementation of HTMLTitleElement::setText() to call
1168         setTextContent() as per the specification:
1169         - https://html.spec.whatwg.org/multipage/semantics.html#dom-title-text
1170
1171         * html/HTMLTitleElement.h:
1172         * html/HTMLTitleElement.idl:
1173
1174         * html/ImageDocument.cpp:
1175         (WebCore::ImageDocument::finishedParsing):
1176
1177         * svg/SVGTitleElement.cpp:
1178         * svg/SVGTitleElement.h:
1179         Drop setText() setter which was duplicated from HTMLTitleElement::setText()
1180         now that Document::setTitle() calls SVGTitleElement::setTextContent()
1181         instead.
1182
1183 2016-07-10  Zalan Bujtas  <zalan@apple.com>
1184
1185         Fix LogicalSelectionOffsetCaches to work with detached render tree.
1186         https://bugs.webkit.org/show_bug.cgi?id=159605
1187         <rdar://problem/27248845>
1188
1189         Reviewed by Brent Fulgham.
1190
1191         When the renderer that is being destroyed is on a selection boundary,
1192         we need to ensure that all its cached pointers across the selection code (e.g. SelectionSubtreeData)
1193         are getting reset. In order to do that, we call clearSelection() on the RenderView.
1194         One of the last steps of clearing selection is to collect the selection gaps. Selection gaps uses this
1195         LogicalSelectionOffsetCaches helper class to collect selection information across blocks.
1196         LogicalSelectionOffsetCaches normally operates on rooted renderers. However we need to ensure sure that
1197         it can also handle renderers that are no longer part of the render tree.
1198
1199         Test: fast/text/selection-on-a-detached-tree.html
1200
1201         * rendering/LogicalSelectionOffsetCaches.h:
1202         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock):
1203         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::logicalLeftSelectionOffset):
1204         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::logicalRightSelectionOffset):
1205         * rendering/RenderBlock.cpp:
1206         (WebCore::RenderBlock::logicalLeftSelectionOffset):
1207         (WebCore::RenderBlock::logicalRightSelectionOffset):
1208
1209 2016-07-10  Chris Dumez  <cdumez@apple.com>
1210
1211         adoptNode() changes css class to lowercase for document loaded with XHR responseType = "document"
1212         https://bugs.webkit.org/show_bug.cgi?id=159555
1213         <rdar://problem/27252541>
1214
1215         Reviewed by Benjamin Poulain.
1216
1217         Follow-up on r203018 which was incomplete. We need to update ElementData's
1218         m_classNames / m_idForStyleResolution when the source document is in strict
1219         mode and the destination document is in quirks mode as well.
1220
1221         Test: fast/dom/Document/adoptNode-quirks-mismatch2.html
1222
1223         * dom/Element.cpp:
1224         (WebCore::Element::didMoveToNewDocument):
1225
1226 2016-07-10  Sam Weinig  <sam@webkit.org>
1227
1228         Rename isEmojiModifier to isEmojiFitzpatrickModifier to better capture its function
1229         https://bugs.webkit.org/show_bug.cgi?id=159610
1230
1231         Reviewed by Dan Bernstein.
1232
1233         * platform/graphics/FontCascade.cpp:
1234         (WebCore::FontCascade::characterRangeCodePath):
1235         * platform/graphics/mac/ComplexTextController.cpp:
1236         (WebCore::advanceByCombiningCharacterSequence):
1237         Update for rename.
1238
1239         * platform/text/CharacterProperties.h:
1240         (WebCore::isEmojiGroupCandidate):
1241         (WebCore::isEmojiFitzpatrickModifier):
1242         (WebCore::isVariationSelector):
1243         Rename isEmojiModifier -> isEmojiFitzpatrickModifier. Also add some comments
1244         explaining what the characters these predicate act on to demystify them a bit.
1245
1246         * rendering/RenderText.cpp:
1247         (WebCore::RenderText::previousOffsetForBackwardDeletion):
1248         Update for rename and rename a related variable.
1249
1250 2016-07-10  Alex Christensen  <achristensen@webkit.org>
1251
1252         Fix client certificate authentication after r200463
1253         https://bugs.webkit.org/show_bug.cgi?id=159574
1254         <rdar://problem/26931006>
1255
1256         Reviewed by Sam Weinig.
1257
1258         No new tests.  We really need a test for this
1259
1260         * platform/network/cf/CertificateInfo.h:
1261         (WebCore::CertificateInfo::CertificateInfo):
1262         (WebCore::CertificateInfo::trust):
1263         Make sure we only get the trust for Trust type CertificateInfos.  
1264         If we mix up our types, we get unexpected nullptrs, which will cause authentication to fail.
1265
1266 2016-07-10  Myles C. Maxfield  <mmaxfield@apple.com>
1267
1268         Fix Windows build after r203038
1269
1270         Unreviewed.
1271
1272         * platform/text/TextAllInOne.cpp:
1273
1274 2016-07-10  Myles C. Maxfield  <mmaxfield@apple.com>
1275
1276         Move breaking iterator code to WTF
1277         https://bugs.webkit.org/show_bug.cgi?id=159594
1278
1279         Reviewed by Alex Christensen.
1280
1281         This is in preparation for giving StringView a GraphemeClusters iterator.
1282         Such an interator needs to be implemented on top of our breaking iterator
1283         code.
1284
1285         No new tests because there is no behavior change.
1286
1287         * CMakeLists.txt:
1288         * PlatformEfl.cmake:
1289         * PlatformGTK.cmake:
1290         * PlatformMac.cmake:
1291         * PlatformWin.cmake:
1292         * WebCore.xcodeproj/project.pbxproj:
1293         * dom/CharacterData.cpp:
1294         * editing/TextCheckingHelper.cpp:
1295         * editing/TextIterator.cpp:
1296         * editing/VisibleUnits.cpp:
1297         * html/HTMLInputElement.cpp:
1298         * html/HTMLTextAreaElement.cpp:
1299         * html/InputType.cpp:
1300         * html/TextFieldInputType.cpp:
1301         * html/TextInputType.cpp:
1302         * platform/LocalizedStrings.cpp:
1303         * platform/graphics/StringTruncator.cpp:
1304         * platform/graphics/cg/ColorCG.cpp:
1305         (WTF::RetainPtr<CGColorRef>>::createValueForKey):
1306         (WebCore::RetainPtr<CGColorRef>>::createValueForKey): Deleted.
1307         * platform/graphics/mac/ComplexTextController.cpp:
1308         * platform/text/LineBreakIteratorPoolICU.h:
1309         (WebCore::LineBreakIteratorPool::LineBreakIteratorPool): Deleted.
1310         (WebCore::LineBreakIteratorPool::sharedPool): Deleted.
1311         (WebCore::LineBreakIteratorPool::makeLocaleWithBreakKeyword): Deleted.
1312         (WebCore::LineBreakIteratorPool::take): Deleted.
1313         (WebCore::LineBreakIteratorPool::put): Deleted.
1314         * platform/text/TextBoundaries.cpp:
1315         * platform/text/TextBreakIterator.cpp:
1316         (WebCore::initializeIterator): Deleted.
1317         (WebCore::initializeIteratorWithRules): Deleted.
1318         (WebCore::setTextForIterator): Deleted.
1319         (WebCore::setContextAwareTextForIterator): Deleted.
1320         (WebCore::wordBreakIterator): Deleted.
1321         (WebCore::sentenceBreakIterator): Deleted.
1322         (WebCore::cursorMovementIterator): Deleted.
1323         (WebCore::acquireLineBreakIterator): Deleted.
1324         (WebCore::releaseLineBreakIterator): Deleted.
1325         (WebCore::mapLineIteratorModeToRules): Deleted.
1326         (WebCore::isCJKLocale): Deleted.
1327         (WebCore::openLineBreakIterator): Deleted.
1328         (WebCore::closeLineBreakIterator): Deleted.
1329         (WebCore::compareAndSwapNonSharedCharacterBreakIterator): Deleted.
1330         (WebCore::NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator): Deleted.
1331         (WebCore::NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator): Deleted.
1332         (WebCore::textBreakFirst): Deleted.
1333         (WebCore::textBreakLast): Deleted.
1334         (WebCore::textBreakNext): Deleted.
1335         (WebCore::textBreakPrevious): Deleted.
1336         (WebCore::textBreakPreceding): Deleted.
1337         (WebCore::textBreakFollowing): Deleted.
1338         (WebCore::textBreakCurrent): Deleted.
1339         (WebCore::isTextBreak): Deleted.
1340         (WebCore::isWordTextBreak): Deleted.
1341         (WebCore::numGraphemeClusters): Deleted.
1342         (WebCore::numCharactersInGraphemeClusters): Deleted.
1343         * platform/text/TextBreakIterator.h:
1344         (WebCore::LazyLineBreakIterator::LazyLineBreakIterator): Deleted.
1345         (WebCore::LazyLineBreakIterator::~LazyLineBreakIterator): Deleted.
1346         (WebCore::LazyLineBreakIterator::string): Deleted.
1347         (WebCore::LazyLineBreakIterator::isLooseCJKMode): Deleted.
1348         (WebCore::LazyLineBreakIterator::lastCharacter): Deleted.
1349         (WebCore::LazyLineBreakIterator::secondToLastCharacter): Deleted.
1350         (WebCore::LazyLineBreakIterator::setPriorContext): Deleted.
1351         (WebCore::LazyLineBreakIterator::updatePriorContext): Deleted.
1352         (WebCore::LazyLineBreakIterator::resetPriorContext): Deleted.
1353         (WebCore::LazyLineBreakIterator::priorContextLength): Deleted.
1354         (WebCore::LazyLineBreakIterator::get): Deleted.
1355         (WebCore::LazyLineBreakIterator::resetStringAndReleaseIterator): Deleted.
1356         (WebCore::NonSharedCharacterBreakIterator::operator TextBreakIterator*): Deleted.
1357         * platform/text/cf/HyphenationCF.cpp:
1358         * platform/text/efl/TextBreakIteratorInternalICUEfl.cpp:
1359         (WebCore::currentSearchLocaleID): Deleted.
1360         (WebCore::currentTextBreakLocaleID): Deleted.
1361         * platform/text/enchant/TextCheckerEnchant.cpp:
1362         * platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp:
1363         (WebCore::currentSearchLocaleID): Deleted.
1364         (WebCore::currentTextBreakLocaleID): Deleted.
1365         * platform/text/icu/UTextProvider.cpp:
1366         (WebCore::fixPointer): Deleted.
1367         (WebCore::uTextCloneImpl): Deleted.
1368         * platform/text/icu/UTextProvider.h:
1369         (WebCore::uTextProviderContext): Deleted.
1370         (WebCore::initializeContextAwareUTextProvider): Deleted.
1371         (WebCore::uTextAccessPinIndex): Deleted.
1372         (WebCore::uTextAccessInChunkOrOutOfRange): Deleted.
1373         * platform/text/icu/UTextProviderLatin1.cpp:
1374         (WebCore::uTextLatin1Clone): Deleted.
1375         (WebCore::uTextLatin1NativeLength): Deleted.
1376         (WebCore::uTextLatin1Access): Deleted.
1377         (WebCore::uTextLatin1Extract): Deleted.
1378         (WebCore::uTextLatin1MapOffsetToNative): Deleted.
1379         (WebCore::uTextLatin1MapNativeIndexToUTF16): Deleted.
1380         (WebCore::uTextLatin1Close): Deleted.
1381         (WebCore::openLatin1UTextProvider): Deleted.
1382         (WebCore::textLatin1ContextAwareGetCurrentContext): Deleted.
1383         (WebCore::textLatin1ContextAwareMoveInPrimaryContext): Deleted.
1384         (WebCore::textLatin1ContextAwareSwitchToPrimaryContext): Deleted.
1385         (WebCore::textLatin1ContextAwareMoveInPriorContext): Deleted.
1386         (WebCore::textLatin1ContextAwareSwitchToPriorContext): Deleted.
1387         (WebCore::uTextLatin1ContextAwareClone): Deleted.
1388         (WebCore::uTextLatin1ContextAwareNativeLength): Deleted.
1389         (WebCore::uTextLatin1ContextAwareAccess): Deleted.
1390         (WebCore::uTextLatin1ContextAwareExtract): Deleted.
1391         (WebCore::uTextLatin1ContextAwareClose): Deleted.
1392         (WebCore::openLatin1ContextAwareUTextProvider): Deleted.
1393         * platform/text/icu/UTextProviderUTF16.cpp:
1394         (WebCore::textUTF16ContextAwareGetCurrentContext): Deleted.
1395         (WebCore::textUTF16ContextAwareMoveInPrimaryContext): Deleted.
1396         (WebCore::textUTF16ContextAwareSwitchToPrimaryContext): Deleted.
1397         (WebCore::textUTF16ContextAwareMoveInPriorContext): Deleted.
1398         (WebCore::textUTF16ContextAwareSwitchToPriorContext): Deleted.
1399         (WebCore::uTextUTF16ContextAwareClone): Deleted.
1400         (WebCore::uTextUTF16ContextAwareNativeLength): Deleted.
1401         (WebCore::uTextUTF16ContextAwareAccess): Deleted.
1402         (WebCore::uTextUTF16ContextAwareExtract): Deleted.
1403         (WebCore::uTextUTF16ContextAwareClose): Deleted.
1404         (WebCore::openUTF16ContextAwareUTextProvider): Deleted.
1405         * platform/text/mac/TextBoundaries.mm:
1406         * platform/text/mac/TextBreakIteratorInternalICUMac.mm:
1407         (WebCore::textBreakLocalePreference): Deleted.
1408         (WebCore::topLanguagePreference): Deleted.
1409         (WebCore::getLocale): Deleted.
1410         (WebCore::getSearchLocale): Deleted.
1411         (WebCore::currentSearchLocaleID): Deleted.
1412         (WebCore::getTextBreakLocale): Deleted.
1413         (WebCore::currentTextBreakLocaleID): Deleted.
1414         * platform/text/win/TextBreakIteratorInternalICUWin.cpp:
1415         (WebCore::currentSearchLocaleID): Deleted.
1416         (WebCore::currentTextBreakLocaleID): Deleted.
1417         * rendering/RenderBlock.cpp:
1418         * rendering/RenderText.cpp:
1419         * rendering/RenderText.h:
1420         * rendering/SimpleLineLayoutTextFragmentIterator.h:
1421         * rendering/break_lines.cpp:
1422         * rendering/break_lines.h:
1423         * rendering/line/LineBreaker.h:
1424
1425 2016-07-10  Yusuke Suzuki  <utatane.tea@gmail.com>
1426
1427         [GTK] Crash on https://diafygi.github.io/webcrypto-examples with ENABLE_SUBTLE_CRYPTO
1428         https://bugs.webkit.org/show_bug.cgi?id=159189
1429
1430         Reviewed by Michael Catanzaro.
1431
1432         Currently, we explicitly release the pointers of std::unique_ptr<CryptoAlgorithm> and std::unique_ptr<CryptoAlgorithmParameters>,
1433         and delete them in the asynchronously called lambdas. In GnuTLS version, callback function is accidentally called twice,
1434         and it incurs the double free problem.
1435         In SubtleCrypto code, we have the rule that we must not call failureCallback when the error code is filled in synchronous execution.
1436         So we drop the failureCallback calling code in GnuTLS subtle crypto code.
1437
1438         But, rather than carefully handling un-smart-pointer-managed raw pointer's life time, we should use ref counted pointer for that.
1439         Using the raw delete is error-prone.
1440
1441         This patch also changes CryptoAlgorithm and CryptoAlgorithmParameters to RefCounted. And use Ref and RefPtr instead.
1442         The change eliminates the ad-hoc delete code. And now, the lambdas can be called multiple times since once the result of the promise
1443         is resolved or rejected, subsequent resolve / reject calls are ignored.
1444
1445         And this patch also fixes the incorrect call to the lambda that is already WTFMoved.
1446
1447         While we can see several `return WTFMove(...)`, they are necessary since it uses implicit type conversions, like,
1448         `Ref<A>` => `RefPtr<A>`, and `Ref<Derived>` => `Ref<Base>`.
1449
1450         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
1451         (WebCore::createAesCbcParams):
1452         (WebCore::createAesKeyGenParams):
1453         (WebCore::createHmacParams):
1454         (WebCore::createHmacKeyParams):
1455         (WebCore::createRsaKeyGenParams):
1456         (WebCore::createRsaKeyParamsWithHash):
1457         (WebCore::createRsaOaepParams):
1458         (WebCore::createRsaSsaParams):
1459         (WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt):
1460         (WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt):
1461         (WebCore::JSCryptoAlgorithmDictionary::createParametersForSign):
1462         (WebCore::JSCryptoAlgorithmDictionary::createParametersForVerify):
1463         (WebCore::JSCryptoAlgorithmDictionary::createParametersForDigest):
1464         (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey):
1465         (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveKey):
1466         (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveBits):
1467         (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey):
1468         (WebCore::JSCryptoAlgorithmDictionary::createParametersForExportKey):
1469         * bindings/js/JSCryptoAlgorithmDictionary.h:
1470         * bindings/js/JSCryptoKeySerializationJWK.cpp:
1471         (WebCore::createHMACParameters):
1472         (WebCore::createRSAKeyParametersWithHash):
1473         (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
1474         * bindings/js/JSCryptoKeySerializationJWK.h:
1475         * bindings/js/JSSubtleCryptoCustom.cpp:
1476         (WebCore::createAlgorithmFromJSValue):
1477         (WebCore::importKey):
1478         (WebCore::JSSubtleCrypto::importKey):
1479         (WebCore::JSSubtleCrypto::wrapKey):
1480         (WebCore::JSSubtleCrypto::unwrapKey):
1481         * crypto/CryptoAlgorithm.h:
1482         * crypto/CryptoAlgorithmParameters.h:
1483         * crypto/CryptoAlgorithmRegistry.cpp:
1484         (WebCore::CryptoAlgorithmRegistry::create):
1485         * crypto/CryptoAlgorithmRegistry.h:
1486         * crypto/CryptoKeySerialization.h:
1487         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
1488         (WebCore::CryptoAlgorithmAES_CBC::create):
1489         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
1490         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
1491         (WebCore::CryptoAlgorithmAES_KW::create):
1492         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
1493         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1494         (WebCore::CryptoAlgorithmHMAC::create):
1495         * crypto/algorithms/CryptoAlgorithmHMAC.h:
1496         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1497         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::create):
1498         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
1499         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1500         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::create):
1501         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
1502         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1503         (WebCore::CryptoAlgorithmRSA_OAEP::create):
1504         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
1505         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
1506         (WebCore::CryptoAlgorithmSHA1::create):
1507         * crypto/algorithms/CryptoAlgorithmSHA1.h:
1508         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
1509         (WebCore::CryptoAlgorithmSHA224::create):
1510         * crypto/algorithms/CryptoAlgorithmSHA224.h:
1511         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
1512         (WebCore::CryptoAlgorithmSHA256::create):
1513         * crypto/algorithms/CryptoAlgorithmSHA256.h:
1514         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
1515         (WebCore::CryptoAlgorithmSHA384::create):
1516         * crypto/algorithms/CryptoAlgorithmSHA384.h:
1517         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
1518         (WebCore::CryptoAlgorithmSHA512::create):
1519         * crypto/algorithms/CryptoAlgorithmSHA512.h:
1520         * crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
1521         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
1522         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
1523         * crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp:
1524         (WebCore::CryptoAlgorithmAES_KW::platformEncrypt):
1525         (WebCore::CryptoAlgorithmAES_KW::platformDecrypt):
1526         * crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp:
1527         (WebCore::CryptoAlgorithmHMAC::platformSign):
1528         (WebCore::CryptoAlgorithmHMAC::platformVerify):
1529         * crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp:
1530         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
1531         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
1532         * crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:
1533         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
1534         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
1535         * crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
1536         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
1537         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
1538         * crypto/keys/CryptoKeySerializationRaw.cpp:
1539         (WebCore::CryptoKeySerializationRaw::reconcileAlgorithm):
1540         * crypto/keys/CryptoKeySerializationRaw.h:
1541
1542 2016-07-09  Antti Koivisto  <antti@apple.com>
1543
1544         REGRESSION (r202931): breaks release builds with ASSERT_WITH_SECURITY_IMPLICATION for fuzzing
1545         https://bugs.webkit.org/show_bug.cgi?id=159599
1546         rdar://problem/27248835
1547
1548         Reviewed by Chris Dumez.
1549
1550         Make RenderStyle::deletionHasBegun() available with ENABLE(SECURITY_ASSERTIONS)
1551
1552         * rendering/style/RenderStyle.cpp:
1553         (WebCore::RenderStyle::~RenderStyle):
1554         * rendering/style/RenderStyle.h:
1555         (WebCore::RenderStyle::deletionHasBegun):
1556
1557 2016-07-09  Youenn Fablet  <youenn@apple.com>
1558
1559         Make use of PrivateIdentifier to simplify Fetch Headers built-in checks
1560         https://bugs.webkit.org/show_bug.cgi?id=159554
1561
1562         Reviewed by Alex Christensen.
1563
1564         Test: fetch/header-constructor-overriden.html
1565         Patch does not change visible behavior.
1566
1567         * Modules/fetch/FetchHeaders.idl: Adding PrivateIdentifier to the Headers constructor.
1568         * Modules/fetch/FetchHeaders.js:
1569         (initializeFetchHeaders): Checking directly with @Headers for improved clarity.
1570         * Modules/fetch/FetchResponse.js: Using @Headers to check whether creating a Headers object or not before
1571         passsing it to C++ FetchResponse initialize method.
1572         (initializeFetchResponse):
1573         * bindings/js/WebCoreBuiltinNames.h: Adding Headers private name.
1574
1575 2016-07-08  Chris Dumez  <cdumez@apple.com>
1576
1577         adoptNode() changes css class to lowercase for document loaded with XHR responseType = "document"
1578         https://bugs.webkit.org/show_bug.cgi?id=159555
1579         <rdar://problem/27252541>
1580
1581         Reviewed by Ryosuke Niwa.
1582
1583         When adopting an Element from another document which has a different quirks mode,
1584         case-sensitivity for id and class attributes differs and we need to correctly
1585         update members such as ElementData::m_classNames or ElementData::m_idForStyleResolution.
1586
1587         To address the issue, have Element override didMoveToNewDocument() and call
1588         attributeChanged() for id and class attributes.
1589
1590         Test: fast/dom/Document/adoptNode-quirks-mismatch.html
1591
1592         * dom/Element.cpp:
1593         (WebCore::Element::didMoveToNewDocument):
1594         * dom/Element.h:
1595
1596 2016-07-08  Daniel Bates  <dabates@apple.com>
1597
1598         Cleanup: Remove use of PassRefPtr from class HTMLTableElement
1599         https://bugs.webkit.org/show_bug.cgi?id=159587
1600
1601         Reviewed by Chris Dumez.
1602
1603         * html/HTMLTableElement.cpp:
1604         (WebCore::HTMLTableElement::setCaption): Take a rvalue reference to a RefPtr instead of a PassRefPtr.
1605         (WebCore::HTMLTableElement::setTHead): Take a rvalue reference to a RefPtr instead of a PassRefPtr. Also
1606         fix a style nit; add curly braces around the for-loop body since its body is more than a single line.
1607         (WebCore::HTMLTableElement::createTHead): Use Ref::copyRef() instead of Ref::ptr() to pass the instantiated
1608         table section to better convey that we are passing a copy of the table section.
1609         (WebCore::HTMLTableElement::createCaption): Ditto.
1610         * html/HTMLTableElement.h:
1611
1612 2016-07-08  Daniel Bates  <dabates@apple.com>
1613
1614         Move shouldInheritSecurityOriginFromOwner() from URL to Document
1615         https://bugs.webkit.org/show_bug.cgi?id=158987
1616
1617         Reviewed by Alex Christensen.
1618
1619         The URL class should not have knowledge of the concept of an origin or the semantics of origin
1620         inheritance as these are higher level concepts. We should make URL::shouldInheritSecurityOriginFromOwner()
1621         a static non-member, non-friend function of Document because its implements the origin semantics
1622         for a Document object as described in section Origin of the HTML5 spec., <https://html.spec.whatwg.org/multipage/browsers.html#origin> (8 July 2016).
1623         These semantics only apply to Documents.
1624
1625         No functionality changed. So, no new tests.
1626
1627         * dom/Document.cpp:
1628         (WebCore::shouldInheritSecurityOriginFromOwner): Added.
1629         (WebCore::Document::initSecurityContext): Modified to call WebCore::shouldInheritSecurityOriginFromOwner().
1630         (WebCore::Document::initContentSecurityPolicy): Ditto.
1631         * platform/URL.cpp:
1632         (WebCore::URL::shouldInheritSecurityOriginFromOwner): Deleted.
1633         * platform/URL.h:
1634
1635 2016-07-08  Daniel Bates  <dabates@apple.com>
1636
1637         Setting table.tFoot or calling table.createTFoot() should append HTML tfont element to the end of the table
1638         https://bugs.webkit.org/show_bug.cgi?id=159583
1639         <rdar://problem/27255292>
1640
1641         In HTMLTableElement::createTFoot() I inadvertently made use of WTFMove() to move the instantiated
1642         HTMLTableSectionElement into the argument passed to setTFoot(). We should use Ref::copyRef() instead
1643         because we want this function to return the instantiated table section.
1644
1645         * html/HTMLTableElement.cpp:
1646         (WebCore::HTMLTableElement::createTFoot):
1647
1648 2016-07-08  Daniel Bates  <dabates@apple.com>
1649
1650         Setting table.tFoot or calling table.createTFoot() should append HTML tfont element to the end of the table
1651         https://bugs.webkit.org/show_bug.cgi?id=159583
1652         <rdar://problem/27255292>
1653
1654         Reviewed by Chris Dumez.
1655
1656         he HTML standard has long since been revised to describe that assignment to property table.tFoot
1657         or invoking table.createTFoot() will append the HTML tfoot element to the end of the table. This
1658         behavior is defined in <https://html.spec.whatwg.org/multipage/tables.html#dom-table-tfoot> (8 July 2016)
1659         and <https://html.spec.whatwg.org/multipage/tables.html#dom-table-createtfoot> for the property
1660         table.tFoot and table.createTFoot(), respectively. This change makes our behavior match the
1661         behavior in Mozilla Firefox, Microsoft Edge, Microsoft Internet Explorer 8 and later.
1662
1663         * html/HTMLTableElement.cpp:
1664         (WebCore::HTMLTableElement::setTFoot): Append <tfoot> to the end of the table. Use RefPtr<>&& instead of PassRefPtr.
1665         (WebCore::HTMLTableElement::createTFoot): Use RefPtr<>&& instead of PassRefPtr.
1666         * html/HTMLTableElement.h:
1667
1668 2016-07-08  Jer Noble  <jer.noble@apple.com>
1669
1670         Crash in layout test /media/video-buffered-range-contains-currentTime.html
1671         https://bugs.webkit.org/show_bug.cgi?id=159109
1672         <rdar://problem/26535750>
1673
1674         Reviewed by Alex Christensen.
1675
1676         Protect against _dataTasks being mutated and accessed on multiple simultaneous threads with a Lock.
1677
1678         * platform/network/cocoa/WebCoreNSURLSession.h:
1679         * platform/network/cocoa/WebCoreNSURLSession.mm:
1680         (-[WebCoreNSURLSession dealloc]):
1681         (-[WebCoreNSURLSession taskCompleted:]):
1682         (-[WebCoreNSURLSession finishTasksAndInvalidate]):
1683         (-[WebCoreNSURLSession invalidateAndCancel]):
1684         (-[WebCoreNSURLSession getTasksWithCompletionHandler:]):
1685         (-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]):
1686         (-[WebCoreNSURLSession dataTaskWithRequest:]):
1687         (-[WebCoreNSURLSession dataTaskWithURL:]):
1688
1689 2016-07-08  Jeremy Jones  <jeremyj@apple.com>
1690
1691         Prevent fullscreen video dimension state from being reset after configuring.
1692         https://bugs.webkit.org/show_bug.cgi?id=159578
1693
1694         Reviewed by Jer Noble.
1695
1696         This change moves setVideoElement() to after setMediaElement(), since setMediaElement() resets the
1697         mediaState, undoing the configuration done by setVideoElement().
1698
1699         This change is fragile, but minimal. The proper, more comprehinsive fix will come later from
1700         https://bugs.webkit.org/show_bug.cgi?id=159580.
1701
1702         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1703         (WebVideoFullscreenControllerContext::setUpFullscreen):
1704
1705 2016-07-08  Andy Estes  <aestes@apple.com>
1706
1707         [Content Filtering] Load blocked pages more like other error pages are loaded
1708         https://bugs.webkit.org/show_bug.cgi?id=159485
1709         <rdar://problem/26014076>
1710
1711         Reviewed by Brady Eidson.
1712
1713         Content filter blocked pages were being loaded by cancelling the provisional load of the
1714         page that was blocked and then scheduling a navigation to the content filter error page.
1715         Some clients would not expect a new, Web process-initiated provisional navigation to start
1716         after a cancellation, though, and this would put them in a bad state.
1717         
1718         This patch changes blocked page loading to behave more like loading other error pages.
1719         Specifically:
1720         1. didFailProvisionalLoad is dispatched with a new, non-cancellation error code.
1721         2. The blocked page is loaded immediately after dispatching didFailProvisionalLoad, which
1722            prevents FrameLoader from creating a new back-forward list item for the substitute data load.
1723         3. A substitute data load initiated by the client for the blocked URL is ignored if
1724            ContentFilter will display its own error page.
1725         4. A file: URL is used instead of a custom scheme for the base URL of the blocked page,
1726            since some clients expect this.
1727
1728         Updated existing tests to capture frame load delegate callbacks and the back forward list.
1729         Added new API tests: ContentFiltering.LoadAlternate*.
1730
1731         * English.lproj/Localizable.strings: Added a WebKitErrorFrameLoadBlockedByContentFilter description.
1732         * Resources/ContentFilterBlockedPage.html: Added.
1733         * WebCore.xcodeproj/project.pbxproj: Added ContentFilterBlockedPage.html as a frameowrk resource.
1734         * loader/ContentFilter.cpp:
1735         (WebCore::ContentFilter::continueAfterWillSendRequest): Protected m_documentLoader,
1736         since it might otherwise be deallocated inside ContentFilter::didDecide() if the load is blocked.
1737         (WebCore::ContentFilter::stopFilteringMainResource): Only set m_state to Stopped if not
1738         already Blocked, so that we don't forget this ContentFilter was blocked when calling
1739         cancelMailResourceLoad() in didDecide().
1740         (WebCore::ContentFilter::continueAfterResponseReceived): Protected m_documentLoader,
1741         since it might otherwise be deallocated inside ContentFilter::didDecide() if the load is blocked.
1742         (WebCore::ContentFilter::continueAfterDataReceived): Ditto.
1743         (WebCore::ContentFilter::continueAfterNotifyFinished): Ditto.
1744         (WebCore::ContentFilter::didDecide): Moved code from DocumentLoader::contentFilterDidBlock() to here.
1745         Created a blockedByContentFilterError() and called cancelMainResourceLoad().
1746         (WebCore::blockedPageURL): Returned a file: URL to ContentFilterBlockedPage.html in WebCore.framework.
1747         (WebCore::ContentFilter::continueAfterSubstituteDataRequest): If the substitute data load
1748         is for the same failingURL as the currently-displayed blocked page, ignore it.
1749         (WebCore::ContentFilter::handleProvisionalLoadFailure): Load the blocked page if m_state is Blocked
1750         and the ResourceError matches the error we used when previously calling cancelMainResourceLoad().
1751         (WebCore::ContentFilter::unblockHandler): Deleted.
1752         (WebCore::ContentFilter::replacementData): Deleted.
1753         (WebCore::ContentFilter::unblockRequestDeniedScript): Deleted.
1754         * loader/ContentFilter.h:
1755         * loader/DocumentLoader.cpp:
1756         (WebCore::DocumentLoader::contentFilter): Returned m_contentFilter.
1757         (WebCore::DocumentLoader::installContentFilterUnblockHandler): Deleted.
1758         (WebCore::DocumentLoader::contentFilterDidBlock): Deleted.
1759         * loader/DocumentLoader.h:
1760         * loader/EmptyClients.h: Added a default implementation of blockedByContentFilterError().
1761         * loader/FrameLoader.cpp:
1762         (WebCore::FrameLoader::load): If m_loadType was already RedirectWithLockedBackForwardList
1763         and we are loading subsitute data for a failing URL, continue to use RedirectWithLockedBackForwardList.
1764         This prevents a new back-forward list item from being created when loading a blocked page in a subframe.
1765         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1766         Called ContentFilter::handleProvisionalLoadFailure() after dispatchDidFailProvisionalLoad().
1767         (WebCore::FrameLoader::blockedByContentFilterError): Called FrameLoaderClient::blockedByContentFilterError().
1768         * loader/FrameLoader.h:
1769         * loader/FrameLoaderClient.h:
1770         * loader/NavigationScheduler.cpp:
1771         (WebCore::ScheduledSubstituteDataLoad::ScheduledSubstituteDataLoad): Deleted.
1772         (WebCore::NavigationScheduler::scheduleSubstituteDataLoad): Deleted.
1773         * loader/NavigationScheduler.h:
1774         * loader/PolicyChecker.cpp:
1775         (WebCore::PolicyChecker::checkNavigationPolicy): Ignored a substitute data load for a
1776         failing URL if ContentFilter::continueAfterSubstituteDataRequest() returns false.
1777
1778 2016-07-08  Myles C. Maxfield  <mmaxfield@apple.com>
1779
1780         [Font Loading] The callback passed to document.fonts.ready should always be called
1781         https://bugs.webkit.org/show_bug.cgi?id=158884
1782
1783         Reviewed by Dean Jackson.
1784
1785         The boolean was simply not being reset when loads start.
1786
1787         Test: fast/text/font-face-set-ready-fire.html
1788
1789         * css/FontFaceSet.cpp:
1790         (WebCore::FontFaceSet::startedLoading):
1791         * css/FontFaceSet.h:
1792
1793 2016-07-08  Commit Queue  <commit-queue@webkit.org>
1794
1795         Unreviewed, rolling out r202944.
1796         https://bugs.webkit.org/show_bug.cgi?id=159570
1797
1798         caused some tests to crash under GuardMalloc (Requested by
1799         estes on #webkit).
1800
1801         Reverted changeset:
1802
1803         "[Content Filtering] Load blocked pages more like other error
1804         pages are loaded"
1805         https://bugs.webkit.org/show_bug.cgi?id=159485
1806         http://trac.webkit.org/changeset/202944
1807
1808 2016-07-08  Antti Koivisto  <antti@apple.com>
1809
1810         Regression(r201805): Crash with <use> resource that has Vary header
1811         https://bugs.webkit.org/show_bug.cgi?id=159560
1812         <rdar://problem/27034208>
1813
1814         Reviewed by Chris Dumez.
1815
1816         In some situations (SVG <use> element for example) we may try to load resources from frameless documents.
1817         Such loads always fail. The new vary header verification code path tried to access the frame earlier without
1818         null check.
1819
1820         Test: http/tests/cache/vary-frameless-document.html
1821
1822         * loader/cache/CachedResource.cpp:
1823         (WebCore::CachedResource::failBeforeStarting):
1824         (WebCore::addAdditionalRequestHeadersToRequest):
1825
1826             Null check frame.
1827             Also move the resource type check here so all callers get the same behavior.
1828
1829         (WebCore::CachedResource::addAdditionalRequestHeaders):
1830         (WebCore::CachedResource::load):
1831         (WebCore::CachedResource::varyHeaderValuesMatch):
1832
1833 2016-07-08  Brady Eidson  <beidson@apple.com>
1834
1835         Clearing LocalStorage doesn't also delete -wal and -shm files.
1836         <rdar://problem/27206772> and https://bugs.webkit.org/show_bug.cgi?id=159566
1837
1838         Reviewed by Brent Fulgham.
1839         Also helpfully picked over by Andy "Never Forgets" Estes.
1840
1841         Covered by new API test.
1842
1843         * WebCore.xcodeproj/project.pbxproj:
1844
1845         * platform/sql/SQLiteFileSystem.h:
1846
1847 2016-07-08  Commit Queue  <commit-queue@webkit.org>
1848
1849         Unreviewed, rolling out r202945.
1850         https://bugs.webkit.org/show_bug.cgi?id=159565
1851
1852         The test for this change is failing on all platforms.
1853         (Requested by ryanhaddad on #webkit).
1854
1855         Reverted changeset:
1856
1857         "[Font Loading] The callback passed to document.fonts.ready
1858         should always be called"
1859         https://bugs.webkit.org/show_bug.cgi?id=158884
1860         http://trac.webkit.org/changeset/202945
1861
1862 2016-07-08  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1863
1864         ExecState should be passed by reference in JS bindings generator for custom constructors
1865         https://bugs.webkit.org/show_bug.cgi?id=159357
1866
1867         Reviewed by Youenn Fablet.
1868
1869         Pass ExecState as a reference instead of pointer in JS bindings
1870         code for custom constructors.
1871
1872         * bindings/js/JSAudioContextCustom.cpp:
1873         (WebCore::constructJSAudioContext):
1874         * bindings/js/JSBlobCustom.cpp:
1875         (WebCore::constructJSBlob):
1876         * bindings/js/JSDOMFormDataCustom.cpp:
1877         (WebCore::constructJSDOMFormData):
1878         (WebCore::JSDOMFormData::append):
1879         * bindings/js/JSDataCueCustom.cpp:
1880         (WebCore::constructJSDataCue):
1881         * bindings/js/JSFileCustom.cpp:
1882         (WebCore::constructJSFile):
1883         * bindings/js/JSHTMLElementCustom.cpp:
1884         (WebCore::constructJSHTMLElement):
1885         * bindings/js/JSMediaSessionCustom.cpp:
1886         (WebCore::constructJSMediaSession):
1887         * bindings/js/JSMutationObserverCustom.cpp:
1888         (WebCore::constructJSMutationObserver):
1889         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
1890         (WebCore::constructJSReadableStreamController):
1891         (WebCore::constructJSReadableStreamReader):
1892         * bindings/js/JSWebKitPointCustom.cpp:
1893         (WebCore::constructJSWebKitPoint):
1894         * bindings/js/JSWorkerCustom.cpp:
1895         (WebCore::constructJSWorker):
1896         * bindings/scripts/CodeGeneratorJS.pm:
1897         (GenerateHeader):
1898         (GenerateConstructorDefinition):
1899         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1900         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::construct):
1901         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
1902
1903 2016-07-08  Olivier Blin  <olivier.blin@softathome.com>
1904
1905         Expose crossOrigin attribute as a static property in HTMLMediaElement
1906         https://bugs.webkit.org/show_bug.cgi?id=159459
1907
1908         Reviewed by Chris Dumez.
1909
1910         The crossOrigin attribute is already used for MediaResourceLoader
1911         (r119742 and r175050), but it was not exposed as a static property.
1912
1913         This fixes VR360 support in Dailymotion, since it uses the "in"
1914         operator to detect if crossOrigin is supported by the
1915         HTMLVideoElement, in order to enable VR360.
1916
1917         No new tests, rebaselined existing tests, 150 WPT tests are fixed.
1918
1919         * html/HTMLMediaElement.cpp:
1920         (WebCore::HTMLMediaElement::setCrossOrigin):
1921         (WebCore::HTMLMediaElement::crossOrigin):
1922         * html/HTMLMediaElement.h:
1923         * html/HTMLMediaElement.idl:
1924
1925 2016-03-20  Frederic Wang  <fwang@igalia.com>
1926
1927         Use Fraction* parameters from the OpenType MATH table
1928         https://bugs.webkit.org/show_bug.cgi?id=155639
1929
1930         Reviewed by Brent Fulgham.
1931
1932         We improve the RenderMathMLFraction so minimal vertical shifts and gaps
1933         from the MATH table (or arbitrary fallback) are used for fractions.
1934         We also change the interpretation of "thick" and "thin" linethickness values
1935         to match Gecko's behavior and the one suggested in the MathML in HTML5 implementation note.
1936
1937         Test: imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-parameters-1.html
1938
1939         * rendering/mathml/MathMLStyle.cpp:
1940         (WebCore::MathMLStyle::updateStyleIfNeeded): set NeedsLayout after displaystyle change
1941         so that dynamic MathML tests still work.
1942         * rendering/mathml/RenderMathMLFraction.cpp:
1943         (WebCore::RenderMathMLFraction::RenderMathMLFraction): Init LayoutUnit members to zero.
1944         (WebCore::RenderMathMLFraction::updateFromElement):
1945         Set new members for fraction gaps and shifts using Fraction* constants or some fallback
1946         values. Change the interpretation of "thick" and "thin".
1947         (WebCore::RenderMathMLFraction::layoutBlock): Use new constants affecting vertical
1948         positions of numerator and denominator.
1949         (WebCore::RenderMathMLFraction::paint): Use m_ascent to set the vertical position
1950         of the fraction bar.
1951         (WebCore::RenderMathMLFraction::firstLineBaseline): We just return m_ascent.
1952         * rendering/mathml/RenderMathMLFraction.h: Make updateFromElement public so that
1953         it can be used in MathMLStyle. Add LayoutUnit members for the ascent of the fraction
1954         and for minimal shifts/gaps values.
1955
1956 2016-07-08  Frederic Wang  <fwang@igalia.com>
1957
1958         Use Radical* constants from the OpenType MATH table.
1959         https://bugs.webkit.org/show_bug.cgi?id=155638
1960
1961         Reviewed by Brent Fulgham.
1962
1963         Test: mathml/mathml-in-html5/root-parameters-1.html
1964
1965         We make the radical vertical gap depends on displaystyle.
1966         This is the only remaining step to use all the Radical* constants from the MATH table.
1967         We also introduce a ruleThicknessFallback function for future use.
1968
1969         * rendering/mathml/RenderMathMLBlock.h:
1970         (WebCore::RenderMathMLBlock::ruleThicknessFallback): Add this helper function since that
1971         calculation is used in several places.
1972         * rendering/mathml/RenderMathMLRoot.cpp:
1973         (WebCore::RenderMathMLRoot::updateStyle): Reorganize the way we set constant parameters,
1974         add more comments and take into account the displaystyle for the vertical gap.
1975
1976 2016-07-08  Commit Queue  <commit-queue@webkit.org>
1977
1978         Unreviewed, rolling out r202967.
1979         https://bugs.webkit.org/show_bug.cgi?id=159556
1980
1981         This patch caused crashes in https tests on Windows (Requested
1982         by perarne on #webkit).
1983
1984         Reverted changeset:
1985
1986         "[Win] The test http/tests/security/contentSecurityPolicy
1987         /upgrade-insecure-requests/basic-upgrade.https.html is
1988         failing."
1989         https://bugs.webkit.org/show_bug.cgi?id=159510
1990         http://trac.webkit.org/changeset/202967
1991
1992 2016-07-08  Youenn Fablet  <youenn@apple.com>
1993
1994         Generate WebCore builtin wrapper files
1995         https://bugs.webkit.org/show_bug.cgi?id=159461
1996
1997         Reviewed by Brian Burg.
1998
1999         No change of behavior.
2000
2001         Updating build system to handle new built-in generators without modifying WebCoreJSBuiltins* files.
2002         The generator is now passed all built-ins at once so that wrapper files can be generated.
2003         Removing WebCoreJSBuiltins* checked-in wrapper files.
2004
2005         * CMakeLists.txt:
2006         * DerivedSources.make:
2007         * WebCore.xcodeproj/project.pbxproj:
2008         * bindings/js/JSDOMGlobalObject.cpp:
2009         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2010         * bindings/js/JSDOMGlobalObject.h:
2011         * bindings/js/WebCoreJSBuiltinInternals.cpp: Removed.
2012         * bindings/js/WebCoreJSBuiltinInternals.h: Removed.
2013         * bindings/js/WebCoreJSBuiltins.cpp: Removed.
2014         * bindings/js/WebCoreJSBuiltins.h: Removed.
2015
2016 2016-07-08  Manuel Rego Casasnovas  <rego@igalia.com>
2017
2018         [css-grid] Inline size is never indefinite during layout
2019         https://bugs.webkit.org/show_bug.cgi?id=159253
2020
2021         Reviewed by Sergio Villar Senin.
2022
2023         The issue is that the inline size of the grid container
2024         is only indefinite while we're computing the intrinsic sizes.
2025         During layout we should be able to resolve the percentage tracks
2026         against that size. This makes Grid Layout compatible with regular blocks
2027         regarding how inline percentages are resolved.
2028
2029         The patch passes the SizingOperation enum to RenderGrid::gridTrackSize().
2030         That way we can know if we're computing the intrinsic sizes or not.
2031
2032         Test: fast/css-grid-layout/grid-container-percentage-columns.html
2033
2034         * rendering/RenderGrid.cpp:
2035         (WebCore::RenderGrid::computeTrackSizesForDirection):
2036         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
2037         (WebCore::RenderGrid::computeIntrinsicLogicalHeight):
2038         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
2039         (WebCore::RenderGrid::gridTrackSize):
2040         (WebCore::RenderGrid::minSizeForChild):
2041         (WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks):
2042         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
2043         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
2044         (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
2045         (WebCore::RenderGrid::rawGridTrackSize): Deleted.
2046         * rendering/RenderGrid.h:
2047
2048 2016-07-08  Frederic Wang  <fwang@igalia.com>
2049
2050         Use OpenType MATH constant AxisHeight.
2051         https://bugs.webkit.org/show_bug.cgi?id=133567
2052
2053         Reviewed by Brent Fulgham.
2054
2055         We make RenderMathMLOperator and RenderMathMLTable use the OpenType MATH constant AxisHeight.
2056         These are the only remaining cases to handle since RenderMathMLFraction already uses that constant.
2057
2058         Tests: imported/mathml-in-html5/mathml/presentation-markup/operators/mo-axis-height-1.html
2059               imported/mathml-in-html5/mathml/presentation-markup/tables/table-axis-height.html
2060
2061         * rendering/mathml/RenderMathMLBlock.cpp: Make RenderMathMLTable use the math axis
2062         for its vertical alignment and update a bit the comments.
2063         (WebCore::axisHeight): Move the code in a static function that can be called by
2064         RenderMathMLBlock and RenderMathMLTable.
2065         (WebCore::RenderMathMLBlock::mathAxisHeight): Use axisHeight.
2066         (WebCore::RenderMathMLTable::firstLineBaseline): Ditto.
2067         * rendering/mathml/RenderMathMLOperator.cpp:
2068         (WebCore::RenderMathMLOperator::stretchTo):
2069
2070 2016-07-08  Manuel Rego Casasnovas  <rego@igalia.com>
2071
2072         [css-grid] Disallow repeat() in grid-template shorthand
2073         https://bugs.webkit.org/show_bug.cgi?id=159200
2074
2075         Reviewed by Sergio Villar Senin.
2076
2077         As discussed on www-style, "repeat()" notation shouldn't be allowed
2078         in the ASCII branch of the grid-template shorthand.
2079         https://lists.w3.org/Archives/Public/www-style/2016May/0193.html
2080
2081         The patch uses an enum to invalidate "repeat()" when parsing
2082         the grid-template shorthand.
2083
2084         Test: fast/css-grid-layout/grid-template-shorthand-get-set.html
2085
2086         * css/CSSParser.cpp:
2087         (WebCore::CSSParser::parseGridTemplateColumns): Add enum.
2088         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): Pass "DisallowRepeat"
2089         when calling parseGridTemplateColumns().
2090         (WebCore::CSSParser::parseGridTrackList): Use enum to allow/disallow repeat.
2091         * css/CSSParser.h: Define the new enum and modify method signatures to use it,
2092         setting it to "AllowRepeat" by default.
2093
2094 2016-07-08  Frederic Wang  <fwang@igalia.com>
2095
2096         Add support for movablelimits.
2097         https://bugs.webkit.org/show_bug.cgi?id=155542
2098
2099         Reviewed by Brent Fulgham.
2100
2101         Tests: mathml/presentation/displaystyle-1.html
2102                mathml/presentation/displaystyle-2.html
2103                mathml/presentation/displaystyle-3.html
2104                mathml/presentation/mo-movablelimits-default.html
2105                mathml/presentation/mo-movablelimits-dynamic.html
2106                mathml/presentation/mo-movablelimits.html
2107
2108         * mathml/MathMLTextElement.cpp:
2109         (WebCore::MathMLTextElement::parseAttribute): Take into account change of movablelimits.
2110         * rendering/mathml/MathMLOperatorDictionary.h: Remove FIXME comment.
2111         * rendering/mathml/MathMLStyle.cpp:
2112         (WebCore::MathMLStyle::updateStyleIfNeeded): Force relayout and width computation when a
2113         displaystyle value change.
2114         * rendering/mathml/RenderMathMLOperator.h:
2115         (WebCore::RenderMathMLOperator::shouldMoveLimits): Helper function to test if the operator
2116         should have his limits moved when used as a base of munder/mover/munderover.
2117         * rendering/mathml/RenderMathMLScripts.cpp: Allow munderover/munder/mover elements to use
2118         this class and take the same behavior as the corresponding msubsup/msub/sup except for
2119         the *scriptshift attributes.
2120         (WebCore::RenderMathMLScripts::RenderMathMLScripts):
2121         (WebCore::RenderMathMLScripts::getBaseAndScripts):
2122         (WebCore::RenderMathMLScripts::computePreferredLogicalWidths):
2123         (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded):
2124         (WebCore::RenderMathMLScripts::layoutBlock):
2125         * rendering/mathml/RenderMathMLScripts.h: Allow some members to be accessible/overridden
2126         by RenderMathMLUnderOver and add munderover/munder/mover in the kind.
2127         * rendering/mathml/RenderMathMLUnderOver.cpp:
2128         (WebCore::RenderMathMLUnderOver::RenderMathMLUnderOver): We use the code from
2129         RenderMathMLScripts to initialize m_kind.
2130         (WebCore::RenderMathMLUnderOver::shouldMoveLimits): New function to determine if the base
2131         should move its limits.
2132         (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths): We use the code from
2133         RenderMathMLScripts when the base should move its limits.
2134         (WebCore::RenderMathMLUnderOver::layoutBlock): We use the code from RenderMathMLScripts when
2135         the base should move its limits. Also improve the early return for invalid markup.
2136         (WebCore::RenderMathMLUnderOver::unembellishedOperator): Deleted. We use the code from RenderMathMLScripts.
2137         (WebCore::RenderMathMLUnderOver::firstLineBaseline): Deleted. We use the code from RenderMathMLScripts.
2138         * rendering/mathml/RenderMathMLUnderOver.h: We now inherit from RenderMathMLScripts and can
2139         just remove members that exist in the parent. We define shouldMoveLimits() to determine
2140         when the layout should be done the same as RenderMathMLScripts. For now, we try and be
2141         safe with the rest of the code by continuing to claim that we are not a RenderMathMLScripts.
2142
2143 2016-07-07  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2144
2145         Clean up PassRefPtr in Modules/webaudio
2146         https://bugs.webkit.org/show_bug.cgi?id=159540
2147
2148         Reviewed by Alex Christensen.
2149
2150         Purge PassRefPtr in webaudio directory.
2151
2152         No new tests, no behavior changes.
2153
2154         * Modules/webaudio/AsyncAudioDecoder.h:
2155         * Modules/webaudio/AudioBasicProcessorNode.h:
2156         * Modules/webaudio/AudioBuffer.h:
2157         * Modules/webaudio/AudioBufferSourceNode.h:
2158         * Modules/webaudio/AudioListener.h:
2159         * Modules/webaudio/AudioParam.h:
2160         * Modules/webaudio/AudioParamTimeline.h:
2161         (WebCore::AudioParamTimeline::ParamEvent::ParamEvent):
2162         * Modules/webaudio/AudioProcessingEvent.cpp:
2163         (WebCore::AudioProcessingEvent::AudioProcessingEvent):
2164         * Modules/webaudio/AudioProcessingEvent.h:
2165         (WebCore::AudioProcessingEvent::create):
2166         * Modules/webaudio/ChannelMergerNode.h:
2167         * Modules/webaudio/ChannelSplitterNode.h:
2168         * Modules/webaudio/GainNode.h:
2169         * Modules/webaudio/MediaElementAudioSourceNode.h:
2170         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
2171         * Modules/webaudio/MediaStreamAudioSource.cpp:
2172         (WebCore::MediaStreamAudioSource::addAudioConsumer):
2173         * Modules/webaudio/MediaStreamAudioSource.h:
2174         * Modules/webaudio/OfflineAudioCompletionEvent.cpp:
2175         (WebCore::OfflineAudioCompletionEvent::create):
2176         (WebCore::OfflineAudioCompletionEvent::OfflineAudioCompletionEvent):
2177         * Modules/webaudio/OfflineAudioCompletionEvent.h:
2178         * Modules/webaudio/OfflineAudioDestinationNode.h:
2179         * Modules/webaudio/OscillatorNode.h:
2180         * Modules/webaudio/PeriodicWave.h:
2181         * Modules/webaudio/ScriptProcessorNode.h:
2182
2183 2016-07-07  Per Arne Vollan  <pvollan@apple.com>
2184
2185         [Win] The test http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/basic-upgrade.https.html is failing.
2186         https://bugs.webkit.org/show_bug.cgi?id=159510
2187
2188         Reviewed by Brent Fulgham.
2189
2190         On Windows, validate certificate chain even when any https certificate is allowed.
2191
2192         * platform/network/cf/ResourceHandleCFNet.cpp:
2193         (WebCore::ResourceHandle::createCFURLConnection):
2194
2195 2016-07-07  Frederic Wang  <fwang@igalia.com>
2196
2197         Bug 155792 - Basic implementation of mpadded
2198         https://bugs.webkit.org/show_bug.cgi?id=155792
2199
2200         Reviewed by Brent Fulgham.
2201
2202         We implement a basic support for the mpadded element.
2203         We support most of the attribute values except pseudo-units or negative values.
2204
2205         Tests: mathml/presentation/mpadded-1-2.html
2206                mathml/presentation/mpadded-1.html
2207                mathml/presentation/mpadded-2.html
2208                mathml/presentation/mpadded-3.html
2209                mathml/presentation/mpadded-unsupported-values.html
2210                mathml/presentation/mpadded-dynamic.html
2211
2212         * CMakeLists.txt: Add RenderMathMLPadded to the build system.
2213         * WebCore.xcodeproj/project.pbxproj: Ditto.
2214         * mathml/MathMLInlineContainerElement.cpp:
2215         (WebCore::MathMLInlineContainerElement::createElementRenderer): Create the renderer
2216         for mpadded.
2217         * mathml/mathattrs.in: Add voffset attribute.
2218         * mathml/mathtags.in: Make mpadded use MathMLInlineContainerElement.
2219         * rendering/RenderObject.h:
2220         (WebCore::RenderObject::isRenderMathMLPadded): Define isRenderMathMLPadded.
2221         * rendering/mathml/RenderMathMLPadded.cpp: Added.
2222         We do a simple implementation by overriding the behavior of RenderMathMLRow and forcing
2223         relayout after attribute or style change.
2224         (WebCore::RenderMathMLPadded::RenderMathMLPadded):
2225         (WebCore::RenderMathMLPadded::computePreferredLogicalWidths):
2226         (WebCore::RenderMathMLPadded::layoutBlock):
2227         (WebCore::RenderMathMLPadded::updateFromElement):
2228         (WebCore::RenderMathMLPadded::styleDidChange):
2229         (WebCore::RenderMathMLPadded::firstLineBaseline):
2230         * rendering/mathml/RenderMathMLPadded.h: Added.
2231
2232 2016-07-07  Frederic Wang  <fwang@igalia.com>
2233
2234         Move MathML-specific code into a separate accessibility class
2235         https://bugs.webkit.org/show_bug.cgi?id=159213
2236
2237         Reviewed by Chris Fleizach.
2238
2239         Currently, MathML accessibility is completely handled in the generic AccessibilityRenderObject
2240         and it's sometimes messy and unconvenient. Hence we move most of the MathML-specific code
2241         into a separate AccessibilityMathMLElement class to facilitate future work and maintenance.
2242
2243         No new tests, already covered by existing tests.
2244
2245         * CMakeLists.txt: Add new AccessibilityMathMLElement module.
2246         * WebCore.xcodeproj/project.pbxproj: Ditto.
2247         * accessibility/AccessibilityAllInOne.cpp: Ditto.
2248         * accessibility/AXObjectCache.cpp: Add MathML headers and create AccessibilityMathMLElement.
2249         (WebCore::createFromRenderer): Create AccessibilityMathMLElement for MathML elements and
2250         anonymous operators created by the mfenced element.
2251         * accessibility/AccessibilityMathMLElement.cpp: Added. This class handles all the MathML
2252         elements as well as the anonymous operators created by the mfenced element. A boolean is
2253         passed to the constructor to indicate whether we are in the latter case.
2254         (WebCore::AccessibilityMathMLElement::AccessibilityMathMLElement):
2255         (WebCore::AccessibilityMathMLElement::~AccessibilityMathMLElement):
2256         (WebCore::AccessibilityMathMLElement::create):
2257         (WebCore::AccessibilityMathMLElement::determineAccessibilityRole): Move handling of specific
2258         MathElementRole and DocumentMathRole here.
2259         (WebCore::AccessibilityMathMLElement::textUnderElement): Move retrieval of text from the
2260         anonymous operators here.
2261         (WebCore::AccessibilityMathMLElement::stringValue): Ditto.
2262         (WebCore::AccessibilityMathMLElement::isIgnoredElementWithinMathTree): Move the determination
2263         of ignored math elements here.
2264         (WebCore::AccessibilityMathMLElement::isMathFraction): Moved from AccessibilityRenderObject.
2265         (WebCore::AccessibilityMathMLElement::isMathFenced): Ditto.
2266         (WebCore::AccessibilityMathMLElement::isMathSubscriptSuperscript): Ditto.
2267         (WebCore::AccessibilityMathMLElement::isMathRow): Ditto.
2268         (WebCore::AccessibilityMathMLElement::isMathUnderOver): Ditto.
2269         (WebCore::AccessibilityMathMLElement::isMathSquareRoot): Ditto.
2270         (WebCore::AccessibilityMathMLElement::isMathToken): Ditto.
2271         (WebCore::AccessibilityMathMLElement::isMathRoot): Ditto.
2272         (WebCore::AccessibilityMathMLElement::isMathOperator): Ditto.
2273         (WebCore::AccessibilityMathMLElement::isAnonymousMathOperator): Move the determination of
2274         anonymous operators here. We now just return the boolean passed at creation time.
2275         (WebCore::AccessibilityMathMLElement::isMathFenceOperator): Moved from
2276         AccessibilityRenderObject.
2277         (WebCore::AccessibilityMathMLElement::isMathSeparatorOperator): Ditto.
2278         (WebCore::AccessibilityMathMLElement::isMathText): Ditto.
2279         (WebCore::AccessibilityMathMLElement::isMathNumber): Ditto.
2280         (WebCore::AccessibilityMathMLElement::isMathIdentifier): Ditto.
2281         (WebCore::AccessibilityMathMLElement::isMathMultiscript): Ditto.
2282         (WebCore::AccessibilityMathMLElement::isMathTable): Ditto.
2283         (WebCore::AccessibilityMathMLElement::isMathTableRow): Ditto.
2284         (WebCore::AccessibilityMathMLElement::isMathTableCell): Ditto.
2285         (WebCore::AccessibilityMathMLElement::isMathScriptObject): Ditto.
2286         (WebCore::AccessibilityMathMLElement::isMathMultiscriptObject): Ditto.
2287         (WebCore::AccessibilityMathMLElement::mathRadicandObject): Ditto.
2288         (WebCore::AccessibilityMathMLElement::mathRootIndexObject): Ditto.
2289         (WebCore::AccessibilityMathMLElement::mathNumeratorObject): Ditto.
2290         (WebCore::AccessibilityMathMLElement::mathDenominatorObject): Ditto.
2291         (WebCore::AccessibilityMathMLElement::mathUnderObject): Ditto.
2292         (WebCore::AccessibilityMathMLElement::mathOverObject): Ditto.
2293         (WebCore::AccessibilityMathMLElement::mathBaseObject): Ditto.
2294         (WebCore::AccessibilityMathMLElement::mathSubscriptObject): Ditto.
2295         (WebCore::AccessibilityMathMLElement::mathSuperscriptObject): Ditto.
2296         (WebCore::AccessibilityMathMLElement::mathFencedOpenString): Ditto.
2297         (WebCore::AccessibilityMathMLElement::mathFencedCloseString): Ditto.
2298         (WebCore::AccessibilityMathMLElement::mathPrescripts): Ditto.
2299         (WebCore::AccessibilityMathMLElement::mathPostscripts): Ditto.
2300         (WebCore::AccessibilityMathMLElement::mathLineThickness): Ditto.
2301         * accessibility/AccessibilityMathMLElement.h: Added.
2302         * accessibility/AccessibilityRenderObject.cpp:
2303         (WebCore::AccessibilityRenderObject::isIgnoredElementWithinMathTree): The cases of
2304         AccessibilityMathMLElement objects are now handled in the derived class. We remove the case
2305         of text node since the MathML code no longer creates anonymous text nodes after r202420.
2306         Anonymous block inserted into RenderMathMLBlocks to honor CSS rules are not AccessibilityMathMLElements
2307         and it does not seem safe to modify AXObjectCache::createFromRenderer to force that. Hence
2308         we still need to be handle them here.
2309         (WebCore::AccessibilityRenderObject::textUnderElement): This code is moved into AccessibilityMathMLElement.
2310         (WebCore::AccessibilityRenderObject::stringValue): Ditto.
2311         (WebCore::AccessibilityRenderObject::determineAccessibilityRole): Ditto.
2312         (WebCore::AccessibilityRenderObject::isMathElement): Deleted.
2313         (WebCore::AccessibilityRenderObject::isMathFraction): Deleted.
2314         (WebCore::AccessibilityRenderObject::isMathFenced): Deleted.
2315         (WebCore::AccessibilityRenderObject::isMathSubscriptSuperscript): Deleted.
2316         (WebCore::AccessibilityRenderObject::isMathRow): Deleted.
2317         (WebCore::AccessibilityRenderObject::isMathUnderOver): Deleted.
2318         (WebCore::AccessibilityRenderObject::isMathSquareRoot): Deleted.
2319         (WebCore::AccessibilityRenderObject::isMathToken): Deleted.
2320         (WebCore::AccessibilityRenderObject::isMathRoot): Deleted.
2321         (WebCore::AccessibilityRenderObject::isMathOperator): Deleted.
2322         (WebCore::AccessibilityRenderObject::isAnonymousMathOperator): Deleted.
2323         (WebCore::AccessibilityRenderObject::isMathFenceOperator): Deleted.
2324         (WebCore::AccessibilityRenderObject::isMathSeparatorOperator): Deleted.
2325         (WebCore::AccessibilityRenderObject::isMathText): Deleted.
2326         (WebCore::AccessibilityRenderObject::isMathNumber): Deleted.
2327         (WebCore::AccessibilityRenderObject::isMathIdentifier): Deleted.
2328         (WebCore::AccessibilityRenderObject::isMathMultiscript): Deleted.
2329         (WebCore::AccessibilityRenderObject::isMathTable): Deleted.
2330         (WebCore::AccessibilityRenderObject::isMathTableRow): Deleted.
2331         (WebCore::AccessibilityRenderObject::isMathTableCell): Deleted.
2332         (WebCore::AccessibilityRenderObject::isMathScriptObject): Deleted.
2333         (WebCore::AccessibilityRenderObject::isMathMultiscriptObject): Deleted.
2334         (WebCore::AccessibilityRenderObject::mathRadicandObject): Deleted.
2335         (WebCore::AccessibilityRenderObject::mathRootIndexObject): Deleted.
2336         (WebCore::AccessibilityRenderObject::mathNumeratorObject): Deleted.
2337         (WebCore::AccessibilityRenderObject::mathDenominatorObject): Deleted.
2338         (WebCore::AccessibilityRenderObject::mathUnderObject): Deleted.
2339         (WebCore::AccessibilityRenderObject::mathOverObject): Deleted.
2340         (WebCore::AccessibilityRenderObject::mathBaseObject): Deleted.
2341         (WebCore::AccessibilityRenderObject::mathSubscriptObject): Deleted.
2342         (WebCore::AccessibilityRenderObject::mathSuperscriptObject): Deleted.
2343         (WebCore::AccessibilityRenderObject::mathFencedOpenString): Deleted.
2344         (WebCore::AccessibilityRenderObject::mathFencedCloseString): Deleted.
2345         (WebCore::AccessibilityRenderObject::mathPrescripts): Deleted.
2346         (WebCore::AccessibilityRenderObject::mathPostscripts): Deleted.
2347         (WebCore::AccessibilityRenderObject::mathLineThickness): Deleted.
2348         * accessibility/AccessibilityRenderObject.h: Remove declarations of functions that are now
2349         overridden in AccessibilityMathMLElement. Make isIgnoredElementWithinMathTree virtual so that
2350         it can be reimplemented in AccessibilityMathMLElement.
2351
2352 2016-07-07  Frederic Wang  <fwang@igalia.com>
2353
2354         Implement an internal style property for displaystyle.
2355         https://bugs.webkit.org/show_bug.cgi?id=133845
2356
2357         Reviewed by Brent Fulgham.
2358
2359         Tests: mathml/opentype/large-operators-displaystyle-dynamic.html
2360                mathml/opentype/large-operators-displaystyle.html
2361
2362         This is based on a patch by Alejandro G. Castro <alex@igalia.com>
2363
2364         * CMakeLists.txt: Add MathMLStyle to the build system.
2365         * WebCore.xcodeproj/project.pbxproj: ditto.
2366         * mathml/MathMLInlineContainerElement.cpp:
2367         (WebCore::MathMLInlineContainerElement::parseAttribute): Resolve the mathml style when the
2368         displaystyle attribute changes on the mtable or mstyle elements.
2369         * mathml/MathMLInlineContainerElement.h: Define parseAttribute.
2370         * mathml/MathMLMathElement.cpp:
2371         (WebCore::MathMLMathElement::MathMLMathElement): Indicate that we have custom style.
2372         (WebCore::MathMLMathElement::parseAttribute): Resolve the mathml style when the display or
2373         displaystyle attributes change on the math element.
2374         (WebCore::MathMLMathElement::didAttachRenderers): Resolve the mathml style when one
2375         renderer is attached.
2376         * mathml/MathMLMathElement.h: Declare parseAttribute and didAttachRenderers.
2377         * mathml/mathattrs.in: Declare the display and displaystyle attributes.
2378         * rendering/mathml/MathMLStyle.cpp: Added.
2379         (WebCore::MathMLStyle::MathMLStyle): New class to handle custom MathML style.
2380         (WebCore::MathMLStyle::create):
2381         (WebCore::MathMLStyle::setDisplayStyle): Helper function to take the displaystyle from
2382         the specified rendered.
2383         (WebCore::MathMLStyle::resolveMathMLStyleTree): Helper function to resolve the custom
2384         MathML style in renderer subtree.
2385         (WebCore::MathMLStyle::getMathMLParentNode): Helper function to get a MathML ancestor of
2386         the specified renderer.
2387         (WebCore::MathMLStyle::updateStyleIfNeeded): Helper function to update the style of the
2388         specified renderer if needed.
2389         (WebCore::MathMLStyle::resolveMathMLStyle): Resolve the MathML style of a given renderer.
2390         For displaystyle, we inherit the value of the parent except for the cases mentioned in the
2391         MathML recommendation.
2392         * rendering/mathml/MathMLStyle.h: New class header for custom MathML style.
2393         Only displaystyle is supported for now.
2394         * rendering/mathml/RenderMathMLBlock.cpp: Add a member and getter for custom MathML style.
2395         (WebCore::RenderMathMLBlock::RenderMathMLBlock):
2396         * rendering/mathml/RenderMathMLBlock.h: ditto.
2397         (WebCore::RenderMathMLBlock::mathMLStyle):
2398         * rendering/mathml/RenderMathMLMath.h: Add definition to use the syntax is<RenderMathMLMath>.
2399         * rendering/mathml/RenderMathMLOperator.h:
2400         (WebCore::RenderMathMLOperator::isLargeOperatorInDisplayStyle): Do not rerturn true when
2401         the operator is not in displaystyle.
2402         * rendering/mathml/RenderMathMLRoot.h: Make updateStyle public, so that it can be called
2403         by MathMLStyle::updateStyleIfNeeded.
2404         * rendering/mathml/RenderMathMLUnderOver.h: Add definition to use the syntax
2405         is<RenderMathMLUnderOver>.
2406
2407 2016-07-07  Ryosuke Niwa  <rniwa@webkit.org>
2408
2409         Replace scoped flag in Event by composed flag
2410         https://bugs.webkit.org/show_bug.cgi?id=158415
2411
2412         Reviewed by Chris Dumez.
2413
2414         Replace `scoped` flag with `composed` flag and negate its meaning per the latest spec:
2415         https://dom.spec.whatwg.org/#dom-event-composed
2416         https://github.com/w3c/webcomponents/issues/513
2417
2418         In the old spec, every event was assumed to be "composed" (crosses shadow boundaries)
2419         by default and there was `scoped` flag which prevented the event from crossing bondaries,
2420         and there was a handful of events for which `scoped` was set true when dispatched by UA.
2421
2422         In the new spec, every event is assumed to be "scoped" and a handful of user-initiated
2423         events set `composed` flag to true, which is also exposed in EventInit dictionary.
2424         `relatedTargetScoped` flag has been removed. New behavior is identical to when this flag
2425         was set to true.
2426
2427         No new tests since existing tests are updated to test the new flag and behavior.
2428
2429         * dom/CompositionEvent.cpp:
2430         (WebCore::CompositionEvent::isCompositionEvent): Added.
2431         * dom/CompositionEvent.h:
2432         * dom/Event.cpp:
2433         (WebCore::Event::Event): Initialize m_composed. Also re-ordered m_type and m_isInitialized
2434         for better packing.
2435         (WebCore::Event::composed): Renamed from Event::composed. We return true whenever composed
2436         is set to true in EventInit, or the engine is dispatching an user-initiated event listed in:
2437         https://github.com/w3c/webcomponents/issues/513#issuecomment-224183937
2438         as well as keypress, cut, paste, and, copy as discussed in:
2439         https://github.com/w3c/webcomponents/issues/513#issuecomment-230988170
2440         (WebCore::Event::isCompositionEvent): Added.
2441         * dom/Event.h:
2442         (WebCore::Event::composed): Added.
2443         (WebCore::Event::scoped): Deleted.
2444         (WebCore::Event::relatedTargetScoped): Deleted.
2445         (WebCore::Event): Reordered m_type and m_isInitialized for better packing. Added m_composed
2446         and removed m_scoped and m_relatedTargetScoped.
2447         * dom/Event.idl:
2448         * dom/EventPath.cpp:
2449         (WebCore::shouldEventCrossShadowBoundary): Returns true if the event did not originate from
2450         a shadow tree (this event entered the current shadow tree via a slot so we need to proceed with
2451         the normal bubble path outside the shadow tree) or composed flag is set true.
2452         (WebCore::EventPath::EventPath): m_event no longer exists, which was only used to get the value
2453         of relatedTargetScoped which has been removed.
2454         (WebCore::EventPath::setRelatedTarget): Behave as if relatedTargetScoped is always set true
2455         since the flag has been removed.
2456         * dom/EventPath.h:
2457         * dom/FocusEvent.cpp:
2458         (WebCore::FocusEvent::relatedTargetScoped): Deleted.
2459         * dom/FocusEvent.h:
2460         * dom/MouseEvent.cpp:
2461         (WebCore::MouseEvent::relatedTargetScoped): Deleted.
2462         * dom/MouseEvent.h:
2463
2464 2016-07-07  Chris Dumez  <cdumez@apple.com>
2465
2466         tdody.deleteRow(-1) and tr.deleteCell(-1) should not throw when there are no rows / cells
2467         https://bugs.webkit.org/show_bug.cgi?id=159527
2468         <rdar://problem/27232261>
2469
2470         Reviewed by Alex Christensen.
2471
2472         tdody.deleteRow(-1) and tr.deleteCell(-1) should not throw when there
2473         are no rows / cells:
2474         - https://html.spec.whatwg.org/multipage/tables.html#dom-tbody-deleterow
2475         - https://html.spec.whatwg.org/multipage/tables.html#dom-tr-deletecell
2476
2477         Firefox and Chrome do not throw but WebKit was throwing.
2478
2479         No new tests, rebaselined existing tests.
2480
2481         * html/HTMLTableRowElement.cpp:
2482         (WebCore::HTMLTableRowElement::deleteCell):
2483         * html/HTMLTableSectionElement.cpp:
2484         (WebCore::HTMLTableSectionElement::deleteRow):
2485
2486 2016-07-07  Chris Dumez  <cdumez@apple.com>
2487
2488         HTMLTitleElement.text should only account for direct children Text nodes
2489         https://bugs.webkit.org/show_bug.cgi?id=159536
2490
2491         Reviewed by Ryosuke Niwa.
2492
2493         HTMLTitleElement.text should only account for direct children Text nodes:
2494         - https://html.spec.whatwg.org/multipage/semantics.html#dom-title-text
2495         - https://html.spec.whatwg.org/multipage/infrastructure.html#child-text-content
2496
2497         Firefox and Chrome match the specification. However, WebKit accounted for all
2498         Text nodes that are descendants, not just children. This patch aligns our
2499         behavior with the specification and other browsers.
2500
2501         No new tests, rebaselined existing tests.
2502
2503         * html/HTMLTitleElement.cpp:
2504         (WebCore::HTMLTitleElement::text):
2505
2506 2016-07-07  Dean Jackson  <dino@apple.com>
2507
2508         REGRESSION(r200769): animations are no longer overridden
2509         https://bugs.webkit.org/show_bug.cgi?id=159450
2510         <rdar://problem/27120570>
2511
2512         Reviewed by Zalan Bujtas.
2513
2514         The change in r200769 removed a lot of the prefixing variant
2515         handling, but unfortunately we can't be completely rid
2516         of it until we alias the prefixed transitions and animations
2517         to the non-prefixed form. For example, setting the prefixed
2518         shorthand has to reset the non-prefixed longhands.
2519
2520         The fix was to explicitly call the variant forms when
2521         parsing such longhands, and make sure that MutableStyleProperties
2522         removes all prefixed variants when removing shorthands.
2523
2524         The existing test was amended to cover this case:
2525         fast/css/shorthand-omitted-initial-value-overrides-shorthand.html
2526
2527         * css/CSSParser.cpp:
2528         (WebCore::CSSParser::parseAnimationShorthand):
2529         (WebCore::CSSParser::addPropertyWithPrefixingVariant):
2530         (WebCore::CSSParser::parseTransitionShorthand):
2531         * css/CSSParser.h:
2532         * css/StyleProperties.cpp:
2533         (WebCore::MutableStyleProperties::removeShorthandProperty):
2534
2535 2016-07-07  Alex Christensen  <achristensen@webkit.org>
2536
2537         Fix CMake build.
2538
2539         * PlatformMac.cmake:
2540
2541 2016-07-07  Alex Christensen  <achristensen@webkit.org>
2542
2543         Fix CMake build.
2544
2545         * PlatformMac.cmake:
2546
2547 2016-07-07  Myles C. Maxfield  <mmaxfield@apple.com> and Frédéric Wang  <fred.wang@free.fr>
2548
2549         [Font Loading] The callback passed to document.fonts.ready should always be called
2550         https://bugs.webkit.org/show_bug.cgi?id=158884
2551
2552         Reviewed by Dean Jackson.
2553
2554         The boolean was simply not being reset when loads start.
2555
2556         Test: fast/text/font-face-set-ready-fire.html
2557
2558         * css/FontFaceSet.cpp:
2559         (WebCore::FontFaceSet::startedLoading):
2560         * css/FontFaceSet.h:
2561
2562 2016-07-07  Andy Estes  <aestes@apple.com>
2563
2564         [Content Filtering] Load blocked pages more like other error pages are loaded
2565         https://bugs.webkit.org/show_bug.cgi?id=159485
2566         <rdar://problem/26014076>
2567
2568         Reviewed by Brady Eidson.
2569
2570         Content filter blocked pages were being loaded by cancelling the provisional load of the
2571         page that was blocked and then scheduling a navigation to the content filter error page.
2572         Some clients would not expect a new, Web process-initiated provisional navigation to start
2573         after a cancellation, though, and this would put them in a bad state.
2574         
2575         This patch changes blocked page loading to behave more like loading other error pages.
2576         Specifically:
2577         1. didFailProvisionalLoad is dispatched with a new, non-cancellation error code.
2578         2. The blocked page is loaded immediately after dispatching didFailProvisionalLoad, which
2579            prevents FrameLoader from creating a new back-forward list item for the substitute data load.
2580         3. A substitute data load initiated by the client for the blocked URL is ignored if
2581            ContentFilter will display its own error page.
2582         4. A file: URL is used instead of a custom scheme for the base URL of the blocked page,
2583            since some clients expect this.
2584
2585         Updated existing tests to capture frame load delegate callbacks and the back forward list.
2586         Added new API tests: ContentFiltering.LoadAlternate*.
2587
2588         * English.lproj/Localizable.strings: Added a WebKitErrorFrameLoadBlockedByContentFilter description.
2589         * Resources/ContentFilterBlockedPage.html: Added.
2590         * WebCore.xcodeproj/project.pbxproj: Added ContentFilterBlockedPage.html as a frameowrk resource.
2591         * loader/ContentFilter.cpp:
2592         (WebCore::ContentFilter::stopFilteringMainResource): Only set m_state to Stopped if not
2593         already Blocked, so that we don't forget this ContentFilter was blocked when calling
2594         cancelMailResourceLoad() in didDecide().
2595         (WebCore::ContentFilter::didDecide): Moved code from DocumentLoader::contentFilterDidBlock() to here.
2596         Created a blockedByContentFilterError() and called cancelMainResourceLoad().
2597         (WebCore::blockedPageURL): Returned a file: URL to ContentFilterBlockedPage.html in WebCore.framework.
2598         (WebCore::ContentFilter::continueAfterSubstituteDataRequest): If the substitute data load
2599         is for the same failingURL as the currently-displayed blocked page, ignore it.
2600         (WebCore::ContentFilter::handleProvisionalLoadFailure): Load the blocked page if m_state is Blocked
2601         and the ResourceError matches the error we used when previously calling cancelMainResourceLoad().
2602         (WebCore::ContentFilter::unblockHandler): Deleted.
2603         (WebCore::ContentFilter::replacementData): Deleted.
2604         (WebCore::ContentFilter::unblockRequestDeniedScript): Deleted.
2605         * loader/ContentFilter.h:
2606         * loader/DocumentLoader.cpp:
2607         (WebCore::DocumentLoader::contentFilter): Returned m_contentFilter.
2608         (WebCore::DocumentLoader::installContentFilterUnblockHandler): Deleted.
2609         (WebCore::DocumentLoader::contentFilterDidBlock): Deleted.
2610         * loader/DocumentLoader.h:
2611         * loader/EmptyClients.h: Added a default implementation of blockedByContentFilterError().
2612         * loader/FrameLoader.cpp:
2613         (WebCore::FrameLoader::load): If m_loadType was already RedirectWithLockedBackForwardList
2614         and we are loading subsitute data for a failing URL, continue to use RedirectWithLockedBackForwardList.
2615         This prevents a new back-forward list item from being created when loading a blocked page in a subframe.
2616         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2617         Called ContentFilter::handleProvisionalLoadFailure() after dispatchDidFailProvisionalLoad().
2618         (WebCore::FrameLoader::blockedByContentFilterError): Called FrameLoaderClient::blockedByContentFilterError().
2619         * loader/FrameLoader.h:
2620         * loader/FrameLoaderClient.h:
2621         * loader/NavigationScheduler.cpp:
2622         (WebCore::ScheduledSubstituteDataLoad::ScheduledSubstituteDataLoad): Deleted.
2623         (WebCore::NavigationScheduler::scheduleSubstituteDataLoad): Deleted.
2624         * loader/NavigationScheduler.h:
2625         * loader/PolicyChecker.cpp:
2626         (WebCore::PolicyChecker::checkNavigationPolicy): Ignored a substitute data load for a
2627         failing URL if ContentFilter::continueAfterSubstituteDataRequest() returns false.
2628
2629 2016-07-07  Chris Dumez  <cdumez@apple.com>
2630
2631         td / th should be exposed as HTMLTableCellElement objects
2632         https://bugs.webkit.org/show_bug.cgi?id=159518
2633         <rdar://problem/27225436>
2634
2635         Reviewed by Ryosuke Niwa.
2636
2637         td / th should be exposed as HTMLTableCellElement objects:
2638         - https://html.spec.whatwg.org/multipage/tables.html#the-td-element
2639         - https://html.spec.whatwg.org/multipage/tables.html#the-th-element
2640
2641         We were using HTMLTableDataCellElement / HTMLTableHeaderCellElement
2642         sub-types.
2643
2644         Firefox and Chrome match the current specification.
2645
2646         We actually introduced these types recently via Bug 148859 to align
2647         with an older version of the HTML specification. However, it seems the
2648         specification has been updated to match Firefox / Chrome in the mean
2649         time.
2650
2651         Since we have not shipped those subtypes yet, the compatibility risk is
2652         low.
2653
2654         No new tests, rebaselined existing tests.
2655
2656         * CMakeLists.txt:
2657         * DerivedSources.cpp:
2658         * DerivedSources.make:
2659         * WebCore.xcodeproj/project.pbxproj:
2660         * html/HTMLElementsAllInOne.cpp:
2661         * html/HTMLTableCellElement.cpp:
2662         (WebCore::HTMLTableCellElement::create):
2663         (WebCore::HTMLTableCellElement::scope):
2664         (WebCore::HTMLTableCellElement::setScope):
2665         (WebCore::HTMLTableCellElement::setRowSpanForBindings): Deleted.
2666         * html/HTMLTableCellElement.h:
2667         * html/HTMLTableCellElement.idl:
2668         * html/HTMLTableDataCellElement.h: Removed.
2669         * html/HTMLTableDataCellElement.idl: Removed.
2670         * html/HTMLTableHeaderCellElement.cpp: Removed.
2671         * html/HTMLTableHeaderCellElement.h: Removed.
2672         * html/HTMLTableHeaderCellElement.idl: Removed.
2673         * html/HTMLTableRowElement.cpp:
2674         (WebCore::HTMLTableRowElement::insertCell):
2675         * html/HTMLTagNames.in:
2676
2677 2016-07-07  Brady Eidson  <beidson@apple.com>
2678
2679         Modern IDB: When IDBDatabase objects are garbage collected, they don't close their server connection.
2680         <rdar://problem/25910345> and https://bugs.webkit.org/show_bug.cgi?id=159523
2681
2682         Reviewed by Alex Christensen.
2683
2684         Tests: storage/indexeddb/modern/gc-closes-database-private.html
2685                storage/indexeddb/modern/gc-closes-database.html
2686
2687         * Modules/indexeddb/IDBDatabase.cpp:
2688         (WebCore::IDBDatabase::IDBDatabase): New logging.
2689         (WebCore::IDBDatabase::~IDBDatabase): Close server connection.
2690         (WebCore::IDBDatabase::fireVersionChangeEvent): New logging.
2691         (WebCore::IDBDatabase::dispatchEvent): New logging.
2692
2693         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2694         (WebCore::IDBClient::IDBConnectionToServer::openDatabase): New logging.
2695
2696 2016-07-07  Frederic Wang  <fwang@igalia.com>
2697
2698         Refactor layout functions to avoid using flexbox in MathML
2699         https://bugs.webkit.org/show_bug.cgi?id=153991
2700
2701         Reviewed by Brent Fulgham.
2702
2703         No new tests, already covered by existing tests.
2704
2705         * css/mathml.css:
2706         (math): Change inline mathematical formulas from inline-flex to inline.
2707         (math[display="block"]): Change display mathematical formulas from flex to block and
2708         remove flexbox property justify-content.
2709         (ms, mspace, mtext, mi, mn, mo, mrow, mfenced, mfrac, msub, msup, msubsup, mmultiscripts,
2710          mprescripts, none, munder, mover, munderover, msqrt, mroot, merror, mphantom, mstyle)
2711          menclose, semantics, mpadded, maction): In order to render properly, all children of the
2712          classes derived from RenderMathMLBlock must now be block-level. So we add more elements in
2713          this list and update the display property.
2714         (mtd > *): However, we use inline-block for children of the cell so that the text-align
2715          property is taken into account.
2716         * rendering/RenderBox.cpp:
2717         (WebCore::RenderBox::computeLogicalWidthInRegion): Add a special case for RenderMathMLBlock
2718         to preserve the old behavior.
2719         (WebCore::RenderBox::sizesLogicalWidthToFitContent): Ditto.
2720         * rendering/RenderFlexibleBox.h: No need to override layoutBlock anymore.
2721         * rendering/mathml/RenderMathMLBlock.cpp: Include LayoutRepainter header for use in layoutBlock.
2722         (WebCore::RenderMathMLBlock::RenderMathMLBlock): Inherit from RenderBlock and ensure that
2723         our children are block-level.
2724         (WebCore::RenderMathMLBlock::~RenderMathMLBlock): Added.
2725         (WebCore::RenderMathMLBlock::baselinePosition): If the baselinefirstLineBaseline() is
2726         undefined, just returns 0.
2727         (WebCore::RenderMathMLBlock::paint): Call RenderBlock::paint.
2728         (WebCore::RenderMathMLBlock::layoutItems): Implement a simplified version of
2729         RenderFlexibleBox::layoutItems where we assume horizontal layout for all children.
2730         (WebCore::RenderMathMLBlock::layoutBlock): Add a basic implementation based on
2731         RenderFlexibleBox::layoutBlock.
2732         (WebCore::RenderMathMLBlock::renderName): Deleted. There is now a simple implementation in the header.
2733         * rendering/mathml/RenderMathMLBlock.h: Use RenderBlock instead of RenderFlexibleBox and
2734         define layout functions. Define avoidsFloats and canDropAnonymousBlockChild to preserve
2735         the old behavior and remove isFlexibleBoxImpl.
2736         * rendering/mathml/RenderMathMLFenced.cpp:
2737         (WebCore::RenderMathMLFenced::createMathMLOperator): Use block for anonymous RenderMathMLOperator.
2738         * rendering/mathml/RenderMathMLRow.cpp:
2739         (WebCore::RenderMathMLRow::layoutRowItems): No need to handle the flexbox case anymore.
2740         (WebCore::RenderMathMLRow::paintChildren): Deleted. We now just use RenderBlock::paintChildren.
2741         * rendering/mathml/RenderMathMLRow.h:
2742         * rendering/mathml/RenderMathMLFraction.cpp:
2743         (WebCore::RenderMathMLFraction::paintChildren): Deleted. We now just use RenderBlock::paintChildren.
2744         * rendering/mathml/RenderMathMLFraction.h:
2745         * rendering/mathml/RenderMathMLRoot.cpp:
2746         (WebCore::RenderMathMLRoot::paintChildren): Deleted. We now just use RenderBlock::paintChildren.
2747         * rendering/mathml/RenderMathMLRoot.h:
2748         * rendering/mathml/RenderMathMLScripts.cpp:
2749         (WebCore::RenderMathMLScripts::paintChildren): Deleted. We now just use RenderBlock::paintChildren.
2750         * rendering/mathml/RenderMathMLScripts.h:
2751         * rendering/mathml/RenderMathMLUnderOver.cpp:
2752         (WebCore::RenderMathMLUnderOver::paintChildren): Deleted. We now just use RenderBlock::paintChildren.
2753         * rendering/mathml/RenderMathMLUnderOver.h:
2754
2755 2016-07-07  Antti Koivisto  <antti@apple.com>
2756
2757         REGRESSION (r199054): CrashTracer: [USER] parseWebKit at WebCore: WebCore::RenderBlockFlow::checkFloatsInCleanLine + 107
2758         https://bugs.webkit.org/show_bug.cgi?id=159519
2759
2760         Reviewed by Zalan Bujtas.
2761
2762         Test: fast/inline/trailing-floats-inline-crash.html
2763
2764         * rendering/RenderBlockLineLayout.cpp:
2765         (WebCore::RenderBlockFlow::checkFloatsInCleanLine):
2766
2767             Use the existing deletionHasBegun bit in RenderStyle to assert against this reliably.
2768
2769         * rendering/RenderLineBoxList.cpp:
2770         (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
2771
2772             In some cases a special TrailingFloatsRootInlineBox may be added as the last root linebox of a flow.
2773             If it is combined with br the existing invalidation that invalidates the next and previous line may
2774             not be sufficient. Test for this case and invalidate the TrailingFloatsRootInlineBox too if it exists.
2775
2776         * rendering/RootInlineBox.h:
2777         (WebCore::RootInlineBox::isTrailingFloatsRootInlineBox):
2778         * rendering/TrailingFloatsRootInlineBox.h:
2779         * rendering/style/RenderStyle.h:
2780         (WebCore::RenderStyle::deletionHasBegun):
2781
2782             Expose the bit in debug.
2783
2784 2016-07-07  Alex Christensen  <achristensen@webkit.org>
2785
2786         Use SocketProvider to create WebSocketChannels
2787         https://bugs.webkit.org/show_bug.cgi?id=158776
2788
2789         Reviewed by Brent Fulgham.
2790
2791         This patch should have no change in behavior except making an InvalidStateError in
2792         conditions where we should not be able to do networking, like in a detached frame.
2793         It just replaces ThreadableWebSocketChannel::create with SocketProvider::createWebSocketChannel
2794         which does the same thing as ThreadableWebSocketChannel::create for Mac and 
2795         Windows WebKit1.  The WebKit2 implementation is the same right now, but it will
2796         be replaced by a proxy that will do the WebSocket operations in the NetworkProcess.
2797
2798         * Modules/websockets/ThreadableWebSocketChannel.cpp: Removed.
2799         * Modules/websockets/ThreadableWebSocketChannel.h:
2800         (WebCore::ThreadableWebSocketChannel::ThreadableWebSocketChannel):
2801         * Modules/websockets/WebSocket.cpp:
2802         (WebCore::WebSocket::connect):
2803         * Modules/websockets/WebSocketChannel.h:
2804         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
2805         * WebCore.xcodeproj/project.pbxproj:
2806         * dom/Document.cpp:
2807         (WebCore::Document::idbConnectionProxy):
2808         (WebCore::Document::socketProvider):
2809         (WebCore::Document::canNavigate):
2810         * dom/Document.h:
2811         (WebCore::Document::notifyRemovePendingSheetIfNeeded):
2812         * dom/ScriptExecutionContext.h:
2813         * inspector/InspectorOverlay.cpp:
2814         (WebCore::InspectorOverlay::overlayPage):
2815         * loader/EmptyClients.cpp:
2816         (WebCore::EmptyEditorClient::registerRedoStep):
2817         (WebCore::EmptySocketProvider::createWebSocketChannel):
2818         * loader/EmptyClients.h:
2819         * page/Page.h:
2820         * page/PageConfiguration.cpp:
2821         (WebCore::PageConfiguration::PageConfiguration):
2822         * page/PageConfiguration.h:
2823         * page/SocketProvider.h:
2824         (WebCore::SocketProvider::~SocketProvider):
2825         * svg/graphics/SVGImage.cpp:
2826         (WebCore::SVGImage::dataChanged):
2827         * workers/DedicatedWorkerGlobalScope.cpp:
2828         (WebCore::DedicatedWorkerGlobalScope::create):
2829         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
2830         * workers/DedicatedWorkerGlobalScope.h:
2831         * workers/DedicatedWorkerThread.cpp:
2832         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
2833         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
2834         (WebCore::DedicatedWorkerThread::runEventLoop):
2835         * workers/DedicatedWorkerThread.h:
2836         * workers/WorkerGlobalScope.cpp:
2837         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
2838         (WebCore::WorkerGlobalScope::disableEval):
2839         (WebCore::WorkerGlobalScope::socketProvider):
2840         (WebCore::WorkerGlobalScope::idbConnectionProxy):
2841         * workers/WorkerGlobalScope.h:
2842         (WebCore::WorkerGlobalScope::script):
2843         * workers/WorkerMessagingProxy.cpp:
2844         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
2845         * workers/WorkerThread.cpp:
2846         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
2847         (WebCore::WorkerThread::WorkerThread):
2848         (WebCore::WorkerThread::idbConnectionProxy):
2849         (WebCore::WorkerThread::socketProvider):
2850         * workers/WorkerThread.h:
2851         (WebCore::WorkerThread::workerGlobalScope):
2852
2853 2016-07-07  Commit Queue  <commit-queue@webkit.org>
2854
2855         Unreviewed, rolling out r202905 and r202911.
2856         https://bugs.webkit.org/show_bug.cgi?id=159522
2857
2858         This test is fails on El Capitan and Sierra WK1 (Requested by
2859         ryanhaddad on #webkit).
2860
2861         Reverted changesets:
2862
2863         "Add a test for media control dropoff"
2864         https://bugs.webkit.org/show_bug.cgi?id=151287
2865         http://trac.webkit.org/changeset/202905
2866
2867         "Add a test for media control dropoff"
2868         https://bugs.webkit.org/show_bug.cgi?id=151287
2869         http://trac.webkit.org/changeset/202911
2870
2871 2016-07-07  Antoine Quint  <graouts@apple.com>
2872
2873         <img> with a wide gamut PDF does not display using a wide gamut color space
2874         https://bugs.webkit.org/show_bug.cgi?id=158983
2875         <rdar://problem/25720247>
2876
2877         Reviewed by Dean Jackson.
2878
2879         Calls to ImageBuffer::createCompatibleBuffer() that do not provide an explicit
2880         color space will now infer the color space from the provided graphics context
2881         on platforms using CG. The method signature that takes in a GraphicsContext
2882         without a color space is now split into a CG-specified implementation and a
2883         Cairo one to avoid having diverging platform code in ImageBuffer.cpp.
2884
2885         Some call sites need to provide an explicit color space still, so we add a new
2886         ImageBuffer::createCompatibleBuffer() that allows for that while inferring
2887         sizing and scaling from a GraphicsContext.
2888         
2889         All signatures of ImageBuffer::createCompatibleBuffer() are losing the
2890         hasAlpha parameter which was always ignored. All call sites that were using
2891         hasAlpha have been updated.
2892
2893         In addition, we make all the IOSurface and IOSurfacePool code, which is
2894         CG-specific, use the plaform-specific type CGColorSpaceRef instead of ColorSpace
2895         so that we may pick up on the color space copied over from the graphics context
2896         in the CG-specific implementation of ImageBuffer::createCompatibleBuffer().
2897
2898         * html/canvas/CanvasRenderingContext2D.cpp:
2899         (WebCore::CanvasRenderingContext2D::drawTextInternal):
2900         * platform/graphics/BitmapImage.cpp:
2901         (WebCore::BitmapImage::drawPattern):
2902         * platform/graphics/GradientImage.cpp:
2903         (WebCore::GradientImage::drawPattern):
2904         * platform/graphics/ImageBuffer.cpp:
2905         (WebCore::ImageBuffer::createCompatibleBuffer):
2906         * platform/graphics/ImageBuffer.h:
2907         * platform/graphics/NamedImageGeneratedImage.cpp:
2908         (WebCore::NamedImageGeneratedImage::drawPattern):
2909         * platform/graphics/cairo/ImageBufferCairo.cpp:
2910         (WebCore::ImageBuffer::createCompatibleBuffer):
2911         * platform/graphics/cg/IOSurfacePool.cpp:
2912         (WebCore::surfaceMatchesParameters):
2913         (WebCore::IOSurfacePool::takeSurface):
2914         * platform/graphics/cg/IOSurfacePool.h:
2915         * platform/graphics/cg/ImageBufferCG.cpp:
2916         (WebCore::ImageBuffer::createCompatibleBuffer):
2917         (WebCore::ImageBuffer::ImageBuffer):
2918         * platform/graphics/cocoa/IOSurface.h:
2919         * platform/graphics/cocoa/IOSurface.mm:
2920         (WebCore::IOSurface::surfaceFromPool):
2921         (WebCore::IOSurface::create):
2922         (WebCore::IOSurface::createFromSendRight):
2923         (WebCore::IOSurface::createFromSurface):
2924         (WebCore::IOSurface::createFromImage):
2925         (WebCore::IOSurface::IOSurface):
2926         (WebCore::IOSurface::ensurePlatformContext):
2927         * platform/mac/ThemeMac.mm:
2928         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
2929         * platform/spi/cg/CoreGraphicsSPI.h:
2930         * rendering/RenderBoxModelObject.cpp:
2931         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2932         * rendering/RenderThemeMac.mm:
2933         (WebCore::RenderThemeMac::paintProgressBar):
2934         * rendering/svg/SVGRenderingContext.cpp:
2935         (WebCore::SVGRenderingContext::bufferForeground):
2936         * svg/graphics/SVGImage.cpp:
2937         (WebCore::SVGImage::drawPatternForContainer):
2938
2939 2016-07-07  Beth Dakin  <bdakin@apple.com>
2940
2941         All fullscreen videos should be able the control the controls manager
2942         https://bugs.webkit.org/show_bug.cgi?id=159496
2943         -and corresponding-
2944         rdar://problem/27009446
2945
2946         Reviewed by Eric Carlson.
2947
2948         * html/HTMLMediaElement.cpp:
2949         (WebCore::HTMLMediaElement::fullscreenModeChanged):
2950         * html/MediaElementSession.cpp:
2951         (WebCore::MediaElementSession::canControlControlsManager):
2952
2953 2016-07-07  Jer Noble  <jer.noble@apple.com>
2954
2955         Crash due to HTMLMediaElement at JavaScriptCore: JSC::JSLockHolder::JSLockHolder
2956         https://bugs.webkit.org/show_bug.cgi?id=159517
2957         <rdar://problem/27221109>
2958
2959         Reviewed by Eric Carlson.
2960
2961         When WebKit on iOS gets a notification that the UIProcess has been backgrounded, it sends an
2962         interruption event to the WebProcess to pause any playing HTMLMediaElements. When the
2963         elements which get this interruption have pending promises created during a previous call to
2964         play(), these promises get rejected.
2965
2966         However, if the HTMLMediaElement's document has already been destroyed, the pending Promises
2967         are in an inconsistent state: their script execution context (the document) has been
2968         destroyed, leading to the crash in JSLockHolder.
2969
2970         When HTMLMediaElement is notified that its ScriptExecutionContext has been destroyed, also
2971         clear the list of pending Promises.
2972
2973         * html/HTMLMediaElement.cpp:
2974         (WebCore::HTMLMediaElement::contextDestroyed):
2975
2976 2016-07-05  Jer Noble  <jer.noble@apple.com>
2977
2978         Facebook videos without audio tracks will sometimes cause playback controls to appear.
2979         https://bugs.webkit.org/show_bug.cgi?id=159437
2980
2981         Reviewed by Eric Carlson.
2982
2983         Because updatePlaybackControlsManager() will cause the session manager to walk through all
2984         the outstanding sessions asking if it canControlControlsManager(), some sessions will say
2985         they can control the controls manager if we are currently processing a user gesture. This is
2986         obviously not intended (there may be a user gesture to un-mute video 1, but an unrelated
2987         video 2 should not be allowed to use that use gesture to fulfill its own requirements.)
2988
2989         So in those situations where conditions may have changed and updatePlaybackControlsManager()
2990         needs to be called, instead schedule the update for the next run loop.
2991         
2992         * html/HTMLMediaElement.cpp:
2993         (WebCore::HTMLMediaElement::setMuted):
2994         (WebCore::HTMLMediaElement::layoutSizeChanged):
2995         (WebCore::HTMLMediaElement::updatePlayState):
2996         (WebCore::HTMLMediaElement::createMediaPlayer):
2997         (WebCore::HTMLMediaElement::scheduleUpdatePlaybackControlsManager):
2998         * html/HTMLMediaElement.h:
2999
3000 2016-07-07  Jer Noble  <jer.noble@apple.com>
3001
3002         Unreviewed build fix after r202908. Fix the webPlaybackSessionInterfaceMac @property.
3003
3004         * platform/mac/WebPlaybackControlsManager.h:
3005         * platform/mac/WebPlaybackControlsManager.mm:
3006
3007 2016-07-07  Youenn Fablet  <youenn@apple.com>
3008
3009         [Fetch API] Response constructor should throw in case of bad reason phrase
3010         https://bugs.webkit.org/show_bug.cgi?id=159508
3011
3012         Reviewed by Alex Christensen.
3013
3014         Covered by rebased test.
3015
3016         * Modules/fetch/FetchResponse.cpp:
3017         (WebCore::FetchResponse::initializeWith): Validating reason phrase with new routine.
3018         Throwing a TypeError in case of error.
3019         * platform/network/HTTPParsers.cpp:
3020         (WebCore::isValidReasonPhrase): Added to validate reason phrase according
3021         https://tools.ietf.org/html/rfc7230#section-3.1.2
3022         * platform/network/HTTPParsers.h:
3023
3024 2016-07-07  Youenn Fablet  <youenn@apple.com>
3025
3026         [Fetch API] Response.redirect should throw a RangeError in case of bad status code
3027         https://bugs.webkit.org/show_bug.cgi?id=159507
3028
3029         Reviewed by Alex Christensen.
3030
3031         Covered by rebased test.
3032
3033         * Modules/fetch/FetchResponse.cpp:
3034         (WebCore::FetchResponse::redirect): Throw a RangeError in case of bad status.
3035
3036 2016-07-05  Jer Noble  <jer.noble@apple.com>
3037
3038         Ownership between WebPlaybackSessionInterfaceMac and WebPlaybackControlsManager is backwards.
3039         https://bugs.webkit.org/show_bug.cgi?id=159441
3040
3041         Reviewed by Eric Carlson.
3042
3043         The WebPlaybackControlsManager should own the WebPlaybackSessionInterfaceMac, and not
3044         vice versa.
3045
3046         * platform/mac/WebPlaybackControlsManager.h:
3047         * platform/mac/WebPlaybackControlsManager.mm:
3048         (-[WebPlaybackControlsManager webPlaybackSessionInterfaceMac]):
3049         (-[WebPlaybackControlsManager setWebPlaybackSessionInterfaceMac:]):
3050         * platform/mac/WebPlaybackSessionInterfaceMac.h:
3051         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
3052         (WebCore::WebPlaybackSessionInterfaceMac::playBackControlsManager):
3053
3054 2016-07-07  Eric Carlson  <eric.carlson@apple.com>
3055
3056         Add a test for media control dropoff
3057         https://bugs.webkit.org/show_bug.cgi?id=151287
3058         <rdar://problem/23544666>
3059
3060         Reviewed by Antoine Quint.
3061
3062         Test: media/controls/inline-elements-dropoff-order.html
3063
3064         * Modules/mediacontrols/mediaControlsApple.js: Expose more state to testing.
3065
3066 2016-07-07  Miguel Gomez  <magomez@igalia.com>
3067
3068         [GTK] Painting a video into a canvas doesn't work when accelerated compositing is enabled
3069         https://bugs.webkit.org/show_bug.cgi?id=159405
3070
3071         Reviewed by Xabier Rodriguez-Calvar.
3072
3073         Implement video frame painting to the canvas when accelerated compositing is enabled.
3074
3075         Already covered by existent tests.
3076
3077         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3078         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
3079         Replace custom enumeration for the video rotation with the ImageOrientation class.
3080         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3081         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize):
3082         Replace the orientation value comparison with ImageOrientation::usesWidthAsHeight().
3083         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
3084         Perform the frame painting taking into account the video orientation tag.
3085         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
3086         Rotate the native image before returning it.
3087         (WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation):
3088         Replace custom enumeration for the video rotation with the ImageOrientation class.
3089         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase): Deleted.
3090         Remove orientation initialization.
3091         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3092         Remove custom enumeration for the video orientation.
3093
3094 2016-07-07  Philippe Normand  <pnormand@igalia.com>
3095
3096         [GStreamer][GL] switch to appsink
3097         https://bugs.webkit.org/show_bug.cgi?id=159466
3098
3099         Reviewed by Carlos Garcia Campos.
3100
3101         Fakesink is mostly used for tests. Appsink provides the same
3102         functionality and is actually meant to be used on application
3103         side.
3104
3105         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3106         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
3107         (WebCore::newSampleCallback):
3108         (WebCore::newPrerollCallback):
3109         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
3110         (WebCore::MediaPlayerPrivateGStreamerBase::drawCallback): Deleted.
3111         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3112
3113 2016-07-06  Chris Dumez  <cdumez@apple.com>
3114
3115         Document.title setter does not work for SVG documents
3116         https://bugs.webkit.org/show_bug.cgi?id=159503
3117         <rdar://problem/27212313>
3118
3119         Reviewed by Ryosuke Niwa.
3120
3121         Document.title setter should work for SVG documents:
3122         - https://html.spec.whatwg.org/multipage/dom.html#document.title
3123
3124         This patch aligns our behavior with the specification
3125         and with Firefox / Chrome.
3126
3127         No new tests, rebaselined existing test.
3128
3129         * dom/Document.cpp:
3130         (WebCore::Document::setTitle):
3131         - Reverse the if conditions for clarity.
3132         - If the document element is an SVG svg element, create a
3133           SVGTitleElement and insert it as first child of the
3134           document element.
3135         - Call SVGTitleElement::setText() instead of
3136           HTMLTitleElement::setText() at the end of the method if
3137           m_titleElement is a SVGTitleElement.
3138
3139         (WebCore::Document::updateTitleElement):
3140         - If document element is an SVG svg element, use the first
3141           child of the document element that is a SVGTitleElement.
3142
3143         * svg/SVGTitleElement.cpp:
3144         (WebCore::SVGTitleElement::setText):
3145         * svg/SVGTitleElement.h:
3146         Add SVGTitleElement::setText() method that does the same
3147         thing as HTMLTitleElement::setText().
3148
3149 2016-07-06  Chris Dumez  <cdumez@apple.com>
3150
3151         Align Document.body setter with the HTML specification
3152         https://bugs.webkit.org/show_bug.cgi?id=159490
3153
3154         Reviewed by Alex Christensen.
3155
3156         Align Document.body setter with the HTML specification:
3157         - https://html.spec.whatwg.org/multipage/dom.html#dom-document-body
3158
3159         In particular, the following web-exposed changes were made:
3160         - It is now possible to set document.body to a frameset element.
3161         - We no longer call importNode() on the passed in body. Therefore,
3162           if the body comes from another document, its will be adopted /
3163           transferred rather than cloned.
3164
3165         Both changes match the behavior of Firefox and Chrome.
3166
3167         No new tests, updated / rebaselined existing tests.
3168
3169         * dom/Document.cpp:
3170         (WebCore::Document::setBodyOrFrameset):
3171
3172 2016-07-06  Brady Eidson  <beidson@apple.com>
3173
3174         Fix my bogus json I landed earlier today.
3175
3176         * features.json:
3177
3178 2016-07-06  Benjamin Poulain  <bpoulain@apple.com>
3179
3180         [JSC] Unify how we throw TypeError from C++
3181         https://bugs.webkit.org/show_bug.cgi?id=159500
3182
3183         Reviewed by Saam Barati.
3184
3185         * bindings/js/JSBiquadFilterNodeCustom.cpp:
3186         (WebCore::JSBiquadFilterNode::setType):
3187         * bindings/js/JSBlobCustom.cpp:
3188         (WebCore::constructJSBlob):
3189         * bindings/js/JSCryptoKeySerializationJWK.cpp:
3190         (WebCore::getBigIntegerVectorFromJSON):
3191         (WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
3192         (WebCore::tryJWKKeyOpsValue):
3193         (WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
3194         (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
3195         (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
3196         (WebCore::JSCryptoKeySerializationJWK::keyData):
3197         (WebCore::addJWKAlgorithmToJSON):
3198         (WebCore::JSCryptoKeySerializationJWK::serialize):
3199         * bindings/js/JSCryptoOperationData.cpp:
3200         (WebCore::cryptoOperationDataFromJSValue):
3201         * bindings/js/JSDOMBinding.cpp:
3202         (WebCore::enforceRange):
3203         (WebCore::throwTypeError):
3204         (WebCore::throwArgumentMustBeEnumError):
3205         (WebCore::throwArgumentMustBeFunctionError):
3206         (WebCore::throwArgumentTypeError):
3207         (WebCore::throwArrayElementTypeError):
3208         (WebCore::throwGetterTypeError):
3209         (WebCore::throwThisTypeError):
3210         * bindings/js/JSDataCueCustom.cpp:
3211         (WebCore::constructJSDataCue):
3212         * bindings/js/JSDocumentCustom.cpp:
3213         (WebCore::JSDocument::defineElement):
3214         * bindings/js/JSFileCustom.cpp:
3215         (WebCore::constructJSFile):
3216         * bindings/js/JSModuleLoader.cpp:
3217         (WebCore::JSModuleLoader::evaluate):
3218         * bindings/js/JSMutationObserverCustom.cpp:
3219         (WebCore::constructJSMutationObserver):
3220         * bindings/js/JSOscillatorNodeCustom.cpp:
3221         (WebCore::JSOscillatorNode::setType):
3222         * bindings/js/JSPannerNodeCustom.cpp:
3223         (WebCore::JSPannerNode::setPanningModel):
3224         (WebCore::JSPannerNode::setDistanceModel):
3225         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
3226         (WebCore::constructJSReadableStreamController):
3227         (WebCore::constructJSReadableStreamReader):
3228         * bindings/js/JSSubtleCryptoCustom.cpp:
3229         (WebCore::cryptoKeyFormatFromJSValue):
3230         (WebCore::importKey):
3231         (WebCore::exportKey):
3232         * bindings/js/ReadableStreamController.cpp:
3233         (WebCore::ReadableStreamController::invoke):
3234         * bindings/js/SerializedScriptValue.cpp:
3235         (WebCore::CloneDeserializer::throwValidationError):
3236         (WebCore::SerializedScriptValue::maybeThrowExceptionIfSerializationFailed):
3237         * bridge/c/c_instance.cpp:
3238         (JSC::Bindings::CInstance::invokeMethod):
3239         * bridge/objc/objc_instance.mm:
3240         (ObjcInstance::invokeMethod):
3241         * bridge/objc/objc_runtime.mm:
3242         (JSC::Bindings::ObjcArray::setValueAt):
3243
3244 2016-07-06  Tim Horton  <timothy_horton@apple.com>
3245
3246         Email from June 1st containing text 'Today @ 7:10PM' is linkified, but shouldn't be
3247         https://bugs.webkit.org/show_bug.cgi?id=159498
3248         <rdar://problem/26719903>
3249
3250         Reviewed by Sam Weinig.
3251
3252         New API test: WebKit2.DataDetectionReferenceDate
3253
3254         * editing/cocoa/DataDetection.h:
3255         * editing/cocoa/DataDetection.mm:
3256         (WebCore::DataDetection::detectContentInRange):
3257         Extract the reference date from the DataDetectors context dictionary if it exists,
3258         and pass it along to DataDetectors.
3259
3260         * loader/FrameLoader.cpp:
3261         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
3262         * loader/FrameLoaderClient.h:
3263         Plumb the DataDetectors context dictionary through from WebPage.
3264
3265 2016-07-06  Chris Dumez  <cdumez@apple.com>
3266
3267         [WK2][Cocoa] Disable ResourceResponse lazy initialization
3268         https://bugs.webkit.org/show_bug.cgi?id=159497
3269         <rdar://problem/27209066>
3270
3271         Reviewed by Alex Christensen.
3272
3273         Add method to Cocoa's ResponseResponse header to disable
3274         lazy initialization.
3275
3276         * platform/network/cf/ResourceResponse.h:
3277         * platform/network/cocoa/ResourceResponseCocoa.mm:
3278         (WebCore::ResourceResponse::disableLazyInitialization):
3279
3280 2016-07-06  Brent Fulgham  <bfulgham@apple.com>
3281
3282         Return values of JSArray::createUninitialized (and related) are not consistently checked for nullptr
3283         https://bugs.webkit.org/show_bug.cgi?id=159495
3284         <rdar://problem/26075433>
3285
3286         Reviewed by Dean Jackson.
3287
3288         Test: fast/canvas/canvas-getImageData-invalid-result-buffer-crash.html
3289
3290         * html/ImageData.cpp:
3291         (WebCore::ImageData::ImageData): Assert at construction if we could not create a valid
3292         buffer.
3293         * platform/SharedBuffer.cpp:
3294         (WebCore::SharedBuffer::createArrayBuffer): Check for a null buffer before using it.
3295         * platform/graphics/cg/ImageBufferDataCG.cpp:
3296         (WebCore::ImageBufferData::getData): Ditto.
3297         * platform/graphics/filters/FEGaussianBlur.cpp:
3298         (WebCore::FEGaussianBlur::platformApplySoftware): Ditto.
3299         * platform/graphics/filters/FilterEffect.cpp:
3300         (WebCore::FilterEffect::copyImageBytes): Ditto.
3301         (WebCore::FilterEffect::copyUnmultipliedImage): Ditto.
3302         (WebCore::FilterEffect::copyPremultipliedImage): Ditto.
3303
3304 2016-07-06  Chris Dumez  <cdumez@apple.com>
3305
3306         Document.body should return the first child of the html element that is either a body / frameset element
3307         https://bugs.webkit.org/show_bug.cgi?id=159488
3308
3309         Reviewed by Ryosuke Niwa.
3310
3311         Document.body should return the first child of the html element that is
3312         either a body / frameset element:
3313         - https://html.spec.whatwg.org/multipage/dom.html#dom-document-body
3314         - https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2
3315
3316         We used the first child of the *document* element that is either a
3317         body / frameset element, even if the document element is not an html
3318         element.
3319
3320         Firefox and Chrome match the specification.
3321
3322         Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/Document.body.html
3323
3324         * dom/Document.cpp:
3325         (WebCore::Document::bodyOrFrameset):
3326
3327 2016-07-06  Dean Jackson  <dino@apple.com>
3328
3329         Adopt new PiP glyph
3330         https://bugs.webkit.org/show_bug.cgi?id=159494
3331         <rdar://problem/27061084>
3332
3333         Reviewed by Ada Chan.
3334
3335         We got new artwork for Picture-in-Picture on macOS from
3336         our designers.
3337
3338         * Modules/mediacontrols/mediaControlsApple.css:
3339         (video::-webkit-media-controls-panel .picture-in-picture-button):
3340         (video::-webkit-media-controls-panel .picture-in-picture-button.return-from-picture-in-picture):
3341
3342 2016-07-06  Commit Queue  <commit-queue@webkit.org>
3343
3344         Unreviewed, rolling out r202867.
3345         https://bugs.webkit.org/show_bug.cgi?id=159491
3346
3347         This change caused an existing LayoutTest to crash on ios-
3348         simulator (Requested by ryanhaddad on #webkit).
3349
3350         Reverted changeset:
3351
3352         "<img> with a wide gamut PDF does not display using a wide
3353         gamut color space"
3354         https://bugs.webkit.org/show_bug.cgi?id=158983
3355         http://trac.webkit.org/changeset/202867
3356
3357 2016-07-06  Chris Dumez  <cdumez@apple.com>
3358
3359         [ShadowDOM] assignedSlot property should be on Text, not CharacterData
3360         https://bugs.webkit.org/show_bug.cgi?id=159482
3361         <rdar://problem/27201687>
3362
3363         Reviewed by Ryosuke Niwa.
3364
3365         assignedSlot property should be on Text, not CharacterData as per:
3366         - https://dom.spec.whatwg.org/#mixin-slotable
3367
3368         Align with the latest specification.
3369
3370         No new tests, rebaselined existing test.
3371
3372         * CMakeLists.txt:
3373         * DerivedSources.make:
3374         * WebCore.xcodeproj/project.pbxproj:
3375         * dom/Element.idl:
3376         * dom/NonDocumentTypeChildNode.idl:
3377         * dom/Slotable.idl: Copied from Source/WebCore/dom/NonDocumentTypeChildNode.idl.
3378         * dom/Text.idl:
3379
3380 2016-07-06  Jeremy Jones  <jeremyj@apple.com>
3381
3382         Do not animate video fullscreen exit when page has navigated away.
3383         https://bugs.webkit.org/show_bug.cgi?id=159479
3384