Extremely large canvas crashes on pre-El Capitan machines
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-06-19  Dean Jackson  <dino@apple.com>
2
3         Extremely large canvas crashes on pre-El Capitan machines
4         https://bugs.webkit.org/show_bug.cgi?id=146169
5         <rdar://problem/21410046>
6
7         Reviewed by Tim Horton.
8
9         On machines before El Capitan, make the maximum canvas size
10         8k by 8k.
11
12         Covered by existing tests.
13
14         * html/HTMLCanvasElement.cpp:
15
16 2015-06-19  Tim Horton  <timothy_horton@apple.com>
17
18         Selection services cannot be invoked when force click is enabled
19         https://bugs.webkit.org/show_bug.cgi?id=146166
20         <rdar://problem/21468362>
21
22         Reviewed by Darin Adler.
23
24         * page/mac/ServicesOverlayController.h:
25         Turn Highlight::Type into something we can use for dirty flags.
26
27         * page/mac/ServicesOverlayController.mm:
28         (WebCore::ServicesOverlayController::Highlight::createForSelection):
29         (WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber):
30         (WebCore::ServicesOverlayController::ServicesOverlayController):
31         (WebCore::ServicesOverlayController::selectionRectsDidChange):
32         (WebCore::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
33         (WebCore::ServicesOverlayController::invalidateHighlightsOfType):
34         (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded):
35         (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
36         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
37         (WebCore::ServicesOverlayController::buildSelectionHighlight):
38         (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
39         (WebCore::ServicesOverlayController::determineActiveHighlight):
40         (WebCore::ServicesOverlayController::didScrollFrame):
41         (WebCore::ServicesOverlayController::handleClick):
42         Coalesce highlight rebuilding so that things (like TextIndicator creation)
43         that change the selection and then reset it immediately don't cause us
44         to lose the active highlight.
45
46         This also means that if the selection changes multiple times in a runloop
47         (easily possible from script), we won't waste a lot of time rebuilding highlights.
48
49         (WebCore::ServicesOverlayController::didRebuildPotentialHighlights):
50         Merged into buildPotentialHighlightsIfNeeded.
51
52 2015-06-19  Matt Baker  <mattbaker@apple.com>
53
54         Web Inspector: TimelineAgent needs to handle nested runloops
55         https://bugs.webkit.org/show_bug.cgi?id=145090
56
57         Reviewed by Joseph Pecoraro.
58
59         Previously nested run loops caused InspectorTimelineAgent to prematurely pop the current run loop record. This
60         patch adds a counter to track the run loop nesting level, and rendering frame records are only pushed/popped
61         when the nesting level is zero. Run loop entry/exit notifications received while the debugger is paused do not
62         affect the nesting level.
63
64         * inspector/InspectorTimelineAgent.cpp:
65         (WebCore::InspectorTimelineAgent::internalStart):
66         (WebCore::InspectorTimelineAgent::internalStop):
67         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
68         * inspector/InspectorTimelineAgent.h:
69
70 2015-06-19  Brent Fulgham  <bfulgham@apple.com>
71
72         Follow-up fix to r185766.
73         https://bugs.webkit.org/show_bug.cgi?id=22132
74
75         Reviewed by Zalan Bujtas.
76
77         Suggested by Darin Adler in the bug.
78
79         * platform/graphics/filters/FETile.cpp:
80         (WebCore::FETile::platformApplySoftware): Use WTF::move when passing
81         the new tileImageCopy RefPtr.
82
83 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
84
85         [SOUP] Fix return-type-c-linkage warning after r185553
86         https://bugs.webkit.org/show_bug.cgi?id=146014
87
88         Reviewed by Martin Robinson.
89
90         * platform/network/soup/WebKitSoupRequestGeneric.cpp:
91         (webkitSoupRequestGenericGetRequest): Return a pointer rather than a reference.
92         * platform/network/soup/WebKitSoupRequestGeneric.h: webkitSoupRequestGenericGetRequest now
93         returns a pointer rather than a reference.
94
95 2015-06-19  Dean Jackson  <dino@apple.com>
96
97         Played <audio> looks invisible against the gray background
98         https://bugs.webkit.org/show_bug.cgi?id=146164
99         <rdar://problem/21014284>
100
101         Reviewed by Brent Fulgham.
102
103         The plus-darker blend mode was not allowing any white to
104         show through in the rendering. We don't need this for
105         audio controls, where we draw on an opaque grey background.
106
107         * Modules/mediacontrols/mediaControlsiOS.css:
108         (audio::-webkit-media-controls-panel): Darken the color of the controls a
109         little to make white stand out more.
110         (audio::-webkit-media-controls-timeline): Remove the plus-darker blending.
111         (video::-webkit-media-controls-timeline): Apply blending only to video.
112
113 2015-06-19  Andy Estes  <aestes@apple.com>
114
115         Various assertion failures occur when executing script in the midst of DOM insertion
116         https://bugs.webkit.org/show_bug.cgi?id=132482
117
118         Reviewed by Darin Adler.
119
120         Prior to this change, when an element containing a <script> child was inserted into a document, the script was
121         executed in ScriptElement::insertedInto(). That script can access nodes that follow it in the newly-inserted
122         hierarchy but are not yet fully inserted, leading to at least the following problems:
123
124             - The script could remove a node that is not yet marked as in the document.
125             - The script could remove a named <map> that has yet to be added to TreeScope::m_imageMapsByName.
126             - The script could remove a form control that has yet to be added to FormController::m_formElementsWithState.
127
128         These scenarios all result in assertion failures. This change ensures that each node in the newly-inserted
129         hierarchy is fully inserted before executing any scripts.
130
131         Tests: fast/dom/element-removed-while-inserting-parent-crash.html
132                fast/dom/named-map-removed-while-inserting-parent-crash.html
133                fast/forms/form-control-removed-while-inserting-parent-crash.html
134                svg/dom/element-removed-while-inserting-parent-crash.html
135
136         * dom/ScriptElement.cpp:
137         (WebCore::ScriptElement::shouldNotifySubtreeInsertions): Renamed from insertedInto().
138         Returned true in the case where insertedInto() would've called prepareScript().
139         (WebCore::ScriptElement::didNotifySubtreeInsertions): Called prepareScript().
140         (WebCore::ScriptElement::insertedInto): Renamed to shouldNotifySubtreeInsertions().
141         * dom/ScriptElement.h:
142         * html/HTMLScriptElement.cpp:
143         (WebCore::HTMLScriptElement::insertedInto): If shouldNotifySubtreeInsertions() is true, returned InsertionShouldCallDidNotifySubtreeInsertions.
144         Otherwise, returned InsertionDone.
145         (WebCore::HTMLScriptElement::didNotifySubtreeInsertions): Called ScriptElement::didNotifySubtreeInsertions().
146         * html/HTMLScriptElement.h:
147         * svg/SVGScriptElement.cpp:
148         (WebCore::SVGScriptElement::insertedInto): Did the same as HTMLScriptElement::insertedInto().
149         (WebCore::SVGScriptElement::didNotifySubtreeInsertions): Called ScriptElement::didNotifySubtreeInsertions().
150         * svg/SVGScriptElement.h:
151
152 2015-06-19  Brent Fulgham  <bfulgham@apple.com>
153
154         All calls of ImageBuffer::create should null check the return value
155         https://bugs.webkit.org/show_bug.cgi?id=22132
156
157         Reviewed by Zalan Bujtas.
158
159         ImageBuffer::create returns nullptr for a number of reasons, and should be
160         expected to do so. We missed this check in a few places, resulting in
161         crashes on some systems. Likewise, ImageBuffer::copyImage may return nullptr
162         in normal use and should be checked.
163
164         * platform/graphics/BitmapImage.cpp:
165         (WebCore::BitmapImage::drawPattern): Add nullptr check for create and copyImage. Remove
166         extra call to 'setImageObserver'.
167         * platform/graphics/cairo/ImageBufferCairo.cpp:
168         (WebCore::ImageBuffer::drawPattern): Add nullptr check for copyImage.
169         * platform/graphics/cg/ImageBufferCG.cpp:
170         (WebCore::ImageBuffer::drawPattern): Add nullptr checks for copyImage.
171         * platform/graphics/filters/FETile.cpp:
172         (WebCore::FETile::platformApplySoftware): Add nullptr check for copyImage.
173         * platform/graphics/filters/FilterEffect.cpp:
174         (WebCore::FilterEffect::asImageBuffer): Add nullptr check for create.
175         (WebCore::FilterEffect::openCLImageToImageBuffer): Ditto.
176         * platform/graphics/texmap/BitmapTexture.cpp:
177         (WebCore::BitmapTexture::updateContents): Add nullptr checks for create and copyImage.
178         * svg/graphics/SVGImage.cpp:
179         (WebCore::SVGImage::drawPatternForContainer): Add nullptr check for copyImage.
180
181 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
182
183         Get CAContext directly for CALayer instead of walking the layer tree.
184         https://bugs.webkit.org/show_bug.cgi?id=146138
185         <rdar://problem/21455974>
186
187         Reviewed by Darin Adler.
188
189         This will get the context directly from the CALayer instead of getting all CAContexts, walking the layer tree 
190         to the root and comparing that against each CAContext's root layer.
191
192         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
193         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
194
195 2015-06-18  Brent Fulgham  <bfulgham@apple.com>
196
197         [iOS] scrollIntoViewIfNeeded is not working with scroll-snap points
198         https://bugs.webkit.org/show_bug.cgi?id=145318
199         <rdar://problem/21081501>
200
201         Reviewed by Simon Fraser.
202
203         Use the ScrollController in iOS to track the scroll snap point state.
204         We do not need the animation implementation or timers since the actual
205         animation is handled by UIKit.
206
207         This change lets us communicate the current offset into the scroll snap
208         offset vector between the WebProcess and RemoteScrollingTree so that
209         both sides stay in sync regardless of whether user gestures or style
210         updates have caused us to shift to a different snap point.
211
212         * page/scrolling/AsyncScrollingCoordinator.cpp:
213         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Set the
214         current horizontal and vertical scroll snap offset indices.
215         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Ditto.
216         * page/scrolling/AsyncScrollingCoordinator.h: Mark the setActiveScrollSnapIndices
217         for export so that it can be reached by the UIProcess.
218         * page/scrolling/ScrollingCoordinator.h: Keep track of horizontal and
219         vertical scroll snap offset indices.
220         * page/scrolling/ScrollingStateScrollingNode.cpp:
221         (WebCore::ScrollingStateScrollingNode::setCurrentHorizontalSnapPointIndex): Added.
222         (WebCore::ScrollingStateScrollingNode::setCurrentVerticalSnapPointIndex): Added.
223         * page/scrolling/ScrollingStateScrollingNode.h:
224         (WebCore::ScrollingStateScrollingNode::currentHorizontalSnapPointIndex): Added.
225         (WebCore::ScrollingStateScrollingNode::currentVerticalSnapPointIndex): Added.
226         * page/scrolling/ScrollingTree.h:
227         * page/scrolling/ScrollingTreeScrollingNode.cpp:
228         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren): Update the scroll snap
229         point offset indices if either has changed.
230         * page/scrolling/ScrollingTreeScrollingNode.h:
231         (WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex): Added.
232         (WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex): Added.
233         (WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Added.
234         (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Added.
235         * page/scrolling/ThreadedScrollingTree.cpp:
236         (WebCore::ThreadedScrollingTree::currentSnapPointIndicesDidChange): New method
237         to handle notifications about scroll snap index changes from the UIProcess.
238         * page/scrolling/ThreadedScrollingTree.h:
239         * page/scrolling/ios/ScrollingTreeIOS.cpp:
240         (WebCore::ScrollingTreeIOS::currentSnapPointIndicesDidChange): New method
241         to handle notifications about scroll snap index changes from the UIProcess.
242         * page/scrolling/ios/ScrollingTreeIOS.h:
243         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
244         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Update scroll
245         snap point current offset indices if they have changed.
246         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Remove unneeded
247         PLATFORM(MAC) macro.
248         * platform/ScrollAnimator.cpp:
249         (WebCore::ScrollAnimator::ScrollAnimator): We have a ScrollController if we are
250         supporting scroll snap points or rubber banding.
251         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): This method is not needed
252         for iOS builds.
253         (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset): Enable this on iOS.
254         (WebCore::ScrollAnimator::updateScrollSnapState): Renamed from 'updateScrollAnimatorsAndTimers'
255         and enabled on iOS.
256         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Deleted.
257         * platform/ScrollAnimator.h: Enable some scroll snap methods on iOS.
258         * platform/ScrollableArea.cpp:
259         (WebCore::ScrollableArea::handleWheelEvent): Enable scroll snap index bookkeeping on iOS, too.
260         (WebCore::ScrollableArea::updateScrollSnapState): Revise to call 'updateScrollSnapState' instead
261         of 'updateScrollAnimatorsAndTimers'.
262         * platform/cocoa/ScrollController.h: Enable some methods on iOS. Reorder methods to
263         reduce the number of macros needed to do so.
264         * platform/cocoa/ScrollController.mm:
265         (systemUptime): Only build for Mac.
266         (WebCore::ScrollController::ScrollController): Disable rubber band-specific members on iOS.
267         (WebCore::ScrollController::handleWheelEvent): Only build this on Mac.
268         (WebCore::ScrollController::isRubberBandInProgress): Always return 'false' on iOS.
269         (WebCore::ScrollController::startSnapRubberbandTimer): Only build this on Mac.
270         (WebCore::ScrollController::shouldRubberBandInHorizontalDirection): Ditto.
271         (WebCore::ScrollController::scrollSnapPointState): Enable on iOS.
272         (WebCore::ScrollController::hasActiveScrollSnapTimerForAxis): Only build on Mac.
273         (WebCore::ScrollController::updateScrollSnapState): renamed from 'updateScrollAnimatorsAndTimers'
274         (WebCore::ScrollController::startScrollSnapTimer): Only build on Mac.
275         (WebCore::ScrollController::initializeGlideParameters): Ditto.
276         (WebCore::ScrollController::activeScrollSnapIndexForAxis): Enable on iOS.
277         (WebCore::ScrollController::setActiveScrollSnapIndicesForOffset): Ditto.
278         (WebCore::ScrollController::beginScrollSnapAnimation): Only build on Mac.
279         (WebCore::ScrollController::computeGlideDelta): Ditto.
280         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Deleted.
281         * rendering/RenderLayerCompositor.cpp:
282         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Capture any changes in scroll
283         snap offset indices.
284
285 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
286
287         Fullscreen view should not update bounds of video when in PiP.
288         https://bugs.webkit.org/show_bug.cgi?id=146134
289
290         Reviewed by Darin Adler.
291
292         Don't update bounds on video layer when it is not a child.
293
294         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
295         (-[WebAVVideoLayer setBounds:]):
296
297 2015-06-19  Zalan Bujtas  <zalan@apple.com>
298
299         RenderRubyText requires RenderRubyRun parent.
300         https://bugs.webkit.org/show_bug.cgi?id=146148
301         rdar://problem/21423319
302
303         Reviewed by Simon Fraser.
304
305         RenderRubyText expects its parent to be RenderRubyRun and since a
306         a non-block <rt> requires anonymous wrapper, we should check whether
307         the display type is actually block.
308
309         Test: fast/ruby/crash-when-ruby-rt-is-non-block.html
310
311         * html/RubyTextElement.cpp:
312         (WebCore::RubyTextElement::createElementRenderer):
313
314 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
315
316         cancelPreviousPerformRequestsWithTarget for -resolveBounds in wrong class.
317         https://bugs.webkit.org/show_bug.cgi?id=146140
318
319         Reviewed by Eric Carlson.
320
321         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
322         (-[WebCALayerHostWrapper dealloc]): Added.
323         (-[WebAVVideoLayer dealloc]): Deleted.
324
325 2015-06-19  Per Arne Vollan  <peavo@outlook.com>
326
327         [WinCairo] Null pointer crash in BitmapTexture::updateContents.
328         https://bugs.webkit.org/show_bug.cgi?id=146147
329
330         Reviewed by Brent Fulgham.
331
332         Added null pointer check.
333
334         * platform/graphics/texmap/BitmapTexture.cpp:
335         (WebCore::BitmapTexture::updateContents):
336
337 2015-06-19  Anders Carlsson  <andersca@apple.com>
338
339         Spintracer treats the web process as hung when it's showing JavaScript dialogs in the UI process
340         https://bugs.webkit.org/show_bug.cgi?id=146124
341         rdar://problem/21449395
342
343         Reviewed by Geoffrey Garen.
344
345         * platform/spi/cg/CoreGraphicsSPI.h:
346
347 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
348
349         Remove unnecessary svn:executable flags
350         https://bugs.webkit.org/show_bug.cgi?id=146107
351
352         Reviewed by Alexey Proskuryakov.
353
354         * html/canvas/CanvasRenderingContext2D.cpp: Removed property svn:executable.
355         * mathml/MathMLMencloseElement.cpp: Removed property svn:executable.
356         * mathml/MathMLMencloseElement.h: Removed property svn:executable.
357         * platform/efl/RenderThemeEfl.cpp: Removed property svn:executable.
358         * rendering/mathml/RenderMathMLMenclose.cpp: Removed property svn:executable.
359         * rendering/mathml/RenderMathMLMenclose.h: Removed property svn:executable.
360
361 2015-06-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
362
363         Bindings generator should generate code to catch exception and reject promises for Promise-based APIs
364         https://bugs.webkit.org/show_bug.cgi?id=146060
365
366         Reviewed by Darin Adler.
367
368         The binding generator splits the function that binds JS to the DOM class implementation in two for functions returning promise.
369         The first function, called from JS, is responsible of casting this to the expected JSXXX class.
370         If casting fails, an exception is raised. Otherwise, it calls the second function.
371         After calling the second function, it checks whether an exception is raised, in which case it returns a rejected promise.
372         The second function is responsible of argument conversion and calling the DOM class function.
373
374         Covered by expectations and AudioContext promise still working.
375         A test case is added for a promise returning function taking a typed argument as input (if argument value cannot be typed, the promise is rejected).
376         A second test case is a promise-returning function that can raise an exception. In that case the DOMException is used as rejection value.
377
378         As can be seen from generated code, this generalized code adds a mandatory check (is there an exception?) at the end of the function.
379         This check is done even in cases we know there will be no exception.
380         This may be covered by another patch if this optimization is thought useful enough.
381
382         * bindings/js/JSDOMPromise.cpp:
383         (WebCore::rejectPromiseWithExceptionIfAny): Utility method for the binding code.
384         (WebCore::callPromiseFunction): Ditto.
385         * bindings/js/JSDOMPromise.h:
386         * bindings/scripts/CodeGeneratorJS.pm:
387         (GenerateImplementation):
388         (GenerateFunctionCastedThis): Extracted from GenerateImplementationFunctionCall to reuse it in case of promise-returning functions.
389         (GenerateImplementationFunctionCall):
390         (GenerateCallbackImplementation): Deleted.
391         * bindings/scripts/test/JS/JSTestObj.cpp:
392         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
393         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
394         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
395         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
396         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
397         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
398         * bindings/scripts/test/TestObj.idl:
399
400 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
401
402         Disable UIWindow for fullscreen video for selected clients.
403         https://bugs.webkit.org/show_bug.cgi?id=145852
404
405         Reviewed by Simon Fraser.
406
407         Disable UIWindow for fullscreen video doesn't work everywhere (rdar://problem/21315993), so just disable it when creating a UIWindow won't work.
408         Fix some interface hiding and layout problems that showed up in the non UIWindow code path.
409
410         * platform/RuntimeApplicationChecksIOS.h:
411         * platform/RuntimeApplicationChecksIOS.mm: Remove iAD bundle identifier.
412         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
413         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Opt out of UIWindow when hosted in another process. And fix view parenting for non-window case.
414         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Fix for AVKit exit fullscreen complaining about -needsLayout.
415
416         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
417         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
418         (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen):
419         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen):
420         (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen):
421         (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen):
422         These hide and show the view controller where we hide and show the window.
423
424 2015-06-18  Dean Jackson  <dino@apple.com>
425
426         Provide a way for web developers to draw a Theme-specific Wireless Playback icon
427         https://bugs.webkit.org/show_bug.cgi?id=146123
428         <rdar://problem/21119287>
429
430         Reviewed by Simon Fraser.
431
432         Implement a -webkit-named-image() CSS <image> generator that allows a site to
433         request artwork by name and get the platform variant. At the moment
434         we only support "wireless-playback" which returns a generic image everywhere
435         but Cocoa platforms, where we render the AirPlay icon.
436
437         In order to do this I added a ThemeCocoa to share any Theme code between
438         Mac and iOS.
439
440         Test: fast/css/named-icons.html
441
442         * WebCore.xcodeproj/project.pbxproj: Add new files CSSNamedImageValue, NamedImageGeneratedImage and ThemeCocoa.
443
444         * css/CSSImageGeneratorValue.cpp: Handle the new NamedImageClass in the switch statements for downcasting.
445         (WebCore::CSSImageGeneratorValue::image):
446         (WebCore::CSSImageGeneratorValue::isFixedSize):
447         (WebCore::CSSImageGeneratorValue::isPending):
448         (WebCore::CSSImageGeneratorValue::knownToBeOpaque):
449
450         * css/CSSNamedImageValue.cpp: New class. Just holds a name String.
451         (WebCore::CSSNamedImageValue::customCSSText):
452         (WebCore::CSSNamedImageValue::image):
453         (WebCore::CSSNamedImageValue::equals):
454         * css/CSSNamedImageValue.h:
455         (WebCore::CSSNamedImageValue::create):
456         (WebCore::CSSNamedImageValue::isFixedSize):
457         (WebCore::CSSNamedImageValue::isPending):
458         (WebCore::CSSNamedImageValue::CSSNamedImageValue):
459
460         * css/CSSParser.cpp:
461         (WebCore::CSSParser::isGeneratedImageValue): Allow "-webkit-named-image(".
462         (WebCore::CSSParser::parseGeneratedImage): Call parseNamedImage if we hit named-icon.
463         (WebCore::CSSParser::parseNamedImage): Parse the function looking for a CSS ident.
464         * css/CSSParser.h:
465
466         * css/CSSValue.cpp: Handle NamedImageClass in the various switch statements.
467         (WebCore::CSSValue::equals):
468         (WebCore::CSSValue::cssText):
469         (WebCore::CSSValue::destroy):
470         * css/CSSValue.h:
471         (WebCore::CSSValue::isNamedImageValue): Helper to detect the correct CSSValue subclass.
472
473         * platform/Theme.cpp:
474         (WebCore::Theme::drawNamedImage): Draw a generic wireless playback icon.
475         * platform/Theme.h: Add drawNamedImage.
476
477         * platform/cocoa/ThemeCocoa.cpp: New shared base class for ThemeMac and ThemeIOS.
478         (WebCore::fitContextToBox):
479         (WebCore::ThemeCocoa::drawNamedImage): Draw an AirPlay icon for wireless playback.
480         * platform/cocoa/ThemeCocoa.h:
481
482         * platform/graphics/CrossfadeGeneratedImage.h: Drive-by removal of unnecessary forward class definition.
483
484         * platform/graphics/ImageBuffer.h: Add NamedImageGeneratedImage as a friend class.
485
486         * platform/graphics/NamedImageGeneratedImage.cpp: New class. Calls into the Theme to render the artwork.
487         (WebCore::NamedImageGeneratedImage::NamedImageGeneratedImage):
488         (WebCore::NamedImageGeneratedImage::draw):
489         (WebCore::NamedImageGeneratedImage::drawPattern):
490         * platform/graphics/NamedImageGeneratedImage.h:
491
492         * platform/ios/ThemeIOS.h: Inherit from ThemeCocoa.
493         * platform/mac/ThemeMac.h: Ditto.
494
495 2015-06-18  KyungTae Kim  <ktf.kim@samsung.com> and Myles C. Maxfield  <mmaxfield@apple.com>
496
497         [CSS3] Add support for the word-break:keep-all CSS property
498         https://bugs.webkit.org/show_bug.cgi?id=123782
499
500         Reviewed by Darin Adler.
501
502         Add support for word-break:keep-all CSS property by CSS3 spec:
503         http://www.w3.org/TR/2013/WD-css-text-3-20131010/#word-break-property
504
505         Test: fast/text/word-break-keep-all.html
506
507         * css/CSSParser.cpp:
508         (WebCore::isValidKeywordPropertyAndValue):
509         * css/CSSPrimitiveValueMappings.h:
510         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
511         (WebCore::CSSPrimitiveValue::operator EWordBreak):
512         * css/CSSValueKeywords.in:
513         * rendering/RenderText.cpp:
514         (WebCore::RenderText::computePreferredLogicalWidths):
515         * rendering/break_lines.h:
516         (WebCore::nextBreakablePositionKeepingAllWords):
517         (WebCore::nextBreakablePositionKeepingAllWordsIgnoringNBSP):
518         (WebCore::isBreakable):
519         * rendering/line/BreakingContext.h:
520         (WebCore::BreakingContext::handleText):
521         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
522         * rendering/style/RenderStyleConstants.h:
523
524 2015-06-18  Jon Lee  <jonlee@apple.com>
525
526         Update AVKit usage of pip
527         https://bugs.webkit.org/show_bug.cgi?id=146095
528         <rdar://problem/21386853>
529
530         Reviewed by Eric Carlson.
531
532         - Rename enum VideoFullscreenModeOptimized to VideoFullscreenModePictureInPicture
533         - Rename MediaElementSession::allowsAlternateFullscreen to allowsPictureInPicture
534         - Rename Settings::allowsAlternateFullscreen to allowsPictureInPictureMediaPlayback
535         - Update AVKit calls and AVKitSPI.h
536         - Rename WebVideoFullscreenInterfaceAVKit delegate functions and member variables
537
538         * html/HTMLMediaElement.cpp:
539         * html/HTMLVideoElement.cpp:
540         * html/MediaElementSession.cpp:
541         (WebCore::MediaElementSession::allowsPictureInPicture): Renamed.
542         (WebCore::MediaElementSession::allowsAlternateFullscreen): Deleted.
543         * html/MediaElementSession.h:
544         * page/Settings.cpp:
545         * page/Settings.in:
546         * platform/graphics/MediaPlayerEnums.h:
547         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
548         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
549         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Remove unused setIsOptimized.
550         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
551         * platform/spi/cocoa/AVKitSPI.h: Remove unused typedef.
552         * platform/spi/mac/AVFoundationSPI.h:
553
554 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
555
556         Fix crash when entering fullscreen during exit fullscreen animation.
557         https://bugs.webkit.org/show_bug.cgi?id=146117
558
559         Reviewed by Simon Fraser.
560
561         Because enterFullscreen can be called during exitFullscreen animation, the exit fullscreen teardown
562         should not imply a fullscreen state change on video element.
563
564         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
565         (WebVideoFullscreenControllerContext::exitFullscreen): May be called from mainThread
566         (-[WebVideoFullscreenController exitFullscreen]): May be called from mainThread
567         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
568         (WebVideoFullscreenModelVideoElement::setVideoElement): 
569         Changing associated video element does not imply fullscreen mode change.
570
571 2015-06-18  Brian J. Burg  <burg@cs.washington.edu>
572
573         Web Inspector: improve generated types for objects passed to backend commands
574         https://bugs.webkit.org/show_bug.cgi?id=146091
575
576         Reviewed by Joseph Pecoraro.
577
578         Update type signatures for backend command implementations. In a few cases, clean
579         up relevant helper function signatures and copy data out of parameter objects where
580         the code previously held onto a reference.
581
582         No new tests, no behavior changed.
583
584         * inspector/InspectorCSSAgent.cpp:
585         (WebCore::computePseudoClassMask):
586         (WebCore::InspectorCSSAgent::setStyleText):
587         (WebCore::InspectorCSSAgent::setRuleSelector):
588         (WebCore::InspectorCSSAgent::forcePseudoState):
589         * inspector/InspectorCSSAgent.h:
590         * inspector/InspectorDOMAgent.cpp:
591         (WebCore::parseColor):
592         (WebCore::parseConfigColor):
593         (WebCore::parseQuad):
594         (WebCore::InspectorDOMAgent::performSearch):
595         (WebCore::InspectorDOMAgent::setSearchingForNode):
596         (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
597         (WebCore::InspectorDOMAgent::setInspectModeEnabled):
598         (WebCore::InspectorDOMAgent::highlightRect):
599         (WebCore::InspectorDOMAgent::highlightQuad):
600         (WebCore::InspectorDOMAgent::innerHighlightQuad):
601         (WebCore::InspectorDOMAgent::highlightNode):
602         (WebCore::InspectorDOMAgent::highlightFrame):
603         * inspector/InspectorDOMAgent.h:
604         * inspector/InspectorDOMStorageAgent.cpp:
605         (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
606         (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
607         (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
608         (WebCore::InspectorDOMStorageAgent::findStorageArea):
609         * inspector/InspectorDOMStorageAgent.h:
610         * inspector/InspectorIndexedDBAgent.cpp:
611         (WebCore::InspectorIndexedDBAgent::requestData):
612         * inspector/InspectorIndexedDBAgent.h:
613         * inspector/InspectorReplayAgent.cpp:
614         (WebCore::InspectorReplayAgent::replayToPosition):
615         * inspector/InspectorReplayAgent.h:
616         * inspector/InspectorResourceAgent.cpp:
617         (WebCore::InspectorResourceAgent::willSendRequest):
618         (WebCore::InspectorResourceAgent::setExtraHTTPHeaders):
619         Clean up extraHTTPHeaders to copy header key/values out of the InspectorObject, rather
620         than retaining the protocol object indefinitely. This matches the ownership scheme used
621         everywhere else.
622
623         * inspector/InspectorResourceAgent.h:
624         * inspector/InspectorStyleSheet.h:
625         (WebCore::InspectorCSSId::InspectorCSSId):
626         * inspector/InspectorWorkerAgent.cpp:
627         (WebCore::InspectorWorkerAgent::sendMessageToWorker):
628         * inspector/InspectorWorkerAgent.h:
629
630 2015-06-18  Anders Carlsson  <andersca@apple.com>
631
632         Remove shouldInterruptJavaScript
633         https://bugs.webkit.org/show_bug.cgi?id=146118
634
635         Reviewed by Antti Koivisto.
636
637         The WebKit SPI methods for deciding whether JavaScript execution should be interrupted hasn't been used
638         for many releases. Furthermore, they don't make sense in the multi-process architecture since it's still possible
639         to interrupt execution (by closing the browser tab or window) from the UI process.
640
641         * bindings/js/JSDOMWindowBase.cpp:
642         (WebCore::JSDOMWindowBase::shouldInterruptScript):
643         * loader/EmptyClients.h:
644         * page/Chrome.cpp:
645         (WebCore::Chrome::shouldInterruptJavaScript): Deleted.
646         * page/Chrome.h:
647         * page/ChromeClient.h:
648
649 2015-06-18  Benjamin Poulain  <bpoulain@apple.com>
650
651         [CSS JIT][ARMv7] The pseudo element early exit trashes r6
652         https://bugs.webkit.org/show_bug.cgi?id=146078
653
654         Reviewed by Alex Christensen.
655
656         The pseudo element early failure runs before we generate the prologue.
657         The reason is that we can often exit immediately on function entry, before
658         we even touch any memory.
659
660         On ARMv7, we don't have many spare registers so the MacroAssembler
661         uses r6 as a scratch register and the client code is expected to save
662         it.
663
664         In the early failure case, we were not pushing r6 before using the MacroAssembler
665         and its value could be trashed.
666
667         This patch push the macro assembler registers separately from the prologue.
668
669         For restoring the registers, a new function generateFunctionEnding() encapsulate
670         the pop() and ret().
671
672         * cssjit/SelectorCompiler.cpp:
673         (WebCore::SelectorCompiler::SelectorCodeGenerator::pushMacroAssemblerRegisters):
674         (WebCore::SelectorCompiler::SelectorCodeGenerator::popMacroAssemblerRegisters):
675         (WebCore::SelectorCompiler::SelectorCodeGenerator::generatePrologue):
676         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateEpilogue):
677         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
678
679         * cssjit/StackAllocator.h:
680         (WebCore::StackAllocator::operator=):
681         We have a new case for the stack allocator: some stack changes are conditional
682         at compile time instead of runtime. This is easy to deal with by overriding
683         the stack if a path is not taken at compile time.
684
685 2015-06-17  Conrad Shultz  <conrad_shultz@apple.com>
686
687         REGRESSION: js/dom/navigator-plugins-crash.html asserts a lot
688         https://bugs.webkit.org/show_bug.cgi?id=144399
689
690         Reviewed by Darin Adler.
691
692         Earlier work made the array of web-visible plug-ins dynamic, but allowed DOMPlugin (and, indirectly by extension,
693         DOMMimeType) to continue keeping a reference to a plug-in in terms of an index into that array. This superficially
694         appeared correct since DOMPlugin immutably holds onto a PluginData instance, which in turn immutably holds onto a
695         Page instance. PluginStrategy::getWebVisiblePluginInfo() is passed this Page, which is used to determine the contents
696         of the plugin array. The expectation was that keeping an index would still be safe since the Page is not changing,
697         but this is not strictly correct since relevant attributes of the Page and/or the available plugins may still change.
698
699         It's not entirely clear why the test failures are intermittent and occur only on certain configurations, but address
700         them by eliminating the incorrect storage of indexes in favor of keeping copies of the relevant plugin info itself.
701
702         * plugins/DOMMimeType.cpp:
703         (WebCore::DOMMimeType::DOMMimeType):
704         Instead of storing the MIME type index, retrieve and store the MIME class info and plugin info.
705         (WebCore::DOMMimeType::type):
706         Directly access the m_mimeClassInfo member.
707         (WebCore::DOMMimeType::suffixes):
708         Ditto.
709         (WebCore::DOMMimeType::description):
710         Ditto.
711         (WebCore::DOMMimeType::enabledPlugin):
712         Directly access the m_pluginInfo member.
713         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
714
715         * plugins/DOMMimeType.h:
716         Update member variables.
717
718         * plugins/DOMPlugin.cpp:
719         (WebCore::DOMPlugin::DOMPlugin):
720         Instead of storing the plugin index, store the plugin info directly.
721         (WebCore::DOMPlugin::name):
722         Directly access m_pluginInfo.
723         (WebCore::DOMPlugin::filename):
724         Ditto.
725         (WebCore::DOMPlugin::description):
726         Ditto.
727         (WebCore::DOMPlugin::length):
728         Ditto.
729         (WebCore::DOMPlugin::item):
730         Access m_pluginInfo directly; find the matching plug-in based on matching PluginInfo (for which an overloaded
731         comparator is supplied below).
732         (WebCore::DOMPlugin::pluginInfo): Deleted.
733
734         * plugins/DOMPlugin.h:
735         Update member variables.
736         (WebCore::DOMPlugin::create):
737         Accept a PluginInfo instead of a plugin index.
738
739         * plugins/DOMPluginArray.cpp:
740         (WebCore::DOMPluginArray::item):
741         (WebCore::DOMPluginArray::namedItem):
742
743         * plugins/PluginData.h:
744         (WebCore::operator==):
745         Added; compare PluginInfo structs on the basis of member equality.
746
747 2015-06-17  Alex Christensen  <achristensen@webkit.org>
748
749         [Content Extensions] Log blocked loads to the WebInspector console
750         https://bugs.webkit.org/show_bug.cgi?id=146089
751
752         Reviewed by Joseph Pecoraro.
753
754         * contentextensions/ContentExtensionsBackend.cpp:
755         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
756         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
757         Log which URLs are blocked and the URL of the page they are blocked from.
758
759 2015-06-18  Joseph Pecoraro  <pecoraro@apple.com>
760
761         Crash under WebCore::DOMWindow::dispatchMessageEventWithOriginCheck attempting to log console message
762         https://bugs.webkit.org/show_bug.cgi?id=146093
763
764         Reviewed by Timothy Hatcher.
765
766         * page/DOMWindow.cpp:
767         (WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):
768         The console could be null so null check its use.
769
770 2015-06-18  Csaba Osztrogonác  <ossy@webkit.org>
771
772         Suppress null-conversion warnings in ANGLE
773         https://bugs.webkit.org/show_bug.cgi?id=145125
774
775         Reviewed by Alex Christensen.
776
777         * CMakeLists.txt:
778
779 2015-06-18  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
780
781         [Streams API] Implement ReadableStreamReader.releaseLock
782         https://bugs.webkit.org/show_bug.cgi?id=145299
783
784         Reviewed by Darin Adler.
785
786         Covered by rebased tests.
787
788         * Modules/streams/ReadableStream.cpp:
789         (WebCore::ReadableStream::close): Moving some close code to newly added releaseReader.
790         (WebCore::ReadableStream::releaseReader): Implements reader release and callbacks finalization.
791         (WebCore::ReadableStream::changeStateToErrored): Calls releaseReader.
792         * Modules/streams/ReadableStream.h:
793         (WebCore::ReadableStream::hasReadPendingRequests): Added to enable reader.releaseLock throwing if read requests are pending.
794         * Modules/streams/ReadableStreamReader.cpp:
795         (WebCore::ReadableStreamReader::releaseLock): Implementation of releaseLock
796         * Modules/streams/ReadableStreamReader.h:
797         * Modules/streams/ReadableStreamReader.idl:
798         (WebCore::releaseLock): Deleted.
799
800 2015-06-18  Youenn Fablet  <youenn.fablet@crf.canon.fr>
801
802         GObject and ObjC bindings generator should not generate code for promise-based APIs
803         https://bugs.webkit.org/show_bug.cgi?id=146059
804
805         Reviewed by Darin Adler.
806
807         Covered by rebased expectations.
808
809         * bindings/scripts/CodeGeneratorGObject.pm:
810         (SkipFunction): Disabling GObject DOM binding for functions returning promises.
811         * bindings/scripts/CodeGeneratorObjC.pm:
812         (SkipFunction): Disabling ObjC DOM binding for functions returning promises.
813         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Rebasing expectation.
814         (webkit_dom_test_obj_get_read_only_long_attr): Deleted.
815         (webkit_dom_test_obj_get_read_only_string_attr): Deleted.
816         * bindings/scripts/test/GObject/WebKitDOMTestObj.h: Rebasing expectation.
817         * bindings/scripts/test/ObjC/DOMTestObj.h: Ditto.
818         * bindings/scripts/test/ObjC/DOMTestObj.mm: Ditto.
819         (core): Deleted.
820
821 2015-06-17  Ryuan Choi  <ryuan.choi@navercorp.com>
822
823         [EFL] test_ewk2_context_url_scheme_register has been crashed since r185553
824         https://bugs.webkit.org/show_bug.cgi?id=146075
825
826         Reviewed by Carlos Garcia Campos.
827
828         Since r185553, CustomProtocolManager sends StartLoading message to UIProcess
829         with request of SoupGenericRequest instead of request itself.
830         But, request of SoupGenericRequest is nullptr in EFL port because EFL port
831         does not use m_initiatingPageID.
832
833         This patch updates request of SoupGenericRequest although m_initiatingPageID is null.
834
835         * platform/network/soup/ResourceRequestSoup.cpp: 
836         (WebCore::ResourceRequest::updateSoupRequest):
837
838 2015-06-17  Daniel Bates  <dabates@apple.com>
839
840         Client may receive began editing callback for already focused text field
841         https://bugs.webkit.org/show_bug.cgi?id=146074
842         <rdar://problem/21293562>
843
844         Reviewed by Darin Adler.
845
846         Fixes an issue where the client would be notified that began editing in a text field
847         for each programmatic DOM focus event dispatched at the text field regardless of
848         whether the field was focused. The client should only be notified that began editing
849         exactly once when a text field becomes focused (either programmatically or by user interaction).
850
851         * html/TextFieldInputType.cpp:
852         (WebCore::TextFieldInputType::forwardEvent): Move logic to dispatch editing began callback from here...
853         (WebCore::TextFieldInputType::handleFocusEvent): to here. This function is called when the
854         text field becomes newly focused.
855         * html/TextFieldInputType.h:
856
857 2015-06-17  Alex Christensen  <achristensen@webkit.org>
858
859         [Content Extensions] Fail to parse invalid arrays
860         https://bugs.webkit.org/show_bug.cgi?id=146079
861         rdar://problem/21422649
862
863         Reviewed by Benjamin Poulain.
864
865         Covered by new and corrected API tests.
866
867         * contentextensions/ContentExtensionParser.cpp:
868         (WebCore::ContentExtensions::loadTrigger):
869         Fail to parse invalid arrays for if-domain, unless-domain, resource-type, and load-type arrays.
870
871 2015-06-16  Jon Honeycutt  <jhoneycutt@apple.com>
872
873         Position::findParent() should take a reference
874         https://bugs.webkit.org/show_bug.cgi?id=146038
875
876         Reviewed by Darin Adler.
877
878         * dom/Position.cpp:
879         (WebCore::Position::containerNode):
880         (WebCore::Position::parentAnchoredEquivalent):
881         Pass a reference; there is already a null check.
882         (WebCore::Position::previous):
883         Add a missing null check. Code below this expects that node is non-null.
884         (WebCore::Position::next):
885         Ditto.
886         (WebCore::Position::atStartOfTree):
887         (WebCore::Position::atEndOfTree):
888         Pass a reference.
889         (WebCore::Position::findParent):
890         Changed to take a reference.
891
892         * dom/Position.h:
893         Ditto.
894
895 2015-06-17  Brent Fulgham  <bfulgham@apple.com>
896
897         Overflow regions with scroll snap points are not reliably rubber banding
898         https://bugs.webkit.org/show_bug.cgi?id=142522
899         <rdar://problem/20100726>
900
901         Reviewed by Darin Adler.
902
903         When computing the target scroll destination, update the nearest snap point index
904         and other bookkeeping, but keep the original gesture target if it would have taken
905         us beyond either limit of the scroll container.
906
907         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
908         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
909         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollExtents): Add new method
910         to support client API.
911         * platform/ScrollAnimator.cpp:
912         (WebCore::ScrollAnimator::scrollExtents): Add new method to support client API.
913         * platform/ScrollAnimator.h:
914         * platform/cocoa/ScrollController.h:
915         (WebCore::ScrollControllerClient::scrollExtents): Added new pure virtual method to API.
916         * platform/cocoa/ScrollController.mm:
917         (WebCore::ScrollController::beginScrollSnapAnimation): Hold onto original user gesture
918         target, and use that instead of our nearest snap point if the gesture takes us past
919         either extreme of the scroll container.
920
921 2015-06-17  Tim Horton  <timothy_horton@apple.com>
922
923         Swipe gesture can get stuck, preventing scrolling and other gestures
924         https://bugs.webkit.org/show_bug.cgi?id=146088
925         <rdar://problem/16056087>
926
927         Reviewed by Darin Adler.
928
929         * WebCore.xcodeproj/project.pbxproj:
930         * platform/spi/mac/NSEventSPI.h: Added.
931         Add an SPI header.
932
933 2015-06-16  Matt Rajca  <mrajca@apple.com>
934
935         MediaSession: handle MediaEventTrackNext and MediaEventTrackPrevious events
936         https://bugs.webkit.org/show_bug.cgi?id=146028
937
938         Reviewed by Darin Adler.
939
940         * Modules/mediasession/MediaRemoteControls.idl: Added nexttrack/previoustrack event handlers.
941         * Modules/mediasession/MediaSession.cpp: Dispatch the nexttrack/previoustrack events.
942         (WebCore::MediaSession::skipToNextTrack):
943         (WebCore::MediaSession::skipToPreviousTrack):
944         * Modules/mediasession/MediaSession.h:
945         * Modules/mediasession/MediaSessionManager.cpp: Skip to the next/previous track as described in the media session spec.
946         (WebCore::MediaSessionManager::skipToNextTrack):
947         (WebCore::MediaSessionManager::skipToPreviousTrack):
948         * Modules/mediasession/MediaSessionManager.h:
949         * dom/EventNames.h: Added the nexttrack/previoustrack event names.
950         * page/Page.cpp: Tell MediaSessionManager to handle the new track-skipping events.
951         (WebCore::Page::handleMediaEvent):
952
953 2015-06-17  Chris Fleizach  <cfleizach@apple.com>
954
955         AX: VoiceOver in iOS not announcing generic WAI-ARIA region, even if labelled properly
956         https://bugs.webkit.org/show_bug.cgi?id=146066
957
958         Reviewed by Darin Adler.
959
960         Allow the region role to identify as a landmark type.
961
962         Updated test: platform/ios-simulator/accessibility/landmark-types.html
963
964         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
965         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
966
967 2015-06-17  Simon Fraser  <simon.fraser@apple.com>
968
969         REGRESSION (r173283-r173296): Amazon.com front page has no caret in the search field
970         https://bugs.webkit.org/show_bug.cgi?id=146073
971         rdar://problem/21022203
972
973         Reviewed by Tim Horton.
974
975         Text controls (text inputs and textareas) need backing store even when empty, because
976         they need to be able to paint a caret.
977
978         Test: compositing/backing/form-controls-backing.html
979
980         * rendering/RenderLayerBacking.cpp:
981         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
982
983 2015-06-17  Zalan Bujtas  <zalan@apple.com>
984
985         Selection cache produces invalid result when ancestor has float element.
986         https://bugs.webkit.org/show_bug.cgi?id=146042
987         rdar://problem/20604592
988
989         Reviewed by Ryosuke Niwa.
990
991         Selection cache already takes floats into account, however it's not enough to check current
992         block against floats. Any of the ancestor's float starting from the selection root block
993         can impact the selection offsets.
994
995         Test: fast/block/selection-cache-is-incorrect-when-non-direct-parent-has-float.html
996
997         * rendering/LogicalSelectionOffsetCaches.h:
998         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::ContainingBlockInfo):
999         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock):
1000         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::block):
1001         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::cache):
1002         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::hasFloatsOrFlowThreads):
1003         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
1004
1005 2015-06-17  Joanmarie Diggs  <jdiggs@igalia.com>
1006
1007         AX: [ATK] Expose element tag name as an object attribute
1008         https://bugs.webkit.org/show_bug.cgi?id=146062
1009
1010         Reviewed by Mario Sanchez Prada.
1011
1012         Expose the element tag name as an object attribute with name "tag" and
1013         value being the lowercase tag name, both being what Gecko does for ATK.
1014
1015         No new tests. We already have sufficient coverage for AtkObject attributes.
1016         These tests have been updated to reflect the addition of the new attribute.
1017
1018         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1019         (webkitAccessibleGetAttributes):
1020
1021 2015-06-17  Antti Koivisto  <antti@apple.com>
1022
1023         iOS WebKit1: [LegacyTileLayer drawInContext:] should ensure it has web lock
1024         https://bugs.webkit.org/show_bug.cgi?id=146072
1025         rdar://problem/21149759
1026
1027         Reviewed by Simon Fraser
1028
1029         There are some scenarios where we end up drawing without web lock due to client or system issues.
1030         This can cause crashes.
1031
1032         * platform/ios/LegacyTileLayer.mm:
1033         (-[LegacyTileLayer setNeedsDisplayInRect:]):
1034         (-[LegacyTileLayer drawInContext:]):
1035
1036             Ensure we have the web lock when called in main thread (even though we should have it already).
1037
1038 2015-06-17  Brent Fulgham  <bfulgham@apple.com>
1039
1040         CSS scroll snap: defining snap points on axis that does not scroll does not work properly
1041         https://bugs.webkit.org/show_bug.cgi?id=146043
1042         <rdar://problem/20125511>
1043
1044         Reviewed by Simon Fraser.
1045
1046         Tested by css3/scroll-snap/scroll-snap-mismatch.html
1047
1048         We always seed the set of scroll snap points with the start and end of the scroll container. This is not
1049         the right behavior if there are no scroll points defined, because we end up creating a snap for the start
1050         and end of the container, and any scroll gesture just takes us across the entire element.
1051         
1052         Instead, when we do not find any scroll snap points, we should clear the snap point state for the container.
1053
1054         * page/scrolling/AxisScrollSnapOffsets.cpp:
1055         (WebCore::updateFromStyle): If we did not find any snap points (i.e., the snapOffsets container
1056         only holds '0', return an empty Vector. 
1057         (WebCore::updateSnapOffsetsForScrollableArea): If the set of snap points produced by 'updateFromStyle' is empty,
1058         clear the horizontal (or vertical) snap offsets for the scroll area.
1059         
1060
1061 2015-06-17  Chris Fleizach  <cfleizach@apple.com>
1062
1063         AX: input role="spinbutton" gets skipped in voiceover
1064         https://bugs.webkit.org/show_bug.cgi?id=145514
1065
1066         Reviewed by Mario Sanchez Prada.
1067
1068         SpinButton role was added, but left out of iOS.
1069         To prevent this from happening again, explicitly list every role in the switch statement that
1070         determines accessible visibility.
1071
1072         Test: platform/ios-simulator/accessibility/spinbutton.html
1073
1074         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1075         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1076         (-[WebAccessibilityObjectWrapper isAccessibilityElement]):
1077
1078 2015-06-17  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1079
1080         [Streams API] ReadableJSStream should handle promises returned by JS source pull callback
1081         https://bugs.webkit.org/show_bug.cgi?id=145965
1082
1083         Reviewed by Darin Adler.
1084
1085         Implemented asynchronous pulling.
1086         In particular, ensuring that doPull is not called as long as previous call to doPull is finished.
1087         Storing whether to pull automatically when the current pull is finished. 
1088
1089         Covered by rebased tests.
1090
1091         * Modules/streams/ReadableStream.cpp:
1092         (WebCore::ReadableStream::pull): stores whether to pull again.
1093         (WebCore::ReadableStream::finishPulling): called when pulling finishes.
1094         * Modules/streams/ReadableStream.h:
1095         * bindings/js/ReadableJSStream.cpp:
1096         (WebCore::createPullResultFulfilledFunction): The promise resolve callback.
1097         (WebCore::ReadableJSStream::doPull): Handling of promise.
1098         * bindings/js/ReadableJSStream.h:
1099
1100 2015-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1101
1102         WebProcess crashes after too many redirect error when there's an active NPAPI plugin
1103         https://bugs.webkit.org/show_bug.cgi?id=146019
1104
1105         Reviewed by Darin Adler.
1106
1107         This happens with the GTK+ port after a navigation action ends up
1108         in an infinite redirection and the ResourceHandle fails with too
1109         many redirections error. I should actually happen after any error
1110         is reported by the ResourceHnalder before the load is
1111         committed. But tt only happens if there's an active NPAPI
1112         plugin. The problem is that FrameLoader::receivedMainResourceError()
1113         is called recursively because DocumentLoader::stopLoading() ends up
1114         calling mainReceivedError() that calls FrameLoader::receivedMainResourceError()
1115         again. DocumentLoader::stopLoading() checks if the document is
1116         still loading, which can happen if the main resource is loading,
1117         if there's any subresource loading or if there's a plugin
1118         loading. So, in case of being loading, those cases are handled
1119         individually to cancel the main resource, or set an error in the
1120         document loader and cancel subresources and plugins, except for
1121         this case of plugins, that mainReceivedError is called instead of
1122         setting cancelled error on the document loader.
1123
1124         * loader/DocumentLoader.cpp:
1125         (WebCore::DocumentLoader::stopLoading): If the document is still
1126         loading because there are active plugins, set the cancelled error
1127         on the document instead of calling mainReceivedError again.
1128
1129 2015-06-16  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
1130
1131         [Streams API] Implement ReadableStream locked property
1132         https://bugs.webkit.org/show_bug.cgi?id=146023
1133
1134         Reviewed by Darin Adler.
1135
1136         Covered by rebased tests.
1137
1138         * Modules/streams/ReadableStream.h:
1139         (WebCore::ReadableStream::locked): Renamed isLocked by locked.
1140         * Modules/streams/ReadableStream.idl: Adding locked.
1141         * bindings/js/JSReadableStreamCustom.cpp:
1142         (WebCore::JSReadableStream::getReader): Using isLocked.
1143         * bindings/js/JSReadableStreamReaderCustom.cpp:
1144         (WebCore::constructJSReadableStreamReader): Using isLocked.
1145
1146 2015-06-16  Myles C. Maxfield  <mmaxfield@apple.com>
1147
1148         REGRESSION(r184899): [Cocoa] font-variant: small-caps is not honored with web fonts
1149         https://bugs.webkit.org/show_bug.cgi?id=145873
1150         <rdar://problem/21314282>
1151
1152         Reviewed by Dean Jackson.
1153
1154         When font-variant: small-caps is applied, we create a smaller version of the original font
1155         and draw capital characters in that smaller font. CGFontRefs do not have an intrinsic size,
1156         and web fonts historically only had a CGFontRef, which means that there was no need to
1157         convert the CGFontRef to be smaller (as opposed to regular fonts, which had a CTFontRef and
1158         therefore needed the conversion). Instead, we just changed m_size, which represents
1159         the size that the text should be drawn in.
1160
1161         However, r184899 gave CTFontRefs to web fonts. This means that now the FontPlatformData's
1162         m_size variable disagreed with the CTFontRef member. The solution here is to unify the web
1163         font and regular font codepaths, and treat them the same throughout.
1164
1165         Note that this patch removes the last use of the m_isCustomFont variable. As soon as we
1166         entirely migrate to CORETEXT_WEB_FONTS, we should delete this variable.
1167
1168         Test: fast/text/small-caps-web-font.html
1169
1170         * platform/graphics/cocoa/FontCocoa.mm:
1171         (WebCore::Font::platformCreateScaledFont): Treat web fonts the same as regular fonts.
1172         * platform/text/TextFlags.h: Add a comment regarding teh deletion of m_isCustomFont.
1173
1174 2015-06-16  Alex Christensen  <achristensen@webkit.org>
1175
1176         [Content Extensions] Implement branch compaction for DFA bytecode.
1177         https://bugs.webkit.org/show_bug.cgi?id=145619
1178
1179         Reviewed by Benjamin Poulain.
1180
1181         This patch adds another pass to the DFABytecodeCompiler which finds where the bytecode from each node
1182         would be if it were compiled with no branch compaction, then uses that as a worst-case value to determine
1183         how many bytes are needed to store the relative jump distance.  Then when linking, it will fill in the 
1184         value as it already did, but with a variable size jump.  The jumps are also now signed distances relative to
1185         where the jump is stored.
1186
1187         This patch is covered by existing tests, which have many jumps that are near the -128/127 byte boundary,
1188         and the switch from 16-bit jumps to 32-bit jumps near the -65536/65535 byte boundary is analogous.
1189
1190         * contentextensions/ContentExtensionCompiler.cpp:
1191         (WebCore::ContentExtensions::compileRuleList):
1192         * contentextensions/DFABytecode.h:
1193         (WebCore::ContentExtensions::smallestPossibleJumpSize):
1194         (WebCore::ContentExtensions::instructionSizeWithArguments):
1195         * contentextensions/DFABytecodeCompiler.cpp:
1196         (WebCore::ContentExtensions::append):
1197         (WebCore::ContentExtensions::appendZeroes):
1198         (WebCore::ContentExtensions::setBits):
1199         (WebCore::ContentExtensions::appendActionBytecodeSize):
1200         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
1201         (WebCore::ContentExtensions::DFABytecodeCompiler::longestPossibleJump):
1202         (WebCore::ContentExtensions::DFABytecodeCompiler::emitJump):
1203         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
1204         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
1205         (WebCore::ContentExtensions::DFABytecodeCompiler::emitTerminate):
1206         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
1207         (WebCore::ContentExtensions::DFABytecodeCompiler::compiledNodeMaxBytecodeSize):
1208         (WebCore::ContentExtensions::DFABytecodeCompiler::ranges):
1209         (WebCore::ContentExtensions::DFABytecodeCompiler::checkForRangeMaxBytecodeSize):
1210         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
1211         (WebCore::ContentExtensions::DFABytecodeCompiler::nodeTransitionsMaxBytecodeSize):
1212         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
1213         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
1214         (WebCore::ContentExtensions::set32Bits): Deleted.
1215         * contentextensions/DFABytecodeCompiler.h:
1216         * contentextensions/DFABytecodeInterpreter.cpp:
1217         (WebCore::ContentExtensions::getBits):
1218         (WebCore::ContentExtensions::getInstruction):
1219         (WebCore::ContentExtensions::jumpSizeInBytes):
1220         (WebCore::ContentExtensions::getJumpSize):
1221         (WebCore::ContentExtensions::getJumpDistance):
1222         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
1223         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
1224         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot):
1225         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1226         * loader/ResourceLoadInfo.h:
1227
1228 2015-06-16  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1229
1230         [GTK] [Wayland] Should be possible to build with support for both X11 and Wayland.
1231         https://bugs.webkit.org/show_bug.cgi?id=145701
1232
1233         Reviewed by Darin Adler.
1234
1235         No new tests, no behavior changes.
1236
1237         When building both targets, we have to include the wayland-egl
1238         headers in order to build the Wayland target. This causes that
1239         EGLNativePixmapType and EGLNativeWindowType get defined as
1240         different types than when building only the X11 target.
1241
1242         By type casting them to the ones that are expected, we are able
1243         to build both targets at the same time.
1244
1245         I have done tests (building each target alone as also both targets
1246         at the same time), and everything seems to works as expected.
1247
1248         Once built for both targets, if you try to launch the MiniBrowser
1249         from inside a Wayland compositor (Weston on top of X for example),
1250         it will trigger the X11 target if the DISPLAY environment variable
1251         is set and the environment variable GDK_BACKEND is not set to wayland,
1252         otherwise it will trigger the Wayland target.
1253
1254         * platform/graphics/GLContext.cpp:
1255         (WebCore::GLContext::createContextForWindow): Add type casts. We have
1256         to consider here two different type casts depending on the type of
1257         GLNativeWindowType to avoid a build failure on 32-bits platforms.
1258         The static_cast one was already beeing done as an implicit cast
1259         (from uint64_t to XID), the reinterpret_cast is the new one that
1260         we need to do only when building on both platforms.
1261         * platform/graphics/egl/GLContextEGL.cpp: Add missing include when
1262         building both targets that is required for defining DefaultRootWindow().
1263         (WebCore::GLContextEGL::createPixmapContext): Add type cast.
1264
1265 2015-06-15  Jon Honeycutt  <jhoneycutt@apple.com>
1266
1267         [iOS] Crash long pressing on <input type=file>
1268         https://bugs.webkit.org/show_bug.cgi?id=146009
1269         <rdar://problem/21234453>
1270
1271         Reviewed by Ryosuke Niwa.
1272
1273         * dom/Position.cpp:
1274         (WebCore::Position::atStartOfTree):
1275         (WebCore::Position::atEndOfTree):
1276         Null check the container node before passing it to findParent().
1277
1278 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
1279
1280         AX:  iOS accessibility tests are not running because we need WKTR support
1281         https://bugs.webkit.org/show_bug.cgi?id=145991
1282
1283         Reviewed by Daniel Bates.
1284
1285         Make some minor modifications to support notification handling in WKTR.
1286
1287         * accessibility/ios/AXObjectCacheIOS.mm:
1288         (WebCore::AXObjectCache::postPlatformNotification):
1289         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
1290         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1291         (-[WebAccessibilityObjectWrapper accessibilityClickPoint]):
1292         (-[WebAccessibilityObjectWrapper description]):
1293         (-[WebAccessibilityObjectWrapper accessibilitySetPostedNotificationCallback:withContext:]): Deleted.
1294         (-[WebAccessibilityObjectWrapper accessibilityPostedNotification:]): Deleted.
1295
1296 2015-06-16  Mark Lam  <mark.lam@apple.com>
1297
1298         Use NakedPtr<Exception>& to return exception results.
1299         https://bugs.webkit.org/show_bug.cgi?id=145870
1300
1301         Reviewed by Anders Carlsson and Filip Pizlo.
1302
1303         No new WebCore tests because this functionality is already covered by existing tests.
1304         API tests added for WTF::NakedPtr.
1305
1306         * bindings/js/JSCallbackData.cpp:
1307         (WebCore::JSCallbackData::invokeCallback):
1308         * bindings/js/JSCustomXPathNSResolver.cpp:
1309         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
1310         * bindings/js/JSErrorHandler.cpp:
1311         (WebCore::JSErrorHandler::handleEvent):
1312         * bindings/js/JSEventListener.cpp:
1313         (WebCore::JSEventListener::handleEvent):
1314         * bindings/js/JSMainThreadExecState.cpp:
1315         (WebCore::JSMainThreadExecState::didLeaveScriptContext):
1316         (WebCore::functionCallHandlerFromAnyThread):
1317         (WebCore::evaluateHandlerFromAnyThread):
1318         * bindings/js/JSMainThreadExecState.h:
1319         (WebCore::JSMainThreadExecState::currentState):
1320         (WebCore::JSMainThreadExecState::call):
1321         (WebCore::JSMainThreadExecState::evaluate):
1322         * bindings/js/JSMutationCallback.cpp:
1323         (WebCore::JSMutationCallback::call):
1324         * bindings/js/ScheduledAction.cpp:
1325         (WebCore::ScheduledAction::executeFunctionInContext):
1326         * bindings/js/ScriptController.cpp:
1327         (WebCore::ScriptController::evaluateInWorld):
1328         * bindings/js/WorkerScriptController.cpp:
1329         (WebCore::WorkerScriptController::evaluate):
1330         (WebCore::WorkerScriptController::setException):
1331         * bindings/js/WorkerScriptController.h:
1332         (WebCore::WorkerScriptController::workerGlobalScopeWrapper):
1333         * bindings/objc/WebScriptObject.mm:
1334         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1335         * workers/WorkerGlobalScope.cpp:
1336         (WebCore::WorkerGlobalScope::importScripts):
1337
1338 2015-06-16  Brent Fulgham  <bfulgham@apple.com>
1339
1340         CSS Scroll Snap - support snapping to nested elements
1341         https://bugs.webkit.org/show_bug.cgi?id=145843
1342         <rdar://problem/21339581>
1343
1344         Reviewed by Darin Adler.
1345
1346         Tested by css3/scroll-snap/nested-elements.html
1347
1348         The Scroll Snap Point implementation was not properly handling nested elements.
1349         This could be resolved by recursively calling 'appendChildSnapOffsets', but this
1350         seemed like an inefficient approach, especially considering how often this method
1351         is called during various scaling and other operations.
1352         
1353         Instead, do the following:
1354         (1) Add a new HashSet to RenderView that holds a collection of RenderElements that
1355             have scroll-snap-coordinates.
1356         (2) During RenderElement::styleWillChange, register all elements that have the
1357             scroll-snap-coordinates style with the RenderView.
1358         (3) When performing 'appendChildSnapOffsets', refer to the HashSet of elements, select the
1359             subset of these entries relevant to the current scrolling container, and build up the
1360             set of scroll-snap-coordinates needed for the current scrolling container.
1361
1362         * page/scrolling/AxisScrollSnapOffsets.cpp:
1363         (WebCore::appendChildSnapOffsets): Check the scroll-snap-coordinate RenderElement HashSet
1364         for the RenderView to find all elements that are children of the current scrolling container.
1365         Add the scroll-snap-coordinates for these RenderElements to the current set of snap points.
1366         * rendering/RenderElement.cpp:
1367         (WebCore::findEnclosingScrollableContainer): New helper function.
1368         (WebCore::RenderElement::styleWillChange): If the current element has scroll-snap-coordinate
1369         defined, remember it for later so we can use it with the relevant scrolling container
1370         after layout completes.
1371         (WebCore::RenderElement::willBeRemovedFromTree): Unregister the current element from the
1372         RenderView.
1373         (WebCore::RenderElement::findEnclosingScrollableContainer): Added. Locate the relevant
1374         scrolling container for the current object.
1375         * rendering/RenderElement.h:
1376         * rendering/RenderView.cpp:
1377         (WebCore::Document::registerRenderElementWithScrollSnapCoordinates): Added.
1378         (WebCore::Document::unregisterRenderElementWithScrollSnapCoordinates): Added.
1379         * rendering/RenderView.h:
1380
1381 2015-06-16  Brady Eidson  <beidson@apple.com>
1382
1383         [IndexedDB] array index keys are concatenated across cursor lifetime
1384         <rdar://problem/19684902> and https://bugs.webkit.org/show_bug.cgi?id=138504
1385
1386         Reviewed by Brady Eidson, patch by Mark Dixon <mark@lowla.io>
1387
1388         Tested by:
1389         storage/indexeddb/keypath-arrays.html
1390
1391         IDBKeyData and IDBKeyPath need to clear any existing array values before calling
1392         decodeObjects to update the value of an existing object.
1393         
1394         * Modules/indexeddb/IDBKeyData.cpp:
1395         (WebCore::IDBKeyData::decode):
1396         * Modules/indexeddb/IDBKeyPath.cpp:
1397         (WebCore::IDBKeyPath::decode):
1398
1399 2015-06-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
1400
1401         Canvas dimensions should be limited to 4096x4096 pixels on iOS devices.
1402         https://bugs.webkit.org/show_bug.cgi?id=145998
1403
1404         Reviewed by Darin Adler.
1405
1406         The value of MaxCanvasArea should depend on the platform. If the platform
1407         is iOS, the limit should be 64M. Otherwise the limit should be 1G.
1408
1409         Test: fast/canvas/pattern-too-large-to-create-2.html
1410
1411         * html/HTMLCanvasElement.cpp: Change MaxCanvasArea value based on the platform. 
1412         
1413         * rendering/svg/RenderSVGShape.h:
1414         (WebCore::RenderSVGShape::graphicsElement): Remove un-implemented constructor.
1415
1416 2015-06-16  Chris Dumez  <cdumez@apple.com>
1417
1418         REGRESSION(r185012): chat frame in Gmail now says "Something's not right"
1419         https://bugs.webkit.org/show_bug.cgi?id=146025
1420         <rdar://problem/21391412>
1421
1422         Reviewed by Darin Adler.
1423
1424         Only throttle timers in non-visible iframes once they've reached the
1425         max nesting level to avoid throttling critical one-shot timers. This is
1426         consistent with the default DOMTimer throttling behavior that is
1427         defined in the specification.
1428
1429         Power-wise, we are mostly interested in DOMTimers that fire frequently
1430         and cause high CPU usage over an extended period of time anyway.
1431
1432         * dom/Document.cpp:
1433         (WebCore::Document::setTimerThrottlingEnabled):
1434         (WebCore::Document::timerAlignmentInterval):
1435         * dom/Document.h:
1436         * dom/ScriptExecutionContext.cpp:
1437         (WebCore::ScriptExecutionContext::timerAlignmentInterval):
1438         * dom/ScriptExecutionContext.h:
1439         * page/DOMTimer.cpp:
1440         (WebCore::DOMTimer::alignedFireTime):
1441
1442 2015-06-16  sylvain-galineau  <galineau@adobe.com>
1443
1444         Incorrect order of arguments in initial-letter property
1445         https://bugs.webkit.org/show_bug.cgi?id=139667
1446
1447         Reviewed by Sam Weinig.
1448
1449         The CSS specification swapped the order of the initial-letters numeric values.
1450         The drop cap's height now comes first, followed by its optional vertical position.
1451         See http://www.w3.org/TR/css-inline/#sizing-drop-initials.
1452          
1453         No new tests. Existing tests updated.
1454
1455         * css/CSSParser.cpp:
1456         (WebCore::CSSParser::parseValue): swap arguments to reflect new spec order.
1457
1458 2015-06-16  Alex Christensen  <achristensen@webkit.org>
1459
1460         Remove some unused values.
1461         https://bugs.webkit.org/show_bug.cgi?id=145997
1462
1463         Reviewed by Gyuyoung Kim.
1464
1465         This patch should have no change in behavior.
1466
1467         * accessibility/AccessibilityObject.cpp:
1468         (WebCore::computeBestScrollOffset):
1469         (WebCore::AccessibilityObject::scrollToMakeVisibleWithSubFocus):
1470         (WebCore::AccessibilityObject::scrollToGlobalPoint):
1471         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1472         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1473         * html/canvas/WebGL2RenderingContext.cpp:
1474         (WebCore::WebGL2RenderingContext::validateTexFuncData):
1475         * html/canvas/WebGLRenderingContext.cpp:
1476         (WebCore::WebGLRenderingContext::validateTexFuncData):
1477         * platform/graphics/StringTruncator.cpp:
1478         (WebCore::leftTruncateToBuffer):
1479         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1480         (WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
1481         * rendering/InlineTextBox.cpp:
1482         (WebCore::InlineTextBox::localSelectionRect):
1483         * rendering/RenderElement.cpp:
1484         (WebCore::RenderElement::anchorRect):
1485         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1486         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
1487         * rendering/svg/SVGTextQuery.cpp:
1488         (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures):
1489         Remove unused values.
1490
1491 2015-06-16  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
1492
1493         [Streams API] Calling controller.error() should trigger storing an undefined error
1494         https://bugs.webkit.org/show_bug.cgi?id=145976
1495
1496         Reviewed by Darin Adler.
1497
1498         Covered by rebased test.
1499
1500         * bindings/js/JSReadableStreamControllerCustom.cpp:
1501         (WebCore::JSReadableStreamController::error): Storing undefined if no error value passed.
1502         * bindings/js/ReadableJSStream.cpp: Removed storeError(ExecState*).
1503         (WebCore::ReadableJSStream::ReadableJSStream):
1504
1505 2015-06-16  Chris Dumez  <cdumez@apple.com>
1506
1507         Purge StyledElement's presentation attribute cache on memory pressure
1508         https://bugs.webkit.org/show_bug.cgi?id=145999
1509         <rdar://problem/21359252>
1510
1511         Reviewed by Andreas Kling.
1512
1513         Purge StyledElement's presentation attribute cache on memory pressure.
1514
1515         * dom/StyledElement.cpp:
1516         (WebCore::presentationAttributeCache):
1517         (WebCore::presentationAttributeCacheCleaner):
1518         (WebCore::StyledElement::clearPresentationAttributeCache):
1519         * dom/StyledElement.h:
1520         * platform/MemoryPressureHandler.cpp:
1521         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
1522
1523 2015-06-15  Brent Fulgham  <bfulgham@apple.com>
1524
1525         REGRESSION(r175251, Mavericks Only): Playback may stall
1526         https://bugs.webkit.org/show_bug.cgi?id=145989
1527         <rdar://problem/21271919>
1528
1529         Unreviewed post-review correction.
1530
1531         Dave Kilzer pointed out that the macro around the waitForVideoOutputMediaDataWillChange
1532         call was incorrect. This patch corrects this error.
1533
1534         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1535         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Correct the
1536         macro definition.
1537
1538 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
1539
1540         AX: Changing state of radio buttons causes VoiceOver to go busy for a short time.
1541         https://bugs.webkit.org/show_bug.cgi?id=145933
1542
1543         Reviewed by Dean Jackson.
1544
1545         When radio buttons animate the new focus selection state, the thread activity looks a lot like short burst of
1546         activity to draw, then wait on CoreAnimation to apply those changes.
1547
1548         Since those periods of activity during animation are so short, VoiceOver is not able to query for all the
1549         attributes it needs, and gets stuck in the queue behind rendering.
1550
1551         The fix here is to turn off button state animations while VoiceOver is running.
1552
1553         * platform/mac/ThemeMac.mm:
1554         (WebCore::updateStates):
1555
1556 2015-06-15  Zalan Bujtas  <zalan@apple.com>
1557
1558         RootInlineBox::m_lineBreakObj becomes invalid when a child renderer is removed and the line does not get marked dirty.
1559         https://bugs.webkit.org/show_bug.cgi?id=145988
1560         rdar://problem/20959137
1561
1562         Reviewed by David Hyatt.
1563
1564         This patch ensures that we find the right first inline box so that we can dirty the
1565         the appropriate line boxes.
1566         With marking the right line boxes dirty, now we can update RootInlineBox::m_lineBreakObj at the next layout.
1567
1568         Test: fast/inline/crash-when-child-renderer-is-removed-and-line-stays-clean.html
1569
1570         * rendering/RenderInline.cpp:
1571         (WebCore::RenderInline::culledInlineFirstLineBox):
1572         (WebCore::RenderInline::culledInlineLastLineBox):
1573         * rendering/RootInlineBox.cpp:
1574         (WebCore::RootInlineBox::setLineBreakInfo): Deleted. Remove misleading assert and comment.
1575
1576 2015-06-15  Matt Rajca  <mrajca@apple.com>
1577
1578         Media Session: Improve the safety of playback toggling
1579         https://bugs.webkit.org/show_bug.cgi?id=145986
1580
1581         Reviewed by Darin Adler.
1582
1583         * Modules/mediasession/MediaSession.cpp:
1584         (WebCore::MediaSession::togglePlayback): Improved the safety of the loop so that we don't re-visit elements that
1585           may have been deleted underneath us.
1586         * Modules/mediasession/MediaSession.h: Added a pointer to the set of iterated active participating elements so
1587           we can remove any elements that are deleted from the underlying "real" set.
1588
1589 2015-06-15  Brent Fulgham  <bfulgham@apple.com>
1590
1591         REGRESSION(r175251, Mavericks Only): Playback may stall
1592         https://bugs.webkit.org/show_bug.cgi?id=145989
1593         <rdar://problem/21271919>
1594
1595         Reviewed by Dean Jackson.
1596
1597         Revert r175251 for Mavericks build targets.
1598
1599         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1600         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
1601         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
1602         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
1603
1604 2015-06-15  Darin Adler  <darin@apple.com>
1605
1606         REGRESSION (r182215): Reproducible crash at drawsvg.org due to reentrant layout
1607         https://bugs.webkit.org/show_bug.cgi?id=145964
1608
1609         Reviewed by Simon Fraser.
1610
1611         Test: svg/as-object/mutate-on-load.html
1612
1613         * page/FrameView.cpp:
1614         (WebCore::FrameView::forceLayoutParentViewIfNeeded): Don't do a synchronous layout here,
1615         because it can lead indirectly to unwanted layout reentrancy. Instead schedule a layout.
1616
1617 2015-06-15  Matt Rajca  <mrajca@apple.com>
1618
1619         Media Session: Active participating elements can change while being iterated 
1620         https://bugs.webkit.org/show_bug.cgi?id=145978
1621
1622         Reviewed by Alex Christensen.
1623
1624         * Modules/mediasession/MediaSession.cpp:
1625         (WebCore::MediaSession::togglePlayback): Iterate through a copy of m_activeParticipatingElements since its contents
1626           can be modified in the loop.
1627
1628 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
1629
1630         AX: no accessibility support for details element
1631         https://bugs.webkit.org/show_bug.cgi?id=131111
1632
1633         Reviewed by Darin Adler.
1634
1635         Add accessibility support for Mac for details element by:
1636            1) Returning new subroles for <details> and <summary>
1637            2) Exposing isExpanded property for <details> element.
1638
1639         Test: platform/mac/accessibility/details-summary.html
1640
1641         * accessibility/AccessibilityObject.cpp:
1642         (WebCore::AccessibilityObject::supportsARIAPressed):
1643         (WebCore::AccessibilityObject::supportsExpanded):
1644         (WebCore::AccessibilityObject::isExpanded):
1645         (WebCore::AccessibilityObject::supportsARIAExpanded): Deleted.
1646         * accessibility/AccessibilityObject.h:
1647         (WebCore::AccessibilityObject::canvasHasFallbackContent):
1648         * accessibility/AccessibilityRenderObject.cpp:
1649         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1650         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1651         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1652         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
1653         (-[WebAccessibilityObjectWrapper accessibilityIsExpanded]):
1654         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1655         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1656         (createAccessibilityRoleMap):
1657         (-[WebAccessibilityObjectWrapper subrole]):
1658         * html/HTMLDetailsElement.h:
1659         * inspector/InspectorDOMAgent.cpp:
1660         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1661
1662 2015-06-15  Alex Christensen  <achristensen@webkit.org>
1663
1664         [Content Extensions] Limit number of rules.
1665         https://bugs.webkit.org/show_bug.cgi?id=145663
1666
1667         Reviewed by Benjamin Poulain.
1668
1669         Added an API test to make sure that parsing fails when there are too many rules.
1670
1671         * contentextensions/ContentExtensionError.cpp:
1672         (WebCore::ContentExtensions::contentExtensionErrorCategory):
1673         * contentextensions/ContentExtensionError.h:
1674         * contentextensions/ContentExtensionParser.cpp:
1675         (WebCore::ContentExtensions::loadEncodedRules):
1676         Fail to parse a content extension with more than 50000 rules.
1677
1678 2015-06-12  Alexey Proskuryakov  <ap@apple.com>
1679
1680         -[WKWebView evaluateJavaScript] provides a misleading error when the return cannot be serialized
1681         https://bugs.webkit.org/show_bug.cgi?id=145900
1682
1683         Reviewed by Sam Weinig.
1684
1685         * English.lproj/Localizable.strings:
1686
1687 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1688
1689         [SOUP] Custom URI schemes don't work for requests containing a fragment identifier
1690         https://bugs.webkit.org/show_bug.cgi?id=145969
1691
1692         Reviewed by Sergio Villar Senin.
1693
1694         For URIs like foo:bar#baz, what the custom protocol manager
1695         receives in the UI process is foo:bar, so the user can't handle fragments.
1696
1697         * platform/network/soup/ResourceRequestSoup.cpp:
1698         (WebCore::ResourceRequest::updateSoupRequest): If the SoupRequest
1699         is a WebKitSoupRequestGeneric, call
1700         webkitSoupRequestGenericSetRequest with the ResourceRequest.
1701         * platform/network/soup/WebKitSoupRequestGeneric.cpp:
1702         (webkitSoupRequestGenericSetRequest):
1703         (webkitSoupRequestGenericGetRequest):
1704         * platform/network/soup/WebKitSoupRequestGeneric.h:
1705
1706 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1707
1708         [SOUP] Move WebKitSoupRequestGeneric to platform layer
1709         https://bugs.webkit.org/show_bug.cgi?id=145968
1710
1711         Reviewed by Sergio Villar Senin.
1712
1713         * PlatformEfl.cmake:
1714         * PlatformGTK.cmake:
1715         * platform/network/soup/WebKitSoupRequestGeneric.cpp: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp.
1716         (webkitSoupRequestGenericFinalize):
1717         (webkit_soup_request_generic_init):
1718         (webkitSoupRequestGenericSendAsync):
1719         (webkitSoupRequestGenericSendFinish):
1720         (webkitSoupRequestGenericGetContentLength):
1721         (webkitSoupRequestGenericGetContentType):
1722         (webkit_soup_request_generic_class_init):
1723         (webkitSoupRequestGenericSetContentLength):
1724         (webkitSoupRequestGenericSetContentType):
1725         * platform/network/soup/WebKitSoupRequestGeneric.h: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.h.
1726         * platform/network/soup/WebKitSoupRequestGenericClient.h: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGenericClient.h.
1727
1728 2015-06-13  Chris Dumez  <cdumez@apple.com>
1729
1730         [WK2] API::Navigation objects are leaked on history navigation to HistoryItems in PageCache
1731         https://bugs.webkit.org/show_bug.cgi?id=145948
1732
1733         Reviewed by Darin Adler.
1734
1735         API::Navigation objects were leaked on history navigation to
1736         HistoryItems in PageCache. In such case, we would create 2 Navigation
1737         objects instead of 1 and the first one would be leaked. The reason
1738         we create the second one is because we fail to pass along the
1739         navigationID from the UIProcess to the WebProcess and then back to the
1740         UIProcess. On the IPC back to the UIProcess, the navigationID ends up
1741         being 0 so the UIProcess creates a new Navigation object, thinking that
1742         the load was triggered by the WebContent process.
1743
1744         We now pass along the navigationID, even if the HistoryItem is in the
1745         PageCache and we end up reusing the cached DocumentLoader, instead of
1746         creating a new one. A new updateCachedDocumentLoader() delegate is
1747         added to the FrameLoaderClient, similarly to the pre-existing
1748         createDocumentLoader() but for the case where the DocumentLoader gets
1749         reused.
1750
1751         * loader/EmptyClients.h:
1752         * loader/FrameLoader.cpp:
1753         (WebCore::FrameLoader::loadDifferentDocumentItem):
1754         * loader/FrameLoaderClient.h:
1755
1756 2015-06-13  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1757
1758         [Streams API] ReadableJSStream should handle promises returned by JS source start callback
1759         https://bugs.webkit.org/show_bug.cgi?id=145792
1760
1761         Reviewed by Darin Adler.
1762
1763         Covered by rebased tests.
1764
1765         When calling start callback, the returned value is checked.
1766         If it is not a promise, we do as if it is a resolved promise.
1767         If it is a promise, we call its then() method with two resolve/reject JS functions.
1768
1769         * Modules/streams/ReadableStream.cpp:
1770         * bindings/js/ReadableJSStream.cpp:
1771         (WebCore::ReadableJSStream::invoke): Returns a JSPromise* if any is returned by the JS source callback.
1772         (WebCore::thenPromise): Utility method to call the promise.
1773         (WebCore::createStartResultFulfilledFunction): The promise resolve callback.
1774         (WebCore::ReadableJSStream::doStart): Calls thenPromise if a JSPromise* is returned by invoke.
1775         (WebCore::ReadableJSStream::ReadableJSStream):
1776         * bindings/js/ReadableJSStream.h:
1777
1778 2015-06-13  Andres Gonzalez  <agonzalez334@nc.rr.com>
1779
1780         AX: WebKit exposes all Ruby Text as Unknown (Japanese EPUB accessibility blocker)
1781         https://bugs.webkit.org/show_bug.cgi?id=141303
1782
1783         Reviewed by Chris Fleizach.
1784
1785         Test: accessibility/ruby-hierarchy-roles.html
1786
1787         * accessibility/AccessibilityObject.h:
1788         * accessibility/AccessibilityRenderObject.cpp:
1789         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1790         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1791         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1792         (createAccessibilityRoleMap):
1793         (-[WebAccessibilityObjectWrapper subrole]):
1794
1795 2015-06-12  Chris Fleizach  <cfleizach@apple.com>
1796
1797         AX: iOS: after updating control, VoiceOver speaks aria-expanded states reversed (says "collapsed" when "expanded")
1798         https://bugs.webkit.org/show_bug.cgi?id=145943
1799
1800         Reviewed by Darin Adler.
1801
1802         iOS Accessibility platform needs to be notified of when aria expanded changes.
1803
1804         * accessibility/ios/AXObjectCacheIOS.mm:
1805         (WebCore::AXObjectCache::postPlatformNotification):
1806         * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
1807         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1808         (-[WebAccessibilityObjectWrapper postValueChangedNotification]):
1809         (-[WebAccessibilityObjectWrapper postExpandedChangedNotification]):
1810         (-[WebAccessibilityObjectWrapper postScrollStatusChangeNotification]):
1811
1812 2015-06-12  Chris Fleizach  <cfleizach@apple.com>
1813
1814         AX:ARIA Toggle buttons aren't properly conveyed on iOS using VoiceOver
1815         https://bugs.webkit.org/show_bug.cgi?id=145949
1816
1817         Reviewed by Darin Adler.
1818
1819         Expose pressed state information to the iOS platform AX API.
1820
1821         Test: Updated inspector-protocol/dom/getAccessibilityPropertiesForNode.html 
1822               There was a FIXME for this issue in that test: https://bugs.webkit.org/show_bug.cgi?id=129830
1823
1824         * accessibility/AccessibilityNodeObject.cpp:
1825         (WebCore::AccessibilityNodeObject::isPressed):
1826         * accessibility/AccessibilityObject.cpp:
1827         (WebCore::AccessibilityObject::classList):
1828         (WebCore::AccessibilityObject::supportsARIAPressed):
1829         (WebCore::AccessibilityObject::supportsARIAExpanded):
1830         * accessibility/AccessibilityObject.h:
1831         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1832         (-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionIsAtomic]):
1833         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAPressed]):
1834         (-[WebAccessibilityObjectWrapper accessibilityIsPressed]):
1835         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
1836
1837 2015-06-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1838
1839         Purge PassRefPtr in JavaScriptCore - 2
1840         https://bugs.webkit.org/show_bug.cgi?id=145834
1841
1842         Reviewed by Darin Adler.
1843
1844         Fix call sites depends on changing of JSC.
1845
1846         * html/canvas/WebGL2RenderingContext.cpp:
1847         (WebCore::WebGL2RenderingContext::getParameter):
1848         * html/canvas/WebGLRenderingContext.cpp:
1849         (WebCore::WebGLRenderingContext::getParameter):
1850         * html/canvas/WebGLRenderingContextBase.cpp:
1851         (WebCore::WebGLRenderingContextBase::getUniform):
1852         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
1853         (WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter):
1854         (WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter):
1855
1856 2015-06-12  Zalan Bujtas  <zalan@apple.com>
1857
1858         Be more defensive at renderer type checking when initializing flow segments.
1859         https://bugs.webkit.org/show_bug.cgi?id=145942
1860
1861         Reviewed by Simon Fraser.
1862
1863         FlowContents::initializeSegments should ignore unsupported renderers so that when we miss
1864         a simple line layout path invalidation, we don't downcast the unsupported renderer to RenderText.
1865
1866         I have not reproduced this issue (but related to rdar://problem/21312452)
1867
1868         * rendering/SimpleLineLayoutFlowContents.cpp:
1869         (WebCore::SimpleLineLayout::initializeSegments):
1870
1871 2015-06-12  Anders Carlsson  <andersca@apple.com>
1872
1873         deleteEmptyDirectory should delete .DS_Store files on OS X
1874         https://bugs.webkit.org/show_bug.cgi?id=145944
1875
1876         Reviewed by Dan Bernstein.
1877
1878         deleteEmptyDirectory is often used when clearing website data, so we should
1879         take extra care to delete empty directories so the user won't think that clearing
1880         website data didn't do anything because it would leave directories with .DS_Store 
1881         files behind.
1882
1883         * platform/mac/FileSystemMac.mm:
1884         (WebCore::deleteEmptyDirectory):
1885         * platform/posix/FileSystemPOSIX.cpp:
1886
1887 2015-06-12  Manuel Rego Casasnovas  <rego@igalia.com>
1888
1889         [CSS Grid Layout] Fix grid-template-areas parsing to avoid spaces
1890         https://bugs.webkit.org/show_bug.cgi?id=145860
1891
1892         Reviewed by Sergio Villar Senin.
1893
1894         The spec doesn't require to have spaces between unnamed and named areas
1895         in grid-template-areas syntax. But spaces are currently required in our
1896         code.
1897
1898         This was confirmed in the CSS WG mailing list:
1899         https://lists.w3.org/Archives/Public/www-style/2015May/0239.html
1900
1901         This patch updates grid-template-areas parsing to allow the possibility
1902         of removing spaces between unnamed and named areas.
1903
1904         Added new cases to fast/css-grid-layout/grid-template-areas-get-set.html.
1905
1906         * css/CSSParser.cpp:
1907         (WebCore::parseGridTemplateAreasColumnNames): New helper method to
1908         determine the column names split by white spaces or dots.
1909         (WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
1910         method to get the column names.
1911         (WebCore::containsOnlyDots): Deleted. Not needed anymore as
1912         parseGridTemplateAreasColumnNames() is using a single dot for unnamed
1913         grid areas (despite of being defined with 1 or more dots).
1914
1915 2015-06-12  Eric Carlson  <eric.carlson@apple.com>
1916
1917         [Mac] AirPlay menu button doesn't always show on page load
1918         https://bugs.webkit.org/show_bug.cgi?id=145936
1919
1920         Reviewed by Brent Fulgham.
1921
1922         * Modules/mediasession/WebMediaSessionManager.cpp:
1923         (WebCore::mediaProducerStateString): New, return a string representing MediaStateFlags.
1924         (WebCore::WebMediaSessionManager::clientStateDidChange): Log the states as strings.
1925         (WebCore::WebMediaSessionManager::toString): New, return a string representing ConfigurationTasks.
1926         (WebCore::WebMediaSessionManager::scheduleDelayedTask): Add logging.
1927         (WebCore::WebMediaSessionManager::taskTimerFired): Add logging.
1928         * Modules/mediasession/WebMediaSessionManager.h:
1929
1930         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: Override wirelessVideoPlaybackDisabled
1931           so it is possible to activate route monitoring for a movie loaded with this engine.
1932         * platform/graphics/mac/MediaPlayerPrivateQTKit.h: Ditto.
1933
1934 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
1935
1936         Add the remaining missing override specifiers under Source/WebCore/
1937         https://bugs.webkit.org/show_bug.cgi?id=145907
1938
1939         Reviewed by Darin Adler.
1940
1941         Fix the remaining compiler warnings about missing override specifiers
1942         for overriding method declarations in classes under Source/WebCore/.
1943
1944         Where the addition had to be performed on all virtual methods of the
1945         class, the virtual specifier was removed so now only the override
1946         specifier is in use.
1947
1948         * Modules/indexeddb/IDBOpenDBRequest.h:
1949         * Modules/indexeddb/IDBRequest.h:
1950         * Modules/webdatabase/DatabaseServer.h:
1951         * bindings/js/ReadableJSStream.h:
1952         * editing/InsertTextCommand.h:
1953         * mathml/MathMLInlineContainerElement.h:
1954         * platform/audio/EqualPowerPanner.h:
1955         (WebCore::EqualPowerPanner::reset):
1956         * platform/graphics/MediaPlayer.cpp:
1957         (WebCore::NullMediaPlayerPrivate::load):
1958         (WebCore::NullMediaPlayerPrivate::cancelLoad):
1959         (WebCore::NullMediaPlayerPrivate::prepareToPlay):
1960         (WebCore::NullMediaPlayerPrivate::play):
1961         (WebCore::NullMediaPlayerPrivate::pause):
1962         (WebCore::NullMediaPlayerPrivate::platformMedia):
1963         (WebCore::NullMediaPlayerPrivate::platformLayer):
1964         (WebCore::NullMediaPlayerPrivate::naturalSize):
1965         (WebCore::NullMediaPlayerPrivate::hasVideo):
1966         (WebCore::NullMediaPlayerPrivate::hasAudio):
1967         (WebCore::NullMediaPlayerPrivate::setVisible):
1968         (WebCore::NullMediaPlayerPrivate::durationDouble):
1969         (WebCore::NullMediaPlayerPrivate::currentTimeDouble):
1970         (WebCore::NullMediaPlayerPrivate::seekDouble):
1971         (WebCore::NullMediaPlayerPrivate::seeking):
1972         (WebCore::NullMediaPlayerPrivate::setRateDouble):
1973         (WebCore::NullMediaPlayerPrivate::setPreservesPitch):
1974         (WebCore::NullMediaPlayerPrivate::paused):
1975         (WebCore::NullMediaPlayerPrivate::setVolumeDouble):
1976         (WebCore::NullMediaPlayerPrivate::supportsMuting):
1977         (WebCore::NullMediaPlayerPrivate::setMuted):
1978         (WebCore::NullMediaPlayerPrivate::hasClosedCaptions):
1979         (WebCore::NullMediaPlayerPrivate::setClosedCaptionsVisible):
1980         (WebCore::NullMediaPlayerPrivate::networkState):
1981         (WebCore::NullMediaPlayerPrivate::readyState):
1982         (WebCore::NullMediaPlayerPrivate::maxTimeSeekableDouble):
1983         (WebCore::NullMediaPlayerPrivate::minTimeSeekable):
1984         (WebCore::NullMediaPlayerPrivate::buffered):
1985         (WebCore::NullMediaPlayerPrivate::totalBytes):
1986         (WebCore::NullMediaPlayerPrivate::didLoadingProgress):
1987         (WebCore::NullMediaPlayerPrivate::setSize):
1988         (WebCore::NullMediaPlayerPrivate::canLoadPoster):
1989         (WebCore::NullMediaPlayerPrivate::setPoster):
1990         (WebCore::NullMediaPlayerPrivate::hasSingleSecurityOrigin):
1991         * platform/graphics/filters/DistantLightSource.h:
1992         * platform/graphics/filters/FEComposite.h:
1993         * platform/graphics/filters/FEDisplacementMap.h:
1994         (WebCore::FEDisplacementMap::determineAbsolutePaintRect):
1995         * platform/graphics/filters/FEFlood.h:
1996         (WebCore::FEFlood::determineAbsolutePaintRect):
1997         * platform/graphics/filters/PointLightSource.h:
1998         * platform/graphics/filters/SpotLightSource.h:
1999         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2000         (WebCore::MediaPlayerPrivateGStreamer::hasVideo):
2001         (WebCore::MediaPlayerPrivateGStreamer::hasAudio):
2002         (WebCore::MediaPlayerPrivateGStreamer::audioSourceProvider):
2003         (WebCore::MediaPlayerPrivateGStreamer::engineDescription):
2004         (WebCore::MediaPlayerPrivateGStreamer::isLiveStream):
2005         (WebCore::MediaPlayerPrivateGStreamer::totalVideoFrames):
2006         (WebCore::MediaPlayerPrivateGStreamer::droppedVideoFrames):
2007         (WebCore::MediaPlayerPrivateGStreamer::corruptedVideoFrames):
2008         (WebCore::MediaPlayerPrivateGStreamer::totalFrameDelay):
2009         * platform/graphics/texmap/BitmapTextureGL.h:
2010         (WebCore::BitmapTextureGL::isBackedByOpenGL):
2011         * platform/graphics/transforms/Matrix3DTransformOperation.h:
2012         * platform/graphics/transforms/MatrixTransformOperation.h:
2013         * platform/graphics/transforms/PerspectiveTransformOperation.h:
2014         * platform/graphics/transforms/RotateTransformOperation.h:
2015         * platform/graphics/transforms/ScaleTransformOperation.h:
2016         * platform/graphics/transforms/SkewTransformOperation.h:
2017         * platform/image-decoders/png/PNGImageDecoder.h:
2018         (WebCore::PNGImageDecoder::filenameExtension):
2019         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
2020         * platform/mock/MockRealtimeMediaSourceCenter.h:
2021
2022 2015-06-12  Commit Queue  <commit-queue@webkit.org>
2023
2024         Unreviewed, rolling out r185512.
2025         https://bugs.webkit.org/show_bug.cgi?id=145932
2026
2027         Many asserts on layout tests and on API tests (Requested by
2028         ap_ on #webkit).
2029
2030         Reverted changeset:
2031
2032         "Use modern for-loops in WebCore/rendering - 1"
2033         https://bugs.webkit.org/show_bug.cgi?id=145831
2034         http://trac.webkit.org/changeset/185512
2035
2036 2015-06-12  Simon Fraser  <simon.fraser@apple.com>
2037
2038         OpenGLESSPI.h doesn't need to include UIKit.h
2039         https://bugs.webkit.org/show_bug.cgi?id=145931
2040
2041         Reviewed by Darin Adler.
2042
2043         No need to suck in all of UIKit from OpenGLESSPI.h.
2044
2045         * platform/spi/ios/OpenGLESSPI.h:
2046
2047 2015-06-12  Matt Rajca  <mrajca@apple.com>
2048
2049         Add barebones implementation of media session invocation algorithm.
2050         https://bugs.webkit.org/show_bug.cgi?id=145847
2051
2052         Reviewed by Darin Adler.
2053
2054         * Modules/mediasession/MediaSession.cpp:
2055         (WebCore::MediaSession::invoke): Move the media session to an active state.
2056         * Modules/mediasession/MediaSession.h:
2057         * html/HTMLMediaElement.cpp:
2058         (WebCore::HTMLMediaElement::playInternal): Call the media session invocation algorithm as described in the
2059           Media Session spec.
2060
2061 2015-06-12  Hunseop Jeong  <hs85.jeong@samsung.com>
2062
2063         Use modern for-loops in WebCore/rendering - 1
2064         https://bugs.webkit.org/show_bug.cgi?id=145831
2065
2066         Reviewed by Darin Adler.
2067
2068         No new tests because there is no behavior change.
2069
2070         * rendering/AutoTableLayout.cpp:
2071         (WebCore::AutoTableLayout::computeIntrinsicLogicalWidths):
2072         (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
2073         * rendering/FilterEffectRenderer.cpp:
2074         (WebCore::FilterEffectRenderer::build):
2075         (WebCore::FilterEffectRenderer::clearIntermediateResults):
2076         * rendering/FilterEffectRenderer.h:
2077         * rendering/FloatingObjects.cpp:
2078         (WebCore::FloatingObjects::clearLineBoxTreePointers):
2079         (WebCore::FloatingObjects::moveAllToFloatInfoMap):
2080         (WebCore::FloatingObjects::computePlacedFloatsTree):
2081         * rendering/FlowThreadController.cpp:
2082         (WebCore::FlowThreadController::collectFixedPositionedLayers):
2083         * rendering/HitTestResult.cpp:
2084         (WebCore::HitTestResult::append):
2085         * rendering/ImageQualityController.cpp:
2086         (WebCore::ImageQualityController::highQualityRepaintTimerFired):
2087         * rendering/InlineTextBox.cpp:
2088         (WebCore::InlineTextBox::paint):
2089         * rendering/RenderBlock.cpp:
2090         (WebCore::removeBlockFromDescendantAndContainerMaps):
2091         (WebCore::RenderBlock::addOverflowFromPositionedObjects):
2092         (WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants):
2093         (WebCore::RenderBlock::simplifiedNormalFlowLayout):
2094         (WebCore::RenderBlock::layoutPositionedObjects):
2095         (WebCore::RenderBlock::markPositionedObjectsForLayout):
2096         (WebCore::RenderBlock::paintContinuationOutlines):
2097         (WebCore::clipOutPositionedObjects):
2098         (WebCore::RenderBlock::removeFromTrackedRendererMaps):
2099         (WebCore::RenderBlock::removePositionedObjects):
2100         (WebCore::RenderBlock::checkPositionedObjectsNeedLayout):
2101         * rendering/RenderBlockFlow.cpp:
2102         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
2103         (WebCore::RenderBlockFlow::styleDidChange):
2104         (WebCore::RenderBlockFlow::moveFloatsTo):
2105         (WebCore::RenderBlockFlow::addOverflowFromFloats):
2106         (WebCore::RenderBlockFlow::repaintOverhangingFloats):
2107         (WebCore::RenderBlockFlow::paintFloats):
2108         (WebCore::RenderBlockFlow::clipOutFloatingObjects):
2109         (WebCore::RenderBlockFlow::lowestFloatLogicalBottom):
2110         (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom):
2111         (WebCore::RenderBlockFlow::addOverhangingFloats):
2112         (WebCore::RenderBlockFlow::addIntrudingFloats):
2113         (WebCore::RenderBlockFlow::markSiblingsWithFloatsForLayout):
2114         (WebCore::RenderBlockFlow::adjustForBorderFit):
2115         * rendering/RenderBlockLineLayout.cpp:
2116         (WebCore::setLogicalWidthForTextRun):
2117         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
2118         (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
2119         (WebCore::RenderBlockFlow::repaintDirtyFloats):
2120         (WebCore::RenderBlockFlow::layoutLineBoxes):
2121         (WebCore::RenderBlockFlow::checkFloatsInCleanLine):
2122         (WebCore::RenderBlockFlow::determineStartPosition):
2123         (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
2124         * rendering/RenderCounter.cpp:
2125         (WebCore::RenderCounter::destroyCounterNodes):
2126         (WebCore::updateCounters):
2127         (WebCore::RenderCounter::rendererStyleChanged):
2128         * rendering/RenderFlexibleBox.cpp:
2129         (WebCore::RenderFlexibleBox::autoMarginOffsetInMainAxis):
2130         (WebCore::RenderFlexibleBox::freezeViolations):
2131         (WebCore::RenderFlexibleBox::resolveFlexibleLengths):
2132         (WebCore::RenderFlexibleBox::numberOfInFlowPositionedChildren):
2133         (WebCore::RenderFlexibleBox::layoutColumnReverse):
2134         (WebCore::RenderFlexibleBox::alignFlexLines):
2135         (WebCore::RenderFlexibleBox::alignChildren):
2136         (WebCore::RenderFlexibleBox::flipForWrapReverse):
2137         * rendering/RenderFlowThread.cpp:
2138         (WebCore::RenderFlowThread::updateAllLayerToRegionMappings):
2139         * rendering/RenderInline.cpp:
2140         (WebCore::RenderInline::addAnnotatedRegions):
2141         * rendering/RenderLayer.cpp:
2142         (WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrder):
2143         (WebCore::RenderLayer::updateDescendantDependentFlags):
2144         * rendering/RenderLayerBacking.cpp:
2145         (WebCore::descendantLayerPaintsIntoAncestor):
2146         (WebCore::RenderLayerBacking::startAnimation):
2147         * rendering/RenderLineBoxList.cpp:
2148         (WebCore::RenderLineBoxList::paint):
2149         * rendering/RenderListBox.cpp:
2150         (WebCore::RenderListBox::updateFromElement):
2151         * rendering/RenderMenuList.cpp:
2152         (WebCore::selectedOptionCount):
2153         (RenderMenuList::updateOptionsWidth):
2154         * rendering/RenderMultiColumnSet.cpp:
2155         (WebCore::RenderMultiColumnSet::distributeImplicitBreaks):
2156
2157 2015-06-12  Csaba Osztrogonác  <ossy@webkit.org>
2158
2159         Fix unused private field warning in ResourceHandleSoup.cpp
2160         https://bugs.webkit.org/show_bug.cgi?id=145910
2161
2162         Reviewed by Darin Adler.
2163
2164         * platform/network/soup/ResourceHandleSoup.cpp:
2165
2166 2015-06-12  Joseph Pecoraro  <pecoraro@apple.com>
2167
2168         Web Inspector: CRASH trying to inspect text that was removed/replaced
2169         https://bugs.webkit.org/show_bug.cgi?id=145898
2170
2171         Reviewed by Darin Adler.
2172
2173         * inspector/InspectorDOMAgent.cpp:
2174         (WebCore::InspectorDOMAgent::inspect):
2175         (WebCore::InspectorDOMAgent::focusNode):
2176         Ensure we only cause focusNode with a node to focus. If the original
2177         node that was provided is no longer in the document, then we won't
2178         actually find a node to inspect.
2179
2180 2015-06-12  KwangHyuk Kim  <hyuki.kim@samsung.com>
2181
2182         [EFL] canvas/philip/tests/toDataURL.jpeg.foo tests have been failed since r185417.
2183         https://bugs.webkit.org/show_bug.cgi?id=145878
2184
2185         Reviewed by Gyuyoung Kim.
2186
2187         Fix input buffer alignment issue.
2188
2189         No new tests, canvas/philip/tests/toDataURL.jpeg.foo can be used.
2190
2191         * platform/graphics/efl/ImageBufferEfl.cpp:
2192         (WebCore::encodeImagePNG):
2193         (WebCore::encodeImageJPEG):
2194         (WebCore::ImageBuffer::toDataURL):
2195
2196 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
2197
2198         Add missing override specifiers under Source/WebCore/svg/
2199         https://bugs.webkit.org/show_bug.cgi?id=145841
2200
2201         Reviewed by Darin Adler.
2202
2203         Add missing override specifiers to virtual method overrides for classes
2204         under Source/WebCore/svg/, suppressing a bunch of warnings when compiling
2205         with Clang 3.6.
2206
2207         Add the BEGIN_DECLARE_ANIMATED_PROPERTIES_BASE() macro that doesn't
2208         override the localAttributeToPropertyMap() method declaration, and
2209         have the BEGIN_DECLARE_ANIMATED_PROPERTIES() macro add the override
2210         specifier. The new macro is used in SVGElement.
2211
2212         Change the DECLARE_ANIMATED_PROPERTY() to accept the optional override
2213         specifier as the fifth parameter. Current DECLARE_ANIMATED_*() macros
2214         are modified to just pass an empty argument, not adding any specifier.
2215         DECLARE_ANIMATED_BOOLEAN_OVERRIDE() and DECLARE_ANIMATED_STRING_OVERRIDE()
2216         macros are added to override the methods for the externalResourcesRequired
2217         and href animated properties, where required.
2218
2219         * svg/SVGAElement.h:
2220         * svg/SVGAltGlyphElement.h:
2221         * svg/SVGAnimatedAngle.h:
2222         * svg/SVGAnimatedBoolean.h:
2223         * svg/SVGAnimatedEnumeration.h:
2224         * svg/SVGAnimatedInteger.h:
2225         * svg/SVGAnimatedLength.h:
2226         * svg/SVGAnimatedNumber.h:
2227         * svg/SVGAnimatedPreserveAspectRatio.h:
2228         * svg/SVGAnimatedRect.h:
2229         * svg/SVGAnimatedString.h:
2230         * svg/SVGAnimationElement.h:
2231         * svg/SVGCircleElement.h:
2232         * svg/SVGClipPathElement.h:
2233         * svg/SVGCursorElement.h:
2234         * svg/SVGDefsElement.h:
2235         * svg/SVGElement.h:
2236         * svg/SVGEllipseElement.h:
2237         * svg/SVGFEImageElement.h:
2238         * svg/SVGFilterElement.h:
2239         * svg/SVGFontElement.h:
2240         * svg/SVGForeignObjectElement.h:
2241         * svg/SVGGElement.h:
2242         * svg/SVGGlyphRefElement.h:
2243         * svg/SVGGradientElement.h:
2244         * svg/SVGImageElement.h:
2245         * svg/SVGLineElement.h:
2246         * svg/SVGMPathElement.h:
2247         * svg/SVGMarkerElement.h:
2248         * svg/SVGMaskElement.h:
2249         * svg/SVGPathElement.h:
2250         * svg/SVGPatternElement.h:
2251         * svg/SVGPolyElement.h:
2252         * svg/SVGRectElement.h:
2253         * svg/SVGSVGElement.h:
2254         * svg/SVGScriptElement.h:
2255         * svg/SVGSwitchElement.h:
2256         * svg/SVGSymbolElement.h:
2257         * svg/SVGTRefElement.h:
2258         * svg/SVGTextContentElement.h:
2259         * svg/SVGTextPathElement.h:
2260         * svg/SVGURIReference.h: Add the hrefBaseValue() pure virtual method
2261         so it can be overridden by any class that also overrides the
2262         corresponding setHrefBaseValue() method.
2263         * svg/SVGUseElement.h:
2264         * svg/SVGViewElement.h:
2265         * svg/properties/SVGAnimatedPropertyMacros.h:
2266         * svg/properties/SVGMatrixTearOff.h:
2267         (WebCore::SVGMatrixTearOff::commitChange):
2268
2269 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
2270
2271         [GLib] Move files under Source/WTF/wtf/gobject to Source/WTF/wtf/glib
2272         https://bugs.webkit.org/show_bug.cgi?id=145799
2273
2274         Reviewed by Carlos Garcia Campos.
2275
2276         Update header inclusions for headers that have been moved
2277         to Source/WTF/wtf/glib/.
2278
2279         * accessibility/atk/AXObjectCacheAtk.cpp:
2280         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2281         * bindings/gobject/DOMObjectCache.cpp:
2282         * bindings/gobject/GObjectEventListener.h:
2283         * bindings/gobject/GObjectNodeFilterCondition.h:
2284         * bindings/gobject/GObjectXPathNSResolver.h:
2285         * bindings/gobject/WebKitDOMEventTarget.cpp:
2286         * platform/Pasteboard.h:
2287         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
2288         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
2289         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
2290         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
2291         * platform/audio/gtk/AudioBusGtk.cpp:
2292         * platform/geoclue/GeolocationProviderGeoclue.h:
2293         * platform/geoclue/GeolocationProviderGeoclue2.cpp:
2294         * platform/glib/BatteryProviderUPower.cpp:
2295         * platform/glib/BatteryProviderUPower.h:
2296         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
2297         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
2298         * platform/graphics/gstreamer/GUniquePtrGStreamer.h:
2299         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
2300         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2301         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2302         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2303         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2304         * platform/graphics/gstreamer/MediaSourceGStreamer.cpp:
2305         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
2306         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
2307         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
2308         * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp:
2309         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2310         * platform/graphics/gtk/ImageBufferGtk.cpp:
2311         * platform/graphics/gtk/ImageGtk.cpp:
2312         * platform/gtk/ContextMenuGtk.cpp:
2313         * platform/gtk/ContextMenuItemGtk.cpp:
2314         * platform/gtk/DataObjectGtk.cpp:
2315         * platform/gtk/DataObjectGtk.h:
2316         * platform/gtk/FileSystemGtk.cpp:
2317         * platform/gtk/GRefPtrGtk.h:
2318         * platform/gtk/GUniquePtrGtk.h:
2319         * platform/gtk/GamepadsGtk.cpp:
2320         * platform/gtk/GtkUtilities.cpp:
2321         * platform/gtk/LanguageGtk.cpp:
2322         * platform/gtk/LocalizedStringsGtk.cpp:
2323         * platform/gtk/PasteboardHelper.cpp:
2324         * platform/gtk/ScrollbarThemeGtk.cpp:
2325         * platform/gtk/SharedBufferGtk.cpp:
2326         * platform/gtk/SharedTimerGtk.cpp:
2327         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
2328         * platform/network/ResourceHandleInternal.h:
2329         * platform/network/gtk/CredentialBackingStore.cpp:
2330         * platform/network/soup/CertificateInfo.h:
2331         * platform/network/soup/CookieJarSoup.cpp:
2332         * platform/network/soup/DNSSoup.cpp:
2333         * platform/network/soup/GRefPtrSoup.h:
2334         * platform/network/soup/GUniquePtrSoup.h:
2335         * platform/network/soup/ResourceError.h:
2336         * platform/network/soup/ResourceErrorSoup.cpp:
2337         * platform/network/soup/ResourceHandleSoup.cpp:
2338         * platform/network/soup/ResourceResponse.h:
2339         * platform/network/soup/SocketStreamHandle.h:
2340         * platform/network/soup/SocketStreamHandleSoup.cpp:
2341         * platform/network/soup/SoupNetworkSession.h:
2342         * platform/text/gtk/HyphenationLibHyphen.cpp:
2343         * rendering/RenderThemeGtk.cpp:
2344
2345 2015-06-12  Yoav Weiss  <yoav@yoav.ws>
2346
2347         Fix the build when the PICTURE_SIZES flag is off
2348         https://bugs.webkit.org/show_bug.cgi?id=145926
2349
2350         Reviewed by Csaba Osztrogonác.
2351
2352         No new tests since there's no functionality change.
2353
2354         * html/parser/HTMLPreloadScanner.cpp: Remove the guard around the definition of m_sizesAttribute.
2355
2356 2015-06-12  Commit Queue  <commit-queue@webkit.org>
2357
2358         Unreviewed, rolling out r185492.
2359         https://bugs.webkit.org/show_bug.cgi?id=145927
2360
2361         Causes crashes on debug (Requested by rego on #webkit).
2362
2363         Reverted changeset:
2364
2365         "[CSS Grid Layout] Fix grid-template-areas parsing to avoid
2366         spaces"
2367         https://bugs.webkit.org/show_bug.cgi?id=145860
2368         http://trac.webkit.org/changeset/185492
2369
2370 2015-06-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2371
2372         Bindings generator should generate code for Promise-based APIs
2373         https://bugs.webkit.org/show_bug.cgi?id=145833
2374
2375         Reviewed by Darin Adler.
2376
2377         Covered by existing tests.
2378
2379         * Modules/webaudio/AudioContext.idl: Removing custom binding for resume, suspend and close.
2380         * bindings/js/JSAudioContextCustom.cpp: Ditto.
2381         * bindings/scripts/CodeGeneratorJS.pm:
2382         (GenerateHeader): Refactoring to use IsReturningPromise.
2383         (GenerateImplementation): Disabling include for return type if it is a promise.
2384         (GenerateParametersCheck): Adding DeferredWrapper() as argument to the DOM method if JS method returns a promise.
2385         (GenerateImplementationFunctionCall): Added support for promise-returning API.
2386         (IsReturningPromise): Checking whether function is returning a promise.
2387         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2388         (webkit_dom_test_obj_test_promise_function):
2389         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2390         * bindings/scripts/test/JS/JSTestObj.cpp:
2391         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
2392         * bindings/scripts/test/ObjC/DOMTestObj.h:
2393         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2394         (-[DOMTestObj testPromiseFunction]):
2395         * bindings/scripts/test/TestObj.idl: Adding promise returning function.
2396
2397
2398 2015-06-12  Manuel Rego Casasnovas  <rego@igalia.com>
2399
2400         [CSS Grid Layout] Fix grid-template-areas parsing to avoid spaces
2401         https://bugs.webkit.org/show_bug.cgi?id=145860
2402
2403         Reviewed by Sergio Villar Senin.
2404
2405         The spec doesn't require to have spaces between unnamed and named areas
2406         in grid-template-areas syntax. But spaces are currently required in our
2407         code.
2408
2409         This was confirmed in the CSS WG mailing list:
2410         https://lists.w3.org/Archives/Public/www-style/2015May/0239.html
2411
2412         This patch updates grid-template-areas parsing to allow the possibility
2413         of removing spaces between unnamed and named areas.
2414
2415         Added new cases to fast/css-grid-layout/grid-template-areas-get-set.html.
2416
2417         * css/CSSParser.cpp:
2418         (WebCore::parseGridTemplateAreasColumnNames): New helper method to
2419         determine the column names split by white spaces or dots.
2420         (WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
2421         method to get the column names.
2422         (WebCore::containsOnlyDots): Deleted. Not needed anymore as
2423         parseGridTemplateAreasColumnNames() is using a single dot for unnamed
2424         grid areas (despite of being defined with 1 or more dots).
2425
2426 2015-06-11  Mark Lam  <mark.lam@apple.com>
2427
2428         WebCore::reportException() needs to be able to accept a raw thrown value in addition to Exception objects.
2429         https://bugs.webkit.org/show_bug.cgi?id=145872
2430
2431         Reviewed by Michael Saboff.
2432
2433         API test added: WebKit1.ReportExceptionTest.
2434
2435         * bindings/js/JSDOMBinding.cpp:
2436         (WebCore::reportException):
2437         - Added a version of reportException() that takes a JSValue instead of an Exception
2438           object.  This version will ensure that we have an Exception object before calling
2439           into the original reportException() as follows:
2440
2441           1. If the JSValue is already an Exception object, we're good to go.
2442
2443           2. Else, if VM::lastException() is available, use that as the exception.
2444              This is how the old code use to behave (in terms of where it gets the exception
2445              stack trace).  The assumption is that reportException() will be called in
2446              a timely manner before the exception stack trace has been purged.
2447
2448           3. Else, create an Exception object with no stack trace.  This is the fall back
2449              in case the client did not call reportException() in a timely manner.
2450
2451         - Also clear the last exception after we've reported it.  This is how the old code
2452           before r185259 behave (in terms of the lifecycle of the last exception stack
2453           trace).  We're restoring that behavior here.
2454
2455         * bindings/js/JSDOMBinding.h:
2456
2457 2015-06-11  Zalan Bujtas  <zalan@apple.com>
2458
2459         Do not crash when the descendant frame tree is destroyed during layout.
2460         https://bugs.webkit.org/show_bug.cgi?id=144540
2461         rdar://problem/20793184
2462
2463         Reviewed by Andreas Kling.
2464
2465         Widget::setFrameRect(), through WebHTMLView layout, could trigger a style recalc, which in turn
2466         could initiate an onBeforeLoad callback.
2467         If javascript happens to destroy the current iframe in the onBeforeLoad callback, we lose the descendant
2468         render tree, including the child FrameView (the iframe element's view). However the RenderIFrame
2469         object stays protected until after the layout is done. (see protectRenderWidgetUntilLayoutIsDone())
2470
2471         Climbing back on the callstack, we need to make sure that
2472         1. the root widget of the descendant render tree (FrameView) stays valid as long as it is needed.
2473         2. RenderFrameBase::layoutWithFlattening() can handle the case when the associated widget (child FrameView) is set to nullptr.
2474         (see RenderWidget::willBeDestroyed() -> setWidget(nullptr))
2475
2476         (and later, when layout is finished this (RenderIFrame) object gets destroyed too.)
2477
2478         Covered by fast/frames/flattening/crash-remove-iframe-during-object-beforeload.html.
2479
2480         * page/FrameView.cpp:
2481         (WebCore::FrameView::setFrameRect):
2482         (WebCore::FrameView::updateEmbeddedObject):
2483         (WebCore::FrameView::updateWidgetPositions):
2484         * platform/ScrollView.cpp:
2485         (WebCore::ScrollView::setFrameRect):
2486         * platform/mac/WidgetMac.mm:
2487         (WebCore::Widget::setFrameRect):
2488         * rendering/RenderFrameBase.cpp:
2489         (WebCore::RenderFrameBase::layoutWithFlattening):
2490         (WebCore::RenderFrameBase::childRenderView):
2491         (WebCore::RenderFrameBase::peformLayoutWithFlattening):
2492         * rendering/RenderFrameBase.h:
2493         * rendering/RenderWidget.cpp:
2494         (WebCore::RenderWidget::updateWidgetPosition):
2495         * rendering/RenderWidget.h:
2496
2497 2015-06-11  Commit Queue  <commit-queue@webkit.org>
2498
2499         Unreviewed, rolling out r185470.
2500         https://bugs.webkit.org/show_bug.cgi?id=145902
2501
2502         Caused ASan violations (Requested by ap on #webkit).
2503
2504         Reverted changeset:
2505
2506         "Add an appearance keyword for wireless playback / airplay
2507         icon"
2508         https://bugs.webkit.org/show_bug.cgi?id=145892
2509         http://trac.webkit.org/changeset/185470
2510
2511 2015-06-11  Brady Eidson  <beidson@apple.com>
2512
2513         IndexedDB onupgradeneeded event has incorrect value for oldVersion.
2514         <rdar://problem/18309792> and https://bugs.webkit.org/show_bug.cgi?id=136888
2515
2516         Reviewed by Sam Weinig.
2517
2518         Test: storage/indexeddb/version-change-event-basic.html
2519
2520         "NoIntVersion" is an internal bookkeeping concept that we never should've been passing to Javascript.
2521         
2522         This cleans up things by:
2523         - Adjusting an old version of "NoIntVersion" to "0" before making the version change callback.
2524         - Removing the VersionNullness parameter from almost everywhere.
2525         - Removing the nullability of the newVersion parameter from the IDL.
2526
2527         * Modules/indexeddb/IDBDatabase.cpp:
2528         (WebCore::IDBDatabase::onVersionChange):
2529         * Modules/indexeddb/IDBDatabase.h:
2530         
2531         * Modules/indexeddb/IDBDatabaseBackend.cpp:
2532         (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction):
2533         (WebCore::IDBDatabaseBackend::deleteDatabase):
2534         
2535         * Modules/indexeddb/IDBDatabaseCallbacks.h:
2536         * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
2537         (WebCore::IDBDatabaseCallbacksImpl::onVersionChange):
2538         * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
2539         
2540         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2541         (WebCore::IDBOpenDBRequest::onBlocked):
2542         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
2543         
2544         * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
2545         (WebCore::IDBDatabaseBackend::VersionChangeOperation::perform):
2546         
2547         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
2548         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
2549         * Modules/indexeddb/IDBVersionChangeEvent.h:
2550         (WebCore::IDBVersionChangeEvent::create):
2551         (WebCore::IDBVersionChangeEvent::newVersion):
2552         * Modules/indexeddb/IDBVersionChangeEvent.idl:
2553
2554 2015-06-11  Matt Rajca  <mrajca@apple.com>
2555
2556         Media Session: Add plumbing for media control event delivery.
2557         https://bugs.webkit.org/show_bug.cgi?id=145859
2558
2559         Reviewed by Anders Carlsson.
2560
2561         * Modules/mediasession/MediaEventTypes.h: Added.
2562         * WebCore.xcodeproj/project.pbxproj:
2563         * page/Page.cpp:
2564         (WebCore::Page::handleMediaEvent): Toggle media playback upon receiving the PlayPause event as described in the spec.
2565         * page/Page.h:
2566
2567 2015-06-11  Jon Lee  <jonlee@apple.com>
2568
2569         Update media controls JS and CSS to use picture-in-picture
2570         https://bugs.webkit.org/show_bug.cgi?id=145827
2571         <rdar://problem/21311576>
2572
2573         Reviewed by Dean Jackson.
2574
2575         * English.lproj/mediaControlsLocalizedStrings.js: Update localized strings.
2576         Add a string for the placeholder text, and for the aria-label of the
2577         placard.
2578
2579         * Modules/mediacontrols/MediaControlsHost.idl: Remove uncalled functions.
2580         * Modules/mediacontrols/MediaControlsHost.h: Also remove optimizedFullscreenSupported(),
2581         which was never used.
2582         * Modules/mediacontrols/MediaControlsHost.cpp: Remove uncalled functions and media part IDs.
2583         (WebCore::MediaControlsHost::enterFullscreenOptimized): Deleted.
2584         (WebCore::MediaControlsHost::mediaUIImageData): Deleted.
2585
2586         * Modules/mediacontrols/mediaControlsApple.css:
2587         (audio::-webkit-media-controls-picture-in-picture-button): Update pseudo-element name.
2588         (audio::-webkit-media-controls-optimized-fullscreen-button): Deleted.
2589         * Modules/mediacontrols/mediaControlsApple.js: Update global variable name, and classes.
2590         (Controller.prototype.createControls): Update button name. Add aria-label to the placeholder.
2591         (Controller.prototype.updateFullscreenButtons):
2592         (Controller.prototype.updateLayoutForDisplayedWidth):
2593         (Controller.prototype.handlePictureInPictureButtonClicked): Update handler names.
2594         (Controller.prototype.handleOptimizedFullscreenButtonClicked): Deleted.
2595
2596         * Modules/mediacontrols/mediaControlsiOS.css: Rename pseudo-element.
2597         (audio::-webkit-media-controls-picture-in-picture-button): Add mask images.
2598         (audio::-webkit-media-controls-picture-in-picture-button:active):
2599         (video::-webkit-media-controls-picture-in-picture-button):
2600         (video::-webkit-media-controls-picture-in-picture-button.return-from-picture-in-picture):
2601         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
2602         (audio::-webkit-media-controls-wireless-playback-text-top.picture-in-picture):
2603         (audio::-webkit-media-controls-wireless-playback-text-bottom.picture-in-picture):
2604         (audio::-webkit-media-controls-optimized-fullscreen-button): Deleted.
2605         (audio::-webkit-media-controls-optimized-fullscreen-button:active): Deleted.
2606         (video::-webkit-media-controls-optimized-fullscreen-button): Deleted.
2607         (audio::-webkit-media-controls-wireless-playback-status.optimized): Deleted. The placard
2608         pseudo-element should be updated from wireless-playback-status to just playback-status
2609         since it serves both for pip and AirPlay.
2610         (audio::-webkit-media-controls-wireless-playback-text-top.optimized): Deleted.
2611         (audio::-webkit-media-controls-wireless-playback-text-bottom.optimized): Deleted.
2612         * Modules/mediacontrols/mediaControlsiOS.js:
2613         (ControllerIOS.prototype.createControls): Update button names.
2614         (ControllerIOS.prototype.configureInlineControls):
2615         (ControllerIOS.prototype.handlePictureInPictureButtonClicked): Update handler name.
2616         (ControllerIOS.prototype.handlePictureInPictureTouchStart):
2617         (ControllerIOS.prototype.handlePictureInPictureTouchEnd):
2618         (ControllerIOS.prototype.handlePictureInPictureTouchCancel):
2619         (ControllerIOS.prototype.handlePresentationModeChange): Remove changes to the inline bg
2620         image style, and rely on the CSS to fill those in. Use localized strings for the placard.
2621         Move the aria-label to createControls().
2622         (ControllerIOS.prototype.handleOptimizedFullscreenButtonClicked): Deleted.
2623         (ControllerIOS.prototype.handleOptimizedFullscreenTouchStart): Deleted.
2624         (ControllerIOS.prototype.handleOptimizedFullscreenTouchEnd): Deleted.
2625         (ControllerIOS.prototype.handleOptimizedFullscreenTouchCancel): Deleted.
2626
2627         * html/HTMLMediaElement.cpp: Remove enterFullscreenOptimized since it is never called.
2628         (WebCore::HTMLMediaElement::enterFullscreenOptimized): Deleted.
2629         * html/HTMLMediaElement.h:
2630         * platform/ios/WebCoreSystemInterfaceIOS.h: Remove wkGetMediaUIImageData.
2631         * platform/ios/WebCoreSystemInterfaceIOS.mm:
2632         * rendering/RenderThemeIOS.mm:
2633         (WebCore::RenderThemeIOS::mediaControlsStyleSheet): Remove calls to wkGetMediaUIImageData.
2634
2635 2015-06-11  Dean Jackson  <dino@apple.com>
2636
2637         Add an appearance keyword for wireless playback / airplay icon
2638         https://bugs.webkit.org/show_bug.cgi?id=145892
2639         <rdar://problem/21344872>
2640
2641         Reviewed by Simon Fraser.
2642
2643         Add a new "-webkit-appearance" value named "-apple-airplay"
2644         which will be used to render an icon. This change simply
2645         adds support for the value, and puts in hooks for drawing.
2646
2647         At the moment this is only going to be used by Airplay, so
2648         the public-facing name is "-apple-airplay". However, the
2649         implementation in Theme has a more generic name, in case
2650         we hook it up for other ports later.
2651
2652         Test: fast/css/appearance-airplay.html
2653
2654         * css/CSSParser.cpp:
2655         (WebCore::cssValueKeywordID): This new keyword should not get
2656         translated into having a -webkit prefix.
2657         * css/CSSPrimitiveValueMappings.h:
2658         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): New mapping from
2659         the Theme to the CSS value.
2660         * css/CSSValueKeywords.in: Add "-apple-airplay".
2661         * platform/ThemeTypes.h: New ControlPart.
2662         * rendering/RenderTheme.cpp: Stub implementation of the rendering and
2663         style update for the new appearance.
2664         (WebCore::RenderTheme::adjustStyle):
2665         (WebCore::RenderTheme::paint):
2666         (WebCore::RenderTheme::adjustWirelessPlaybackIconStyle):
2667         (WebCore::RenderTheme::paintWirelessPlaybackIcon):
2668         * rendering/RenderTheme.h:
2669         * rendering/RenderThemeMac.h:
2670         * rendering/RenderThemeMac.mm:
2671         (WebCore::RenderThemeMac::adjustWirelessPlaybackIconStyle):
2672         (WebCore::RenderThemeMac::paintWirelessPlaybackIcon):
2673
2674 2015-06-11  Commit Queue  <commit-queue@webkit.org>
2675
2676         Unreviewed, rolling out r185464.
2677         https://bugs.webkit.org/show_bug.cgi?id=145894
2678
2679         "This patch is breaking binding tests" (Requested by youenn on
2680         #webkit).
2681
2682         Reverted changeset:
2683
2684         "Bindings generator should generate code for Promise-based
2685         APIs"
2686         https://bugs.webkit.org/show_bug.cgi?id=145833
2687         http://trac.webkit.org/changeset/185464
2688
2689 2015-06-11  Commit Queue  <commit-queue@webkit.org>
2690
2691         Unreviewed, rolling out r185465.
2692         https://bugs.webkit.org/show_bug.cgi?id=145893
2693
2694         "This patch is breaking 32bit mac build" (Requested by youenn
2695         on #webkit).
2696
2697         Reverted changeset:
2698
2699         "[Streams API] ReadableJSStream should handle promises
2700         returned by JS source start callback"
2701         https://bugs.webkit.org/show_bug.cgi?id=145792
2702         http://trac.webkit.org/changeset/185465
2703
2704 2015-06-11  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2705
2706         [Streams API] ReadableJSStream should handle promises returned by JS source start callback
2707         https://bugs.webkit.org/show_bug.cgi?id=145792
2708
2709         Reviewed by Darin Adler.
2710
2711         Covered by rebased tests.
2712
2713         When calling start callback, the returned value is checked.
2714         If it is not a promise, we do as if it is a resolved promise.
2715         If it is a promise, we call its then() method with two resolve/reject JS functions.
2716
2717         * Modules/streams/ReadableStream.cpp:
2718         * bindings/js/ReadableJSStream.cpp:
2719         (WebCore::ReadableJSStream::invoke): Returns a JSPromise* if any is returned by the JS source callback.
2720         (WebCore::thenPromise): Utility method to call the promise.
2721         (WebCore::createStartResultFulfilledFunction): The promise resolve callback.
2722         (WebCore::ReadableJSStream::doStart): Calls thenPromise if a JSPromise* is returned by invoke.
2723         (WebCore::ReadableJSStream::ReadableJSStream):
2724         * bindings/js/ReadableJSStream.h:
2725
2726 2015-06-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2727
2728         Bindings generator should generate code for Promise-based APIs
2729         https://bugs.webkit.org/show_bug.cgi?id=145833
2730
2731         Reviewed by Darin Adler.
2732
2733         Covered by existing tests.
2734
2735         * Modules/webaudio/AudioContext.idl: Removing custom binding for resume, suspend and close.
2736         * bindings/js/JSAudioContextCustom.cpp: Ditto.
2737         * bindings/scripts/CodeGeneratorJS.pm:
2738         (GenerateHeader): Refactoring to use IsReturningPromise.
2739         (GenerateImplementation): Disabling include for return type if it is a promise.
2740         (GenerateParametersCheck): Adding DeferredWrapper() as argument to the DOM method if JS method returns a promise.
2741         (GenerateImplementationFunctionCall): Added support for promise-returning API.
2742         (IsReturningPromise): Checking whether function is returning a promise.
2743         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2744         (webkit_dom_test_obj_test_promise_function):
2745         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2746         * bindings/scripts/test/JS/JSTestObj.cpp:
2747         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
2748         * bindings/scripts/test/ObjC/DOMTestObj.h:
2749         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2750         (-[DOMTestObj testPromiseFunction]):
2751         * bindings/scripts/test/TestObj.idl: Adding promise returning function.
2752
2753
2754 2015-06-08  Simon Fraser  <simon.fraser@apple.com>
2755
2756         Missing content in UIWebView snapshots sometimes
2757         https://bugs.webkit.org/show_bug.cgi?id=145779
2758         rdar://problem/20744708
2759
2760         Reviewed by Darin Adler.
2761         
2762         When expanding collapsed parts of quoted text on iOS, sometimes the "concertina"
2763         images would be blank. This happened because we'd fail to create tiles for regions
2764         outside the LegacyTileCache's visibleRect.
2765         
2766         Fix by giving LegacyTileCache an optional override visibleRect, which is set
2767         and cleared during -renderInContext: using the context clip rect.
2768
2769         * platform/ios/LegacyTileCache.h:
2770         * platform/ios/LegacyTileCache.mm:
2771         (WebCore::LegacyTileCache::visibleRectInLayer):
2772         (WebCore::LegacyTileCache::setOverrideVisibleRect):
2773         * platform/ios/LegacyTileLayer.mm:
2774         (-[LegacyTileHostLayer renderInContext:]):
2775
2776 2015-06-11  Daniel Bates  <dabates@apple.com>
2777
2778         Simplify event handling logic for search cancel button
2779         https://bugs.webkit.org/show_bug.cgi?id=145780
2780
2781         Reviewed by Darin Adler.
2782
2783         Following the patch for <https://bugs.webkit.org/show_bug.cgi?id=145774> we can take advantage
2784         of the DOM click event to simplify the event handling logic for the search cancel button.
2785         It is sufficient to listen for mousedown and click events instead of listening for mousedown
2786         and mouseup events, capturing all events during drag, and using the hover state of the button
2787         on mouse release together with a instance variable set on mouse press to determine whether
2788         the cancel button was clicked.
2789
2790         As a side effect of removing the requirement that the search cancel button be hovered (a
2791         workaround to ensure that the mouse was pressed and released on the button in absence of
2792         listening for an explicit DOM click event) we can remove the accessibility-specific class,
2793         AccessibilitySearchFieldCancelButton, that was primarily used to fake the hover state of
2794         the button so that the accessibility machinery could simulate a click on it. Instead we
2795         can add use the default accessibility machinery for clicking on an element.
2796
2797         No new tests since no functionality was changed.
2798
2799         * CMakeLists.txt: Remove reference to file AccessibilitySearchFieldButtons.cpp.
2800         * WebCore.vcxproj/WebCore.vcxproj: Remove reference to files AccessibilitySearchFieldButtons.{cpp, h}.
2801         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2802         * WebCore.xcodeproj/project.pbxproj: Ditto.
2803         * accessibility/AXObjectCache.cpp:
2804         (WebCore::createFromRenderer): Remove special-purpose logic that instantiated
2805         AccessibilitySearchFieldCancelButton for the search cancel button. Instead we can make
2806         use of the existing accessibility machinery to handle this button.
2807         * accessibility/AccessibilityAllInOne.cpp: Remove #include of AccessibilitySearchFieldButtons.cpp
2808         since the file is no longer needed.
2809         * accessibility/AccessibilitySearchFieldButtons.cpp: Removed.
2810         * accessibility/AccessibilitySearchFieldButtons.h: Removed.
2811         * dom/Element.h:
2812         (WebCore::Element::isSearchFieldCancelButtonElement): Deleted.
2813         * html/shadow/TextControlInnerElements.cpp:
2814         (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement): Set the ARIA role
2815         and label attributes so that the accessibility system identifies the search cancel button as
2816         a button and shows a description for the button, respectively.
2817         (WebCore::SearchFieldCancelButtonElement::defaultEventHandler): Simplify the event handling logic
2818         such that we clear the field when we receive a DOM click event (i.e. the mouse was pressed
2819         and released on the button). Remove unused variable, oldValue. Substitute emptyString() for the
2820         empty string literal in the call to HTMLInputElement::setValueForUser() to avoid an implicit
2821         conversion to String. Also remove out-of-date comment that repeated what the code does.
2822         (WebCore::SearchFieldCancelButtonElement::willDetachRenderers): Deleted. We no longer need to use
2823         custom style resolve callbacks to reset the state of the EventHandler since we no longer need to
2824         have the EventHandler dispatch all mouse events to us on mouse press.
2825         * html/shadow/TextControlInnerElements.h:
2826
2827 2015-06-11  Commit Queue  <commit-queue@webkit.org>
2828
2829         Unreviewed, rolling out r185453.
2830         https://bugs.webkit.org/show_bug.cgi?id=145881
2831
2832         it broke the 32-bit build (Requested by clopez on #webkit).
2833
2834         Reverted changeset:
2835
2836         "[GTK] [Wayland] Should be possible to build with support for
2837         both X11 and Wayland."
2838         https://bugs.webkit.org/show_bug.cgi?id=145701
2839         http://trac.webkit.org/changeset/185453
2840
2841 2015-06-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2842
2843         [GTK] [Wayland] Should be possible to build with support for both X11 and Wayland.
2844         https://bugs.webkit.org/show_bug.cgi?id=145701
2845
2846         Reviewed by Žan Doberšek.
2847
2848         No new tests, no behavior changes.
2849
2850         When building both targets, we have to include the wayland-egl
2851         headers in order to build the Wayland target. This causes that
2852         EGLNativePixmapType and EGLNativeWindowType get defined as
2853         different types than when building only the X11 target.
2854
2855         By type casting them to the ones that are expected, we are able
2856         to build both targets at the same time.
2857
2858         I have done tests (building each target alone as also both targets
2859         at the same time), and everything seems to works as expected.
2860
2861         Once built for both targets, if you try to launch the MiniBrowser
2862         from inside a Wayland compositor (Weston on top of X for example),
2863         it will trigger the X11 target if the DISPLAY environment variable
2864         is set and the environment variable GDK_BACKEND is not set to wayland,
2865         otherwise it will trigger the Wayland target.
2866
2867         * platform/graphics/GLContext.cpp:
2868         (WebCore::GLContext::createContextForWindow): Add type cast.
2869         * platform/graphics/egl/GLContextEGL.cpp: Add missing include when
2870         building both targets that is required for defining DefaultRootWindow().
2871         (WebCore::GLContextEGL::createPixmapContext): Add type cast.
2872
2873 2015-06-11  Hunseop Jeong  <hs85.jeong@samsung.com>
2874
2875         [EFL] Fix the debug build after r185417.
2876         https://bugs.webkit.org/show_bug.cgi?id=145876 
2877
2878         Reviewed by Gyuyoung Kim.
2879
2880         * platform/graphics/efl/ImageBufferEfl.cpp: added the missing "MIMETypeRegistry.h".
2881
2882 2015-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
2883
2884         [iOS] Tahoma isn't installed on iOS, so there is no need to blacklist it
2885         https://bugs.webkit.org/show_bug.cgi?id=145865
2886
2887         Reviewed by Dan Bernstein.
2888
2889         No new tests because I can't copy Tahoma into our open source repository.
2890
2891         * platform/graphics/cocoa/FontCocoa.mm:
2892         (WebCore::fontFamilyShouldNotBeUsedForArabic):
2893
2894 2015-06-10  Commit Queue  <commit-queue@webkit.org>
2895
2896         Unreviewed, rolling out r185442.
2897         https://bugs.webkit.org/show_bug.cgi?id=145871
2898
2899         seems to have broken WTF.StringOperators test (Requested by
2900         alexchristensen on #webkit).
2901
2902         Reverted changeset:
2903
2904         "[Content Extensions] Limit number of rules."
2905         https://bugs.webkit.org/show_bug.cgi?id=145663
2906         http://trac.webkit.org/changeset/185442
2907
2908 2015-06-10  Jon Lee  <jonlee@apple.com>
2909
2910         Update presentation mode JS API to using 'picture-in-picture'
2911         https://bugs.webkit.org/show_bug.cgi?id=145826
2912         rdar://problem/2131153
2913
2914         Reviewed by Anders Carlsson.
2915
2916         Update presentation modes to use 'picture-in-picture' in lieu of 'optimized'.
2917
2918         * html/HTMLVideoElement.idl: Update to "picture-in-picture".
2919         * html/HTMLVideoElement.cpp:
2920         (WebCore::presentationModePictureInPicture): Rename static function returning string.
2921         (WebCore::presentationModeOptimized): Deleted.
2922         (WebCore::HTMLVideoElement::webkitSupportsPresentationMode): Use the new static function name.
2923         (WebCore::HTMLVideoElement::webkitSetPresentationMode): Ditto.
2924         (WebCore::HTMLVideoElement::webkitPresentationMode): Ditto.
2925
2926         * Modules/mediacontrols/mediaControlsiOS.js: Update to 'picture-in-picture'.
2927         (ControllerIOS.prototype.configureInlineControls): 
2928         (ControllerIOS.prototype.isFullScreen):
2929         (ControllerIOS.prototype.handleOptimizedFullscreenButtonClicked):
2930         (ControllerIOS.prototype.handlePresentationModeChange):
2931         (ControllerIOS.prototype.controlsAlwaysVisible):
2932
2933 2015-06-10  Boris Smus  <boris@smus.com>
2934
2935         [Mobile Safari, WKWebView] increase DeviceOrientationEvent events emission frequency
2936         https://bugs.webkit.org/show_bug.cgi?id=145814
2937
2938         Reviewed by Benjamin Poulain.
2939
2940         Increased the sampling rate of DeviceOrientationEvent from 20 Hz to 60
2941         Hz to make good head tracking possible.
2942
2943         * platform/ios/WebCoreMotionManager.h:
2944
2945 2015-06-10  Alex Christensen  <achristensen@webkit.org>
2946
2947         [Content Extensions] Limit number of rules.
2948         https://bugs.webkit.org/show_bug.cgi?id=145663
2949         rdar://problem/21242407
2950
2951         Reviewed by Benjamin Poulain.
2952
2953         Added an API test to make sure that parsing fails when there are too many rules.
2954
2955         * contentextensions/ContentExtensionError.cpp:
2956         (WebCore::ContentExtensions::contentExtensionErrorCategory):
2957         * contentextensions/ContentExtensionError.h:
2958         * contentextensions/ContentExtensionParser.cpp:
2959         (WebCore::ContentExtensions::loadEncodedRules):
2960         Fail to parse a content extension with more than 50000 rules.
2961
2962 2015-06-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
2963
2964         REGRESSION (r184895): Vertical border elements ([-webkit]-border-image set to 'repeat') that used to render perfectly are now rendering incorrectly.
2965         https://bugs.webkit.org/show_bug.cgi?id=145801
2966
2967         Reviewed by Simon Fraser.
2968
2969         When using the tiling to draw the sides of an image-border, the image slice
2970         is repeated only in one direction. For top and bottom sides, the slice is
2971         repeated horizontally and for left and right sides, it's repeated vertically.
2972         The tile might be scaled in the other direction of the tiling if the border
2973         extent and the slice extent are different in this direction.
2974         
2975         The bug happens because we were scaling the tile in the tiling direction.
2976
2977         Test: fast/borders/border-image-repeat-stretch.html
2978
2979         * rendering/style/NinePieceImage.cpp:
2980         (WebCore::NinePieceImage::scaleSlicesIfNeeded): Fix the type and the name
2981         of deviceScaleFactor.
2982         
2983         (WebCore::NinePieceImage::computeIntrinsicSideTileScale): Fix the scaling
2984         direction of the border image side tiling.
2985         
2986         * rendering/style/NinePieceImage.h:
2987
2988 2015-06-10  Chris Dumez  <cdumez@apple.com>
2989
2990         ASSERT_WITH_SECURITY_IMPLICATION in WebCore::DocumentOrderedMap::getElementById
2991         https://bugs.webkit.org/show_bug.cgi?id=145857
2992         <rdar://problem/16798440>
2993
2994         Reviewed by Darin Adler.
2995
2996         Make sure Node::insertedInto() gets called on the inserted node and its
2997         descendants after its insertion into the tree but *before*
2998         ContainerNode::childrenChanged() is called on the parent node. This is
2999         needed so that the descendants know they've been inserted into the tree
3000         (and their InDocumentFlag flag gets set) before the parent node does
3001         anything with them in childrenChanged().
3002
3003         In the case of <rdar://problem/16798440>, executing HTMLScriptElement's
3004         childrenChanged() after appending a child to a script element was causing
3005         the script to be executed. The script would call getElementBy() which
3006         would traverse the DOM tree and find a matching Element in the newly
3007         inserted subtree. However, the matching Element's InDocumentFlag flag was
3008         not set yet because the element's insertedInto() method has not been called
3009         yet at this point. This would cause us to hit an assertion as
3010         DocumentOrderedMap::getElementById() is only supposed to return elements
3011         that are in a Document.
3012
3013         This patch is based on Blink r178976 by <esprehn@chromium.org>:
3014         https://src.chromium.org/viewvc/blink?view=rev&revision=178976
3015
3016         Tests: fast/dom/script-getElementById-during-insertion.html
3017                fast/dom/script-remove-child-id-map.html
3018
3019         * dom/ContainerNode.cpp:
3020         (WebCore::ContainerNode::notifyChildInserted):
3021         (WebCore::ContainerNode::notifyChildRemoved):
3022         (WebCore::ContainerNode::removeChildren):
3023         (WebCore::ContainerNode::parserInsertBefore): Deleted.
3024         (WebCore::ContainerNode::removeChild): Deleted.
3025         (WebCore::ContainerNode::parserRemoveChild): Deleted.
3026         (WebCore::ContainerNode::parserAppendChild): Deleted.
3027         (WebCore::ContainerNode::childrenChanged): Deleted.
3028         (WebCore::ContainerNode::setAttributeEventListener): Deleted.
3029         (WebCore::ContainerNode::querySelector): Deleted.
3030         * dom/ContainerNodeAlgorithms.cpp:
3031         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument):
3032         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree):
3033         * dom/ContainerNodeAlgorithms.h:
3034         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
3035         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree):
3036         (WebCore::ChildNodeInsertionNotifier::notify):
3037         (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument): Deleted.
3038         * dom/Element.cpp:
3039         (WebCore::Element::addShadowRoot):
3040
3041 2015-06-10  Alex Christensen  <achristensen@webkit.org>
3042
3043         [Web Timing] Fix flaky test.
3044         https://bugs.webkit.org/show_bug.cgi?id=145846
3045
3046         Reviewed by Alexey Proskuryakov.
3047
3048         The timing data is gathered in ResourceHandle::getConnectionTimingData as 
3049         millisecond deltas from the fetch start time, not the navigation start time.
3050         The difference between navigation and fetch start time is usually so small that 
3051         it only caused one flaky test, but this should fix that flakiness. This patch 
3052         corrects how the millisecond deltas are used.
3053
3054         * page/PerformanceTiming.cpp:
3055         (WebCore::PerformanceTiming::domainLookupStart):
3056         (WebCore::PerformanceTiming::domainLookupEnd):
3057         (WebCore::PerformanceTiming::connectStart):
3058         (WebCore::PerformanceTiming::connectEnd):
3059         (WebCore::PerformanceTiming::secureConnectionStart):
3060         (WebCore::PerformanceTiming::requestStart):
3061         (WebCore::PerformanceTiming::responseStart):
3062         (WebCore::PerformanceTiming::responseEnd):
3063         (WebCore::PerformanceTiming::documentLoadTiming):
3064         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
3065         (WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds):
3066         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToAbsolute): Deleted.
3067         * page/PerformanceTiming.h:
3068
3069 2015-06-10  Beth Dakin  <bdakin@apple.com>
3070
3071         Overriding the overlay scrollbar style on WKView doesn't take effect immediately
3072         https://bugs.webkit.org/show_bug.cgi?id=145855
3073         -and corresponding-
3074         rdar://problem/20948706
3075
3076         Reviewed by Simon Fraser.
3077
3078         Since we opt into layer-per-part scrollbars in order to move the knob on the 
3079         secondary thread, AppKit is creating its own layers for the knob and track. To 
3080         invalidate them, we need to call into the ScrollbarPainter’s setNeedsDisplay.
3081
3082         New virtual function on ScrollAnimator to call into ScrollbarPainter’s 
3083         setNeedsDispay.
3084         * platform/ScrollAnimator.h:
3085
3086         Call the new function when setting the overlay style.
3087         * platform/ScrollableArea.cpp:
3088         (WebCore::ScrollableArea::setScrollbarOverlayStyle):
3089
3090         Add setNeedsDisplay to the list of ScrollbarPainter methods.
3091         * platform/mac/NSScrollerImpDetails.h:
3092
3093         Implement invalidateScrollbarPartLayers.
3094         * platform/mac/ScrollAnimatorMac.h:
3095         * platform/mac/ScrollAnimatorMac.mm:
3096         (WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
3097
3098 2015-06-10  Matt Rajca  <mrajca@apple.com>
3099
3100         MediaRemoteControls should be marked JSGenerateToJSObject.
3101         https://bugs.webkit.org/show_bug.cgi?id=145849
3102
3103         Reviewed by Eric Carlson.
3104
3105         Since MediaRemoteControls has a parent interface, we need to add the JSGenerateToJSObject attribute so the
3106         toJS(...) function gets generated. This is required for event handling to work.
3107
3108         * Modules/mediasession/MediaRemoteControls.idl:
3109
3110 2015-06-10  Dean Jackson  <dino@apple.com>
3111
3112         User can not scroll on page when dragging inside video
3113         https://bugs.webkit.org/show_bug.cgi?id=145848
3114         <rdar://problem/20997158>
3115
3116         Reviewed by Brent Fulgham.
3117
3118         Revert the change made in http://trac.webkit.org/changeset/183797
3119         which breaks panning on pages if the touch starts inside the video.
3120
3121         * Modules/mediacontrols/mediaControlsiOS.js:
3122         (ControllerIOS.prototype.handleWrapperTouchStart): Do not return true, which stops
3123         the handleEvent call in the superclass from preventing the default action.
3124
3125 2015-06-10  Matt Rajca  <mrajca@apple.com>
3126
3127         Explicitly keep track of active HTMLMediaElements in MediaSessions.
3128         https://bugs.webkit.org/show_bug.cgi?id=145829
3129
3130         Reviewed by Eric Carlson.
3131
3132         * Modules/mediasession/MediaSession.cpp: Add support for keeping track of active media elements.
3133         (WebCore::MediaSession::addActiveMediaElement):
3134         * Modules/mediasession/MediaSession.h:
3135         * html/HTMLMediaElement.cpp:
3136         (WebCore::HTMLMediaElement::playInternal): If the paused attribute is true and the readyState attribute has the
3137           value HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA, the media element becomes an active participating element of the
3138           media session.
3139
3140 2015-06-10  Chris Dumez  <cdumez@apple.com>
3141
3142         Drop unused argument for Node::didNotifySubtreeInsertions()
3143         https://bugs.webkit.org/show_bug.cgi?id=145845
3144
3145         Reviewed by Andreas Kling.
3146
3147         * dom/ContainerNodeAlgorithms.h:
3148         (WebCore::ChildNodeInsertionNotifier::notify):
3149         * dom/Node.h:
3150         (WebCore::Node::didNotifySubtreeInsertions):
3151         * html/HTMLFrameElementBase.cpp:
3152         (WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions):
3153         * html/HTMLFrameElementBase.h:
3154         * svg/SVGFEImageElement.cpp:
3155         (WebCore::SVGFEImageElement::didNotifySubtreeInsertions):
3156         * svg/SVGFEImageElement.h:
3157         * svg/SVGMPathElement.cpp:
3158         (WebCore::SVGMPathElement::didNotifySubtreeInsertions):
3159         * svg/SVGMPathElement.h:
3160         * svg/SVGTRefElement.cpp:
3161         (WebCore::SVGTRefElement::didNotifySubtreeInsertions):
3162         * svg/SVGTRefElement.h:
3163         * svg/SVGTextPathElement.cpp:
3164         (WebCore::SVGTextPathElement::didNotifySubtreeInsertions):
3165         * svg/SVGTextPathElement.h:
3166         * svg/animation/SVGSMILElement.cpp:
3167         (WebCore::SVGSMILElement::didNotifySubtreeInsertions):
3168         * svg/animation/SVGSMILElement.h:
3169
3170 2015-06-10  KwangHyuk Kim  <hyuki.kim@samsung.com>
3171
3172         [EFL] Jpeg image export implementation for Canvas.
3173         https://bugs.webkit.org/show_bug.cgi?id=145457
3174
3175         Reviewed by Gyuyoung Kim.
3176
3177         Add implementation of jpeg image export on Webkit EFL by using JPEGImageEncoder.
3178
3179         No new tests, fast/canvas/toDataURL-supportedTypes.html can be reused.
3180
3181         * PlatformEfl.cmake:
3182         * platform/MIMETypeRegistry.cpp:
3183         (WebCore::initializeSupportedImageMIMETypesForEncoding):
3184         * platform/graphics/cairo/ImageBufferCairo.cpp:
3185         * platform/graphics/efl/ImageBufferEfl.cpp: Added.
3186         (WebCore::writeFunction):
3187         (WebCore::encodeImage):
3188         (WebCore::ImageBuffer::toDataURL):
3189         * platform/image-encoders/JPEGImageEncoder.cpp:
3190         (WebCore::compressRGBABigEndianToJPEG):
3191
3192 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3193
3194         [GTK] Move KeyBindingTranslator from platform to WebKit2 layer
3195         https://bugs.webkit.org/show_bug.cgi?id=145840
3196
3197         Reviewed by Martin Robinson.
3198
3199         It's currently used only by WebKit2 in the UI process and it's
3200         another file built twice because of the GTK2 plugin process.
3201
3202         * PlatformGTK.cmake:
3203
3204 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3205
3206         [GTK] Get rid of GetEditorCommandsForKeyEvent sync message
3207         https://bugs.webkit.org/show_bug.cgi?id=145598
3208
3209         Reviewed by Žan Doberšek.
3210
3211         * platform/PlatformKeyboardEvent.h:
3212         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3213         (WebCore::PlatformKeyboardEvent::commands):
3214         * platform/gtk/KeyBindingTranslator.cpp: Use a single list of
3215         custom key bindings. We don't need to distinguish between key down and
3216         key press commands, since the web editor client already does that
3217         when executing the commands.
3218         (WebCore::KeyBindingTranslator::commandsForKeyEvent): This is
3219         getEditorCommandsForKeyEvent() renamed as commandsForKeyEvent(),
3220         since it now returns the list of commands to simplify the
3221         code. Also simplify the custom key bindings handling, by using the
3222         global list instead of moving it to a HashMap.
3223         (WebCore::KeyBindingTranslator::getEditorCommandsForKeyEvent): Deleted.
3224         * platform/gtk/KeyBindingTranslator.h:
3225
3226 2015-06-10  Per Arne Vollan  <peavo@outlook.com>
3227
3228         [WinCairo] Crash on exit when terminating egl
3229         https://bugs.webkit.org/show_bug.cgi?id=145832
3230
3231         Reviewed by Carlos Garcia Campos.
3232
3233         Avoid terminating egl on exit for WinCairo.
3234
3235         * platform/graphics/PlatformDisplay.cpp:
3236         (WebCore::PlatformDisplay::~PlatformDisplay):
3237
3238 2015-06-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3239
3240         Refactor AudioContext implementation to enable automatic binding generation of promise-based methods
3241         https://bugs.webkit.org/show_bug.cgi?id=145223
3242
3243         Reviewed by Darin Adler.
3244
3245         Introducing DOMPromise as a typed wrapper above DeferredWrapper.
3246         This DOMPromise allows constraining Promise resolution/rejection to a single resolution type and rejection type. 
3247         This might be useful for typed callback usage of promise based APIs, like getUserMedia() or ReadableStreamReader.read().
3248
3249         Applying DOMPromise to AudioContext close, suspend and resume.
3250         Changed binding code to represent what could be automatically generated by binding generator.
3251         Fixing unneeded copies of std::function callbacks.
3252
3253         Disabling DOMPromise copy constructors to lower chances that resolution/rejection is done twice on the same object.
3254
3255         Covered by existing tests.
3256
3257         * Modules/webaudio/AudioContext.cpp:
3258         (WebCore::AudioContext::addReaction):
3259         (WebCore::AudioContext::setState):
3260         (WebCore::AudioContext::suspend):
3261         (WebCore::AudioContext::resume):
3262         (WebCore::AudioContext::close):
3263         * Modules/webaudio/AudioContext.h:
3264         * bindings/js/JSAudioContextCustom.cpp:
3265         (WebCore::JSAudioContext::suspend):
3266         (WebCore::JSAudioContext::resume):
3267         (WebCore::JSAudioContext::close):
3268         * bindings/js/JSDOMPromise.cpp:
3269         (WebCore::DeferredWrapper::callFunction):
3270         * bindings/js/JSDOMPromise.h:
3271         (WebCore::DeferredWrapper::resolve):
3272         (WebCore::DeferredWrapper::reject):
3273         (WebCore::DOMPromise::DOMPromise):
3274         (WebCore::DOMPromise::resolve):
3275         (WebCore::DOMPromise::reject):
3276
3277 2015-06-10  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3278
3279         [Streams API] Implement pulling of a source by a ReadableStream
3280         https://bugs.webkit.org/show_bug.cgi?id=145262
3281
3282         Reviewed by Darin Adler
3283
3284         Introduced abstract ReadableStream::doPull() which is overriden in ReadableJSStream.
3285         Added support to call the "pull" JS callback in ReadableJSStream::doPull().
3286         Added calls to pull as requested by the spec (when resolving a read callback, at start time...).
3287
3288         Fixed issue in ReadableStreamReader::read() (use of successCallback(JSValue()) in lieu of endCallback())
3289
3290         Covered by rebased tests.
3291
3292         * Modules/streams/ReadableStream.cpp:
3293         (WebCore::ReadableStream::start): calling pull() once start.
3294         (WebCore::ReadableStream::pull): calling doPull() if readableStream states requires to.
3295         (WebCore::ReadableStream::read): calling pull() after resolving a read callback.
3296         * Modules/streams/ReadableStream.h:
3297         * Modules/streams/ReadableStreamReader.cpp:
3298         (WebCore::ReadableStreamReader::read): fixed JSValue() bug.
3299         * bindings/js/ReadableJSStream.cpp:
3300         (WebCore::ReadableJSStream::doPull): calling of JS callback.
3301         (WebCore::ReadableJSStream::storeException): catches exception and store them.
3302         (WebCore::ReadableJSStream::storeError): refactoring for checkForException.
3303         (WebCore::ReadableJSStream::enqueue):
3304         * bindings/js/ReadableJSStream.h:
3305
3306 2015-06-09  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3307
3308         DeferredWrapper should clear its JS strong references once its promise is resolved/rejected
3309         https://bugs.webkit.org/show_bug.cgi?id=145753
3310
3311         Reviewed by Darin Adler.
3312
3313         Clear strong references at the end of DeferredWrapper::resolve and DeferredWrapper::reject.
3314         Added assertions to check that resolve or reject is called only once.
3315
3316         Removed DeferredWrapper constructor that creates internally its promise.
3317         Reason is DeferredWrapper can be resolved synchronously and promise
3318         will be lost when returning it at the end of the binding promise function.
3319         Updated all custom bindings accordingly.
3320
3321         Covered by existing tests.
3322
3323         * bindings/js/JSAudioContextCustom.cpp:
3324         (WebCore::JSAudioContext::suspend): Updated DeferredWrapper constructor to properly return the promise.
3325         (WebCore::JSAudioContext::resume): Ditto.
3326         (WebCore::JSAudioContext::close): Ditto.
3327         * bindings/js/JSDOMPromise.cpp:
3328         (WebCore::DeferredWrapper::resolve): Cleared strong references after promise resolution.
3329         (WebCore::DeferredWrapper::reject): Cleared strong references after promise rejection.
3330         * bindings/js/JSDOMPromise.h:
3331         (WebCore::DeferredWrapper::resolve): Added ASSERT to check promise is not yet rejected/resolved.
3332         (WebCore::DeferredWrapper::reject): Ditto.
3333         (WebCore::DeferredWrapper::reject<ExceptionCode>): Ditto.
3334         (WebCore::DeferredWrapper::resolve<String>): Ditto.
3335         (WebCore::DeferredWrapper::resolve<bool>): Ditto.
3336         (WebCore::DeferredWrapper::resolve<JSC::JSValue>): Ditto.
3337         (WebCore::char>>):
3338         (WebCore::DeferredWrapper::reject<String>): Ditto.
3339         * bindings/js/JSMediaDevicesCustom.cpp:
3340         (WebCore::JSMediaDevices::getUserMedia): Updated DeferredWrapper constructor to properly return the promise.
3341         * bindings/js/JSReadableStreamReaderCustom.cpp:
3342         (WebCore::JSReadableStreamReader::read): Ditto.
3343         (WebCore::JSReadableStreamReader::closed): Ditto.
3344         * bindings/js/JSSubtleCryptoCustom.cpp:
3345         (WebCore::JSSubtleCrypto::encrypt): Ditto.
3346         (WebCore::JSSubtleCrypto::decrypt): Ditto.
3347         (WebCore::JSSubtleCrypto::sign): Ditto.
3348         (WebCore::JSSubtleCrypto::verify): Ditto.
3349         (WebCore::JSSubtleCrypto::digest): Ditto.
3350         (WebCore::JSSubtleCrypto::generateKey): Ditto.
3351         (WebCore::JSSubtleCrypto::importKey): Ditto.
3352         (WebCore::JSSubtleCrypto::exportKey): Ditto.
3353         (WebCore::JSSubtleCrypto::wrapKey): Ditto.
3354         (WebCore::JSSubtleCrypto::unwrapKey): Ditto.
3355
3356 2015-06-09  Zalan Bujtas  <zalan@apple.com>
3357
3358         Protect FrameView from being destroyed in Document::recalcStyle()
3359         https://bugs.webkit.org/show_bug.cgi?id=143033
3360         rdar://problem/20326871
3361
3362         Reviewed by Andreas Kling.
3363
3364         This patch ensures that FrameView stays valid in Document::recalcStyle().
3365         It follows the defensive pattern we use to deal with the refcounted FrameView (see EventDispatcher::dispatchEvent)
3366
3367         When the iframe destroys itself in the onBeforeLoad callback (as the result of
3368         PostResolutionCallbackDisabler -> HTMLObjectElement::updateWidget -> guardedDispatchBeforeLoadEvent),
3369         we detach the frame and release the FrameView. However Document::recalcStyle() expects
3370         the FrameView to stay valid.
3371
3372         Covered by fast/frames/flattening/crash-remove-iframe-during-object-beforeload.html.
3373
3374         * dom/Document.cpp:
3375         (WebCore::Document::recalcStyle):
3376
3377 2015-06-09  Daegyu Lee  <daegyu.lee@navercorp.com>
3378
3379         3D-transformed video does not display on platforms without accelerated video rendering
3380         https://bugs.webkit.org/show_bug.cgi?id=144782
3381
3382         Reviewed by Simon Fraser.
3383
3384         Video element does not get GraphicsLayer when MediaPlayerPrivate::supportsAcceleratedRendering() returns false
3385         which means not using accelerated video decoding.
3386         Although the video element gets GraphicsLayer by changing the CSS style of video element by javascript,
3387         there is no way to set GraphicsLayer::setDrawsContent(true) for updating the video content.
3388         As a result, after changing the CSS style, the video content does not show.
3389         To avoid missing setDrawsContent(true), add conditions(!supportsAcceleratedRendering() && m_requiresOwnBackingStore).
3390
3391         Test: media/video-transformed-by-javascript.html
3392               media/video-transformed-by-javascript-expected.html
3393
3394         * rendering/RenderLayerBacking.cpp:
3395         (WebCore::RenderLayerBacking::containsPaintedContent):
3396
3397 2015-06-09  Ryosuke Niwa  <rniwa@webkit.org>
3398
3399         REGRESSION(r180867): Tabbing to login field on iCloud.com doesn't have highlight for text
3400         https://bugs.webkit.org/show_bug.cgi?id=145830
3401
3402         Reviewed by Darin Adler.