[WinCairo] Fix build after r206196
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-09-22  Don Olmstead  <don.olmstead@am.sony.com>
2
3         [WinCairo] Fix build after r206196
4
5         Reviewed by Alex Christensen.
6
7         * platform/text/win/LocaleWin.cpp:
8         (WebCore::LocaleWin::getLocaleInfoString):
9
10 2016-09-22  Jonathan Bedard  <jbedard@apple.com>
11
12         Automatic Text Replacement Testing in WebKit2
13         https://bugs.webkit.org/show_bug.cgi?id=161919
14
15         Reviewed by Ryosuke Niwa.
16
17         Fixing existing tests:
18             editing/inserting/smart-link-when-caret-is-moved-before-URL.html
19             editing/inserting/typing-space-to-trigger-smart-link.html
20
21         Implemented test hooks for text replacement for WebKit2.
22         Note that spell checking has not been implemented, so most tests which use text replacement still fail.
23
24         * testing/Internals.cpp:
25         (WebCore::Internals::Internals): Reset TextChecker.
26         (WebCore::Internals::setContinuousSpellCheckingEnabled): Converted exception to an assert.
27         (WebCore::Internals::setAutomaticQuoteSubstitutionEnabled): Converted exception to an assert.
28         (WebCore::Internals::setAutomaticLinkDetectionEnabled): Converted exception to an assert.
29         (WebCore::Internals::setAutomaticDashSubstitutionEnabled): Converted exception to an assert.
30         (WebCore::Internals::setAutomaticTextReplacementEnabled): Converted exception to an assert.
31         (WebCore::Internals::setAutomaticSpellingCorrectionEnabled): Converted exception to an assert.
32         * testing/Internals.h: Removed exception argument for TextChecker setters.
33         * testing/Internals.idl: Ditto.
34
35 2016-09-22  Nan Wang  <n_wang@apple.com>
36
37         AX: aria-pressed state not correctly conveyed to VoiceOver iOS on <button> unless role=button added
38         https://bugs.webkit.org/show_bug.cgi?id=162269
39
40         Reviewed by Chris Fleizach.
41
42         <button> with aria-pressed attribute has a toggle button role, however, we were looking for explicit
43         roles in order to convey the aria-press state. Since there's no spec requiring authors explicitly defining
44         default ARIA semantics in such case, I'm exposing the aria-pressed state for all valid toggle buttons.
45
46         Changes are covered in modified test.
47
48         * accessibility/AccessibilityNodeObject.cpp:
49         (WebCore::AccessibilityNodeObject::isPressed):
50
51 2016-09-22  Anders Carlsson  <andersca@apple.com>
52
53         Attempt to fix the open source iOS build.
54
55         * platform/spi/cocoa/PassKitSPI.h:
56
57 2016-09-22  Olivier Blin  <olivier.blin@softathome.com>
58
59         [GStreamer] Support a direct GPU-to-GPU copy of video textures to WebGL
60         https://bugs.webkit.org/show_bug.cgi?id=159928
61
62         Reviewed by Carlos Garcia Campos.
63
64         Copy of GStreamer video frames to WebGL textures was not accelerated.
65
66         WebGLRenderingContextBase::texImage2D(HTMLVideoElement) went
67         through a slow software paint() wrapping the video frame into
68         cairo surface (ImageGStreamer), downloading it to draw to the
69         image cache context, copying it again in software, and uploading
70         it back to an OpenGL texture.
71
72         This patch implements copyVideoTextureToPlatformTexture() for
73         the GStreamer media player backend, to do GPU-to-GPU copy, by
74         extracting code from nativeImageForCurrentTime().
75
76         Doing this also fixes bug #159621: red and blue colors were
77         swapped in video rendered through WebGL with GSTREAMER_GL enabled.
78
79         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
80         (WebCore::MediaPlayerPrivateGStreamerBase::prepareContextForCairoPaint):
81         (WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface):
82         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
83         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
84         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
85
86 2016-09-22  Carlos Garcia Campos  <cgarcia@igalia.com>
87
88         [GTK] Rename DataObjectGtk as SelectionData
89         https://bugs.webkit.org/show_bug.cgi?id=162380
90
91         Reviewed by Žan Doberšek.
92
93         DataObjectGtk represents the data of a selection, like GtkSelectionData, used for clipboard and drag adn drop
94         operations. Data object is a very generic name, and the Gtk suffix sounds like if this is the GTK implementation
95         of a generic DataObject class.
96
97         * PlatformGTK.cmake:
98         * editing/gtk/EditorGtk.cpp:
99         (WebCore::createFragmentFromPasteboardData):
100         * page/gtk/DragControllerGtk.cpp:
101         * platform/DragData.h:
102         * platform/Pasteboard.h:
103         * platform/PasteboardStrategy.h:
104         (WebCore::PasteboardStrategy::~PasteboardStrategy): Deleted.
105         * platform/PlatformPasteboard.h:
106         * platform/gtk/DragDataGtk.cpp:
107         * platform/gtk/PasteboardGtk.cpp:
108         (WebCore::Pasteboard::createPrivate):
109         (WebCore::Pasteboard::createForDragAndDrop):
110         (WebCore::Pasteboard::Pasteboard):
111         (WebCore::Pasteboard::selectionData):
112         (WebCore::selectionDataTypeFromHTMLClipboardType):
113         (WebCore::Pasteboard::writeToClipboard):
114         (WebCore::Pasteboard::readFromClipboard):
115         (WebCore::Pasteboard::writeString):
116         (WebCore::Pasteboard::writePlainText):
117         (WebCore::Pasteboard::write):
118         (WebCore::Pasteboard::writePasteboard):
119         (WebCore::Pasteboard::clear):
120         (WebCore::Pasteboard::canSmartReplace):
121         (WebCore::Pasteboard::read):
122         (WebCore::Pasteboard::hasData):
123         (WebCore::Pasteboard::types):
124         (WebCore::Pasteboard::readString):
125         (WebCore::Pasteboard::readFilenames):
126         * platform/gtk/PasteboardHelper.cpp:
127         (WebCore::PasteboardHelper::getClipboardContents):
128         (WebCore::PasteboardHelper::targetListForSelectionData):
129         (WebCore::PasteboardHelper::fillSelectionData):
130         (WebCore::ClipboardSetData::ClipboardSetData):
131         (WebCore::getClipboardContentsCallback):
132         (WebCore::PasteboardHelper::writeClipboardContents):
133         (WebCore::clearClipboardContentsCallback): Deleted.
134         * platform/gtk/PasteboardHelper.h:
135         * platform/gtk/PlatformPasteboardGtk.cpp:
136         (WebCore::PlatformPasteboard::writeToClipboard):
137         (WebCore::PlatformPasteboard::readFromClipboard):
138         * platform/gtk/SelectionData.cpp: Renamed from Source/WebCore/platform/gtk/DataObjectGtk.cpp.
139         (WebCore::SelectionData::setText):
140         (WebCore::SelectionData::setURIList):
141         (WebCore::SelectionData::setURL):
142         (WebCore::SelectionData::urlLabel):
143         (WebCore::SelectionData::clearAllExceptFilenames):
144         (WebCore::SelectionData::clearAll):
145         * platform/gtk/SelectionData.h: Renamed from Source/WebCore/platform/gtk/DataObjectGtk.h.
146         (WebCore::SelectionData::create):
147         (WebCore::SelectionData::text):
148         (WebCore::SelectionData::hasText):
149         (WebCore::SelectionData::clearText):
150         (WebCore::SelectionData::setMarkup):
151         (WebCore::SelectionData::markup):
152         (WebCore::SelectionData::hasMarkup):
153         (WebCore::SelectionData::clearMarkup):
154         (WebCore::SelectionData::hasURL):
155         (WebCore::SelectionData::clearURL):
156         (WebCore::SelectionData::filenames):
157         (WebCore::SelectionData::hasURIList):
158         (WebCore::SelectionData::hasFilenames):
159         (WebCore::SelectionData::setImage):
160         (WebCore::SelectionData::image):
161         (WebCore::SelectionData::hasImage):
162         (WebCore::SelectionData::unknownTypeData):
163         (WebCore::SelectionData::unknownTypes):
164         (WebCore::SelectionData::hasUnknownTypeData):
165         (WebCore::SelectionData::canSmartReplace):
166         (WebCore::SelectionData::url): Deleted.
167         (WebCore::SelectionData::uriList): Deleted.
168         (WebCore::SelectionData::clearURIList): Deleted.
169         (WebCore::SelectionData::clearImage): Deleted.
170         (WebCore::SelectionData::setUnknownTypeData): Deleted.
171
172 2016-09-22  Youenn Fablet  <youenn@apple.com>
173
174         CachedResourceRequest should store a SecurityOrigin
175         https://bugs.webkit.org/show_bug.cgi?id=162258
176
177         Reviewed by Sam Weinig.
178
179         Test: http/tests/local/script-crossorigin-loads-file-scheme.html
180
181         Passing SecurityOrigin from loader clients to CachedResource through CachedResourceRequest.
182         This ensures that specific origin properties like universal access are well preserved.
183
184         * loader/DocumentThreadableLoader.cpp:
185         (WebCore::DocumentThreadableLoader::loadRequest): Set origin to the request.
186         * loader/cache/CachedResource.cpp:
187         (WebCore::CachedResource::CachedResource): Setting origin from the request.
188         Computing CORS state based on that origin.
189         (WebCore::CachedResource::load): Removing origin computation.
190         (WebCore::CachedResource::loadFrom): Ditto.
191         (WebCore::CachedResource::computeOrigin): Deleted.
192         * loader/cache/CachedResource.h:
193         * loader/cache/CachedResourceLoader.cpp:
194         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
195         (WebCore::CachedResourceLoader::prepareFetch): Introduced to implement step 1 to 7 of https://fetch.spec.whatwg.org/#fetching.
196         (WebCore::CachedResourceLoader::requestResource):
197         * loader/cache/CachedResourceLoader.h:
198         * loader/cache/CachedResourceRequest.cpp:
199         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin): Storing origin.
200         * loader/cache/CachedResourceRequest.h:
201         (WebCore::CachedResourceRequest::setOrigin):
202         (WebCore::CachedResourceRequest::releaseOrigin):
203         (WebCore::CachedResourceRequest::origin):
204
205 2016-09-22  Youenn Fablet  <youenn@apple.com>
206
207         Refactor ContentSecurityPolicy::allow* methods
208         https://bugs.webkit.org/show_bug.cgi?id=162335
209
210         Reviewed by Darin Adler.
211
212         No change of behavior.
213
214         Removing the second parameter of ContentSecurityPolicy::allow* methods.
215         When true, this parameter makes the methods return true.
216         This patch updates the callers of allow* methods to check for the parameter before making the call.
217
218         Made some refactoring to share more code between the various allow* methods.
219
220         * Modules/fetch/FetchLoader.cpp:
221         (WebCore::FetchLoader::start):
222         * Modules/websockets/WebSocket.cpp:
223         (WebCore::WebSocket::connect):
224         * html/HTMLMediaElement.cpp:
225         (WebCore::HTMLMediaElement::isSafeToLoadURL):
226         (WebCore::HTMLMediaElement::outOfBandTrackSources):
227         * html/HTMLPlugInImageElement.cpp:
228         (WebCore::HTMLPlugInImageElement::allowedToLoadPluginContent):
229         * html/HTMLTrackElement.cpp:
230         (WebCore::HTMLTrackElement::canLoadURL):
231         * loader/DocumentThreadableLoader.cpp:
232         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
233         (WebCore::DocumentThreadableLoader::redirectReceived):
234         (WebCore::DocumentThreadableLoader::loadRequest):
235         (WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy):
236         * loader/DocumentThreadableLoader.h:
237         * loader/FrameLoader.cpp:
238         (WebCore::FrameLoader::checkIfFormActionAllowedByCSP):
239         * loader/PolicyChecker.cpp:
240         (WebCore::isAllowedByContentSecurityPolicy):
241         * loader/SubframeLoader.cpp:
242         (WebCore::SubframeLoader::createJavaAppletWidget):
243         * loader/cache/CachedResourceLoader.cpp:
244         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
245         * page/EventSource.cpp:
246         (WebCore::EventSource::create):
247         * page/csp/ContentSecurityPolicy.cpp:
248         (WebCore::ContentSecurityPolicy::allowObjectFromSource):
249         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource):
250         (WebCore::ContentSecurityPolicy::allowResourceFromSource):
251         (WebCore::ContentSecurityPolicy::allowChildContextFromSource):
252         (WebCore::ContentSecurityPolicy::allowScriptFromSource):
253         (WebCore::ContentSecurityPolicy::allowImageFromSource):
254         (WebCore::ContentSecurityPolicy::allowStyleFromSource):
255         (WebCore::ContentSecurityPolicy::allowFontFromSource):
256         (WebCore::ContentSecurityPolicy::allowMediaFromSource):
257         (WebCore::ContentSecurityPolicy::allowConnectToSource):
258         (WebCore::ContentSecurityPolicy::allowFormAction):
259         * page/csp/ContentSecurityPolicy.h:
260         * workers/AbstractWorker.cpp:
261         (WebCore::AbstractWorker::resolveURL):
262         * workers/WorkerGlobalScope.cpp:
263         (WebCore::WorkerGlobalScope::importScripts):
264         * xml/XMLHttpRequest.cpp:
265         (WebCore::XMLHttpRequest::initSend):
266
267 2016-09-19  Sergio Villar Senin  <svillar@igalia.com>
268
269         [css-grid] Remove the x2 computation of row sizes with indefinite heights
270         https://bugs.webkit.org/show_bug.cgi?id=162150
271
272         Reviewed by Darin Adler.
273
274         On r192154, among other things, we added a second pass of the track sizing algorithm for
275         rows in order to properly compute row sizes when the height was indefinite. We did that in
276         order to have a symmetrical implementation for columns and rows, but unfortunatelly that was
277         not correct.
278
279         Apart from issuing incorrect results in some cases it created a huge performance issue in
280         the case of having nested grids because we were exponentially increasing the amount of
281         executions of the track sizing algorithm. The attached performance test shows a 200%
282         improvement with the patch (26 vs 80 runs/s).
283
284         Test: fast/css-grid-layout/nested-grid.html
285
286         * rendering/RenderGrid.cpp:
287         (WebCore::RenderGrid::layoutBlock):
288         (WebCore::RenderGrid::computeIntrinsicLogicalHeight):
289         (WebCore::RenderGrid::layoutGridItems):
290
291 2016-09-22  Youenn Fablet  <youenn@apple.com>
292
293         Improve DeferredWrapper code
294         https://bugs.webkit.org/show_bug.cgi?id=161787
295
296         Reviewed by Darin Adler.
297
298         No change of behavior.
299
300         Renaming DeferredWrapper to DeferredPromise.
301         Adding create method that creates the underlying JSC::JSPromiseDeferred in non-worker environments.
302         Updated create method to take references.
303         Introducing domWindow helper accessor into JSDOMObject to ease creation of promise in non-worker environments.
304         Doing some minor clean up (renaming of m_wrapper to m_promiseDeferred, accessor change).
305
306         * Modules/applepay/ApplePaySession.cpp:
307         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
308         * Modules/applepay/ApplePaySession.h:
309         * Modules/fetch/DOMWindowFetch.cpp:
310         (WebCore::DOMWindowFetch::fetch):
311         * Modules/fetch/DOMWindowFetch.h: Updated to take a DeferredPromise to make it consistent with WorkerGlobalScopeFetch.
312         * Modules/fetch/FetchBody.cpp:
313         (WebCore::FetchBody::arrayBuffer):
314         (WebCore::FetchBody::blob):
315         (WebCore::FetchBody::json):
316         (WebCore::FetchBody::text):
317         (WebCore::FetchBody::consume):
318         (WebCore::FetchBody::consumeArrayBuffer):
319         (WebCore::FetchBody::consumeArrayBufferView):
320         (WebCore::FetchBody::consumeText):
321         (WebCore::FetchBody::consumeBlob):
322         * Modules/fetch/FetchBody.h:
323         (WebCore::FetchBody::formData):
324         * Modules/fetch/FetchBodyConsumer.cpp:
325         (WebCore::FetchBodyConsumer::resolveWithData):
326         (WebCore::FetchBodyConsumer::resolve):
327         * Modules/fetch/FetchBodyConsumer.h:
328         * Modules/fetch/FetchBodyOwner.cpp:
329         (WebCore::FetchBodyOwner::arrayBuffer):
330         (WebCore::FetchBodyOwner::blob):
331         (WebCore::FetchBodyOwner::formData):
332         (WebCore::FetchBodyOwner::json):
333         (WebCore::FetchBodyOwner::text):
334         * Modules/fetch/FetchBodyOwner.h:
335         * Modules/fetch/FetchResponse.cpp:
336         (WebCore::FetchResponse::consume):
337         (WebCore::FetchResponse::finishConsumingStream):
338         * Modules/fetch/FetchResponse.h:
339         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
340         (WebCore::WorkerGlobalScopeFetch::fetch):
341         * Modules/fetch/WorkerGlobalScopeFetch.h:
342         * bindings/js/JSCustomElementRegistryCustom.cpp:
343         (WebCore::whenDefinedPromise):
344         (WebCore::JSCustomElementRegistry::whenDefined):
345         * bindings/js/JSDOMGlobalObject.cpp:
346         (WebCore::JSDOMGlobalObject::visitChildren):
347         * bindings/js/JSDOMGlobalObject.h:
348         * bindings/js/JSDOMPromise.cpp:
349         (WebCore::DOMDeferredPromise::DOMDeferredPromise):
350         (WebCore::DOMDeferredPromise::~DOMDeferredPromise):
351         (WebCore::DOMDeferredPromise::clear):
352         (WebCore::DOMDeferredPromise::contextDestroyed):
353         (WebCore::DOMDeferredPromise::promise):
354         (WebCore::DOMDeferredPromise::callFunction):
355         (WebCore::DOMDeferredPromise::reject):
356         (WebCore::rejectPromiseWithExceptionIfAny):
357         (WebCore::fulfillPromiseWithJSON):
358         (WebCore::fulfillPromiseWithArrayBuffer):
359         (WebCore::DeferredWrapper::DeferredWrapper): Deleted.
360         (WebCore::DeferredWrapper::~DeferredWrapper): Deleted.
361         (WebCore::DeferredWrapper::clear): Deleted.
362         (WebCore::DeferredWrapper::contextDestroyed): Deleted.
363         (WebCore::DeferredWrapper::promise): Deleted.
364         (WebCore::DeferredWrapper::callFunction): Deleted.
365         (WebCore::DeferredWrapper::reject): Deleted.
366         * bindings/js/JSDOMPromise.h:
367         (WebCore::DOMDeferredPromise::create):
368         (WebCore::callPromiseFunction):
369         (WebCore::DOMPromise::DOMPromise):
370         (WebCore::DOMPromise::deferredPromise):
371         (WebCore::DOMDeferredPromise::resolveWithValue):
372         (WebCore::DOMDeferredPromise::resolveWithNewlyCreated):
373         (WebCore::DOMDeferredPromise::rejectWithValue):
374         (WebCore::DOMDeferredPromise::resolve):
375         (WebCore::DOMDeferredPromise::reject):
376         (WebCore::DeferredWrapper::create): Deleted.
377         (WebCore::DOMPromise::deferredWrapper): Deleted.
378         (WebCore::DeferredWrapper::resolveWithValue): Deleted.
379         (WebCore::DeferredWrapper::resolveWithNewlyCreated): Deleted.
380         (WebCore::DeferredWrapper::rejectWithValue): Deleted.
381         (WebCore::DeferredWrapper::resolve): Deleted.
382         (WebCore::DeferredWrapper::reject): Deleted.
383         * bindings/js/JSDOMWrapper.cpp: Introducing domWindow() accessor.
384         * bindings/js/JSDOMWrapper.h:
385         * bindings/js/JSFontFaceCustom.cpp:
386         (WebCore::JSFontFace::loaded):
387         * bindings/js/JSFontFaceSetCustom.cpp:
388         (WebCore::JSFontFaceSet::ready):
389         * bindings/js/JSMediaDevicesCustom.cpp:
390         (WebCore::JSMediaDevices::getUserMedia):
391         * bindings/js/JSMediaStreamTrackCustom.cpp:
392         (WebCore::JSMediaStreamTrack::applyConstraints):
393         * bindings/js/JSReadableStreamSourceCustom.cpp:
394         (WebCore::JSReadableStreamSource::start):
395         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
396         (WebCore::JSWebKitSubtleCrypto::encrypt):
397         (WebCore::JSWebKitSubtleCrypto::decrypt):
398         (WebCore::JSWebKitSubtleCrypto::sign):
399         (WebCore::JSWebKitSubtleCrypto::verify):
400         (WebCore::JSWebKitSubtleCrypto::digest):
401         (WebCore::JSWebKitSubtleCrypto::generateKey):
402         (WebCore::JSWebKitSubtleCrypto::importKey):
403         (WebCore::JSWebKitSubtleCrypto::exportKey):
404         (WebCore::JSWebKitSubtleCrypto::wrapKey):
405         (WebCore::JSWebKitSubtleCrypto::unwrapKey):
406         * bindings/scripts/CodeGeneratorJS.pm:
407         (GenerateImplementation):
408         (GenerateReturnParameters):
409         * bindings/scripts/test/JS/JSTestObj.cpp:
410         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
411         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
412         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
413         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
414         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
415         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
416         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
417         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
418         * dom/CustomElementRegistry.h:
419         (WebCore::CustomElementRegistry::promiseMap):
420
421 2016-09-21  Alexey Proskuryakov  <ap@apple.com>
422
423         Rolling out r206244, as it caused flaky crashes on tests.
424         Was: Correct uses of 'safeCast'
425
426         * loader/cache/MemoryCache.cpp:
427         (WebCore::MemoryCache::adjustSize):
428         * platform/graphics/BitmapImage.cpp:
429         (WebCore::BitmapImage::destroyMetadataAndNotify):
430         (WebCore::BitmapImage::cacheFrame):
431         (WebCore::BitmapImage::didDecodeProperties):
432         (WebCore::BitmapImage::dataChanged):
433         (WebCore::BitmapImage::frameImageAtIndex):
434         * platform/graphics/cg/PDFDocumentImage.cpp:
435         (WebCore::PDFDocumentImage::decodedSizeChanged):
436         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
437
438 2016-09-21  Chris Dumez  <cdumez@apple.com>
439
440         Fix serialization of bgsound, keygen and track elements
441         https://bugs.webkit.org/show_bug.cgi?id=162353
442
443         Reviewed by Darin Adler.
444
445         Fix serialization of keygen and track elements to match the specification:
446         - https://html.spec.whatwg.org/#serialising-html-fragments
447
448         They are not supposed to have an end tag. Firefox and Chrome agree with
449         the specification.
450
451         No new tests, rebaselined existing tests.
452
453         * editing/MarkupAccumulator.cpp:
454         (WebCore::MarkupAccumulator::elementCannotHaveEndTag):
455
456 2016-09-21  Keith Miller  <keith_miller@apple.com>
457
458         Fix build for future versions of Clang.
459         https://bugs.webkit.org/show_bug.cgi?id=162346
460
461         Reviewed by Filip Pizlo.
462
463         This fixes issues with the WebCore build where inline
464         template-class function definitions are marked as exported. This
465         genereates a weak external symobl that our build does not like.
466
467         * Configurations/WebCore.unexp:
468         * dom/Exception.h:
469         * page/Frame.h:
470         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
471         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
472         (WebCore::WebVideoFullscreenModelVideoElement::videoElement):
473         * platform/graphics/Color.h:
474         * platform/graphics/transforms/TransformationMatrix.h:
475         (WebCore::TransformationMatrix::rotate):
476         * platform/mac/WebVideoFullscreenInterfaceMac.h:
477         * platform/network/ParsedContentRange.h:
478         (WebCore::ParsedContentRange::ParsedContentRange):
479         (WebCore::ParsedContentRange::isValid):
480         * platform/network/ResourceResponseBase.h:
481         (WebCore::ResourceResponseBase::certificateInfo):
482         * platform/text/TextStream.h:
483         (WebCore::TextStream::increaseIndent):
484         (WebCore::TextStream::decreaseIndent):
485
486 2016-09-20  Brent Fulgham  <bfulgham@apple.com>
487
488         Correct uses of 'safeCast'
489         https://bugs.webkit.org/show_bug.cgi?id=162301
490         <rdar://problem/28343658>
491
492         Reviewed by Antti Koivisto.
493
494         A number of integer calculations in BitmapImage and PDFDocumentImage
495         are not properly checked for overflow. Correct this.
496
497         Tested by fast/images/large-size-image-crash.html
498
499         * loader/cache/MemoryCache.cpp:
500         (WebCore::MemoryCache::adjustSize): RELEASE_ASSERT on overflow.
501         * platform/graphics/BitmapImage.cpp:
502         (WebCore::BitmapImage::destroyMetadataAndNotify):
503         (WebCore::BitmapImage::cacheFrame):
504         (WebCore::BitmapImage::didDecodeProperties):
505         (WebCore::BitmapImage::dataChanged):
506         (WebCore::BitmapImage::ensureFrameAtIndexIsCached):
507         (WebCore::BitmapImage::frameImageAtIndex):
508         * platform/graphics/BitmapImage.h:
509         * platform/graphics/cg/PDFDocumentImage.cpp:
510         (WebCore::PDFDocumentImage::decodedSizeChanged):
511         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
512
513 2016-09-21  Chris Dumez  <cdumez@apple.com>
514
515         Setting HTMLMeterElement's attributes to non-finite values throws wrong exception type
516         https://bugs.webkit.org/show_bug.cgi?id=162364
517
518         Reviewed by Darin Adler.
519
520         Setting HTMLMeterElement's attributes to non-finite values throws wrong exception type.
521         It should throw a TypeError because their type is 'double' but we throw a
522         NOT_SUPPORTED_ERR.
523
524         Specification:
525         - https://html.spec.whatwg.org/#htmlmeterelement
526
527         Firefox and Chrome agree with the specification.
528
529         No new tests, updated existing test.
530
531         * html/HTMLMeterElement.cpp:
532         (WebCore::HTMLMeterElement::setMin):
533         (WebCore::HTMLMeterElement::setMax):
534         (WebCore::HTMLMeterElement::setValue):
535         (WebCore::HTMLMeterElement::setLow):
536         (WebCore::HTMLMeterElement::setHigh):
537         (WebCore::HTMLMeterElement::setOptimum):
538         * html/HTMLMeterElement.h:
539         * html/HTMLMeterElement.idl:
540
541 2016-09-21  Anders Carlsson  <andersca@apple.com>
542
543         Fix open source build.
544
545         * platform/spi/cocoa/PassKitSPI.h:
546
547 2016-09-21  Chris Dumez  <cdumez@apple.com>
548
549         Fix serialization of HTML Element attributes
550         https://bugs.webkit.org/show_bug.cgi?id=162356
551
552         Reviewed by Alex Christensen.
553
554         Fix serialization of HTML Element attributes to align with:
555         - https://html.spec.whatwg.org/#html-fragment-serialisation-algorithm
556         - https://html.spec.whatwg.org/#escapingString
557
558         In particular, we should not escape '<' and '>'.
559
560         Firefox and Chrome both match the specification.
561
562         Note that we keep escaping '<' and '>' for Element attributes in the
563         context of XML serialization, as per:
564         - https://w3c.github.io/DOM-Parsing/#dfn-serializing-an-attribute-value
565
566         No new tests, rebaselined existing test.
567
568         * editing/MarkupAccumulator.h:
569
570 2016-09-21  Anders Carlsson  <andersca@apple.com>
571
572         support openPaymentSetup API on ApplePaySession object
573         https://bugs.webkit.org/show_bug.cgi?id=162357
574         rdar://problem/26776939
575
576         Reviewed by Tim Horton.
577
578         * Modules/applepay/ApplePaySession.cpp:
579         (WebCore::ApplePaySession::openPaymentSetup):
580         Perform security checks and then call into the PaymentCoordinator. In its completion handler, we resolve the promise.
581
582         * Modules/applepay/ApplePaySession.h:
583         Add new members.
584
585         * Modules/applepay/ApplePaySession.idl:
586         Add openPaymentSetup declaration.
587
588         * Modules/applepay/PaymentCoordinator.cpp:
589         (WebCore::PaymentCoordinator::openPaymentSetup):
590         Call through to the clients.
591
592         * Modules/applepay/PaymentCoordinator.h:
593         * Modules/applepay/PaymentCoordinatorClient.h:
594         Add new members.
595
596         * loader/EmptyClients.cpp:
597         Add new stub.
598
599         * platform/spi/cocoa/PassKitSPI.h:
600         Add SPI declaration.
601
602 2016-09-21  Commit Queue  <commit-queue@webkit.org>
603
604         Unreviewed, rolling out r206222 and r206227.
605         https://bugs.webkit.org/show_bug.cgi?id=162361
606
607         "broke the windows build" (Requested by keith_mi_ on #webkit).
608
609         Reverted changesets:
610
611         "Fix build for future versions of Clang."
612         https://bugs.webkit.org/show_bug.cgi?id=162346
613         http://trac.webkit.org/changeset/206222
614
615         "Attempt to fix windows build after r206222."
616         http://trac.webkit.org/changeset/206227
617
618 2016-09-21  Alex Christensen  <achristensen@webkit.org>
619
620         URLParser should match URL::parse when parsing data urls with slashes in them
621         https://bugs.webkit.org/show_bug.cgi?id=162352
622
623         Reviewed by Darin Adler.
624
625         Covered by new API tests.
626
627         * platform/URLParser.cpp:
628         (WebCore::URLParser::parse):
629
630 2016-09-21  Per Arne Vollan  <pvollan@apple.com>
631
632         [Win] Null pointer crash under WebCore::CACFLayerTreeHost::create().
633         https://bugs.webkit.org/show_bug.cgi?id=162266
634         <rdar://problem/28345073>
635
636         Reviewed by Brent Fulgham.
637
638         Add null pointer check.
639
640         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
641         (WebCore::CACFLayerTreeHost::create):
642
643 2016-09-21  Chris Dumez  <cdumez@apple.com>
644
645         Fix enumeration of properties cross origin
646         https://bugs.webkit.org/show_bug.cgi?id=162328
647
648         Reviewed by Darin Adler.
649
650         All cross origin properties for Window / Location are supposed to be not enumerable:
651         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
652
653         Therefore, there should be no properties to iterate on for cross origin Window /
654         Location objects.
655
656         No new tests, rebaselined existing test.
657
658         * bindings/js/JSDOMWindowCustom.cpp:
659         (WebCore::JSDOMWindow::getOwnPropertyNames):
660         * bindings/js/JSLocationCustom.cpp:
661         (WebCore::JSLocation::getOwnPropertyNames):
662
663 2016-09-21  Alex Christensen  <achristensen@webkit.org>
664
665         URLParser should fail when parsing invalid relative URLs with no schemes
666         https://bugs.webkit.org/show_bug.cgi?id=162355
667
668         Reviewed by Tim Horton.
669
670         Covered by new API tests.
671
672         * platform/URLParser.cpp:
673         (WebCore::copyASCIIStringUntil):
674         When copying from a null String, is8Bit dereferences a null pointer.  We don't want to do that.
675         (WebCore::URLParser::parse):
676         What the spec calls a "null" URL matches !url.isValid(), not url.isNull().
677         The former reflects whether the parsing succeeded, 
678         the latter whether the contained String (which could be an invalid URL) is null.
679
680 2016-09-21  Antti Koivisto  <antti@apple.com>
681
682         Document::styleResolverChanged simplification
683         https://bugs.webkit.org/show_bug.cgi?id=162347
684
685         Reviewed by Anders Carlsson.
686
687         * dom/Document.cpp:
688         (WebCore::Document::implicitClose):
689         (WebCore::Document::setParsing):
690         (WebCore::Document::write):
691         (WebCore::Document::styleResolverChanged):
692
693             - Remove unncessary AnimationUpdateBlock, it is created by recalcStyle.
694             - Remove explicit setNeedsLayoutAndPrefWidthsRecalc/scheduleRelayout calls, style resolution
695               invalidates those as needed.
696             - Remove evaluateMediaQueryList call, that is done on layout as needed.
697             - Remove the ancient INSTRUMENT_LAYOUT_SCHEDULING and the related printfs.
698
699 2016-09-21  Keith Miller  <keith_miller@apple.com>
700
701         Attempt to fix windows build after r206222.
702
703         * page/MainFrame.h:
704         (WebCore::Frame::isMainFrame):
705
706 2016-09-21  Keith Rollin  <krollin@apple.com>
707
708         New DocumentLoader logging causes crashes
709         https://bugs.webkit.org/show_bug.cgi?id=162348
710         <rdar://problem/28404744>
711
712         Reviewed by Chris Dumez
713
714         Check for NULL m_frame before using it.
715
716         No new tests -- no tests for logging, though this issue was found by
717         contentfiltering/block-after-will-send-request-then-allow-unblock.html
718
719         * loader/DocumentLoader.cpp:
720         (WebCore::DocumentLoader::startLoadingMainResource):
721
722 2016-09-21  Alex Christensen  <achristensen@webkit.org>
723
724         Optimize URLParser
725         https://bugs.webkit.org/show_bug.cgi?id=162338
726
727         Reviewed by Tim Horton.
728
729         No change in behavior. Just a marginal performance improvement.
730
731         * platform/URLParser.cpp:
732         (WebCore::isValidSchemeCharacter):
733         Added to reduce branches when parsing the scheme of a URL.  Now there is a table lookup instead of many range checks.
734         (WebCore::URLParser::parse):
735         Use appendVector, which uses memcpy.
736         (WebCore::URLParser::parseHostAndPort):
737         If we know that we are parsing the serialized output of a valid URL, 
738         we do not need to convert host characters to lower case.
739         They are already lower case.
740
741 2016-09-21  Keith Miller  <keith_miller@apple.com>
742
743         Fix build for future versions of Clang.
744         https://bugs.webkit.org/show_bug.cgi?id=162346
745
746         Reviewed by Filip Pizlo.
747
748         This fixes issues with the WebCore build where inline
749         template-class function definitions are marked as exported. This
750         genereates a weak external symobl that our build does not like.
751
752         * Configurations/WebCore.unexp:
753         * dom/Exception.h:
754         * page/Frame.h:
755         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
756         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
757         (WebCore::WebVideoFullscreenModelVideoElement::videoElement):
758         * platform/graphics/Color.h:
759         * platform/graphics/transforms/TransformationMatrix.h:
760         (WebCore::TransformationMatrix::rotate):
761         * platform/mac/WebVideoFullscreenInterfaceMac.h:
762         * platform/network/ParsedContentRange.h:
763         (WebCore::ParsedContentRange::ParsedContentRange):
764         (WebCore::ParsedContentRange::isValid):
765         * platform/network/ResourceResponseBase.h:
766         (WebCore::ResourceResponseBase::certificateInfo):
767         * platform/text/TextStream.h:
768         (WebCore::TextStream::increaseIndent):
769         (WebCore::TextStream::decreaseIndent):
770
771 2016-09-21  Chris Dumez  <cdumez@apple.com>
772
773         Object.getOwnPropertyDescriptor() does not work correctly cross origin
774         https://bugs.webkit.org/show_bug.cgi?id=162311
775
776         Reviewed by Gavin Barraclough.
777
778         Object.getOwnPropertyDescriptor() does not work correctly cross origin. In particular:
779         - We return value descriptors for attributes instead of getter/setter descriptors
780         - attributes / operations are wrongly marked as non-configurable
781
782         Corresponding specification:
783         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
784         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
785
786         Test: http/tests/security/cross-origin-descriptors.html
787
788         * bindings/js/JSDOMWindowCustom.cpp:
789         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
790         * bindings/js/JSLocationCustom.cpp:
791         (WebCore::JSLocation::getOwnPropertySlotDelegate):
792
793 2016-09-21  Alex Christensen  <achristensen@webkit.org>
794
795         URLParser: Correctly parse URLs that are just nonspecialscheme:/
796         https://bugs.webkit.org/show_bug.cgi?id=162340
797
798         Reviewed by Tim Horton.
799
800         Covered by new API tests.
801
802         * platform/URLParser.cpp:
803         (WebCore::URLParser::parse):
804         r206162 wasn't quite right.  If a url is just nonspecialscheme:/ then the path should indeed be /
805
806 2016-09-21  Alex Christensen  <achristensen@webkit.org>
807
808         URLParser: correctly parse relative URLs that are just one character
809         https://bugs.webkit.org/show_bug.cgi?id=162344
810
811         Reviewed by Tim Horton.
812
813         Covered by new API tests.
814
815         * platform/URLParser.cpp:
816         (WebCore::URLParser::parse):
817
818 2016-09-21  Daniel Bates  <dabates@apple.com>
819
820         REGRESSION (r201090): Setting style.webkitTextSizeAdjust does not change text change on iPad
821         https://bugs.webkit.org/show_bug.cgi?id=162227
822         <rdar://problem/27201529>
823
824         Reviewed by Simon Fraser.
825
826         The CSS property -webkit-text-size-adjust should be respected on all iOS devices. Following
827         r201090 we respect it only on iPhone and in iPhone-apps run on iPad.
828
829         Tests: fast/text-autosizing/ios/ipad/programmatic-text-size-adjust.html
830                fast/text-autosizing/ios/ipad/text-size-adjust-inline-style.html
831                fast/text-autosizing/ios/programmatic-text-size-adjust.html
832                fast/text-autosizing/ios/text-size-adjust-inline-style.html
833                fast/text-autosizing/text-size-adjust-inline-style.html
834
835         * css/parser/CSSParser.cpp:
836         (WebCore::isValidKeywordPropertyAndValue): Remove unused code to validate -webkit-text-size-adjust.
837         This code is never used because -webkit-text-size-adjust is a value property (since it accepts a
838         <percentage> as a value and CSSParserFastPaths::isKeywordPropertyID(CSSPropertyWebkitTextSizeAdjust)
839         returns false). That is, it is not a keyword property.
840         (WebCore::CSSParser::parseValue): Always enable the -webkit-text-size-adjust CSS property when
841         building for iOS regardless of whether Settings:textAutosizingEnabled() is enabled.
842
843 2016-09-21  Miguel Gomez  <magomez@igalia.com>
844
845         [GTK] Build fails with GSTREAMER_GL enabled
846         https://bugs.webkit.org/show_bug.cgi?id=162337
847
848         Reviewed by Michael Catanzaro.
849
850         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
851         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Remove uneeded const.
852
853 2016-09-21  Jer Noble  <jer.noble@apple.com>
854
855         REGRESSION(r206127): ASSERTION FAILED: !isClosed() in WebCore::MediaSource::detachFromElement
856         https://bugs.webkit.org/show_bug.cgi?id=162307
857
858         Reviewed by Eric Carlson.
859
860         The test is crashing when the ScriptExecutionContext is calling stop() on the media element before
861         it's attached MediaSource has been open()ed, which is a valid state. Removing this ASSERT().
862
863         * Modules/mediasource/MediaSource.cpp:
864         (WebCore::MediaSource::detachFromElement):
865
866 2016-09-19  Jer Noble  <jer.noble@apple.com>
867
868         [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-activesourcebuffers.html
869         https://bugs.webkit.org/show_bug.cgi?id=162257
870
871         Reviewed by Eric Carlson.
872
873         Some of the conditions in the track changed methods were reversed, and all failed to schedule
874         a change event.
875
876         * Modules/mediasource/SourceBuffer.cpp:
877         (WebCore::SourceBuffer::videoTrackSelectedChanged):
878         (WebCore::SourceBuffer::audioTrackEnabledChanged):
879         (WebCore::SourceBuffer::textTrackModeChanged):
880
881 2016-09-20  Jer Noble  <jer.noble@apple.com>
882
883         [media-source] Fix imported/w3c/web-platform-tests/media-source/URL-createObjectURL-null.html
884         https://bugs.webkit.org/show_bug.cgi?id=162299
885
886         Reviewed by Eric Carlson.
887
888         URL.createObjectURL() should not take an optional parameter (nor return an optional String). 
889         (Ref: https://w3c.github.io/FileAPI/#dfn-createObjectURL)
890
891         * Modules/mediasource/DOMURLMediaSource.cpp:
892         (WebCore::DOMURLMediaSource::createObjectURL):
893         * Modules/mediasource/DOMURLMediaSource.h:
894         * Modules/mediasource/DOMURLMediaSource.idl:
895         * Modules/mediasource/MediaSourceRegistry.cpp:
896         (WebCore::MediaSourceRegistry::registerURL):
897         * Modules/mediasource/MediaSourceRegistry.h:
898         * Modules/mediastream/DOMURLMediaStream.cpp:
899         (WebCore::DOMURLMediaStream::createObjectURL):
900         * Modules/mediastream/DOMURLMediaStream.h:
901         * Modules/mediastream/DOMURLMediaStream.idl:
902         * Modules/mediastream/MediaStreamRegistry.cpp:
903         (WebCore::MediaStreamRegistry::registerURL):
904         * Modules/mediastream/MediaStreamRegistry.h:
905         * fileapi/Blob.cpp:
906         (WebCore::BlobURLRegistry::registerURL):
907         * html/DOMURL.cpp:
908         (WebCore::DOMURL::createObjectURL):
909         (WebCore::DOMURL::createPublicURL):
910         * html/DOMURL.h:
911         * html/DOMURL.idl:
912         * html/HTMLMediaElement.cpp:
913         (WebCore::HTMLMediaElement::setSrcObject):
914         * html/PublicURLManager.cpp:
915         (WebCore::PublicURLManager::registerURL):
916         * html/PublicURLManager.h:
917         * html/URLRegistry.h:
918
919 2016-09-21  Youenn Fablet  <youenn@apple.com>
920
921         [Fetch] Align Accept header default values with fetch spec
922         https://bugs.webkit.org/show_bug.cgi?id=162260
923
924         Reviewed by Sam Weinig.
925
926         Covered by existing and updated tests.
927
928         To start implementing step 1 to 7 of fetch algorithm, this patch updates Accept header handling.
929
930         Default values are set according the spec based on resource type.
931         Some resource types are not defined in the spec and we keep using existing values.
932
933         We check if Accept header is already present in the request. If that is the case, no change is done to that header.
934
935         If the Accept header is not set, the default value '*/*' is used.
936         An Accept header is therefore always set at CachedResourceLoader level.
937
938         * loader/cache/CachedCSSStyleSheet.cpp:
939         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet): Removing accept initialization.
940         * loader/cache/CachedResource.cpp:
941         (WebCore::CachedResource::load): Removing accept header setting.
942         * loader/cache/CachedResource.h:
943         (WebCore::CachedResource::accept): Deleted.
944         (WebCore::CachedResource::setAccept): Deleted.
945         * loader/cache/CachedResourceLoader.cpp:
946         (WebCore::acceptHeaderValueFromType): helper routine merging fetch spec and existing WebKit accept values.
947         (WebCore::CachedResourceLoader::prepareFetch): Should implement step 1 to 7 of https://fetch.spec.whatwg.org/#fetching.
948         (WebCore::CachedResourceLoader::requestResource): Making use of prepareFetch.
949         * loader/cache/CachedResourceLoader.h:
950         * loader/cache/CachedSVGDocument.cpp:
951         (WebCore::CachedSVGDocument::CachedSVGDocument): Removing accept initialization.
952         * loader/cache/CachedScript.cpp:
953         (WebCore::CachedScript::CachedScript): Removing accept initialization.
954         * loader/cache/CachedXSLStyleSheet.cpp:
955         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet): Removing accept initialization.
956         * platform/network/ResourceRequestBase.cpp:
957         (WebCore::ResourceRequestBase::hasHTTPHeader): Introduced to check for header presence.
958         * platform/network/ResourceRequestBase.h:
959
960 2016-09-21  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
961
962         [GTK] Fix build failure of ScrollbarThemeGtk with libc++
963         https://bugs.webkit.org/show_bug.cgi?id=162302
964
965         Reviewed by Carlos Garcia Campos.
966
967         * platform/gtk/ScrollbarThemeGtk.cpp:
968         (WebCore::ScrollbarThemeGtk::paint): Add missing #include <cstdlib>
969
970 2016-09-21  Philippe Normand  <pnormand@igalia.com>
971
972         [OpenWebRTC] Miscellaneous fixes
973         https://bugs.webkit.org/show_bug.cgi?id=162332
974
975         Reviewed by Alejandro G. Castro.
976
977         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
978         (WebCore::MediaPlayerPrivateGStreamerOwr::currentTime): Improved logging.
979         (WebCore::MediaPlayerPrivateGStreamerOwr::load): Ditto.
980         (WebCore::MediaPlayerPrivateGStreamerOwr::loadingFailed): Ditto.
981         (WebCore::MediaPlayerPrivateGStreamerOwr::createGSTAudioSinkBin):
982         Pre-roll the autoaudiosink, fetch the underlying platform audio
983         sink and pass it to the OpenWebRTC renderer.
984         (WebCore::MediaPlayerPrivateGStreamerOwr::maybeHandleChangeMutedState): Improved logging.
985         (WebCore::MediaPlayerPrivateGStreamerOwr::setSize): Don't configure invalid video renderer.
986         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
987         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Fix copy-paste error.
988
989 2016-09-21  Youenn Fablet  <youenn@apple.com>
990
991         Refactor CachedResourceLoader::canRequest
992         https://bugs.webkit.org/show_bug.cgi?id=162144
993
994         Reviewed by Darin Adler.
995
996         Covered by existing tests.
997
998         Simplifying CachedResourceLoader::canRequest by doing:
999         - CSP checks in another method
1000         - Removing Same-Origin type-specific checks by setting FetchOptions::Mode appropriately in resource loader clients
1001         - Moving script specific check in ScriptElement
1002
1003         Note that the last check may affect the loading behavior in the case scripts are enabled when starting the load
1004         of a script, but gets disabled before receiving a redirection for the script load.
1005
1006         * dom/ProcessingInstruction.cpp:
1007         (WebCore::ProcessingInstruction::checkStyleSheet): Setting XSLT stylesheet fetch mode to SameOrigin.
1008         * dom/ScriptElement.cpp:
1009         (WebCore::ScriptElement::requestScriptWithCache): Returning early if scripts are disabled.
1010         * loader/CrossOriginPreflightChecker.cpp:
1011         (WebCore::CrossOriginPreflightChecker::startPreflight): Bypassing CSP checks.
1012         * loader/DocumentLoader.cpp:
1013         (WebCore::DocumentLoader::startLoadingMainResource): Bypassing CSP checks as CachedResourceLoader was not
1014         checking them for MainResource.
1015         * loader/DocumentThreadableLoader.cpp:
1016         (WebCore::DocumentThreadableLoader::loadRequest): Ditto.
1017         * loader/LinkLoader.cpp:
1018         (WebCore::LinkLoader::preloadIfNeeded): Using new CachedResourceRequest constructor to enable moving the ResourceRequest.
1019         (WebCore::LinkLoader::loadLink): Skipping CSP checks for link prefetch/subresources as CachedResourceLoader was
1020         not checking them for Link Prefetch and Subresource types.
1021         * loader/cache/CachedResourceLoader.cpp:
1022         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy): Helper routine to check for CSP.
1023         (WebCore::CachedResourceLoader::canRequest): Making use of introduced helper routine.
1024         Simplified same origin check as all requests should have their options set.
1025         * loader/cache/CachedResourceLoader.h:
1026         * loader/cache/CachedResourceRequest.cpp:
1027         (WebCore::CachedResourceRequest::CachedResourceRequest): More efficient constructor.
1028         * loader/cache/CachedResourceRequest.h:
1029         * loader/cache/CachedSVGDocumentReference.cpp:
1030         (WebCore::CachedSVGDocumentReference::load): Setting fetch mode to SameOrigin.
1031         * svg/SVGUseElement.cpp:
1032         (WebCore::SVGUseElement::updateExternalDocument): Ditto.
1033         * xml/XSLImportRule.cpp:
1034         (WebCore::XSLImportRule::loadSheet): Ditto.
1035
1036 2016-09-21  Miguel Gomez  <magomez@igalia.com>
1037
1038         Build fails with GSTREAMER_GL when both desktop GL and GLES2 are enabled in gst-plugins-bad
1039         https://bugs.webkit.org/show_bug.cgi?id=159562
1040
1041         Reviewed by Philippe Normand.
1042
1043         Refactor video orientation code so including TextureMapperGL in MediaPlayerPrivateGStreamerBase.h
1044         is not necessary.
1045
1046         Covered by existent tests.
1047
1048         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1049         (WebCore::texMapFlagFromOrientation):
1050         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
1051         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
1052         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
1053         (WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation):
1054         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1055
1056 2016-09-21  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
1057
1058         [GTK] Fix build failure in clipboard support
1059         https://bugs.webkit.org/show_bug.cgi?id=162261
1060
1061         Reviewed by Carlos Garcia Campos.
1062
1063         * platform/PlatformPasteboard.h: Add missing #include <functional>
1064         * platform/gtk/PasteboardHelper.h: Add missing #include <functional>
1065
1066 2016-09-20  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1067
1068         VariadicHelper::Result should not include constructor to initialize members
1069         https://bugs.webkit.org/show_bug.cgi?id=162298
1070
1071         Reviewed by Darin Adler.
1072
1073         Remove the constructor since member-wise initialization does the same thing.
1074
1075         No new tests required.
1076
1077         * bindings/js/JSDOMBinding.h: Remove useless constructor.
1078
1079 2016-09-20  Alex Christensen  <achristensen@webkit.org>
1080
1081         Optimize URLParser
1082         https://bugs.webkit.org/show_bug.cgi?id=162105
1083
1084         Reviewed by Geoffrey Garen.
1085
1086         Covered by new API tests.
1087         This is about a 5% speedup on my URLParser benchmark.
1088
1089         * platform/URLParser.cpp:
1090         (WebCore::percentEncodeByte):
1091         (WebCore::utf8PercentEncode):
1092         (WebCore::utf8QueryEncode):
1093         (WebCore::encodeQuery):
1094         (WebCore::URLParser::parse):
1095         (WebCore::serializeURLEncodedForm):
1096         (WebCore::percentEncode): Deleted.
1097         (WebCore::utf8PercentEncodeQuery): Deleted.
1098
1099 2016-09-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1100
1101         [GTK] Clean up DataObjectGtk handling
1102         https://bugs.webkit.org/show_bug.cgi?id=162267
1103
1104         Reviewed by Michael Catanzaro.
1105
1106         * platform/Pasteboard.h: Use Ref instead of RefPtr for DataObjectGtk member.
1107         * platform/PasteboardStrategy.h: Pass a const reference to DataObjectGtk in write method and return a Ref from read.
1108         * platform/PlatformPasteboard.h: Ditto.
1109         * platform/gtk/DataObjectGtk.h:
1110         (WebCore::DataObjectGtk::image): Use Image instead of GdkPixbuf.
1111         (WebCore::DataObjectGtk::setImage):
1112         * platform/gtk/PasteboardGtk.cpp:
1113         (WebCore::Pasteboard::createForDragAndDrop): Use a reference instead of a pointer.
1114         (WebCore::Pasteboard::Pasteboard): Receives a reference, so we can also remove the ASSERT.
1115         (WebCore::Pasteboard::dataObject):
1116         (WebCore::Pasteboard::writeToClipboard): Remove the ShouldIncludeSmartPaste parameter, callers should also update
1117         canSmartPaste property of DataObjectGtk before calling this.
1118         (WebCore::Pasteboard::writePlainText):
1119         (WebCore::Pasteboard::write): Do not convert the image the GdkPixbuf, pass the image to the DataObjectGtk instead.
1120         * platform/gtk/PasteboardHelper.cpp:
1121         (WebCore::PasteboardHelper::fillSelectionData): Convert the DataObjectGtk image to GdkPixbuf right before
1122         passing it to gtk_selection_data_set_pixbuf().
1123         (WebCore::ClipboardSetData::ClipboardSetData): Use reference instead of pointer.
1124         (WebCore::getClipboardContentsCallback):
1125         (WebCore::clearClipboardContentsCallback): Never clear the saved DataObjectGtk, that was only needed when we had
1126         a global DataObjectGtk associated to a GtkClipboard.
1127         (WebCore::PasteboardHelper::writeClipboardContents): Use TemporaryChange to set the settingClipboardDataObject global.
1128         * platform/gtk/PlatformPasteboardGtk.cpp:
1129         (WebCore::PlatformPasteboard::writeToClipboard):
1130         (WebCore::PlatformPasteboard::readFromClipboard):
1131
1132 2016-09-20  Alex Christensen  <achristensen@webkit.org>
1133
1134         Require WTFMove for String::adopt
1135         https://bugs.webkit.org/show_bug.cgi?id=162313
1136
1137         Reviewed by Yusuke Suzuki.
1138
1139         No change in behavior.  This just makes it more clear what is going on when a String adopts a Vector.
1140
1141         * bindings/js/SerializedScriptValue.cpp:
1142         (WebCore::CloneDeserializer::readString):
1143         * css/parser/CSSParser.cpp:
1144         (WebCore::quoteCSSStringInternal):
1145         * dom/Document.cpp:
1146         (WebCore::canonicalizedTitle):
1147         * html/canvas/CanvasRenderingContext2D.cpp:
1148         (WebCore::normalizeSpaces):
1149         * html/parser/HTMLTreeBuilder.cpp:
1150         (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemainingWhitespace):
1151         * platform/Length.cpp:
1152         (WebCore::newCoordsArray):
1153         * platform/URLParser.cpp:
1154         (WebCore::URLParser::parse):
1155         (WebCore::URLParser::serialize):
1156         * platform/graphics/ca/GraphicsLayerCA.cpp:
1157         (WebCore::GraphicsLayerCA::ReplicaState::cloneID):
1158         * platform/text/TextCodecUTF16.cpp:
1159         (WebCore::TextCodecUTF16::decode):
1160         * platform/text/TextCodecUTF8.cpp:
1161         (WebCore::TextCodecUTF8::decode):
1162         * platform/text/mac/TextCodecMac.cpp:
1163         (WebCore::TextCodecMac::decode):
1164
1165 2016-09-20  Jer Noble  <jer.noble@apple.com>
1166
1167         Adopt MRMediaRemoteSetParentApplication.
1168         https://bugs.webkit.org/show_bug.cgi?id=162259
1169         <rdar://problem/28376161>
1170
1171         Reviewed by Anders Carlsson.
1172
1173         Allow MediaSessionManagerMac to retrieve the correct parent application identifier
1174         from a PlatformMediaSession so that it can pass that identifier through to MediaRemote
1175         via MRMediaRemoteSetParentApplication.
1176
1177         * Modules/webaudio/AudioContext.cpp:
1178         (WebCore::AudioContext::sourceApplicationIdentifier):
1179         * Modules/webaudio/AudioContext.h:
1180         * platform/audio/PlatformMediaSession.cpp:
1181         (WebCore::PlatformMediaSession::sourceApplicationIdentifier):
1182         * platform/audio/PlatformMediaSession.h:
1183         (WebCore::PlatformMediaSession::resetPlaybackSessionState): Deleted.
1184         * platform/audio/mac/MediaSessionManagerMac.mm:
1185         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
1186         * platform/mac/MediaRemoteSoftLink.cpp:
1187         * platform/mac/MediaRemoteSoftLink.h:
1188
1189
1190 2016-09-20  Nan Wang  <n_wang@apple.com>
1191
1192         AX: AppleVisUser: VO can't navigate web dialogs iOS10
1193         https://bugs.webkit.org/show_bug.cgi?id=162322
1194
1195         Reviewed by Chris Fleizach.
1196
1197         When using VoiceOver to navigate a web dialog's children, we were setting focus
1198         onto the focusable parent in accessibilityElementDidBecomeFocused. When the focusable
1199         parent is the dialog, it will cause the VO cursor jumping back and forward. Fixed it
1200         by not setting focus on web dialogs in such case.
1201
1202         Test: accessibility/ios-simulator/dialog-did-become-focused.html
1203
1204         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1205         (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):
1206
1207 2016-09-20  Keith Rollin  <krollin@apple.com>
1208
1209         Add new logging for network resource loading
1210         https://bugs.webkit.org/show_bug.cgi?id=162237
1211
1212         Reviewed by Antti Koivisto.
1213
1214         Add new logging along the non-main path for resource loading. This
1215         logging should allow us to differentiate between lack-of-logging due
1216         execution along a path that doesn't have logging statements and
1217         lack-of-logging due to a hung process.
1218
1219         No new tests -- there are no tests for logging.
1220
1221         * loader/DocumentLoader.cpp:
1222         (WebCore::DocumentLoader::startLoadingMainResource):
1223         (WebCore::DocumentLoader::isAlwaysOnLoggingAllowed):
1224         * loader/DocumentLoader.h:
1225         * loader/FrameLoader.cpp:
1226         (WebCore::FrameLoader::continueLoadAfterWillSubmitForm):
1227         * loader/cache/CachedResource.cpp:
1228         (WebCore::CachedResource::load):
1229         * loader/cache/CachedResourceLoader.cpp:
1230         (WebCore::CachedResourceLoader::requestResource):
1231         (WebCore::CachedResourceLoader::isAlwaysOnLoggingAllowed):
1232         * loader/cache/CachedResourceLoader.h:
1233         * page/Frame.h:
1234
1235 2016-09-20  Zalan Bujtas  <zalan@apple.com>
1236
1237         REGRESSION (r204552): Athlete search on Strava gives bad rendering.
1238         https://bugs.webkit.org/show_bug.cgi?id=162250
1239
1240         Reviewed by Simon Fraser.
1241
1242         Test: fast/layers/blank-content-when-child-layer-is-at-negative-big-number.html
1243
1244         * platform/graphics/LayoutRect.cpp:
1245         (WebCore::LayoutRect::checkedUnite):
1246         * platform/graphics/LayoutRect.h:
1247         (WebCore::LayoutRect::isMaxXMaxYRepresentable):
1248         (WebCore::LayoutRect::maxXMaxYCorner): Deleted.
1249         * rendering/RenderLayer.cpp:
1250         (WebCore::RenderLayer::calculateClipRects):
1251
1252 2016-09-20  Jer Noble  <jer.noble@apple.com>
1253
1254         [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-appendwindow.html
1255         https://bugs.webkit.org/show_bug.cgi?id=162306
1256
1257         Reviewed by Darin Adler.
1258
1259         appendWindowStart should be a restricted double, and both it and appendWindowEnd should throw
1260         TypeError exceptions when setting them to disallowed values.
1261
1262         * Modules/mediasource/SourceBuffer.cpp:
1263         (WebCore::SourceBuffer::setAppendWindowStart):
1264         (WebCore::SourceBuffer::setAppendWindowEnd):
1265         * Modules/mediasource/SourceBuffer.idl:
1266
1267 2016-09-20  Jer Noble  <jer.noble@apple.com>
1268
1269         [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-preload.html
1270         https://bugs.webkit.org/show_bug.cgi?id=162304
1271
1272         Reviewed by Darin Adler.
1273
1274         If an error occurs while loading a URL on behalf of MediaPlayerPrivateAVFObjC, make sure to signal
1275         that error to AVFoundation, so that the HTMLMediaElement is notified of the error.
1276
1277         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1278         (WebCore::WebCoreAVFResourceLoader::notifyFinished):
1279
1280 2016-09-20  Anders Carlsson  <andersca@apple.com>
1281
1282         Remove "in-store" from "-apple-pay-button-type"
1283         https://bugs.webkit.org/show_bug.cgi?id=162321
1284         rdar://problem/28394581
1285
1286         Reviewed by Beth Dakin.
1287
1288         * css/CSSPrimitiveValueMappings.h:
1289         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1290         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
1291         * css/CSSValueKeywords.in:
1292         * css/parser/CSSParser.cpp:
1293         (WebCore::isValidKeywordPropertyAndValue):
1294         * css/parser/CSSParserFastPaths.cpp:
1295         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1296         * rendering/RenderThemeCocoa.mm:
1297         (WebCore::toPKPaymentButtonType):
1298         * rendering/style/RenderStyleConstants.h:
1299
1300 2016-09-20  Alex Christensen  <achristensen@webkit.org>
1301
1302         Fix occasional using uninitialized memory crashes after r206168.
1303         https://bugs.webkit.org/show_bug.cgi?id=162247
1304
1305         This fixes a crash in imported/w3c/web-platform-tests/url/urlsearchparams-constructor.html
1306         I could reproduce about 10% of the time.
1307
1308         * html/URLSearchParams.h:
1309         Initialize the pointer to nullptr.
1310
1311 2016-09-20  Alex Christensen  <achristensen@webkit.org>
1312
1313         Reduce allocations in URLParser
1314         https://bugs.webkit.org/show_bug.cgi?id=162241
1315
1316         Reviewed by Chris Dumez.
1317
1318         Use Vectors instead of StringBuilders.  This allows us to use the inline capacity on the stack
1319         for short URLs (<2KB) and also allows us to skip branches because we know whether the
1320         contained type is UChar or LChar at compile time.  It also allows us to use uncheckedAppend.
1321
1322         Added new API tests for parts that were less tested, but there is
1323         no change in behavior except for a performance improvement.
1324
1325         * platform/URLParser.cpp:
1326         (WebCore::appendCodePoint):
1327         (WebCore::encodeQuery):
1328         (WebCore::URLParser::failure):
1329         (WebCore::URLParser::parse):
1330         (WebCore::percentDecode):
1331         (WebCore::domainToASCII):
1332         (WebCore::hasInvalidDomainCharacter):
1333         (WebCore::URLParser::parseHost):
1334         (WebCore::formURLDecode):
1335         (WebCore::isC0Control): Deleted.
1336         * platform/URLParser.h:
1337
1338 2016-09-20  Nan Wang  <n_wang@apple.com>
1339
1340         AX: voiceover does not read contents of input role="spinbutton"
1341         https://bugs.webkit.org/show_bug.cgi?id=162137
1342
1343         Reviewed by Chris Fleizach.
1344
1345         The aria-valuenow attribute value on the spinbutton is not exposed
1346         on iOS. We should expose aria-valuenow attribute for range controls
1347         based on https://www.w3.org/TR/wai-aria/states_and_properties#aria-valuenow
1348
1349         Changes are covered in the modified test.
1350
1351         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1352         (-[WebAccessibilityObjectWrapper accessibilityValue]):
1353
1354 2016-09-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1355
1356         URLParser: uidna_IDNToASCII_56 is deprecated
1357         https://bugs.webkit.org/show_bug.cgi?id=161841
1358
1359         Reviewed by Alex Christensen.
1360
1361         Add pragmas to silence the warning, plus a FIXME.
1362
1363         * platform/URLParser.cpp:
1364         (WebCore::domainToASCII):
1365
1366 2016-09-20  Alex Christensen  <achristensen@webkit.org>
1367
1368         Make URLSearchParams spec-compliant
1369         https://bugs.webkit.org/show_bug.cgi?id=162247
1370
1371         Reviewed by Chris Dumez and Sam Weinig.
1372
1373         Covered by newly-passing web platform tests.
1374
1375         * html/DOMURL.cpp:
1376         (WebCore::DOMURL::~DOMURL):
1377         (WebCore::DOMURL::setHref):
1378         (WebCore::DOMURL::setQuery):
1379         Update any associated URLSearchParams object when the query could change.
1380         (WebCore::DOMURL::searchParams):
1381         The lifetime of the URLSearchParams was wrong.  We were creating a new URLSearchParams each time
1382         URL.searchParams was called, and we should have been creating one the first time and returning the
1383         same instance for subsequent calls.  This means the DOMURL must own the URLSearchParams if it is associated,
1384         but if it is not associated, then a URLSearchParams can live on its own.
1385         * html/DOMURL.h:
1386         * html/URLSearchParams.h:
1387         (WebCore::URLSearchParams::URLDestroyed):
1388         (WebCore::URLSearchParams::setContents):
1389
1390 2016-09-20  Antti Koivisto  <antti@apple.com>
1391
1392         Remove AuthorStyleSheets::m_hadActiveLoadingStylesheet bit
1393         https://bugs.webkit.org/show_bug.cgi?id=162312
1394
1395         Reviewed by Chris Dumez.
1396
1397         * dom/AuthorStyleSheets.cpp:
1398         (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
1399
1400             We can handle loading sheets with the normal stylesheet change logic. Remove the special case.
1401
1402         (WebCore::filterEnabledNonemptyCSSStyleSheets):
1403
1404             Filter out loading stylesheets.
1405
1406         * dom/AuthorStyleSheets.h:
1407
1408 2016-09-20  Keith Rollin  <krollin@apple.com>
1409
1410         Adjust current networking logging
1411         https://bugs.webkit.org/show_bug.cgi?id=162235
1412
1413         Reviewed by Antti Koivisto.
1414
1415         Update the "always on" network logging in order to better track the
1416         loading of a particular resource and to better bind together the
1417         resources downloaded for a particular page and frame. Do this by
1418         consistently logging pageID, frameID, and resourceID.
1419
1420         No new tests -- there are no tests for logging.
1421
1422         * loader/FrameLoader.cpp:
1423         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1424         * loader/ResourceLoader.h:
1425         (WebCore::ResourceLoader::frame):
1426
1427 2016-09-20  Alex Christensen  <achristensen@webkit.org>
1428
1429         Non-special URLs should have an opaque origin
1430         https://bugs.webkit.org/show_bug.cgi?id=162254
1431
1432         Reviewed by Sam Weinig.
1433
1434         Covered by newly passing web platform tests.
1435
1436         * page/SecurityOrigin.cpp:
1437         (WebCore::shouldTreatAsUniqueOrigin):
1438         According to https://url.spec.whatwg.org/#origin all URLs with non-special protocols
1439         should have a unique SecurityOrigin whose serialization is "null".
1440
1441 2016-09-20  Christopher Reid  <Christopher.Reid@am.sony.com>
1442
1443         [WinCairo]  Not building since 206044
1444         https://bugs.webkit.org/show_bug.cgi?id=162246
1445
1446         Reviewed by Alex Christensen.
1447
1448         No new tests. No change in behaviour.
1449
1450         * bindings/js/JSWebGLRenderingContextCustom.cpp:
1451         * platform/network/curl/CookieJarCurl.cpp:
1452
1453 2016-09-20  Alex Christensen  <achristensen@webkit.org>
1454
1455         Align URLParser with web platform tests when parsing non-special relative URLs ending in AuthorityOrHost state
1456         https://bugs.webkit.org/show_bug.cgi?id=162251
1457
1458         Reviewed by Tim Horton.
1459
1460         Covered by new and updated API tests.
1461
1462         * platform/URLParser.cpp:
1463         (WebCore::URLParser::parse):
1464         Fix parsing of non-special URLs that end after scheme:// with no authority.
1465         We used to assume that parsing non-special schemes would never end with just scheme:// but a string can indeed end right there.
1466         When a non-special relative URL contains just scheme:// we need the resulting URL to be valid to conform with the web platform tests.
1467         (WebCore::URLParser::parseHostAndPort):
1468         Renamed to reflect what the function actually does.
1469         (WebCore::URLParser::internalValuesConsistent):
1470         Add utility function for testing.
1471         (WebCore::URLParser::parseHost): Deleted.
1472         * platform/URLParser.h:
1473
1474 2016-09-20  Javier Fernandez  <jfernandez@igalia.com>
1475
1476         [css-grid] The 'grid' shorthand has a new syntax.
1477         https://bugs.webkit.org/show_bug.cgi?id=161954
1478
1479         Reviewed by Darin Adler.
1480
1481         Implementation of the new CSS syntax for the 'grid' shorthand, as
1482         defined in the CSS Grid Layout specification:
1483         - https://drafts.csswg.org/css-grid/#grid-shorthand
1484
1485         No new tests, just adapted the ones we already have and added a few additional test cases.
1486
1487         * css/CSSValueKeywords.in:
1488         * css/parser/CSSParser.cpp:
1489         (WebCore::CSSParser::parseImplicitAutoFlow): Added. Similar to parseGridAutoFlow, but using the new 'auto-flow' keyword.
1490         (WebCore::CSSParser::parseGridShorthand): New syntax of the 'grid' shorthand.
1491         * css/parser/CSSParser.h:
1492
1493 2016-09-20  Alex Christensen  <achristensen@webkit.org>
1494
1495         URLParser should allow '@' in user
1496         https://bugs.webkit.org/show_bug.cgi?id=162272
1497
1498         Reviewed by Tim Horton.
1499
1500         Covered by a new API test.
1501
1502         * platform/URLParser.cpp:
1503         (WebCore::URLParser::parse):
1504         The spec describes using an "@ flag" and rewinding iterators.  I've implemented the authority parsing
1505         and host parsing a little differently, but this makes it equivalent.
1506
1507 2016-09-20  Alex Christensen  <achristensen@webkit.org>
1508
1509         URLParser: Fix parsing relative URLs with one slash after the scheme:
1510         https://bugs.webkit.org/show_bug.cgi?id=162294
1511
1512         Reviewed by Tim Horton.
1513
1514         This fixes the relatively-obscure case where a relative URL has the same special scheme as the base,
1515         but there is only one slash after the scheme: at the beginning of the relative URL.  According to spec,
1516         this should be interpreted the same as if the scheme: were not there.
1517         For example, parsing "http:/example.com/" relative to "http://example.org/foo/bar" should be the same as
1518         parsing "/example.com/" relative to "http://example.org/foo/bar".
1519
1520         Covered by a new API test.
1521
1522         * platform/URLParser.cpp:
1523         (WebCore::URLParser::parse):
1524
1525 2016-09-20  Alex Christensen  <achristensen@webkit.org>
1526
1527         Fix Windows file URL quirks in URLParser
1528         https://bugs.webkit.org/show_bug.cgi?id=162303
1529
1530         Reviewed by Tim Horton.
1531
1532         Windows file urls allow c:\ and c|\ to have the same meaning, but when serialized they should both be c:/.
1533         This is now standardized to allow cross-platform uniform behavior of URLs.
1534
1535         Covered by new API tests and progress on web platform tests when URLParser is enabled.
1536
1537         * platform/URLParser.cpp:
1538         (WebCore::incrementIteratorSkippingTabAndNewLine):
1539         (WebCore::isWindowsDriveLetter):
1540         (WebCore::checkWindowsDriveLetter):
1541         (WebCore::shouldCopyFileURL):
1542         (WebCore::URLParser::parseSerializedURL):
1543         (WebCore::URLParser::parse):
1544
1545 2016-09-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
1546
1547         Rename FrameData to ImageFrame, move it to a separate file and use it for all ports
1548         https://bugs.webkit.org/show_bug.cgi?id=159819
1549
1550         Reviewed by Simon Fraser.
1551
1552         Rename FrameData to ImageFrame and move it to a separate file so caching
1553         it can be managed outside the BitmapImage object. Make the data members
1554         of FrameData be private and add getters to return their values. Add backing
1555         store and disposalMethod members, getter and setters to ImageFrame so it can
1556         replace the non-CG ImageFrame class.
1557
1558         * CMakeLists.txt:
1559         * WebCore.xcodeproj/project.pbxproj:
1560         Add ImageFrame class to WebCore project.
1561         
1562         * platform/graphics/BitmapImage.cpp:
1563         (WebCore::BitmapImage::BitmapImage): The metadata for the non-decoder case is now calculated in the ImageFrame::initialize().
1564         (WebCore::BitmapImage::haveFrameImageAtIndex): Call ImageFrame's getters instead of access private members.
1565         (WebCore::BitmapImage::destroyDecodedData): Pass ImageFrame::Caching::Metadata to ImageFrame::clear() to clear the image only.
1566         (WebCore::BitmapImage::destroyDecodedDataIfNecessary): ImageFrame::usedFrameBytes() is now renamed to ImageFrame::frameBytes().
1567         (WebCore::BitmapImage::cacheFrame): Call ImageFrame::initialize() to set the image and cache the frame's metadata.
1568         (WebCore::BitmapImage::dataChanged): Pass ImageFrame::Caching::Empty to ImageFrame::clear() to clear the frame's image and metadata.
1569         (WebCore::BitmapImage::ensureFrameAtIndexIsCached): Call ImageFrame's getters instead of access private members.
1570         (WebCore::BitmapImage::frameImageAtIndex): Call ImageFrame's getters instead of access private members.
1571         (WebCore::BitmapImage::frameIsCompleteAtIndex): Pass ImageFrame::Caching::Metadata to ensureFrameAtIndexIsCached() to ensure the frame's metadata is cached.
1572         (WebCore::BitmapImage::frameDurationAtIndex): Pass ImageFrame::Caching::Metadata to ensureFrameAtIndexIsCached() to ensure the frame's metadata is cached.
1573         (WebCore::BitmapImage::frameHasAlphaAtIndex): Pass ImageFrame::Caching::Metadata to ensureFrameAtIndexIsCached() to ensure the frame's metadata is cached.
1574         (WebCore::BitmapImage::frameOrientationAtIndex): Pass ImageFrame::Caching::Metadata to ensureFrameAtIndexIsCached() to ensure the frame's metadata is cached.
1575         (WebCore::BitmapImage::singlePixelSolidColor): Call ImageFrame's getters instead of access private members.
1576         (WebCore::BitmapImage::repetitionCount): Change the return type to be RepetitionCount instead of int.
1577         (WebCore::BitmapImage::shouldAnimate): Use a simpler condition since RepetitionCountNone is equal to zero.
1578         (WebCore::BitmapImage::startAnimation): Replace the cAnimation* constants by the new RepetitionCount* enum.
1579         (WebCore::BitmapImage::internalAdvanceAnimation): Replace the cAnimation* constants by the new RepetitionCount* enum.
1580
1581         * platform/graphics/BitmapImage.h: FrameData is renamed to ImageFrame and moved to a separate file named ImageFrame.h.
1582         (WebCore::FrameData::FrameData): Deleted.
1583         (WebCore::FrameData::~FrameData): Deleted.
1584         (WebCore::FrameData::clear): Deleted.
1585         (WebCore::FrameData::usedFrameBytes): Deleted.
1586
1587         * platform/graphics/ImageBackingStore.h: 
1588         (WebCore::ImageBackingStore::fillRect): Make it efficient to fill a rect in the ImageBackingStore with the same color.
1589         (WebCore::ImageBackingStore::pixelAt): Asserts the point is in the bounds of the ImageBackingStore size.
1590         (WebCore::ImageBackingStore::setPixel): Use pixelValue().
1591         (WebCore::ImageBackingStore::inBounds): Private functions check whether a point or a rect is in the bounds of the ImageBackingStore size.
1592         (WebCore::ImageBackingStore::pixelValue): Calculate the RGBA value form red, green, blue and alpha values.
1593
1594         * platform/graphics/ImageFrame.cpp: Added.
1595         (WebCore::ImageFrame::ImageFrame): 
1596         (WebCore::ImageFrame::~ImageFrame):
1597         (WebCore::ImageFrame::operator=):
1598         (WebCore::ImageFrame::fillMetaData): Caches the ImageFrame's metadata.
1599         (WebCore::ImageFrame::clearImage): Deletes all the allocated memory by ImageFrame which can be the ImageBackingStore or the NativeImagePtr.
1600         (WebCore::ImageFrame::clear): Deletes the allocated memory and may or may not clears the metadata also.
1601         (WebCore::ImageFrame::initialize): Sets a new ImageBackingStore or a new NativeImagePtr in the ImageFrame.
1602         (WebCore::ImageFrame::size): Returns the size of the ImageFrame which can be the size of ImageBackingStore or the size of NativeImagePtr.
1603         (WebCore::ImageFrame::singlePixelSolidColor): Returns whether the ImageFrame can be drawn by filling the image rectangle with a solid color.
1604         
1605         * platform/graphics/ImageFrame.h: Added.
1606         (WebCore::operator++): SubsamplingLevel is strongly typed but RepetitionCount is not since it can be any unsigned value in addition to -1.
1607         (WebCore::ImageFrame::ImageFrame):
1608         (WebCore::ImageFrame::setDecoding):
1609         (WebCore::ImageFrame::decoding):
1610         (WebCore::ImageFrame::isEmpty):
1611         (WebCore::ImageFrame::isPartial):
1612         (WebCore::ImageFrame::isComplete):
1613         (WebCore::ImageFrame::sizeRespectingOrientation):
1614         (WebCore::ImageFrame::frameBytes):
1615         (WebCore::ImageFrame::subsamplingLevel):
1616         (WebCore::ImageFrame::setDisposalMethod):
1617         (WebCore::ImageFrame::disposalMethod):
1618         (WebCore::ImageFrame::image):
1619         (WebCore::ImageFrame::setOrientation):
1620         (WebCore::ImageFrame::orientation):
1621         (WebCore::ImageFrame::setDuration):
1622         (WebCore::ImageFrame::duration):
1623         (WebCore::ImageFrame::setHasAlpha):
1624         (WebCore::ImageFrame::hasAlpha):
1625         (WebCore::ImageFrame::hasImage):
1626         (WebCore::ImageFrame::hasInvalidImage):
1627         (WebCore::ImageFrame::hasMetadata):
1628         (WebCore::ImageFrame::backingStore):
1629         (WebCore::ImageFrame::hasBackingStore):
1630         Setters and getters for the private members.
1631
1632         * platform/graphics/ImageSource.cpp:
1633         (WebCore::ImageSource::calculateMaximumSubsamplingLevel): allowSubsamplingOfFrameAtIndex() is renamed to frameAllowSubsamplingAtIndex().
1634         (WebCore::ImageSource::subsamplingLevelForScale): Use the values of the enum class SubsamplingLevel.
1635         (WebCore::ImageSource::size): Use the values of the enum class SubsamplingLevel.
1636         (WebCore::ImageSource::sizeRespectingOrientation): Use the values of the enum class SubsamplingLevel.
1637         (WebCore::ImageSource::repetitionCount): Replace the constants cAnimation* by the enum RepetitionCount*.
1638         (WebCore::ImageSource::frameAllowSubsamplingAtIndex): Rename allowSubsamplingOfFrameAtIndex() to frameAllowSubsamplingAtIndex().
1639         (WebCore::ImageSource::frameSizeAtIndex): Replace the call to orientationAtIndex() by frameOrientationAtIndex().
1640         (WebCore::ImageSource::frameOrientationAtIndex): Rename orientationAtIndex() to frameOrientationAtIndex().
1641         (WebCore::ImageSource::dump): Replace the call to orientationAtIndex() by frameOrientationAtIndex().
1642         (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex): Deleted.
1643         (WebCore::ImageSource::orientationAtIndex): Deleted.
1644         
1645         * platform/graphics/ImageSource.h:
1646         (WebCore::ImageSource::decoder): We need this function temporarily till we move caching the frames outside BitmapImage. 
1647
1648         * platform/graphics/NativeImage.h: Change SubImages() to Subimages(). See Darin's comment in https://bugs.webkit.org/show_bug.cgi?id=159819#c6.
1649         * platform/graphics/cairo/NativeImageCairo.cpp:
1650         (WebCore::clearNativeImageSubimages):
1651         (WebCore::clearNativeImageSubImages): Deleted.
1652
1653         * platform/graphics/cg/ImageDecoderCG.cpp:
1654         (WebCore::createImageSourceOptions): Use the values of the enum class SubsamplingLevel.
1655         (WebCore::imageSourceOptions): Use the values of the enum class SubsamplingLevel.
1656         (WebCore::ImageDecoder::repetitionCount): Change the return type to be RepetitionCount instead of int.
1657         (WebCore::ImageDecoder::frameOrientationAtIndex): orientationAtIndex() is renamed to frameOrientationAtIndex().
1658         (WebCore::ImageDecoder::frameAllowSubsamplingAtIndex): allowSubsamplingOfFrameAtIndex() is renamed to frameAllowSubsamplingAtIndex().
1659         (WebCore::ImageDecoder::orientationAtIndex): Deleted.
1660         (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex): Deleted.
1661         * platform/graphics/cg/ImageDecoderCG.h:
1662
1663         * platform/graphics/cg/NativeImageCG.cpp:
1664         (WebCore::clearNativeImageSubimages): Change SubImages() to Subimages().
1665         (WebCore::clearNativeImageSubImages): Deleted.
1666
1667         * platform/image-decoders/ImageDecoder.cpp:
1668         (WebCore::ImageDecoder::frameIsCompleteAtIndex): Use ImageFrame::isComplete() instead of checking the value of the decoding status().
1669         (WebCore::ImageDecoder::frameHasAlphaAtIndex): Use ImageFrame::isComplete() instead of checking the value of the decoding status().
1670         (WebCore::ImageDecoder::frameDurationAtIndex): Use ImageFrame::isEmpty() instead of checking the value of the decoding status().
1671         (WebCore::ImageDecoder::createFrameImageAtIndex): Access the ImageBackingStore::image() function directly.
1672         (WebCore::ImageFrame::ImageFrame): Deleted.
1673         (WebCore::ImageFrame::operator=): Deleted.
1674         (WebCore::ImageFrame::clearPixelData): Deleted.
1675         (WebCore::ImageFrame::zeroFillPixelData): Deleted.
1676         (WebCore::ImageFrame::zeroFillFrameRect): Deleted.
1677         (WebCore::ImageFrame::initializeBackingStore): Deleted.
1678         (WebCore::ImageFrame::hasAlpha): Deleted.
1679         (WebCore::ImageFrame::setHasAlpha): Deleted.
1680         (WebCore::ImageFrame::setOriginalFrameRect): Deleted.
1681         (WebCore::ImageFrame::setStatus): Deleted.
1682
1683         * platform/image-decoders/ImageDecoder.h:
1684         (WebCore::ImageDecoder::repetitionCount): Use the type RepetitionCount and the enum RepetitionCount* values.
1685         (WebCore::ImageDecoder::frameOrientationAtIndex): Rename orientationAtIndex() to frameOrientationAtIndex().
1686         (WebCore::ImageDecoder::frameAllowSubsamplingAtIndex): Rename allowSubsamplingOfFrameAtIndex() to frameAllowSubsamplingAtIndex().
1687         (WebCore::ImageDecoder::subsamplingLevelForScale): Use the enum class SubsamplingLevel value instead of integer values.
1688         (WebCore::ImageFrame::ImageFrame): Deleted.
1689         (WebCore::ImageFrame::copyRowNTimes): Deleted.
1690         (WebCore::ImageFrame::size): Deleted.
1691         (WebCore::ImageFrame::asNewNativeImage): Deleted.
1692         (WebCore::ImageFrame::backingStore): Deleted.
1693         (WebCore::ImageFrame::hasBackingStore): Deleted.
1694         (WebCore::ImageFrame::originalFrameRect): Deleted.
1695         (WebCore::ImageFrame::status): Deleted.
1696         (WebCore::ImageFrame::duration): Deleted.
1697         (WebCore::ImageFrame::disposalMethod): Deleted.
1698         (WebCore::ImageFrame::setDuration): Deleted.
1699         (WebCore::ImageFrame::setDisposalMethod): Deleted.
1700         (WebCore::ImageFrame::pixelAt): Deleted.
1701         (WebCore::ImageFrame::setPixel): Deleted.
1702         (WebCore::ImageFrame::blendPixel): Deleted.
1703         (WebCore::ImageDecoder::orientationAtIndex): Deleted.
1704         (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex): Deleted.
1705
1706         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
1707         (WebCore::BMPImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
1708         (WebCore::BMPImageDecoder::decode): Ditto.
1709
1710         * platform/image-decoders/bmp/BMPImageReader.cpp:
1711         (WebCore::BMPImageReader::decodeBMP): Call ImageFrame::isEmpty(). ImageBuffer::initializeBackingStore() is renamed to initialize().
1712         (WebCore::BMPImageReader::processNonRLEData): Replace ImageFrame::zeroFillPixelData() by ImageBackingStore::clear() and ImageFrame::setAlpha().
1713
1714         * platform/image-decoders/bmp/BMPImageReader.h:
1715         (WebCore::BMPImageReader::setPixel): Call ImageBackingStore::setPixel() directly.
1716         (WebCore::BMPImageReader::fillRGBA): Replace an efficient loop to call setPixel() by ImageBackingStore::fillRect().
1717
1718         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1719         (WebCore::GIFImageDecoder::GIFImageDecoder): Move the initialization of m_repetitionCount to the header file.
1720         (WebCore::GIFImageDecoder::repetitionCount): Change the return type.
1721         (WebCore::GIFImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
1722         (WebCore::GIFImageDecoder::clearFrameBufferCache): Use the values of the new enum class ImageFrame::DisposalMethod.
1723         (WebCore::GIFImageDecoder::haveDecodedRow): Call the ImageBackingStore API's directly.
1724         (WebCore::GIFImageDecoder::frameComplete): Use the values of the new enum class ImageFrame::DisposalMethod.
1725         (WebCore::GIFImageDecoder::initFrameBuffer): Move calling ImageBackingStore::setFrameRect() to be after initializing the ImageBackingStore itself.
1726
1727         * platform/image-decoders/gif/GIFImageDecoder.h: Make repetitionCount() returns RepetitionCount and use the new enum class ImageFrame::DisposalMethod.
1728         
1729         * platform/image-decoders/gif/GIFImageReader.cpp:
1730         (GIFImageReader::parse):
1731
1732         * platform/image-decoders/gif/GIFImageReader.h:
1733         (GIFFrameContext::GIFFrameContext): Use new enum class ImageFrame::DisposalMethod.
1734         
1735         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1736         (WebCore::ICOImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
1737         (WebCore::ICOImageDecoder::decode): Ditto.
1738
1739         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
1740         (WebCore::JPEGImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
1741         (WebCore::setPixel): Call ImageBackingStore::setPixel() directly.
1742         (WebCore::JPEGImageDecoder::outputScanlines): ImageFrame::initializeBackingStore() is renamed to initialize().
1743         (WebCore::JPEGImageDecoder::jpegComplete): ImageFrame::setStatus() is renamed to ImageFrame::setDecoding().
1744         (WebCore::JPEGImageDecoder::decode): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
1745
1746         * platform/image-decoders/png/PNGImageDecoder.cpp:
1747         (WebCore::PNGImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
1748         (WebCore::PNGImageDecoder::rowAvailable): Call the ImageBackingStore APIs directly.
1749         (WebCore::PNGImageDecoder::pngComplete): ImageFrame::setStatus() is renamed to setDecoding().
1750         (WebCore::PNGImageDecoder::readChunks): Use the values of the new enum class ImageFrame::DisposalMethod.
1751         (WebCore::PNGImageDecoder::clearFrameBufferCache): Replace the call to ImageFrame::clearPixelData() by  ImageFrame::clear().
1752         (WebCore::PNGImageDecoder::initFrameBuffer): Move calling ImageBackingStore::setFrameRect() to be after initializing the ImageBackingStore itself.
1753         (WebCore::PNGImageDecoder::frameComplete): Call the ImageBackingStore APIs directly.
1754
1755         * platform/image-decoders/png/PNGImageDecoder.h: Call ImageFrame::isComplete() instead of checking the value of the decoding status().
1756
1757         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
1758         (WebCore::WEBPImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
1759         (WebCore::WEBPImageDecoder::decode): ImageFrame::setStatus() is renamed to setDecoding(). And initializeBackingStore() is renamed to initialize().
1760
1761 2016-09-20  Don Olmstead  <don.olmstead@am.sony.com>
1762
1763         [WinCairo] Use find_package cairo in build
1764         https://bugs.webkit.org/show_bug.cgi?id=162239
1765
1766         Reviewed by Alex Christensen.
1767
1768         No new tests. No change in behavior.
1769
1770         * PlatformWinCairo.cmake:
1771
1772 2016-09-20  Jer Noble  <jer.noble@apple.com>
1773
1774         [media-source] Support MediaSource.setLiveSeekableRanges()
1775         https://bugs.webkit.org/show_bug.cgi?id=162252
1776
1777         Reviewed by Sam Weinig.
1778
1779         Fixes tests: imported/w3c/web-platform-tests/media-source/interfaces.html
1780                      imported/w3c/web-platform-tests/media-source/mediasource-liveseekable.html
1781
1782         Add support for a new part of the Media Source specification, the ability for clients to
1783         specify the seekable ranges for a MediaSource-backed HTMLMediaElement.
1784
1785         Adding the live-seekable methods to MediaSource fixes a large number of the interfaces.html
1786         tests, and the rest are fixed by adding on<event> handlers to MediaSource, SourceBuffer,
1787         and SourceBufferList.
1788
1789         * Modules/mediasource/MediaSource.cpp:
1790         (WebCore::MediaSource::seekable):
1791         (WebCore::MediaSource::setLiveSeekableRange):
1792         (WebCore::MediaSource::clearLiveSeekableRange):
1793         * Modules/mediasource/MediaSource.h:
1794         * Modules/mediasource/MediaSource.idl:
1795         * Modules/mediasource/SourceBuffer.idl:
1796         * Modules/mediasource/SourceBufferList.idl:
1797         * Modules/mediasource/VideoPlaybackQuality.idl:
1798         * html/HTMLMediaElement.cpp:
1799         (WebCore::HTMLMediaElement::seekable):
1800
1801 2016-09-20  Per Arne Vollan  <pvollan@apple.com>
1802
1803         [Win] Unreviewed warning fix.
1804
1805         * page/CaptionUserPreferencesMediaAF.cpp:
1806
1807 2016-09-19  Chris Dumez  <cdumez@apple.com>
1808
1809         Add support for HTMLSourceElement.prototype.sizes / HTMLSourceElement.prototype.srcset
1810         https://bugs.webkit.org/show_bug.cgi?id=162244
1811
1812         Reviewed by Alex Christensen.
1813
1814         Add support for HTMLPrototype.prototype.sizes / HTMLPrototype.prototype.srcset:
1815         - https://html.spec.whatwg.org/#the-source-element
1816
1817         We already support the corresponding content attributes internally. However, we
1818         are missing the corresponding IDL attributes that are supposed to reflect them.
1819
1820         Chrome and Firefox support them. We already had those IDL attributes on
1821         HTMLImageElement.
1822
1823         No new tests, rebaselined existing test.
1824
1825         * html/HTMLSourceElement.idl:
1826
1827 2016-09-19  Anders Carlsson  <andersca@apple.com>
1828
1829         Suppress JavaScript prompts early on in certain cases
1830         https://bugs.webkit.org/show_bug.cgi?id=162243
1831         rdar://problem/27661602
1832
1833         Reviewed by Geoffrey Garen.
1834
1835         Export symbols needed by WebKit2.
1836
1837         * loader/FrameLoader.h:
1838         * loader/FrameLoaderStateMachine.h:
1839
1840 2016-09-19  Chris Dumez  <cdumez@apple.com>
1841
1842         Align HTMLAppletElement with the specification
1843         https://bugs.webkit.org/show_bug.cgi?id=162240
1844
1845         Reviewed by Alex Christensen.
1846
1847         Align HTMLAppletElement with the specification:
1848         - https://html.spec.whatwg.org/#htmlappletelement
1849
1850         In particular:
1851         - space / vspace should be of type "unsigned long", not DOMString
1852         - codeBase and object should reflect as URLs
1853
1854         Firefox agree with the specification. Chrome does not have
1855         HTMLAppletElement anymore.
1856
1857         No new tests, rebaselined existing test.
1858
1859         * html/HTMLAppletElement.cpp:
1860         (WebCore::HTMLAppletElement::isURLAttribute):
1861         * html/HTMLAppletElement.h:
1862         * html/HTMLAppletElement.idl:
1863
1864 2016-09-16  Jer Noble  <jer.noble@apple.com>
1865
1866         [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-avtracks.html
1867         https://bugs.webkit.org/show_bug.cgi?id=162104
1868
1869         Reviewed by Eric Carlson.
1870
1871         Fixes test: imported/w3c/web-platform-tests/media-source/mediasource-avtracks.html
1872
1873         Multiple overlapping issues are causing this test to fail:
1874
1875         - When a MediaSource object is not attached from a HTMLMediaElement, it's SourceBuffer
1876           objects will return `null` from .videoTracks and .audioTracks, foiling the tests ability
1877           to assert that sourceBuffer.videoTracks.length == 0.
1878
1879         - When a MediaSource object is detached from a HTMLMediaElement, it's tracks are removed
1880           but do not generate 'removedtrack' events.
1881
1882         When these bugs were fixed, a few more popped up:
1883
1884         - The HTMLMediaElement removes its tracks before it closes the MediaSource, which causes an
1885           assertion when the MediaSource tells the HTMLMediaElement to remove its copy of the 
1886           source's tracks (which have already been removed).
1887
1888         - When the HTMLMediaElement is stop()-ed due to its ScriptExecutionContext being destroyed,
1889           it tries to close its MediaSource, which has itself already been stop()-ed and thus asserts.
1890
1891         To eliminate all these bugs and make the code more self explanatory, we will rename the 
1892         HTMLMediaElement's closeMediaSource() method to detachMediaSource(), and the MediaSource's
1893         close() method to detachFromElement(). The only way to close a MediaSource is now by calling
1894         detachMediaSource() from the HTMLMediaElement.  The parts of the "Detaching from a media
1895         element" algorithm which were previously spread across setReadyState() and onReadyStateChange()
1896         are now unified in the newly renamed detachFromElement() method. The HTMLMediaElement will
1897         first detach its MediaSource, and only after that remove all its tracks.
1898
1899         * Modules/mediasource/MediaSource.cpp:
1900         (WebCore::MediaSource::setReadyState): Move steps into detachFromElement().
1901         (WebCore::MediaSource::onReadyStateChange): Ditto.
1902         (WebCore::MediaSource::detachFromElement): Perform the steps as specified.
1903         (WebCore::MediaSource::attachToElement): Takes a reference rather than a bare pointer.
1904         (WebCore::MediaSource::stop): Ask the media elemnet to detach.
1905         (WebCore::MediaSource::close): Renamed to detachFromElement().
1906         * Modules/mediasource/MediaSource.h:
1907         * Modules/mediasource/SourceBuffer.cpp:
1908         (WebCore::SourceBuffer::videoTracks): Always return a valid TrackList object.
1909         (WebCore::SourceBuffer::audioTracks): Ditto.
1910         (WebCore::SourceBuffer::textTracks): Ditto.
1911         * html/HTMLMediaElement.cpp:
1912         (WebCore::HTMLMediaElement::~HTMLMediaElement): Renamed closeMediaSource() -> detachMediaSource().
1913         (WebCore::HTMLMediaElement::prepareForLoad): Ditto.
1914         (WebCore::HTMLMediaElement::loadResource): Ditto.
1915         (WebCore::HTMLMediaElement::noneSupported): Ditto.
1916         (WebCore::HTMLMediaElement::mediaLoadingFailedFatally): Ditto.
1917         (WebCore::HTMLMediaElement::detachMediaSource): Ditto.
1918         (WebCore::HTMLMediaElement::userCancelledLoad): Ditto.
1919         (WebCore::HTMLMediaElement::createMediaPlayer): Ditto.
1920         (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto. Also, detach from the MediaSource before
1921             removing tracks.
1922         (WebCore::HTMLMediaElement::closeMediaSource): Deleted.
1923         * html/HTMLMediaElement.h:
1924         * html/track/TrackListBase.cpp:
1925         (TrackListBase::remove): Only try to clear the media element from Tracks that have one.
1926
1927 2016-09-19  Alex Christensen  <achristensen@webkit.org>
1928
1929         URLParser can read memory out of bounds
1930         https://bugs.webkit.org/show_bug.cgi?id=162206
1931
1932         Reviewed by Geoff Garen.
1933
1934         Covered by new API tests.
1935         URLParser is disabled by default still.
1936
1937         * platform/URLParser.cpp:
1938         (WebCore::parseIPv4Host):
1939         If there are fewer than two numbers in an ipv4 address, we would subtract two from the Vector's size, 
1940         causing us to read memory up to std::numeric_limits<size_t>::max() - 2.  Added a bounds check and many tests.
1941
1942 2016-09-19  Alex Christensen  <achristensen@webkit.org>
1943
1944         URLParser should parse serialized valid URLs faster than unknown input
1945         https://bugs.webkit.org/show_bug.cgi?id=162228
1946
1947         Reviewed by Chris Dumez.
1948
1949         The URL constructor with ParsedURLStringTag is almost twice as fast as the other URL constructors.
1950         Assuming there are no tabs or newlines, and assuming characters are already encoded decreases the URLParser
1951         runtime by over 25% and adds infrastructure for more optimizations.
1952
1953         No new tests. No change in behaviour.
1954
1955         * platform/URL.cpp:
1956         (WebCore::URL::URL):
1957         * platform/URLParser.cpp:
1958         (WebCore::utf8PercentEncode):
1959         (WebCore::utf8PercentEncodeQuery):
1960         (WebCore::URLParser::parse):
1961         (WebCore::URLParser::parseSerializedURL):
1962         (WebCore::incrementIterator):
1963         (WebCore::URLParser::parseAuthority):
1964         (WebCore::URLParser::parsePort):
1965         (WebCore::URLParser::parseHost):
1966         * platform/URLParser.h:
1967         (WebCore::URLParser::parse): Deleted.
1968
1969 2016-09-19  Daniel Bates  <dabates@apple.com>
1970
1971         Cleanup: Remove an extraneous copy of SecurityOrigin
1972         https://bugs.webkit.org/show_bug.cgi?id=162118
1973
1974         Reviewed by Youenn Fablet.
1975
1976         Share one isolated copy of the SecurityOrigin between the ContentSecurityPolicy and
1977         LoaderTaskOptions objects instead of creating two isolated copies of the SecurityOrigin.
1978         This is safe because both ContentSecurityPolicy and LoaderTaskOptions are instantiated
1979         in WorkerThreadableLoader::MainThreadBridge for use on the main thread only.
1980
1981         * loader/WorkerThreadableLoader.cpp:
1982         (WebCore::LoaderTaskOptions::LoaderTaskOptions):
1983         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1984
1985 2016-09-19  Antti Koivisto  <antti@apple.com>
1986
1987         Add size assert for RenderElement
1988         https://bugs.webkit.org/show_bug.cgi?id=162096
1989
1990         Reviewed by Simon Fraser.
1991
1992         Also remove the unused m_visibleInViewportState field.
1993
1994         * rendering/RenderElement.cpp:
1995         (WebCore::RenderElement::unregisterForVisibleInViewportCallback):
1996         * rendering/RenderElement.h:
1997
1998 2016-09-19  Keith Rollin  <krollin@apple.com>
1999
2000         REGRESSION (r205275): LOG_WITH_STREAM() macros are all compiled in release builds now
2001         https://bugs.webkit.org/show_bug.cgi?id=162180
2002
2003         Reviewed by Simon Fraser.
2004
2005         Disable LOG_WITH_STREAM in release mode. Along with this, remove a
2006         local variable in GraphcsContextCG.cpp in release mode that's no
2007         longer referenced. And adjust logFunctionResult so that it gets
2008         defined only in debug mode, too, to match its declaration in
2009         LogMacros.h.
2010
2011         No new tests -- there are no tests for logging.
2012
2013         * platform/LogMacros.h:
2014         * platform/Logging.cpp:
2015         * platform/graphics/cg/GraphicsContextCG.cpp:
2016         (WebCore::GraphicsContext::drawNativeImage):
2017
2018 2016-09-19  Daniel Bates  <dabates@apple.com>
2019
2020         Remove ENABLE(TEXT_AUTOSIZING) automatic text size adjustment code
2021         https://bugs.webkit.org/show_bug.cgi?id=162167
2022
2023         Reviewed by Simon Fraser.
2024
2025         Remove the automatic text size adjustment code guarded by ENABLE(TEXT_AUTOSIZING)
2026         because it is not used by any port. On Mac and iOS, analogous code guarded by
2027         ENABLE(IOS_TEXT_AUTOSIZING) is used.
2028
2029         * CMakeLists.txt:
2030         * Configurations/FeatureDefines.xcconfig:
2031         * dom/Document.cpp:
2032         (WebCore::Document::Document):
2033         * dom/Document.h:
2034         (WebCore::Document::textAutosizer): Deleted.
2035         * page/FrameView.cpp:
2036         (WebCore::FrameView::setFrameRect):
2037         (WebCore::FrameView::layout):
2038         * page/Settings.cpp:
2039         (WebCore::Settings::Settings):
2040         (WebCore::Settings::setTextAutosizingFontScaleFactor): Deleted.
2041         * page/Settings.h:
2042         (WebCore::Settings::textAutosizingFontScaleFactor): Deleted.
2043         * page/animation/CSSPropertyAnimation.cpp:
2044         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2045         * rendering/RenderingAllInOne.cpp:
2046         * rendering/TextAutosizer.cpp: Removed.
2047         * rendering/TextAutosizer.h: Removed.
2048         * rendering/style/RenderStyle.cpp:
2049         (WebCore::RenderStyle::changeRequiresLayout):
2050         (WebCore::RenderStyle::lineHeight):
2051         (WebCore::RenderStyle::setFontSize):
2052         * rendering/style/RenderStyle.h:
2053         (WebCore::RenderStyle::textAutosizingMultiplier): Deleted.
2054         (WebCore::RenderStyle::setTextAutosizingMultiplier): Deleted.
2055         * rendering/style/StyleVisualData.cpp:
2056         (WebCore::StyleVisualData::StyleVisualData):
2057         * rendering/style/StyleVisualData.h:
2058         * testing/InternalSettings.cpp:
2059         (WebCore::InternalSettings::Backup::Backup):
2060         (WebCore::InternalSettings::Backup::restoreTo):
2061         (WebCore::InternalSettings::setTextAutosizingEnabled):
2062         (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride):
2063         (WebCore::InternalSettings::setTextAutosizingFontScaleFactor): Deleted.
2064         * testing/InternalSettings.h:
2065         * testing/InternalSettings.idl:
2066
2067 2016-09-19  Chris Dumez  <cdumez@apple.com>
2068
2069         Update XHTMLParser to recognize "-//W3C//DTD MathML 2.0//EN" public identifier
2070         https://bugs.webkit.org/show_bug.cgi?id=162166
2071
2072         Reviewed by Alex Christensen.
2073
2074         Update XHTMLParser to recognize "-//W3C//DTD MathML 2.0//EN" public identifier as
2075         per the latest HTML specification.
2076         - https://html.spec.whatwg.org/#parsing-xhtml-documents
2077
2078         Firefox already recognizes it properly.
2079
2080         Test: imported/w3c/web-platform-tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm
2081
2082         * xml/parser/XMLDocumentParserLibxml2.cpp:
2083         (WebCore::convertUTF16EntityToUTF8):
2084         Fix assertion that was causing the new test to crash in debug. The input '\u0026'
2085         gets converted to '&' which is only 1 character. However, the assertion wrongly
2086         expected WTF::Unicode::convertUTF16ToUTF8() to generate more than 1 character.
2087
2088         (WebCore::externalSubsetHandler):
2089         Add "-//W3C//DTD MathML 2.0//EN" to the list.
2090
2091 2016-09-19  Chris Dumez  <cdumez@apple.com>
2092
2093         Window's pageXOffset / pageYOffset attributes should be replaceable
2094         https://bugs.webkit.org/show_bug.cgi?id=162046
2095
2096         Reviewed by Darin Adler.
2097
2098         Window's pageXOffset / pageYOffset attributes should be replaceable as per:
2099         - https://drafts.csswg.org/cssom-view/#extensions-to-the-window-interface
2100
2101         Firefox agrees with the specification.
2102
2103         No new tests, rebaselined existing test.
2104
2105         * page/DOMWindow.h:
2106         * page/DOMWindow.idl:
2107
2108 2016-09-19  Commit Queue  <commit-queue@webkit.org>
2109
2110         Unreviewed, rolling out r206107.
2111         https://bugs.webkit.org/show_bug.cgi?id=162229
2112
2113         still failing on armv7 for some reason (Requested by anttik on
2114         #webkit).
2115
2116         Reverted changeset:
2117
2118         "Add size assert for RenderElement"
2119         https://bugs.webkit.org/show_bug.cgi?id=162096
2120         http://trac.webkit.org/changeset/206107
2121
2122 2016-09-19  Antti Koivisto  <antti@apple.com>
2123
2124         Add size assert for RenderElement
2125         https://bugs.webkit.org/show_bug.cgi?id=162096
2126
2127         Reviewed by Simon Fraser.
2128
2129         Also remove the unused m_visibleInViewportState field.
2130
2131         * rendering/RenderElement.cpp:
2132         (WebCore::RenderElement::unregisterForVisibleInViewportCallback):
2133         * rendering/RenderElement.h:
2134
2135 2016-09-19  Nan Wang  <n_wang@apple.com>
2136
2137         AX: Add accessibility support for details element on iOS
2138         https://bugs.webkit.org/show_bug.cgi?id=162041
2139
2140         Reviewed by Chris Fleizach.
2141
2142         The details and summary elements are poorly supported on iOS.
2143         Two major issues:
2144             1. Assistive technologies taking focus onto details/summary elements will cause unexpected behavior.
2145             2. VoiceOver is not speaking the expanded status of the details element.
2146         Fixed them by not setting focus onto elements inside details and exposing the details element's expanded
2147         status to its summary's accessible children.
2148
2149         Test: accessibility/ios-simulator/detail-summary-ios.html
2150
2151         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2152         (matchedParent):
2153         (-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
2154         (-[WebAccessibilityObjectWrapper _accessibilityLandmarkAncestor]):
2155         (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
2156         (-[WebAccessibilityObjectWrapper _accessibilityFieldsetAncestor]):
2157         (-[WebAccessibilityObjectWrapper tableCellParent]):
2158         (-[WebAccessibilityObjectWrapper tableParent]):
2159         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
2160         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
2161         (-[WebAccessibilityObjectWrapper detailParentForSummaryObject:]):
2162         (-[WebAccessibilityObjectWrapper detailParentForObject:]):
2163         (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):
2164         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
2165         (-[WebAccessibilityObjectWrapper accessibilityIsExpanded]):
2166
2167 2016-09-19  Zalan Bujtas  <zalan@apple.com>
2168
2169         ASSERTION FAILED: clipRectsContext.rootLayer == m_clipRectsCache->m_clipRectsRoot[clipRectsType] while loading guardian.co.uk
2170         https://bugs.webkit.org/show_bug.cgi?id=162129
2171         <rdar://problem/28353350>
2172
2173         Reviewed by Antti Koivisto.
2174
2175         Neither ::localClipRect() nor ::selfClipRect() accounts for paginated context while computing the cliprects (See FIXMEs).
2176         This patch ensures that we don't end up caching these invalid cliprects.
2177
2178         Test: fast/multicol/assert-on-cliprect-caching-when-paginated.html
2179
2180         * rendering/RenderLayer.cpp:
2181         (WebCore::RenderLayer::calculateClipRects):
2182
2183 2016-09-19  Youenn Fablet  <youenn@apple.com>
2184
2185         Clean-up after r206014
2186         https://bugs.webkit.org/show_bug.cgi?id=162140
2187
2188         Reviewed by Sam Weinig.
2189
2190         Covered by existing tests.
2191
2192         * platform/network/HTTPHeaderMap.cpp:
2193         (WebCore::HTTPHeaderMap::add):
2194
2195 2016-09-19  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
2196
2197         If a host object is only used as a variadic argument, its bindings header isn't properly included
2198         https://bugs.webkit.org/show_bug.cgi?id=150121
2199
2200         Reviewed by Youenn Fablet.
2201
2202         Modify JS binding generator to include binding headers of objects passed
2203         as variadic argument.
2204
2205         * Modules/mediastream/RTCPeerConnection.h: Remove workaround.
2206         * bindings/scripts/CodeGeneratorJS.pm:
2207         (AddVariadicToImplIncludes):
2208         (GenerateParametersCheck):
2209         * bindings/scripts/test/JS/JSTestObj.cpp:
2210
2211 2016-09-19  Joseph Pecoraro  <pecoraro@apple.com>
2212
2213         Web Inspector: ⇧⌘C should highlight node under cursor without re-moving mouse
2214         https://bugs.webkit.org/show_bug.cgi?id=162128
2215
2216         Reviewed by Brian Burg.
2217
2218         * inspector/InspectorDOMAgent.h:
2219         * inspector/InspectorDOMAgent.cpp:
2220         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
2221         (WebCore::InspectorDOMAgent::mouseDidMoveOverElement):
2222         (WebCore::InspectorDOMAgent::highlightMousedOverNode):
2223         (WebCore::InspectorDOMAgent::setSearchingForNode):
2224         When the inspector is connected, remember the last moused over node.
2225         This produces far more consistent results of highlighting under
2226         the cursor when pressing and releasing the keyboard shortcut keys,
2227         without having to move the mouse. Even when using the shortcut to
2228         first connect the inspector this produces far more consistent
2229         results because releasing the keys for the shortcut produce new
2230         mouseDidMoveOverElement events.
2231
2232 2016-09-19  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
2233
2234         JSDOMBindings' toArguments() should return a more descriptive object
2235         https://bugs.webkit.org/show_bug.cgi?id=161793
2236
2237         Reviewed by Youenn Fablet.
2238
2239         Replace std::pair with new VariadicHelperResult class with more
2240         readable members names.
2241
2242         No additional tests required.
2243
2244         * bindings/js/JSDOMBinding.h:
2245         (WebCore::VariadicHelper::Result::Result):
2246         * bindings/scripts/CodeGeneratorJS.pm:
2247         (GenerateParametersCheck):
2248         * bindings/scripts/test/JS/JSTestObj.cpp:
2249         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
2250         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
2251         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
2252         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
2253
2254 2016-09-18  Alex Christensen  <achristensen@webkit.org>
2255
2256         Remove unnecessary String allocations in URLParser
2257         https://bugs.webkit.org/show_bug.cgi?id=162089
2258
2259         Reviewed by Chris Dumez.
2260
2261         No change in behavior except a performance improvement.
2262
2263         * platform/URL.cpp:
2264         (WebCore::assertProtocolIsGood):
2265         (WebCore::URL::protocolIs):
2266         (WebCore::protocolIs):
2267         * platform/URL.h:
2268         Added a new protocolIs for non-null-terminated strings from user input.
2269         * platform/URLParser.cpp:
2270         (WebCore::URLParser::parse):
2271         Don't make a String to compare protocols.
2272
2273 2016-09-17  Alex Christensen  <achristensen@webkit.org>
2274
2275         Inline functions in URLParser
2276         https://bugs.webkit.org/show_bug.cgi?id=162106
2277
2278         Reviewed by Antti Koivisto.
2279
2280         No change in behavior. Just make URLParser faster.
2281
2282         * platform/URLParser.cpp:
2283         (WebCore::isC0Control):
2284         (WebCore::isC0ControlOrSpace):
2285         (WebCore::isTabOrNewline):
2286         (WebCore::isInSimpleEncodeSet):
2287         (WebCore::isInDefaultEncodeSet):
2288         (WebCore::isInUserInfoEncodeSet):
2289         (WebCore::isInvalidDomainCharacter):
2290         (WebCore::isPercentOrNonASCII):
2291         (WebCore::isSlashQuestionOrHash):
2292         (WebCore::isWindowsDriveLetter):
2293         (WebCore::shouldCopyFileURL):
2294         (WebCore::percentEncode):
2295         (WebCore::utf8PercentEncode):
2296         (WebCore::utf8PercentEncodeQuery):
2297         (WebCore::encodeQuery):
2298         (WebCore::isDefaultPort):
2299         (WebCore::isSpecialScheme):
2300         (WebCore::copyASCIIStringUntil):
2301         (WebCore::isPercentEncodedDot):
2302         (WebCore::isSingleDotPathSegment):
2303         (WebCore::isDoubleDotPathSegment):
2304         (WebCore::consumeSingleDotPathSegment):
2305         (WebCore::consumeDoubleDotPathSegment):
2306         (WebCore::serializeIPv4):
2307         (WebCore::zeroSequenceLength):
2308         (WebCore::findLongestZeroSequence):
2309         (WebCore::serializeIPv6Piece):
2310         (WebCore::serializeIPv6):
2311         (WebCore::parseIPv4Number):
2312         (WebCore::pow256):
2313         (WebCore::parseIPv4Host):
2314         (WebCore::parseIPv6Host):
2315         (WebCore::percentDecode):
2316         (WebCore::containsOnlyASCII):
2317         (WebCore::domainToASCII):
2318         (WebCore::hasInvalidDomainCharacter):
2319         (WebCore::formURLDecode):
2320         (WebCore::serializeURLEncodedForm):
2321
2322 2016-09-17  David Kilzer  <ddkilzer@apple.com>
2323
2324         MainThreadBridge needs an isolatedCopy() of SecurityOrigin
2325         <https://webkit.org/b/162116>
2326         <rdar://problem/27525870>
2327
2328         Reviewed by Carlos Garcia Campos.
2329
2330         Covered by existing tests.
2331
2332         * loader/WorkerThreadableLoader.cpp:
2333         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
2334         Make an isolatedCopy() of SecurityOrigin here since that's the
2335         correct idiom to use when the object is passed from a worker
2336         thread back to the main thread.  Fix suggested by Daniel Bates.
2337
2338 2016-09-16  Yusuke Suzuki  <utatane.tea@gmail.com>
2339
2340         [DFG] Introduce IsCellWithType node and unify IsJSArray, IsRegExpObject and newly added IsProxyObject
2341         https://bugs.webkit.org/show_bug.cgi?id=162000
2342
2343         Reviewed by Filip Pizlo.
2344
2345         * bridge/runtime_array.h:
2346         (JSC::RuntimeArray::createStructure):
2347
2348 2016-09-16  Chris Dumez  <cdumez@apple.com>
2349
2350         Cancelling one frame's load cancels load in other frames that have the same URL as well
2351         https://bugs.webkit.org/show_bug.cgi?id=162094
2352
2353         Reviewed by Antti Koivisto.
2354
2355         Cancelling one frame's load cancels load in other frames that have the same URL as well.
2356
2357         So if you have several frames that are loading URL X and you navigate one of the frames
2358         to Y, then the load of X will be cancelled and this frame will navigate to Y. All other
2359         frames will not load URL X even though they should.
2360
2361         The issue is that all the DocumentLoaders share the same CachedResource because of the
2362         memoryCache. When we call DocumentLoader::stopLoading(), it will cancel the
2363         CachedResource's load even though there are several clients for this CachedResource
2364         and other clients still want the load.
2365
2366         The approach chosen in this patch is to not reuse CachedResources that are still
2367         loading when trying to load a main resource. This is not the most efficient approach.
2368         I still chose this approach because:
2369         - It is very unlikely to introduce new bugs.
2370         - The change is very simple.
2371         - This is a corner case (several iframes having the same URL and cancelling the load in
2372           one of them).
2373
2374         Test: http/tests/navigation/frames-same-url-cancel-load.html
2375
2376         * loader/cache/CachedResourceLoader.cpp:
2377         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
2378
2379 2016-09-16  Michael Catanzaro  <mcatanzaro@igalia.com>
2380
2381         ASSERTION FAILED: The string being removed is atomic in the string table of an other thread! iterator != atomicStringTable.end() at Source/WTF/wtf/text/AtomicStringImpl.cpp(453)
2382         https://bugs.webkit.org/show_bug.cgi?id=161800
2383
2384         Reviewed by Žan Doberšek.
2385
2386         Speculative fix. These strings are created as static objects on a secondary thread, but all
2387         static objects are destroyed in exit handlers on the main thread, and AtomicStrings must
2388         always be destroyed on the same thread they are created.
2389
2390         * platform/graphics/texmap/TextureMapperShaderProgram.h:
2391
2392 2016-09-16  Commit Queue  <commit-queue@webkit.org>
2393
2394         Unreviewed, rolling out r206055.
2395         https://bugs.webkit.org/show_bug.cgi?id=162110
2396
2397         broke 32bit ARM build (Requested by anttik on #webkit).
2398
2399         Reverted changeset:
2400
2401         "Add size assert for RenderElement"
2402         https://bugs.webkit.org/show_bug.cgi?id=162096
2403         http://trac.webkit.org/changeset/206055
2404
2405 2016-09-16  Brent Fulgham  <bfulgham@apple.com>
2406
2407         [Win][Direct2D] Provide Color support for Direct2D
2408         https://bugs.webkit.org/show_bug.cgi?id=162090
2409
2410         Reviewed by Dean Jackson.
2411
2412         Add casting operations to the Color class to allow easy interoption with
2413         native Direct2D operations.
2414
2415         No new tests. No change in behavior.
2416
2417         * PlatformWin.cmake: Add new Windows implementation file.
2418         * platform/graphics/Color.h:
2419         * platform/graphics/win/ColorDirect2D.cpp: Added.
2420         (WebCore::Color::Color):
2421         (WebCore::Color::operator D2D1_COLOR_F):
2422
2423 2016-09-16  Antti Koivisto  <antti@apple.com>
2424
2425         Add size assert for RenderElement
2426         https://bugs.webkit.org/show_bug.cgi?id=162096
2427
2428         Reviewed by Simon Fraser.
2429
2430         Also remove the unused m_visibleInViewportState field.
2431
2432         * rendering/RenderElement.cpp:
2433         (WebCore::RenderElement::unregisterForVisibleInViewportCallback):
2434         * rendering/RenderElement.h:
2435
2436 2016-09-16  Antti Koivisto  <antti@apple.com>
2437
2438         Tighten region style map to use RenderElement instead of RenderObject
2439         https://bugs.webkit.org/show_bug.cgi?id=162064
2440
2441         Reviewed by Zalan Bujtas.
2442
2443         RenderTexts don't have styles of their own so the map can operate on RenderElements.
2444
2445         * rendering/RenderElement.cpp:
2446         (WebCore::RenderElement::willBeRemovedFromTree):
2447         (WebCore::RenderElement::removeFromRenderFlowThread):
2448         (WebCore::RenderElement::removeFromRenderFlowThreadIncludingDescendants):
2449         (WebCore::RenderElement::invalidateFlowThreadContainingBlockIncludingDescendants):
2450         * rendering/RenderElement.h:
2451         * rendering/RenderFlowThread.cpp:
2452         (WebCore::RenderFlowThread::removeFlowChildInfo):
2453         * rendering/RenderFlowThread.h:
2454         * rendering/RenderNamedFlowFragment.cpp:
2455         (WebCore::RenderNamedFlowFragment::computeChildrenStyleInRegion):
2456         (WebCore::RenderNamedFlowFragment::setRendererStyleInRegion):
2457         (WebCore::RenderNamedFlowFragment::clearObjectStyleInRegion):
2458         (WebCore::RenderNamedFlowFragment::setRegionObjectsRegionStyle):
2459         (WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle):
2460         (WebCore::RenderNamedFlowFragment::setObjectStyleInRegion): Deleted.
2461         * rendering/RenderNamedFlowFragment.h:
2462         * rendering/RenderNamedFlowThread.cpp:
2463         (WebCore::RenderNamedFlowThread::clearRenderObjectCustomStyle):
2464         (WebCore::RenderNamedFlowThread::removeFlowChildInfo):
2465         * rendering/RenderNamedFlowThread.h:
2466         * rendering/RenderObject.cpp:
2467         (WebCore::RenderObject::willBeRemovedFromTree):
2468         (WebCore::RenderObject::removeFromRenderFlowThread): Deleted.
2469         (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants): Deleted.
2470         (WebCore::RenderObject::invalidateFlowThreadContainingBlockIncludingDescendants): Deleted.
2471
2472             These can now move to RenderElement.
2473
2474         * rendering/RenderObject.h:
2475
2476 2016-09-16  Brent Fulgham  <bfulgham@apple.com>
2477
2478         CaptionUserPreferences's use of the PageGroup's page map is incorrect
2479         https://bugs.webkit.org/show_bug.cgi?id=122194
2480         <rdar://problem/27332004>
2481
2482         Reviewed by Zalan Bujtas.
2483
2484         Avoid the possibility of dereferencing an unsafe iterator by checking
2485         for an empty HashSet before using the result of 'begin()'.
2486
2487         No new tests because there is no change in behavior.
2488
2489         * page/CaptionUserPreferences.cpp:
2490         (WebCore::CaptionUserPreferences::CaptionUserPreferences): Use new safer
2491         accessor to retrieve the current page.
2492         (WebCore::CaptionUserPreferences::setCaptionDisplayMode): Ditto.
2493         (WebCore::CaptionUserPreferences::currentPage): Added.
2494         (WebCore::CaptionUserPreferences::userPrefersCaptions): Use new safer
2495         accessor to retrieve the current page.
2496         (WebCore::CaptionUserPreferences::setUserPrefersCaptions): Ditto.
2497         (WebCore::CaptionUserPreferences::userPrefersSubtitles): Ditto.
2498         (WebCore::CaptionUserPreferences::setUserPrefersSubtitles): Ditto.
2499         (WebCore::CaptionUserPreferences::userPrefersTextDescriptions): Ditto.
2500         (WebCore::CaptionUserPreferences::setUserPrefersTextDescriptions): Ditto.
2501         * page/CaptionUserPreferences.h:
2502
2503 2016-09-16  Alex Christensen  <achristensen@webkit.org>
2504
2505         Use Vector<LChar> instead of StringBuilder for the ASCII parts of URLParser
2506         https://bugs.webkit.org/show_bug.cgi?id=162035
2507
2508         Reviewed by Chris Dumez.
2509
2510         StringBuilder::append checks to see whether its StringBuffer is 8-bit or 16-bit each time it is called.
2511         When parsing URLs, almost all of the parsed URL is guaranteed to be 8-bit ASCII.
2512         Using a Vector<LChar> for this allows us to use uncheckedAppend in some places, and it always eliminates the 8-bit check.
2513         This is a ~20% speedup in url parsing.
2514
2515         Covered by existing API tests.
2516
2517         * platform/URLParser.cpp:
2518         (WebCore::isWindowsDriveLetter):
2519         (WebCore::percentEncode):
2520         (WebCore::utf8PercentEncode):
2521         (WebCore::utf8PercentEncodeQuery):
2522         (WebCore::encodeQuery):
2523         (WebCore::URLParser::copyURLPartsUntil):
2524         (WebCore::URLParser::popPath):
2525         (WebCore::URLParser::parse):
2526         (WebCore::URLParser::parseAuthority):
2527         (WebCore::appendNumber):
2528         (WebCore::serializeIPv4):
2529         (WebCore::serializeIPv6Piece):
2530         (WebCore::serializeIPv6):
2531         (WebCore::URLParser::parsePort):
2532         (WebCore::URLParser::parseHost):
2533         (WebCore::serializeURLEncodedForm):
2534         (WebCore::URLParser::serialize):
2535         (WebCore::bufferView): Deleted.
2536         * platform/URLParser.h:
2537
2538 2016-09-16  Dave Hyatt  <hyatt@apple.com>
2539
2540         [CSS Parser] Get CSSPropertyParserHelpers.cpp compiling
2541         https://bugs.webkit.org/show_bug.cgi?id=162078
2542
2543         Reviewed by Dean Jackson.
2544
2545         * css/CSSCalculationValue.cpp:
2546         (WebCore::hasDoubleValue):
2547         (WebCore::checkDepthAndIndex):
2548         (WebCore::CSSCalcExpressionNodeParser::parseCalc):
2549         (WebCore::CSSCalcExpressionNodeParser::operatorValue):
2550         (WebCore::CSSCalcExpressionNodeParser::parseValue):
2551         (WebCore::CSSCalcExpressionNodeParser::parseValueTerm):
2552         (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
2553         (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
2554         (WebCore::CSSCalcExpressionNodeParser::parseValueExpression):
2555         (WebCore::checkDepthAndIndexDeprecated):
2556         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueTerm):
2557         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueMultiplicativeExpression):
2558         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseAdditiveValueExpression):
2559         (WebCore::CSSCalcValue::create):
2560         * css/CSSCalculationValue.h:
2561         (WebCore::CSSCalcValue::createCalculationValue):
2562         (WebCore::CSSCalcValue::setPermittedValueRange):
2563         Switch off the permitted calc value range enum, since we can just use the identical ValueRange enum.
2564         Deprecate the CSSParserValueList-based parser by renaming it, and add a new parser that operates
2565         on tokens.
2566
2567         * css/CSSPrimitiveValue.cpp:
2568         (WebCore::isValidCSSUnitTypeForDoubleConversion):
2569         (WebCore::isStringType):
2570         (WebCore::CSSPrimitiveValue::cleanup):
2571         (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):
2572         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
2573         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
2574         (WebCore::CSSPrimitiveValue::equals):
2575         (WebCore::CSSPrimitiveValue::buildParserValue):
2576         * css/CSSPrimitiveValue.h:
2577         Add support for CSS_QUIRKY_EMS as a unit type. This will let us eliminate the extra m_isQuirkValue boolean
2578         eventually.
2579
2580         * css/parser/CSSParser.cpp:
2581         (WebCore::CSSParser::validateCalculationUnit):
2582         (WebCore::CSSParser::parseCalculation):
2583         * css/parser/CSSParser.h:
2584         Switch to ValueRange.
2585
2586         * css/parser/CSSParserIdioms.cpp:
2587         (WebCore::completeURL):
2588         * css/parser/CSSParserIdioms.h:
2589         Make the URL completion function from CSSParser.cpp available to all.
2590
2591         * css/parser/CSSParserMode.h:
2592         (WebCore::isUnitLessValueParsingEnabledForMode):
2593         (WebCore::isUnitLessLengthParsingEnabledForMode): Deleted.
2594         Rename this to value, since for now we're not supporting Blink's UserUnits. This means we need to support
2595         unitless parsing for times and angles in addition to lengths, making the name of the function inappropriate.
2596
2597         * css/parser/CSSParserToken.cpp:
2598         (WebCore::cssPrimitiveValueUnitFromTrie):
2599         Turn quirky ems support back on.
2600
2601         * css/parser/CSSParserValues.cpp:
2602         (WebCore::CSSParserValue::createCSSValue):
2603         Support quirky ems.
2604
2605         * css/parser/CSSPropertyParserHelpers.cpp:
2606         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeValue):
2607         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
2608         (WebCore::CSSPropertyParserHelpers::consumeInteger):
2609         (WebCore::CSSPropertyParserHelpers::consumePositiveInteger):
2610         (WebCore::CSSPropertyParserHelpers::consumeNumber):
2611         (WebCore::CSSPropertyParserHelpers::shouldAcceptUnitlessValue):
2612         (WebCore::CSSPropertyParserHelpers::consumeLength):
2613         (WebCore::CSSPropertyParserHelpers::consumePercent):
2614         (WebCore::CSSPropertyParserHelpers::canConsumeCalcValue):
2615         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
2616         (WebCore::CSSPropertyParserHelpers::consumeAngle):
2617         (WebCore::CSSPropertyParserHelpers::consumeTime):
2618         (WebCore::CSSPropertyParserHelpers::consumeIdent):
2619         (WebCore::CSSPropertyParserHelpers::consumeIdentRange):
2620         (WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
2621         (WebCore::CSSPropertyParserHelpers::consumeString):
2622         (WebCore::CSSPropertyParserHelpers::consumeUrl):
2623         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
2624         (WebCore::CSSPropertyParserHelpers::parseHSLParameters):
2625         (WebCore::CSSPropertyParserHelpers::consumeColor):
2626         (WebCore::CSSPropertyParserHelpers::consumePositionComponent):
2627         (WebCore::CSSPropertyParserHelpers::positionFromOneValue):
2628         (WebCore::CSSPropertyParserHelpers::positionFromTwoValues):
2629         (WebCore::CSSPropertyParserHelpers::createPrimitiveValuePair):
2630         (WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues):
2631         (WebCore::CSSPropertyParserHelpers::consumePosition):
2632         (WebCore::CSSPropertyParserHelpers::consumeOneOrTwoValuedPosition):
2633         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint):
2634         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientStopColor):
2635         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
2636         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
2637         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
2638         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
2639         (WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
2640         (WebCore::CSSPropertyParserHelpers::consumeImageOrNone):
2641         (WebCore::CSSPropertyParserHelpers::consumeCrossFade):
2642         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
2643         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
2644         (WebCore::CSSPropertyParserHelpers::consumeImage):
2645         * css/parser/CSSPropertyParserHelpers.h:
2646         (WebCore::CSSPropertyParserHelpers::isCSSWideKeyword):
2647         Lots of changes here. The most important is switching over to RefPtrs and Refs where appropriate, with the
2648         requisite WTFMoves. Unit types also have to be converted back to our values, and unitless parsing has
2649         to work with consumeTime and consumeAngle.
2650
2651         * platform/CalculationValue.cpp:
2652         (WebCore::CalculationValue::create):
2653         * platform/CalculationValue.h:
2654         (WebCore::CalculationValue::CalculationValue):
2655         Use ValueRange.
2656
2657         * platform/graphics/Color.cpp:
2658         (WebCore::Color::parseHexColor):
2659         (WebCore::Color::Color):
2660         * platform/graphics/Color.h:
2661         Add a StringView-based parseHexColor function.
2662
2663         * rendering/style/BasicShapes.cpp:
2664         (WebCore::BasicShapeCenterCoordinate::updateComputedLength):
2665         Use ValueRange
2666
2667 2016-09-16  Jer Noble  <jer.noble@apple.com>
2668
2669         [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-av-audio-bitrate.html
2670         https://bugs.webkit.org/show_bug.cgi?id=162052
2671
2672         Reviewed by Brent Fulgham.
2673
2674         Fixes tests: imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-av-audio-bitrate.html
2675                      imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-av-video-bitrate.html
2676
2677         The above tests would throw an assertion while trying to invert a range with an invalid end time. Check the
2678         validity of trackBuffer.lastEnqueuedPresentationTime before comparing it and assigning it to a range.
2679
2680         * Modules/mediasource/SourceBuffer.cpp:
2681         (WebCore::SourceBuffer::removeCodedFrames):
2682
2683 2016-09-16  Alex Christensen  <achristensen@webkit.org>
2684
2685         URLParser should percent encode the user and password according to spec
2686         https://bugs.webkit.org/show_bug.cgi?id=162049
2687
2688         Reviewed by Tim Horton.
2689
2690         Covered by new API tests based on the web platform tests.
2691
2692         * platform/URLParser.cpp:
2693         (WebCore::URLParser::parseAuthority):
2694
2695 2016-09-16  Alex Christensen  <achristensen@webkit.org>
2696
2697         Fix more edge cases in URLParser
2698         https://bugs.webkit.org/show_bug.cgi?id=162051
2699
2700         Reviewed by Tim Horton.
2701
2702         Added new API tests.
2703
2704         * platform/URLParser.cpp:
2705         (WebCore::URLParser::parse):
2706         Some edge case handling was wrong. Also, some of the terminal states are not possible
2707         to reach because we transition to those states without incrementing the iterator.
2708
2709 2016-09-16  Alex Christensen  <achristensen@webkit.org>
2710
2711         Fix Windows clean build after r205929
2712
2713         * DerivedSources.cpp:
2714
2715 2016-09-16  Jer Noble  <jer.noble@apple.com>
2716
2717         [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-timestamp-offset.html
2718         https://bugs.webkit.org/show_bug.cgi?id=162038
2719
2720         Reviewed by Eric Carlson.
2721
2722         The timestampOffset property is no longer specified as an 'unrestricted' double.
2723
2724         * Modules/mediasource/SourceBuffer.idl:
2725
2726 2016-09-16  Per Arne Vollan  <pvollan@apple.com>
2727
2728         [Win] Compile fix.
2729         https://bugs.webkit.org/show_bug.cgi?id=162059
2730
2731         Reviewed by Alex Christensen.
2732
2733         If an include file exists in two places in the include paths, we can end up including the file twice,
2734         since #pragma once will not protect us against this.
2735
2736         * PlatformWin.cmake: Put WebCore forwarding folder first in include list.
2737
2738 2016-09-16  Chris Dumez  <cdumez@apple.com>
2739
2740         Cloning a textarea does not clone the textarea's value
2741         https://bugs.webkit.org/show_bug.cgi?id=156637
2742
2743         Reviewed by Ryosuke Niwa.
2744
2745         Update WebKit so that cloning a textarea element also clones its value.
2746         This matches the HTML specification after:
2747         - https://github.com/whatwg/html/pull/1784
2748
2749         The new behavior also matches Chrome and Edge.
2750
2751         Test: imported/w3c/web-platform-tests/html/semantics/forms/the-textarea-element/cloning-steps.html
2752
2753         * html/HTMLInputElement.cpp:
2754         (WebCore::HTMLInputElement::copyNonAttributePropertiesFromElement):
2755         * html/HTMLTextAreaElement.cpp:
2756         (WebCore::HTMLTextAreaElement::copyNonAttributePropertiesFromElement):
2757         * html/HTMLTextAreaElement.h:
2758
2759 2016-09-16  Jer Noble  <jer.noble@apple.com>
2760
2761         [media-source] Only fire 'resize' events when new sized frame is displayed, not parsed.
2762         https://bugs.webkit.org/show_bug.cgi?id=162039
2763
2764         Reviewed by Eric Carlson.
2765
2766         Fixes tests: imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-av-framesize.html
2767                      imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-v-framesize.html
2768
2769         Currently, the SourceBufferPrivateAVFObjC will signal a size change as soon as the sample is
2770         parsed during appendData(). This is incorrect, as the intrinsic size of the video element
2771         should be based on when the sample is displayed, and it causes some W3C test cases to fail.
2772         Set a boundary time observer on the player's synchronizer at each sample's presentation time
2773         where that sample signals a change in intrinsic size. Flush those observers whenever the
2774         samples are flushed un-displayed (typically, during a seek). Because the observer callback
2775         may have already been issued (but not executed) at a flush, use a separate weak pointer
2776         factory, and invalidate all outstanding size change observer weak pointers when flushing.
2777
2778         * Modules/mediasource/SourceBuffer.cpp:
2779         (WebCore::SourceBuffer::reenqueueMediaForTime): When re-enqueing, enqueue the next decodable
2780             sample, even if it doesn't include the current time. This handles cases where the current
2781             time is 0, and the first video sample starts at 0.033.
2782         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2783         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2784         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2785         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
2786         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::naturalSize):
2787         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
2788         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::flushPendingSizeChanges):
2789         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeChanged): Deleted.
2790         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2791         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2792         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
2793         (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
2794         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2795
2796 2016-09-16  Alex Christensen  <achristensen@webkit.org>
2797
2798         Fix Windows clean build after r205929
2799
2800         * DerivedSources.cpp:
2801
2802 2016-09-16  Jer Noble  <jer.noble@apple.com>
2803
2804         [media-source] ASAN crash running imported/w3c/web-platform-tests/media-source/mediasource-remove.html
2805         https://bugs.webkit.org/show_bug.cgi?id=162050
2806
2807         Reviewed by Brent Fulgham.
2808
2809         SampleMap::removeSample() was accessing the passed-in sample after removing it from its own storage. If
2810         the SampleMap held the last reference to the sample, it would end up acessing freed memory. Fix the
2811         post-removal access, but also ensure that the caller, SourceBuffer::removeCodedFrames(), retains the
2812         sample it passes into removeSample().
2813
2814         * Modules/mediasource/SampleMap.cpp:
2815         (WebCore::SampleMap::removeSample):
2816         * Modules/mediasource/SourceBuffer.cpp:
2817         (WebCore::SourceBuffer::removeCodedFrames):
2818
2819 2016-09-16  Javier Fernandez  <jfernandez@igalia.com>
2820
2821         [GTK] Unreviewed build fix after r206007.
2822         https://bugs.webkit.org/show_bug.cgi?id=162058
2823
2824         * css/parser/CSSParserFastPaths.cpp:
2825         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2826
2827 2016-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2828
2829         [TextureMapper] Scrolling through 01.org/dleyna crashes WebKitWebProcess
2830         https://bugs.webkit.org/show_bug.cgi?id=162020
2831
2832         Reviewed by Žan Doberšek.
2833
2834         The problem is that we are trying to clone a ReferenceFilterOperation, which is not expected to be cloned, from
2835         FilterAnimationValue copy constructor, and FilterOperations are never expected to be nullptr, so we end up
2836         crashing. We just need to validate the filters before setting then and before creating a TextureMapperAnimation
2837         for them.
2838
2839         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2840         (WebCore::GraphicsLayerTextureMapper::filtersCanBeComposited): Return false if there are reference filters or no
2841         filters at all. I don't know if we really support other filters, but at least we won't crash for the others.
2842         (WebCore::GraphicsLayerTextureMapper::addAnimation): Check if filters can be composited before creating a
2843         TextureMapperAnimation.
2844         (WebCore::GraphicsLayerTextureMapper::setFilters): Check if filters can be composited before setting them.
2845         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
2846         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2847         (WebCore::CoordinatedGraphicsLayer::filtersCanBeComposited): Return false if there are reference filters or no
2848         filters at all. I don't know if we really support other filters, but at least we won't crash for the others.
2849         (WebCore::CoordinatedGraphicsLayer::setFilters): Check if filters can be composited before setting them.
2850         (WebCore::CoordinatedGraphicsLayer::addAnimation): Check if filters can be composited before creating a
2851         TextureMapperAnimation.
2852         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2853
2854 2016-09-16  Youenn Fablet  <youenn@apple.com>
2855
2856         CachedFont do not need to be updated according Origin/Fetch mode
2857         https://bugs.webkit.org/show_bug.cgi?id=161909
2858
2859         Reviewed by Sam Weinig.
2860
2861         No change of behavior.
2862
2863         * loader/cache/CachedFont.h: Ensuring CachedFont is not reused.
2864         * loader/cache/CachedResourceLoader.cpp:
2865         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Doing direct reuse for CachedFont as WebKit is ignoring CORS for all fonts related stuff.
2866
2867 2016-09-16  Youenn Fablet  <youenn@apple.com>
2868
2869         CachedResource should efficiently construct its ResourceRequest
2870         https://bugs.webkit.org/show_bug.cgi?id=161609
2871
2872         Reviewed by Sam Weinig.
2873
2874         Covered by existing tests.
2875
2876         Making CachedResourceLoader take a CachedResourceRequest&& when being asked to load resources.
2877         Making CachedResource et al take a CachedResourceRequest&& as constructor parameter.
2878
2879         CachedResource now sets its options at construction time instead of load time.
2880         This may change some specific behaviors, for instance when loading manually images.
2881
2882         Made some refactoring when both the resource and request are needed, for ResourceTimingInformation.
2883         Made local copies of some CachedResourceRequest fields so that we do not need it after being WTFMoved.
2884         Some of these properties may be put outside CachedResourceRequest in a later refactoring step.
2885
2886         * css/CSSFontFaceSrcValue.cpp:
2887         (WebCore::CSSFontFaceSrcValue::cachedFont):
2888         * css/CSSImageSetValue.cpp:
2889         (WebCore::CSSImageSetValue::loadBestFitImage):
2890         * css/CSSImageValue.cpp:
2891         (WebCore::CSSImageValue::loadImage):
2892         * css/StyleRuleImport.cpp:
2893         (WebCore::StyleRuleImport::requestStyleSheet):
2894         * dom/ProcessingInstruction.cpp:
2895         (WebCore::ProcessingInstruction::checkStyleSheet):
2896         * dom/ScriptElement.cpp:
2897         (WebCore::ScriptElement::requestScriptWithCache):
2898         * html/HTMLLinkElement.cpp:
2899         (WebCore::HTMLLinkElement::process):
2900         * html/parser/HTMLResourcePreloader.cpp:
2901         (WebCore::HTMLResourcePreloader::preload):
2902         * loader/CrossOriginPreflightChecker.cpp:
2903         (WebCore::CrossOriginPreflightChecker::startPreflight):
2904         * loader/DocumentLoader.cpp:
2905         (WebCore::DocumentLoader::startLoadingMainResource):
2906         * loader/DocumentThreadableLoader.cpp:
2907         (WebCore::DocumentThreadableLoader::loadRequest):
2908         * loader/ImageLoader.cpp:
2909         (WebCore::ImageLoader::updateFromElement):
2910         * loader/LinkLoader.cpp:
2911         (WebCore::LinkLoader::preloadIfNeeded):
2912         (WebCore::LinkLoader::loadLink):
2913         * loader/MediaResourceLoader.cpp:
2914         (WebCore::MediaResourceLoader::requestResource):
2915         * loader/ResourceTimingInformation.cpp:
2916         (WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation):
2917         * loader/ResourceTimingInformation.h:
2918         * loader/TextTrackLoader.cpp:
2919         (WebCore::TextTrackLoader::load):
2920         * loader/cache/CachedCSSStyleSheet.cpp:
2921         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
2922         * loader/cache/CachedCSSStyleSheet.h:
2923         * loader/cache/CachedFont.cpp:
2924         (WebCore::CachedFont::CachedFont):
2925         (WebCore::CachedFont::load):
2926         (WebCore::CachedFont::beginLoadIfNeeded):
2927         * loader/cache/CachedFont.h:
2928         * loader/cache/CachedImage.cpp:
2929         (WebCore::CachedImage::CachedImage):
2930         (WebCore::CachedImage::load):
2931         * loader/cache/CachedImage.h:
2932         * loader/cache/CachedRawResource.cpp:
2933         (WebCore::CachedRawResource::CachedRawResource):
2934         * loader/cache/CachedRawResource.h:
2935         * loader/cache/CachedResource.cpp:
2936         (WebCore::CachedResource::CachedResource):
2937         (WebCore::CachedResource::load):
2938         (WebCore::CachedResource::loadFrom):
2939         * loader/cache/CachedResource.h:
2940         (WebCore::CachedResource::resourceRequest):
2941         * loader/cache/CachedResourceLoader.cpp:
2942         (WebCore::createResource):
2943         (WebCore::CachedResourceLoader::requestImage):
2944         (WebCore::CachedResourceLoader::requestFont):
2945         (WebCore::CachedResourceLoader::requestTextTrack):
2946         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
2947         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
2948         (WebCore::CachedResourceLoader::requestScript):
2949         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
2950         (WebCore::CachedResourceLoader::requestSVGDocument):
2951         (WebCore::CachedResourceLoader::requestLinkResource):
2952         (WebCore::CachedResourceLoader::requestMedia):
2953         (WebCore::CachedResourceLoader::requestRawResource):
2954         (WebCore::CachedResourceLoader::requestMainResource):
2955         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
2956         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
2957         (WebCore::CachedResourceLoader::requestResource):
2958         (WebCore::CachedResourceLoader::revalidateResource):
2959         (WebCore::CachedResourceLoader::loadResource):
2960         (WebCore::CachedResourceLoader::reloadImagesIfNotDeferred):
2961         (WebCore::CachedResourceLoader::preload):
2962         (WebCore::CachedResourceLoader::checkForPendingPreloads):
2963         (WebCore::CachedResourceLoader::requestPreload):
2964         * loader/cache/CachedResourceLoader.h:
2965         * loader/cache/CachedSVGDocument.cpp:
2966         (WebCore::CachedSVGDocument::CachedSVGDocument):
2967         * loader/cache/CachedSVGDocument.h:
2968         * loader/cache/CachedSVGDocumentReference.cpp:
2969         (WebCore::CachedSVGDocumentReference::load):
2970         * loader/cache/CachedSVGFont.cpp:
2971         (WebCore::CachedSVGFont::CachedSVGFont):
2972         * loader/cache/CachedSVGFont.h:
2973         * loader/cache/CachedScript.cpp:
2974         (WebCore::CachedScript::CachedScript):
2975         * loader/cache/CachedScript.h:
2976         * loader/cache/CachedTextTrack.cpp:
2977         (WebCore::CachedTextTrack::CachedTextTrack):
2978         * loader/cache/CachedTextTrack.h:
2979         * loader/cache/CachedXSLStyleSheet.cpp:
2980         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
2981         (WebCore::CachedXSLStyleSheet::didAddClient):
2982         * loader/cache/CachedXSLStyleSheet.h:
2983         * loader/icon/IconLoader.cpp:
2984         (WebCore::IconLoader::startLoading):
2985         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2986         (WebCore::WebCoreAVCFResourceLoader::startLoading):
2987         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2988         (WebCore::WebCoreAVFResourceLoader::startLoading):
2989         * svg/SVGFEImageElement.cpp:
2990         (WebCore::SVGFEImageElement::requestImageResource):
2991         * svg/SVGFontFaceUriElement.cpp:
2992         (WebCore::SVGFontFaceUriElement::loadFont):
2993         * svg/SVGUseElement.cpp:
2994         (WebCore::SVGUseElement::updateExternalDocument):
2995         * xml/XSLImportRule.cpp:
2996         (WebCore::XSLImportRule::loadSheet):
2997
2998 2016-09-16  Youenn Fablet  <youenn@apple.com>
2999
3000         [Fetch API] Headers should be combine with ',' and not ', '
3001         https://bugs.webkit.org/show_bug.cgi?id=161736
3002
3003         Reviewed by Sam Weinig.
3004
3005         Covered by updated tests and http/tests/xmlhttprequest/check-combining-headers.html.
3006
3007         * loader/CrossOriginAccessControl.cpp:
3008         (WebCore::createAccessControlPreflightRequest): Combining with ',' for Access-Control-Request-Headers
3009         * platform/network/HTTPHeaderMap.cpp:
3010         (HTTPHeaderMap::add): Combining with ','
3011
3012 2016-09-16  Youenn Fablet  <youenn@apple.com>
3013
3014         Custom promise-returning functions should not throw if callee has not the expected type
3015         https://bugs.webkit.org/show_bug.cgi?id=162011
3016
3017         Reviewed by Sam Weinig.
3018
3019         Covered by added test.
3020
3021         Updating code generator to handle this case.
3022         Cleaning related getUserMedia implementation.
3023
3024         * CMakeLists.txt: Removing Modules/mediastream/MediaDevices.js.
3025         * DerivedSources.make: Removing Modules/mediastream/MediaDevices.js.
3026         * Modules/mediastream/MediaDevices.idl: Cleaning IDL definition
3027         * Modules/mediastream/MediaDevices.js: Removing error throwing and so removing file.
3028         * Modules/mediastream/NavigatorUserMedia.js: getUsermMediaFromJS to getUserMedia.
3029         * WebCore.xcodeproj/project.pbxproj: Removing Modules/mediastream/MediaDevices.js.
3030         * bindings/js/JSDOMPromise.cpp:
3031         (WebCore::createRejectedPromiseWithTypeError): Helper routine.
3032         * bindings/js/JSDOMPromise.h:
3033         * bindings/js/WebCoreBuiltinNames.h: getUsermMediaFromJS to getUserMedia.
3034         * bindings/scripts/CodeGeneratorJS.pm:
3035         (GenerateImplementation): Rejecting promise in case of failing castedThis, but only for custom functions since
3036         they are handled differently for non custom methods.
3037         (GenerateFunctionCastedThis):
3038         * bindings/scripts/test/JS/JSTestObj.cpp:
3039         * bindings/scripts/test/JS/JSTestObj.h:
3040         * bindings/scripts/test/TestObj.idl: Adding custom promise test.
3041
3042 2016-09-16  Youenn Fablet  <youenn@apple.com>
3043
3044         Link loader should use FetchOptions::mode according its crossOrigin attribute
3045         https://bugs.webkit.org/show_bug.cgi?id=161859
3046
3047         Reviewed by Sam Weinig.
3048
3049         Tests: http/tests/security/cached-cross-origin-preloaded-css-stylesheet.html
3050                http/tests/security/cached-cross-origin-preloading-css-stylesheet.html
3051
3052         Setting fetch mode according crossorigin attribute for link preload elements.
3053         This allows calling onerror callback for CORS failures, which was not the case before the patch.
3054
3055         Making cached CSS stylesheet reusable accross origins and fetch modes.
3056
3057         * loader/LinkLoader.cpp:
3058         (WebCore::LinkLoader::preloadIfNeeded): Using CachedResourceRequest::setAsPotentiallyCrossOrigin to set fetch mode.
3059         * loader/cache/CachedCSSStyleSheet.cpp:
3060         (WebCore::CachedCSSStyleSheet::sheetText): clean-up.
3061         (WebCore::CachedCSSStyleSheet::setBodyDataFrom): Implementing data init for cached css stylesheets.
3062         * loader/cache/CachedCSSStyleSheet.h:
3063         * loader/cache/CachedResourceLoader.cpp:
3064         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Activating update support for stylesheets.
3065         (WebCore::CachedResourceLoader::requestResource): Fixing for matching cached resources that need being reloaded due to different origin/fetch mode.
3066
3067 2016-09-16  Youenn Fablet  <youenn@apple.com>
3068
3069         [Fetch API] Referrer and Origin header should not be considered as safe request headers
3070         https://bugs.webkit.org/show_bug.cgi?id=161902
3071
3072         Reviewed by Sam Weinig.
3073
3074         Test: http/tests/fetch/fetch-cors-with-referrer.html and updated WPT tests.
3075
3076         Removing Origin and Referrer from safe request headers.
3077         Making referrer header setting after preflight for fetch API code path.
3078
3079         Ensuring that no ThreadableLoader client sets Origin or Referrer headers of the ResourceRequest, as they should use the proper mechanisms for that.
3080
3081         Handling no-referrer referrer special value by setting the referrer-policy to NoReferrer in FetchLoader.
3082
3083         * Modules/fetch/FetchLoader.cpp:
3084         (WebCore::FetchLoader::start): Computing referrer value and handling special "client"and "no-referrer" cases.
3085         Passing the value directly to ThreadableLoader.
3086         * Modules/fetch/FetchRequest.cpp:
3087         (WebCore::FetchRequest::internalRequest): Removing setting of ResourceRequest referrer header.
3088         (WebCore::FetchRequest::clone): Removing obsolete FIXME.
3089         * Modules/fetch/FetchRequest.h:
3090         * loader/CrossOriginAccessControl.cpp:
3091         (WebCore::isOnAccessControlSimpleRequestHeaderWhitelist): Removing Origin and Referrer headers.
3092         * loader/DocumentThreadableLoader.cpp:
3093         (WebCore::DocumentThreadableLoader::create): Updated to take a referrer as parameter.
3094         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Ditto.
3095         * loader/DocumentThreadableLoader.h: Ditto.
3096         * loader/ThreadableLoader.cpp: Ditto.
3097         (WebCore::ThreadableLoader::create): Ditto.
3098         * loader/ThreadableLoader.h: Ditto.
3099         * loader/WorkerThreadableLoader.cpp: Ditto.
3100         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader): Ditto.
3101         (WebCore::WorkerThreadableLoader::loadResourceSynchronously): Ditto.
3102         * loader/WorkerThreadableLoader.h: Ditto.
3103         (WebCore::WorkerThreadableLoader::create): Ditto.
3104         * platform/network/ResourceRequestBase.cpp:
3105         (WebCore::ResourceRequestBase::hasHTTPReferrer): Added to enable asserting that no threadable loader client sets the referrer in the request.
3106         * platform/network/ResourceRequestBase.h:
3107
3108 2016-09-15  Dave Hyatt  <hyatt@apple.com>
3109
3110         [CSS Parser] Get CSSParserFastPaths.cpp compiling
3111         https://bugs.webkit.org/show_bug.cgi?id=162033
3112
3113         Reviewed by Dean Jackson.
3114
3115         * CMakeLists.txt:
3116         * WebCore.xcodeproj/project.pbxproj:
3117         Add new StyleColor.h/.cpp files to the projecty
3118
3119         * css/CSSFunctionValue.cpp:
3120         (WebCore::CSSFunctionValue::CSSFunctionValue):
3121         (WebCore::CSSFunctionValue::customCSSText):
3122         (WebCore::CSSFunctionValue::append):
3123         (WebCore::CSSFunctionValue::buildParserValueSubstitutingVariables):
3124         * css/CSSFunctionValue.h:
3125         Tweak CSSFunctionValue so that the name can be represented as a keyword ID instead of a String. Eventually we also
3126         want to make CSSFunctionValue subclass CSSValueList rather than referencing a separate CSSValueList as a member. For now
3127         I left that alone though in order to not change too much in the old parser.
3128
3129         * css/CSSProperty.cpp:
3130         (WebCore::CSSProperty::isDescriptorOnly):
3131         Whether or not a property is only a descriptor, e.g., used in viewport and font face stuff.
3132
3133         * css/CSSProperty.h:
3134         * css/CSSValueKeywords.in:
3135         Added new keywords for functions that can be used as values. The new parser uses keywords to represent function names.
3136
3137         * css/StyleColor.cpp: Added.
3138         (WebCore::StyleColor::colorFromKeyword):
3139         (WebCore::StyleColor::isColorKeyword):
3140         (WebCore::StyleColor::isSystemColor):
3141         * css/StyleColor.h: Added.
3142         (WebCore::StyleColor::StyleColor):
3143         (WebCore::StyleColor::currentColor):
3144         (WebCore::StyleColor::isCurrentColor):
3145         (WebCore::StyleColor::getColor):
3146         (WebCore::StyleColor::resolve):
3147         (WebCore::operator==):
3148         (WebCore::operator!=):
3149         New color helper that contains code for checking and looking up colors. This code is similar to some code we already
3150         had in the old CSSParser.cpp file, but this way it can be used outside the parser and/or in different files.
3151
3152         * css/parser/CSSParserFastPaths.cpp:
3153         (WebCore::parseSimpleLengthValue):
3154         (WebCore::isColorPropertyID):
3155         (WebCore::parseColorIntOrPercentage):
3156         (WebCore::fastParseColorInternal):
3157         (WebCore::CSSParserFastPaths::parseColor):
3158         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3159         (WebCore::isUniversalKeyword):
3160         (WebCore::parseKeywordValue):
3161         (WebCore::parseTransformTranslateArguments):
3162         (WebCore::parseTransformNumberArguments):
3163         (WebCore::parseSimpleTransformValue):
3164         (WebCore::transformCanLikelyUseFastPath):
3165         (WebCore::parseSimpleTransformList):
3166         (WebCore::parseSimpleTransform):
3167         (WebCore::CSSParserFastPaths::maybeParseValue):
3168         * css/parser/CSSParserFastPaths.h:
3169         Get everything compiling in this file. Key changes included reverting to our old unit names, making CSSFunctionValue compatible,
3170         adding support for StyleColor, adding support for mode checking of keywords, and fixing up the memory management model so that
3171         RefPtrs are used on returns from parsing functions.
3172
3173         * css/parser/CSSParserIdioms.cpp:
3174         (WebCore::isValueAllowedInMode):
3175         * css/parser/CSSParserIdioms.h:
3176         New helper function for restricting keywords to certain modes only. The -webkit-text color quirk has been moved to this function.
3177
3178 2016-09-15  Brady Eidson  <beidson@apple.com>
3179
3180         WKWebView.hasOnlySecureContent always returns "YES" after going back to a CachedPage (even if it has http resources).
3181         <rdar://problem/27681261> and https://bugs.webkit.org/show_bug.cgi?id=162043
3182
3183         Reviewed by Brent Fulgham. 
3184
3185         No new tests (Not possible with current testing infrastructure).
3186
3187         This adds the infrastructure for WebCore to track whether or not a CachedFrame had insecure content at the time
3188         it was cached, and then to report that back to the client when a CachedPage is restored.
3189
3190         Since "has insecure content" is currently only tracked in the WK2 UI process, that is the only client of this code.
3191
3192         * history/CachedFrame.cpp:
3193         (WebCore::CachedFrame::setHasInsecureContent):
3194         * history/CachedFrame.h:
3195         (WebCore::CachedFrame::hasInsecureContent):
3196
3197         * loader/EmptyClients.h:
3198
3199         * loader/FrameLoader.cpp:
3200         (WebCore::FrameLoader::receivedFirstData):
3201         (WebCore::FrameLoader::commitProvisionalLoad):
3202         (WebCore::FrameLoader::dispatchDidCommitLoad):
3203         * loader/FrameLoader.h:
3204
3205         * loader/FrameLoaderClient.h:
3206
3207         * loader/FrameLoaderTypes.h:
3208
3209 2016-09-13  Jer Noble  <jer.noble@apple.com>
3210
3211         [media-source] web-platform-test/media-source/mediasource-remove.html test failing
3212         https://bugs.webkit.org/show_bug.cgi?id=161950
3213
3214         Reviewed by Eric Carlson.
3215
3216         Fixes test: web-platform-test/media-source/mediasource-remove.html
3217
3218         The mediasource-remove.html test was failing in a number of ways:
3219
3220         - Tests with invalid start or end times were not throwing the correct exception
3221           code, or not throwing exception codes at all
3222
3223         - Tests were showing an incorrect start buffered range at the beginning of each test.
3224
3225         - Tests which removed samples were not getting the expected buffered values at the end
3226           each test.
3227
3228         For the exception failures, update the implementation of abort() and remove() to throw
3229         the correct exceptions at the correct times.
3230
3231         For the incorrect initial buffered range, update our buffered calculations to store
3232         individual PlatformTimeRanges on each TrackBuffer, and coalesce them into a single
3233         value when an append operation completes, a remove operation completes, or when the
3234         MediaSource's ready state changes.
3235
3236         For the incorrect buffered ranges after removal, this is caused because the "samples"
3237         that make up an audio track are actually a collection of a large number of individual
3238         samples.  So when we are asked to remove media data in a given range, break these audio
3239         meta-samples into two pieces at the removal points. This allows the removal algorithm
3240         to operate on a individual audio sample basis. (We should look into using this technique
3241         when audio samples are evicted during an append operation.) This requires adding some
3242         methods to MediaSample and it's concrete subclasses to "divide" a sample into two at
3243         a given presentation time.
3244
3245         Fixing these behaviors, however, breaks the media-source-end-of-stream-buffered.html
3246         test, which expects the buffered range for the entire element to expand to the maximum
3247         buffered time of any of the element's MediaSource's active sourceBuffers. To fix this,
3248         update the MediaSource's monitorSourceBuffer() implementation to match the current
3249         specification. The new spec no longer queries the individual SourceBuffers, but rather
3250         queries the already coalesced buffered ranges. So move the helper methods hasCurrentTime()
3251         hasFutureTime(), and canPlayThrough() up into MediaSource from SourceBuffer. Also, update
3252         seekToTime, since it has the same problem as monitorSourceBuffer().
3253
3254         However, this breaks the media-source-monitor-source-buffers.html test, which appends
3255         10s of movie data instantaneously, then never appends again. The SourceBuffer's
3256         monitorBufferingRate() method only re-evaluates the rate after data has been appended,
3257         so the SourceBuffer thinks it's buffered data at a prodigious rate forever. Instead,
3258         allow the SourceBuffer to continuously re-evalute it's buffering rate by modifying the
3259         exponential moving average so that the co-efficient scales based on how frequently the
3260         method is called. Call the method more often, and the moving average changes less quickly,
3261         and it means that when media is stalled out at the end of a buffered range, the readyState
3262         of a video element will eventually drop to HAVE_CURRENT_DATA when the average buffering
3263         rate falls below the level where playback would continue uninterrupted.
3264
3265         * Modules/mediasource/MediaSource.cpp:
3266         (WebCore::MediaSource::seekToTime):
3267         (WebCore::MediaSource::currentTimeFudgeFactor):
3268         (WebCore::MediaSource::hasBufferedTime):
3269         (WebCore::MediaSource::hasCurrentTime):
3270         (WebCore::MediaSource::hasFutureTime):
3271         (WebCore::MediaSource::monitorSourceBuffers):
3272         * Modules/mediasource/MediaSource.h:
3273         * Modules/mediasource/SourceBuffer.cpp:
3274         (WebCore::SourceBuffer::abort):
3275         (WebCore::SourceBuffer::remove):
3276         (WebCore::SourceBuffer::abortIfUpdating):
3277         (WebCore::SourceBuffer::removeCodedFrames):
3278         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3279         (WebCore::SourceBuffer::updateBufferedFromTrackBuffers):
3280         (WebCore::SourceBuffer::canPlayThroughRange):
3281         (WebCore::SourceBuffer::monitorBufferingRate):
3282         (WebCore::currentTimeFudgeFactor): Deleted.
3283         (WebCore::SourceBuffer::hasCurrentTime): Deleted.
3284         (WebCore::SourceBuffer::hasFutureTime): Deleted.
3285         (WebCore::SourceBuffer::canPlayThrough): Deleted.
3286         * platform/MediaSample.h:
3287         * platform/cf/CoreMediaSoftLink.cpp:
3288         * platform/cf/CoreMediaSoftLink.h:
3289         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
3290         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
3291         (WebCore::MediaSampleAVFObjC::isDivisable):
3292         (WebCore::MediaSampleAVFObjC::divide):
3293         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
3294
3295 2016-09-15  Zalan Bujtas  <zalan@apple.com>
3296
3297         ASSERTION FAILED: willBeComposited == needsToBeComposited(layer) in WebCore::RenderLayerCompositor::computeCompositingRequirements
3298         https://bugs.webkit.org/show_bug.cgi?id=151097
3299         <rdar://problem/27711678>
3300
3301         Reviewed by Simon Fraser.
3302
3303         This patch ensures that when will-change property triggers stacking context, we make the associated layer a non-normal flow layer.
3304         (This is similar to what any other stacking context-triggering CSS property does.)  
3305
3306         Test: compositing/assert-on-will-change-transform-with-composited-descendant.html
3307
3308         * rendering/RenderLayer.cpp:
3309         (WebCore::RenderLayer::calculateClipRects):
3310
3311 2016-09-15  Zalan Bujtas  <zalan@apple.com>
3312
3313         Move RenderObject::shouldRespectImageOrientation to RenderElement.
3314         https://bugs.webkit.org/show_bug.cgi?id=162028
3315
3316         Reviewed by Antti Koivisto.
3317
3318         Tighten the type for imageSizeForRenderer/canRender so that RenderObject::shouldRespectImageOrientation could
3319         be moved to RenderElement.
3320
3321         No change in functionality.
3322
3323         * loader/cache/CachedImage.cpp:
3324         (WebCore::CachedImage::imageSizeForRenderer):
3325         * loader/cache/CachedImage.h:
3326         * rendering/RenderElement.cpp:
3327         (WebCore::RenderElement::shouldRespectImageOrientation):
3328         * rendering/RenderElement.h:
3329         * rendering/RenderObject.cpp:
3330         (WebCore::RenderObject::shouldRespectImageOrientation): Deleted.
3331         * rendering/RenderObject.h:
3332         * rendering/style/StyleCachedImage.cpp:
3333         (WebCore::StyleCachedImage::canRender):
3334         * rendering/style/StyleCachedImage.h:
3335         * rendering/style/StyleImage.h:
3336         (WebCore::StyleImage::canRender):
3337
3338 2016-09-15  Anders Carlsson  <andersca@apple.com>
3339
3340         Fix build.
3341
3342         * platform/spi/cocoa/PassKitSPI.h:
3343
3344 2016-09-15  Alex Christensen  <achristensen@webkit.org>
3345
3346         Use character class table in URLParser
3347         https://bugs.webkit.org/show_bug.cgi?id=161997
3348
3349         Reviewed by Chris Dumez.
3350
3351         No change in behavior except a performance improvement.
3352         
3353         Before this change, URLParser took 1.514x as long to run my URL Parsing benchmark as URL::parse
3354         with a standard deviation of the ration of the runtimes of 0.063 after 8 runs with each parser.
3355         After this change, URLParser took 1.328x as long with a standard deviation of 0.037.
3356         This isn't the cleanest data, but it's enough to convince me that this is a significant improvement.
3357
3358         * platform/URLParser.cpp:
3359         (WebCore::isC0Control):
3360         (WebCore::isC0ControlOrSpace):
3361         (WebCore::isTabOrNewline):
3362         (WebCore::isInSimpleEncodeSet):
3363         (WebCore::isInDefaultEncodeSet):
3364         (WebCore::isInUserInfoEncodeSet):
3365         (WebCore::isInvalidDomainCharacter):
3366         (WebCore::isSlashQuestionOrHash):
3367         (WebCore::shouldPercentEncodeQueryByte):
3368         (WebCore::shouldCopyFileURL):
3369         (WebCore::isSingleDotPathSegment):
3370         (WebCore::URLParser::parse):
3371
3372 2016-09-15  Keith Miller  <keith_miller@apple.com>
3373
3374         Pragma out undefined-var-template warnings in JSC for JSObjects that are templatized
3375         https://bugs.webkit.org/show_bug.cgi?id=161985
3376
3377         Reviewed by Alex Christensen.
3378
3379         Delete unneeded using, which broke the build on newer versions of clang.
3380
3381         * bridge/objc/WebScriptObject.mm:
3382
3383 2016-09-15  Alex Christensen  <achristensen@webkit.org>
3384
3385         URLParser: Check for invalid characters in the host
3386         https://bugs.webkit.org/show_bug.cgi?id=162023
3387
3388         Reviewed by Tim Horton.
3389
3390         Covered by new API tests.
3391
3392         * platform/URLParser.cpp:
3393         (WebCore::URLParser::failure):
3394         (WebCore::URLParser::parseHost):
3395
3396 2016-09-15  Antti Koivisto  <antti@apple.com>
3397
3398         Remove some extra spaces.
3399
3400         * rendering/TextDecorationPainter.cpp:
3401         (WebCore::collectStylesForRenderer):
3402
3403 2016-09-15  Alex Christensen  <achristensen@webkit.org>
3404
3405         Use efficient iterators in URLParser
3406         https://bugs.webkit.org/show_bug.cgi?id=162007
3407
3408         Reviewed by Tim Horton.
3409
3410         URLParser used to use StringView::CodePoints::Iterator, which needs to check if
3411         the StringView is 8-bit or 16-bit every time it does anything.
3412         I wrote a new CodePointIterator template which already knows whether it is iterating
3413         8-bit or 16-bit characters, so it does not need to do the checks each time it gets a
3414         code point or advances to the next code point.
3415
3416         No change in behavior except a performance increase.
3417         Covered by existing tests.
3418
3419         * platform/URLParser.cpp:
3420         (WebCore::CodePointIterator::CodePointIterator):
3421         (WebCore::CodePointIterator::operator==):
3422         (WebCore::CodePointIterator::operator!=):
3423         (WebCore::CodePointIterator::operator=):
3424         (WebCore::CodePointIterator::atEnd):
3425         (WebCore::CodePointIterator<LChar>::operator):
3426         (WebCore::CodePointIterator<UChar>::operator):
3427         (WebCore::isWindowsDriveLetter):
3428         (WebCore::shouldCopyFileURL):
3429         (WebCore::isPercentEncodedDot):
3430         (WebCore::isSingleDotPathSegment):