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