URLParser should ignore tabs in authority
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-09-28  Alex Christensen  <achristensen@webkit.org>
2
3         URLParser should ignore tabs in authority
4         https://bugs.webkit.org/show_bug.cgi?id=162694
5
6         Reviewed by Geoffrey Garen.
7
8         Covered by new API tests.
9
10         * platform/URLParser.cpp:
11         (WebCore::URLParser::parseAuthority):
12
13 2016-09-28  Alex Christensen  <achristensen@webkit.org>
14
15         URLParser should ignore extra slashes after scheme:// and handle a missing slash after the port
16         https://bugs.webkit.org/show_bug.cgi?id=162690
17
18         Reviewed by Geoffrey Garen.
19
20         Covered by new API tests.
21
22         * platform/URLParser.cpp:
23         (WebCore::URLParser::parse):
24
25 2016-09-28  Alex Christensen  <achristensen@webkit.org>
26
27         URLParser should correctly canonicalize uppercase IPv6 addresses
28         https://bugs.webkit.org/show_bug.cgi?id=162680
29
30         Reviewed by Tim Horton.
31
32         Covered by a new API test.
33
34         * platform/URLParser.cpp:
35         (WebCore::URLParser::parseIPv6Host):
36         If there is an uppercase character in the IPv6 address part, then it is a syntax violation
37         because the canonicalized IPv6 address differs from the input String.
38
39 2016-09-28  Chris Dumez  <cdumez@apple.com>
40
41         Unreviewed, fix iOS build.
42
43         * bindings/js/ios/TouchConstructors.cpp:
44
45 2016-09-28  Chris Dumez  <cdumez@apple.com>
46
47         It should be possible to dispatch events on template documents
48         https://bugs.webkit.org/show_bug.cgi?id=162687
49
50         Reviewed by Ryosuke Niwa.
51
52         It should be possible to dispatch events on template documents. Firefox
53         supports this. Chrome does not but this is likely not intentional as
54         Chrome generally supports dispatching events on frameless documents.
55
56         Test: fast/dom/template-document-dispatchEvent.html
57
58         * dom/Document.cpp:
59         (WebCore::Document::ensureTemplateDocument):
60
61 2016-09-27  Dean Jackson  <dino@apple.com>
62
63         Use Color references where possible
64         https://bugs.webkit.org/show_bug.cgi?id=162643
65         <rdar://problem/28506550>
66
67         Reviewed by Simon Fraser.
68
69         There were a bunch of places where we pass or use
70         Colors by value. As the Color class gets a bit more
71         complicated, it would be nice to avoid copying, so
72         use references where possible.
73
74         * css/CSSGradientValue.cpp:
75         (WebCore::interpolate):
76         * css/StyleColor.h:
77         (WebCore::StyleColor::getColor):
78         (WebCore::StyleColor::resolve):
79         * css/StyleResolver.h:
80         (WebCore::StyleResolver::State::backgroundColor):
81         * dom/Document.h:
82         (WebCore::Document::textColor):
83         * editing/FrameSelection.cpp:
84         (WebCore::disappearsIntoBackground):
85         * html/canvas/CanvasRenderingContext2D.cpp:
86         (WebCore::CanvasRenderingContext2D::setShadow):
87         * html/canvas/CanvasRenderingContext2D.h:
88         * html/track/TextTrackCueGeneric.h:
89         * page/PageOverlay.cpp:
90         (WebCore::PageOverlay::setBackgroundColor):
91         * page/PageOverlay.h:
92         * page/animation/CSSPropertyAnimation.cpp:
93         (WebCore::PropertyWrapperColor::PropertyWrapperColor):
94         (WebCore::PropertyWrapperMaybeInvalidColor::PropertyWrapperMaybeInvalidColor):
95         (WebCore::PropertyWrapperVisitedAffectedColor::PropertyWrapperVisitedAffectedColor):
96         * platform/graphics/GraphicsContext.cpp:
97         (WebCore::GraphicsContext::fillRectWithRoundedHole):
98         * platform/graphics/GraphicsContext.h:
99         (WebCore::GraphicsContext::strokeColor):
100         (WebCore::GraphicsContext::fillColor):
101         * platform/graphics/InbandTextTrackPrivateClient.h:
102         (WebCore::GenericCueData::foregroundColor):
103         (WebCore::GenericCueData::setForegroundColor):
104         (WebCore::GenericCueData::backgroundColor):
105         (WebCore::GenericCueData::setBackgroundColor):
106         (WebCore::GenericCueData::highlightColor):
107         (WebCore::GenericCueData::setHighlightColor):
108         * platform/graphics/ca/TileController.h:
109         * platform/graphics/cg/GraphicsContextCG.cpp:
110         (WebCore::GraphicsContext::drawRect):
111         (WebCore::GraphicsContext::fillRect):
112         (WebCore::GraphicsContext::platformFillRoundedRect):
113         (WebCore::GraphicsContext::fillRectWithRoundedHole):
114         * platform/graphics/displaylists/DisplayListItems.h:
115         (WebCore::DisplayList::DrawFocusRingPath::color):
116         (WebCore::DisplayList::DrawFocusRingRects::color):
117         (WebCore::DisplayList::FillRectWithColor::color):
118         (WebCore::DisplayList::FillCompositedRect::color):
119         (WebCore::DisplayList::FillRoundedRect::color):
120         (WebCore::DisplayList::FillRectWithRoundedHole::color):
121         * platform/graphics/filters/FEDiffuseLighting.cpp:
122         (WebCore::FEDiffuseLighting::lightingColor):
123         * platform/graphics/filters/FEDiffuseLighting.h:
124         * platform/graphics/filters/FEDropShadow.h:
125         (WebCore::FEDropShadow::shadowColor):
126         * platform/graphics/filters/FEFlood.cpp:
127         (WebCore::FEFlood::floodColor):
128         (WebCore::FEFlood::platformApplySoftware):
129         * platform/graphics/filters/FEFlood.h:
130         * platform/graphics/filters/FESpecularLighting.cpp:
131         (WebCore::FESpecularLighting::lightingColor):
132         * platform/graphics/filters/FESpecularLighting.h:
133         * platform/graphics/filters/FilterOperation.h:
134         * rendering/BorderEdge.h:
135         (WebCore::BorderEdge::color):
136         * rendering/InlineFlowBox.cpp:
137         (WebCore::InlineFlowBox::paintBoxDecorations):
138         * rendering/InlineTextBox.cpp:
139         (WebCore::InlineTextBox::paintSelection):
140         * rendering/InlineTextBox.h:
141         * rendering/RenderFrameSet.cpp:
142         (WebCore::borderStartEdgeColor):
143         (WebCore::borderEndEdgeColor):
144         (WebCore::borderFillColor):
145         * rendering/RenderInline.cpp:
146         (WebCore::RenderInline::paintOutlineForLine):
147         * rendering/RenderInline.h:
148         * rendering/RenderLayerCompositor.h:
149         * rendering/RenderView.cpp:
150         (WebCore::RenderView::paintBoxDecorations):
151         * rendering/TextDecorationPainter.cpp:
152         (WebCore::TextDecorationPainter::paintTextDecoration):
153         * rendering/TextPainter.cpp:
154         (WebCore::TextPainter::paintTextWithShadows):
155         * rendering/style/BorderValue.h:
156         (WebCore::BorderValue::color):
157         * rendering/style/CollapsedBorderValue.h:
158         (WebCore::CollapsedBorderValue::color):
159         * rendering/style/RenderStyle.cpp:
160         (WebCore::RenderStyle::color):
161         (WebCore::RenderStyle::visitedLinkColor):
162         (WebCore::RenderStyle::setColor):
163         (WebCore::RenderStyle::setVisitedLinkColor):
164         * rendering/style/RenderStyle.h:
165         (WebCore::RenderStyle::borderLeftColor):
166         (WebCore::RenderStyle::borderRightColor):
167         (WebCore::RenderStyle::borderTopColor):
168         (WebCore::RenderStyle::borderBottomColor):
169         (WebCore::RenderStyle::backgroundColor):
170         (WebCore::RenderStyle::columnRuleColor):
171         (WebCore::RenderStyle::outlineColor):
172         (WebCore::RenderStyle::textEmphasisColor):
173         (WebCore::RenderStyle::textFillColor):
174         (WebCore::RenderStyle::textStrokeColor):
175         (WebCore::RenderStyle::visitedLinkBackgroundColor):
176         (WebCore::RenderStyle::visitedLinkBorderLeftColor):
177         (WebCore::RenderStyle::visitedLinkBorderRightColor):
178         (WebCore::RenderStyle::visitedLinkBorderBottomColor):
179         (WebCore::RenderStyle::visitedLinkBorderTopColor):
180         (WebCore::RenderStyle::visitedLinkOutlineColor):
181         (WebCore::RenderStyle::visitedLinkColumnRuleColor):
182         (WebCore::RenderStyle::textDecorationColor):
183         (WebCore::RenderStyle::visitedLinkTextDecorationColor):
184         (WebCore::RenderStyle::visitedLinkTextEmphasisColor):
185         (WebCore::RenderStyle::visitedLinkTextFillColor):
186         (WebCore::RenderStyle::visitedLinkTextStrokeColor):
187         (WebCore::RenderStyle::stopColor):
188         (WebCore::RenderStyle::floodColor):
189         (WebCore::RenderStyle::lightingColor):
190         * svg/SVGFEDiffuseLightingElement.cpp:
191         (WebCore::SVGFEDiffuseLightingElement::build):
192         * svg/SVGFEDropShadowElement.cpp:
193         (WebCore::SVGFEDropShadowElement::build):
194         * svg/SVGFEFloodElement.cpp:
195         (WebCore::SVGFEFloodElement::build):
196         * svg/SVGFESpecularLightingElement.cpp:
197         (WebCore::SVGFESpecularLightingElement::build):
198         * svg/SVGGradientElement.cpp:
199         (WebCore::SVGGradientElement::buildStops):
200
201 2016-09-28  Ryosuke Niwa  <rniwa@webkit.org>
202
203         assignedNodes should include fallback contents when flattened option is set
204         https://bugs.webkit.org/show_bug.cgi?id=162656
205
206         Reviewed by Antti Koivisto.
207
208         Fixed the bug by traversing through fallback contents when there are no assigned nodes.
209
210         Tests: imported/w3c/web-platform-tests/shadow-dom/slots.html
211                imported/w3c/web-platform-tests/shadow-dom/slots-fallback.html
212
213         * html/HTMLSlotElement.cpp:
214         (WebCore::flattenAssignedNodes):
215         (WebCore::HTMLSlotElement::assignedNodes):
216
217 2016-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>
218
219         Adopt MediaRemote SPI to achieve desired Now Playing behavior
220         https://bugs.webkit.org/show_bug.cgi?id=162658
221         <rdar://problem/28499358>
222
223         Reviewed by Jer Noble.
224
225         Restores the changes previously rolled out in r206444, and adopts new MediaRemote SPI to achieve the desired
226         behavior for media in background tabs without breaking other features.
227
228         Introduces 2 new unit tests in NowPlayingControlsTests.
229
230         * html/MediaElementSession.cpp:
231         (WebCore::MediaElementSession::pageAllowsNowPlayingControls):
232         * page/Page.cpp:
233         (WebCore::Page::setViewState):
234         * platform/audio/PlatformMediaSessionManager.h:
235         (WebCore::PlatformMediaSessionManager::hasActiveNowPlayingSession):
236         * platform/audio/mac/MediaSessionManagerMac.h:
237         * platform/audio/mac/MediaSessionManagerMac.mm:
238         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
239         * platform/mac/MediaRemoteSoftLink.cpp:
240         * platform/mac/MediaRemoteSoftLink.h:
241         * platform/spi/mac/MediaRemoteSPI.h:
242
243 2016-09-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
244
245         REGRESSION(r206481): ASSERTION FAILED: isDecoderAvailable()
246         https://bugs.webkit.org/show_bug.cgi?id=162665
247
248         Reviewed by Simon Fraser.
249
250         Remove a wrong assertion from ImageSource::destroyDecodedData(). Before
251         r206481, the original function BitmapImage::destroyDecodedData() did not
252         have this assertion. Destroying the decoded ImageFrames can happen after
253         releasing the ImageDecoder. And it can happen also if decoding the image
254         fails and BitmapImage::isNull() is true. See CachedImage::finishLoading().
255
256         * platform/graphics/ImageSource.cpp:
257         (WebCore::ImageSource::destroyDecodedData):
258
259 2016-09-28  Youenn Fablet  <youenn@apple.com>
260
261         WebCore::ResourceErrorBase::setType is crashing
262         https://bugs.webkit.org/show_bug.cgi?id=162484
263         <rdar://problem/28390828>
264
265         Reviewed by Alex Christensen.
266
267         Test: http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html
268
269         Behavior is slightly changed as we are no longer casting Timeout preflight errors as AccessControl errors.
270         This is more inline with fetch spec which prescribes to send back any error received by preflight as response error for fetch.
271
272         Ideally, we should not need to change errors received during preflight loads but the error type is important for some clients:
273         - EventSource may try to reconnect if error is not AccessControl
274         - XMLHttpRequest will send abort events in case of Cancellation errors and timeout events in case of Timeout errors
275
276         * loader/CrossOriginPreflightChecker.cpp:
277         (WebCore::CrossOriginPreflightChecker::notifyFinished): Setting error type to AccessControl except in case of Timeout.
278         (WebCore::CrossOriginPreflightChecker::doPreflight): Ditto.
279         * loader/DocumentThreadableLoader.cpp:
280         (WebCore::DocumentThreadableLoader::preflightFailure): Removing ASSERT since Timeout errors may be returned.
281         * platform/network/ResourceErrorBase.h:
282         (WebCore::ResourceErrorBase::isGeneral): New getter.
283
284 2016-09-28  Jer Noble  <jer.noble@apple.com>
285
286         PiP shows incorrect state of play button.
287         https://bugs.webkit.org/show_bug.cgi?id=162652
288
289         Reviewed by Eric Carlson.
290
291         After getting a new WebPlaybackSessionModel, the first thing WebVideoFullscreenInterfaceMac
292         should do is query for it's playbackRate() and isPlaying() properties.
293
294         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
295         (WebCore::WebVideoFullscreenInterfaceMac::WebVideoFullscreenInterfaceMac):
296
297 2016-09-28  Michael Catanzaro  <mcatanzaro@igalia.com>
298
299         [GTK] Add Chrome UA quirk
300         https://bugs.webkit.org/show_bug.cgi?id=162617
301
302         Reviewed by Carlos Garcia Campos.
303
304         Add Chrome UA quirk and use it on typekit.net, typekit.com, youtube.com, slack.com, and
305         any domain that begins with "google".
306
307         * platform/gtk/UserAgentGtk.cpp:
308         (WebCore::buildUserAgentString):
309         (WebCore::urlRequiresChromeBrowser):
310         (WebCore::standardUserAgentForURL):
311
312 2016-09-28  Jer Noble  <jer.noble@apple.com>
313
314         [MSE][Mac] In SourceBufferPrivateAVFObjC::abort(), support reseting parser to the last appended initialization segment.
315         https://bugs.webkit.org/show_bug.cgi?id=135164
316
317         Reviewed by Eric Carlson.
318
319         Test: media/media-source/media-source-abort-resets-parser.html
320
321         Use the -[AVStreamDataParser appendStreamData:withFlags:] to implement "resetting" the parser. In this case,
322         the parser isn't explicitly reset during resetParserState(), but rather a flag is set so that the next append
323         signals a data discontinuity, and the parser is reset at that point.
324
325         Because a previous append operation may be in-flight during this abort(), care must be taken to invalidate any
326         operations which may have already started on a background thread. So SourceBufferPrivateAVFObjC will use a
327         separate WeakPtrFactory for its append operations, will invalidate any outstanding WeakPtrs during an abort(),
328         and will block until the previous append() operation completes.
329
330         This will require the WebAVStreamDataParserListener object to occasionally have it's WeakPtr pointing back to the
331         SourceBufferPrivateAVFObjC to be reset after an abort(), so make that ivar an @property. Rather than passing a
332         RetainPtr to itself in all the callbacks it handles, the WebAVStreamDataParserListener can just pass in a copy
333         of its own WeakPtr (which may be invalidated during an abort()).
334
335         Break the distinct operations of "abort()" and "resetParserState()" into their own methods in SourceBufferPrivate
336         and all its subclasses.
337
338         * Modules/mediasource/SourceBuffer.cpp:
339         (WebCore::SourceBuffer::resetParserState):
340         (WebCore::SourceBuffer::abortIfUpdating):
341         * platform/graphics/SourceBufferPrivate.h:
342         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
343         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
344         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]):
345         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]):
346         (-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]):
347         (-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]):
348         (-[WebAVStreamDataParserListener streamDataParser:didReachEndOfTrackWithTrackID:mediaType:]):
349         (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
350         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
351         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
352         (WebCore::SourceBufferPrivateAVFObjC::append):
353         (WebCore::SourceBufferPrivateAVFObjC::abort):
354         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
355         (-[WebAVStreamDataParserListener initWithParser:parent:]): Deleted.
356         * platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp:
357         (WebCore::SourceBufferPrivateGStreamer::resetParserState):
358         * platform/graphics/gstreamer/SourceBufferPrivateGStreamer.h:
359         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
360         (WebCore::MockSourceBufferPrivate::resetParserState):
361         * platform/mock/mediasource/MockSourceBufferPrivate.h:
362         * platform/spi/mac/AVFoundationSPI.h:
363
364 2016-09-28  Michael Catanzaro  <mcatanzaro@igalia.com>
365
366         [GTK] User agent should always claim to be Intel
367         https://bugs.webkit.org/show_bug.cgi?id=162610
368
369         Reviewed by Carlos Garcia Campos.
370
371         We should always claim to be running on Intel regardless of actual CPU type. See discussion
372         in bug #162548 for details. In particular, we can never advertise ARM because it causes dumb
373         websites to send mobile pages.
374
375         * platform/gtk/UserAgentGtk.cpp:
376         (WebCore::platformVersionForUAString):
377         (WebCore::buildUserAgentString):
378         (WebCore::cpuDescriptionForUAString): Deleted.
379
380 2016-09-28  Michael Catanzaro  <mcatanzaro@igalia.com>
381
382         [GTK] Adjust OS X UA quirks list
383         https://bugs.webkit.org/show_bug.cgi?id=162616
384
385         Reviewed by Carlos Garcia Campos.
386
387         Remove the OS X quirk for yahoo.com as it's no longer needed. Add quirks for taobao.com and
388         whatsapp.com.
389
390         * platform/gtk/UserAgentGtk.cpp:
391         (WebCore::urlRequiresMacintoshPlatform):
392         (WebCore::standardUserAgentForURL):
393
394 2016-09-28  Alejandro G. Castro  <alex@igalia.com>
395
396         Add WebIDL special operation support: serializer
397         https://bugs.webkit.org/show_bug.cgi?id=156293
398
399         Reviewed by Youenn Fablet.
400
401         Added support for the serializer special operation for WebIDLs,
402         current implementation adds support for:
403           - just the keyword: serializer; It will return all the
404             attributes of in an object.
405           - map of entries with the attributes: serializer = {attribute1,
406             attribute2, ...}
407
408         It creates a toJSON method that returns the serialized value
409         converted into an ECMAScript value. For more information check the
410         definition of the operation:
411
412         http://heycam.github.io/webidl/#idl-serializers
413
414         We have created a new function in the API of the objects
415         that are marked as serializer.
416
417         Used the support to add new API for RTCIceCandidate and
418         RTCSessionDescription.
419
420         Updated the tests expectations of the bindings.
421
422         Tests: bindings/scripts/test/TestNode.idl
423                bindings/scripts/test/TestObj.idl
424                fast/mediastream/RTCIceCandidate.html
425                fast/mediastream/RTCSessionDescription.html
426
427         * Modules/mediastream/RTCIceCandidate.idl: Added the serializer
428         operation.
429         * Modules/mediastream/RTCSessionDescription.idl: Added the
430         serializer operation.
431         * bindings/scripts/CodeGeneratorJS.pm:
432         (GenerateImplementation): Added the calls to the serializer
433         code generator.
434         (GenerateSerializerFunction): Added, generates the toJSON function
435         adding all the serializable->attributes value to an object as
436         defined in the spec.
437         * bindings/scripts/IDLParser.pm: Modified the serializer parser
438         that was unused to support the WebIDL spec parts. Added a new
439         domSerializable type to store the list of attributes in the
440         possible map.
441         (parseSerializer): Modified the function to follow the
442         semicolon rule in the spec, now the serializer line must have a
443         semicolon like any other line.
444         (parseSerializerRest): The function now has to get the attributes
445         list from the pattern parsing function and add them to the
446         domSerializable item.
447         (parseSerializationPattern): Now this function returns the list of
448         attributes in the serializable map or list if we have one.
449         (parseSerializationAttributes): Added, this function replaces the
450         Map and List functions, the currently supported parts are similar
451         for both situations.
452         (applyMemberList): Added the serializable item to the interface
453         variable and populate the serializable in case there is not a
454         defined map.
455         (parseSerializationPatternMap): Replaced with
456         parseSerializationAttributes.
457         (parseSerializationPatternList): Ditto.
458         * bindings/scripts/test/JS/JSTestNode.cpp: Modified the expected result.
459         (WebCore::jsTestNodePrototypeFunctionToJSON):
460         * bindings/scripts/test/JS/JSTestObj.cpp: Modified the expected result.
461         (WebCore::jsTestObjPrototypeFunctionToJSON):
462         * bindings/scripts/test/TestNode.idl: Added the serializer test.
463         * bindings/scripts/test/TestObj.idl: Added serializer map test.
464
465 2016-09-28  Michael Catanzaro  <mcatanzaro@igalia.com>
466
467         [GTK] Simplify platformForUAString
468         https://bugs.webkit.org/show_bug.cgi?id=162614
469
470         Reviewed by Carlos Garcia Campos.
471
472         Note in particular that the previous PLATFORM(MAC) check was wrong here, as that is never
473         true for GTK; this patch risks changing it to OS(MAC_OS_X), on the hope that advertising Mac
474         when running on Mac might not break anything. If it does, then we should remove it and just
475         always pretend to be on X11.
476
477         * platform/gtk/UserAgentGtk.cpp:
478         (WebCore::platformForUAString):
479
480 2016-09-28  Michael Catanzaro  <mcatanzaro@igalia.com>
481
482         [GTK] Bump fake Safari version in UA
483         https://bugs.webkit.org/show_bug.cgi?id=162615
484
485         Reviewed by Carlos Garcia Campos.
486
487         Pretend to be Safari 10.0 to fix sites that don't work when we pretend to be Safari 8.0.
488
489         * platform/gtk/UserAgentGtk.cpp:
490         (WebCore::buildUserAgentString):
491
492 2016-09-28  Khaled Hosny  <khaledhosny@eglug.org>
493
494         Use new woff2 API
495         https://bugs.webkit.org/show_bug.cgi?id=162608
496
497         Reviewed by Michael Catanzaro.
498
499         Test: fast/text/woff2-totalsfntsize.html
500
501         * platform/graphics/WOFFFileFormat.cpp:
502         (WebCore::WOFF2VectorOut::WOFF2VectorOut):
503         (WebCore::WOFF2VectorOut::Write):
504         (WebCore::WOFF2VectorOut::Size):
505         (WebCore::convertWOFFToSfnt):
506
507 2016-09-28  Michael Catanzaro  <mcatanzaro@igalia.com>
508
509         [GTK] Add warning comment in UserAgentGtk.cpp
510         https://bugs.webkit.org/show_bug.cgi?id=162618
511
512         Reviewed by Carlos Garcia Campos.
513
514         * platform/gtk/UserAgentGtk.cpp:
515
516 2016-09-28  Romain Bellessort  <romain.bellessort@crf.canon.fr>
517
518         [Streams API] Align cancelReadableStream() with spec
519         https://bugs.webkit.org/show_bug.cgi?id=162556
520
521         Reviewed by Xabier Rodriguez-Calvar.
522
523         Aligned cancelReadableStream() with Streams API. In particular, private cancel() method
524         was added to ReadableStreamDefaultController and function name was replaced by readableStreamCancel().
525         Implementation of cancel() (as well as pull()) is actually made in ReadableStreamInternals.js to
526         avoid creating new function for each controller.
527
528         No change in behaviour.
529
530         * Modules/streams/ReadableStream.js:
531         (cancel): Updated with reference to readableStreamCancel().
532         * Modules/streams/ReadableStreamDefaultReader.js:
533         (cancel): Updated with reference to readableStreamCancel().
534         * Modules/streams/ReadableStreamInternals.js:
535         (privateInitializeReadableStreamDefaultController): Refer to external functions (cancel/pull) to avoid
536         creating new functions.
537         (teeReadableStreamBranch2CancelFunction): Updated with reference to readableStreamCancel().
538         (readableStreamCancel): New name for cancelReadableStream(), behaviour aligned with spec.
539         (readableStreamDefaultControllerCancel): Added to avoid creating new function for each controller.
540         (readableStreamDefaultControllerPull): Added to avoid creating new function for each controller.
541         (readFromReadableStreamDefaultReader): Updated call to pull method to pass controller.
542         * bindings/js/WebCoreBuiltinNames.h: Added "cancel".
543
544 2016-09-27  Joonghun Park  <jh718.park@samsung.com>
545
546         [EFL] Fix debug build break since r206481. Unreviewed
547         https://bugs.webkit.org/show_bug.cgi?id=162662
548
549         No new tests, no new behaviours.
550
551         * platform/graphics/BitmapImage.cpp:
552         (WebCore::BitmapImage::draw):
553
554 2016-09-27  Nan Wang  <n_wang@apple.com>
555
556         AX: CrashTracer: com.apple.WebKit.WebContent at WebCore::AXObjectCache::localCaretRectForCharacterOffset(WebCore::RenderObject*&, WebCore::CharacterOffset const&) + 116
557         https://bugs.webkit.org/show_bug.cgi?id=162654
558
559         Reviewed by Chris Fleizach.
560
561         rangeForUnorderedCharacterOffsets() can return a null Range but we failed to
562         do a null check in localCaretRectForCharacterOffset() before dereferencing it.
563
564         Test: accessibility/mac/bounds-for-range-crash.html
565
566         * accessibility/AXObjectCache.cpp:
567         (WebCore::AXObjectCache::localCaretRectForCharacterOffset):
568
569 2016-09-27  Alex Christensen  <achristensen@webkit.org>
570
571         Inline critical functions in URLParser
572         https://bugs.webkit.org/show_bug.cgi?id=162653
573
574         Reviewed by Myles C. Maxfield.
575
576         This gives me about a 15% speed improvement.
577
578         * platform/URLParser.cpp:
579         (WebCore::CodePointIterator::CodePointIterator):
580         (WebCore::CodePointIterator::operator==):
581         (WebCore::CodePointIterator::operator!=):
582         (WebCore::CodePointIterator::operator=):
583         (WebCore::CodePointIterator::atEnd):
584         (WebCore::CodePointIterator::codeUnitsSince):
585         (WebCore::CodePointIterator<LChar>::operator):
586         (WebCore::CodePointIterator<UChar>::operator):
587         (WebCore::appendCodePoint):
588         (WebCore::isC0Control):
589         (WebCore::isC0ControlOrSpace):
590         (WebCore::isTabOrNewline):
591         (WebCore::isInSimpleEncodeSet):
592         (WebCore::isInDefaultEncodeSet):
593         (WebCore::isInUserInfoEncodeSet):
594         (WebCore::isInvalidDomainCharacter):
595         (WebCore::isPercentOrNonASCII):
596         (WebCore::isSlashQuestionOrHash):
597         (WebCore::isValidSchemeCharacter):
598         (WebCore::URLParser::advance):
599         (WebCore::URLParser::isWindowsDriveLetter):
600         (WebCore::URLParser::appendToASCIIBuffer):
601         (WebCore::percentEncodeByte):
602         (WebCore::URLParser::utf8PercentEncode):
603         (WebCore::URLParser::utf8QueryEncode):
604         (WebCore::isDefaultPort):
605         (WebCore::isSpecialScheme):
606         (WebCore::isPercentEncodedDot):
607         (WebCore::isSingleDotPathSegment):
608         (WebCore::isDoubleDotPathSegment):
609         (WebCore::consumeSingleDotPathSegment):
610         (WebCore::consumeDoubleDotPathSegment):
611         (WebCore::URLParser::popPath):
612         (WebCore::URLParser::parsedDataView):
613         (WebCore::URLParser::currentPosition):
614         (WebCore::zeroSequenceLength):
615         (WebCore::findLongestZeroSequence):
616         (WebCore::pow256):
617         (WebCore::percentDecode):
618         (WebCore::containsOnlyASCII):
619         (WebCore::domainToASCII):
620         (WebCore::hasInvalidDomainCharacter):
621         (WebCore::formURLDecode):
622         (WebCore::serializeURLEncodedForm):
623
624 2016-09-27  Zalan Bujtas  <zalan@apple.com>
625
626         REGRESSION (r204552): Yelp carousel animation is not smooth.
627         https://bugs.webkit.org/show_bug.cgi?id=162632
628
629         Reviewed by Simon Fraser.
630
631         For composited state changes when the layers don't need rebuilding, the updateGeometry() traversal
632         is post-order (see webkit.org/162634), so we can't rely on the offsetfromRenderer() value when
633         computing the graphics layer position on the descendants. We need this workaround until after webkit.org/162634
634         gets fixed.
635
636         Tests: compositing/hidpi-composited-container-and-graphics-layer-gap-changes.html
637                compositing/hidpi-negative-composited-bounds-on-device-pixel.html
638
639         * rendering/RenderLayerBacking.cpp:
640         (WebCore::computeOffsetFromAncestorGraphicsLayer):
641         (WebCore::ComputedOffsets::ComputedOffsets):
642         (WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
643         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):
644
645 2016-09-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
646
647         Move caching the ImageFrame from BitmapImage to ImageSource
648         https://bugs.webkit.org/show_bug.cgi?id=155498
649
650         Reviewed by Simon Fraser.
651
652         BitmapImage has two modes of operation regarding its image decoding state.
653         The first mode happens when a remote image is loaded as encoded data and
654         which requires an ImageDecoder to generate the image metadata and the
655         the ImageFrames. The second mode happens when a BitmapImage is created
656         with a NativeImagePtr. In this case, no ImageDecoder is needed.
657
658         To remove this burden from the BitmapImage the member 'm_frames' is removed
659         from BitmapImage. A new member named 'm_frameCache' of type ImageFrameCache
660         is added to ImageSource. This class handles caching and recaching the image
661         metadata and the ImageFrames if the image needs decoding. When the BitmapImage
662         is initialized with a memory image, the ImageFrameCache initializes its
663         metadata and ImageFrames directly from the NativeImagePtr.
664
665         The plan for ImageFrameCache is to be extended for the asynchronous image
666         decoding and also to be used by the non CG image decoders which cache
667         other copies of the ImageFrames. This double caching should be removed.
668
669         When the BitmapImage is replying to the ImageFrame queries, it will ask the
670         ImageSource which will pass the query the ImageFrameCache. ImageFrameCache
671         will ensure the requested ImageFrame is cached and is valid for the requested
672         SubSamplingLevel before accessing the data members of this ImageFrame.
673
674         * CMakeLists.txt:
675         * WebCore.xcodeproj/project.pbxproj:
676         Add and ImageFrameCache.cpp to the WebCore project.
677
678         * platform/graphics/BitmapImage.cpp:
679         (WebCore::BitmapImage::BitmapImage): Move initializing the image metadata to
680         ImageSource. Add initializers for the remaining members in the class declaration.
681
682         (WebCore::BitmapImage::destroyDecodedData): Move most of the logic of this
683         function to ImageFrameCache::destroyDecodedData(). The only part which can't
684         be moved is the call invalidatePlatformData().
685
686         (WebCore::BitmapImage::destroyDecodedDataIfNecessary): Move the logic of this
687         function to ImageFrameCache::destroyDecodedDataIfNecessary().
688
689         (WebCore::BitmapImage::dataChanged): Move the logic of this function to
690         ImageSource::dataChanged().
691
692         (WebCore::BitmapImage::frameImageAtIndex): Move most of the logic of this
693         function to ImageFrameCache::frameImageAtIndex(). The only part which can't
694         be moved is the call invalidatePlatformData() if the required subsampling
695         level is different from the subsampling level for the cached frame image.
696
697         (WebCore::BitmapImage::draw): Replace the BitmapImage  cached metadata with
698         the corresponding ImageSource cached metadata.
699         (WebCore::BitmapImage::drawPattern): Ditto.
700         (WebCore::BitmapImage::shouldAnimate): Ditto.
701         (WebCore::BitmapImage::startAnimation): Ditto.
702         (WebCore::BitmapImage::internalAdvanceAnimation): Ditto.
703
704         (WebCore::BitmapImage::dump): Call ImageSource::dump() to dump the image
705         cached metadata.
706
707         (WebCore::BitmapImage::haveFrameImageAtIndex): Deleted.
708         (WebCore::BitmapImage::destroyMetadataAndNotify): Deleted.
709         (WebCore::BitmapImage::cacheFrame): Deleted.
710         (WebCore::BitmapImage::didDecodeProperties): Deleted.
711         (WebCore::BitmapImage::updateSize): Deleted.
712         (WebCore::BitmapImage::size): Deleted.
713         (WebCore::BitmapImage::sizeRespectingOrientation): Deleted.
714         (WebCore::BitmapImage::hotSpot): Deleted.
715         (WebCore::BitmapImage::frameCount): Deleted.
716         (WebCore::BitmapImage::isSizeAvailable): Deleted.
717         (WebCore::BitmapImage::ensureFrameAtIndexIsCached): Deleted.
718         (WebCore::BitmapImage::frameIsCompleteAtIndex): Deleted.
719         (WebCore::BitmapImage::frameDurationAtIndex): Deleted.
720         (WebCore::BitmapImage::frameHasAlphaAtIndex): Deleted.
721         (WebCore::BitmapImage::currentFrameKnownToBeOpaque): Deleted.
722         (WebCore::BitmapImage::frameOrientationAtIndex): Deleted.
723         (WebCore::BitmapImage::singlePixelSolidColor): Deleted.
724         (WebCore::BitmapImage::repetitionCount): Deleted.
725         * platform/graphics/BitmapImage.h:
726         Managing the ImageFrames caching is moved to ImageFrameCache. Caching the
727         image metadata is now moved to the ImageSource.
728         
729         * platform/graphics/GeneratedImage.h:
730         * platform/graphics/Image.h:
731         (WebCore::Image::orientationForCurrentFrame):
732         (WebCore::Image::singlePixelSolidColor):
733         Change currentFrameKnownToBeOpaque(), orientationForCurrentFrame() and
734         singlePixelSolidColor() to be const.
735         
736         * platform/graphics/ImageFrame.cpp:
737         (WebCore::ImageFrame::defaultFrame): Returns an empty ImageFrame to get the default ImageFrame metadata.
738         (WebCore::ImageFrame::fillMetadata): Deleted. Moved to ImageFrameCache.
739         (WebCore::ImageFrame::initialize): Deleted. Ditto.
740         
741         * platform/graphics/ImageFrame.h:
742         (WebCore::ImageFrame::setDuration): Change the type of the argument to float instead of unsigned.
743         (WebCore::ImageFrame::hasAlpha): Protect the unset m_hasAlpha by checking hasMetadata() first.
744
745         * platform/graphics/ImageFrameCache.cpp: Added.
746         (WebCore::ImageFrameCache::ImageFrameCache): Two constructors similar to what we do for ImageSource and BitmapImage.
747         (WebCore::ImageFrameCache::destroyDecodedData): Moved from BitmapImage.cpp.
748         (WebCore::ImageFrameCache::destroyDecodedDataIfNecessary): Ditto.
749         (WebCore::ImageFrameCache::destroyIncompleteDecodedData): Ditto.
750         (WebCore::ImageFrameCache::decodedSizeChanged): Ditto.
751         (WebCore::ImageFrameCache::decodedSizeIncremented): Ditto.
752         (WebCore::ImageFrameCache::decodedSizeDecremented): Ditto.
753         (WebCore::ImageFrameCache::decodedSizeReset): Ditto.
754         (WebCore::ImageFrameCache::didDecodeProperties): Ditto.
755         (WebCore::ImageFrameCache::growFrames): Grows the size of m_frames if necessary.
756         (WebCore::ImageFrameCache::setNativeImage): Initializes the ImageFrame metadata directly from the NativeImagePtr. 
757         (WebCore::ImageFrameCache::setFrameNativeImage): Initializes the ImageFrame image and the metadata.
758         (WebCore::ImageFrameCache::setFrameMetadata): Initializes the ImageFrame metadata from the ImageDecoder.
759         (WebCore::ImageFrameCache::frameAtIndex): Returns an ImageFrame given its index. Cache or recache the requested ImageFrame if necessary.
760         (WebCore::ImageFrameCache::clearMetadata): Invalidates the cached image metadata.
761         (WebCore::ImageFrameCache::metadata): A template function which returns an image metadata property.
762         (WebCore::ImageFrameCache::frameMetadataAtIndex): A template function which returns an ImageFrame metadata property.
763         (WebCore::ImageFrameCache::isSizeAvailable): An image metadata property.
764         (WebCore::ImageFrameCache::frameCount): Ditto.
765         (WebCore::ImageFrameCache::repetitionCount): Ditto.
766         (WebCore::ImageFrameCache::filenameExtension): Ditto.
767         (WebCore::ImageFrameCache::hotSpot): Ditto.
768         (WebCore::ImageFrameCache::size): An image metadata property but we get it from the first ImageFrame.
769         (WebCore::ImageFrameCache::sizeRespectingOrientation): Ditto.
770         (WebCore::ImageFrameCache::singlePixelSolidColor): Ditto.
771         (WebCore::ImageFrameCache::frameIsCompleteAtIndex): An ImageFrame metadata property.
772         (WebCore::ImageFrameCache::frameHasAlphaAtIndex): Ditto.
773         (WebCore::ImageFrameCache::frameHasImageAtIndex): Ditto.
774         (WebCore::ImageFrameCache::frameHasInvalidNativeImageAtIndex): Ditto.
775         (WebCore::ImageFrameCache::frameSubsamplingLevelAtIndex): Ditto.
776         (WebCore::ImageFrameCache::frameSizeAtIndex): Ditto.
777         (WebCore::ImageFrameCache::frameBytesAtIndex): Ditto.
778         (WebCore::ImageFrameCache::frameDurationAtIndex): Ditto.
779         (WebCore::ImageFrameCache::frameOrientationAtIndex): Ditto.
780         (WebCore::ImageFrameCache::frameImageAtIndex): Ditto.
781
782         * platform/graphics/ImageFrameCache.h: Added.
783         (WebCore::ImageFrameCache::setDecoder): Sets the current ImageDecoder which is owned by the ImageSource.
784         (WebCore::ImageFrameCache::decodedSize): Returns the size of the cached NativeImages.
785         (WebCore::ImageFrameCache::isDecoderAvailable): Returns whether an ImageDecoder is available.
786
787         * platform/graphics/ImageSource.cpp:
788         (WebCore::ImageSource::ImageSource): Initializes the ImageFrameCache based on the image decoding state.
789         (WebCore::ImageSource::clearFrameBufferCache): Replace initialized() with isDecoderAvailable().
790         (WebCore::ImageSource::clear): Clears the ImageDecoder of the ImageFrameCache.
791         (WebCore::ImageSource::destroyDecodedData): Moved from BitmapImage.cpp.
792         (WebCore::ImageSource::destroyDecodedDataIfNecessary): Ditto.
793         (WebCore::ImageSource::ensureDecoderAvailable): Creates an ImageDecoder if necessary and sets it in ImageFrameCache.
794         (WebCore::ImageSource::setData):
795         (WebCore::ImageSource::dataChanged): Moved from BitmapImage.cpp.
796         (WebCore::ImageSource::isAllDataReceived):
797         (WebCore::ImageSource::maximumSubsamplingLevel): Rename calculateMaximumSubsamplingLevel() to maximumSubsamplingLevel().
798         (WebCore::ImageSource::subsamplingLevelForScale):
799         (WebCore::ImageSource::createFrameImageAtIndex):
800         (WebCore::ImageSource::dump):
801         (WebCore::ImageSource::calculateMaximumSubsamplingLevel): Deleted. Renamed to maximumSubsamplingLevel().
802         (WebCore::ImageSource::updateMetadata): Deleted. Not needed. Caching the image metadata is the responsibility of ImageFrameCache. 
803         (WebCore::ImageSource::bytesDecodedToDetermineProperties): Deleted. Not needed.
804         (WebCore::ImageSource::isSizeAvailable): Deleted. Moved to ImageSource.h. 
805         (WebCore::ImageSource::size): Deleted. Ditto.
806         (WebCore::ImageSource::sizeRespectingOrientation): Deleted. Ditto.
807         (WebCore::ImageSource::frameCount): Deleted. Ditto.
808         (WebCore::ImageSource::repetitionCount): Deleted. Ditto.
809         (WebCore::ImageSource::filenameExtension): Deleted. Ditto.
810         (WebCore::ImageSource::hotSpot): Deleted. Ditto.
811         (WebCore::ImageSource::frameIsCompleteAtIndex): Deleted. Ditto.
812         (WebCore::ImageSource::frameHasAlphaAtIndex): Deleted. Ditto.
813         (WebCore::ImageSource::frameAllowSubsamplingAtIndex): Deleted. Ditto.
814         (WebCore::ImageSource::frameSizeAtIndex): Deleted. Ditto.
815         (WebCore::ImageSource::frameBytesAtIndex): Deleted. Ditto.
816         (WebCore::ImageSource::frameDurationAtIndex): Deleted. Ditto.
817         (WebCore::ImageSource::frameOrientationAtIndex): Deleted. Ditto.
818
819         * platform/graphics/ImageSource.h:
820         (WebCore::ImageSource::isDecoderAvailable): initialized() was renamed to isDecoderAvailable().
821         (WebCore::ImageSource::decodedSize): Send the query to ImageFrameCache.
822         (WebCore::ImageSource::isSizeAvailable): Ditto.
823         (WebCore::ImageSource::frameCount): Ditto.
824         (WebCore::ImageSource::repetitionCount): Ditto.
825         (WebCore::ImageSource::filenameExtension): Ditto.
826         (WebCore::ImageSource::hotSpot): Ditto.
827         (WebCore::ImageSource::size): Ditto.
828         (WebCore::ImageSource::sizeRespectingOrientation): Ditto.
829         (WebCore::ImageSource::singlePixelSolidColor): Ditto.
830         (WebCore::ImageSource::frameIsCompleteAtIndex): Ditto.
831         (WebCore::ImageSource::frameHasAlphaAtIndex): Ditto.
832         (WebCore::ImageSource::frameHasImageAtIndex): Ditto.
833         (WebCore::ImageSource::frameHasInvalidNativeImageAtIndex): Ditto.
834         (WebCore::ImageSource::frameSubsamplingLevelAtIndex): Ditto.
835         (WebCore::ImageSource::frameSizeAtIndex): Ditto.
836         (WebCore::ImageSource::frameBytesAtIndex): Ditto.
837         (WebCore::ImageSource::frameDurationAtIndex): Ditto.
838         (WebCore::ImageSource::frameOrientationAtIndex): Ditto.
839         (WebCore::ImageSource::frameImageAtIndex): Ditto.
840         (WebCore::ImageSource::decoder): Deleted. Not needed.
841         (WebCore::ImageSource::initialized): Deleted. Was renamed to isDecoderAvailable().
842         (WebCore::ImageSource::setNeedsUpdateMetadata): Deleted. Not needed.
843
844         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
845         (WebCore::GraphicsContext3D::ImageExtractor::extractImage): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
846         * platform/graphics/cg/GraphicsContext3DCG.cpp:
847         (WebCore::GraphicsContext3D::ImageExtractor::extractImage): Ditto.
848         
849         * platform/graphics/cg/ImageDecoderCG.cpp:
850         (WebCore::ImageDecoder::ImageDecoder): Make the constructor of ImageDecoder be the same for all ports. 
851         (WebCore::ImageDecoder::setData): Removed unused overloaded function.
852         (WebCore::ImageDecoder::size): Deleted.  Removed unused function.
853
854         * platform/graphics/cg/ImageDecoderCG.h:
855         (WebCore::ImageDecoder::create): Make the constructor of CG ImageDecoder be like the other ports.
856         (WebCore::ImageDecoder::isAllDataReceived): Make this property owned by ImageDecoder.
857
858         * platform/graphics/cg/PDFDocumentImage.h: Change currentFrameKnownToBeOpaque() to be const.
859
860         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
861         (WebCore::GraphicsContext3D::ImageExtractor::extractImage): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
862         
863         * platform/graphics/mac/ImageMac.mm:
864         (WebCore::BitmapImage::invalidatePlatformData): m_frames is owned by ImageFrameCache. ImageFrameCache::frameCount() has to 
865         be equal to ImageFrame::m_frames.size().
866
867         * platform/image-decoders/ImageDecoder.cpp:
868         (WebCore::ImageDecoder::create): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
869         * platform/image-decoders/ImageDecoder.h:
870         (WebCore::ImageDecoder::ImageDecoder): Ditto.
871         (WebCore::ImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
872         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
873         (WebCore::BMPImageDecoder::BMPImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
874         * platform/image-decoders/bmp/BMPImageDecoder.h:
875         * platform/image-decoders/gif/GIFImageDecoder.cpp:
876         (WebCore::GIFImageDecoder::GIFImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
877         (WebCore::GIFImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
878         * platform/image-decoders/gif/GIFImageDecoder.h:
879         * platform/image-decoders/gif/GIFImageReader.cpp:
880         * platform/image-decoders/gif/GIFImageReader.h:
881         * platform/image-decoders/ico/ICOImageDecoder.cpp:
882         (WebCore::ICOImageDecoder::ICOImageDecoder): 
883         (WebCore::ICOImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
884         (WebCore::ICOImageDecoder::decode): Move resizing the m_frameBufferCache from ICOImageDecoder::frameCount() to ICOImageDecoder::decode().
885         (WebCore::ICOImageDecoder::decodeAtIndex): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
886         * platform/image-decoders/ico/ICOImageDecoder.h:
887         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
888         (WebCore::JPEGImageDecoder::JPEGImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
889         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
890         * platform/image-decoders/png/PNGImageDecoder.cpp:
891         (WebCore::PNGImageDecoder::PNGImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
892         * platform/image-decoders/png/PNGImageDecoder.h:
893         (WebCore::PNGImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
894         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
895         (WebCore::WEBPImageDecoder::WEBPImageDecoder):
896         * platform/image-decoders/webp/WEBPImageDecoder.h:
897
898         * svg/graphics/SVGImage.h: Make currentFrameKnownToBeOpaque() be const.
899         * svg/graphics/SVGImageForContainer.h: Ditto.
900
901 2016-09-27  Alex Christensen  <achristensen@webkit.org>
902
903         Correctly parse URLs with the first tab in the fragment
904         https://bugs.webkit.org/show_bug.cgi?id=162650
905
906         Reviewed by Saam Barati.
907
908         Covered by a new API test.
909
910         * platform/URLParser.cpp:
911         (WebCore::URLParser::fragmentSyntaxViolation):
912
913 2016-09-27  Chris Dumez  <cdumez@apple.com>
914
915         <a download> does not honor the same-origin requirement
916         https://bugs.webkit.org/show_bug.cgi?id=156100
917
918         Reviewed by Alex Christensen.
919
920         We now completely ignore the "download" attribute on anchors if the
921         href URL is cross-origin. We therefore navigate to the URL instead
922         of forcefully downloading it in this case and leave it up to the server
923         to give us the right headers if it should be downloaded. This is
924         conservative and matches Firefox.
925
926         Chrome and the HTML specification ignore only the suggested filename
927         if the URL is cross-origin but still download the file.
928
929         No new tests, updated existing test.
930
931         * html/HTMLAnchorElement.cpp:
932         (WebCore::HTMLAnchorElement::handleClick):
933
934 2016-09-27  Alex Christensen  <achristensen@webkit.org>
935
936         URLParser: Handle windows drive letters after two slashes in relative URLs according to spec
937         https://bugs.webkit.org/show_bug.cgi?id=162646
938
939         Reviewed by Saam Barati.
940
941         Covered by new API tests.
942
943         * platform/URLParser.cpp:
944         (WebCore::CodePointIterator::codeUnitsSince):
945         (WebCore::URLParser::appendWindowsDriveLetter):
946         (WebCore::URLParser::parse):
947         (WebCore::isWindowsDriveLetter): Deleted.
948         (WebCore::URLParser::checkWindowsDriveLetter): Deleted.
949         * platform/URLParser.h:
950
951 2016-09-27  Alex Christensen  <achristensen@webkit.org>
952
953         URLs with @ in the user should only search for the last @ until the end of the authority and host
954         https://bugs.webkit.org/show_bug.cgi?id=162635
955
956         Reviewed by Geoffrey Garen.
957
958         Covered by new API tests.
959
960         * platform/URLParser.cpp:
961         (WebCore::URLParser::parse):
962
963 2016-09-27  Chris Dumez  <cdumez@apple.com>
964
965         It should be possible to dispatch events on documents created using DOMParser
966         https://bugs.webkit.org/show_bug.cgi?id=26147
967
968         Reviewed by Ryosuke Niwa.
969
970         It should be possible to dispatch events on documents created using
971         DOMParser. It did not work because we were not setting the context
972         document on the newly created document in DOMParser::parseFromString().
973
974         Firefox and Chrome both already support this.
975
976         Test: fast/dom/parsed-document-dispatchEvent.html
977
978         * xml/DOMParser.cpp:
979         (WebCore::DOMParser::DOMParser):
980         (WebCore::DOMParser::parseFromString):
981         * xml/DOMParser.h:
982         (WebCore::DOMParser::create):
983         * xml/DOMParser.idl:
984
985 2016-09-26  Myles C. Maxfield  <mmaxfield@apple.com>
986
987         [Cocoa] Improve performance of complex text codepath
988         https://bugs.webkit.org/show_bug.cgi?id=161936
989
990         Reviewed by Simon Fraser.
991
992         CoreText exposes a bit on the CTRunStatus which represents whether
993         the run actually uses the glyph origins concept introduced in
994         r205396. If this bit is not set, we can use the (slightly faster)
995         call to CTRunGetAdvances() instead of
996         CTRunGetBaseAdvancesAndOrigins(). In addition, if none of the runs
997         have this bit set, we don't need to allocate storage for the vector
998         of origins at all, thereby using less memory.
999
1000         No new tests because there is no behavior change.
1001
1002         * platform/graphics/mac/ComplexTextController.cpp:
1003         (WebCore::ComplexTextController::advance):
1004         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
1005         * platform/graphics/mac/ComplexTextController.h:
1006         (WebCore::ComplexTextController::ComplexTextRun::glyphOrigins):
1007         (WebCore::ComplexTextController::glyphOrigin):
1008         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1009         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
1010         * platform/spi/cocoa/CoreTextSPI.h:
1011
1012 2016-09-27  Ryosuke Niwa  <rniwa@webkit.org>
1013
1014         Import w3c shadow DOM tests and fix one assertion
1015         https://bugs.webkit.org/show_bug.cgi?id=162629
1016
1017         Reviewed by Chris Dumez.
1018
1019         The assertion failure was caused by RelatedNodeRetargeter's constructor mixing up the ancestor tree scopes
1020         for the target and the related target. Fixed the bug by reversing the two.
1021
1022         Tests: imported/w3c/web-platform-tests/shadow-dom/event-composed-path-with-related-target.html
1023
1024         * dom/EventPath.cpp:
1025         (WebCore::RelatedNodeRetargeter::RelatedNodeRetargeter): i and m_ancestorTreeScopes are for the related target
1026         and j and targetTreeScopeAncestors are for the target.
1027
1028 2016-09-27  Chris Dumez  <cdumez@apple.com>
1029
1030         It should be possible to dispatch events on documents that do not have a browsing context
1031         https://bugs.webkit.org/show_bug.cgi?id=162620
1032
1033         Reviewed by Ryosuke Niwa.
1034
1035         It should be possible to dispatch events on documents that do not have a browsing
1036         context (e.g. Documents created using DOMImplementation.createHTMLDocument()).
1037         Gecko and Blink both allow this but WebKit did not.
1038
1039         The approach chosen to support this is similar to the one in Blink. When constructing
1040         a new document (e.g. using DOMImplementation.createHTMLDocument()) we now keep track
1041         of the context document. When requesting the scriptExecutionContext(), we now return
1042         the context document if the document has one instead of the document itself.
1043
1044         Test: imported/w3c/web-platform-tests/dom/events/Event-dispatch-other-document.html
1045
1046         * bindings/js/JSDocumentCustom.cpp:
1047         (WebCore::JSDocument::visitAdditionalChildren):
1048         * dom/DOMImplementation.cpp:
1049         (WebCore::DOMImplementation::createDocument):
1050         (WebCore::DOMImplementation::createHTMLDocument):
1051         * dom/Document.cpp:
1052         (WebCore::Document::create):
1053         (WebCore::Document::cloneDataFromDocument):
1054         (WebCore::Document::contextDocument):
1055         (WebCore::Document::takeDOMWindowFrom): Deleted.
1056         * dom/Document.h:
1057         (WebCore::Document::setContextDocument):
1058         (WebCore::Node::scriptExecutionContext):
1059         (WebCore::Node::isDocumentNode): Deleted.
1060         * dom/Document.idl:
1061         * xml/XMLHttpRequest.cpp:
1062         (WebCore::XMLHttpRequest::responseXML):
1063
1064 2016-09-27  Alex Christensen  <achristensen@webkit.org>
1065
1066         Implement URLParser::syntaxViolation
1067         https://bugs.webkit.org/show_bug.cgi?id=162593
1068
1069         Reviewed by Geoffrey Garen.
1070
1071         Most of the time when parsing URLs, we just look at the URL, find offsets of the host, path, query, etc., 
1072         and the String can be used untouched.  When this happens, we do not want to allocate and copy the String.
1073         We want to just add a reference to an existing String.
1074
1075         Sometimes we need to canonicalize the String because there has been a syntaxViolation,
1076         defined as any String that is different than its canonicalized URL String.  In such cases we need to
1077         allocate a new String and fill it with the canonicalized URL String.  When a syntaxViolation happens for the
1078         first time, we know that everything in the input String up to that point is equal to what it would have been
1079         if we had canonicalized the beginning of the URL, copy it into a buffer, and continue parsing in a mode where
1080         instead of just looking at the input URL String, we canonicalize each code point into the buffer.
1081
1082         Changes to behavior involve additional spec compliance with tabs and newlines in different places in URLs,
1083         as well as additional spec compliance when parsing empty and null URLs relative to other URLs.
1084         Both are covered by new API tests. Existing behavior covered by existing API tests.
1085
1086         This is about a 15% speed improvement on my URL parsing benchmark.
1087
1088         * platform/URL.cpp:
1089         (WebCore::assertProtocolIsGood):
1090         (WebCore::URL::protocolIs):
1091         (WebCore::protocolIs):
1092         * platform/URL.h:
1093         * platform/URLParser.cpp:
1094         (WebCore::isTabOrNewline):
1095         (WebCore::URLParser::incrementIteratorSkippingTabsAndNewlines):
1096         (WebCore::URLParser::isWindowsDriveLetter):
1097         (WebCore::URLParser::appendToASCIIBuffer):
1098         (WebCore::URLParser::checkWindowsDriveLetter):
1099         (WebCore::URLParser::shouldCopyFileURL):
1100         (WebCore::URLParser::utf8PercentEncode):
1101         (WebCore::URLParser::utf8QueryEncode):
1102         (WebCore::URLParser::copyURLPartsUntil):
1103         (WebCore::URLParser::syntaxViolation):
1104         (WebCore::URLParser::fragmentSyntaxViolation):
1105         (WebCore::URLParser::parsedDataView):
1106         (WebCore::URLParser::currentPosition):
1107         (WebCore::URLParser::URLParser):
1108         (WebCore::URLParser::parse):
1109         (WebCore::URLParser::parseAuthority):
1110         (WebCore::URLParser::parseIPv4Number):
1111         (WebCore::URLParser::parseIPv4Host):
1112         (WebCore::URLParser::parseIPv6Host):
1113         (WebCore::URLParser::parsePort):
1114         (WebCore::URLParser::parseHostAndPort):
1115         (WebCore::serializeURLEncodedForm):
1116         (WebCore::URLParser::allValuesEqual):
1117         (WebCore::URLParser::internalValuesConsistent):
1118         (WebCore::URLParser::incrementIteratorSkippingTabAndNewLine): Deleted.
1119         (WebCore::URLParser::syntaxError): Deleted.
1120         (WebCore::parseIPv4Number): Deleted.
1121         * platform/URLParser.h:
1122         (WebCore::URLParser::incrementIteratorSkippingTabsAndNewlines):
1123
1124 2016-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1125
1126         Related videos on YouTube (and YouTube playlists) cause media controls to disappear
1127         https://bugs.webkit.org/show_bug.cgi?id=162621
1128         <rdar://problem/28484193>
1129
1130         Reviewed by Jer Noble.
1131
1132         Tweaks the main content media heuristic for better Now Playing behavior on YouTube by making the following
1133         changes:
1134         - Remove the strict requirement for audio to be actively playing for the session to be able to show
1135           controls for the purpose of Now Playing, making it the same as our policy for the controls manager.
1136         - Make playback requirement restrictions apply only for the controls manager. Videos that do not
1137           autoplay will still have the correct behavior with respect to Now Playing, since we will bail in the
1138           hasEverNotifiedAboutPlaying() check.
1139         - Only consider the main content heuristic as preventing media controls from showing up for the purposes
1140           of the controls manager. Now Playing should instead account for this by preferring elements large
1141           enough for main content after collecting all of the candidate sessions.
1142
1143         * html/HTMLMediaElement.cpp:
1144         (WebCore::mediaElementSessionInfoForSession):
1145         (WebCore::preferMediaControlsForCandidateSessionOverOtherCandidateSession):
1146         (WebCore::HTMLMediaElement::updatePlayState):
1147         * html/MediaElementSession.cpp:
1148         (WebCore::MediaElementSession::canShowControlsManager):
1149         * platform/audio/mac/MediaSessionManagerMac.mm:
1150         (WebCore::MediaSessionManagerMac::sessionWillBeginPlayback):
1151
1152 2016-09-27  Chris Dumez  <cdumez@apple.com>
1153
1154         Second parameter to MutationObserver.observe() should be optional
1155         https://bugs.webkit.org/show_bug.cgi?id=162627
1156
1157         Reviewed by Ryosuke Niwa.
1158
1159         Second parameter to MutationObserver.observe() should be optional:
1160         - https://dom.spec.whatwg.org/#interface-mutationobserver
1161
1162         Firefox agrees with the specification. There is no real behavior change
1163         except that MutationObserver.prototype.observe.length is now 1 instead
1164         of 2. Passing only one parameter will still throw a TypeError because
1165         the Dictionary is empty. However, this parameter needs to be marked as
1166         optional because Web IDL requires the last parameter to be optional if
1167         it is a Dictionary.
1168
1169         No new tests, rebaselined existing test.
1170
1171         * dom/MutationObserver.idl:
1172
1173 2016-09-20  Anders Carlsson  <andersca@apple.com>
1174
1175         PlatformEvent::m_modifiers should be an OptionSet
1176         https://bugs.webkit.org/show_bug.cgi?id=162326
1177
1178         Reviewed by Daniel Bates.
1179
1180         * page/EventHandler.cpp:
1181         (WebCore::EventHandler::handleAccessKey):
1182         * page/EventHandler.h:
1183         * page/mac/EventHandlerMac.mm:
1184         (WebCore::EventHandler::accessKeyModifiers):
1185         * platform/PlatformEvent.h:
1186         (WebCore::PlatformEvent::shiftKey):
1187         (WebCore::PlatformEvent::ctrlKey):
1188         (WebCore::PlatformEvent::altKey):
1189         (WebCore::PlatformEvent::metaKey):
1190         (WebCore::PlatformEvent::modifiers):
1191         (WebCore::PlatformEvent::PlatformEvent):
1192         * platform/PlatformKeyboardEvent.h:
1193         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1194         * platform/mac/PlatformEventFactoryMac.mm:
1195         (WebCore::modifiersForEvent):
1196         (WebCore::typeForEvent):
1197         * replay/SerializationMethods.cpp:
1198         (JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
1199         (JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
1200         * replay/WebInputs.json:
1201
1202 2016-09-27  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1203
1204         [GTK] Handle Wayland & X11 correctly for GST_GL
1205         https://bugs.webkit.org/show_bug.cgi?id=162619
1206
1207         Reviewed by Carlos Garcia Campos.
1208
1209         The checks for GST_GL consider X11 and Wayland are exclusive alternatives, but it
1210         turns out we can enable both! We need to check them independently and also include
1211         a runtime check.
1212
1213         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1214         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): fix checks for X11 and
1215         Wayland to handle the case where both are enabled. Includes a runtime check.
1216
1217 2016-09-27  Eric Carlson  <eric.carlson@apple.com>
1218
1219         [MediaStream] Restructure MediaConstraints classes
1220         https://bugs.webkit.org/show_bug.cgi?id=162571
1221
1222         Reviewed by Jer Noble.
1223
1224         No new tests, no functional changes.
1225
1226         * Modules/mediastream/MediaConstraintsImpl.cpp:
1227         (WebCore::MediaConstraintsImpl::initialize): Deleted, no longer used.
1228         * Modules/mediastream/MediaConstraintsImpl.h:
1229
1230         * bindings/js/JSMediaDevicesCustom.cpp:
1231         (WebCore::createStringConstraint): Return Optional<> instead of RefPtr<>.
1232         (WebCore::createBooleanConstraint): Ditto.
1233         (WebCore::createDoubleConstraint): Ditto.
1234         (WebCore::createIntConstraint): Ditto.
1235         (WebCore::parseMediaTrackConstraintSetForKey): Deal with above change.
1236
1237         * platform/mediastream/CaptureDeviceManager.cpp:
1238         (CaptureDeviceManager::verifyConstraintsForMediaType): Use constraints.mandatoryConstraints.filter
1239           instead of direct enumeration.
1240         (CaptureDeviceManager::sessionSupportsConstraint): Use downcast<>.
1241         (CaptureDeviceManager::isSupportedFrameRate): Ditto.
1242
1243         * platform/mediastream/MediaConstraints.cpp:
1244         (WebCore::StringConstraint::find): Lose the ConstraintType parameter.
1245         (WebCore::StringConstraint::merge): Use downcast<>.
1246         (WebCore::FlattenedConstraint::set): Use ConstraintHolder.
1247         (WebCore::FlattenedConstraint::merge): Ditto.
1248         (WebCore::MediaTrackConstraintSetMap::forEach): New.
1249         (WebCore::MediaTrackConstraintSetMap::filter): Ditto.
1250         (WebCore::MediaTrackConstraintSetMap::isEmpty): Ditto.
1251         (WebCore::MediaTrackConstraintSetMap::set): Ditto.
1252         (WebCore::MediaConstraint::copy): Deleted.
1253         (WebCore::IntConstraint::copy): Deleted.
1254         (WebCore::DoubleConstraint::copy): Deleted.
1255         (WebCore::BooleanConstraint::copy): Deleted.
1256         (WebCore::StringConstraint::copy): Deleted.
1257         * platform/mediastream/MediaConstraints.h:
1258         (WebCore::MediaConstraint::MediaConstraint):
1259         (WebCore::MediaConstraint::isEmpty):
1260         (WebCore::MediaConstraint::isMandatory):
1261         (WebCore::MediaConstraint::merge):
1262         (WebCore::MediaConstraint::isInt):
1263         (WebCore::MediaConstraint::isDouble):
1264         (WebCore::MediaConstraint::isBoolean):
1265         (WebCore::MediaConstraint::isString):
1266         (WebCore::MediaConstraint::dataType):
1267         (WebCore::MediaConstraint::constraintType):
1268         (WebCore::NumericConstraint::getMin):
1269         (WebCore::NumericConstraint::getMax):
1270         (WebCore::NumericConstraint::getExact):
1271         (WebCore::NumericConstraint::getIdeal):
1272         (WebCore::NumericConstraint::fitnessDistance):
1273         (WebCore::NumericConstraint::validForRange):
1274         (WebCore::NumericConstraint::find):
1275         (WebCore::NumericConstraint::NumericConstraint):
1276         (WebCore::NumericConstraint::innerMerge):
1277         (WebCore::FlattenedConstraint::isEmpty):
1278         (WebCore::FlattenedConstraint::iterator::iterator):
1279         (WebCore::FlattenedConstraint::iterator::operator*):
1280         (WebCore::FlattenedConstraint::iterator::operator++):
1281         (WebCore::FlattenedConstraint::iterator::operator==):
1282         (WebCore::FlattenedConstraint::iterator::operator!=):
1283         (WebCore::FlattenedConstraint::begin):
1284         (WebCore::FlattenedConstraint::end):
1285         (WebCore::FlattenedConstraint::ConstraintHolder::create):
1286         (WebCore::FlattenedConstraint::ConstraintHolder::~ConstraintHolder):
1287         (WebCore::FlattenedConstraint::ConstraintHolder::constraint):
1288         (WebCore::FlattenedConstraint::ConstraintHolder::dataType):
1289         (WebCore::FlattenedConstraint::ConstraintHolder::constraintType):
1290         (WebCore::FlattenedConstraint::ConstraintHolder::ConstraintHolder):
1291         (WebCore::MediaConstraint::getMin): Deleted.
1292         (WebCore::MediaConstraint::getMax): Deleted.
1293         (WebCore::MediaConstraint::getExact): Deleted.
1294         (WebCore::MediaConstraint::getIdeal): Deleted.
1295         (WebCore::MediaConstraint::validForRange): Deleted.
1296         (WebCore::MediaConstraint::find): Deleted.
1297         (WebCore::MediaConstraint::fitnessDistance): Deleted.
1298         (WebCore::MediaConstraint::type): Deleted.
1299
1300         * platform/mediastream/RealtimeMediaSource.cpp:
1301         (WebCore::RealtimeMediaSource::fitnessDistance): Use downcast<>.
1302         (WebCore::applyNumericConstraint):
1303         (WebCore::RealtimeMediaSource::applyConstraint): Ditto.
1304         (WebCore::RealtimeMediaSource::selectSettings): Ditto. Use constraints.mandatoryConstraints.filter
1305           instead of direct enumeration.
1306         (WebCore::RealtimeMediaSource::applyConstraints):
1307         (WebCore::RealtimeMediaSource::setSampleRate): Sample rate is an int, not a double.
1308         (WebCore::RealtimeMediaSource::setSampleSize): Sample size is also an int.
1309         * platform/mediastream/RealtimeMediaSource.h:
1310
1311         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1312         (WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Use downcast<>.
1313
1314         * platform/mock/MediaConstraintsMock.cpp:
1315         (WebCore::isIntMediaConstraintSatisfiable): Use downcast<>.
1316         (WebCore::isDoubleMediaConstraintSatisfiable): Ditto.
1317         (WebCore::isBooleanMediaConstraintSatisfiable): Ditto.
1318         (WebCore::isStringMediaConstraintSatisfiable):
1319         (WebCore::isSatisfiable):
1320         (WebCore::MediaConstraintsMock::verifyConstraints): Use constraints.mandatoryConstraints.filter
1321           instead of direct enumeration.
1322         * platform/mock/MediaConstraintsMock.h:
1323
1324         * platform/mock/MockRealtimeAudioSource.h:
1325         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1326         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
1327
1328 2016-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1329
1330         Some Now Playing behavior is broken after r206315
1331         https://bugs.webkit.org/show_bug.cgi?id=162625
1332         <rdar://problem/28496755>
1333
1334         Reviewed by Jer Noble.
1335
1336         Reverts the part of our heuristic that disables Now Playing in active tabs in the main window.
1337
1338         * html/MediaElementSession.cpp:
1339         (WebCore::MediaElementSession::pageAllowsNowPlayingControls):
1340         * page/Page.cpp:
1341         (WebCore::Page::setViewState):
1342
1343 2016-09-27  Ryan Haddad  <ryanhaddad@apple.com>
1344
1345         Remove an unneeded assert in InspectorOverlay.cpp
1346         https://bugs.webkit.org/show_bug.cgi?id=162581
1347
1348         Reviewed by Alexey Proskuryakov.
1349
1350         This assertion was added to catch unknown issues, but it is firing frequently enough on certain Inspector
1351         tests that it is causing more harm than good.
1352
1353         * inspector/InspectorOverlay.cpp:
1354         (WebCore::buildQuadObjectForCSSRegionContentClip):
1355         (WebCore::evaluateCommandInOverlay):
1356
1357 2016-09-27  Jer Noble  <jer.noble@apple.com>
1358
1359         Remove deprecated ENCRYPTED_MEDIA implementation.
1360         https://bugs.webkit.org/show_bug.cgi?id=161010
1361
1362         Reviewed by Eric Carlson.
1363
1364         Remove all references to the deprecated ENABLE_ENCRYPTED_MEDIA (leaving in place
1365         the soon-to-be deprecated ENABLE_ENCRYPTED_MEDIA_V2).
1366
1367         * CMakeLists.txt:
1368         * Configurations/FeatureDefines.xcconfig:
1369         * DerivedSources.make:
1370         * WebCore.xcodeproj/project.pbxproj:
1371         * bindings/objc/DOMHTMLMediaElement.h:
1372         * bindings/objc/DOMHTMLMediaElement.mm:
1373         (-[DOMHTMLMediaElement canPlayType:]):
1374         (-[DOMHTMLMediaElement canPlayType:keySystem:]): Deleted.
1375         * bindings/js/JSDictionary.cpp:
1376         * bindings/js/JSDictionary.h:
1377         * dom/Element.idl:
1378         * dom/EventNames.in:
1379         * html/HTMLMediaElement.cpp:
1380         (WebCore::HTMLMediaElement::selectNextSourceChild):
1381         (WebCore::exceptionCodeForMediaKeyException): Deleted.
1382         (WebCore::HTMLMediaElement::canPlayType): Deleted.
1383         (WebCore::HTMLMediaElement::mediaPlayerKeyAdded): Deleted.
1384         (WebCore::HTMLMediaElement::mediaPlayerKeyError): Deleted.
1385         (WebCore::HTMLMediaElement::mediaPlayerKeyMessage): Deleted.
1386         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded): Deleted.
1387         * html/HTMLMediaElement.h:
1388         * html/HTMLMediaElement.idl:
1389         * html/MediaError.h:
1390         * html/MediaError.idl:
1391         * html/MediaKeyError.h:
1392         * html/MediaKeyError.idl:
1393         * html/MediaKeyEvent.cpp: Removed.
1394         (WebCore::MediaKeyEvent::MediaKeyEvent): Deleted.
1395         (WebCore::MediaKeyEvent::~MediaKeyEvent): Deleted.
1396         (WebCore::MediaKeyEvent::eventInterface): Deleted.
1397         * html/MediaKeyEvent.h: Removed.
1398         * html/MediaKeyEvent.idl: Removed.
1399         * platform/graphics/MediaPlayer.cpp:
1400         (WebCore::MediaPlayer::nextBestMediaEngine):
1401         (WebCore::MediaPlayer::generateKeyRequest): Deleted.
1402         (WebCore::MediaPlayer::addKey): Deleted.
1403         (WebCore::MediaPlayer::cancelKeyRequest): Deleted.
1404         (WebCore::MediaPlayer::keyAdded): Deleted.
1405         (WebCore::MediaPlayer::keyError): Deleted.
1406         (WebCore::MediaPlayer::keyMessage): Deleted.
1407         (WebCore::MediaPlayer::keyNeeded): Deleted.
1408         * platform/graphics/MediaPlayer.h:
1409         (WebCore::MediaPlayerClient::mediaPlayerKeyAdded): Deleted.
1410         (WebCore::MediaPlayerClient::mediaPlayerKeyError): Deleted.
1411         (WebCore::MediaPlayerClient::mediaPlayerKeyMessage): Deleted.
1412         (WebCore::MediaPlayerClient::mediaPlayerKeyNeeded): Deleted.
1413         * platform/graphics/MediaPlayerPrivate.h:
1414         (WebCore::MediaPlayerPrivateInterface::addKey): Deleted.
1415         (WebCore::MediaPlayerPrivateInterface::generateKeyRequest): Deleted.
1416         (WebCore::MediaPlayerPrivateInterface::cancelKeyRequest): Deleted.
1417         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1418         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1419         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1420         (WebCore::CDMSessionAVContentKeySession::update):
1421         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1422         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1423         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
1424         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1425         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Deleted.
1426         (WebCore::MediaPlayerPrivateAVFoundationObjC::generateKeyRequest): Deleted.
1427         (WebCore::MediaPlayerPrivateAVFoundationObjC::addKey): Deleted.
1428         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelKeyRequest): Deleted.
1429         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1430         (WebCore::MediaPlayerPrivateQTKit::supportsType): Deleted.
1431         * testing/MockCDM.h:
1432
1433 2016-09-27  Youenn Fablet  <youenn@apple.com>
1434
1435         [Fetch API] Use Ref<const T> in FetchBody::m_data variant
1436         https://bugs.webkit.org/show_bug.cgi?id=162599
1437
1438         Reviewed by Alex Christensen.
1439
1440         Covered by existing tests.
1441
1442         Using Ref<const T> for all variants of m_data except for FormData since FetchBody is actually creating it and may modifiy it.
1443         Updating blob loading code path to use a const Blob& instead of a Blob&.
1444
1445         * Modules/fetch/FetchBody.cpp:
1446         (WebCore::FetchBody::FetchBody):
1447         (WebCore::FetchBody::extract):
1448         (WebCore::FetchBody::clone):
1449         * Modules/fetch/FetchBody.h:
1450         (WebCore::FetchBody::blobBody):
1451         (WebCore::FetchBody::arrayBufferBody):
1452         (WebCore::FetchBody::arrayBufferViewBody):
1453         * Modules/fetch/FetchBodyOwner.cpp:
1454         (WebCore::FetchBodyOwner::loadBlob):
1455         * Modules/fetch/FetchBodyOwner.h:
1456         * Modules/fetch/FetchLoader.cpp:
1457         (WebCore::FetchLoader::start):
1458         * Modules/fetch/FetchLoader.h:
1459
1460 2016-09-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1461
1462         Unreviewed typo fix
1463
1464         * platform/gtk/UserAgentGtk.cpp:
1465         (WebCore::standardUserAgent):
1466
1467 2016-09-27  Youenn Fablet  <youenn@apple.com>
1468
1469         Clean-up CachedImage constructor
1470         https://bugs.webkit.org/show_bug.cgi?id=162601
1471
1472         Reviewed by Sam Weinig.
1473
1474         No change of behavior.
1475         Removing an unused constructor.
1476         Specializing one constructor for manually cached images.
1477         Cleaning initialization of some CachedImage fields.
1478
1479         * loader/cache/CachedImage.cpp:
1480         (WebCore::CachedImage::CachedImage):
1481         * loader/cache/CachedImage.h:
1482         * loader/cache/MemoryCache.cpp:
1483         (WebCore::MemoryCache::addImageToCache):
1484
1485 2016-09-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1486
1487         [FreeType] Add comment further justifying use of FT_LOAD_FORCE_AUTOHINT
1488         https://bugs.webkit.org/show_bug.cgi?id=162607
1489
1490         Reviewed by Martin Robinson.
1491
1492         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
1493         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
1494
1495 2016-09-27  Mario Sanchez Prada  <mario@endlessm.com>
1496
1497         Build fails for X11+EGL due to missing gst_gl_display_x11_new_with_display()
1498         https://bugs.webkit.org/show_bug.cgi?id=162606
1499
1500         Reviewed by Gustavo Noronha Silva.
1501
1502         Use the right check to retrieve the right instance of GstGLDisplay
1503         depending on whether we're using GLX or EGL, not X11 or Wayland.
1504
1505         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1506         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
1507
1508 2016-09-27  Youenn Fablet  <youenn@apple.com>
1509
1510         [GTK][EFL] imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html is failing
1511         https://bugs.webkit.org/show_bug.cgi?id=162547
1512
1513         Reviewed by Michael Catanzaro.
1514
1515         Covered by existing tests.
1516
1517         * platform/network/soup/SoupNetworkSession.cpp:
1518         (WebCore::SoupNetworkSession::createTestingSession): Setting the underlying soupSession.
1519
1520 2016-09-27  Youenn Fablet  <youenn@apple.com>
1521
1522         [Fetch API] Remove ReadableStreamSource firstReadCallback
1523         https://bugs.webkit.org/show_bug.cgi?id=162339
1524
1525         Reviewed by Sam Weinig.
1526
1527         No observable change of behavior.
1528         Removing ReadableStreamSource firstReadCallback.
1529         This makes the enqueuing of data to happen when the stream is created.
1530         In the future, we may want to implement doPull() to enqueue data when stream actually needs it.
1531
1532         * Modules/fetch/FetchResponseSource.cpp:
1533         (WebCore::FetchResponseSource::doPull): Introduced as we introduce pull() in ReadableStreamSource.
1534         * Modules/fetch/FetchResponseSource.h:
1535         * Modules/streams/ReadableStreamInternals.js:
1536         (readFromReadableStreamDefaultReader): Removing firstReadCallback use.
1537         * Modules/streams/ReadableStreamSource.h: Renaming m_startPromise in m_promise since m_promise may store start and pull promises.
1538         (WebCore::ReadableStreamSource::isStarting):
1539         (WebCore::ReadableStreamSource::start):
1540         (WebCore::ReadableStreamSource::pull): Introduced to support ReadableStreamSource pulling.
1541         (WebCore::ReadableStreamSource::startFinished):
1542         (WebCore::ReadableStreamSource::pullFinished): Ditto.
1543         (WebCore::ReadableStreamSource::clean):
1544         * Modules/streams/ReadableStreamSource.idl: Ditto.
1545         * bindings/js/JSReadableStreamSourceCustom.cpp: Refactoring to use callPromiseFunction
1546         (WebCore::startReadableStream):
1547         (WebCore::JSReadableStreamSource::start):
1548         (WebCore::pullReadableStream): Introduced to support ReadableStreamSource pulling.
1549         (WebCore::JSReadableStreamSource::pull): Ditto.
1550         * bindings/js/WebCoreBuiltinNames.h: Removing firstReadCallback
1551
1552 2016-09-27  Myles C. Maxfield  <mmaxfield@apple.com>
1553
1554         REGRESSION(r205883): Letterpressed text is invisible
1555         https://bugs.webkit.org/show_bug.cgi?id=162590
1556         <rdar://problem/28141512>
1557
1558         Reviewed by Simon Fraser.
1559
1560         r205883 removed the last place where we use CGFonts directly in WebKit. However,
1561         our letterpress code is sensitive to the current state of the CGContext.
1562
1563         Tests: fast/text/letterpress-different.html
1564                fast/text/letterpress-paint.html
1565
1566         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1567         (WebCore::showLetterpressedGlyphsWithAdvances):
1568
1569 2016-09-27  Youenn Fablet  <youenn@apple.com>
1570
1571         [Fetch API] Refactor FetchBody to use std::experimental::variant
1572         https://bugs.webkit.org/show_bug.cgi?id=162559
1573
1574         Reviewed by Alex Christensen.
1575
1576         Covered by exiting tests.
1577
1578         Using variant to represent the variant data types.
1579         Adding nullptr as a specific type for default empty values and to allow clean-up.
1580         Adding FetchBody::clone as the default copy constructor is deleted with this change.
1581
1582         * Modules/fetch/FetchBody.cpp:
1583         (WebCore::FetchBody::FetchBody):
1584         (WebCore::FetchBody::json):
1585         (WebCore::FetchBody::text):
1586         (WebCore::FetchBody::consumeAsStream):
1587         (WebCore::FetchBody::consumeArrayBuffer):
1588         (WebCore::FetchBody::consumeArrayBufferView):
1589         (WebCore::FetchBody::consumeText):
1590         (WebCore::FetchBody::consumeBlob):
1591         (WebCore::FetchBody::extractFromText):
1592         (WebCore::FetchBody::bodyForInternalRequest):
1593         (WebCore::FetchBody::clone):
1594         * Modules/fetch/FetchBody.h:
1595         (WebCore::FetchBody::blobBody):
1596         (WebCore::FetchBody::formDataBody):
1597         (WebCore::FetchBody::arrayBufferBody):
1598         (WebCore::FetchBody::arrayBufferViewBody):
1599         (WebCore::FetchBody::textBody):
1600         * Modules/fetch/FetchRequest.cpp:
1601         (WebCore::FetchRequest::clone):
1602         * Modules/fetch/FetchResponse.cpp:
1603         (WebCore::FetchResponse::cloneForJS):
1604
1605 2016-09-26  Joonghun Park  <jh718.park@samsung.com>
1606
1607         [EFL] Fix debug build break since r204205. Unreviewed
1608         https://bugs.webkit.org/show_bug.cgi?id=162596
1609
1610         No new tests, no new behaviours.
1611
1612         * platform/graphics/BitmapImage.cpp:
1613         (WebCore::BitmapImage::frameImageAtIndex):
1614
1615 2016-09-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1616
1617         If you play a youtube video from now playing after it finished in Safari, controls disappear
1618         https://bugs.webkit.org/show_bug.cgi?id=162589
1619         <rdar://problem/28484047>
1620
1621         Reviewed by Jer Noble.
1622
1623         Tweaks the main content heuristic slightly to remove the "mostly in mainframe" requirement in the case of Now
1624         Playing. This was added in the case of the controls manager as an additional way to identify video elements that
1625         should not show controls, since we relax audio and video constraints for showing videos in the controls manager,
1626         so that a video element is prevented from showing controls on grounds of lacking audio only if it has never had
1627         audio before. In the case of Now Playing, we have stricter requirements for videos, which must have audio, which
1628         makes the mainframe heuristic not necessary.
1629
1630         * html/MediaElementSession.cpp:
1631         (WebCore::MediaElementSession::canShowControlsManager):
1632
1633 2016-09-26  Antti Koivisto  <antti@apple.com>
1634
1635         Setter on style element's textContent or cssText doesn't trigger style recalc
1636         https://bugs.webkit.org/show_bug.cgi?id=160331
1637         <rdar://problem/27609715>
1638
1639         Reviewed by Ryosuke Niwa and Daniel Bates.
1640
1641         We would not notify the parent when text node content changed in a shadow tree.
1642
1643         Test: fast/shadow-dom/shadow-style-text-mutation.html
1644
1645         * dom/AuthorStyleSheets.cpp:
1646         (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
1647
1648             Invalidate shadow root children instead of the root itself when doing full invalidation.
1649             The invalidity bits have no meaning for non-element, non-texts.
1650
1651         * dom/CharacterData.cpp:
1652         (WebCore::CharacterData::parserAppendData):
1653         (WebCore::CharacterData::setDataAndUpdate):
1654         (WebCore::CharacterData::notifyParentAfterChange):
1655
1656             Add a helper and call it also in shadow trees.
1657
1658         (WebCore::CharacterData::dispatchModifiedEvent):
1659         * dom/CharacterData.h:
1660
1661 2016-09-26  Antti Koivisto  <antti@apple.com>
1662
1663         Input elements don't work inside shadow tree
1664         https://bugs.webkit.org/show_bug.cgi?id=160427
1665
1666         Reviewed by Darin Adler.
1667
1668         There is a bug in ComposedTreeIterator. If the iterator is initialized with an initial state where the root
1669         is inside a shadow tree it won't iterate into slots.
1670
1671         If an input element is in a shadow tree it generates narrowly scoped style updates. When RenderTreeUpdater
1672         applies such an update the update root will be inside the shadow tree and the bug will prevent the render tree
1673         for slotted content from updating.
1674
1675         Added tests for both the iterator behavior and the specific symptom with input elements.
1676
1677         Tests: fast/shadow-dom/composed-tree-shadow-child-subtree.html
1678                fast/shadow-dom/input-element-in-shadow.html
1679
1680         * dom/ComposedTreeIterator.cpp:
1681         (WebCore::ComposedTreeIterator::ComposedTreeIterator):
1682
1683             Check and cache if the root is inside shadow tree.
1684
1685         (WebCore::ComposedTreeIterator::traverseNextInShadowTree):
1686         * dom/ComposedTreeIterator.h:
1687         (WebCore::ComposedTreeIterator::traverseNext):
1688
1689             If it is, always use the shadow traversal code path.
1690
1691 2016-09-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1692
1693         Seeking video doesn't update seek position
1694         https://bugs.webkit.org/show_bug.cgi?id=162575
1695         <rdar://problem/28457219>
1696
1697         Reviewed by Jer Noble.
1698
1699         On ToT, seeking in a video causes the playhead to stutter, and does not actually update media remote's seek
1700         position. This is partly due to how we do not update media remote with new information when beginning to respond
1701         to remote seek commands, so media remote continues to think that a playing video is still playing despite the
1702         user attempting to seek through it.
1703
1704         To fix this, we introduce timer-based guards around remote seek commands, such that a seek "gesture" begins when
1705         we receive the first seek command and ends when no seek command has been received in a set amount of time (this
1706         is 0.5 seconds, which is approximately what other clients around the platform use).
1707
1708         Also, when responding to a remote seek, perform the seek with no tolerance. This prevents the playhead from
1709         stuttering at the end of a seek from the final requested destination of the seek to the last actually seeked
1710         time in the video.
1711
1712         When beginning to seek, we must pause the media. Through existing mechanisms, this causes the media session
1713         manager to update its Now Playing information, which informs media remote that we are no longer playing and
1714         prevents us from stuttering. However, when ending a seek, we must also trigger an additional update to again
1715         refresh media remote's view of the current time. This prevents a flicker when playing media after seeking.
1716
1717         Unit tests to be added in a follow-up due to time constraints.
1718
1719         * html/HTMLMediaElement.cpp:
1720         (WebCore::HTMLMediaElement::HTMLMediaElement):
1721         (WebCore::HTMLMediaElement::handleSeekToPlaybackPosition):
1722         (WebCore::HTMLMediaElement::seekToPlaybackPositionEndedTimerFired):
1723         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
1724         * html/HTMLMediaElement.h:
1725         * platform/audio/PlatformMediaSessionManager.h:
1726         (WebCore::PlatformMediaSessionManager::scheduleUpdateNowPlayingInfo):
1727         (WebCore::PlatformMediaSessionManager::sessionDidEndRemoteScrubbing):
1728         (WebCore::PlatformMediaSessionManager::sessions): Deleted.
1729         * platform/audio/mac/MediaSessionManagerMac.h:
1730         * platform/audio/mac/MediaSessionManagerMac.mm:
1731         (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary):
1732         (WebCore::MediaSessionManagerMac::scheduleUpdateNowPlayingInfo):
1733         (WebCore::MediaSessionManagerMac::sessionDidEndRemoteScrubbing):
1734         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
1735
1736 2016-09-26  Chris Dumez  <cdumez@apple.com>
1737
1738         [WK2] BlobDownloadClient should use asynchronous IPC to decide destination path
1739         https://bugs.webkit.org/show_bug.cgi?id=162568
1740
1741         Reviewed by Alex Christensen.
1742
1743         Update BlobResourceHandle to wait for continueDidReceiveResponse() to be
1744         called after it calls the client's didReceiveResponseAsync(), before
1745         actually reading the Blob Data.
1746
1747         No new tests, covered by existing tests.
1748
1749         * platform/network/BlobResourceHandle.cpp:
1750         (WebCore::BlobResourceHandle::continueDidReceiveResponse):
1751         (WebCore::BlobResourceHandle::getSizeForNext):
1752         (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
1753         (WebCore::BlobResourceHandle::notifyResponseOnError):
1754
1755 2016-09-26  Daniel Bates  <dabates@apple.com>
1756
1757         Mark Ping{Handle, Load} as final
1758         https://bugs.webkit.org/show_bug.cgi?id=162576
1759
1760         Reviewed by Alex Christensen.
1761
1762         We should not support subclassing of a ping handle or overriding its ResourceHandleClient
1763         callbacks because there are security/privacy implications with a ping request. We should
1764         not encourage subclassing without careful consideration.
1765
1766         * platform/network/PingHandle.h:
1767
1768 2016-09-26  Daniel Bates  <dabates@apple.com>
1769
1770         Rename IOS_TEXT_AUTOSIZING to TEXT_AUTOSIZING
1771         https://bugs.webkit.org/show_bug.cgi?id=162365
1772
1773         Reviewed by Simon Fraser.
1774
1775         Repurpose the feature name TEXT_AUTOSIZING for the ENABLE(IOS_TEXT_AUTOSIZING)-guarded code
1776         as this code represents WebKit's automatic text size adjustment machinery and is compiled
1777         on both macOS and iOS.
1778
1779         * Configurations/FeatureDefines.xcconfig:
1780         * css/CSSComputedStyleDeclaration.cpp:
1781         (WebCore::ComputedStyleExtractor::propertyValue):
1782         * css/CSSPropertyNames.in:
1783         * css/StyleBuilderCustom.h:
1784         * css/StyleResolver.cpp:
1785         (WebCore::StyleResolver::updateFont):
1786         * css/StyleResolver.h:
1787         * css/parser/CSSParser.cpp:
1788         (WebCore::CSSParserContext::CSSParserContext):
1789         (WebCore::CSSParser::parseValue):
1790         * css/parser/CSSParser.h:
1791         * css/parser/CSSParserMode.h:
1792         * dom/Document.cpp:
1793         (WebCore::Document::destroyRenderTree):
1794         * dom/Document.h:
1795         * editing/EditingStyle.cpp:
1796         * page/FrameView.cpp:
1797         (WebCore::FrameView::layout):
1798         * page/Page.cpp:
1799         (WebCore::Page::Page):
1800         * page/Page.h:
1801         * page/Settings.in:
1802         * platform/graphics/FontCascade.h:
1803         * platform/graphics/FontDescription.cpp:
1804         * platform/graphics/FontDescription.h:
1805         * rendering/RenderBlockFlow.cpp:
1806         (WebCore::RenderBlockFlow::RenderBlockFlow):
1807         * rendering/RenderBlockFlow.h:
1808         * rendering/RenderElement.cpp:
1809         * rendering/RenderElement.h:
1810         * rendering/RenderObject.cpp:
1811         * rendering/RenderObject.h:
1812         * rendering/RenderText.cpp:
1813         (WebCore::RenderText::RenderText):
1814         * rendering/RenderText.h:
1815         * rendering/TextAutoSizing.cpp:
1816         * rendering/TextAutoSizing.h:
1817         * rendering/style/RenderStyle.cpp:
1818         (WebCore::RenderStyle::changeRequiresLayout):
1819         * rendering/style/RenderStyle.h:
1820         * rendering/style/StyleInheritedData.cpp:
1821         (WebCore::StyleInheritedData::StyleInheritedData):
1822         (WebCore::StyleInheritedData::operator==):
1823         * rendering/style/StyleInheritedData.h:
1824         * rendering/style/StyleRareInheritedData.cpp:
1825         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1826         (WebCore::StyleRareInheritedData::operator==):
1827         * rendering/style/StyleRareInheritedData.h:
1828         * rendering/style/TextSizeAdjustment.h:
1829         * testing/InternalSettings.cpp:
1830         (WebCore::InternalSettings::Backup::Backup):
1831         (WebCore::InternalSettings::Backup::restoreTo):
1832         (WebCore::InternalSettings::setTextAutosizingEnabled):
1833         (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride):
1834         * testing/InternalSettings.h:
1835
1836 2016-09-26  Nan Wang  <n_wang@apple.com>
1837
1838         AX: Progress: [Mac] Content in label element should be used as AXTitle or AXDescription
1839         https://bugs.webkit.org/show_bug.cgi?id=162573
1840
1841         Reviewed by Chris Fleizach.
1842
1843         Exposed the label element's text as the AXTitle of the progress indicator.
1844
1845         Test: accessibility/mac/progress-with-label-element.html
1846
1847         * accessibility/AccessibilityNodeObject.cpp:
1848         (WebCore::AccessibilityNodeObject::titleElementText):
1849         (WebCore::AccessibilityNodeObject::title):
1850
1851 2016-09-26  Ryan Haddad  <ryanhaddad@apple.com>
1852
1853         Rebaseline bindings tests after r206386.
1854
1855         Unreviewed test gardening.
1856
1857         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1858         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1859         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1860         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1861         * bindings/scripts/test/JS/JSTestInterface.cpp:
1862         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1863         * bindings/scripts/test/JS/JSTestNode.cpp:
1864         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1865         * bindings/scripts/test/JS/JSTestObj.cpp:
1866         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1867         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1868         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1869         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1870         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1871
1872 2016-09-26  Youenn Fablet  <youenn@apple.com>
1873
1874         ASSERTION FAILED: m_origin || m_type == CachedResource::MainResource
1875         https://bugs.webkit.org/show_bug.cgi?id=162472
1876         <rdar://problem/28431522>
1877
1878         Reviewed by Chris Dumez.
1879
1880         Covered by existing tests.
1881
1882         * loader/cache/CachedImage.cpp:
1883         (WebCore::CachedImage::CachedImage): Fixing the last CachedImage constructor.
1884         Using CachedResource protected constructor.
1885         * loader/cache/CachedResource.h: Small clean-up.
1886
1887 2016-09-26  Youenn Fablet  <youenn@apple.com>
1888
1889         [GTK][EFL] imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html is failing
1890         https://bugs.webkit.org/show_bug.cgi?id=162547
1891
1892         Reviewed by Carlos Garcia Campos.
1893
1894         Covered by LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html now passing.
1895
1896         * platform/network/soup/SoupNetworkSession.cpp:
1897         (WebCore::SoupNetworkSession::createTestingSession): Setting a default Accept-Language value.
1898
1899 2016-09-26  Mark Lam  <mark.lam@apple.com>
1900
1901         Added RETURN_IF_EXCEPTION() macro and use it for exception checks.
1902         https://bugs.webkit.org/show_bug.cgi?id=162521
1903
1904         Reviewed by Saam Barati.
1905
1906         No new tests because this patch is mostly refactoring.  The only change in
1907         behavior is that functions that have a JSValue return type will now return the
1908         empty JSValue when an exception is thrown.  I tested this behavior by running
1909         the existing JSC and layout tests.
1910
1911         * bindings/js/ArrayValue.cpp:
1912         (WebCore::ArrayValue::get):
1913         * bindings/js/IDBBindingUtilities.cpp:
1914         (WebCore::toJS):
1915         * bindings/js/JSApplePaySessionCustom.cpp:
1916         (WebCore::JSApplePaySession::completeShippingMethodSelection):
1917         (WebCore::JSApplePaySession::completeShippingContactSelection):
1918         (WebCore::JSApplePaySession::completePaymentMethodSelection):
1919         * bindings/js/JSAudioTrackCustom.cpp:
1920         (WebCore::JSAudioTrack::setKind):
1921         (WebCore::JSAudioTrack::setLanguage):
1922         * bindings/js/JSBlobCustom.cpp:
1923         (WebCore::constructJSBlob):
1924         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1925         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
1926         * bindings/js/JSCommandLineAPIHostCustom.cpp:
1927         (WebCore::getJSListenerFunctions):
1928         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
1929         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
1930         (WebCore::getHashAlgorithm):
1931         (WebCore::createAesCbcParams):
1932         (WebCore::createAesKeyGenParams):
1933         (WebCore::createHmacKeyParams):
1934         (WebCore::createRsaKeyGenParams):
1935         (WebCore::createRsaOaepParams):
1936         * bindings/js/JSCryptoKeySerializationJWK.cpp:
1937         (WebCore::getStringFromJSON):
1938         (WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
1939         (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
1940         (WebCore::buildJSONForRSAComponents):
1941         (WebCore::addUsagesToJSON):
1942         (WebCore::JSCryptoKeySerializationJWK::serialize):
1943         * bindings/js/JSCustomElementInterface.cpp:
1944         (WebCore::constructCustomElementSynchronously):
1945         (WebCore::JSCustomElementInterface::upgradeElement):
1946         * bindings/js/JSCustomElementRegistryCustom.cpp:
1947         (WebCore::getCustomElementCallback):
1948         (WebCore::JSCustomElementRegistry::define):
1949         (WebCore::whenDefinedPromise):
1950         * bindings/js/JSDOMBinding.cpp:
1951         (WebCore::valueToUSVString):
1952         (WebCore::hasIteratorMethod):
1953         (WebCore::toSmallerInt):
1954         (WebCore::toSmallerUInt):
1955         (WebCore::toInt32EnforceRange):
1956         (WebCore::toUInt32EnforceRange):
1957         (WebCore::toInt64EnforceRange):
1958         (WebCore::toUInt64EnforceRange):
1959         * bindings/js/JSDOMBinding.h:
1960         (WebCore::toJSSequence):
1961         (WebCore::toJS):
1962         (WebCore::jsFrozenArray):
1963         * bindings/js/JSDOMPromise.cpp:
1964         (WebCore::rejectPromiseWithExceptionIfAny):
1965         * bindings/js/JSDOMStringMapCustom.cpp:
1966         (WebCore::JSDOMStringMap::putDelegate):
1967         * bindings/js/JSDOMWindowCustom.cpp:
1968         (WebCore::JSDOMWindow::setLocation):
1969         (WebCore::JSDOMWindow::open):
1970         (WebCore::JSDOMWindow::showModalDialog):
1971         (WebCore::handlePostMessage):
1972         (WebCore::JSDOMWindow::setTimeout):
1973         (WebCore::JSDOMWindow::setInterval):
1974         * bindings/js/JSDataCueCustom.cpp:
1975         (WebCore::constructJSDataCue):
1976         * bindings/js/JSDeviceMotionEventCustom.cpp:
1977         (WebCore::readAccelerationArgument):
1978         (WebCore::readRotationRateArgument):
1979         (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
1980         * bindings/js/JSDictionary.cpp:
1981         (WebCore::JSDictionary::tryGetProperty):
1982         (WebCore::JSDictionary::convertValue):
1983         * bindings/js/JSDictionary.h:
1984         (WebCore::JSDictionary::tryGetPropertyAndResult):
1985         * bindings/js/JSDocumentCustom.cpp:
1986         (WebCore::JSDocument::getCSSCanvasContext):
1987         * bindings/js/JSFileCustom.cpp:
1988         (WebCore::constructJSFile):
1989         * bindings/js/JSGeolocationCustom.cpp:
1990         (WebCore::JSGeolocation::getCurrentPosition):
1991         (WebCore::JSGeolocation::watchPosition):
1992         * bindings/js/JSHTMLAllCollectionCustom.cpp:
1993         (WebCore::callHTMLAllCollection):
1994         * bindings/js/JSHTMLCanvasElementCustom.cpp:
1995         (WebCore::JSHTMLCanvasElement::getContext):
1996         * bindings/js/JSHTMLElementCustom.cpp:
1997         (WebCore::constructJSHTMLElement):
1998         * bindings/js/JSHistoryCustom.cpp:
1999         (WebCore::JSHistory::pushState):
2000         (WebCore::JSHistory::replaceState):
2001         * bindings/js/JSIDBDatabaseCustom.cpp:
2002         (WebCore::JSIDBDatabase::createObjectStore):
2003         * bindings/js/JSMessageEventCustom.cpp:
2004         (WebCore::handleInitMessageEvent):
2005         * bindings/js/JSMessagePortCustom.cpp:
2006         (WebCore::fillMessagePortArray):
2007         * bindings/js/JSMessagePortCustom.h:
2008         (WebCore::handlePostMessage):
2009         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
2010         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
2011         (WebCore::toDecision):
2012         (WebCore::JSMockContentFilterSettings::setDecision):
2013         (WebCore::JSMockContentFilterSettings::setUnblockRequestDecision):
2014         * bindings/js/JSNodeFilterCustom.cpp:
2015         (WebCore::JSNodeFilter::acceptNode):
2016         * bindings/js/JSNodeOrString.cpp:
2017         (WebCore::toNodeOrStringVector):
2018         * bindings/js/JSSQLTransactionCustom.cpp:
2019         (WebCore::JSSQLTransaction::executeSql):
2020         * bindings/js/JSSVGLengthCustom.cpp:
2021         (WebCore::JSSVGLength::convertToSpecifiedUnits):
2022         * bindings/js/JSStorageCustom.cpp:
2023         (WebCore::JSStorage::getOwnPropertyNames):
2024         * bindings/js/JSTextTrackCustom.cpp:
2025         (WebCore::JSTextTrack::setLanguage):
2026         * bindings/js/JSVideoTrackCustom.cpp:
2027         (WebCore::JSVideoTrack::setKind):
2028         (WebCore::JSVideoTrack::setLanguage):
2029         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
2030         (WebCore::JSWebGL2RenderingContext::getIndexedParameter):
2031         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
2032         (WebCore::getObjectParameter):
2033         (WebCore::JSWebGLRenderingContextBase::getExtension):
2034         (WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
2035         (WebCore::JSWebGLRenderingContextBase::getParameter):
2036         (WebCore::JSWebGLRenderingContextBase::getProgramParameter):
2037         (WebCore::JSWebGLRenderingContextBase::getShaderParameter):
2038         (WebCore::toVector):
2039         (WebCore::dataFunctionf):
2040         (WebCore::dataFunctionMatrix):
2041         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
2042         (WebCore::cryptoKeyFormatFromJSValue):
2043         (WebCore::cryptoKeyUsagesFromJSValue):
2044         (WebCore::JSWebKitSubtleCrypto::generateKey):
2045         (WebCore::importKey):
2046         (WebCore::JSWebKitSubtleCrypto::importKey):
2047         (WebCore::exportKey):
2048         (WebCore::JSWebKitSubtleCrypto::exportKey):
2049         (WebCore::JSWebKitSubtleCrypto::unwrapKey):
2050         * bindings/js/JSWorkerCustom.cpp:
2051         (WebCore::constructJSWorker):
2052         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2053         (WebCore::JSWorkerGlobalScope::importScripts):
2054         (WebCore::JSWorkerGlobalScope::setTimeout):
2055         (WebCore::JSWorkerGlobalScope::setInterval):
2056         * bindings/js/ReadableStreamDefaultController.cpp:
2057         (WebCore::ReadableStreamDefaultController::invoke):
2058         * bindings/js/ScheduledAction.cpp:
2059         (WebCore::ScheduledAction::create):
2060         * bindings/scripts/CodeGeneratorJS.pm:
2061         (GenerateDictionaryImplementationContent):
2062         (GenerateImplementation):
2063         (GenerateParametersCheck):
2064         (GenerateImplementationFunctionCall):
2065         (GenerateConstructorDefinition):
2066         * html/HTMLMediaElement.cpp:
2067         (WebCore::controllerJSValue):
2068         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
2069         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
2070
2071 2016-09-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2072
2073         -Wtautological-compare triggered in URLParser::internalValuesConsistent
2074         https://bugs.webkit.org/show_bug.cgi?id=162551
2075
2076         Reviewed by Alex Christensen.
2077
2078         Fix logic error.
2079
2080         * platform/URLParser.cpp:
2081         (WebCore::URLParser::internalValuesConsistent):
2082
2083 2016-09-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2084
2085         Add CairoUniquePtr and use it in FontPlatformDataFreetype.cpp
2086         https://bugs.webkit.org/show_bug.cgi?id=162557
2087
2088         Reviewed by Alex Christensen.
2089
2090         * platform/graphics/cairo/CairoUniquePtr.h: Added.
2091         (WebCore::CairoPtrDeleter<cairo_font_options_t>::operator()):
2092         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2093         (WebCore::getDefaultCairoFontOptions): Return a smart pointer.
2094         (WebCore::FontPlatformData::buildScaledFont): Use smart pointer.
2095
2096 2016-09-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2097
2098         Silence unused parameter warnings from Geoclue2Interface.c
2099         https://bugs.webkit.org/show_bug.cgi?id=162545
2100
2101         Reviewed by Carlos Garcia Campos.
2102
2103         * PlatformGTK.cmake:
2104
2105 2016-09-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2106
2107         std::unique_ptr deleter functions should not check if pointer is null
2108         https://bugs.webkit.org/show_bug.cgi?id=162558
2109
2110         Reviewed by Alex Christensen.
2111
2112         std::unique_ptr already does this before calling the deleter.
2113
2114         * platform/graphics/x11/XUniquePtr.h:
2115         (WebCore::XPtrDeleter::operator()):
2116         (WebCore::XPtrDeleter<XImage>::operator()):
2117         (WebCore::XPtrDeleter<_XGC>::operator()):
2118         (WebCore::XPtrDeleter<__GLXcontextRec>::operator()):
2119
2120 2016-09-26  Per Arne Vollan  <pvollan@apple.com>
2121
2122         [Win][Debug] Compile fix.
2123         https://bugs.webkit.org/show_bug.cgi?id=162550
2124
2125         Reviewed by Alex Christensen.
2126
2127         Windows headers need the FragmentForwardIterator '==' operator in debug mode.
2128
2129         * rendering/SimpleLineLayout.cpp:
2130         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator==):
2131
2132 2016-09-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2133
2134         [GTK] Unnecessary extern functions in FontPlatformDataFreeType.cpp
2135         https://bugs.webkit.org/show_bug.cgi?id=162555
2136
2137         Reviewed by Carlos Garcia Campos.
2138
2139         These functions should be file-static.
2140
2141         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2142         (WebCore::convertFontConfigSubpixelOrder):
2143         (WebCore::convertFontConfigHintStyle):
2144         (WebCore::setCairoFontOptionsFromFontConfigPattern):
2145
2146 == Rolled over to ChangeLog-2016-09-26 ==