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