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