1e4a77be43c2c18f27dac0cb49b22da97f110344
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-07-07  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Replace scoped flag in Event by composed flag
4         https://bugs.webkit.org/show_bug.cgi?id=158415
5
6         Reviewed by Chris Dumez.
7
8         Replace `scoped` flag with `composed` flag and negate its meaning per the latest spec:
9         https://dom.spec.whatwg.org/#dom-event-composed
10         https://github.com/w3c/webcomponents/issues/513
11
12         In the old spec, every event was assumed to be "composed" (crosses shadow boundaries)
13         by default and there was `scoped` flag which prevented the event from crossing bondaries,
14         and there was a handful of events for which `scoped` was set true when dispatched by UA.
15
16         In the new spec, every event is assumed to be "scoped" and a handful of user-initiated
17         events set `composed` flag to true, which is also exposed in EventInit dictionary.
18         `relatedTargetScoped` flag has been removed. New behavior is identical to when this flag
19         was set to true.
20
21         No new tests since existing tests are updated to test the new flag and behavior.
22
23         * dom/CompositionEvent.cpp:
24         (WebCore::CompositionEvent::isCompositionEvent): Added.
25         * dom/CompositionEvent.h:
26         * dom/Event.cpp:
27         (WebCore::Event::Event): Initialize m_composed. Also re-ordered m_type and m_isInitialized
28         for better packing.
29         (WebCore::Event::composed): Renamed from Event::composed. We return true whenever composed
30         is set to true in EventInit, or the engine is dispatching an user-initiated event listed in:
31         https://github.com/w3c/webcomponents/issues/513#issuecomment-224183937
32         as well as keypress, cut, paste, and, copy as discussed in:
33         https://github.com/w3c/webcomponents/issues/513#issuecomment-230988170
34         (WebCore::Event::isCompositionEvent): Added.
35         * dom/Event.h:
36         (WebCore::Event::composed): Added.
37         (WebCore::Event::scoped): Deleted.
38         (WebCore::Event::relatedTargetScoped): Deleted.
39         (WebCore::Event): Reordered m_type and m_isInitialized for better packing. Added m_composed
40         and removed m_scoped and m_relatedTargetScoped.
41         * dom/Event.idl:
42         * dom/EventPath.cpp:
43         (WebCore::shouldEventCrossShadowBoundary): Returns true if the event did not originate from
44         a shadow tree (this event entered the current shadow tree via a slot so we need to proceed with
45         the normal bubble path outside the shadow tree) or composed flag is set true.
46         (WebCore::EventPath::EventPath): m_event no longer exists, which was only used to get the value
47         of relatedTargetScoped which has been removed.
48         (WebCore::EventPath::setRelatedTarget): Behave as if relatedTargetScoped is always set true
49         since the flag has been removed.
50         * dom/EventPath.h:
51         * dom/FocusEvent.cpp:
52         (WebCore::FocusEvent::relatedTargetScoped): Deleted.
53         * dom/FocusEvent.h:
54         * dom/MouseEvent.cpp:
55         (WebCore::MouseEvent::relatedTargetScoped): Deleted.
56         * dom/MouseEvent.h:
57
58 2016-07-07  Chris Dumez  <cdumez@apple.com>
59
60         tdody.deleteRow(-1) and tr.deleteCell(-1) should not throw when there are no rows / cells
61         https://bugs.webkit.org/show_bug.cgi?id=159527
62         <rdar://problem/27232261>
63
64         Reviewed by Alex Christensen.
65
66         tdody.deleteRow(-1) and tr.deleteCell(-1) should not throw when there
67         are no rows / cells:
68         - https://html.spec.whatwg.org/multipage/tables.html#dom-tbody-deleterow
69         - https://html.spec.whatwg.org/multipage/tables.html#dom-tr-deletecell
70
71         Firefox and Chrome do not throw but WebKit was throwing.
72
73         No new tests, rebaselined existing tests.
74
75         * html/HTMLTableRowElement.cpp:
76         (WebCore::HTMLTableRowElement::deleteCell):
77         * html/HTMLTableSectionElement.cpp:
78         (WebCore::HTMLTableSectionElement::deleteRow):
79
80 2016-07-07  Chris Dumez  <cdumez@apple.com>
81
82         HTMLTitleElement.text should only account for direct children Text nodes
83         https://bugs.webkit.org/show_bug.cgi?id=159536
84
85         Reviewed by Ryosuke Niwa.
86
87         HTMLTitleElement.text should only account for direct children Text nodes:
88         - https://html.spec.whatwg.org/multipage/semantics.html#dom-title-text
89         - https://html.spec.whatwg.org/multipage/infrastructure.html#child-text-content
90
91         Firefox and Chrome match the specification. However, WebKit accounted for all
92         Text nodes that are descendants, not just children. This patch aligns our
93         behavior with the specification and other browsers.
94
95         No new tests, rebaselined existing tests.
96
97         * html/HTMLTitleElement.cpp:
98         (WebCore::HTMLTitleElement::text):
99
100 2016-07-07  Dean Jackson  <dino@apple.com>
101
102         REGRESSION(r200769): animations are no longer overridden
103         https://bugs.webkit.org/show_bug.cgi?id=159450
104         <rdar://problem/27120570>
105
106         Reviewed by Zalan Bujtas.
107
108         The change in r200769 removed a lot of the prefixing variant
109         handling, but unfortunately we can't be completely rid
110         of it until we alias the prefixed transitions and animations
111         to the non-prefixed form. For example, setting the prefixed
112         shorthand has to reset the non-prefixed longhands.
113
114         The fix was to explicitly call the variant forms when
115         parsing such longhands, and make sure that MutableStyleProperties
116         removes all prefixed variants when removing shorthands.
117
118         The existing test was amended to cover this case:
119         fast/css/shorthand-omitted-initial-value-overrides-shorthand.html
120
121         * css/CSSParser.cpp:
122         (WebCore::CSSParser::parseAnimationShorthand):
123         (WebCore::CSSParser::addPropertyWithPrefixingVariant):
124         (WebCore::CSSParser::parseTransitionShorthand):
125         * css/CSSParser.h:
126         * css/StyleProperties.cpp:
127         (WebCore::MutableStyleProperties::removeShorthandProperty):
128
129 2016-07-07  Alex Christensen  <achristensen@webkit.org>
130
131         Fix CMake build.
132
133         * PlatformMac.cmake:
134
135 2016-07-07  Alex Christensen  <achristensen@webkit.org>
136
137         Fix CMake build.
138
139         * PlatformMac.cmake:
140
141 2016-07-07  Myles C. Maxfield  <mmaxfield@apple.com> and Frédéric Wang  <fred.wang@free.fr>
142
143         [Font Loading] The callback passed to document.fonts.ready should always be called
144         https://bugs.webkit.org/show_bug.cgi?id=158884
145
146         Reviewed by Dean Jackson.
147
148         The boolean was simply not being reset when loads start.
149
150         Test: fast/text/font-face-set-ready-fire.html
151
152         * css/FontFaceSet.cpp:
153         (WebCore::FontFaceSet::startedLoading):
154         * css/FontFaceSet.h:
155
156 2016-07-07  Andy Estes  <aestes@apple.com>
157
158         [Content Filtering] Load blocked pages more like other error pages are loaded
159         https://bugs.webkit.org/show_bug.cgi?id=159485
160         <rdar://problem/26014076>
161
162         Reviewed by Brady Eidson.
163
164         Content filter blocked pages were being loaded by cancelling the provisional load of the
165         page that was blocked and then scheduling a navigation to the content filter error page.
166         Some clients would not expect a new, Web process-initiated provisional navigation to start
167         after a cancellation, though, and this would put them in a bad state.
168         
169         This patch changes blocked page loading to behave more like loading other error pages.
170         Specifically:
171         1. didFailProvisionalLoad is dispatched with a new, non-cancellation error code.
172         2. The blocked page is loaded immediately after dispatching didFailProvisionalLoad, which
173            prevents FrameLoader from creating a new back-forward list item for the substitute data load.
174         3. A substitute data load initiated by the client for the blocked URL is ignored if
175            ContentFilter will display its own error page.
176         4. A file: URL is used instead of a custom scheme for the base URL of the blocked page,
177            since some clients expect this.
178
179         Updated existing tests to capture frame load delegate callbacks and the back forward list.
180         Added new API tests: ContentFiltering.LoadAlternate*.
181
182         * English.lproj/Localizable.strings: Added a WebKitErrorFrameLoadBlockedByContentFilter description.
183         * Resources/ContentFilterBlockedPage.html: Added.
184         * WebCore.xcodeproj/project.pbxproj: Added ContentFilterBlockedPage.html as a frameowrk resource.
185         * loader/ContentFilter.cpp:
186         (WebCore::ContentFilter::stopFilteringMainResource): Only set m_state to Stopped if not
187         already Blocked, so that we don't forget this ContentFilter was blocked when calling
188         cancelMailResourceLoad() in didDecide().
189         (WebCore::ContentFilter::didDecide): Moved code from DocumentLoader::contentFilterDidBlock() to here.
190         Created a blockedByContentFilterError() and called cancelMainResourceLoad().
191         (WebCore::blockedPageURL): Returned a file: URL to ContentFilterBlockedPage.html in WebCore.framework.
192         (WebCore::ContentFilter::continueAfterSubstituteDataRequest): If the substitute data load
193         is for the same failingURL as the currently-displayed blocked page, ignore it.
194         (WebCore::ContentFilter::handleProvisionalLoadFailure): Load the blocked page if m_state is Blocked
195         and the ResourceError matches the error we used when previously calling cancelMainResourceLoad().
196         (WebCore::ContentFilter::unblockHandler): Deleted.
197         (WebCore::ContentFilter::replacementData): Deleted.
198         (WebCore::ContentFilter::unblockRequestDeniedScript): Deleted.
199         * loader/ContentFilter.h:
200         * loader/DocumentLoader.cpp:
201         (WebCore::DocumentLoader::contentFilter): Returned m_contentFilter.
202         (WebCore::DocumentLoader::installContentFilterUnblockHandler): Deleted.
203         (WebCore::DocumentLoader::contentFilterDidBlock): Deleted.
204         * loader/DocumentLoader.h:
205         * loader/EmptyClients.h: Added a default implementation of blockedByContentFilterError().
206         * loader/FrameLoader.cpp:
207         (WebCore::FrameLoader::load): If m_loadType was already RedirectWithLockedBackForwardList
208         and we are loading subsitute data for a failing URL, continue to use RedirectWithLockedBackForwardList.
209         This prevents a new back-forward list item from being created when loading a blocked page in a subframe.
210         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
211         Called ContentFilter::handleProvisionalLoadFailure() after dispatchDidFailProvisionalLoad().
212         (WebCore::FrameLoader::blockedByContentFilterError): Called FrameLoaderClient::blockedByContentFilterError().
213         * loader/FrameLoader.h:
214         * loader/FrameLoaderClient.h:
215         * loader/NavigationScheduler.cpp:
216         (WebCore::ScheduledSubstituteDataLoad::ScheduledSubstituteDataLoad): Deleted.
217         (WebCore::NavigationScheduler::scheduleSubstituteDataLoad): Deleted.
218         * loader/NavigationScheduler.h:
219         * loader/PolicyChecker.cpp:
220         (WebCore::PolicyChecker::checkNavigationPolicy): Ignored a substitute data load for a
221         failing URL if ContentFilter::continueAfterSubstituteDataRequest() returns false.
222
223 2016-07-07  Chris Dumez  <cdumez@apple.com>
224
225         td / th should be exposed as HTMLTableCellElement objects
226         https://bugs.webkit.org/show_bug.cgi?id=159518
227         <rdar://problem/27225436>
228
229         Reviewed by Ryosuke Niwa.
230
231         td / th should be exposed as HTMLTableCellElement objects:
232         - https://html.spec.whatwg.org/multipage/tables.html#the-td-element
233         - https://html.spec.whatwg.org/multipage/tables.html#the-th-element
234
235         We were using HTMLTableDataCellElement / HTMLTableHeaderCellElement
236         sub-types.
237
238         Firefox and Chrome match the current specification.
239
240         We actually introduced these types recently via Bug 148859 to align
241         with an older version of the HTML specification. However, it seems the
242         specification has been updated to match Firefox / Chrome in the mean
243         time.
244
245         Since we have not shipped those subtypes yet, the compatibility risk is
246         low.
247
248         No new tests, rebaselined existing tests.
249
250         * CMakeLists.txt:
251         * DerivedSources.cpp:
252         * DerivedSources.make:
253         * WebCore.xcodeproj/project.pbxproj:
254         * html/HTMLElementsAllInOne.cpp:
255         * html/HTMLTableCellElement.cpp:
256         (WebCore::HTMLTableCellElement::create):
257         (WebCore::HTMLTableCellElement::scope):
258         (WebCore::HTMLTableCellElement::setScope):
259         (WebCore::HTMLTableCellElement::setRowSpanForBindings): Deleted.
260         * html/HTMLTableCellElement.h:
261         * html/HTMLTableCellElement.idl:
262         * html/HTMLTableDataCellElement.h: Removed.
263         * html/HTMLTableDataCellElement.idl: Removed.
264         * html/HTMLTableHeaderCellElement.cpp: Removed.
265         * html/HTMLTableHeaderCellElement.h: Removed.
266         * html/HTMLTableHeaderCellElement.idl: Removed.
267         * html/HTMLTableRowElement.cpp:
268         (WebCore::HTMLTableRowElement::insertCell):
269         * html/HTMLTagNames.in:
270
271 2016-07-07  Brady Eidson  <beidson@apple.com>
272
273         Modern IDB: When IDBDatabase objects are garbage collected, they don't close their server connection.
274         <rdar://problem/25910345> and https://bugs.webkit.org/show_bug.cgi?id=159523
275
276         Reviewed by Alex Christensen.
277
278         Tests: storage/indexeddb/modern/gc-closes-database-private.html
279                storage/indexeddb/modern/gc-closes-database.html
280
281         * Modules/indexeddb/IDBDatabase.cpp:
282         (WebCore::IDBDatabase::IDBDatabase): New logging.
283         (WebCore::IDBDatabase::~IDBDatabase): Close server connection.
284         (WebCore::IDBDatabase::fireVersionChangeEvent): New logging.
285         (WebCore::IDBDatabase::dispatchEvent): New logging.
286
287         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
288         (WebCore::IDBClient::IDBConnectionToServer::openDatabase): New logging.
289
290 2016-07-07  Frederic Wang  <fwang@igalia.com>
291
292         Refactor layout functions to avoid using flexbox in MathML
293         https://bugs.webkit.org/show_bug.cgi?id=153991
294
295         Reviewed by Brent Fulgham.
296
297         No new tests, already covered by existing tests.
298
299         * css/mathml.css:
300         (math): Change inline mathematical formulas from inline-flex to inline.
301         (math[display="block"]): Change display mathematical formulas from flex to block and
302         remove flexbox property justify-content.
303         (ms, mspace, mtext, mi, mn, mo, mrow, mfenced, mfrac, msub, msup, msubsup, mmultiscripts,
304          mprescripts, none, munder, mover, munderover, msqrt, mroot, merror, mphantom, mstyle)
305          menclose, semantics, mpadded, maction): In order to render properly, all children of the
306          classes derived from RenderMathMLBlock must now be block-level. So we add more elements in
307          this list and update the display property.
308         (mtd > *): However, we use inline-block for children of the cell so that the text-align
309          property is taken into account.
310         * rendering/RenderBox.cpp:
311         (WebCore::RenderBox::computeLogicalWidthInRegion): Add a special case for RenderMathMLBlock
312         to preserve the old behavior.
313         (WebCore::RenderBox::sizesLogicalWidthToFitContent): Ditto.
314         * rendering/RenderFlexibleBox.h: No need to override layoutBlock anymore.
315         * rendering/mathml/RenderMathMLBlock.cpp: Include LayoutRepainter header for use in layoutBlock.
316         (WebCore::RenderMathMLBlock::RenderMathMLBlock): Inherit from RenderBlock and ensure that
317         our children are block-level.
318         (WebCore::RenderMathMLBlock::~RenderMathMLBlock): Added.
319         (WebCore::RenderMathMLBlock::baselinePosition): If the baselinefirstLineBaseline() is
320         undefined, just returns 0.
321         (WebCore::RenderMathMLBlock::paint): Call RenderBlock::paint.
322         (WebCore::RenderMathMLBlock::layoutItems): Implement a simplified version of
323         RenderFlexibleBox::layoutItems where we assume horizontal layout for all children.
324         (WebCore::RenderMathMLBlock::layoutBlock): Add a basic implementation based on
325         RenderFlexibleBox::layoutBlock.
326         (WebCore::RenderMathMLBlock::renderName): Deleted. There is now a simple implementation in the header.
327         * rendering/mathml/RenderMathMLBlock.h: Use RenderBlock instead of RenderFlexibleBox and
328         define layout functions. Define avoidsFloats and canDropAnonymousBlockChild to preserve
329         the old behavior and remove isFlexibleBoxImpl.
330         * rendering/mathml/RenderMathMLFenced.cpp:
331         (WebCore::RenderMathMLFenced::createMathMLOperator): Use block for anonymous RenderMathMLOperator.
332         * rendering/mathml/RenderMathMLRow.cpp:
333         (WebCore::RenderMathMLRow::layoutRowItems): No need to handle the flexbox case anymore.
334         (WebCore::RenderMathMLRow::paintChildren): Deleted. We now just use RenderBlock::paintChildren.
335         * rendering/mathml/RenderMathMLRow.h:
336         * rendering/mathml/RenderMathMLFraction.cpp:
337         (WebCore::RenderMathMLFraction::paintChildren): Deleted. We now just use RenderBlock::paintChildren.
338         * rendering/mathml/RenderMathMLFraction.h:
339         * rendering/mathml/RenderMathMLRoot.cpp:
340         (WebCore::RenderMathMLRoot::paintChildren): Deleted. We now just use RenderBlock::paintChildren.
341         * rendering/mathml/RenderMathMLRoot.h:
342         * rendering/mathml/RenderMathMLScripts.cpp:
343         (WebCore::RenderMathMLScripts::paintChildren): Deleted. We now just use RenderBlock::paintChildren.
344         * rendering/mathml/RenderMathMLScripts.h:
345         * rendering/mathml/RenderMathMLUnderOver.cpp:
346         (WebCore::RenderMathMLUnderOver::paintChildren): Deleted. We now just use RenderBlock::paintChildren.
347         * rendering/mathml/RenderMathMLUnderOver.h:
348
349 2016-07-07  Antti Koivisto  <antti@apple.com>
350
351         REGRESSION (r199054): CrashTracer: [USER] parseWebKit at WebCore: WebCore::RenderBlockFlow::checkFloatsInCleanLine + 107
352         https://bugs.webkit.org/show_bug.cgi?id=159519
353
354         Reviewed by Zalan Bujtas.
355
356         Test: fast/inline/trailing-floats-inline-crash.html
357
358         * rendering/RenderBlockLineLayout.cpp:
359         (WebCore::RenderBlockFlow::checkFloatsInCleanLine):
360
361             Use the existing deletionHasBegun bit in RenderStyle to assert against this reliably.
362
363         * rendering/RenderLineBoxList.cpp:
364         (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
365
366             In some cases a special TrailingFloatsRootInlineBox may be added as the last root linebox of a flow.
367             If it is combined with br the existing invalidation that invalidates the next and previous line may
368             not be sufficient. Test for this case and invalidate the TrailingFloatsRootInlineBox too if it exists.
369
370         * rendering/RootInlineBox.h:
371         (WebCore::RootInlineBox::isTrailingFloatsRootInlineBox):
372         * rendering/TrailingFloatsRootInlineBox.h:
373         * rendering/style/RenderStyle.h:
374         (WebCore::RenderStyle::deletionHasBegun):
375
376             Expose the bit in debug.
377
378 2016-07-07  Alex Christensen  <achristensen@webkit.org>
379
380         Use SocketProvider to create WebSocketChannels
381         https://bugs.webkit.org/show_bug.cgi?id=158776
382
383         Reviewed by Brent Fulgham.
384
385         This patch should have no change in behavior except making an InvalidStateError in
386         conditions where we should not be able to do networking, like in a detached frame.
387         It just replaces ThreadableWebSocketChannel::create with SocketProvider::createWebSocketChannel
388         which does the same thing as ThreadableWebSocketChannel::create for Mac and 
389         Windows WebKit1.  The WebKit2 implementation is the same right now, but it will
390         be replaced by a proxy that will do the WebSocket operations in the NetworkProcess.
391
392         * Modules/websockets/ThreadableWebSocketChannel.cpp: Removed.
393         * Modules/websockets/ThreadableWebSocketChannel.h:
394         (WebCore::ThreadableWebSocketChannel::ThreadableWebSocketChannel):
395         * Modules/websockets/WebSocket.cpp:
396         (WebCore::WebSocket::connect):
397         * Modules/websockets/WebSocketChannel.h:
398         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
399         * WebCore.xcodeproj/project.pbxproj:
400         * dom/Document.cpp:
401         (WebCore::Document::idbConnectionProxy):
402         (WebCore::Document::socketProvider):
403         (WebCore::Document::canNavigate):
404         * dom/Document.h:
405         (WebCore::Document::notifyRemovePendingSheetIfNeeded):
406         * dom/ScriptExecutionContext.h:
407         * inspector/InspectorOverlay.cpp:
408         (WebCore::InspectorOverlay::overlayPage):
409         * loader/EmptyClients.cpp:
410         (WebCore::EmptyEditorClient::registerRedoStep):
411         (WebCore::EmptySocketProvider::createWebSocketChannel):
412         * loader/EmptyClients.h:
413         * page/Page.h:
414         * page/PageConfiguration.cpp:
415         (WebCore::PageConfiguration::PageConfiguration):
416         * page/PageConfiguration.h:
417         * page/SocketProvider.h:
418         (WebCore::SocketProvider::~SocketProvider):
419         * svg/graphics/SVGImage.cpp:
420         (WebCore::SVGImage::dataChanged):
421         * workers/DedicatedWorkerGlobalScope.cpp:
422         (WebCore::DedicatedWorkerGlobalScope::create):
423         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
424         * workers/DedicatedWorkerGlobalScope.h:
425         * workers/DedicatedWorkerThread.cpp:
426         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
427         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
428         (WebCore::DedicatedWorkerThread::runEventLoop):
429         * workers/DedicatedWorkerThread.h:
430         * workers/WorkerGlobalScope.cpp:
431         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
432         (WebCore::WorkerGlobalScope::disableEval):
433         (WebCore::WorkerGlobalScope::socketProvider):
434         (WebCore::WorkerGlobalScope::idbConnectionProxy):
435         * workers/WorkerGlobalScope.h:
436         (WebCore::WorkerGlobalScope::script):
437         * workers/WorkerMessagingProxy.cpp:
438         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
439         * workers/WorkerThread.cpp:
440         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
441         (WebCore::WorkerThread::WorkerThread):
442         (WebCore::WorkerThread::idbConnectionProxy):
443         (WebCore::WorkerThread::socketProvider):
444         * workers/WorkerThread.h:
445         (WebCore::WorkerThread::workerGlobalScope):
446
447 2016-07-07  Commit Queue  <commit-queue@webkit.org>
448
449         Unreviewed, rolling out r202905 and r202911.
450         https://bugs.webkit.org/show_bug.cgi?id=159522
451
452         This test is fails on El Capitan and Sierra WK1 (Requested by
453         ryanhaddad on #webkit).
454
455         Reverted changesets:
456
457         "Add a test for media control dropoff"
458         https://bugs.webkit.org/show_bug.cgi?id=151287
459         http://trac.webkit.org/changeset/202905
460
461         "Add a test for media control dropoff"
462         https://bugs.webkit.org/show_bug.cgi?id=151287
463         http://trac.webkit.org/changeset/202911
464
465 2016-07-07  Antoine Quint  <graouts@apple.com>
466
467         <img> with a wide gamut PDF does not display using a wide gamut color space
468         https://bugs.webkit.org/show_bug.cgi?id=158983
469         <rdar://problem/25720247>
470
471         Reviewed by Dean Jackson.
472
473         Calls to ImageBuffer::createCompatibleBuffer() that do not provide an explicit
474         color space will now infer the color space from the provided graphics context
475         on platforms using CG. The method signature that takes in a GraphicsContext
476         without a color space is now split into a CG-specified implementation and a
477         Cairo one to avoid having diverging platform code in ImageBuffer.cpp.
478
479         Some call sites need to provide an explicit color space still, so we add a new
480         ImageBuffer::createCompatibleBuffer() that allows for that while inferring
481         sizing and scaling from a GraphicsContext.
482         
483         All signatures of ImageBuffer::createCompatibleBuffer() are losing the
484         hasAlpha parameter which was always ignored. All call sites that were using
485         hasAlpha have been updated.
486
487         In addition, we make all the IOSurface and IOSurfacePool code, which is
488         CG-specific, use the plaform-specific type CGColorSpaceRef instead of ColorSpace
489         so that we may pick up on the color space copied over from the graphics context
490         in the CG-specific implementation of ImageBuffer::createCompatibleBuffer().
491
492         * html/canvas/CanvasRenderingContext2D.cpp:
493         (WebCore::CanvasRenderingContext2D::drawTextInternal):
494         * platform/graphics/BitmapImage.cpp:
495         (WebCore::BitmapImage::drawPattern):
496         * platform/graphics/GradientImage.cpp:
497         (WebCore::GradientImage::drawPattern):
498         * platform/graphics/ImageBuffer.cpp:
499         (WebCore::ImageBuffer::createCompatibleBuffer):
500         * platform/graphics/ImageBuffer.h:
501         * platform/graphics/NamedImageGeneratedImage.cpp:
502         (WebCore::NamedImageGeneratedImage::drawPattern):
503         * platform/graphics/cairo/ImageBufferCairo.cpp:
504         (WebCore::ImageBuffer::createCompatibleBuffer):
505         * platform/graphics/cg/IOSurfacePool.cpp:
506         (WebCore::surfaceMatchesParameters):
507         (WebCore::IOSurfacePool::takeSurface):
508         * platform/graphics/cg/IOSurfacePool.h:
509         * platform/graphics/cg/ImageBufferCG.cpp:
510         (WebCore::ImageBuffer::createCompatibleBuffer):
511         (WebCore::ImageBuffer::ImageBuffer):
512         * platform/graphics/cocoa/IOSurface.h:
513         * platform/graphics/cocoa/IOSurface.mm:
514         (WebCore::IOSurface::surfaceFromPool):
515         (WebCore::IOSurface::create):
516         (WebCore::IOSurface::createFromSendRight):
517         (WebCore::IOSurface::createFromSurface):
518         (WebCore::IOSurface::createFromImage):
519         (WebCore::IOSurface::IOSurface):
520         (WebCore::IOSurface::ensurePlatformContext):
521         * platform/mac/ThemeMac.mm:
522         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
523         * platform/spi/cg/CoreGraphicsSPI.h:
524         * rendering/RenderBoxModelObject.cpp:
525         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
526         * rendering/RenderThemeMac.mm:
527         (WebCore::RenderThemeMac::paintProgressBar):
528         * rendering/svg/SVGRenderingContext.cpp:
529         (WebCore::SVGRenderingContext::bufferForeground):
530         * svg/graphics/SVGImage.cpp:
531         (WebCore::SVGImage::drawPatternForContainer):
532
533 2016-07-07  Beth Dakin  <bdakin@apple.com>
534
535         All fullscreen videos should be able the control the controls manager
536         https://bugs.webkit.org/show_bug.cgi?id=159496
537         -and corresponding-
538         rdar://problem/27009446
539
540         Reviewed by Eric Carlson.
541
542         * html/HTMLMediaElement.cpp:
543         (WebCore::HTMLMediaElement::fullscreenModeChanged):
544         * html/MediaElementSession.cpp:
545         (WebCore::MediaElementSession::canControlControlsManager):
546
547 2016-07-07  Jer Noble  <jer.noble@apple.com>
548
549         Crash due to HTMLMediaElement at JavaScriptCore: JSC::JSLockHolder::JSLockHolder
550         https://bugs.webkit.org/show_bug.cgi?id=159517
551         <rdar://problem/27221109>
552
553         Reviewed by Eric Carlson.
554
555         When WebKit on iOS gets a notification that the UIProcess has been backgrounded, it sends an
556         interruption event to the WebProcess to pause any playing HTMLMediaElements. When the
557         elements which get this interruption have pending promises created during a previous call to
558         play(), these promises get rejected.
559
560         However, if the HTMLMediaElement's document has already been destroyed, the pending Promises
561         are in an inconsistent state: their script execution context (the document) has been
562         destroyed, leading to the crash in JSLockHolder.
563
564         When HTMLMediaElement is notified that its ScriptExecutionContext has been destroyed, also
565         clear the list of pending Promises.
566
567         * html/HTMLMediaElement.cpp:
568         (WebCore::HTMLMediaElement::contextDestroyed):
569
570 2016-07-05  Jer Noble  <jer.noble@apple.com>
571
572         Facebook videos without audio tracks will sometimes cause playback controls to appear.
573         https://bugs.webkit.org/show_bug.cgi?id=159437
574
575         Reviewed by Eric Carlson.
576
577         Because updatePlaybackControlsManager() will cause the session manager to walk through all
578         the outstanding sessions asking if it canControlControlsManager(), some sessions will say
579         they can control the controls manager if we are currently processing a user gesture. This is
580         obviously not intended (there may be a user gesture to un-mute video 1, but an unrelated
581         video 2 should not be allowed to use that use gesture to fulfill its own requirements.)
582
583         So in those situations where conditions may have changed and updatePlaybackControlsManager()
584         needs to be called, instead schedule the update for the next run loop.
585         
586         * html/HTMLMediaElement.cpp:
587         (WebCore::HTMLMediaElement::setMuted):
588         (WebCore::HTMLMediaElement::layoutSizeChanged):
589         (WebCore::HTMLMediaElement::updatePlayState):
590         (WebCore::HTMLMediaElement::createMediaPlayer):
591         (WebCore::HTMLMediaElement::scheduleUpdatePlaybackControlsManager):
592         * html/HTMLMediaElement.h:
593
594 2016-07-07  Jer Noble  <jer.noble@apple.com>
595
596         Unreviewed build fix after r202908. Fix the webPlaybackSessionInterfaceMac @property.
597
598         * platform/mac/WebPlaybackControlsManager.h:
599         * platform/mac/WebPlaybackControlsManager.mm:
600
601 2016-07-07  Youenn Fablet  <youenn@apple.com>
602
603         [Fetch API] Response constructor should throw in case of bad reason phrase
604         https://bugs.webkit.org/show_bug.cgi?id=159508
605
606         Reviewed by Alex Christensen.
607
608         Covered by rebased test.
609
610         * Modules/fetch/FetchResponse.cpp:
611         (WebCore::FetchResponse::initializeWith): Validating reason phrase with new routine.
612         Throwing a TypeError in case of error.
613         * platform/network/HTTPParsers.cpp:
614         (WebCore::isValidReasonPhrase): Added to validate reason phrase according
615         https://tools.ietf.org/html/rfc7230#section-3.1.2
616         * platform/network/HTTPParsers.h:
617
618 2016-07-07  Youenn Fablet  <youenn@apple.com>
619
620         [Fetch API] Response.redirect should throw a RangeError in case of bad status code
621         https://bugs.webkit.org/show_bug.cgi?id=159507
622
623         Reviewed by Alex Christensen.
624
625         Covered by rebased test.
626
627         * Modules/fetch/FetchResponse.cpp:
628         (WebCore::FetchResponse::redirect): Throw a RangeError in case of bad status.
629
630 2016-07-05  Jer Noble  <jer.noble@apple.com>
631
632         Ownership between WebPlaybackSessionInterfaceMac and WebPlaybackControlsManager is backwards.
633         https://bugs.webkit.org/show_bug.cgi?id=159441
634
635         Reviewed by Eric Carlson.
636
637         The WebPlaybackControlsManager should own the WebPlaybackSessionInterfaceMac, and not
638         vice versa.
639
640         * platform/mac/WebPlaybackControlsManager.h:
641         * platform/mac/WebPlaybackControlsManager.mm:
642         (-[WebPlaybackControlsManager webPlaybackSessionInterfaceMac]):
643         (-[WebPlaybackControlsManager setWebPlaybackSessionInterfaceMac:]):
644         * platform/mac/WebPlaybackSessionInterfaceMac.h:
645         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
646         (WebCore::WebPlaybackSessionInterfaceMac::playBackControlsManager):
647
648 2016-07-07  Eric Carlson  <eric.carlson@apple.com>
649
650         Add a test for media control dropoff
651         https://bugs.webkit.org/show_bug.cgi?id=151287
652         <rdar://problem/23544666>
653
654         Reviewed by Antoine Quint.
655
656         Test: media/controls/inline-elements-dropoff-order.html
657
658         * Modules/mediacontrols/mediaControlsApple.js: Expose more state to testing.
659
660 2016-07-07  Miguel Gomez  <magomez@igalia.com>
661
662         [GTK] Painting a video into a canvas doesn't work when accelerated compositing is enabled
663         https://bugs.webkit.org/show_bug.cgi?id=159405
664
665         Reviewed by Xabier Rodriguez-Calvar.
666
667         Implement video frame painting to the canvas when accelerated compositing is enabled.
668
669         Already covered by existent tests.
670
671         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
672         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
673         Replace custom enumeration for the video rotation with the ImageOrientation class.
674         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
675         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize):
676         Replace the orientation value comparison with ImageOrientation::usesWidthAsHeight().
677         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
678         Perform the frame painting taking into account the video orientation tag.
679         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
680         Rotate the native image before returning it.
681         (WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation):
682         Replace custom enumeration for the video rotation with the ImageOrientation class.
683         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase): Deleted.
684         Remove orientation initialization.
685         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
686         Remove custom enumeration for the video orientation.
687
688 2016-07-07  Philippe Normand  <pnormand@igalia.com>
689
690         [GStreamer][GL] switch to appsink
691         https://bugs.webkit.org/show_bug.cgi?id=159466
692
693         Reviewed by Carlos Garcia Campos.
694
695         Fakesink is mostly used for tests. Appsink provides the same
696         functionality and is actually meant to be used on application
697         side.
698
699         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
700         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
701         (WebCore::newSampleCallback):
702         (WebCore::newPrerollCallback):
703         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
704         (WebCore::MediaPlayerPrivateGStreamerBase::drawCallback): Deleted.
705         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
706
707 2016-07-06  Chris Dumez  <cdumez@apple.com>
708
709         Document.title setter does not work for SVG documents
710         https://bugs.webkit.org/show_bug.cgi?id=159503
711         <rdar://problem/27212313>
712
713         Reviewed by Ryosuke Niwa.
714
715         Document.title setter should work for SVG documents:
716         - https://html.spec.whatwg.org/multipage/dom.html#document.title
717
718         This patch aligns our behavior with the specification
719         and with Firefox / Chrome.
720
721         No new tests, rebaselined existing test.
722
723         * dom/Document.cpp:
724         (WebCore::Document::setTitle):
725         - Reverse the if conditions for clarity.
726         - If the document element is an SVG svg element, create a
727           SVGTitleElement and insert it as first child of the
728           document element.
729         - Call SVGTitleElement::setText() instead of
730           HTMLTitleElement::setText() at the end of the method if
731           m_titleElement is a SVGTitleElement.
732
733         (WebCore::Document::updateTitleElement):
734         - If document element is an SVG svg element, use the first
735           child of the document element that is a SVGTitleElement.
736
737         * svg/SVGTitleElement.cpp:
738         (WebCore::SVGTitleElement::setText):
739         * svg/SVGTitleElement.h:
740         Add SVGTitleElement::setText() method that does the same
741         thing as HTMLTitleElement::setText().
742
743 2016-07-06  Chris Dumez  <cdumez@apple.com>
744
745         Align Document.body setter with the HTML specification
746         https://bugs.webkit.org/show_bug.cgi?id=159490
747
748         Reviewed by Alex Christensen.
749
750         Align Document.body setter with the HTML specification:
751         - https://html.spec.whatwg.org/multipage/dom.html#dom-document-body
752
753         In particular, the following web-exposed changes were made:
754         - It is now possible to set document.body to a frameset element.
755         - We no longer call importNode() on the passed in body. Therefore,
756           if the body comes from another document, its will be adopted /
757           transferred rather than cloned.
758
759         Both changes match the behavior of Firefox and Chrome.
760
761         No new tests, updated / rebaselined existing tests.
762
763         * dom/Document.cpp:
764         (WebCore::Document::setBodyOrFrameset):
765
766 2016-07-06  Brady Eidson  <beidson@apple.com>
767
768         Fix my bogus json I landed earlier today.
769
770         * features.json:
771
772 2016-07-06  Benjamin Poulain  <bpoulain@apple.com>
773
774         [JSC] Unify how we throw TypeError from C++
775         https://bugs.webkit.org/show_bug.cgi?id=159500
776
777         Reviewed by Saam Barati.
778
779         * bindings/js/JSBiquadFilterNodeCustom.cpp:
780         (WebCore::JSBiquadFilterNode::setType):
781         * bindings/js/JSBlobCustom.cpp:
782         (WebCore::constructJSBlob):
783         * bindings/js/JSCryptoKeySerializationJWK.cpp:
784         (WebCore::getBigIntegerVectorFromJSON):
785         (WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
786         (WebCore::tryJWKKeyOpsValue):
787         (WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
788         (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
789         (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
790         (WebCore::JSCryptoKeySerializationJWK::keyData):
791         (WebCore::addJWKAlgorithmToJSON):
792         (WebCore::JSCryptoKeySerializationJWK::serialize):
793         * bindings/js/JSCryptoOperationData.cpp:
794         (WebCore::cryptoOperationDataFromJSValue):
795         * bindings/js/JSDOMBinding.cpp:
796         (WebCore::enforceRange):
797         (WebCore::throwTypeError):
798         (WebCore::throwArgumentMustBeEnumError):
799         (WebCore::throwArgumentMustBeFunctionError):
800         (WebCore::throwArgumentTypeError):
801         (WebCore::throwArrayElementTypeError):
802         (WebCore::throwGetterTypeError):
803         (WebCore::throwThisTypeError):
804         * bindings/js/JSDataCueCustom.cpp:
805         (WebCore::constructJSDataCue):
806         * bindings/js/JSDocumentCustom.cpp:
807         (WebCore::JSDocument::defineElement):
808         * bindings/js/JSFileCustom.cpp:
809         (WebCore::constructJSFile):
810         * bindings/js/JSModuleLoader.cpp:
811         (WebCore::JSModuleLoader::evaluate):
812         * bindings/js/JSMutationObserverCustom.cpp:
813         (WebCore::constructJSMutationObserver):
814         * bindings/js/JSOscillatorNodeCustom.cpp:
815         (WebCore::JSOscillatorNode::setType):
816         * bindings/js/JSPannerNodeCustom.cpp:
817         (WebCore::JSPannerNode::setPanningModel):
818         (WebCore::JSPannerNode::setDistanceModel):
819         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
820         (WebCore::constructJSReadableStreamController):
821         (WebCore::constructJSReadableStreamReader):
822         * bindings/js/JSSubtleCryptoCustom.cpp:
823         (WebCore::cryptoKeyFormatFromJSValue):
824         (WebCore::importKey):
825         (WebCore::exportKey):
826         * bindings/js/ReadableStreamController.cpp:
827         (WebCore::ReadableStreamController::invoke):
828         * bindings/js/SerializedScriptValue.cpp:
829         (WebCore::CloneDeserializer::throwValidationError):
830         (WebCore::SerializedScriptValue::maybeThrowExceptionIfSerializationFailed):
831         * bridge/c/c_instance.cpp:
832         (JSC::Bindings::CInstance::invokeMethod):
833         * bridge/objc/objc_instance.mm:
834         (ObjcInstance::invokeMethod):
835         * bridge/objc/objc_runtime.mm:
836         (JSC::Bindings::ObjcArray::setValueAt):
837
838 2016-07-06  Tim Horton  <timothy_horton@apple.com>
839
840         Email from June 1st containing text 'Today @ 7:10PM' is linkified, but shouldn't be
841         https://bugs.webkit.org/show_bug.cgi?id=159498
842         <rdar://problem/26719903>
843
844         Reviewed by Sam Weinig.
845
846         New API test: WebKit2.DataDetectionReferenceDate
847
848         * editing/cocoa/DataDetection.h:
849         * editing/cocoa/DataDetection.mm:
850         (WebCore::DataDetection::detectContentInRange):
851         Extract the reference date from the DataDetectors context dictionary if it exists,
852         and pass it along to DataDetectors.
853
854         * loader/FrameLoader.cpp:
855         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
856         * loader/FrameLoaderClient.h:
857         Plumb the DataDetectors context dictionary through from WebPage.
858
859 2016-07-06  Chris Dumez  <cdumez@apple.com>
860
861         [WK2][Cocoa] Disable ResourceResponse lazy initialization
862         https://bugs.webkit.org/show_bug.cgi?id=159497
863         <rdar://problem/27209066>
864
865         Reviewed by Alex Christensen.
866
867         Add method to Cocoa's ResponseResponse header to disable
868         lazy initialization.
869
870         * platform/network/cf/ResourceResponse.h:
871         * platform/network/cocoa/ResourceResponseCocoa.mm:
872         (WebCore::ResourceResponse::disableLazyInitialization):
873
874 2016-07-06  Brent Fulgham  <bfulgham@apple.com>
875
876         Return values of JSArray::createUninitialized (and related) are not consistently checked for nullptr
877         https://bugs.webkit.org/show_bug.cgi?id=159495
878         <rdar://problem/26075433>
879
880         Reviewed by Dean Jackson.
881
882         Test: fast/canvas/canvas-getImageData-invalid-result-buffer-crash.html
883
884         * html/ImageData.cpp:
885         (WebCore::ImageData::ImageData): Assert at construction if we could not create a valid
886         buffer.
887         * platform/SharedBuffer.cpp:
888         (WebCore::SharedBuffer::createArrayBuffer): Check for a null buffer before using it.
889         * platform/graphics/cg/ImageBufferDataCG.cpp:
890         (WebCore::ImageBufferData::getData): Ditto.
891         * platform/graphics/filters/FEGaussianBlur.cpp:
892         (WebCore::FEGaussianBlur::platformApplySoftware): Ditto.
893         * platform/graphics/filters/FilterEffect.cpp:
894         (WebCore::FilterEffect::copyImageBytes): Ditto.
895         (WebCore::FilterEffect::copyUnmultipliedImage): Ditto.
896         (WebCore::FilterEffect::copyPremultipliedImage): Ditto.
897
898 2016-07-06  Chris Dumez  <cdumez@apple.com>
899
900         Document.body should return the first child of the html element that is either a body / frameset element
901         https://bugs.webkit.org/show_bug.cgi?id=159488
902
903         Reviewed by Ryosuke Niwa.
904
905         Document.body should return the first child of the html element that is
906         either a body / frameset element:
907         - https://html.spec.whatwg.org/multipage/dom.html#dom-document-body
908         - https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2
909
910         We used the first child of the *document* element that is either a
911         body / frameset element, even if the document element is not an html
912         element.
913
914         Firefox and Chrome match the specification.
915
916         Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/Document.body.html
917
918         * dom/Document.cpp:
919         (WebCore::Document::bodyOrFrameset):
920
921 2016-07-06  Dean Jackson  <dino@apple.com>
922
923         Adopt new PiP glyph
924         https://bugs.webkit.org/show_bug.cgi?id=159494
925         <rdar://problem/27061084>
926
927         Reviewed by Ada Chan.
928
929         We got new artwork for Picture-in-Picture on macOS from
930         our designers.
931
932         * Modules/mediacontrols/mediaControlsApple.css:
933         (video::-webkit-media-controls-panel .picture-in-picture-button):
934         (video::-webkit-media-controls-panel .picture-in-picture-button.return-from-picture-in-picture):
935
936 2016-07-06  Commit Queue  <commit-queue@webkit.org>
937
938         Unreviewed, rolling out r202867.
939         https://bugs.webkit.org/show_bug.cgi?id=159491
940
941         This change caused an existing LayoutTest to crash on ios-
942         simulator (Requested by ryanhaddad on #webkit).
943
944         Reverted changeset:
945
946         "<img> with a wide gamut PDF does not display using a wide
947         gamut color space"
948         https://bugs.webkit.org/show_bug.cgi?id=158983
949         http://trac.webkit.org/changeset/202867
950
951 2016-07-06  Chris Dumez  <cdumez@apple.com>
952
953         [ShadowDOM] assignedSlot property should be on Text, not CharacterData
954         https://bugs.webkit.org/show_bug.cgi?id=159482
955         <rdar://problem/27201687>
956
957         Reviewed by Ryosuke Niwa.
958
959         assignedSlot property should be on Text, not CharacterData as per:
960         - https://dom.spec.whatwg.org/#mixin-slotable
961
962         Align with the latest specification.
963
964         No new tests, rebaselined existing test.
965
966         * CMakeLists.txt:
967         * DerivedSources.make:
968         * WebCore.xcodeproj/project.pbxproj:
969         * dom/Element.idl:
970         * dom/NonDocumentTypeChildNode.idl:
971         * dom/Slotable.idl: Copied from Source/WebCore/dom/NonDocumentTypeChildNode.idl.
972         * dom/Text.idl:
973
974 2016-07-06  Jeremy Jones  <jeremyj@apple.com>
975
976         Do not animate video fullscreen exit when page has navigated away.
977         https://bugs.webkit.org/show_bug.cgi?id=159479
978
979         Reviewed by Eric Carlson.
980
981         No new tests there is no effect on the DOM. The only effect is to video fullscreen window animation.
982
983         When the page has been navigated away, the fullscreen or picture-in-picture window should
984         not animate back inline in the page, since the page has already navigated to a new page.
985         Instead exit the fullscreen mode without animating.
986
987         * html/HTMLMediaElement.cpp:
988         (WebCore::HTMLMediaElement::exitFullscreen):
989
990 2016-07-06  Jeremy Jones  <jeremyj@apple.com>
991
992         Signal that media element is prepared for inline when being stopped since script won't be able to.
993         https://bugs.webkit.org/show_bug.cgi?id=159163
994         rdar://problem/26844557
995
996         Reviewed by Jer Noble.
997
998         No new tests since this don't change behavior in the DOM. It prevents a race that could cause 
999         fullscreen and picture in picture to fail to tear down completely.
1000   
1001         When an element exits a fullscreen mode and is immediately removed from the DOM by the page, 
1002         its JavaScript stops running. The fullscreen code is then blocked waiting for JS to signal 
1003         that it has updated its state in preparation for inline mode. This change explicitly signals
1004         this since JS wont be able to.
1005
1006         Additionally, when going from PiP back to inline, don't go through fullscreen first, when the 
1007         request comes from the DOM. This was causing the presentation mode to become confused. The
1008         page requests inline. PiP would exit back to fullscreen and set the presentation mode to
1009         fullscreen. Then it would exit fullscreen back to inline, but the DOM still had the wrong
1010         presentation mode. Skipping this removes an unnecessary step in the animation and keeps the
1011         presentation mode state consistent.
1012
1013         * html/HTMLMediaElement.cpp:
1014         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
1015         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Set prepared for inline.
1016         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Return directly to inlne.
1017
1018 2016-07-06  Chris Dumez  <cdumez@apple.com>
1019
1020         Add support for Node.isConnected
1021         https://bugs.webkit.org/show_bug.cgi?id=159474
1022         <rdar://problem/27197947>
1023
1024         Reviewed by Ryosuke Niwa.
1025
1026         Add support for Node.isConnected as per:
1027         - https://dom.spec.whatwg.org/#dom-node-isconnected
1028
1029         Chrome already supports this.
1030
1031         Test: imported/w3c/web-platform-tests/dom/nodes/Node-isConnected.html
1032
1033         * dom/Node.idl:
1034
1035 2016-07-06  Brady Eidson  <beidson@apple.com>
1036
1037         Update IndexedDB's status on the feature page (How had we not done this already?)
1038
1039         Rubberstamped by Sam Weinig.
1040
1041         * features.json:
1042
1043 2016-07-06  Antoine Quint  <graouts@apple.com>
1044
1045         <img> with a wide gamut PDF does not display using a wide gamut color space
1046         https://bugs.webkit.org/show_bug.cgi?id=158983
1047         <rdar://problem/25720247>
1048
1049         Reviewed by Tim Horton.
1050
1051         Calls to ImageBuffer::createCompatibleBuffer() that do not provide an explicit
1052         color space will now infer the color space from the provided graphics context
1053         on platforms using CG. The method signature that takes in a GraphicsContext
1054         without a color space is now split into a CG-specified implementation and a
1055         Cairo one to avoid having diverging platform code in ImageBuffer.cpp.
1056
1057         Some call sites need to provide an explicit color space still, so we add a new
1058         ImageBuffer::createCompatibleBuffer() that allows for that while inferring
1059         sizing and scaling from a GraphicsContext.
1060         
1061         All signatures of ImageBuffer::createCompatibleBuffer() are losing the
1062         hasAlpha parameter which was always ignored. All call sites that were using
1063         hasAlpha have been updated.
1064
1065         In addition, we make all the IOSurface and IOSurfacePool code, which is
1066         CG-specific, use the plaform-specific type CGColorSpaceRef instead of ColorSpace
1067         so that we may pick up on the color space copied over from the graphics context
1068         in the CG-specific implementation of ImageBuffer::createCompatibleBuffer().
1069
1070         * html/canvas/CanvasRenderingContext2D.cpp:
1071         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1072         * platform/graphics/GradientImage.cpp:
1073         (WebCore::GradientImage::drawPattern):
1074         * platform/graphics/ImageBuffer.cpp:
1075         (WebCore::ImageBuffer::createCompatibleBuffer):
1076         * platform/graphics/ImageBuffer.h:
1077         * platform/graphics/NamedImageGeneratedImage.cpp:
1078         (WebCore::NamedImageGeneratedImage::drawPattern):
1079         * platform/graphics/cairo/ImageBufferCairo.cpp:
1080         (WebCore::ImageBuffer::createCompatibleBuffer):
1081         * platform/graphics/cg/IOSurfacePool.cpp:
1082         (WebCore::surfaceMatchesParameters):
1083         (WebCore::IOSurfacePool::takeSurface):
1084         * platform/graphics/cg/IOSurfacePool.h:
1085         * platform/graphics/cg/ImageBufferCG.cpp:
1086         (WebCore::ImageBuffer::createCompatibleBuffer):
1087         (WebCore::ImageBuffer::ImageBuffer):
1088         * platform/graphics/cocoa/IOSurface.h:
1089         * platform/graphics/cocoa/IOSurface.mm:
1090         (WebCore::IOSurface::surfaceFromPool):
1091         (WebCore::IOSurface::create):
1092         (WebCore::IOSurface::createFromSendRight):
1093         (WebCore::IOSurface::createFromSurface):
1094         (WebCore::IOSurface::createFromImage):
1095         (WebCore::IOSurface::IOSurface):
1096         (WebCore::IOSurface::ensurePlatformContext):
1097         * platform/mac/ThemeMac.mm:
1098         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
1099         * platform/spi/cg/CoreGraphicsSPI.h:
1100         * rendering/RenderBoxModelObject.cpp:
1101         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1102         * rendering/RenderThemeMac.mm:
1103         (WebCore::RenderThemeMac::paintProgressBar):
1104         * rendering/svg/SVGRenderingContext.cpp:
1105         (WebCore::SVGRenderingContext::bufferForeground):
1106         * svg/graphics/SVGImage.cpp:
1107         (WebCore::SVGImage::drawPatternForContainer):
1108
1109 2016-07-06  Tim Horton  <timothy_horton@apple.com>
1110
1111         Long spin editing text at top of message containing Reader version of web page with many GIFs
1112         https://bugs.webkit.org/show_bug.cgi?id=159444
1113         <rdar://problem/26790386>
1114
1115         Reviewed by Sam Weinig.
1116
1117         * editing/cocoa/HTMLConverter.mm:
1118         (fileWrapperForElement):
1119         Instead of looking up the image's data in the cache by URL, just use the
1120         CachedImage on the HTMLImageElement. There are situations (which seem to involve
1121         cloning the DOM then having the cloned DOM get garbage collected) where the image
1122         can be removed from the cache, but still be live in the document.
1123
1124 2016-07-06  Brady Eidson  <beidson@apple.com>
1125
1126         Hold RefPtr<>'s to UniqueIDBDatabases while performing user delete.
1127         https://bugs.webkit.org/show_bug.cgi?id=159471
1128
1129         Reviewed by Brent Fulgham.
1130
1131         * Modules/indexeddb/server/IDBServer.cpp:
1132         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
1133         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
1134
1135 2016-07-06  Commit Queue  <commit-queue@webkit.org>
1136
1137         Unreviewed, rolling out r202725.
1138         https://bugs.webkit.org/show_bug.cgi?id=159473
1139
1140         didn't reduce coreui memory usage (Requested by kling on
1141         #webkit).
1142
1143         Reverted changeset:
1144
1145         "[Mac] Get rid of the old timey rubber-banding linen pattern."
1146         https://bugs.webkit.org/show_bug.cgi?id=159329
1147         http://trac.webkit.org/changeset/202725
1148
1149 2016-07-06  Philippe Normand  <pnormand@igalia.com>
1150
1151         [GStreamer] duration query improvements
1152         https://bugs.webkit.org/show_bug.cgi?id=159458
1153
1154         Reviewed by Carlos Garcia Campos.
1155
1156         Currently the player caches the result of the duration query but
1157         this is overkill because it's cached by playbin already. The only
1158         time where the player needs to cache the duration is when EOS was
1159         reached because in that situation the query would fail.
1160
1161         No new tests, existing media tests cover this patch.
1162
1163         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1164         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Member variables update.
1165         (WebCore::MediaPlayerPrivateGStreamer::load): Stop the fill timer
1166         before loading a new URL, the same player can be used for
1167         different assets.
1168         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition): Perform
1169         a duration query, the duration value is no longer locally cached.
1170         (WebCore::MediaPlayerPrivateGStreamer::duration): Return cached value only after EOS was reached.
1171         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): Perform
1172         a duration query, the duration value is no longer locally cached.
1173         (WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable): Ditto.
1174         (WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded): Ditto.
1175         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress): Ditto.
1176         (WebCore::MediaPlayerPrivateGStreamer::updateStates): Remove duration caching support.
1177         (WebCore::MediaPlayerPrivateGStreamer::didEnd): Ditto.
1178         (WebCore::MediaPlayerPrivateGStreamer::durationChanged): Ditto.
1179         (WebCore::MediaPlayerPrivateGStreamer::cacheDuration): Deleted.
1180         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1181
1182 2016-07-06  Manuel Rego Casasnovas  <rego@igalia.com>
1183
1184         [css-grid] Height percentages are not properly resolved for item's children
1185         https://bugs.webkit.org/show_bug.cgi?id=159258
1186
1187         Reviewed by Sergio Villar Senin.
1188
1189         When grid items are vertically stretched (default behavior)
1190         they store their height on RenderBox::overrideLogicalContentHeight().
1191         In order to resolve the percentage height on the grid item's children
1192         we need to use that size.
1193
1194         Test: fast/css-grid-layout/percent-resolution-grid-item-children.html
1195
1196         * rendering/RenderBox.cpp:
1197         (WebCore::RenderBox::computePercentageLogicalHeight):
1198
1199 2016-07-06  Zan Dobersek  <zdobersek@igalia.com>
1200
1201         [GTK] Better guard TextureMapper header and CMake includes
1202         https://bugs.webkit.org/show_bug.cgi?id=159415
1203
1204         Reviewed by Carlos Garcia Campos.
1205
1206         * PlatformGTK.cmake: Only include TextureMapper.cmake if USE_TEXTURE_MAPPER is enabled.
1207         * platform/graphics/GraphicsContext3DPrivate.h: Guard texmap header inclusions with USE(TEXTURE_MAPPER).
1208         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Ditto, but wrap it around
1209         the existing USE(TEXTURE_MAPPER_GL) block.
1210
1211 2016-07-05  Olivier Blin  <olivier.blin@softathome.com>
1212
1213         [GStreamer] Do not build MediaPlayerPrivateGStreamerOwr when VIDEO is disabled
1214         https://bugs.webkit.org/show_bug.cgi?id=159425
1215
1216         Reviewed by Philippe Normand.
1217
1218         MediaPlayer backends are useful and can be built only when VIDEO is enabled.
1219
1220         No new tests, behavior is unchanged.
1221
1222         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
1223         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
1224
1225 2016-07-05  Per Arne Vollan  <pvollan@apple.com>
1226
1227         [Win] Layout Test http/tests/security/contentSecurityPolicy/source-list-parsing-10.html is failing
1228         https://bugs.webkit.org/show_bug.cgi?id=147646
1229
1230         Reviewed by Brent Fulgham.
1231
1232         Fix build error when CSP_NEXT is disabled.
1233
1234         * DerivedSources.cpp:
1235
1236 2016-07-05  David Kilzer  <ddkilzer@apple.com>
1237
1238         Throw exceptions for invalid number of channels for ConvolverNode
1239         <https://webkit.org/b/159238>
1240
1241         Reviewed by Brent Fulgham.
1242
1243         Fix based on a Blink change (patch by <rtoy@chromium.org>):
1244         <https://chromium.googlesource.com/chromium/src.git/+/0cc26bbb7175aec77910d0b47faf9f8c8a640fe5>
1245
1246         Also includes a related fix for ReverbConvolverStage (patch by <rtoy@chromium.org>):
1247         <https://src.chromium.org/viewvc/blink?revision=157832&view=revision>
1248
1249         Test: webaudio/convolver-channels.html
1250
1251         * Modules/webaudio/ConvolverNode.cpp:
1252         (WebCore::ConvolverNode::setBuffer): Throw an exception for
1253         anything but 1, 2 or 4 channels.
1254         * platform/audio/ReverbConvolverStage.cpp:
1255         (WebCore::ReverbConvolverStage::ReverbConvolverStage): Don't read past the end of
1256         the impulseResponse array.
1257
1258 2016-07-05  Johan K. Jensen  <jj@johanjensen.dk>
1259
1260         Web Inspector: Sending XHR with UTF8 encoded data shows garbled data in Resource sidebar
1261         https://bugs.webkit.org/show_bug.cgi?id=159358
1262
1263         Reviewed by Joseph Pecoraro.
1264
1265         Test: http/tests/inspector/network/xhr-request-data-encoded-correctly.html
1266
1267         * inspector/InspectorNetworkAgent.cpp:
1268         (WebCore::buildObjectForResourceRequest):
1269         * inspector/NetworkResourcesData.cpp:
1270         (WebCore::NetworkResourcesData::setResourceContent):
1271
1272 2016-07-05  Chris Fleizach  <cfleizach@apple.com>
1273
1274         AX: Image attachment in email does not show up in AX tree
1275         https://bugs.webkit.org/show_bug.cgi?id=159422
1276
1277         Reviewed by Joanmarie Diggs.
1278
1279         When an image loads after the accessibility tree has already been created, the ignored status
1280         of that image does not get updated.
1281
1282         Test: accessibility/image-load-on-delay.html
1283
1284         * rendering/RenderImage.cpp:
1285         (WebCore::RenderImage::imageChanged):
1286
1287 2016-07-05  Alex Christensen  <achristensen@webkit.org>
1288
1289         Fix Windows build.
1290         https://bugs.webkit.org/show_bug.cgi?id=159103
1291
1292         * Modules/indexeddb/IDBActiveDOMObject.h:
1293         (WebCore::IDBActiveDOMObject::callFunctionOnOriginThread):
1294         WTF.
1295
1296 2016-07-05  Enrica Casucci  <enrica@apple.com>
1297
1298         HTMLAttachment elements don't receive clicks after the first on iOS.
1299         https://bugs.webkit.org/show_bug.cgi?id=159310
1300         rdar://problem/25776940
1301
1302         Reviewed by Tim Horton.
1303
1304         shouldSelectOnMouseDown() now returns false on iOS.
1305
1306         * html/HTMLAttachmentElement.h:
1307
1308 2016-07-05  Brady Eidson  <beidson@apple.com>
1309
1310         IDBDatabase can null deref its ScriptExecutionContext inside connectionToServerLost.
1311         <rdar://problem/27169924> and https://bugs.webkit.org/show_bug.cgi?id=159432
1312
1313         Reviewed by Alex Christensen.
1314
1315         No new tests (Targeted test not possible, covered peripherally by all IDB tests).
1316
1317         * Modules/indexeddb/IDBActiveDOMObject.h:
1318         * Modules/indexeddb/IDBDatabase.cpp:
1319         (WebCore::IDBDatabase::connectionToServerLost): Make sure there is still a script execution context.
1320
1321 2016-07-01  Jer Noble  <jer.noble@apple.com>
1322
1323         REGRESSION (r202641): Netflix playback stalls after a few seconds
1324         https://bugs.webkit.org/show_bug.cgi?id=159365
1325
1326         Reviewed by Eric Carlson.
1327
1328         Test: LayoutTests/media/media-source/media-source-small-gap.html
1329
1330         In r202641, we removed a "fudge factor" of 1 millisecond added onto the duration
1331         of every sample for the purposes of calculating a SourceBuffer's buffered ranges.
1332         Netflix (and likely other providers) have streams that have 1 "timeScale" gaps
1333         between segments (e.g., 1/9000s, 1/3003s, etc.). Fill those gaps by looking for
1334         the previous and next samples and extending the buffered range to cover the gaps
1335         if they're short enough. We have to ensure that we correctly remove those extended
1336         durations when we remove samples from the SourceBuffer as well.
1337
1338         * Modules/mediasource/SourceBuffer.cpp:
1339         (WebCore::removeSamplesFromTrackBuffer):
1340         (WebCore::SourceBuffer::removeCodedFrames):
1341         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1342
1343 2016-07-05  Brady Eidson  <beidson@apple.com>
1344
1345         Database process crashes deleting a corrupt SQLite database file (null deref).
1346         https://bugs.webkit.org/show_bug.cgi?id=155506.
1347
1348         Reviewed by Alex Christensen.
1349
1350         Covered by new API test.
1351
1352         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1353         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore): Null check.
1354
1355 2016-07-05  Brady Eidson  <beidson@apple.com>
1356
1357         TransactionOperations can get destroyed on the wrong thread.
1358         https://bugs.webkit.org/show_bug.cgi?id=159103
1359
1360         Reviewed by Alex Christensen.
1361
1362         No new tests (Very racy, not feasible to write a dedicated test for, caught on bots occasionally as-is).
1363
1364         * Modules/indexeddb/IDBActiveDOMObject.h:
1365         (WebCore::IDBActiveDOMObject::callFunctionOnOriginThread):
1366         
1367         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1368         (WebCore::IDBClient::IDBConnectionProxy::completeOperation): Pass the last ref to the operation to its
1369           origin thread to be deleted there.
1370         
1371         * Modules/indexeddb/client/TransactionOperation.h:
1372         (WebCore::IDBClient::TransactionOperation::performCompleteOnOriginThread):
1373
1374 2016-07-05  Youenn Fablet  <youenn@apple.com>
1375
1376         Remove CredentialRequest ResourceLoaderOptions
1377         https://bugs.webkit.org/show_bug.cgi?id=159404
1378
1379         Reviewed by Sam Weinig.
1380
1381         No observable change of behavior.
1382         Removing CredentialRequest from ResourceLoaderOptions and replacing it by FetchOptions::Credentials.
1383         As per https://fetch.spec.whatwg.org/#http-fetch, credentials flag is set according FetchOptions::Credentials.
1384
1385         * loader/DocumentLoader.cpp:
1386         (WebCore::DocumentLoader::startLoadingMainResource): Set credentials mode to Include.
1387         * loader/DocumentThreadableLoader.cpp:
1388         (WebCore::DocumentThreadableLoader::redirectReceived): Disable credentials if credentials mode is SameOrigin
1389         (request being cross origin).
1390         * loader/MediaResourceLoader.cpp: Refqctoring to use CachedResourceReauest::setAsPotentiallyCrossOrigin.
1391         Removed unnecessary ResourceRequest copy by using the mutable request of CachedResourceRequest.
1392         (WebCore::MediaResourceLoader::requestResource):
1393         * loader/NetscapePlugInStreamLoader.cpp:
1394         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader): Set credential mode  to Include
1395         * loader/ResourceLoaderOptions.h: Removing CredentialRequest option.
1396         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
1397         (WebCore::ResourceLoaderOptions::credentialRequest): Deleted.
1398         (WebCore::ResourceLoaderOptions::setCredentialRequest): Deleted.
1399         * loader/cache/CachedResourceLoader.cpp:
1400         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Set credential mode to Include.
1401         (WebCore::CachedResourceLoader::defaultCachedResourceOptions): Ditto.
1402         * loader/cache/CachedResourceRequest.cpp:
1403         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin): Set credential mode according crossorigin
1404         atribute value.
1405         * loader/icon/IconLoader.cpp:
1406         (WebCore::IconLoader::startLoading): Set credential mode to Omit.
1407         * page/EventSource.cpp:
1408         (WebCore::EventSource::connect): Set credential mode according crossorigin atribute value.
1409         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1410         (WebCore::WebCoreAVCFResourceLoader::startLoading): Set credential mode to Omit.
1411         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1412         (WebCore::WebCoreAVFResourceLoader::startLoading): Ditto.
1413         * platform/network/ResourceHandleTypes.h: Removed definition of CredentialRequest.
1414         * xml/XMLHttpRequest.cpp:
1415         (WebCore::XMLHttpRequest::createRequest): Set credential mode according crossorigin atribute value.
1416
1417 2016-07-04  Fujii Hironori  <Hironori.Fujii@sony.com>
1418
1419         [GTK] Null Node dereference in FrameSelection::notifyAccessibilityForSelectionChange of FrameSelectionAtk.cpp
1420         https://bugs.webkit.org/show_bug.cgi?id=159411
1421
1422         Reviewed by Carlos Garcia Campos.
1423
1424         Tests:
1425             editing/selection/selection-in-iframe-removed-crash.html
1426
1427         * editing/atk/FrameSelectionAtk.cpp:
1428         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
1429         Added a null check for the return value of containerNode().
1430
1431 2016-07-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1432
1433         [EFL] Remove mac configuration dependency in WebKit Version definition
1434         https://bugs.webkit.org/show_bug.cgi?id=159407
1435
1436         Reviewed by Yusuke Suzuki.
1437
1438         EFL port has been used Version.xconfig file in WebKit/mac/Configurations
1439         in order to generate WebKitVersion.h file. But it can be simply defined
1440         in cmake.
1441
1442         * PlatformEfl.cmake: Remove WebKitVersion.h generation.
1443         * platform/efl/UserAgentEfl.cpp:
1444         (WebCore::versionForUAString): Use USER_AGENT_EFL_MAJOR_VERSION and USER_AGENT_EFL_MINOR_VERSION.
1445
1446 2016-07-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1447
1448         [Coordinated Graphics] Modernize and cleanup CompositingCoordinator
1449         https://bugs.webkit.org/show_bug.cgi?id=159212
1450
1451         Reviewed by Žan Doberšek.
1452
1453         Use references instead of pointers when possible.
1454
1455         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1456         (WebCore::CoordinatedGraphicsLayer::paintToSurface):
1457         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1458         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
1459         (WebCore::CoordinatedImageBacking::update):
1460         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
1461         * platform/graphics/texmap/coordinated/CoordinatedSurface.h:
1462         * platform/graphics/texmap/coordinated/Tile.cpp:
1463         (WebCore::Tile::updateBackBuffer):
1464         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
1465
1466 2016-07-04  Youenn Fablet  <youenn@apple.com>
1467
1468         Remove RequestOriginPolicy from ResourceLoaderOptions
1469         https://bugs.webkit.org/show_bug.cgi?id=159406
1470
1471         Reviewed by Sam Weinig.
1472
1473         Using FetchOptions::mode in lieu of ResourceLoaderOptions::RequestOriginPolicy.
1474         The cors, no-cors and same-origin values match PotentiallyCrossOriginEnabled,
1475         UseDefaultOriginRestrictionsForType and RestrictToSameOrigin, default being
1476         cors/UseDefaultOriginRestrictionsForType as per fetch specification.
1477
1478         No change of behavior.
1479
1480         * css/CSSImageSetValue.cpp:
1481         (WebCore::CSSImageSetValue::cachedImageSet):
1482         * css/CSSImageValue.cpp:
1483         (WebCore::CSSImageValue::cachedImage):
1484         * loader/DocumentLoader.cpp:
1485         (WebCore::DocumentLoader::startLoadingMainResource):
1486         * loader/MediaResourceLoader.cpp:
1487         (WebCore::MediaResourceLoader::requestResource):
1488         * loader/NetscapePlugInStreamLoader.cpp:
1489         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
1490         * loader/ResourceLoaderOptions.h:
1491         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
1492         (WebCore::ResourceLoaderOptions::requestOriginPolicy): Deleted.
1493         (WebCore::ResourceLoaderOptions::setRequestOriginPolicy): Deleted.
1494         * loader/SubresourceLoader.cpp:
1495         (WebCore::SubresourceLoader::init):
1496         (WebCore::SubresourceLoader::willSendRequestInternal):
1497         * loader/cache/CachedResourceLoader.cpp:
1498         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
1499         (WebCore::CachedResourceLoader::canRequest):
1500         (WebCore::CachedResourceLoader::defaultCachedResourceOptions):
1501         * loader/cache/CachedResourceRequest.cpp:
1502         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
1503         * loader/icon/IconLoader.cpp:
1504         (WebCore::IconLoader::startLoading):
1505         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1506         (WebCore::WebCoreAVCFResourceLoader::startLoading):
1507         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1508         (WebCore::WebCoreAVFResourceLoader::startLoading):
1509         * style/StylePendingResources.cpp:
1510         (WebCore::Style::loadPendingImage):
1511
1512 2016-07-04  Youenn Fablet  <youenn@apple.com>
1513
1514         Shield WebRTC JS built-ins from user scripts
1515         https://bugs.webkit.org/show_bug.cgi?id=155964
1516
1517         Reviewed by Sam Weinig.
1518
1519         Making use of Promise.prototype.@then instead of Promise.prototype.then.
1520         Covered by updated tests.
1521
1522         * Modules/mediastream/RTCPeerConnection.js:
1523         (createOffer):
1524         (createAnswer):
1525         (setLocalDescription):
1526         (setRemoteDescription):
1527         (addIceCandidate):
1528         (getStats):
1529         * Modules/mediastream/RTCPeerConnectionInternals.js:
1530         (enqueueOperation):
1531
1532 2016-07-04  Brady Eidson  <beidson@apple.com>
1533
1534         WebProcesses don't handle DatabaseProcess going away uncleanly..
1535         https://bugs.webkit.org/show_bug.cgi?id=159371
1536
1537         Reviewed by Alex Christensen.
1538
1539         Covered by new API test.
1540
1541         * Modules/indexeddb/IDBDatabase.cpp:
1542         (WebCore::IDBDatabase::didCloseFromServer):
1543         (WebCore::IDBDatabase::connectionToServerLost):
1544         * Modules/indexeddb/IDBDatabase.h:
1545         
1546         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1547         (WebCore::IDBClient::IDBConnectionProxy::connectionToServerLost): Notify all IDBDatabase
1548           connections, as well as all pending IDBOpenDBRequests, with the error about the
1549           server connection dropping.
1550         * Modules/indexeddb/client/IDBConnectionProxy.h:
1551         
1552         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1553         (WebCore::IDBClient::IDBConnectionToServer::connectionToServerLost):
1554         * Modules/indexeddb/client/IDBConnectionToServer.h:
1555         
1556         * Modules/indexeddb/shared/IDBError.h:
1557
1558 2016-07-04  Philippe Normand  <pnormand@igalia.com>
1559
1560         Release build with logging enabled fails
1561         https://bugs.webkit.org/show_bug.cgi?id=159403
1562
1563         Reviewed by Žan Doberšek.
1564
1565         Protect logging-related methods with !LOG_DISABLED.
1566
1567         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
1568         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1569         * Modules/indexeddb/IDBKey.cpp:
1570         * Modules/indexeddb/IDBKey.h:
1571         * Modules/indexeddb/IDBKeyData.cpp:
1572         * Modules/indexeddb/IDBKeyData.h:
1573         * Modules/indexeddb/IDBKeyPath.cpp:
1574         (WebCore::IDBKeyPath::IDBKeyPath):
1575         * Modules/indexeddb/IDBKeyRangeData.cpp:
1576         * Modules/indexeddb/IDBKeyRangeData.h:
1577         * Modules/indexeddb/server/IndexValueEntry.cpp:
1578         (WebCore::IDBServer::IndexValueEntry::Iterator::isValid):
1579         * Modules/indexeddb/server/IndexValueStore.cpp:
1580         * Modules/indexeddb/server/IndexValueStore.h:
1581         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1582         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
1583         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1584         (WebCore::IDBServer::UniqueIDBDatabase::isVersionChangeInProgress):
1585         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
1586         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
1587         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
1588         * Modules/indexeddb/shared/IDBIndexInfo.h:
1589         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
1590         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
1591         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
1592         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
1593         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
1594         * Modules/indexeddb/shared/IDBTransactionInfo.h:
1595         * page/SecurityOriginData.cpp:
1596         * page/SecurityOriginData.h:
1597
1598 2016-07-04  Commit Queue  <commit-queue@webkit.org>
1599
1600         Unreviewed, rolling out r202556.
1601         https://bugs.webkit.org/show_bug.cgi?id=159399
1602
1603         introduces deadlocks (Requested by philn on #webkit).
1604
1605         Reverted changeset:
1606
1607         "[GStreamer] improved duration query support in the HTTP
1608         source element"
1609         https://bugs.webkit.org/show_bug.cgi?id=159204
1610         http://trac.webkit.org/changeset/202556
1611
1612 2016-07-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1613
1614         [image-decoders] Make ImageDecoder::size() lazily decode the image if needed to return a valid size
1615         https://bugs.webkit.org/show_bug.cgi?id=159297
1616
1617         Reviewed by Antonio Gomes.
1618
1619         It's otherwise confusing leading to bugs like #159089.
1620
1621         * platform/image-decoders/ImageDecoder.cpp:
1622         (WebCore::ImageDecoder::createFrameImageAtIndex): Check the size at the beginning and return early if it's
1623         empty. We no longer need to check the size after calling frameBufferAtIndex().
1624         * platform/image-decoders/ImageDecoder.h:
1625         (WebCore::ImageDecoder::size): Check first is size is available, which lazily decodes the image.
1626         (WebCore::ImageDecoder::scaledSize): Remove const.
1627         (WebCore::ImageDecoder::frameSizeAtIndex): Ditto.
1628         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1629         (WebCore::ICOImageDecoder::size): Ditto.
1630         (WebCore::ICOImageDecoder::frameSizeAtIndex): Ditto.
1631         * platform/image-decoders/ico/ICOImageDecoder.h:
1632
1633 2016-07-02  Youenn Fablet  <youenn@apple.com>
1634
1635         Synchronous preflight checker should set loading options to not use credentials
1636         https://bugs.webkit.org/show_bug.cgi?id=159351
1637
1638         Reviewed by Alex Christensen.
1639
1640         Like for asynchronous preflighting, synchronous preflighting loading options should disqble any credentials.
1641
1642         No change of behavior as preflight request is expressly set to not use credentials in
1643         createAccessControlPreflightRequest.
1644
1645         * loader/CrossOriginPreflightChecker.cpp:
1646         (WebCore::CrossOriginPreflightChecker::doPreflight):
1647
1648 2016-07-01  Commit Queue  <commit-queue@webkit.org>
1649
1650         Unreviewed, rolling out r202766.
1651         https://bugs.webkit.org/show_bug.cgi?id=159382
1652
1653         The new test asserts every time (Requested by ap on #webkit).
1654
1655         Reverted changeset:
1656
1657         "Web Inspector: Sending XHR with UTF8 encoded data shows
1658         garbled data in Resource sidebar"
1659         https://bugs.webkit.org/show_bug.cgi?id=159358
1660         http://trac.webkit.org/changeset/202766
1661
1662 2016-07-01  Zalan Bujtas  <zalan@apple.com>
1663
1664         prepareForDestruction() always needs to be called before destroying the Document object.
1665         https://bugs.webkit.org/show_bug.cgi?id=159372
1666         rdar://problem/26788150
1667
1668         Reviewed by Antti Koivisto.
1669
1670         We should never start destroying the Document object without calling prepareForDestruction() first.
1671         It ensures that render tree gets nuked before we start tearing down the node tree.
1672
1673         Test: fast/history/page-cache-destroy-document.html
1674
1675         * dom/Document.cpp:
1676         (WebCore::Document::removedLastRef):
1677
1678 2016-07-01  Johan K. Jensen  <jj@johanjensen.dk>
1679
1680         Web Inspector: Sending XHR with UTF8 encoded data shows garbled data in Resource sidebar
1681         https://bugs.webkit.org/show_bug.cgi?id=159358
1682
1683         Reviewed by Joseph Pecoraro.
1684
1685         Test: http/tests/inspector/network/xhr-request-data-encoded-correctly.html
1686
1687         * inspector/InspectorNetworkAgent.cpp:
1688         (WebCore::buildObjectForResourceRequest):
1689
1690 2016-07-01  Dean Jackson  <dino@apple.com>
1691
1692         "image-src" support is missing. We only support "-webkit-image-src"
1693         https://bugs.webkit.org/show_bug.cgi?id=159373
1694         <rdar://problem/27140443>
1695
1696         Patch by Brent Fulgham and Dean Jackson.
1697         Reviewed by Dean Jackson and Brent Fulgham.
1698
1699         Support unprefixed image-set.
1700
1701         Test: fast/css/image-set-unprefixed.html
1702
1703         * css/CSSImageSetValue.cpp:
1704         (WebCore::CSSImageSetValue::customCSSText):
1705         * css/CSSParser.cpp:
1706         (WebCore::isImageSetFunctionValue): New helper function
1707         that checks prefixed and unprefixed form.
1708         (WebCore::CSSParser::parseValue): Use the helper.
1709         (WebCore::CSSParser::parseContent):
1710         (WebCore::CSSParser::parseFillImage):
1711         (WebCore::CSSParser::parseBorderImage):
1712
1713 2016-07-01  Chris Dumez  <cdumez@apple.com>
1714
1715         Possible null Range dereference under AXObjectCache::visiblePositionFromCharacterOffset()
1716         https://bugs.webkit.org/show_bug.cgi?id=159330
1717         <rdar://problem/27123752>
1718
1719         Reviewed by Benjamin Poulain.
1720
1721         rangeForUnorderedCharacterOffsets() can return a null Range but we failed
1722         to do a null check before dereferencing it.
1723
1724         * accessibility/AXObjectCache.cpp:
1725         (WebCore::AXObjectCache::visiblePositionFromCharacterOffset):
1726
1727 2016-07-01  Chris Dumez  <cdumez@apple.com>
1728
1729         Regression(r199087): window.focus() / window.close() can no longer be called by a Window's opener
1730         https://bugs.webkit.org/show_bug.cgi?id=159364
1731         <rdar://problem/27117169>
1732
1733         Reviewed by Gavin Barraclough.
1734
1735         window.focus() / window.close() could no longer be called by a Window's opener
1736         after r199087, which would break focusing of open iWork documents on icloud.com.
1737
1738         Before r199087, we would construct a new function in the caller's context every
1739         time window.focus and window.close was accessed. r199087 fixed the issue so that
1740         we always call the same function. However, those functions are using
1741         [CallWith=Document] and they are were no longer passed the *caller*'s document
1742         as a result. This broke focus / close permission checking as the code needed the
1743         caller's document to do the check.
1744
1745         This patch introduces [CallWith=CallerDocument] and [CallWith=CallerWindow] so
1746         that the implementation can now pass the caller's Document / Window to the
1747         implementation. The bindings rely on JSDOMWindow's callerDOMWindow() to get the
1748         caller DOMWindow / document. This new functionality is now used for window.close
1749         and window.focus to unbreak their permission checking.
1750
1751         Test: fast/dom/Window/child-window-focus.html
1752
1753         * bindings/scripts/CodeGeneratorJS.pm:
1754         (GenerateCallWith):
1755         * bindings/scripts/IDLAttributes.txt:
1756         * page/DOMWindow.cpp:
1757         (WebCore::DOMWindow::focus):
1758         * page/DOMWindow.h:
1759         * page/DOMWindow.idl:
1760
1761 2016-07-01  Chris Dumez  <cdumez@apple.com>
1762
1763         [iOS] Possible null Range dereference under computeAutocorrectionContext()
1764         https://bugs.webkit.org/show_bug.cgi?id=159328
1765         <rdar://problem/26766720>
1766
1767         Reviewed by Benjamin Poulain.
1768
1769         * editing/Editor.cpp:
1770         (WebCore::Editor::compositionRange):
1771         * editing/Editor.h:
1772         Update to return a RefPtr instead of a PassRefPtr and use nullptr
1773         instead of 0 in the implementation.
1774
1775 2016-07-01  Jon Davis  <jond@apple.com>
1776
1777         Updated Picture element and WOFF 2 status
1778         https://bugs.webkit.org/show_bug.cgi?id=159356
1779
1780         Reviewed by Timothy Hatcher.
1781         
1782         Status updates and clean-up to move Web Animations and Resource Timing entries from JSC to WebCore.
1783
1784         * features.json:
1785
1786 2016-07-01  Andreas Kling  <akling@apple.com>
1787
1788         Add early return when processing content extensions if there aren't any.
1789         <https://webkit.org/b/159363>
1790
1791         Reviewed by Antti Koivisto.
1792
1793         Short-circuit outta there if there aren't any extensions to query.
1794
1795         * contentextensions/ContentExtensionsBackend.cpp:
1796         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
1797
1798 2016-07-01  Eric Carlson  <eric.carlson@apple.com>
1799
1800         HTMLMediaElement::resume() may cause JavaScript execution
1801         https://bugs.webkit.org/show_bug.cgi?id=159327
1802         <rdar://problem/27131641>
1803
1804         Reviewed by Jer Noble.
1805
1806         HTMLMediaElement::updatePlayState can cause an element to begin playing and enter fullscreen,
1807         which can result in a call to the media controls and JavaScript execution. Javascript is not
1808         allowed allowed to run when a page resumes, so make the call to updatePlayState asynchronous.
1809
1810         No new tests, I wasn't able to create a test that triggers the crash.
1811
1812         * html/HTMLMediaElement.cpp:
1813         (WebCore::HTMLMediaElement::scheduleDelayedAction): Support UpdatePlayState.
1814         (WebCore::HTMLMediaElement::pendingActionTimerFired): Ditto.
1815         (WebCore::HTMLMediaElement::setReadyState): UpdateMediaState -> UpdateState.
1816         (WebCore::HTMLMediaElement::playInternal): Don't call updateMediaController, it is called
1817           by updatePlayState.
1818         (WebCore::HTMLMediaElement::setMuted): UpdateMediaState -> UpdateState.
1819         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto.
1820         (WebCore::HTMLMediaElement::mediaEngineWasUpdated): Update media state asynchronously.
1821         (WebCore::HTMLMediaElement::updatePlayState): Add parameter to allow update to happen
1822           asynchronously.
1823         (WebCore::HTMLMediaElement::setPlaying): UpdateMediaState -> UpdateState.
1824         (WebCore::HTMLMediaElement::setPausedInternal): Update media state asynchronously.
1825         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):  
1826           UpdateMediaState -> UpdateState.
1827         (WebCore::HTMLMediaElement::removeEventListener): Ditto.
1828         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent): Ditto.
1829         (WebCore::HTMLMediaElement::updateMediaState): UpdateMediaState -> UpdateState
1830         * html/HTMLMediaElement.h:
1831         * html/HTMLMediaElementEnums.h: Add UpdatePlayState.
1832
1833 2016-07-01  Brady Eidson  <beidson@apple.com>
1834
1835         Blob content type not preserved when retrieving blobs from IndexedDB.
1836         <rdar://problem/27057357> and https://bugs.webkit.org/show_bug.cgi?id=159360
1837
1838         Reviewed by Alex Christensen.
1839
1840         Test: storage/indexeddb/modern/blob-svg-image.html
1841
1842         * fileapi/Blob.cpp:
1843         (WebCore::Blob::Blob):
1844
1845         * fileapi/ThreadableBlobRegistry.cpp:
1846         (WebCore::postToMainThread):
1847         (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked): Pass along the content type
1848           to the blob registry so that if the file-backed blob takes over, it has the content type.
1849         (WebCore::threadableQueue): Deleted.
1850         * fileapi/ThreadableBlobRegistry.h:
1851
1852         * platform/network/BlobRegistry.h:
1853
1854         * platform/network/BlobRegistryImpl.cpp:
1855         (WebCore::BlobRegistryImpl::registerBlobURL):
1856         (WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked):
1857         * platform/network/BlobRegistryImpl.h:
1858
1859 2016-07-01  Youenn Fablet  <youenn@apple.com>
1860
1861         Make ResourceLoaderOptions derive from FetchOptions
1862         https://bugs.webkit.org/show_bug.cgi?id=159345
1863
1864         Reviewed by Alex Christensen.
1865
1866         No change of behavior.
1867
1868         * Modules/fetch/FetchLoader.cpp:
1869         (WebCore::FetchLoader::start):
1870         * loader/CrossOriginPreflightChecker.cpp:
1871         (WebCore::CrossOriginPreflightChecker::startPreflight):
1872         * loader/ResourceLoaderOptions.h:
1873         (WebCore::ResourceLoaderOptions::fetchOptions): Deleted.
1874         (WebCore::ResourceLoaderOptions::setFetchOptions): Deleted.
1875         * loader/SubresourceLoader.cpp:
1876         (WebCore::SubresourceLoader::willSendRequestInternal):
1877         * loader/ThreadableLoader.h: Removing securityOrigin field (left over from https://bugs.webkit.org/show_bug.cgi?id=159221)
1878
1879 2016-07-01  Per Arne Vollan  <pvollan@apple.com>
1880
1881         [Win] Animations tests are crashing in debug mode.
1882         https://bugs.webkit.org/show_bug.cgi?id=159335
1883
1884         Reviewed by Alex Christensen.
1885
1886         A MSVC runtime check fails because an uninitialized variable is being used.
1887
1888         * css/StyleResolver.cpp:
1889         (WebCore::StyleResolver::keyframeStylesForAnimation):
1890
1891 2016-07-01  Youenn Fablet  <youennf@gmail.com>
1892
1893         Add a runtime flag for DOM iterators
1894         https://bugs.webkit.org/show_bug.cgi?id=159300
1895
1896         Reviewed by Alex Christensen.
1897
1898         * Modules/fetch/FetchHeaders.idl: Making iterator runtime-enabled.
1899         * bindings/generic/RuntimeEnabledFeatures.h:
1900         (WebCore::RuntimeEnabledFeatures::setDOMIteratorEnabled):
1901         (WebCore::RuntimeEnabledFeatures::domIteratorEnabled):
1902         * bindings/scripts/CodeGeneratorJS.pm:
1903         (ToMethodName): Fixing dOM -> dom casing issue.
1904         (GenerateImplementation): Using addIterableProperties new method.
1905         (addIterableProperties): Activating property addition according runtime flag if iterator is rnutime flagged.
1906         * bindings/scripts/IDLParser.pm:
1907         (parseOptionalIterableInterface): Adding extendedAttributes to iterable.
1908         * bindings/scripts/test/JS/JSTestNode.cpp:
1909         (WebCore::JSTestNodePrototype::finishCreation):
1910         * bindings/scripts/test/JS/JSTestObj.cpp:
1911         (WebCore::JSTestObjPrototype::finishCreation):
1912         * bindings/scripts/test/TestNode.idl: Making iterator runtime-enabled.
1913         * bindings/scripts/test/TestObj.idl: Ditto.
1914         * css/FontFaceSet.idl: Ditto.
1915         * dom/NodeList.idl: Ditto.
1916
1917 2016-07-01  Frederic Wang  <fwang.igalia.com>
1918
1919         Eliminate trailing whitespace in MathML code
1920         https://bugs.webkit.org/show_bug.cgi?id=159091
1921
1922         Reviewed by Alex Christensen.
1923
1924         No new tests, behavior is unchanged.
1925
1926         * rendering/mathml/RenderMathMLBlock.cpp:
1927         (WebCore::RenderMathMLBlock::baselinePosition):
1928         (WebCore::RenderMathMLBlock::paint):
1929         (WebCore::parseMathMLNamedSpace):
1930         * rendering/mathml/RenderMathMLBlock.h:
1931         * rendering/mathml/RenderMathMLFenced.cpp:
1932         (WebCore::RenderMathMLFenced::updateFromElement):
1933         (WebCore::RenderMathMLFenced::addChild):
1934         * rendering/mathml/RenderMathMLFenced.h:
1935         * rendering/mathml/RenderMathMLFraction.cpp:
1936         (WebCore::RenderMathMLFraction::styleDidChange):
1937         (WebCore::RenderMathMLFraction::paint):
1938         * rendering/mathml/RenderMathMLFraction.h:
1939         * rendering/mathml/RenderMathMLMath.h:
1940         * rendering/mathml/RenderMathMLMenclose.h:
1941         * rendering/mathml/RenderMathMLOperator.cpp:
1942         * rendering/mathml/RenderMathMLOperator.h:
1943         * rendering/mathml/RenderMathMLRoot.cpp:
1944         (WebCore::RenderMathMLRoot::paint):
1945         * rendering/mathml/RenderMathMLScripts.cpp:
1946         * rendering/mathml/RenderMathMLSpace.cpp:
1947         * rendering/mathml/RenderMathMLSpace.h:
1948         * rendering/mathml/RenderMathMLToken.h:
1949         * rendering/mathml/RenderMathMLUnderOver.cpp:
1950         * rendering/mathml/RenderMathMLUnderOver.h:
1951
1952 2016-07-01  Frederic Wang  <fwang@igalia.com>
1953
1954         Small cleanup: Remove unused functions RenderObject::isRenderMathML*Wrapper
1955         https://bugs.webkit.org/show_bug.cgi?id=159333
1956
1957         Reviewed by Alex Christensen.
1958
1959         After the refactoring of RenderMathMLRoot and RenderMathMLScripts, the anonymous flexbox
1960         wrappers used in the old layout implementation have been removed. We thus remove the
1961         corresponding isRender* function from RenderObject.
1962
1963         No new tests, behavior is unchanged.
1964
1965         * rendering/RenderObject.h:
1966         (WebCore::RenderObject::isRenderMathMLRootWrapper): Deleted.
1967         (WebCore::RenderObject::isRenderMathMLScriptsWrapper): Deleted.
1968
1969 2016-07-01  Andreas Kling  <akling@apple.com>
1970
1971         [Mac] Get rid of the old timey rubber-banding linen pattern.
1972         <https://webkit.org/b/159329>
1973
1974         Reviewed by Benjamin Poulain.
1975
1976         Remove the "ScrollingOverhang" custom GraphicsLayer appearance since that was only used to
1977         install the old timey linen pattern behind the web content.
1978
1979         We now always just set the overhang area's background color to the document background color.
1980
1981         This fixes an issue where we could end up loading the linen pattern and keeping it in memory
1982         despite never actually showing it on screen.
1983
1984         * platform/ScrollbarTheme.h:
1985         (WebCore::ScrollbarTheme::setUpOverhangAreasLayerContents): Deleted.
1986         * platform/graphics/GraphicsLayer.cpp:
1987         * platform/graphics/GraphicsLayer.h:
1988         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1989         (PlatformCALayerCocoa::updateCustomAppearance):
1990         * platform/mac/ScrollbarThemeMac.h:
1991         * platform/mac/ScrollbarThemeMac.mm:
1992         (WebCore::linenBackgroundColor): Deleted.
1993         (WebCore::ScrollbarThemeMac::setUpOverhangAreaBackground): Deleted.
1994         (WebCore::ScrollbarThemeMac::removeOverhangAreaBackground): Deleted.
1995         (WebCore::ScrollbarThemeMac::setUpOverhangAreasLayerContents): Deleted.
1996         * rendering/RenderLayerCompositor.cpp:
1997         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1998         (WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor):
1999
2000 2016-06-30  Jiewen Tan  <jiewen_tan@apple.com>
2001
2002         Create a generic "linked-on-or-after" check for new CSP Rules
2003         https://bugs.webkit.org/show_bug.cgi?id=159322
2004         <rdar://problem/27117220>
2005
2006         Reviewed by Brent Fulgham.
2007
2008         Create a generic "linked-on-or-after" check for new CSP Rules and cleanup
2009         quirks for Ecobee, Quora and XtraMat.
2010
2011         * platform/RuntimeApplicationChecks.h:
2012         * platform/RuntimeApplicationChecks.mm:
2013         (WebCore::IOSApplication::isEcobee): Deleted.
2014         (WebCore::IOSApplication::isQuora): Deleted.
2015         (WebCore::IOSApplication::isXtraMath): Deleted.
2016
2017 2016-06-30  Antti Koivisto  <antti@apple.com>
2018
2019         WebContent crash due to RELEASE_ASSERT(!m_inLoadPendingImages) in StyleResolver::~StyleResolver()
2020         https://bugs.webkit.org/show_bug.cgi?id=159307
2021         <rdar://problem/26184868>
2022
2023         Reviewed by Andreas Kling.
2024
2025         Pseudo elements are resolved in RenderTreeUpdater (instead of Style::TreeResolver). Their resolution may trigger
2026         resource loads which can cause synchronous layout (when failing synchronously) and lead to destruction of the
2027         the style resolver in post layout task.
2028
2029         No known reliable way to test this.
2030
2031         * style/RenderTreeUpdater.cpp:
2032         (WebCore::RenderTreeUpdater::commit):
2033
2034             Use PostResolutionCallbackDisabler in RenderTreeUpdater similarly to Style::TreeResolver. This prevents
2035             post layout tasks from running synchronously and closes this particular crash path.
2036
2037 2016-06-30  Antoine Quint  <graouts@apple.com>
2038
2039         Drawing an SVG image into a <canvas> that is not in the DOM draws the wrong region
2040         https://bugs.webkit.org/show_bug.cgi?id=159276
2041
2042         Reviewed by Dean Jackson.
2043
2044         In the event where the <img> element that we are passing to CanvasRenderingContext2D.drawImage()
2045         points to an SVG resource, we ensure that the container for the SVG image is sized to match the
2046         HTML element. The necessity for setting this container size, explained in webkit.org/b/148845,
2047         is that we must ensure a cached image does not have an outdated container size.
2048
2049         Tests: svg/as-image/img-with-svg-resource-in-dom-and-drawImage.html
2050                svg/as-image/img-with-svg-resource-in-dom-no-size-and-drawImage.html
2051                svg/as-image/img-with-svg-resource-not-in-dom-and-drawImage.html
2052                svg/as-image/img-with-svg-resource-not-in-dom-no-size-and-drawImage.html
2053
2054         * html/canvas/CanvasRenderingContext2D.cpp:
2055         (WebCore::CanvasRenderingContext2D::drawImage):
2056
2057 2016-06-30  Eric Carlson  <eric.carlson@apple.com>
2058
2059         getUserMedia() exposed, but not functional
2060         https://bugs.webkit.org/show_bug.cgi?id=158393
2061         <rdar://problem/26642259>
2062
2063         Reviewed by Dean Jackson.
2064         
2065         Set default value of the Media Stream runtime flag to false on Mac OS X and iOS until the
2066         browser support is in place.
2067
2068         * bindings/generic/RuntimeEnabledFeatures.cpp:
2069         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): Disable media stream by default
2070         on Mac OS X and iOS.
2071         * bindings/generic/RuntimeEnabledFeatures.h:
2072
2073 2016-06-30  Commit Queue  <commit-queue@webkit.org>
2074
2075         Unreviewed, rolling out r202676.
2076         https://bugs.webkit.org/show_bug.cgi?id=159314
2077
2078         This change caused storage/websql tests to crash on Mac and
2079         iOS WK1 (Requested by ryanhaddad on #webkit).
2080
2081         Reverted changeset:
2082
2083         "Purge PassRefPtr in Modules/webdatabase"
2084         https://bugs.webkit.org/show_bug.cgi?id=159255
2085         http://trac.webkit.org/changeset/202676
2086
2087 2016-06-30  Antoine Quint  <graouts@apple.com>
2088
2089         [iOS] Media controls are too cramped with small video
2090         https://bugs.webkit.org/show_bug.cgi?id=158815
2091         <rdar://problem/26824238>
2092
2093         Reviewed by Eric Carlson.
2094
2095         In updateLayoutForDisplayedWidth(), we try to ensure a minimum width is guaranteed
2096         for the progress indicator. However, we were not accounting for the width used by
2097         the current and remaining time labels on either side of it, so we would incorrectly
2098         conclude that we were guaranteeing the minimum time and yield incorrect layouts since
2099         we were trying to fit more buttons than we had room for.
2100
2101         In order to correctly compute the available width for the progress indicator, we now
2102         have clones of the current and remaining time labels, hidden from video and VoiceOver,
2103         that we update along with the originals. The same styles apply to both clones and
2104         originals, so we may measure the clones to determine the space used by the time labels.
2105         The reason we need to use clones is that if the time labels had previously been hidden
2106         from view, precisely because there was not enough space to display them along with the
2107         progress indicator, then trying to obtain metrics from them would yield 0 since they had
2108         "display: none" styles applied. In order to avoid extra layouts and possible flashing, we
2109         use the clones so that we never have to toggle the "display" property of the originals
2110         just to obtain their measurements.
2111
2112         As a result of this change, we adjust the constant used to set the minimum required
2113         width available to display the progress indicator after all other essential controls
2114         and labels have been measured. That constant used to account for the width of the
2115         time labels, and this is no longer correct.
2116
2117         Test: media/video-controls-drop-and-restore-timeline.html
2118
2119         * Modules/mediacontrols/mediaControlsApple.css:
2120         (::-webkit-media-controls-time-remaining-display.clone):
2121         * Modules/mediacontrols/mediaControlsApple.js:
2122         (Controller):
2123         (Controller.prototype.createTimeClones):
2124         (Controller.prototype.removeTimeClass):
2125         (Controller.prototype.addTimeClass):
2126         (Controller.prototype.updateDuration):
2127         (Controller.prototype.updateLayoutForDisplayedWidth):
2128         (Controller.prototype.updateTime):
2129         (Controller.prototype.updateControlsWhileScrubbing):
2130         * Modules/mediacontrols/mediaControlsiOS.css:
2131         (::-webkit-media-controls-time-remaining-display.clone):
2132         * Modules/mediacontrols/mediaControlsiOS.js:
2133
2134 2016-06-30  Brian Burg  <bburg@apple.com>
2135
2136         Unreviewed, fix the macOS Sierra Release configuration after r202642.
2137
2138         * platform/audio/mac/MediaSessionManagerMac.mm:
2139         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
2140         Add missing UNUSED_PARAM for when logging is not enabled.
2141
2142 2016-06-30  Commit Queue  <commit-queue@webkit.org>
2143
2144         Unreviewed, rolling out r202679.
2145         https://bugs.webkit.org/show_bug.cgi?id=159302
2146
2147         Still causing timeouts on media/controls-drag-timebar.html
2148         (Requested by ap on #webkit).
2149
2150         Reverted changeset:
2151
2152         "[iOS] Media controls are too cramped with small video"
2153         https://bugs.webkit.org/show_bug.cgi?id=158815
2154         http://trac.webkit.org/changeset/202679
2155
2156 2016-06-30  Antoine Quint  <graouts@apple.com>
2157
2158         [iOS] Media controls are too cramped with small video
2159         https://bugs.webkit.org/show_bug.cgi?id=158815
2160         <rdar://problem/26824238>
2161
2162         Reviewed by Eric Carlson.
2163
2164         In updateLayoutForDisplayedWidth(), we try to ensure a minimum width is guaranteed
2165         for the progress indicator. However, we were not accounting for the width used by
2166         the current and remaining time labels on either side of it, so we would incorrectly
2167         conclude that we were guaranteeing the minimum time and yield incorrect layouts since
2168         we were trying to fit more buttons than we had room for.
2169
2170         In order to correctly compute the available width for the progress indicator, we now
2171         have clones of the current and remaining time labels, hidden from video and VoiceOver,
2172         that we update along with the originals. The same styles apply to both clones and
2173         originals, so we may measure the clones to determine the space used by the time labels.
2174         The reason we need to use clones is that if the time labels had previously been hidden
2175         from view, precisely because there was not enough space to display them along with the
2176         progress indicator, then trying to obtain metrics from them would yield 0 since they had
2177         "display: none" styles applied. In order to avoid extra layouts and possible flashing, we
2178         use the clones so that we never have to toggle the "display" property of the originals
2179         just to obtain their measurements.
2180
2181         As a result of this change, we adjust the constant used to set the minimum required
2182         width available to display the progress indicator after all other essential controls
2183         and labels have been measured. That constant used to account for the width of the
2184         time labels, and this is no longer correct.
2185
2186         Test: media/video-controls-drop-and-restore-timeline.html
2187
2188         * Modules/mediacontrols/mediaControlsApple.css:
2189         (::-webkit-media-controls-time-remaining-display.clone):
2190         * Modules/mediacontrols/mediaControlsApple.js:
2191         (Controller):
2192         (Controller.prototype.createTimeClones):
2193         (Controller.prototype.removeTimeClass):
2194         (Controller.prototype.addTimeClass):
2195         (Controller.prototype.updateDuration):
2196         (Controller.prototype.updateLayoutForDisplayedWidth):
2197         (Controller.prototype.updateTime):
2198         (Controller.prototype.updateControlsWhileScrubbing):
2199         * Modules/mediacontrols/mediaControlsiOS.css:
2200         (::-webkit-media-controls-time-remaining-display.clone):
2201         * Modules/mediacontrols/mediaControlsiOS.js:
2202
2203 2016-06-30  Eric Carlson  <eric.carlson@apple.com>
2204
2205         [Mac] Crash registering AVFoundation media engine
2206         https://bugs.webkit.org/show_bug.cgi?id=159269
2207         <rdar://problem/27017656>
2208
2209         Reviewed by Brent Fulgham.
2210
2211         * platform/graphics/MediaPlayer.cpp:
2212         (WebCore::mediaEngineVectorLock): New, return the static Lock.
2213         (WebCore::haveMediaEnginesVector): Wrap the naked bool.
2214         (WebCore::buildMediaEnginesVector): Assert that the lock is locked.
2215         (WebCore::installedMediaEngines): Hold the lock while checking/rebuilding the vector.
2216         (WebCore::MediaPlayer::resetMediaEngines): Hold the lock while clearing the vector.
2217
2218         Use SOFT_LINK_CLASS_FOR_SOURCE instead of SOFT_LINK_CLASS because the former uses dispatch_once
2219         to ensure that class loading is thread safe.
2220         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2221         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine):
2222         (WebCore::assetCacheForPath):
2223         (WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache):
2224         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
2225         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
2226         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
2227         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2228         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
2229         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
2230         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
2231         (WebCore::MediaPlayerPrivateAVFoundationObjC::createOpenGLVideoOutput):
2232         (WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
2233         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
2234         (-[WebCoreAVFPullDelegate setCallback:]):
2235         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
2236         (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
2237
2238 2016-06-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2239
2240         [image-decoders] Use final and override in ImageDecoder subclasses
2241         https://bugs.webkit.org/show_bug.cgi?id=159291
2242
2243         Reviewed by Antonio Gomes.
2244
2245         * platform/image-decoders/bmp/BMPImageDecoder.h:
2246         * platform/image-decoders/gif/GIFImageDecoder.h:
2247         * platform/image-decoders/ico/ICOImageDecoder.cpp:
2248         (WebCore::ICOImageDecoder::frameSizeAtIndex):
2249         * platform/image-decoders/ico/ICOImageDecoder.h:
2250         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
2251         * platform/image-decoders/png/PNGImageDecoder.h:
2252         * platform/image-decoders/webp/WEBPImageDecoder.h:
2253
2254 2016-06-30  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2255
2256         Purge PassRefPtr in Modules/webdatabase
2257         https://bugs.webkit.org/show_bug.cgi?id=159255
2258
2259         Reviewed by Benjamin Poulain.
2260
2261         As a step to remove PassRefPtr use, this patch cleans it up in Modules/webdatabase.
2262
2263         Additionally unnecessary spaces and tabs are removed too.
2264
2265         * Modules/webdatabase/ChangeVersionWrapper.cpp:
2266         * Modules/webdatabase/DOMWindowWebDatabase.h:
2267         * Modules/webdatabase/Database.cpp:
2268         (WebCore::Database::Database):
2269         (WebCore::Database::~Database):
2270         (WebCore::Database::scheduleTransaction):
2271         (WebCore::Database::runTransaction):
2272         * Modules/webdatabase/Database.h:
2273         * Modules/webdatabase/DatabaseAuthorizer.cpp:
2274         (WebCore::DatabaseAuthorizer::allowRead):
2275         * Modules/webdatabase/DatabaseManager.cpp:
2276         (WebCore::DatabaseManager::openDatabase):
2277         (WebCore::DatabaseManager::fullPathForDatabase):
2278         (WebCore::DatabaseManager::detailsForNameAndOrigin):
2279         * Modules/webdatabase/DatabaseManager.h:
2280         * Modules/webdatabase/DatabaseTask.cpp:
2281         (WebCore::DatabaseTransactionTask::DatabaseTransactionTask):
2282         * Modules/webdatabase/DatabaseTask.h:
2283         * Modules/webdatabase/SQLCallbackWrapper.h:
2284         (WebCore::SQLCallbackWrapper::SQLCallbackWrapper):
2285         * Modules/webdatabase/SQLResultSetRowList.h:
2286         * Modules/webdatabase/SQLStatement.cpp:
2287         (WebCore::SQLStatement::SQLStatement):
2288         (WebCore::SQLStatement::sqlError):
2289         (WebCore::SQLStatement::sqlResultSet):
2290         * Modules/webdatabase/SQLStatement.h:
2291         * Modules/webdatabase/SQLTransaction.h:
2292         * Modules/webdatabase/SQLTransactionBackend.cpp:
2293         (WebCore::SQLTransactionBackend::create):
2294         (WebCore::SQLTransactionBackend::SQLTransactionBackend):
2295         (WebCore::SQLTransactionBackend::transactionError):
2296         * Modules/webdatabase/SQLTransactionBackend.h:
2297
2298 2016-06-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2299
2300         [Coordinated Graphics] Move CompositingCoordinator from platform to WebKit2 layer
2301         https://bugs.webkit.org/show_bug.cgi?id=159209
2302
2303         Reviewed by Žan Doberšek.
2304
2305         Remove CompositingCoordinator and its helper classes from the platform layer.
2306
2307         * platform/TextureMapper.cmake:
2308
2309 2016-06-29  Youenn Fablet  <youenn@apple.com>
2310
2311         Pass SecurityOrigin as references in CORS check code
2312         https://bugs.webkit.org/show_bug.cgi?id=159263
2313
2314         Reviewed by Alex Christensen.
2315
2316         No change of behavior.
2317
2318         * css/CSSImageSetValue.cpp:
2319         (WebCore::CSSImageSetValue::cachedImageSet):
2320         * css/CSSImageValue.cpp:
2321         (WebCore::CSSImageValue::cachedImage):
2322         * dom/ScriptElement.cpp:
2323         (WebCore::ScriptElement::requestScript):
2324         * loader/CrossOriginAccessControl.cpp:
2325         (WebCore::updateRequestForAccessControl):
2326         (WebCore::createAccessControlPreflightRequest):
2327         (WebCore::passesAccessControlCheck):
2328         * loader/CrossOriginAccessControl.h:
2329         * loader/CrossOriginPreflightChecker.cpp:
2330         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
2331         * loader/DocumentThreadableLoader.cpp:
2332         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2333         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
2334         (WebCore::DocumentThreadableLoader::preflightSuccess):
2335         (WebCore::DocumentThreadableLoader::isAllowedRedirect):
2336         (WebCore::DocumentThreadableLoader::securityOrigin):
2337         * loader/DocumentThreadableLoader.h:
2338         * loader/ImageLoader.cpp:
2339         (WebCore::ImageLoader::updateFromElement):
2340         * loader/LinkLoader.cpp:
2341         (WebCore::preloadIfNeeded):
2342         * loader/MediaResourceLoader.cpp:
2343         (WebCore::MediaResourceLoader::requestResource):
2344         * loader/SubresourceLoader.cpp:
2345         (WebCore::SubresourceLoader::checkCrossOriginAccessControl):
2346         * loader/TextTrackLoader.cpp:
2347         (WebCore::TextTrackLoader::load):
2348         * loader/cache/CachedResource.cpp:
2349         (WebCore::CachedResource::passesAccessControlCheck):
2350         * loader/cache/CachedResourceRequest.cpp:
2351         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
2352
2353 2016-06-29  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2354
2355         WebRTC: Implement MediaEndpointPeerConnection::setConfiguration()
2356         https://bugs.webkit.org/show_bug.cgi?id=159254
2357
2358         Reviewed by Eric Carlson.
2359
2360         Implement MediaEndpointPeerConnection::setConfiguration() which is the
2361         MediaEndpointPeerConnection implementation of RTCPeerConnection.setConfiguration() [1].
2362
2363         [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#dom-rtcpeerconnection-setconfiguration
2364
2365         Testing: Updated existing test.
2366
2367         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2368         (WebCore::MediaEndpointPeerConnection::setConfiguration):
2369         Implemented.
2370         * Modules/mediastream/RTCConfiguration.cpp:
2371         (WebCore::RTCConfiguration::initialize):
2372         * Modules/mediastream/RTCConfiguration.h:
2373         Use shared enums.
2374         * Modules/mediastream/RTCConfiguration.idl:
2375         Remove 'None'/'Public' IceTransportPolicy enum value (removed from WebRTC 1.0).
2376         * platform/mediastream/MediaEndpointConfiguration.cpp:
2377         (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
2378         * platform/mediastream/MediaEndpointConfiguration.h:
2379         Use shared enums.
2380         (WebCore::MediaEndpointConfiguration::create):
2381         * platform/mediastream/PeerConnectionStates.h: Renamed from Source/WebCore/Modules/mediastream/PeerConnectionStates.h.
2382         Make shared enums accessible to platform objects (currently MediaEndpointConfiguration).
2383
2384 2016-06-29  Hunseop Jeong  <hs85.jeong@samsung.com>
2385
2386         Unreviewed, CMake build fix - 2.
2387
2388         * PlatformMac.cmake:
2389
2390 2016-06-29  Hunseop Jeong  <hs85.jeong@samsung.com>
2391
2392         Unreviewed, CMake build fix. 
2393
2394         * PlatformMac.cmake:
2395
2396 2016-06-29  Jer Noble  <jer.noble@apple.com>
2397
2398         Unprefix webkit-playsinline.
2399         https://bugs.webkit.org/show_bug.cgi?id=159283
2400
2401         Reviewed by Eric Carlson.
2402
2403         Tests: media/video-playsinline.html
2404                media/video-webkit-playsinline.html
2405
2406         Unprefix the webkit-playsinline content attribute, as an unprefixed version
2407         was added to the HTML spec by <https://github.com/whatwg/html/pull/1444>.
2408         The new 'playsinline' content attribute reflects to a new DOM property of
2409         the same name.
2410
2411         * html/HTMLAttributeNames.in:
2412         * html/HTMLVideoElement.idl:
2413         * html/MediaElementSession.cpp:
2414         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
2415
2416 2016-06-29  Alex Christensen  <achristensen@webkit.org>
2417
2418         Fix null dereferencing after r201441
2419         https://bugs.webkit.org/show_bug.cgi?id=159282
2420         rdar://problem/27082559
2421
2422         Reviewed by Andreas Kling.
2423
2424         No new tests.  This is reproducible when dragging from regular to high-DPI displays, 
2425         and we don't have testing infrastructure for simulating that.
2426
2427         * css/MediaQueryMatcher.cpp:
2428         (WebCore::MediaQueryMatcher::styleResolverChanged):
2429         MediaQueryListListener::queryChanged can mutate the Vector of listeners while we are iterating it.
2430         Copy the Vector of listeners and iterate the copy so we don't go out of bounds.
2431
2432 2016-06-29  Antti Koivisto  <antti@apple.com>
2433
2434         Factor pending CSS resources into a struct
2435         https://bugs.webkit.org/show_bug.cgi?id=159268
2436
2437         Reviewed by Andreas Kling.
2438
2439         To fix resource loading related re-entrancy issues in StyleResolver we should move the triggering of
2440         resource loads outside the style resolver. The first step for that is to capture pending resources to a struct.
2441
2442         * CMakeLists.txt:
2443         * WebCore.xcodeproj/project.pbxproj:
2444         * css/CSSCursorImageValue.cpp:
2445         (WebCore::CSSCursorImageValue::cachedImage):
2446         (WebCore::CSSCursorImageValue::cachedOrPendingImage):
2447         * css/CSSCursorImageValue.h:
2448         * css/CSSGradientValue.cpp:
2449         (WebCore::GradientStop::GradientStop):
2450         (WebCore::CSSGradientValue::gradientWithStylesResolved):
2451         * css/CSSGradientValue.h:
2452         (WebCore::CSSGradientValue::loadSubimages):
2453         (WebCore::CSSGradientValue::CSSGradientValue):
2454         * css/CSSImageSetValue.cpp:
2455         (WebCore::CSSImageSetValue::cachedImageSet):
2456         (WebCore::CSSImageSetValue::cachedOrPendingImageSet):
2457         * css/CSSImageSetValue.h:
2458         * css/StyleResolver.cpp:
2459         (WebCore::StyleResolver::State::clear):
2460         (WebCore::StyleResolver::State::setParentStyle):
2461         (WebCore::StyleResolver::State::ensurePendingResources):
2462         (WebCore::isAtShadowBoundary):
2463         (WebCore::StyleResolver::cachedOrPendingFromValue):
2464         (WebCore::StyleResolver::generatedOrPendingFromValue):
2465         (WebCore::StyleResolver::setOrPendingFromValue):
2466         (WebCore::StyleResolver::cursorOrPendingFromValue):
2467         (WebCore::filterOperationForType):
2468         (WebCore::StyleResolver::createFilterOperations):
2469         (WebCore::StyleResolver::loadPendingResources):
2470         (WebCore::StyleResolver::MatchedProperties::MatchedProperties):
2471         (WebCore::StyleResolver::loadPendingSVGDocuments): Deleted.
2472         (WebCore::StyleResolver::loadPendingImage): Deleted.
2473         (WebCore::StyleResolver::loadPendingShapeImage): Deleted.
2474         (WebCore::StyleResolver::loadPendingImages): Deleted.
2475         * css/StyleResolver.h:
2476         (WebCore::StyleResolver::rootElementStyle):
2477         (WebCore::StyleResolver::element):
2478         (WebCore::StyleResolver::document):
2479         (WebCore::StyleResolver::documentSettings):
2480         (WebCore::StyleResolver::State::setApplyPropertyToVisitedLinkStyle):
2481         (WebCore::StyleResolver::State::applyPropertyToRegularStyle):
2482         (WebCore::StyleResolver::State::applyPropertyToVisitedLinkStyle):
2483         (WebCore::StyleResolver::State::setFontDirty):
2484         (WebCore::StyleResolver::State::fontDirty):
2485         (WebCore::StyleResolver::State::useSVGZoomRules):
2486         (WebCore::StyleResolver::State::takePendingResources):
2487         (WebCore::StyleResolver::State::cssToLengthConversionData):
2488         (WebCore::StyleResolver::State::cascadeLevel):
2489         (WebCore::StyleResolver::State::setCascadeLevel):
2490         (WebCore::StyleResolver::state):
2491         (WebCore::StyleResolver::State::pendingImageProperties): Deleted.
2492         (WebCore::StyleResolver::State::filtersWithPendingSVGDocuments): Deleted.
2493         * style/StylePendingResources.cpp: Added.
2494         (WebCore::Style::loadPendingImage):
2495         (WebCore::Style::loadPendingImages):
2496         (WebCore::Style::loadPendingSVGFilters):
2497         (WebCore::Style::loadPendingResources):
2498
2499             Move the functions for triggering the resource loads from StyleResolver.
2500
2501         * style/StylePendingResources.h: Added.
2502
2503             Add struct for pending resources.
2504
2505 2016-06-29  Anders Carlsson  <andersca@apple.com>
2506
2507         Add "type" and "paymentPass" properties in PaymentMethod
2508         https://bugs.webkit.org/show_bug.cgi?id=159278
2509         rdar://problem/26999112
2510
2511         Reviewed by Dean Jackson.
2512
2513         * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
2514         (WebCore::toString):
2515         (WebCore::toDictionary):
2516
2517 2016-06-29  Nan Wang  <n_wang@apple.com>
2518
2519         AX: Crash in WebCore::Document::focusNavigationStartingNode(WebCore::FocusDirection) const + 128
2520         https://bugs.webkit.org/show_bug.cgi?id=159240
2521
2522         Reviewed by Ryosuke Niwa.
2523
2524         This crash is caused by passing an empty node to ElementTraversal::previous(Node&). When the
2525         focusNavigationStartingNode has been removed and it has no next sibling, we should fallback
2526         to itself for calculating the next focused element.
2527
2528         Test: fast/events/remove-focus-navigation-starting-point-crash.html
2529
2530         * dom/Document.cpp:
2531         (WebCore::Document::focusNavigationStartingNode):
2532
2533 2016-06-29  Ryan Haddad  <ryanhaddad@apple.com>
2534
2535         Unreviewed, rolling out r202617.
2536
2537         The LayoutTest from this change crashes under GuardMalloc
2538
2539         Reverted changeset:
2540
2541         "Throw exceptions for invalid number of channels for
2542         ConvolverNode"
2543         https://bugs.webkit.org/show_bug.cgi?id=159238
2544         http://trac.webkit.org/changeset/202617
2545
2546 2016-06-29  Anders Carlsson  <andersca@apple.com>
2547
2548         Rename addressFields to contactFields
2549         https://bugs.webkit.org/show_bug.cgi?id=159271
2550         rdar://problem/27086955
2551
2552         Reviewed by Beth Dakin.
2553
2554         * Modules/applepay/ApplePaySession.cpp:
2555         (WebCore::createContactFields):
2556         (WebCore::isValidPaymentRequestPropertyName):
2557         (WebCore::createPaymentRequest):
2558         (WebCore::createAddressFields): Deleted.
2559         * Modules/applepay/PaymentRequest.h:
2560         (WebCore::PaymentRequest::requiredBillingContactFields):
2561         (WebCore::PaymentRequest::setRequiredBillingContactFields):
2562         (WebCore::PaymentRequest::requiredShippingContactFields):
2563         (WebCore::PaymentRequest::setRequiredShippingContactFields):
2564         (WebCore::PaymentRequest::requiredBillingAddressFields): Deleted.
2565         (WebCore::PaymentRequest::setRequiredBillingAddressFields): Deleted.
2566         (WebCore::PaymentRequest::requiredShippingAddressFields): Deleted.
2567         (WebCore::PaymentRequest::setRequiredShippingAddressFields): Deleted.
2568
2569 2016-06-29  Jiewen Tan  <jiewen_tan@apple.com>
2570
2571         Unreviewed, third attempt to fix ASAN build for r202599
2572
2573         * platform/text/TextCodecReplacement.cpp:
2574         (WebCore::TextCodecReplacement::decode):
2575
2576 2016-06-29  Jer Noble  <jer.noble@apple.com>
2577
2578         Adopt MediaRemote.
2579         https://bugs.webkit.org/show_bug.cgi?id=159250
2580
2581         Reviewed by Eric Carlson.
2582
2583         Adopt MediaRemote and use the framework to implement MediaSessionManageMac
2584         and RemoteCommandListenerMac.
2585
2586         * WebCore.xcodeproj/project.pbxproj:
2587         * platform/RemoteCommandListener.cpp:
2588         * platform/audio/PlatformMediaSessionManager.cpp:
2589         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp.
2590         (PlatformMediaSessionManager::updateSessionState):
2591         * platform/audio/mac/MediaSessionManagerMac.h: Added.
2592         * platform/audio/mac/MediaSessionManagerMac.mm: Added.
2593         (WebCore::PlatformMediaSessionManager::sharedManager):
2594         (WebCore::PlatformMediaSessionManager::sharedManagerIfExists):
2595         (WebCore::MediaSessionManagerMac::MediaSessionManagerMac):
2596         (WebCore::MediaSessionManagerMac::~MediaSessionManagerMac):
2597         (WebCore::MediaSessionManagerMac::sessionWillBeginPlayback):
2598         (WebCore::MediaSessionManagerMac::removeSession):
2599         (WebCore::MediaSessionManagerMac::sessionWillEndPlayback):
2600         (WebCore::MediaSessionManagerMac::clientCharacteristicsChanged):
2601         (WebCore::MediaSessionManagerMac::nowPlayingEligibleSession):
2602         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
2603         * platform/cocoa/SoftLinking.h:
2604         * platform/mac/MediaRemoteSoftLink.cpp: Added.
2605         * platform/mac/MediaRemoteSoftLink.h: Added.
2606         * platform/mac/RemoteCommandListenerMac.h: Added.
2607         (WebCore::RemoteCommandListenerMac::createWeakPtr):
2608         * platform/mac/RemoteCommandListenerMac.mm: Added.
2609         (WebCore::RemoteCommandListener::create):
2610         (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac):
2611         (WebCore::RemoteCommandListenerMac::~RemoteCommandListenerMac):
2612         * platform/spi/mac/MediaRemoteSPI.h: Added.
2613
2614 2016-06-29  Jer Noble  <jer.noble@apple.com>
2615
2616         Cannot clear a MediaSource SourceBuffer in Safari 9 and WebKit nightly
2617         https://bugs.webkit.org/show_bug.cgi?id=159230
2618
2619         Reviewed by Eric Carlson.
2620
2621         Test: media/media-source/media-source-remove.html (modified)
2622
2623         Move to using a MediaTime directly (rather than as a double) to add
2624         and removed buffered ranges. Also, drop the use of the "microsecond"
2625         fudge factor when adding buffered ranges.
2626
2627         * Modules/mediasource/SourceBuffer.cpp:
2628         (WebCore::removeSamplesFromTrackBuffer):
2629         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2630
2631 2016-06-29  Jiewen Tan  <jiewen_tan@apple.com>
2632
2633         Unreviewed, second attempt to fix ASAN build for r202599
2634
2635         * platform/text/TextCodecReplacement.cpp:
2636
2637 2016-06-29  Jiewen Tan  <jiewen_tan@apple.com>
2638
2639         Unreviewed, first attempt to fix ASAN build for r202599
2640
2641         * platform/text/TextCodecReplacement.cpp:
2642
2643 2016-06-29  Joseph Pecoraro  <pecoraro@apple.com>
2644
2645         Web Inspector: Show Shadow Root type in DOM Tree
2646         https://bugs.webkit.org/show_bug.cgi?id=159236
2647         <rdar://problem/27068521>
2648
2649         Reviewed by Timothy Hatcher.
2650
2651         Test: inspector/dom/shadowRootType.html
2652
2653         * inspector/InspectorDOMAgent.cpp:
2654         (WebCore::shadowRootType):
2655         (WebCore::InspectorDOMAgent::buildObjectForNode):
2656         Set the shadowRootType property when a node is a ShadowRoot.
2657
2658 2016-06-29  Jeremy Jones  <jeremyj@apple.com>
2659
2660         Replace MPAudioVideoRoutingActionSheet with MPAVRoutingSheet.
2661         https://bugs.webkit.org/show_bug.cgi?id=159161
2662         <rdar://problem/26017691>
2663
2664         Reviewed by Sam Weinig.
2665
2666         Replace MPAudioVideoRoutingActionSheet SPI with MPAVRoutingSheet SPI.
2667
2668         * platform/spi/ios/MediaPlayerSPI.h:
2669
2670 2016-06-29  Alejandro G. Castro  <alex@igalia.com>
2671
2672         WebRTC: ice-char can not contain '=' characters for credentials
2673         https://bugs.webkit.org/show_bug.cgi?id=159207
2674
2675         Reviewed by Eric Carlson.
2676
2677         Avoid a general calculation to get a base64 without padding which
2678         was wrong in the randomString function. Because each parameter
2679         using the function requires a different setup depending of the
2680         specification and this is not a general API, it is a better
2681         solution to calculate and store the sizes we want to use, comment
2682         them and test them, considering we use base64 to generate the
2683         strings we just need to avoid padding.
2684
2685         Existing test modified to match the correct behavior.
2686
2687         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2688         (WebCore::randomString): Now the size is the one passed.
2689         (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection):
2690         Used different valid values following the sdp parser in each case.
2691
2692 2016-06-29  David Kilzer  <ddkilzer@apple.com>
2693
2694         Crash when 'input' event handler for input[type=color] changes the input type
2695         <https://webkit.org/b/159262>
2696         <rdar://problem/27020404>
2697
2698         Reviewed by Daniel Bates.
2699
2700         Fix based on a Blink change (patch by <tkent@chromium.org>):
2701         <https://chromium.googlesource.com/chromium/src.git/+/a17cb3ecef49a078657524cdeaba33ad2083646c>
2702
2703         Test: fast/forms/color/color-type-change-on-input-crash.html
2704
2705         * html/ColorInputType.cpp:
2706         (WebCore::ColorInputType::didChooseColor): Add EventQueueScope
2707         before setValueFromRenderer() to fix the bug.
2708         * html/HTMLInputElement.h:
2709         (WebCore::HTMLInputElement::setValueFromRenderer): Add comment
2710         about how to use this method.
2711
2712 2016-06-29  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2713
2714         WebRTC: Misc MediaStreamEvent fixes: Update build flag and remove PassRefPtr usage
2715         https://bugs.webkit.org/show_bug.cgi?id=159132
2716
2717         Reviewed by Eric Carlson.
2718
2719         Use the WEB_RTC build flag instead of MEDIA_STREAM since this event is related to
2720         RTCPeerConnection. Also remove PassRefPtr usage.
2721
2722         Updated existing expected results.
2723
2724         * Modules/mediastream/MediaStreamEvent.cpp:
2725         (WebCore::MediaStreamEvent::create):
2726         (WebCore::MediaStreamEvent::MediaStreamEvent):
2727         * Modules/mediastream/MediaStreamEvent.h:
2728         * Modules/mediastream/MediaStreamEvent.idl:
2729         * dom/EventNames.in:
2730
2731 2016-06-29  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2732
2733         REGRESSION(r202337) [WebRTC] Crash when loading html5test.com
2734         https://bugs.webkit.org/show_bug.cgi?id=159145
2735
2736         Reviewed by Eric Carlson.
2737
2738         MediaEndpointPeerConnection uses an implementation of the MediaEndpoint interface to
2739         interact with the port's WebRTC backend. A mock (MockMediaEndpoint) is used for testing.
2740         This change adds an "empty" MediaEndpoint implementation that simplifies the case when a
2741         port builds and tests with MediaEndpointPeerConnection/MockMediaEndpoint, but doesn't have
2742         a "real" MediaEndpoint implementation yet (to use with MiniBrowser).
2743
2744         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2745         (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection):
2746         * platform/mediastream/MediaEndpoint.cpp:
2747         (WebCore::EmptyRealtimeMediaSource::create):
2748         (WebCore::EmptyRealtimeMediaSource::EmptyRealtimeMediaSource):
2749         (WebCore::EmptyMediaEndpoint::EmptyMediaEndpoint):
2750         (WebCore::createMediaEndpoint):
2751
2752 2016-06-29  Alejandro G. Castro  <alex@igalia.com>
2753
2754         Fix assertion in debug build when creating the SocketStreamHandle object.
2755
2756         We have to call relaxAdoptionRequirement to avoid the assertion
2757         when protecting the non-adopted SocketStreamHandle we are
2758         creating. Update to r202370.
2759
2760         Rubber-stamped by Carlos Garcia Campos.
2761
2762         * platform/network/soup/SocketStreamHandleSoup.cpp:
2763         (WebCore::SocketStreamHandle::SocketStreamHandle):
2764
2765 2016-06-29  David Kilzer  <ddkilzer@apple.com>
2766
2767         Throw exceptions for invalid number of channels for ConvolverNode
2768         <https://webkit.org/b/159238>
2769         <rdar://problem/27020410>
2770
2771         Reviewed by Brent Fulgham.
2772
2773         Fix based on a Blink change (patch by <rtoy@chromium.org>):
2774         <https://chromium.googlesource.com/chromium/src.git/+/0cc26bbb7175aec77910d0b47faf9f8c8a640fe5>
2775
2776         Test: webaudio/convolver-channels.html
2777
2778         * Modules/webaudio/ConvolverNode.cpp:
2779         (WebCore::ConvolverNode::setBuffer): Throw an exception for
2780         anything but 1, 2 or 4 channels.
2781
2782 2016-06-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2783
2784         REGRESSION(r198782, r201043): [image-decoders] Flickering with some animated gif
2785         https://bugs.webkit.org/show_bug.cgi?id=159089
2786
2787         Reviewed by Antonio Gomes.
2788
2789         There's some flickering when loading big enough animated gifs running the animation in a loop. The first time it
2790         loads everything is fine, but after the first loop iteration there are several flickering effects, once every
2791         time the animation finishes and some others happening in the middle of the animation loop. The flickering
2792         happens because we fail to render some of the frames, and it has two diferent causes:
2793
2794          - In r198782, ImageDecoder::createFrameImageAtIndex(), was modified to check first if the image is empty to
2795         return early, and then try to get the frame image from the decoder. This is the aone causing the flickering
2796         always on the first frame after one iteration. It happens because ImageDecoder::size() is always empty at that
2797         point. The first time doesn't happen because the gif is loaded and BitmapImage calls isSizeAvailable() from
2798         BitmapImage::dataChanged(). The isSizeAvailable call makes the gif decoder calculate the size. But for the next
2799         iterations, frames are cached and BitmapImage already has the decoded data so isSizeAvailable is not called
2800         again. When createFrameImageAtIndex() is called again for the first frame, size is empty until the gif decoder
2801         creates the reader again, which happens when frameBufferAtIndex() is called, so after that the size is
2802         available. So, we could call isSizeAvailable before checking the size, or simply do the check after the
2803         frameBufferAtIndex() call as we used to do.
2804
2805          - In r201043 BitmapImage::destroyDecodedDataIfNecessary() was fixed to use the actual bytes used by the frame
2806         in order to decide whether to destroy decoded data or not. This actually revealed a bug, it didn't happen before
2807         because we were never destroying frames before. The bug is in the gif decoder that doesn't correctly handle the
2808         case of destroying only some of the frames from the buffer cache. The gif decoder is designed to always process the
2809         frames in order, the reader keeps an index of the currently processed frame, so when some frames are read from the
2810         cache, and then we ask the decoder for a not cached frame, the currently processed frame is not in sync with the
2811         actual frame we are asking for, and we end do not processing any frame at all.
2812
2813         * platform/image-decoders/ImageDecoder.cpp:
2814         (WebCore::ImageDecoder::createFrameImageAtIndex): Check the size after calling frameBufferAtIndex().
2815         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2816         (WebCore::GIFImageDecoder::clearFrameBufferCache): Delete the reader when clearing the cache since it's out of sync.
2817
2818 2016-06-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2819
2820         [GStreamer] Adaptive streaming issues
2821         https://bugs.webkit.org/show_bug.cgi?id=144040
2822
2823         Reviewed by Philippe Normand.
2824
2825         There are multiple deadlocks in the web process when HLS content is loaded by GStreamer. It happens because gst
2826         is using several threads to download manifest, fragments, monitor the downloads, etc. To download the fragments
2827         and manifest it always creates the source element in a separate thread, something that is not actually expected
2828         to happen in WebKit source element. Our source element is always scheduling tasks (start, stop, need-data,
2829         enough-data and seek) to the main thread, and those downloads that use the ResourceHandleStreamingClient
2830         (there's no player associated) also happen in the main thread, because libsoup calls all its async callbacks in
2831         the main thread. So, the result is that it can happen that we end up blocking the main thread in a lock until
2832         the download finishes, but the download never finishes because tasks are scheduled in the main thread that is
2833         blocked in a lock. This can be prevented by always using a secondary thread for downloads made by
2834         ResourceHandleStreamingClient, using its own run loop with a different GMainContext so that libsoup sends
2835         callbacks to the right thread. We also had to refactor the tasks a bit, leaving the thread safe parts to be run
2836         in the calling thread always, and only scheduling to the main thread in case of not using
2837         ResourceHandleStreamingClient and only for the non thread safe parts.
2838         This patch also includes r200455 that was rolled out, but it was a perfectly valid workaround for GST bug.
2839
2840         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
2841         (WTF::ensureGRef): Consume the floating ref if needed.
2842         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
2843         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2844         (webkit_web_src_init): Check if object is being created in the main thread.
2845         (webKitWebSrcStop): Stop the media resource loader in the main thread and the resource handle streaming in the
2846         current thread.
2847         (webKitWebSrcStart): Start the media resource loader in the main thread and the resource handle streaming in
2848         the current thread.
2849         (webKitWebSrcChangeState): Call webKitWebSrcStart and webKitWebSrcStop in the current thread.
2850         (webKitWebSrcNeedData): Update status in the current thread and notify the media resource loader in the main thread.
2851         (webKitWebSrcEnoughData): Ditto.
2852         (webKitWebSrcSeek): Ditto.
2853         (webKitWebSrcSetMediaPlayer): Add an assert to ensure that source elements used by WebKit are always created in
2854         the main thread.
2855         (ResourceHandleStreamingClient::ResourceHandleStreamingClient): Use a secondary thread to do the download.
2856         (ResourceHandleStreamingClient::~ResourceHandleStreamingClient): Stop the secondary thread.
2857         (ResourceHandleStreamingClient::setDefersLoading): Notify the secondary thread.
2858
2859 2016-06-28  Youenn Fablet  <youennf@gmail.com>
2860
2861         Remove ThreadableLoaderOptions origin
2862         https://bugs.webkit.org/show_bug.cgi?id=159221
2863
2864         Reviewed by Sam Weinig.
2865
2866         No change of behavior.
2867
2868         * loader/DocumentThreadableLoader.cpp:
2869         (WebCore::DocumentThreadableLoader::loadResourceSynchronously): Adding origing parameter.
2870         (WebCore::DocumentThreadableLoader::create): Ditto.
2871         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Ditto.
2872         (WebCore::DocumentThreadableLoader::redirectReceived): Setting m_origin.
2873         (WebCore::DocumentThreadableLoader::securityOrigin): Checking m_origin.
2874         * loader/DocumentThreadableLoader.h: Adding m_origin member.
2875         * loader/ThreadableLoader.cpp:
2876         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Removing origin.
2877         (WebCore::ThreadableLoaderOption::isolatedCopy): Deleted.
2878         * loader/ThreadableLoader.h: Removing origin parameter and isolatedCopy function.
2879         * loader/WorkerThreadableLoader.cpp:
2880         (WebCore::LoaderTaskOptions::LoaderTaskOptions): Structure to pass loader task options from one thread to another.
2881         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
2882         * page/EventSource.cpp:
2883         (WebCore::EventSource::connect): Removing setting of the origin.
2884         * workers/WorkerScriptLoader.cpp:
2885         (WebCore::WorkerScriptLoader::loadSynchronously): Ditto.
2886         (WebCore::WorkerScriptLoader::loadAsynchronously): Ditto.
2887         * xml/XMLHttpRequest.cpp:
2888         (WebCore::XMLHttpRequest::createRequest): Ditto.
2889
2890 2016-06-28  Commit Queue  <commit-queue@webkit.org>
2891
2892         Unreviewed, rolling out r202580.
2893         https://bugs.webkit.org/show_bug.cgi?id=159245
2894
2895         Caused all WKTR tests to fail on GuardMalloc and Production
2896         only for unknown reasons, investigating offline. (Requested by
2897         brrian on #webkit).
2898
2899         Reverted changeset:
2900
2901         "RunLoop::Timer should use constructor templates instead of
2902         class templates"
2903         https://bugs.webkit.org/show_bug.cgi?id=159153
2904         http://trac.webkit.org/changeset/202580
2905
2906 2016-06-28  Benjamin Poulain  <benjamin@webkit.org>
2907
2908         Rename ChildrenAffectedByActive to StyleAffectedByActive
2909         https://bugs.webkit.org/show_bug.cgi?id=159187
2910
2911         Reviewed by Antti Koivisto.
2912
2913         Flags named "ChildrenAffectedBy" are used when the invalidation
2914         of children is so crazy that we invalidate the whole parent subtree instead.
2915
2916         That's not the case for :active. It is a straightforward element invalidation.
2917         Consequently, the property is renamed to StyleAffectedByActive.
2918
2919         * dom/Element.cpp:
2920         (WebCore::Element::setActive):
2921         (WebCore::Element::setStyleAffectedByActive):
2922         (WebCore::Element::hasFlagsSetDuringStylingOfChildren):
2923         (WebCore::Element::rareDataStyleAffectedByActive):
2924         (WebCore::Element::setChildrenAffectedByActive): Deleted.
2925         (WebCore::Element::rareDataChildrenAffectedByActive): Deleted.
2926         * dom/Element.h:
2927         (WebCore::Element::styleAffectedByActive):
2928         (WebCore::Element::childrenAffectedByActive): Deleted.
2929         * dom/ElementRareData.h:
2930         (WebCore::ElementRareData::styleAffectedByActive):
2931         (WebCore::ElementRareData::setStyleAffectedByActive):
2932         (WebCore::ElementRareData::ElementRareData):
2933         (WebCore::ElementRareData::resetDynamicRestyleObservations):
2934         (WebCore::ElementRareData::childrenAffectedByActive): Deleted.
2935         (WebCore::ElementRareData::setChildrenAffectedByActive): Deleted.
2936         * style/StyleRelations.cpp:
2937         (WebCore::Style::commitRelations):
2938
2939 2016-06-28  Jiewen Tan  <jiewen_tan@apple.com>
2940
2941         Implement "replacement" codec
2942         https://bugs.webkit.org/show_bug.cgi?id=159180
2943         <rdar://problem/26015178>
2944
2945         Reviewed by Brent Fulgham.
2946
2947         Test: fast/encoding/charset-replacement.html
2948
2949         Add support for "replacement" codec according to the spec:
2950         https://encoding.spec.whatwg.org/#replacement
2951         According to the spec, encoding labels {"csiso2022kr", "hz-gb-2312", "iso-2022-cn",
2952         "iso-2022-cn-ext", "iso-2022-kr"} are used to conduct certain attacks that abuse
2953         a mismatch between encodings supported on the server and the client. Therefore,
2954         they are grouped under the "replacement" codec, which does the following things
2955         to prevent those attacks.
2956         1) Decode: terminates with a single U+FFFD.
2957         2) Encode: treated as UTF-8.
2958
2959         Furthermore, the "replacement" codec is a specification convenience to group those
2960         vulnerable encoding labels. Therefore, it should not be able to use directly.
2961
2962         This change is based on the following Blink changes:
2963         https://codereview.chromium.org/265973003, and
2964         https://codereview.chromium.org/261013007.
2965
2966         * CMakeLists.txt:
2967         * WebCore.xcodeproj/project.pbxproj:
2968         * platform/text/TextAllInOne.cpp:
2969         * platform/text/TextCodecReplacement.cpp: Added.
2970         (WebCore::TextCodecReplacement::create):
2971         (WebCore::TextCodecReplacement::TextCodecReplacement):
2972         (WebCore::TextCodecReplacement::registerEncodingNames):
2973         (WebCore::TextCodecReplacement::registerCodecs):
2974         (WebCore::TextCodecReplacement::decode):
2975         * platform/text/TextCodecReplacement.h: Added.
2976         * platform/text/TextEncoding.cpp:
2977         (WebCore::TextEncoding::TextEncoding):
2978         * platform/text/TextEncodingRegistry.cpp:
2979         (WebCore::isReplacementEncoding):
2980         (WebCore::extendTextCodecMaps):
2981         * platform/text/TextEncodingRegistry.h:
2982
2983 2016-06-28  Dean Jackson  <dino@apple.com>
2984
2985         Remove incorrect comments in HTMLCanvasElement
2986         https://bugs.webkit.org/show_bug.cgi?id=159229
2987
2988         Reviewed by Sam Weinig.
2989
2990         These comments are wrong.
2991
2992         * html/HTMLCanvasElement.cpp:
2993         (WebCore::HTMLCanvasElement::probablySupportsContext):
2994         (WebCore::HTMLCanvasElement::getContext): Deleted.
2995
2996 2016-06-28  Geoffrey Garen  <ggaren@apple.com>
2997
2998         CrashTracer beneath JSC::MarkedBlock::specializedSweep
2999         https://bugs.webkit.org/show_bug.cgi?id=159223
3000
3001         Reviewed by Saam Barati.
3002
3003         This crash is caused by a media element re-entering JS during the GC
3004         sweep phase.
3005
3006         In theory, other CachedResourceClients in the DOM might also trigger
3007         similar bugs, but our data only implicates the media elements, so this
3008         fix targets them.
3009
3010         * html/HTMLDocument.h: Document has no reason to inherit from
3011         CachedResourceClient. I found this becuase I had to search for all
3012         CachedResourceClients in researching this patch.
3013
3014         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
3015         (WebCore::WebCoreAVCFResourceLoader::invalidate): Delay our call to
3016         stopLoading because it might re-enter JS, and we might have been called
3017         by the GC sweep phase destroying a media element.
3018
3019         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3020         (WebCore::WebCoreAVFResourceLoader::invalidate): Ditto.
3021
3022 2016-06-28  Saam Barati  <sbarati@apple.com>
3023
3024         some Watchpoints' ::fireInternal method will call operations that might GC where the GC will cause the watchpoint itself to destruct
3025         https://bugs.webkit.org/show_bug.cgi?id=159198
3026         <rdar://problem/26302360>
3027
3028         Reviewed by Filip Pizlo.
3029
3030         * bindings/js/JSDOMWindowBase.cpp:
3031         (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
3032         * bindings/scripts/CodeGeneratorJS.pm:
3033         (GenerateHeader):
3034         * bindings/scripts/test/JS/JSTestEventTarget.h:
3035         (WebCore::JSTestEventTarget::create):
3036
3037 2016-06-28  Anders Carlsson  <andersca@apple.com>
3038
3039         Move the user gesture requirement to the ApplePaySession constructor
3040         https://bugs.webkit.org/show_bug.cgi?id=159225
3041         rdar://problem/26507267
3042
3043         Reviewed by Tim Horton.
3044
3045         By doing this, clients can do pre-validation before showing the sheet, while we still maintain the user gesture requirement.
3046
3047         * Modules/applepay/ApplePaySession.cpp:
3048         (WebCore::ApplePaySession::create):
3049         (WebCore::ApplePaySession::begin): Deleted.
3050
3051 2016-06-28  Youenn Fablet  <youenn@apple.com>
3052
3053         Iterable interfaces should have their related prototype @@iterator property writable
3054         https://bugs.webkit.org/show_bug.cgi?id=159211
3055         <rdar://problem/26950766>
3056
3057         Reviewed by Chris Dumez.
3058
3059         Updating @@iterator property according  http://heycam.github.io/webidl/#es-iterator.
3060
3061         Covered by updated test.
3062
3063         * bindings/scripts/CodeGeneratorJS.pm:
3064         (GenerateImplementation): Removing ReadOnly flag from @@iterator property of iterable interfaces.
3065         * bindings/scripts/test/JS/JSTestNode.cpp:
3066         (WebCore::JSTestNodePrototype::finishCreation): Rebasing expectation.
3067         * bindings/scripts/test/JS/JSTestObj.cpp:
3068         (WebCore::JSTestObjPrototype::finishCreation): Ditto.
3069
3070 2016-06-28  Anders Carlsson  <andersca@apple.com>
3071
3072         "Total amount is too big" error message is displaying on clicking Pay button
3073         https://bugs.webkit.org/show_bug.cgi?id=159219
3074         rdar://problem/26722110
3075
3076         Reviewed by Tim Horton.
3077
3078         Match the PassKit max amount.
3079
3080         * Modules/applepay/PaymentRequestValidator.cpp:
3081         (WebCore::PaymentRequestValidator::validateTotal):
3082
3083 2016-06-28  Anders Carlsson  <andersca@apple.com>
3084
3085         PaymentMerchantSession should wrap a PKPaymentMerchantSession
3086         https://bugs.webkit.org/show_bug.cgi?id=159218
3087         rdar://problem/26872118
3088
3089         Reviewed by Tim Horton.
3090
3091         * Modules/applepay/ApplePaySession.cpp:
3092         (WebCore::ApplePaySession::completeMerchantValidation):
3093         Use PaymentMerchantSession::fromJS.
3094
3095         (WebCore::createMerchantSession): Deleted.
3096
3097         * Modules/applepay/PaymentCoordinator.h:
3098         PaymentMerchantSession is now a class.
3099
3100         * Modules/applepay/PaymentCoordinatorClient.h:
3101         PaymentMerchantSession is now a class.
3102
3103         * Modules/applepay/PaymentMerchantSession.h:
3104         (WebCore::PaymentMerchantSession::PaymentMerchantSession):
3105         (WebCore::PaymentMerchantSession::~PaymentMerchantSession):
3106         (WebCore::PaymentMerchantSession::pkPaymentMerchantSession):
3107         Store a PKPaymentMerchantSession in a RetainPtr inside the PaymentMerchantSession object.
3108
3109         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
3110         (WebCore::PaymentMerchantSession::fromJS):
3111         Convert the JS object to a PKPaymentMerchantSession and return a PaymentMerchantSession that wraps it.
3112
3113         * WebCore.xcodeproj/project.pbxproj:
3114         Add new files.
3115
3116         * bindings/js/Dictionary.h:
3117         (WebCore::Dictionary::initializerObject):
3118         Add new getter.
3119
3120 2016-06-28  Brian Burg  <bburg@apple.com>
3121
3122         RunLoop::Timer should use constructor templates instead of class templates
3123         https://bugs.webkit.org/show_bug.cgi?id=159153
3124
3125         Reviewed by Alex Christensen.
3126
3127         Remove the RunLoop::Timer class template argument, and pass its constructor
3128         a reference to `this` instead of a pointer to `this`.
3129
3130         * Modules/mediasession/WebMediaSessionManager.cpp:
3131         (WebCore::WebMediaSessionManager::WebMediaSessionManager):
3132         * Modules/mediasession/WebMediaSessionManager.h:
3133         * page/WheelEventTestTrigger.cpp:
3134         (WebCore::WheelEventTestTrigger::WheelEventTestTrigger):
3135         * page/WheelEventTestTrigger.h:
3136         * page/mac/TextIndicatorWindow.h:
3137         * page/mac/TextIndicatorWindow.mm:
3138         (WebCore::TextIndicatorWindow::TextIndicatorWindow):
3139         * platform/MainThreadSharedTimer.h:
3140         * platform/cocoa/ScrollController.h:
3141         * platform/cocoa/ScrollController.mm:
3142         (WebCore::ScrollController::ScrollController):
3143         * platform/glib/MainThreadSharedTimerGLib.cpp:
3144         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
3145         * platform/graphics/MediaPlaybackTargetPicker.cpp:
3146         (WebCore::MediaPlaybackTargetPicker::MediaPlaybackTargetPicker):
3147         * platform/graphics/MediaPlaybackTargetPicker.h:
3148         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3149         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
3150         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3151         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3152         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
3153         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3154         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
3155         (VideoRenderRequestScheduler::VideoRenderRequestScheduler):
3156         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
3157         (WebCore::TextureMapperPlatformLayerProxy::TextureMapperPlatformLayerProxy):
3158         (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread):
3159         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
3160         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
3161         (WebCore::MediaPlaybackTargetPickerMock::MediaPlaybackTargetPickerMock):
3162         * platform/mock/MediaPlaybackTargetPickerMock.h:
3163         * platform/mock/MockRealtimeVideoSource.cpp:
3164         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
3165         * platform/mock/MockRealtimeVideoSource.h:
3166         * platform/network/ResourceHandleInternal.h:
3167         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3168
3169 2016-06-27  Jer Noble  <jer.noble@apple.com>
3170
3171         Cross-domain video loads do not prompt for authorization.
3172         https://bugs.webkit.org/show_bug.cgi?id=159195
3173         <rdar://problem/26234612>
3174
3175         Reviewed by Brent Fulgham.
3176
3177         Test: http/tests/media/video-auth.html (modified)
3178
3179         We should prompt for authorization when a cross-origin <video> is embedded
3180         in a web page.
3181
3182         * loader/MediaResourceLoader.cpp:
3183         (WebCore::MediaResourceLoader::requestResource):
3184
3185 2016-06-28  Ryosuke Niwa  <rniwa@webkit.org>
3186
3187         REGRESSION(r201471): FormClient.textFieldDidEndEditing is no longer called when a text field is removed
3188         https://bugs.webkit.org/show_bug.cgi?id=159199
3189         <rdar://problem/26748189>
3190
3191         Reviewed by Alexey Proskuryakov.
3192
3193         The bug was caused by HTMLInputElement's endEditing no longer getting called due to the behavior change.
3194         Preserve the WebKit2 API semantics by manually calling HTMLInputElement::endEditing in setFocusedElement.
3195
3196         Tests: WebKit2TextFieldDidBeginAndEndEditing
3197
3198         * dom/Document.cpp:
3199         (WebCore::Document::setFocusedElement):
3200
3201 2016-06-28  Frederic Wang  <fwang@igalia.com>
3202
3203         Phrasing content should be accepted in <mo> elements
3204         https://bugs.webkit.org/show_bug.cgi?id=130245
3205
3206         Reviewed by Brent Fulgham.
3207
3208         After r202420, the RenderMathMLOperator element no longer messes with anonymous block and
3209         text nodes. Hence it is now safe to allow foreign content inside <mo>.
3210
3211         We extend foreign-element-in-token.html to cover the mo case.
3212
3213         * mathml/MathMLTextElement.cpp:
3214         (WebCore::MathMLTextElement::childShouldCreateRenderer): Remove the early return for <mo> so
3215         that it accepts phrasing content children.
3216
3217 2016-06-27  Anders Carlsson  <andersca@apple.com>
3218
3219         WebKit::WebPaymentCoordinator leak
3220         https://bugs.webkit.org/show_bug.cgi?id=159168
3221         rdar://problem/26929772
3222
3223         Reviewed by Beth Dakin.
3224
3225         * Modules/applepay/PaymentCoordinator.cpp:
3226         (WebCore::PaymentCoordinator::~PaymentCoordinator):
3227         Call paymentCoordinatorDestroyed().
3228
3229         * Modules/applepay/PaymentCoordinatorClient.h:
3230         Rename mainFrameDestroyed to paymentCoordinatorDestroyed().
3231
3232         * loader/EmptyClients.cpp:
3233
3234 2016-06-28  Frederic Wang  <fwang@igalia.com>
3235
3236         Remove anonymous in renderName for all MathML renderers but RenderMathMLOperator
3237         https://bugs.webkit.org/show_bug.cgi?id=159114
3238
3239         Reviewed by Martin Robinson.
3240
3241         After r202420, the only anonymous MathML renderers are the RenderMathMLOperators created by
3242         the mfenced element. Hence we remove the special case for anonymous in the renderName
3243         implementation of most MathML renderers.
3244
3245         No new tests, behavior unchanged.
3246
3247         * rendering/mathml/RenderMathMLRow.h:
3248         * rendering/mathml/RenderMathMLSpace.h:
3249         * rendering/mathml/RenderMathMLToken.h:
3250
3251 2016-06-28  Adam Bergkvist  <adam.bergkvist@ericsson.com>
3252
3253         WebRTC: Robustify 'this' type check in RTCPeerConnection JS built-ins
3254         https://bugs.webkit.org/show_bug.cgi?id=158831
3255
3256         Reviewed by Youenn Fablet.
3257
3258         Use @operations slot in RTCPeerConnection type check.
3259
3260         Updated results of existing test.
3261
3262         * Modules/mediastream/RTCPeerConnection.js:
3263         (initializeRTCPeerConnection):
3264         Initialize @operations slot in constructor.
3265         * Modules/mediastream/RTCPeerConnectionInternals.js:
3266         (isRTCPeerConnection):
3267         Use @operations slot in type check.
3268
3269 2016-06-28  Frederic Wang  <fwang@igalia.com>
3270
3271         AX: Remove dead code in AccessibilityRenderObject::textUnderElement
3272         https://bugs.webkit.org/show_bug.cgi?id=159205
3273
3274         Reviewed by Joanmarie Diggs.
3275
3276         RenderMathMLOperator used to destroy its descendants and to replace them with an anonymous
3277         text node wrapped inside anonymous blocks. After r202420, it just behaves as any other token
3278         elements. Hence we remove the code in AccessibilityRenderObject::textUnderElement that was
3279         used to handle this specific render tree structure.
3280
3281         No new tests, already covered by accessibility/math-text.html.
3282
3283         * accessibility/AccessibilityRenderObject.cpp:
3284         (WebCore::AccessibilityRenderObject::textUnderElement): Remove dead code for RenderText and RenderMathMLOperator.
3285
3286 2016-06-28  Per Arne Vollan  <pvollan@apple.com>
3287
3288         [Win] Custom elements tests are failing.
3289         https://bugs.webkit.org/show_bug.cgi?id=159139
3290
3291         Reviewed by Alex Christensen.
3292
3293         Fix compile errors after enabling custom element API.
3294
3295         * bindings/js/JSHTMLElementCustom.cpp:
3296         (WebCore::constructJSHTMLElement):
3297         * dom/CustomElementDefinitions.cpp:
3298         (WebCore::CustomElementDefinitions::addElementDefinition):
3299         * dom/Document.cpp:
3300         (WebCore::createHTMLElementWithNameValidation):
3301         (WebCore::createFallbackHTMLElement):
3302         * dom/Element.cpp:
3303         (WebCore::Element::attributeChanged):
3304         * dom/LifecycleCallbackQueue.cpp:
3305         (WebCore::LifecycleQueueItem::LifecycleQueueItem):
3306         (WebCore::LifecycleCallbackQueue::enqueueElementUpgrade):
3307         (WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallback):
3308         * html/parser/HTMLConstructionSite.cpp:
3309         (WebCore::HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface):
3310         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
3311         * html/parser/HTMLDocumentParser.cpp:
3312         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
3313         * html/parser/HTMLTreeBuilder.cpp:
3314         (WebCore::CustomElementConstructionData::CustomElementConstructionData):
3315         (WebCore::HTMLTreeBuilder::insertGenericHTMLElement):
3316         * html/parser/HTMLTreeBuilder.h:
3317
3318 2016-06-28  Philippe Normand  <pnormand@igalia.com>
3319
3320         [GStreamer] usec rounding is wrong during accurate seeking
3321         https://bugs.webkit.org/show_bug.cgi?id=90734
3322
3323         Reviewed by Carlos Garcia Campos.
3324
3325         Use floor() to round the microseconds value, this is more robust
3326         than roundf.
3327
3328         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
3329         (WebCore::toGstClockTime):
3330         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3331         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
3332
3333 2016-06-28  Philippe Normand  <pnormand@igalia.com>
3334
3335         [GStreamer] improved duration query support in the HTTP source element
3336         https://bugs.webkit.org/show_bug.cgi?id=159204
3337
3338         Reviewed by Carlos Garcia Campos.
3339
3340         When we have the Content-Length value it is possible to infer the TIME
3341         duration in most cases by performing a convert query in the downstream
3342         elements. This is especially useful when the duration query wasn't
3343         managed by the sinks and thus reached the source element.
3344
3345         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3346         (webKitWebSrcQueryWithParent):
3347
3348 2016-06-28  Youenn Fablet  <youenn@apple.com>
3349
3350         Binding generator should generate accessors for constructors safely accessed from JS builtin
3351         https://bugs.webkit.org/show_bug.cgi?id=159087
3352
3353         Reviewed by Alex Christensen.
3354
3355         Removed constructor private slots direct additions in JSDOMGlobalObject.
3356         Added support for generating the code that will do that.
3357         Advantage of the implementation:
3358         - Private slots will expose constructors that are also publically visible (previously workers had some private slots filled with WebRTC constructors).
3359         - Private slots no longer require the creation of the constructors at window creation time.
3360
3361         Although PublicIdentifier and PrivateIdentifier are both added where needed, the binding generator does not
3362         support the case of a constructor accessible only privately.
3363
3364         Covered by existing test set and adding binding test.
3365
3366         * Modules/mediastream/MediaStream.idl: Marked as PublicIdentifier/PrivateIdentifier.
3367         * Modules/mediastream/MediaStreamTrack.idl: Ditto.
3368         * Modules/mediastream/RTCIceCandidate.idl: Ditto.
3369         * Modules/mediastream/RTCSessionDescription.idl: Ditto.
3370         * Modules/streams/ReadableStream.idl: Ditto.
3371         * bindings/js/JSDOMGlobalObject.cpp:
3372         (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Removed unneeded additions.
3373         * bindings/scripts/CodeGeneratorJS.pm:
3374         (GenerateImplementation): Added support for private slots for interface constructors marked as
3375         PrivateIdentifier.
3376         * bindings/scripts/preprocess-idls.pl:
3377         (GenerateConstructorAttribute): Make PublicIdentifier/PrivateIdentifier copied interface attributes.
3378         * bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.cpp:
3379         (webkit_dom_test_global_object_set_property):
3380         (webkit_dom_test_global_object_get_property):
3381         (webkit_dom_test_global_object_class_init):
3382         (webkit_dom_test_global_object_get_public_and_private_attribute):
3383         (webkit_dom_test_global_object_set_public_and_private_attribute):
3384         * bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.h:
3385         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3386         (WebCore::JSTestGlobalObject::finishCreation):
3387         (WebCore::jsTestGlobalObjectPublicAndPrivateAttribute):
3388         (WebCore::setJSTestGlobalObjectPublicAndPrivateAttribute):
3389         * bindings/scripts/test/ObjC/DOMTestGlobalObject.h:
3390         * bindings/scripts/test/ObjC/DOMTestGlobalObject.mm:
3391         (-[DOMTestGlobalObject publicAndPrivateAttribute]):
3392         (-[DOMTestGlobalObject setPublicAndPrivateAttribute:]):
3393         * bindings/scripts/test/TestGlobalObject.idl:
3394
3395
3396 2016-06-27  Jer Noble  <jer.noble@apple.com>
3397
3398         REGRESSION?(r202466): http/tests/security/canvas-remote-read-remote-video-redirect.html failing on Sierra
3399         https://bugs.webkit.org/show_bug.cgi?id=159172
3400         <rdar://problem/27030025>
3401
3402         Reviewed by Brent Fulgham.
3403
3404         Add a hasSingleSecurityOrigin property to WebCoreNSURLSession that gets updated each time one of that
3405         sessions' tasks receieves a response or a redirect request. Check that property from the MediaPlayerPrivate.
3406
3407         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3408         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin):
3409         * platform/network/cocoa/WebCoreNSURLSession.h:
3410         * platform/network/cocoa/WebCoreNSURLSession.mm:
3411         (-[WebCoreNSURLSession updateHasSingleSecurityOrigin:]):
3412         (-[WebCoreNSURLSession dataTaskWithRequest:]):
3413         (-[WebCoreNSURLSession dataTaskWithURL:]):
3414         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
3415         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]):
3416
3417 2016-06-27  Alex Christensen  <achristensen@webkit.org>
3418
3419         CMake build fix.
3420
3421         * PlatformMac.cmake:
3422
3423 2016-06-27  Youenn Fablet  <youenn@apple.com>
3424
3425         Remove didFailAccessControlCheck ThreadableLoaderClient callback
3426         https://bugs.webkit.org/show_bug.cgi?id=159149
3427
3428         Reviewed by Daniel Bates.
3429
3430         Adding an AccessControl ResourceError type.
3431         Replacing didFailAccessControlCheck callback by a direct call to didFail with an error of type AccessControl.
3432
3433         Making CrossOriginPreflightChecker always return an AccessControl error. Previously some errors created below
3434         were passed directly to threadable loader clients.
3435
3436         When doing preflight on unauthorized web sites, WTR/DRT will trigger a cancellation error which was translating into an abort event in XMLHttpRequest.
3437         This patch is changing the error type to AccessControl, which translates into an error event in XMLHttpReauest.
3438
3439         This change of behavior is seen in imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred.htm.
3440         No other observable change of behavior should be expected.
3441
3442         * inspector/InspectorNetworkAgent.cpp: Computing error message in didFail according the error type.
3443         * loader/CrossOriginPreflightChecker.cpp:
3444         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse): Setting preflightFailure error type to AccessControl.
3445         (WebCore::CrossOriginPreflightChecker::notifyFinished): Ditto.
3446         (WebCore::CrossOriginPreflightChecker::doPreflight): Ditto.
3447         * loader/DocumentThreadableLoader.cpp:
3448         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest): Replacing didFailAccessControlCheck
3449         callback by a direct call to didFail with an error of type AccessControl.
3450         (WebCore::reportContentSecurityPolicyError): Ditto.
3451         (WebCore::reportCrossOriginResourceSharingError): Ditto.
3452         (WebCore::DocumentThreadableLoader::didReceiveResponse): Ditto.
3453         (WebCore::DocumentThreadableLoader::preflightFailure): Calling didFail directly.
3454         * loader/ThreadableLoaderClient.h: Removing didFailAccessControlCheck.
3455         * loader/ThreadableLoaderClientWrapper.h: Ditto.
3456         * loader/WorkerThreadableLoader.cpp: Ditto.
3457         * loader/WorkerThreadableLoader.h: Ditto.
3458         * page/EventSource.cpp:
3459         (WebCore::EventSource::didFail): Removing didFailAccessControlCheck and putting handling code in didFail.
3460         * page/EventSource.h:
3461         * platform/network/ResourceErrorBase.cpp:
3462         (WebCore::ResourceErrorBase::setType): Softening the assertion to cover the case of migration to AccessControl.
3463         * platform/network/ResourceErrorBase.h: Adding AccessControl error type.
3464         (WebCore::ResourceErrorBase::isAccessControl):
3465
3466 2016-06-27  Chris Dumez  <cdumez@apple.com>
3467
3468         HTMLElement / SVGElement should implement GlobalEventHandlers, not Element
3469         https://bugs.webkit.org/show_bug.cgi?id=159191
3470         <rdar://problem/27019299>
3471
3472         Reviewed by Ryosuke Niwa.
3473
3474         HTMLElement / SVGElement should implement GlobalEventHandlers, not Element:
3475         - https://html.spec.whatwg.org/multipage/dom.html#htmlelement
3476         - https://www.w3.org/TR/SVG2/types.html#InterfaceSVGElement
3477
3478         Firefox and Chrome behave as per the specification.
3479
3480         Fixing this also fixes rendering on http://survey123.arcgis.com/.
3481
3482         No new tests, covered by existing tests that were rebaselined.
3483
3484         * dom/Element.idl:
3485         * html/HTMLElement.idl:
3486         * svg/SVGElement.idl:
3487
3488 2016-06-27  Myles C. Maxfield  <mmaxfield@apple.com>
3489
3490         [macOS] Test gardening: Generic font families should not map to fonts which aren't installed
3491         https://bugs.webkit.org/show_bug.cgi?id=159111
3492         <rdar://problem/25807529>
3493
3494         Unreviewed.
3495
3496         Osaka-Mono does not come preinstalled on macOS Sierra. However, many Japanese users
3497         will have the font installed. Before setting the generic font family, we should check
3498         to see if the font is present.
3499
3500         * page/cocoa/SettingsCocoa.mm:
3501         (WebCore::osakaMonoIsInstalled):
3502         (WebCore::Settings::initializeDefaultFontFamilies):
3503
3504 2016-06-24  Ryosuke Niwa  <rniwa@webkit.org>
3505
3506         Don't keep all newly created potential custom elements alive when the feature is disabled
3507         https://bugs.webkit.org/show_bug.cgi?id=159113
3508
3509         Reviewed by Daniel Bates.
3510
3511         Don't keep all HTML unknown elements which has a valid custom element alive when the feature is turned off.
3512
3513         Ideally we want to conform to the behavior in the Custom Elements specification and only upgrade an element
3514         that is inserted into the document. We'll implement that later.
3515
3516         * dom/Document.cpp:
3517         (WebCore::createHTMLElementWithNameValidation):
3518
3519 2016-06-27  Simon Fraser  <simon.fraser@apple.com>
3520
3521         [iOS] -webkit-overflow-scrolling: touch prevents repaint with RTL
3522         https://bugs.webkit.org/show_bug.cgi?id=159186
3523         rdar://problem/26659341
3524
3525         Reviewed by Zalan Bujtas.
3526         
3527         There were two issues with repaints in -webkit-overflow-scrolling:touch scrolling
3528         layers.
3529
3530         First, if the scrolled contents were inline (e.g. a <span>), then repaints were
3531         broken because RenderInline didn't call shouldApplyClipAndScrollPositionForRepaint().
3532         Fix by making shouldApplyClipAndScrollPositionForRepaint() a member function of RenderBox
3533         and calling it from RenderBox::computeRectForRepaint() and RenderInline::clippedOverflowRectForRepaint().
3534
3535         Second, repaints were broken in RTL because RenderLayerBacking::setContentsNeedDisplayInRect()
3536         confused scroll offset and scroll position; it needs to subtract scrollPosition.
3537         
3538         Finally renamed to applyCachedClipAndScrollOffsetForRepaint() to applyCachedClipAndScrollPositionForRepaint()
3539         to make it clear that it uses scrollPosition, not scrollOffset.
3540
3541         Tests: compositing/scrolling/touch-scrolling-repaint-spans.html
3542                compositing/scrolling/touch-scrolling-repaint.html
3543
3544         * rendering/RenderBox.cpp:
3545         (WebCore::RenderBox::applyCachedClipAndScrollPositionForRepaint):
3546         (WebCore::RenderBox::shouldApplyClipAndScrollPositionForRepaint):
3547         (WebCore::RenderBox::computeRectForRepaint):
3548         (WebCore::RenderBox::applyCachedClipAndScrollOffsetForRepaint): Deleted.
3549         (WebCore::shouldApplyContainersClipAndOffset): Deleted.
3550         * rendering/RenderBox.h:
3551         * rendering/RenderInline.cpp:
3552         (WebCore::RenderInline::clippedOverflowRectForRepaint):
3553         (WebCore::RenderInline::computeRectForRepaint):
3554         * rendering/RenderLayerBacking.cpp:
3555         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
3556         * rendering/RenderObject.cpp:
3557         (WebCore::RenderObject::computeRectForRepaint):
3558
3559 2016-06-27  Commit Queue  <commit-queue@webkit.org>
3560
3561         Unreviewed, rolling out r202436.
3562         https://bugs.webkit.org/show_bug.cgi?id=159190
3563
3564         We don't need to make this change. (Requested by thorton on
3565         #webkit).
3566
3567         Reverted changeset:
3568
3569         "Do not use iOS specific telephone detection on macOS."
3570         https://bugs.webkit.org/show_bug.cgi?id=159096
3571         http://trac.webkit.org/changeset/202436
3572
3573 2016-06-27  Benjamin Poulain  <benjamin@webkit.org>
3574
3575         Adopt the iOS TouchEventHandler API for cases that must have synchronous dispatch
3576         https://bugs.webkit.org/show_bug.cgi?id=159179
3577         rdar://problem/27006387
3578
3579         Reviewed by Simon Fraser.
3580
3581         Tests: fast/events/touch/ios/block-without-overflow-scroll-and-passive-observer-on-block-scrolling-state.html
3582                fast/events/touch/ios/block-without-overflow-scroll-and-passive-observer-on-document-scrolling-state.html
3583                fast/events/touch/ios/block-without-overflow-scroll-scrolling-state.html
3584                fast/events/touch/ios/drag-block-without-overflow-scroll-and-passive-observer-on-block.html
3585                fast/events/touch/ios/drag-block-without-overflow-scroll-and-passive-observer-on-document.html
3586                fast/events/touch/ios/drag-block-without-overflow-scroll.html
3587
3588         * dom/Document.cpp:
3589         (WebCore::Document::prepareForDestruction):
3590         (WebCore::Document::removeAllEventListeners):
3591         * dom/Node.cpp:
3592         (WebCore::Node::willBeDeletedFrom):
3593         (WebCore::tryAddEventListener):
3594         (WebCore::tryRemoveEventListener):
3595         * html/shadow/SliderThumbElement.cpp:
3596         (WebCore::SliderThumbElement::registerForTouchEvents):
3597         (WebCore::SliderThumbElement::unregisterForTouchEvents):
3598         * rendering/RenderLayer.cpp:
3599         (WebCore::RenderLayer::registerAsTouchEventListenerForScrolling):
3600         (WebCore::RenderLayer::unregisterAsTouchEventListenerForScrolling):
3601
3602 2016-06-27  Alex Christensen  <achristensen@webkit.org>
3603
3604         Fix Windows build.
3605
3606         * bindings/js/SerializedScriptValue.h:
3607         WTF
3608
3609 2016-06-27  Commit Queue  <commit-queue@webkit.org>
3610
3611         Unreviewed, rolling out r202520.
3612         https://bugs.webkit.org/show_bug.cgi?id=159185
3613
3614         This change broke the 32-bit El Capitan build (Requested by
3615         ryanhaddad on #webkit).
3616
3617         Reverted changeset:
3618
3619         "REGRESSION?(r202466): http/tests/security/canvas-remote-read-
3620         remote-video-redirect.html failing on Sierra"
3621         https://bugs.webkit.org/show_bug.cgi?id=159172
3622         http://trac.webkit.org/changeset/202520
3623
3624 2016-06-27  Jer Noble  <jer.noble@apple.com>
3625
3626         REGRESSION?(r202466): http/tests/security/canvas-remote-read-remote-video-redirect.html failing on Sierra
3627         https://bugs.webkit.org/show_bug.cgi?id=159172
3628         <rdar://problem/27030025>
3629
3630         Reviewed by Brent Fulgham.
3631
3632         Add a hasSingleSecurityOrigin property to WebCoreNSURLSession that gets updated each time one of that
3633         sessions' tasks receieves a response or a redirect request. Check that property from the MediaPlayerPrivate.
3634
3635         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3636         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin):
3637         * platform/network/cocoa/WebCoreNSURLSession.h:
3638         * platform/network/cocoa/WebCoreNSURLSession.mm:
3639         (-[WebCoreNSURLSession updateHasSingleSecurityOrigin:]):
3640         (-[WebCoreNSURLSession dataTaskWithRequest:]):
3641         (-[WebCoreNSURLSession dataTaskWithURL:]):
3642         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
3643         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]):
3644
3645 2016-06-27  Benjamin Poulain  <benjamin@webkit.org>
3646
3647         Fix style invalidation for :active when the activated node has no renderer
3648         https://bugs.webkit.org/show_bug.cgi?id=159125
3649
3650         Reviewed by Antti Koivisto.
3651
3652         Same old bug: a style invalidation path was depending
3653         on the style.
3654
3655         Here we really need both flags. An element can have
3656         childrenAffectedByActive() false and renderStyle->affectedByActive() true
3657         if it was subject to style sharing.
3658
3659         The element state "childrenAffectedByActive" should be renamed
3660         "styleAffectedByActive" since it is not a parent invalidation flag.
3661         That will be done separately.
3662
3663         Tests: fast/css/pseudo-active-on-labeled-control-without-renderer.html
3664                fast/css/pseudo-active-style-sharing-1.html
3665                fast/css/pseudo-active-style-sharing-2.html
3666                fast/css/pseudo-active-style-sharing-3.html
3667                fast/css/pseudo-active-style-sharing-4.html
3668                fast/css/pseudo-active-style-sharing-5.html
3669                fast/css/pseudo-active-style-sharing-6.html
3670
3671         * dom/Element.cpp:
3672         (WebCore::Element::setActive):
3673         * style/StyleRelations.cpp:
3674         (WebCore::Style::commitRelationsToRenderStyle):
3675
3676 2016-06-27  Joanmarie Diggs  <jdiggs@igalia.com>
3677
3678         AX: REGRESSION (r202063): ARIA role attribute is being ignored for label element
3679         https://bugs.webkit.org/show_bug.cgi?id=159162
3680
3681         Reviewed by Chris Fleizach.
3682
3683         createFromRenderer() was creating an AccessibilityLabel for any HTMLLabelElement which
3684         lacked an explicitly-handled ARIA role. We should instead create an AccessibilityLabel
3685         when there is no ARIA role.
3686
3687         Test: accessibility/aria-role-on-label.html
3688
3689         * accessibility/AXObjectCache.cpp:
3690         (WebCore::createFromRenderer):
3691
3692 2016-06-27  Commit Queue  <commit-queue@webkit.org>
3693
3694         Unreviewed, rolling out r202505.
3695         https://bugs.webkit.org/show_bug.cgi?id=159169
3696
3697         The test added with this change is flaky and it caused an
3698         existing test to time out on El Capitan. (Requested by
3699         ryanhaddad on #webkit).
3700
3701         Reverted changeset:
3702
3703         "[iOS] Media controls are too cramped with small video"
3704         https://bugs.webkit.org/show_bug.cgi?id=158815
3705         http://trac.webkit.org/changeset/202505
3706
3707 2016-06-27  Benjamin Poulain  <bpoulain@apple.com>
3708
3709         Add :focus-within to the status page
3710
3711         * features.json:
3712         I forgot to update the json file when landing the feature.
3713
3714 2016-06-27  Eric Carlson  <eric.carlson@apple.com>
3715
3716         [Mac] PiP placeholder should remain visible when 'controls' attribute is removed
3717         https://bugs.webkit.org/show_bug.cgi?id=159158
3718         <rdar://problem/26727435>
3719
3720         Reviewed by Jer Noble.
3721
3722         No new tests, existing test updated.
3723
3724         * Modules/mediacontrols/mediaControlsApple.js:
3725         (Controller.prototype.shouldHaveControls): Always return true when in PiP or AirPlay mode.
3726
3727 2016-06-27  Oliver Hunt  <oliver@apple.com>
3728
3729         Update ATS WebContent exception for more robust framework information
3730         https://bugs.webkit.org/show_bug.cgi?id=159151
3731
3732         Reviewed by Alex Christensen.
3733
3734         We found some unexpected poor interaction with AVFoundation in the existing
3735         CFNetwork SPI. This new SPI is more solid and let's us provide more useful
3736         information while also being more future proof against new frameworks and
3737         ATS modes.
3738
3739         * platform/network/mac/ResourceHandleMac.mm:
3740         (WebCore::ResourceHandle::createNSURLConnection):
3741
3742 2016-06-27  Antoine Quint  <graouts@apple.com>
3743
3744         [iOS] Media controls are too cramped with small video
3745         https://bugs.webkit.org/show_bug.cgi?id=158815
3746         <rdar://problem/26824238>
3747
3748         Reviewed by Dean Jackson.
3749
3750         In updateLayoutForDisplayedWidth(), we try to ensure a minimum width is guaranteed
3751         for the progress indicator. However, we were not accounting for the width used by
3752         the current and remaining time labels on either side of it, so we would incorrectly
3753         conclude that we were guaranteeing the minimum time and yield incorrect layouts since
3754         we were trying to fit more buttons than we had room for.
3755
3756         In order to correctly compute the available width for the progress indicator, we now
3757         have clones of the current and remaining time labels, hidden from video and VoiceOver,
3758         that we update along with the originals. The same styles apply to both clones and
3759         originals, so we may measure the clones to determine the space used by the time labels.
3760         The reason we need to use clones is that if the time labels had previously been hidden
3761         from view, precisely because there was not enough space to display them along with the
3762         progress indicator, then trying to obtain metrics from them would yield 0 since they had
3763         "display: none" styles applied. In order to avoid extra layouts and possible flashing, we
3764         use the clones so that we never have to toggle the "display" property of the originals
3765         just to obtain their measurements.
3766
3767         As a result of this change, we adjust the constant used to set the minimum required
3768         width available to display the progress indicator after all other essential controls
3769         and labels have been measured. That constant used to account for the width of the
3770         time labels, and this is no longer correct.
3771
3772         Test: media/video-controls-drop-and-restore-timeline.html
3773
3774         * Modules/mediacontrols/mediaControlsApple.css:
3775         (::-webkit-media-controls-time-remaining-display.clone):
3776         * Modules/mediacontrols/mediaControlsApple.js:
3777         (Controller):
3778         (Controller.prototype.createTimeClones):
3779         (Controller.prototype.removeTimeClass):
3780         (Controller.prototype.addTimeClass):
3781         (Controller.prototype.updateDuration):
3782         (Controller.prototype.updateLayoutForDisplayedWidth):
3783         (Controller.prototype.updateTime):
3784         (Controller.prototype.updateControlsWhileScrubbing):
3785         * Modules/mediacontrols/mediaControlsiOS.css:
3786         (::-webkit-media-controls-time-remaining-display.clone):
3787         * Modules/mediacontrols/mediaControlsiOS.js:
3788
3789 2016-06-27  Anders Carlsson  <andersca@apple.com>
3790
3791         No error message when passing an invalid API version to ApplePaySession constructor
3792         https://bugs.webkit.org/show_bug.cgi?id=159154
3793
3794         Reviewed by Tim Horton.
3795
3796         Log an error message if the version is not supported. Also, check for version 0 since that is also not supported.
3797
3798         * Modules/applepay/ApplePaySession.cpp:
3799         (WebCore::ApplePaySession::create):
3800
3801 2016-06-27  Joanmarie Diggs  <jdiggs@igalia.com>
3802
3803         AX: Anonymous RenderMathMLOperators are not exposed to the accessibility tree
3804         https://bugs.webkit.org/show_bug.cgi?id=139582
3805         <rdar://problem/26938849>
3806
3807         Reviewed by Chris Fleizach.
3808
3809         This is based on a patch by Frederic Wang <fwang@igalia.com>.
3810
3811         WebCore assigns the generic MathElementRole AccessibilityRole to elements
3812         which are expected to be included in the accessibility tree. This assignment
3813         is based on the AccessibilityRenderObject's node being a MathMLElement. The
3814         anonymous RenderMathMLOperators fail that test.
3815
3816         From the perspective of accessibility support, these operators function
3817         like MathMLElements. Furthermore, both WebCore and the platforms rely
3818         upon MathElementRole to identify accessible MathML objects. The simplest
3819         fix is to have AccessibilityRenderObject::isMathElement() treat anonymous
3820         MathML operators as if they were MathMLElements.
3821
3822         Now that these operators are being exposed, we need to handle them in
3823         AccessibilityRenderObject::textUnderElement() which assumes that anonymous
3824         objects either have nodes or have children with nodes. And crashes when
3825         that fails to be the case. Making RenderMathMLOperator::textContent()
3826         public and then using it to get the text under anonymous operators solves
3827         this problem. We also assign StaticTextRole to these operators on the Mac
3828         because the default platform mapping of MathElementRole is GroupRole, which
3829         made sense when we had a child RenderText object holding the operator.
3830
3831         Lastly, AccessibilityRenderObject::isIgnoredElementWithinMathTree() no
3832         longer needs to special-case anonymous operators because they now have
3833         MathElementRole.
3834
3835         Tests: accessibility/math-fenced.html
3836                accessibility/math-foreign-content.html
3837
3838         * accessibility/AccessibilityObject.h:
3839         (WebCore::AccessibilityObject::isAnonymousMathOperator):
3840         * accessibility/AccessibilityRenderObject.cpp:
3841         (WebCore::AccessibilityRenderObject::textUnderElement):
3842         (WebCore::AccessibilityRenderObject::stringValue):
3843         (WebCore::AccessibilityRenderObject::isMathElement):
3844         (WebCore::AccessibilityRenderObject::isAnonymousMathOperator):
3845         (WebCore::AccessibilityRenderObject::isIgnoredElementWithinMathTree):
3846         * accessibility/AccessibilityRenderObject.h:
3847         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3848         (-[WebAccessibilityObjectWrapper role]):
3849         * rendering/mathml/RenderMathMLMath.h:
3850         * rendering/mathml/RenderMathMLOperator.h:
3851         (WebCore::RenderMathMLOperator::textContent):
3852
3853 2016-06-27  Adam Bergkvist  <adam.bergkvist@ericsson.com>
3854
3855         WebRTC: Remove unused RTCOfferAnswerOptionsPrivate.h
3856         https://bugs.webkit.org/show_bug.cgi?id=159130
3857
3858         Reviewed by Eric Carlson.
3859
3860         Remove unused RTCOfferAnswerOptionsPrivate.h file.
3861
3862         * platform/mediastream/RTCOfferAnswerOptionsPrivate.h: Removed.
3863
3864 2016-06-27  Jer Noble  <jer.noble@apple.com>
3865
3866         Crash in layout test /media/video-buffered-range-contains-currentTime.html
3867         https://bugs.webkit.org/show_bug.cgi?id=159109
3868         <rdar://problem/26535750>
3869
3870         Reviewed by Alex Christensen.
3871
3872         Guard against a dealloc race condition by holding a retain on the session
3873         until the task's _resource:loadFinishedWithError: completes, including
3874         main thread callbacks.
3875         
3876         * platform/network/cocoa/WebCoreNSURLSession.mm:
3877         (-[WebCoreNSURLSessionDataTask _resource:loadFinishedWithError:]):
3878
3879 2016-06-27  Frederic Wang  <fwang@igalia.com>
3880
3881         Set an upper limit for the size or number of pieces of stretchy operators
3882         https://bugs.webkit.org/show_bug.cgi?id=155434
3883
3884         Reviewed by Brent Fulgham.
3885
3886         Stretchy MathML operators can currently use an arbitrary number of extension glyphs to cover
3887         a target size. This may result in hangs if large stretch sizes are requested. This change
3888         only allow at most the 128 first extensions to be painted by the MathOperator class, which
3889         should really be enough for mathematical formulas used in practice.
3890
3891         No new tests, already tested by very-large-stretchy-operators.
3892
3893         * rendering/mathml/MathOperator.cpp: Add a new kMaximumExtensionCount constant.
3894         (WebCore::MathOperator::fillWithVerticalExtensionGlyph): Limit the number of step in this loop to kMaximumExtensionCount.
3895         (WebCore::MathOperator::fillWithHorizontalExtensionGlyph): Ditto.
3896
3897 2016-06-27  Frederic Wang  <fred.wang@free.fr>
3898
3899         Small refactoring MathMLInlineContainerElement::createElementRenderer
3900         https://bugs.webkit.org/show_bug.cgi?id=159131
3901
3902         Reviewed by Brent Fulgham.
3903
3904         Many of the MathML renderer classes have been merged during the MathML refactoring. We
3905         simplify how instances are created in MathMLInlineContainerElement::createElementRenderer
3906         by removing duplicate createRenderer calls.
3907
3908         No new tests, behavior unchanged.
3909
3910         * mathml/MathMLInlineContainerElement.cpp:
3911         (WebCore::MathMLInlineContainerElement::createElementRenderer):
3912
3913 2016-06-27  Miguel Gomez  <magomez@igalia.com>
3914
3915         [GTK][EFL] Build with threaded compositor enabled is broken
3916         https://bugs.webkit.org/show_bug.cgi?id=159138
3917
3918         Reviewed by Carlos Garcia Campos.
3919
3920         No need to set the device scale. The compositor buffer is only used for the accelerated
3921         canvas scenario, and the device scale is always 1 there.
3922         This change was introduced in r202421.
3923
3924         Covered by existing tests.
3925
3926         * platform/graphics/cairo/ImageBufferCairo.cpp:
3927         (WebCore::ImageBufferData::createCompositorBuffer):
3928
3929 2016-06-27  Philippe Normand  <philn@igalia.com>
3930
3931         [GStreamer] top/bottom black bars added needlessly in fullscreen
3932         https://bugs.webkit.org/show_bug.cgi?id=158980
3933
3934         Reviewed by Carlos Garcia Campos.
3935
3936         The natural video size calculation depends on the validity of the
3937         current sample, so whenever the first sample reached the sink it's a
3938         good idea to reflect this on the player which will update its natural
3939         size accordingly.
3940
3941         Fixes an issue where black borders were added on top and bottom of
3942         fullscreen video.
3943
3944         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3945         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
3946
3947 2016-06-27  Youenn Fablet  <youenn@apple.com>
3948
3949         Remove didFailRedirectCheck ThreadableLoaderClient callback
3950         https://bugs.webkit.org/show_bug.cgi?id=159085
3951
3952         Reviewed by Daniel Bates.
3953
3954         Removing didFailRedirectCheck and using didFailAccessControlCheck instead.
3955         The change in behavior is that additional error messages are outputted in the console.
3956         These messages give additional debugging information.
3957
3958         Covered by rebased tests.
3959
3960         * Modules/fetch/FetchLoader.cpp: Removing didFailRedirectCheck.
3961         * Modules/fetch/FetchLoader.h: Ditto.
3962         * inspector/InspectorNetworkAgent.cpp: Ditto.
3963         * loader/DocumentThreadableLoader.cpp:
3964         (WebCore::DocumentThreadableLoader::redirectReceived): Calling didFailAccessControlCheck with information on failing
3965         URL.
3966         (WebCore::DocumentThreadableLoader::loadRequest): Ditto.
3967         * loader/ThreadableLoaderClient.h: Removing didFailRedirectCheck.
3968         * loader/ThreadableLoaderClientWrapper.h: Ditto.
3969         * loader/WorkerThreadableLoader.cpp: Ditto.
3970         * loader/WorkerThreadableLoader.h: Ditto.
3971         * page/EventSource.cpp: Ditto.
3972         * page/EventSource.h: Ditto.
3973         * workers/WorkerScriptLoader.cpp: Ditto.
3974         * workers/WorkerScriptLoader.h: Ditto.
3975         * xml/XMLHttpRequest.cpp: Ditto.
3976         * xml/XMLHttpRequest.h: Ditto.
3977
3978 2016-06-26  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3979
3980         [EFL] Fix build warning when using geoclue2
3981         https://bugs.webkit.org/show_bug.cgi?id=159128
3982
3983         Reviewed by Antonio Gomes.
3984
3985         EFL port has handled build warning as error. So EFL port
3986         hasn't been built when we use geoclue2 library because a generated geoclue2 file
3987         has unused-parameter build warning. To fix it this patch set to ignore the build warning
3988         in the generated geoclue2 file.
3989
3990         * PlatformEfl.cmake:
3991
3992 2016-06-26  Chris Dumez  <cdumez@apple.com>
3993
3994         Regression: HTMLOptionsCollection's named properties have precedence over indexed properties
3995         https://bugs.webkit.org/show_bug.cgi?id=159058
3996         <rdar://problem/26988542>
3997
3998         Reviewed by Ryosuke Niwa.
3999
4000         HTMLOptionsCollection's named properties had precedence over indexed properties,
4001         which is wrong as per:
4002         http://heycam.github.io/webidl/#getownproperty-guts
4003
4004         The reason is that there was a named property getter defined on HTMLOptionsCollection
4005         but no indexed property getter. As a result, HTMLOptionsCollection would fall back to
4006         using HTMLCollection's indexed property getter but HTMLOptionsCollection's named getter
4007         would take precedence. This patch defines an indexed property getter on
4008         HTMLOptionsCollection to fix the problem.
4009
4010         Ideally, HTMLOptionsCollection would have no indexed / named property getters and would
4011         entirely rely on the ones from HTMLCollection. However, our bindings generator currently
4012         has trouble with this and requires HTMLOptionsCollection to have a named getter.
4013
4014         Test: fast/dom/HTMLSelectElement/options-indexed-getter-precedence.html
4015
4016         * html/HTMLOptionsCollection.idl:
4017
4018 2016-06-26  Chris Dumez  <cdumez@apple.com>
4019
4020         Regression(r202262): Infinite loop under searchForLinkRemovingExistingDDLinks()
4021         https://bugs.webkit.org/show_bug.cgi?id=159122
4022         <rdar://problem/27014649>
4023
4024         Reviewed by Ryosuke Niwa.
4025
4026         Infinite loop under searchForLinkRemovingExistingDDLinks() because the