REGRESSION (r167689): Hovering file name in a file input causes a crash
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-04-25  Ryosuke Niwa  <rniwa@webkit.org>
2
3         REGRESSION (r167689): Hovering file name in a file input causes a crash
4         https://bugs.webkit.org/show_bug.cgi?id=132214
5
6         Reviewed by Andreas Kling.
7
8         The bug was caused by callDefaultEventHandlersInTheBubblingOrder unconditionally
9         accessing path.contextAt(0) even if the event path was empty.
10
11         Fixed the bug by exiting early when the event path is empty.
12
13         Test: fast/events/shadow-event-path-2.html
14
15         * dom/EventDispatcher.cpp:
16         (WebCore::callDefaultEventHandlersInTheBubblingOrder):
17
18 2014-04-25  Tim Horton  <timothy_horton@apple.com>
19
20         REGRESSION (r167828): http/tests/media/hls/video-controls-live-stream.html fails
21
22         * English.lproj/mediaControlsLocalizedStrings.js:
23         Add 'Live Broadcast' to the localized strings list.
24
25 2014-04-25  Brady Eidson  <beidson@apple.com>
26
27         Add a selection overlay.
28         <rdar://problem/16727797> and https://bugs.webkit.org/show_bug.cgi?id=132200
29
30         Reviewed by David Hyatt.
31
32         No new tests (WK2 feature in development).
33
34         * WebCore.xcodeproj/project.pbxproj:
35
36         Add a SelectionRectGathterer class.
37         It creates a Notifier (given a RenderView) then accepts Rects from the RenderView.
38         When the Notifier is destroyed, the appropriate EditorClient is notified of the gathered rects.
39         * editing/SelectionRectGatherer.cpp: Added.
40         (WebCore::SelectionRectGatherer::SelectionRectGatherer):
41         (WebCore::SelectionRectGatherer::addRect):
42         (WebCore::SelectionRectGatherer::addRects):
43         (WebCore::SelectionRectGatherer::Notifier::Notifier):
44         (WebCore::SelectionRectGatherer::Notifier::~Notifier):
45         (WebCore::SelectionRectGatherer::clearAndCreateNotifier):
46         * editing/SelectionRectGatherer.h: Added.
47
48         * page/EditorClient.h:
49         (WebCore::EditorClient::selectionRectsDidChange):
50
51         * rendering/RenderView.cpp:
52         (WebCore::RenderView::RenderView):
53         (WebCore::RenderView::setSelection): Clear the gatherer’s rects then create a Notifier.
54         (WebCore::RenderView::setSubtreeSelection): Give all the selection rects to be painted to
55           the SelectionRectGatherer.
56         * rendering/RenderView.h:
57
58 2014-04-08  Jer Noble  <jer.noble@apple.com>
59
60         Support "Live" streams in media controls.
61         https://bugs.webkit.org/show_bug.cgi?id=131390
62
63         Reviewed by Brent Fulgham.
64
65         Test: http/tests/media/hls/video-controls-live-stream.html
66
67         Support "Live" streams by adding an isLive property to our media controls.
68
69         * Modules/mediacontrols/mediaControlsApple.css:
70         (audio::-webkit-media-controls-status-display):
71         (video:-webkit-full-screen::-webkit-media-controls-status-display):
72         * Modules/mediacontrols/mediaControlsApple.js:
73         (Controller): isLive defaults to false.
74         (Controller.prototype.setIsLive): Set the isLive property and conditionally reconfigure the controls.
75         (Controller.prototype.configureInlineControls): Don't add the timeline if we are live.
76         (Controller.prototype.configureFullScreenControls): Ditto.
77         (Controller.prototype.updateStatusDisplay): Added.
78         (Controller.prototype.handleLoadStart): Call updateStatusDisplay().
79         (Controller.prototype.handleError): Ditto.
80         (Controller.prototype.handleAbort): Ditto.
81         (Controller.prototype.handleSuspend): Ditto.
82         (Controller.prototype.handleStalled): Ditto.
83         (Controller.prototype.handleWaiting): Ditto.
84         (Controller.prototype.updateDuration): Ditto.
85         (Controller.prototype.updateReadyState): Ditto.
86
87 2014-04-25  Dean Jackson  <dino@apple.com>
88
89         Allow a platform-specific size enumeration to be passed into popup-menu display
90         https://bugs.webkit.org/show_bug.cgi?id=132195
91
92         Reviewed by Brent Fulgham. With some in-person review comments from Sam Weinig.
93
94         Platforms like OS X use a set of predefined sizes for built-in controls
95         used for <select>: normal, small and mini. Expose that information to
96         the PopupMenuClient via the PopupMenuStyle, allowing it to be passed
97         into the platform code in WebKitSystemInterface.
98
99         * platform/PopupMenuStyle.h: Add a menu size enum.
100         (WebCore::PopupMenuStyle::PopupMenuStyle):
101         (WebCore::PopupMenuStyle::menuSize):
102         * platform/mac/WebCoreSystemInterface.h: Pass in NSControlSize as a parameter
103         to WKPopupMenu.
104         * platform/mac/WebCoreSystemInterface.mm: Ditto.
105         * rendering/RenderMenuList.cpp:
106         (RenderMenuList::menuStyle): Ask the RenderTheme to calculate the size
107         of the menu button, so that it can be added to the PopupMenuStyle.
108         * rendering/RenderTheme.h: New method to retrieve the menu size.
109         (WebCore::RenderTheme::popupMenuSize): Convert an NSControlSize into a PopupMenuSize.
110         * rendering/RenderThemeMac.h: Override the base function, and add a
111         controlSizeForCell helper.
112         * rendering/RenderThemeMac.mm:
113         (WebCore::RenderThemeMac::controlSizeForCell): Used by this new
114         code and the old setControlSizeForCell to calculate the NSControlSize
115         that would be used for the button.
116         (WebCore::RenderThemeMac::setControlSize): Call the new helper.
117         (WebCore::RenderThemeMac::popupMenuSize): Return the value from the helper.
118
119 2014-04-25  Javier Fernandez  <jfernandez@igalia.com>
120
121         REGRESSION(r167799): ASSERTION in parseGridTemplateShorthand in fast/css-grid-layout/grid-template-shorthand-get-set.html
122         https://bugs.webkit.org/show_bug.cgi?id=132194
123
124         Reviewed by Martin Robinson.
125
126         Properly resolving the grid-template shorthand for the corresponding longhand
127         properties.
128
129         No new tests, grid-template-shorthand-get-set.html already covers this case.
130
131         * css/StyleProperties.cpp:
132         (WebCore::StyleProperties::getPropertyValue):
133         * css/StylePropertyShorthand.cpp:
134         (WebCore::shorthandForProperty):
135         (WebCore::matchingShorthandsForLonghand):
136         * css/StyleResolver.cpp:
137         (WebCore::StyleResolver::applyProperty):
138
139 2014-04-25  David Hyatt  <hyatt@apple.com>
140
141         Column rules not respecting scroll offsets.
142         https://bugs.webkit.org/show_bug.cgi?id=109683
143
144         Reviewed by Dean Jackson.
145
146         Added fast/multicol/scrolling-column-rules.html
147
148         * rendering/RenderBlock.cpp:
149         (WebCore::RenderBlock::paintColumnRules):
150         Make paintColumnRules virtual so that it works with both column implementations.
151
152         (WebCore::RenderBlock::paintObject):
153         Changed to call paintColumnRules with the adjusted scroll offset and to do it after
154         bailing on the root background only check.
155
156         * rendering/RenderBlock.h:
157         paintColumnRules is now virtual.
158
159         * rendering/RenderBlockFlow.cpp:
160         (WebCore::RenderBlockFlow::paintColumnRules):
161         (WebCore::RenderBlockFlow::paintBoxDecorations): Deleted.
162         * rendering/RenderBlockFlow.h:
163         Got rid of paintBoxDecorations override since it failed when hasBoxDecorations was false
164         anyway. Override paintColumnRules instead to paint at the right time.
165
166 2014-04-23  Jon Honeycutt  <jhoneycutt@apple.com>
167
168         Crash applying editing commands from iframe onload event
169
170         <https://bugs.webkit.org/show_bug.cgi?id=132103>
171         <rdar://problem/15696351>
172
173         This patch merges the Chromium bug workaround from
174         <http://src.chromium.org/viewvc/blink?revision=162080&view=revision>,
175         which prevents reentrancy in CompositeEditCommand::apply().
176
177         Reviewed by Darin Adler.
178
179         Test: editing/apply-style-iframe-crash.html
180
181         * editing/CompositeEditCommand.cpp:
182         (WebCore::HTMLNames::ReentrancyGuard::isRecursiveCall):
183         (WebCore::HTMLNames::ReentrancyGuard::Scope::Scope):
184         (WebCore::HTMLNames::ReentrancyGuard::Scope::~Scope):
185         (WebCore::CompositeEditCommand::apply):
186         If this is a recursive call, return early.
187
188 2014-04-25  David Hyatt  <hyatt@apple.com>
189
190         [New Multicolumn] fast/multicol/hit-test-* layout tests all fail
191         https://bugs.webkit.org/show_bug.cgi?id=132081
192
193         Reviewed by Dean Jackson.
194
195         Added a bunch of tests in fast/multicol/newmulticol/compare-with-old-impl/hit-test-*.html
196
197         * rendering/RenderBlock.h:
198         Make offsetForContents public, since I need to call it from RenderMultiColumnSet.
199
200         * rendering/RenderMultiColumnFlowThread.cpp:
201         (WebCore::RenderMultiColumnFlowThread::populate):
202         Stop an ASSERT in the new columns code on the hit tests by making sure layout state is
203         disabled when moving children around.
204
205         * rendering/RenderMultiColumnSet.cpp:
206         (WebCore::RenderMultiColumnSet::positionForPoint):
207         Refactor this function to call a helper function instead, translateRegionPointToFlowThread.
208
209         (WebCore::RenderMultiColumnSet::translateRegionPointToFlowThread):
210         This function is logical (unlike the mistaken physical function I first implemented in
211         positionForPoint).
212
213         (WebCore::RenderMultiColumnSet::updateHitTestResult):
214         * rendering/RenderMultiColumnSet.h:
215         Overridden to fill in the correct local coordinate when the HTML document is inside a paginated
216         RenderView. Note that column spans don't actually work, but once we move over to a 
217         non-column based pagination API, that will become irrelevant.
218
219 2014-04-25  Andreas Kling  <akling@apple.com>
220
221         Mark some things with WTF_MAKE_FAST_ALLOCATED.
222         <https://webkit.org/b/132198>
223
224         Use FastMalloc for more things.
225
226         Reviewed by Anders Carlsson.
227
228         * bindings/js/ScriptController.h:
229         * dom/DocumentOrderedMap.h:
230         * inspector/InspectorCSSAgent.h:
231         * inspector/InspectorDOMAgent.h:
232         * inspector/InspectorDOMDebuggerAgent.h:
233         * inspector/InspectorDOMStorageAgent.h:
234         * inspector/InspectorDatabaseAgent.h:
235         * inspector/InspectorLayerTreeAgent.h:
236         * inspector/InspectorPageAgent.h:
237         * inspector/InspectorResourceAgent.h:
238         * inspector/InspectorTimelineAgent.h:
239         * inspector/InspectorWorkerAgent.h:
240         * inspector/PageRuntimeAgent.h:
241         * loader/HistoryController.h:
242         * page/DeviceClient.h:
243         * page/DeviceController.h:
244         * page/EventHandler.h:
245         * page/Page.h:
246         * page/scrolling/ScrollingStateNode.h:
247         * platform/graphics/FontGenericFamilies.h:
248         * platform/graphics/FontPlatformData.h:
249
250 2014-04-25  Radu Stavila  <stavila@adobe.com>
251
252         [CSS Regions] Rename objectShouldPaintInFlowRegion to something more clear
253         https://bugs.webkit.org/show_bug.cgi?id=132050
254
255         Reviewed by Andreas Kling.
256
257         The objectShouldPaintInFlowRegion is no longer used only by the painting process
258         but also for hit-testing, so it was renamed to something more generic (objectShouldFragmentInFlowRegion).
259
260         No new tests required, it's just a method rename.
261
262         * rendering/RenderBlock.cpp:
263         (WebCore::RenderBlock::paint):
264         (WebCore::RenderBlock::selectionGaps):
265         (WebCore::RenderBlock::nodeAtPoint):
266         * rendering/RenderBox.cpp:
267         (WebCore::RenderBox::positionForPoint):
268         * rendering/RenderFlowThread.cpp:
269         (WebCore::RenderFlowThread::objectShouldFragmentInFlowRegion):
270         (WebCore::RenderFlowThread::objectShouldPaintInFlowRegion): Deleted.
271         * rendering/RenderFlowThread.h:
272         * rendering/RenderLayer.cpp:
273         (WebCore::RenderLayer::paintLayer):
274         (WebCore::RenderLayer::hitTestLayer):
275         * rendering/RenderRegion.cpp:
276         (WebCore::RenderRegion::ensureOverflowForBox):
277         * rendering/RenderReplaced.cpp:
278         (WebCore::RenderReplaced::shouldPaint):
279
280 2014-04-25  Enrica Casucci  <enrica@apple.com>
281
282         iOS build fix after http://trac.webkit.org/changeset/167803
283         Unreviewed.
284
285         * page/Frame.cpp:
286         (WebCore::Frame::checkOverflowScroll):
287         * rendering/RenderBlock.cpp:
288         (WebCore::positionForPointRespectingEditingBoundaries):
289
290 2014-04-24  David Hyatt  <hyatt@apple.com>
291
292         [New Multicolumn] Add support for offsetLeft and offsetTop.
293         https://bugs.webkit.org/show_bug.cgi?id=132080
294
295         Reviewed by Andrei Bucur.
296
297         Added fast/multicol/client-spanners-complex.html and offset-top-left.html
298
299         * rendering/RenderBoxModelObject.cpp:
300         (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent):
301         Patch the offsetLeft/Top loop to handle calling into RenderMultiColumnFlowThread
302         in order to adjust the coordinates for the new multicolumn layout.
303
304         * rendering/RenderMultiColumnFlowThread.cpp:
305         (WebCore::RenderMultiColumnFlowThread::mapFromFlowToRegion):
306         Modified to use a helper that can be shared by offsetLeft/Top code. This code
307         ran for client rects, and I'm moving/refactoring it for more sharing.
308
309         (WebCore::RenderMultiColumnFlowThread::physicalTranslationOffsetFromFlowToRegion):
310         (WebCore::RenderMultiColumnFlowThread::physicalTranslationFromFlowToRegion):
311         * rendering/RenderMultiColumnFlowThread.h:
312         New functions that beef up what was in mapFromFlowToRegion and fix some bugs
313         with the translation code.
314
315         * rendering/RenderMultiColumnSet.cpp:
316         (WebCore::RenderMultiColumnSet::columnTranslationForOffset):
317         Patched to factor in the flow thread portion rect of the specific multicolumn set.
318
319         * rendering/RenderObject.h:
320         (WebCore::RenderObject::isRenderMultiColumnFlowThread):
321         Added for toRenderMultiColumnFlowThread capability.
322
323 2014-04-25  Brent Fulgham  <bfulgham@apple.com>
324
325         ScrollingCoordinator is unaware of topContentInset
326         https://bugs.webkit.org/show_bug.cgi?id=132158
327         <rdar://problem/16706152>
328
329         Reviewed by Darin Adler.
330
331         Test: platform/mac/fast/scrolling/scroll-select-bottom-test.html
332
333         The calculation of non-fast-scrollable regions does not currently take
334         the topContentOffset into account. Consequently, the logic that decides
335         whether to stay on the scrolling thread, or drop down to an individual
336         page element, can make the wrong choice. This is especially true for
337         small scrollable regions (such as <select> elements), where the
338         topContentInset may be quite close to the size of the scrollable
339          element itself.
340
341         * page/scrolling/ScrollingCoordinator.cpp:
342         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): Also
343         include the topContentInset value in our calculation.
344
345 2014-04-25  Javier Fernandez  <jfernandez@igalia.com>
346
347         REGRESSION(r167799): Breaks debug build
348         https://bugs.webkit.org/show_bug.cgi?id=132194
349
350         Reviewed by Andrei Bucur.
351
352         Fix the debug bots after r167799
353
354         No new tests, no new functionality.
355
356         * css/CSSParser.cpp:
357         (WebCore::CSSParser::parseGridTemplateShorthand):
358
359 2014-04-25  Miyoung Shin  <myid.shin@samsung.com>
360
361         Web process is crashed during dispatching touchEvent created by JS.
362         https://bugs.webkit.org/show_bug.cgi?id=113225
363
364         Reviewed by Benjamin Poulain.
365
366         TouchEvent created by JS should have the necessary attributes
367         of touches, targetTouches and changedTouches.
368         It should be verified weather there are touchLists before dispatching touch event.
369
370         Test: fast/events/touch/create-touch-event-without-touchList.html
371
372         * dom/EventDispatcher.cpp:
373         (WebCore::EventDispatcher::dispatchEvent):
374         (WebCore::EventPath::updateTouchLists):
375         (WebCore::addRelatedNodeResolversForTouchList): Deleted.
376
377 2014-04-25  Philippe Normand  <pnormand@igalia.com>
378
379         [GTK] File webkitRelativePath attribute was removed in r163483
380         https://bugs.webkit.org/show_bug.cgi?id=132193
381
382         Reviewed by Carlos Garcia Campos.
383
384         Add the removed getter as deprecated API to keep backwards compatibility.
385
386         * bindings/gobject/WebKitDOMDeprecated.cpp:
387         (webkit_dom_file_get_webkit_relative_path):
388         * bindings/gobject/WebKitDOMDeprecated.h:
389         * bindings/gobject/WebKitDOMDeprecated.symbols:
390
391 2014-04-25  Radu Stavila  <stavila@adobe.com>
392
393         [CSS Regions] Overflow selection doesn't work properly
394         https://bugs.webkit.org/show_bug.cgi?id=130715
395
396         Reviewed by David Hyatt.
397
398         When hit-testing, painting block selection gaps and searching for the node at a specific point inside a flow thread,
399         the region range of the box being checked must be validated in order to not return false positives. Otherwise, hit-testing
400         at the top of region B could hit elements that overflow the bottom of region A.
401
402         Tests: fast/regions/selection-in-overflow-hit-testing.html
403                fast/regions/selection-in-overflow.html
404                fast/regions/selection-in-text-after-overflow-hit-testing.html
405
406         * accessibility/AccessibilityRenderObject.cpp:
407         (WebCore::AccessibilityRenderObject::visiblePositionRangeForLine):
408         (WebCore::AccessibilityRenderObject::visiblePositionForPoint):
409         * dom/Document.cpp:
410         (WebCore::Document::caretRangeFromPoint):
411         * editing/FrameSelection.cpp:
412         (WebCore::FrameSelection::contains):
413         * editing/VisibleUnits.cpp:
414         (WebCore::previousLinePosition):
415         (WebCore::nextLinePosition):
416         * page/EventHandler.cpp:
417         (WebCore::EventHandler::selectClosestWordFromHitTestResult):
418         (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
419         (WebCore::EventHandler::handleMousePressEventTripleClick):
420         (WebCore::EventHandler::handleMousePressEventSingleClick):
421         (WebCore::selectionExtentRespectingEditingBoundary):
422         (WebCore::EventHandler::updateSelectionForMouseDrag):
423         (WebCore::EventHandler::handleMouseReleaseEvent):
424         * page/Frame.cpp:
425         (WebCore::Frame::visiblePositionForPoint):
426         * rendering/RenderBlock.cpp:
427         (WebCore::RenderBlock::selectionGaps):
428         (WebCore::RenderBlock::nodeAtPoint):
429         (WebCore::positionForPointRespectingEditingBoundaries):
430         (WebCore::RenderBlock::positionForPointWithInlineChildren):
431         (WebCore::isChildHitTestCandidate):
432         (WebCore::RenderBlock::positionForPoint):
433         * rendering/RenderBlock.h:
434         * rendering/RenderBlockFlow.cpp:
435         (WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
436         (WebCore::RenderBlockFlow::positionForPoint):
437         * rendering/RenderBlockFlow.h:
438         * rendering/RenderBox.cpp:
439         (WebCore::RenderBox::positionForPoint):
440         * rendering/RenderBox.h:
441         * rendering/RenderFileUploadControl.cpp:
442         (WebCore::RenderFileUploadControl::positionForPoint):
443         * rendering/RenderFileUploadControl.h:
444         * rendering/RenderInline.cpp:
445         (WebCore::RenderInline::positionForPoint):
446         * rendering/RenderInline.h:
447         * rendering/RenderLineBreak.cpp:
448         (WebCore::RenderLineBreak::positionForPoint):
449         * rendering/RenderLineBreak.h:
450         * rendering/RenderMultiColumnSet.cpp:
451         (WebCore::RenderMultiColumnSet::positionForPoint):
452         * rendering/RenderMultiColumnSet.h:
453         * rendering/RenderObject.cpp:
454         (WebCore::RenderObject::positionForPoint):
455         * rendering/RenderObject.h:
456         * rendering/RenderRegion.cpp:
457         (WebCore::RenderRegion::positionForPoint):
458         * rendering/RenderRegion.h:
459         * rendering/RenderReplaced.cpp:
460         (WebCore::RenderReplaced::positionForPoint):
461         * rendering/RenderReplaced.h:
462         * rendering/RenderText.cpp:
463         (WebCore::RenderText::positionForPoint):
464         * rendering/RenderText.h:
465         * rendering/svg/RenderSVGInlineText.cpp:
466         (WebCore::RenderSVGInlineText::positionForPoint):
467         * rendering/svg/RenderSVGInlineText.h:
468         * rendering/svg/RenderSVGText.cpp:
469         (WebCore::RenderSVGText::positionForPoint):
470         * rendering/svg/RenderSVGText.h:
471
472 2014-04-25  Philippe Normand  <pnormand@igalia.com>
473
474         [GTK] Iframe seamless support was removed in r163427
475         https://bugs.webkit.org/show_bug.cgi?id=132192
476
477         Reviewed by Carlos Garcia Campos.
478
479         Add the removed get and set methods as deprecated API to keep
480         backwards compatibility.
481
482         * bindings/gobject/WebKitDOMDeprecated.cpp:
483         (webkit_dom_processing_instruction_set_data):
484         (webkit_dom_html_iframe_element_get_seamless):
485         (webkit_dom_html_iframe_element_set_seamless):
486         * bindings/gobject/WebKitDOMDeprecated.h:
487         * bindings/gobject/WebKitDOMDeprecated.symbols:
488
489 2014-04-25  Philippe Normand  <pnormand@igalia.com>
490
491         [GTK] HTMLInputElement webkitdirectory property was removed in r163483
492         https://bugs.webkit.org/show_bug.cgi?id=132191
493
494         Reviewed by Carlos Garcia Campos.
495
496         Add the removed get and set methods as deprecated API to keep
497         backwards compatibility.
498
499         * bindings/gobject/WebKitDOMDeprecated.cpp:
500         (webkit_dom_html_input_element_get_webkitdirectory):
501         (webkit_dom_html_input_element_set_webkitdirectory):
502         * bindings/gobject/WebKitDOMDeprecated.h:
503         * bindings/gobject/WebKitDOMDeprecated.symbols:
504
505 2014-04-25  Javier Fernandez  <jfernandez@igalia.com>
506
507         [CSS Grid Layout] Implementation of the grid-template shorthand.
508         https://bugs.webkit.org/show_bug.cgi?id=128980
509
510         Reviewed by Darin Adler.
511
512         This shorthand sets the values for the grid-template-columns,
513         grid-template-rows and grid-template-areas, so the implementation
514         tries to reuse as much available parsing functions as possible.
515
516         The "parsingGridTrackList" was refactored to return a CSSValue and
517         let the "parseValue" function to assign the property value. The
518         "forwardSlash" operator is now valid when the track-list clause is
519         part of a shorthand. The "parseValue" function checkouts that only
520         additional clauses are allowed when processing shorthands; the
521         grid-columns-rows-get-set.html tests was modified to verify this.
522
523         The "parseGridTemplateAreas" was refactored too, in order to
524         process single areas's rows. This is very useful for the
525         gris-template secondary syntax, which mixes areas and rows values.
526
527         Finally, the "parseGirdLineNames" function was modified as well by
528         defining an new argument to concatenate head/tail custom-ident
529         elements and ensure the identList is at the heading index, since
530         it's now possible the parseList was rewound.
531
532         The implementation of the grid-template shorthand tries first to
533         match the <grid-template-columns> / <grid-template-rows> syntax,
534         failing back to the secondary syntax if needed.  This approach
535         requires to rewind the parseList but it produces a clearer code.
536
537         Test: fast/css-grid-layout/grid-template-shorthand-get-set.html
538
539         * css/CSSComputedStyleDeclaration.cpp:
540         (WebCore::ComputedStyleExtractor::propertyValue):
541         * css/CSSParser.cpp:
542         (WebCore::CSSParser::parseValue):
543         (WebCore::CSSParser::parseGridTemplateRowsAndAreas):
544         (WebCore::CSSParser::parseGridTemplateShorthand):
545         (WebCore::CSSParser::parseGridLineNames):
546         (WebCore::CSSParser::parseGridTrackList):
547         (WebCore::CSSParser::parseGridTemplateAreasRow):
548         (WebCore::CSSParser::parseGridTemplateAreas):
549         * css/CSSParser.h:
550         * css/CSSParserValues.h:
551         (WebCore::CSSParserValueList::setCurrentIndex):
552         * css/CSSPropertyNames.in:
553         * css/StylePropertyShorthand.cpp:
554         (WebCore::webkitGridTemplateShorthand):
555         * css/StylePropertyShorthand.h:
556
557 2014-04-25  Andreas Kling  <akling@apple.com>
558
559         Remove two unused SVGDocument functions.
560         <https://webkit.org/b/132178>
561
562         Reviewed by Antti Koivisto.
563
564         * svg/SVGDocument.cpp:
565         (WebCore::SVGDocument::dispatchZoomEvent): Deleted.
566         (WebCore::SVGDocument::dispatchScrollEvent): Deleted.
567         * svg/SVGDocument.h:
568
569 2014-04-25  Ion Rosca  <rosca@adobe.com>
570
571         Incomplete body painting when using blend modes
572         https://bugs.webkit.org/show_bug.cgi?id=131889
573
574         The incomplete painting was caused by the transparency layer created for
575         the root renderer. We can safely skip creating this transparency layer at
576         the root level, as there is nothing else being painted behind this layer that
577         could be used erroneously as a backdrop.
578
579         Reviewed by Simon Fraser.
580
581         Test: css3/compositing/blend-mode-with-body.html
582
583         * rendering/RenderLayer.h:
584         Changing RenderLayer::paintsWithTransparency so that it will not
585         return true when the root renderer needs to isolate blending.
586
587 2014-04-25  Darin Adler  <darin@apple.com>
588
589         ASSERTION FAILED: "!m_isolatedWorld->isNormal() || m_wrapper || !m_jsFunction" in svg/custom/use-instanceRoot-event-listeners.xhtml
590         https://bugs.webkit.org/show_bug.cgi?id=132148
591
592         Reviewed by Andreas Kling.
593
594         Changed how JSCustomMarkFunction generation works. Instead of leaving out
595         the generated visitChildren function, just generate a call to visitAdditionalChildren.
596         This eliminates the need to repeat boilerplate.
597
598         The fix for the above bug was to correct mistaken logic where JSSVGElementInstance
599         had a visitChildren that did not properly mark event listeners because it explicitly
600         did not call through to the base class visitChildren. The new arrangement makes that
601         mistake impossible.
602
603         * bindings/js/JSAttrCustom.cpp:
604         (WebCore::JSAttr::visitAdditionalChildren): Use this instead of visitChildren.
605         * bindings/js/JSAudioTrackCustom.cpp:
606         (WebCore::JSAudioTrack::visitAdditionalChildren): Ditto.
607         * bindings/js/JSAudioTrackListCustom.cpp:
608         (WebCore::JSAudioTrackList::visitAdditionalChildren): Ditto.
609         * bindings/js/JSCSSRuleCustom.cpp:
610         (WebCore::JSCSSRule::visitAdditionalChildren): Ditto.
611         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
612         (WebCore::JSCSSStyleDeclaration::visitAdditionalChildren): Ditto.
613         * bindings/js/JSCanvasRenderingContextCustom.cpp:
614         (WebCore::JSCanvasRenderingContext::visitAdditionalChildren): Ditto.
615         * bindings/js/JSCryptoKeyPairCustom.cpp:
616         (WebCore::JSCryptoKeyPair::visitAdditionalChildren): Ditto.
617         * bindings/js/JSDOMWindowCustom.cpp:
618         (WebCore::JSDOMWindow::visitAdditionalChildren): Ditto.
619         * bindings/js/JSMessageChannelCustom.cpp:
620         (WebCore::JSMessageChannel::visitAdditionalChildren): Ditto.
621         * bindings/js/JSMessagePortCustom.cpp:
622         (WebCore::JSMessagePort::visitAdditionalChildren): Ditto.
623         * bindings/js/JSNodeCustom.cpp:
624         (WebCore::JSNode::visitAdditionalChildren): Ditto.
625         * bindings/js/JSNodeFilterCustom.cpp:
626         (WebCore::JSNodeFilter::visitAdditionalChildren): Ditto.
627         * bindings/js/JSNodeIteratorCustom.cpp:
628         (WebCore::JSNodeIterator::visitAdditionalChildren): Ditto.
629         * bindings/js/JSSVGElementInstanceCustom.cpp:
630         (WebCore::JSSVGElementInstance::visitAdditionalChildren): Ditto.
631         * bindings/js/JSSharedWorkerCustom.cpp:
632         (WebCore::JSSharedWorker::visitAdditionalChildren): Ditto.
633         * bindings/js/JSStyleSheetCustom.cpp:
634         (WebCore::JSStyleSheet::visitAdditionalChildren): Ditto.
635         * bindings/js/JSTextTrackCueCustom.cpp:
636         (WebCore::JSTextTrackCue::visitAdditionalChildren): Ditto.
637         * bindings/js/JSTextTrackCustom.cpp:
638         (WebCore::JSTextTrack::visitAdditionalChildren): Ditto.
639         * bindings/js/JSTextTrackListCustom.cpp:
640         (WebCore::JSTextTrackList::visitAdditionalChildren): Ditto.
641         * bindings/js/JSTreeWalkerCustom.cpp:
642         (WebCore::JSTreeWalker::visitAdditionalChildren): Ditto.
643         * bindings/js/JSVideoTrackCustom.cpp:
644         (WebCore::JSVideoTrack::visitAdditionalChildren): Ditto.
645         * bindings/js/JSVideoTrackListCustom.cpp:
646         (WebCore::JSVideoTrackList::visitAdditionalChildren): Ditto.
647         * bindings/js/JSWebGLRenderingContextCustom.cpp:
648         (WebCore::JSWebGLRenderingContext::visitAdditionalChildren): Ditto.
649         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
650         (WebCore::JSWorkerGlobalScope::visitAdditionalChildren): Ditto.
651         * bindings/js/JSXMLHttpRequestCustom.cpp:
652         (WebCore::JSXMLHttpRequest::visitAdditionalChildren): Ditto.
653         * bindings/js/JSXPathResultCustom.cpp:
654         (WebCore::JSXPathResult::visitAdditionalChildren): Ditto.
655
656         * bindings/js/JSDOMGlobalObject.cpp:
657         (WebCore::JSDOMGlobalObject::visitChildren): Rewrote to use modern for loops.
658
659         * bindings/scripts/CodeGeneratorJS.pm:
660         (GenerateHeader): Generate declaration of visitAdditionalChildren.
661         (GenerateImplementation): Generate call to visitAdditionalChildren.
662
663 2014-04-24  Andreas Kling  <akling@apple.com>
664
665         [iOS WebKit2] Enable optimization to mmap downloaded resources once they become file-backed.
666         <https://webkit.org/b/132171>
667         <rdar://problem/16720733>
668
669         Add a missing export for the USE(CFNETWORK) + WebKit2 combo.
670
671         Reviewed by Antti Koivisto.
672
673         * WebCore.exp.in:
674
675 2014-04-24  Darin Adler  <darin@apple.com>
676
677         FrameLoader::checkCompleted can hit the "ref'ing while destroyed" assertion
678         https://bugs.webkit.org/show_bug.cgi?id=132163
679         rdar://problem/16720640
680
681         Reviewed by Brady Eidson.
682
683         Couldn't find a way to test this yet. Would be nice to have a test.
684
685         * loader/FrameLoader.cpp:
686         (WebCore::FrameLoader::checkCompleted): Move protector until after we check
687         if the frame is already complete. That can happen in practice when this is
688         called from within the frame's destructor. All the code that runs before the
689         protector simply checks state and does not require protection.
690
691 2014-04-24  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
692
693         Mark Supplement instead of RefCountedSupplement in NavigatorContentUtils 
694         https://bugs.webkit.org/show_bug.cgi?id=132151
695
696         Reviewed by Darin Adler.
697
698         Though Original goal was to make it sharable across navigator instances, the NavigatorContentUtils
699         has used RefCountedSupplement<Page> instead of RefCountedSupplement<Navigator>. This patch makes it
700         use Supplement<Page> because there is no scenario which needs to be shared across navigator instances.
701
702         Blink merge from https://src.chromium.org/viewvc/blink?view=rev&revision=171403.
703
704         No new tests, no behavior changes.
705
706         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
707         (WebCore::NavigatorContentUtils::from):
708         (WebCore::NavigatorContentUtils::create):
709         (WebCore::provideNavigatorContentUtilsTo):
710         * Modules/navigatorcontentutils/NavigatorContentUtils.h:
711
712 2014-04-24  Commit Queue  <commit-queue@webkit.org>
713
714         Unreviewed, rolling out r167700.
715         https://bugs.webkit.org/show_bug.cgi?id=132142
716
717         Incorrectly reverted the change in r167547 for
718         webkit.org/b/131898 (Requested by rniwa on #webkit).
719
720         Reverted changeset:
721
722         "Cursor doesn't change back to pointer when leaving the Safari
723         window"
724         https://bugs.webkit.org/show_bug.cgi?id=132038
725         http://trac.webkit.org/changeset/167700
726
727 2014-04-24  Brady Eidson  <beidson@apple.com>
728
729         Rename "IMAGE_CONTROLS" feature to "SERVICE_CONTROLS"
730         https://bugs.webkit.org/show_bug.cgi?id=132155
731
732         Reviewed by Tim Horton.
733
734         No new tests (No change in behavior).
735
736         * Configurations/FeatureDefines.xcconfig:
737         * DerivedSources.make:
738         * WebCore.exp.in:
739         * css/CSSDefaultStyleSheets.cpp:
740         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
741         * css/CSSPrimitiveValueMappings.h:
742         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
743         * css/CSSValueKeywords.in:
744         * dom/Node.h:
745         * html/HTMLImageElement.cpp:
746         (WebCore::HTMLImageElement::HTMLImageElement):
747         (WebCore::HTMLImageElement::parseAttribute):
748         (WebCore::HTMLImageElement::didAttachRenderers):
749         * html/HTMLImageElement.h:
750         * html/shadow/ImageControlsRootElement.cpp:
751         * html/shadow/ImageControlsRootElement.h:
752         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
753         * html/shadow/mac/ImageControlsButtonElementMac.h:
754         * html/shadow/mac/ImageControlsRootElementMac.cpp:
755         * html/shadow/mac/ImageControlsRootElementMac.h:
756         * page/ContextMenuContext.cpp:
757         (WebCore::ContextMenuContext::ContextMenuContext):
758         * page/ContextMenuContext.h:
759         * page/ContextMenuController.cpp:
760         (WebCore::ContextMenuController::maybeCreateContextMenu):
761         (WebCore::ContextMenuController::populate):
762         * page/ContextMenuController.h:
763         * page/Settings.in:
764         * platform/ThemeTypes.h:
765         * rendering/RenderImage.cpp:
766         (WebCore::RenderImage::canHaveChildren):
767         * rendering/RenderTheme.cpp:
768         (WebCore::RenderTheme::adjustStyle):
769         (WebCore::RenderTheme::paint):
770         (WebCore::RenderTheme::paintBorderOnly):
771         (WebCore::RenderTheme::paintDecorations):
772         * rendering/RenderTheme.h:
773         * rendering/RenderThemeMac.h:
774         * rendering/RenderThemeMac.mm:
775         (WebCore::RenderThemeMac::servicesRolloverButtonCell):
776         (WebCore::RenderThemeMac::paintImageControlsButton):
777         (WebCore::RenderThemeMac::imageControlsButtonSize):
778
779 2014-04-24  Timothy Hatcher  <timothy@apple.com>
780
781         Web Inspector: Restore PageDebuggerAgent::enable / disable
782         https://bugs.webkit.org/show_bug.cgi?id=132156
783
784         Restore functions that were eroniously removed in r167530.
785
786         Reviewed by Joseph Pecoraro.
787
788         * inspector/PageDebuggerAgent.cpp:
789         (WebCore::PageDebuggerAgent::enable): Added.
790         (WebCore::PageDebuggerAgent::disable): Added.
791         * inspector/PageDebuggerAgent.h:
792
793 2014-04-24  Alexey Proskuryakov  <ap@apple.com>
794
795         Dropzone effects don't work in non-file documents
796         https://bugs.webkit.org/show_bug.cgi?id=131770
797
798         Reviewed by Darin Adler.
799
800         File documents have two quirks that were making dropzone work in these before:
801         1. An ancient hack for Dashboard allows pasteboard access from JS.
802         2. On Mac, sandbox doesn't prevent File object creation, as we already have the access.
803
804         * dom/DataTransfer.cpp:
805         (WebCore::DataTransfer::hasFileOfType):
806         (WebCore::DataTransfer::hasStringOfType):
807         * dom/DataTransfer.h:
808         Moved these functions from EventHandler to DataTransfer. We can't create a DataTransfer
809         with Files while dragging, security doesn't permit us to. But we can get the file name.
810
811         * fileapi/File.cpp:
812         (WebCore::createBlobDataForFile):
813         (WebCore::createBlobDataForFileWithName):
814         (WebCore::File::contentTypeFromFilePath):
815         (WebCore::getContentTypeFromFileName): Deleted.
816         * fileapi/File.h:
817         Exposed a function to get file type from path without creating a File first.
818         This is much cheaper than creating a File, and works even when sandbox disallows
819         read access to content, such as when dragging over a target.
820
821         * page/EventHandler.cpp:
822         (WebCore::hasDropZoneType):
823         (WebCore::hasFileOfType): Deleted.
824         (WebCore::hasStringOfType): Deleted.
825
826 2014-04-24  Commit Queue  <commit-queue@webkit.org>
827
828         Unreviewed, rolling out r167441.
829         https://bugs.webkit.org/show_bug.cgi?id=132152
830
831         Caused full screen regressions on vimeo, youtube, and others.
832         (Requested by jernoble on #webkit).
833
834         Reverted changeset:
835
836         "Fullscreen media controls are unusable in pagination mode"
837         https://bugs.webkit.org/show_bug.cgi?id=131705
838         http://trac.webkit.org/changeset/167441
839
840 2014-04-24  Adenilson Cavalcanti  <cavalcantii@gmail.com>
841
842         Unused class forward declarations in Page
843         https://bugs.webkit.org/show_bug.cgi?id=132141
844
845         Reviewed by Benjamin Poulain.
846
847         No new tests, no change on behavior.
848
849         * page/Page.h:
850
851 2014-04-24  Eric Carlson  <eric.carlson@apple.com>
852
853         [Mac] don't ask for AVAssetTrack properties before they are available
854         https://bugs.webkit.org/show_bug.cgi?id=131902
855         <rdar://problem/16505076>
856
857         Reviewed by Brent Fulgham.
858
859         No new tests, the behavior this changes can not be tested with a layout test.
860
861         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
862         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
863         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Initialize
864             m_cachedTotalBytes.
865         (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata): Don't report that
866             metadata has been loaded until the track properties we need have been loaded too.
867         (WebCore::MediaPlayerPrivateAVFoundationObjC::totalBytes): Cache totalBytes instead
868             of recalculating it every time.
869         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange): Invalidate cached
870             total bytes.
871         (WebCore::assetTrackMetadataKeyNames): Array of AVAssetTrack properties we use.
872
873 2014-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
874
875         Unify platformWidthForGlyph across OS X and iOS
876         https://bugs.webkit.org/show_bug.cgi?id=132036
877
878         Reviewed by Darin Adler.
879
880         This patch creates on shared SimpleFontData::platformWidthForGlyph() function for both OS X and iOS.
881
882         No new tests are necessary because there should be no behavior changes.
883
884         * platform/graphics/SimpleFontData.h: Signatures for two helper functions
885         * platform/graphics/ios/SimpleFontDataIOS.mm: Replace iOS implementation of platformWidthForGlyph() with
886         implementations of only the two helper functions
887         (WebCore::SimpleFontData::getRenderingStyle): Compute style argument to CGFontGetGlyphAdvancesForStyle()
888         (WebCore::SimpleFontData::advanceForColorBitmapFont): iOS doesn't have color bitmap fonts
889         (WebCore::SimpleFontData::platformWidthForGlyph): Deleted.
890         * platform/graphics/mac/SimpleFontDataMac.mm:
891         (WebCore::SimpleFontData::getRenderingStyle): Compute style argument to CGFontGetGlyphAdvancesForStyle()
892         (WebCore::SimpleFontData::advanceForColorBitmapFont): Use [NSFont advancementForGlyph] to compute the advance
893         (WebCore::hasCustomTracking): Removed #if
894         (WebCore::isEmoji): Only relevant on iOS
895         (WebCore::SimpleFontData::platformWidthForGlyph): Shared implementation. Calls helper functions.
896
897 2014-04-24  Zalan Bujtas  <zalan@apple.com>
898
899         Subpixel rendering: Clipping on text areas when shifted by one device pixel.
900         https://bugs.webkit.org/show_bug.cgi?id=132008
901
902         Reviewed by Darin Adler.
903
904         Make RenderTheme paint* functions LayoutRect aware. Textarea is device pixel snapped, while
905         other theme controls are still on integral size/positions.
906
907         Test: fast/forms/hidpi-textarea-on-subpixel-position.html
908
909         * rendering/RenderBox.cpp:
910         (WebCore::RenderBox::paintBoxDecorations):
911         * rendering/RenderTheme.cpp:
912         (WebCore::RenderTheme::paint):
913         (WebCore::RenderTheme::paintBorderOnly):
914         (WebCore::RenderTheme::paintDecorations):
915         * rendering/RenderTheme.h:
916         (WebCore::RenderTheme::paintTextField):
917         (WebCore::RenderTheme::paintTextFieldDecorations):
918         (WebCore::RenderTheme::paintTextArea):
919         (WebCore::RenderTheme::paintTextAreaDecorations):
920         * rendering/RenderThemeIOS.h:
921         * rendering/RenderThemeIOS.mm:
922         (WebCore::RenderThemeIOS::paintTextFieldDecorations):
923         (WebCore::RenderThemeIOS::paintTextAreaDecorations):
924         * rendering/RenderThemeMac.h:
925         * rendering/RenderThemeMac.mm:
926         (WebCore::RenderThemeMac::paintTextField):
927         (WebCore::RenderThemeMac::paintTextArea):
928
929 2014-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
930
931         FontCache::fontCache() never returns nullptr so it can be made to return a reference instead
932         https://bugs.webkit.org/show_bug.cgi?id=132110
933
934         Reviewed by Tim Horton.
935
936         Updates callers to use '.' instead of '->'.
937
938         No new tests are necessary because there should be no behavior change.
939
940         * css/CSSFontFaceSource.cpp:
941         (WebCore::CSSFontFaceSource::getFontData):
942         * css/CSSFontSelector.cpp:
943         (WebCore::CSSFontSelector::CSSFontSelector):
944         (WebCore::CSSFontSelector::~CSSFontSelector):
945         (WebCore::CSSFontSelector::addFontFaceRule):
946         (WebCore::fontDataForGenericFamily):
947         (WebCore::CSSFontSelector::getFallbackFontData):
948         * platform/MemoryPressureHandler.cpp:
949         (WebCore::MemoryPressureHandler::releaseMemory):
950         * platform/graphics/FontCache.cpp:
951         (WebCore::fontCache): Return a reference
952         * platform/graphics/FontCache.h:
953         (WebCore::FontCachePurgePreventer::FontCachePurgePreventer):
954         (WebCore::FontCachePurgePreventer::~FontCachePurgePreventer):
955         * platform/graphics/FontGlyphs.cpp:
956         (WebCore::FontGlyphs::FontGlyphs):
957         (WebCore::FontGlyphs::releaseFontData):
958         (WebCore::FontGlyphs::realizeFontDataAt):
959         (WebCore::FontGlyphs::glyphDataAndPageForCharacter):
960         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
961         (WebCore::FontPlatformData::verticalData):
962         * platform/graphics/ios/SimpleFontDataIOS.mm:
963         (WebCore::SimpleFontData::platformCreateScaledFontData):
964         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
965         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
966         * platform/graphics/mac/FontCacheMac.mm:
967         (WebCore::invalidateFontCache):
968         (WebCore::fontCacheRegisteredFontsChangedNotificationCallback):
969         * platform/graphics/mac/SimpleFontDataMac.mm:
970         (WebCore::SimpleFontData::platformDestroy):
971         (WebCore::SimpleFontData::platformCreateScaledFontData):
972         * platform/graphics/win/FontCacheWin.cpp:
973         (WebCore::getCJKCodePageMasks):
974         * platform/graphics/win/SimpleFontDataWin.cpp:
975         (WebCore::SimpleFontData::containsCharacters):
976         * platform/graphics/wince/FontCacheWinCE.cpp:
977         (WebCore::getCJKCodePageMasks):
978         * platform/graphics/wince/FontPlatformData.cpp:
979         (WebCore::FontFamilyCodePageInfo::codePages):
980         (WebCore::FixedSizeFontData::create):
981         * platform/graphics/wince/GlyphPageTreeNodeWinCE.cpp:
982         (WebCore::GlyphPage::fill):
983         * platform/graphics/wince/SimpleFontDataWinCE.cpp:
984         (WebCore::SimpleFontData::platformCreateScaledFontData):
985         (WebCore::SimpleFontData::containsCharacters):
986
987 2014-04-24  Eric Carlson  <eric.carlson@apple.com>
988
989         [iOS] Manage AudioSession category according to media type
990         https://bugs.webkit.org/show_bug.cgi?id=132096
991
992         Reviewed by Jer Noble.
993
994         * WebCore.exp.in: Export setting.
995
996         * html/HTMLMediaSession.cpp:
997         (WebCore::HTMLMediaSession::HTMLMediaSession):
998         (WebCore::initializeAudioSession): Deleted.
999
1000         * page/Settings.cpp:
1001         * page/Settings.h:
1002         (WebCore::Settings::setShouldManageAudioSession): New.
1003         (WebCore::Settings::shouldManageAudioSession): Ditto.
1004
1005         * platform/audio/ios/AudioDestinationIOS.cpp:
1006         (WebCore::AudioDestinationIOS::AudioDestinationIOS): Use a MediaSession instead of inheriting
1007             from AudioListener and calling the AudioSession directly.
1008         (WebCore::AudioDestinationIOS::~AudioDestinationIOS): Ditto.
1009         (WebCore::AudioDestinationIOS::start): Notify session.
1010         (WebCore::AudioDestinationIOS::stop): Ditto.
1011         (WebCore::AudioDestinationIOS::beganAudioInterruption): Deleted.
1012         (WebCore::AudioDestinationIOS::endedAudioInterruption): Deleted.
1013         * platform/audio/ios/AudioDestinationIOS.h:
1014         (WebCore::AudioDestinationIOS::mediaType):
1015         (WebCore::AudioDestinationIOS::canReceiveRemoteControlCommands):
1016         (WebCore::AudioDestinationIOS::didReceiveRemoteControlCommand):
1017         (WebCore::AudioDestinationIOS::isPlaying): Deleted.
1018
1019         * platform/audio/ios/AudioSessionIOS.mm:
1020         (WebCore::categoryName): Debug-only logging function.
1021         (WebCore::AudioSession::setCategory): Don't stick with "media" once it is set.
1022
1023         * platform/audio/ios/MediaSessionManagerIOS.mm:
1024         (WebCore::MediaSessionManageriOS::resetRestrictions): Set up restrictions for WebAudio.
1025         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Don't set invalid start time.
1026
1027         * platform/audio/mac/MediaSessionManagerMac.cpp:
1028         (MediaSessionManager::updateSessionState): Manage AudioSession.active when WebAudio clients
1029             come and go. Manage AudioSession.category according to the number of WebAudio and
1030             HTMLMediaElement clients.
1031
1032 2014-04-24  David Hyatt  <hyatt@apple.com>
1033
1034         [New Multicolumn] Client rects don't work with column spans.
1035         https://bugs.webkit.org/show_bug.cgi?id=132131
1036
1037         Reviewed by Dean Jackson.
1038         
1039         Don't factor in the offset of the multicolumn set from the top
1040         of the multicolumn block. This was added already, and it doesn't
1041         need to be a part of columnTranslationForOffset.
1042
1043         Added fast/multicol/client-rects-spanners.html
1044
1045         * rendering/RenderMultiColumnSet.cpp:
1046         (WebCore::RenderMultiColumnSet::columnTranslationForOffset):
1047
1048 2014-04-24  Praveen R Jadhav  <praveen.j@samsung.com>
1049
1050         [EFL] WebKit build fails when MEDIA_SOURCE is enabled
1051         https://bugs.webkit.org/show_bug.cgi?id=132118
1052
1053         Reviewed by Brent Fulgham.
1054
1055         Files MediaSourceGStreamer.cpp, SourceBufferPrivateGStreamer.cpp and
1056         WebKitMediaSourceGStreamer.cpp are included for EFL port build.
1057
1058         No new tests. No change in behaviour.
1059
1060         * PlatformEfl.cmake: MediaSourceGStreamer.cpp, SourceBufferPrivateGStreamer.cpp
1061         and WebKitMediaSourceGStreamer.cpp are included for compilation.
1062
1063 2014-04-24  Tamas Gergely  <tgergely.u-szeged@partner.samsung.com>
1064
1065         ASSERTION FAILED: !begin.isIndefinite() in WebCore::SVGSMILElement::resolveFirstInterval.
1066         https://bugs.webkit.org/show_bug.cgi?id=131097
1067
1068         Reviewed by Darin Adler.
1069
1070         According to smil animation reference, max attribute cannot be 0.
1071
1072         Test: svg/animations/smil-animation-max-attribute-zero-crash.svg
1073
1074         * svg/animation/SVGSMILElement.cpp:
1075         (WebCore::SVGSMILElement::maxValue):
1076           changed (result < 0) to (result <= 0)
1077
1078 2014-04-24  Ryuan Choi  <ryuan.choi@samsung.com>
1079
1080         Remove screenColorProfile()
1081         https://bugs.webkit.org/show_bug.cgi?id=132035
1082
1083         Reviewed by Darin Adler.
1084
1085         Only chromium used screenColorProfile() since r120789.
1086
1087         * platform/PlatformScreen.h:
1088         * platform/efl/PlatformScreenEfl.cpp:
1089         (WebCore::screenColorProfile): Deleted.
1090         * platform/gtk/PlatformScreenGtk.cpp:
1091         (WebCore::screenColorProfile): Deleted.
1092         * platform/image-decoders/ImageDecoder.h:
1093         (WebCore::ImageDecoder::qcmsOutputDeviceProfile):
1094         * platform/ios/PlatformScreenIOS.mm:
1095         (WebCore::screenColorProfile): Deleted.
1096         * platform/mac/PlatformScreenMac.mm:
1097         (WebCore::screenColorProfile): Deleted.
1098         * platform/win/PlatformScreenWin.cpp:
1099         (WebCore::screenColorProfile): Deleted.
1100
1101 2014-04-24  Zalan Bujtas  <zalan@apple.com>
1102
1103         One more unreviewed build fix after r167755.
1104
1105         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
1106         (WebCore::RenderImageControlsButton::updateLogicalWidth):
1107         (WebCore::RenderImageControlsButton::computeLogicalHeight):
1108
1109 2014-04-24  Zalan Bujtas  <zalan@apple.com>
1110
1111         Unreviewed build fix after r167755.
1112
1113         * rendering/RenderThemeMac.h:
1114
1115 2014-04-24  Zalan Bujtas  <zalan@apple.com>
1116
1117         Transition RenderTheme API from RenderObject* to const RenderObject&
1118         https://bugs.webkit.org/show_bug.cgi?id=132037
1119
1120         Reviewed by Andreas Kling.
1121
1122         Using const references provides better encapsulation and improve security.
1123
1124         No change in behavior.
1125
1126         * accessibility/AccessibilityObject.cpp:
1127         (WebCore::AccessibilityObject::boundingBoxForQuads):
1128         * dom/Element.cpp:
1129         (WebCore::Element::setActive):
1130         (WebCore::Element::setHovered):
1131         * editing/FrameSelection.cpp:
1132         (WebCore::FrameSelection::focusedOrActiveStateChanged):
1133         * html/HTMLFormControlElement.cpp:
1134         (WebCore::HTMLFormControlElement::disabledStateChanged):
1135         (WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
1136         * html/HTMLInputElement.cpp:
1137         (WebCore::HTMLInputElement::setChecked):
1138         (WebCore::HTMLInputElement::setIndeterminate):
1139         * html/HTMLOptionElement.cpp:
1140         (WebCore::HTMLOptionElement::parseAttribute):
1141         * rendering/RenderBlock.cpp:
1142         (WebCore::RenderBlock::addVisualOverflowFromTheme):
1143         (WebCore::RenderBlock::baselinePosition):
1144         * rendering/RenderBox.cpp:
1145         (WebCore::RenderBox::paintBoxDecorations):
1146         * rendering/RenderButton.cpp:
1147         (WebCore::RenderButton::styleDidChange):
1148         * rendering/RenderFileUploadControl.cpp:
1149         (WebCore::RenderFileUploadControl::paintObject):
1150         * rendering/RenderFlowThread.cpp:
1151         (WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme):
1152         * rendering/RenderObject.cpp:
1153         (WebCore::RenderObject::drawLineForBoxSide):
1154         * rendering/RenderObject.h:
1155         * rendering/RenderProgress.cpp:
1156         (WebCore::RenderProgress::computeLogicalHeight):
1157         * rendering/RenderTextControlSingleLine.cpp:
1158         (WebCore::RenderTextControlSingleLine::paint):
1159         * rendering/RenderTheme.cpp:
1160         (WebCore::RenderTheme::paint):
1161         (WebCore::RenderTheme::paintBorderOnly):
1162         (WebCore::RenderTheme::paintDecorations):
1163         (WebCore::RenderTheme::baselinePosition):
1164         (WebCore::RenderTheme::adjustRepaintRect):
1165         (WebCore::RenderTheme::stateChanged):
1166         (WebCore::RenderTheme::updateControlStatesForRenderer):
1167         (WebCore::RenderTheme::extractControlStatesForRenderer):
1168         (WebCore::RenderTheme::isActive):
1169         (WebCore::RenderTheme::isChecked):
1170         (WebCore::RenderTheme::isIndeterminate):
1171         (WebCore::RenderTheme::isEnabled):
1172         (WebCore::RenderTheme::isFocused):
1173         (WebCore::RenderTheme::isPressed):
1174         (WebCore::RenderTheme::isSpinUpButtonPartPressed):
1175         (WebCore::RenderTheme::isReadOnlyControl):
1176         (WebCore::RenderTheme::isHovered):
1177         (WebCore::RenderTheme::isSpinUpButtonPartHovered):
1178         (WebCore::RenderTheme::isDefault):
1179         (WebCore::RenderTheme::paintInputFieldSpeechButton):
1180         (WebCore::RenderTheme::paintMeter):
1181         (WebCore::RenderTheme::paintSliderTicks):
1182         (WebCore::RenderTheme::progressBarRectForBounds):
1183         * rendering/RenderTheme.h:
1184         (WebCore::RenderTheme::controlSupportsTints):
1185         (WebCore::RenderTheme::paintCapsLockIndicator):
1186         (WebCore::RenderTheme::paintFileUploadIconDecorations):
1187         (WebCore::RenderTheme::imageControlsButtonSize):
1188         (WebCore::RenderTheme::paintCheckbox):
1189         (WebCore::RenderTheme::paintRadio):
1190         (WebCore::RenderTheme::paintButton):
1191         (WebCore::RenderTheme::paintInnerSpinButton):
1192         (WebCore::RenderTheme::paintCheckboxDecorations):
1193         (WebCore::RenderTheme::paintRadioDecorations):
1194         (WebCore::RenderTheme::paintButtonDecorations):
1195         (WebCore::RenderTheme::paintTextField):
1196         (WebCore::RenderTheme::paintTextFieldDecorations):
1197         (WebCore::RenderTheme::paintTextArea):
1198         (WebCore::RenderTheme::paintTextAreaDecorations):
1199         (WebCore::RenderTheme::paintMenuList):
1200         (WebCore::RenderTheme::paintMenuListDecorations):
1201         (WebCore::RenderTheme::paintMenuListButtonDecorations):
1202         (WebCore::RenderTheme::paintPushButtonDecorations):
1203         (WebCore::RenderTheme::paintSquareButtonDecorations):
1204         (WebCore::RenderTheme::paintProgressBar):
1205         (WebCore::RenderTheme::paintSliderTrack):
1206         (WebCore::RenderTheme::paintSliderThumb):
1207         (WebCore::RenderTheme::paintSliderThumbDecorations):
1208         (WebCore::RenderTheme::paintSearchField):
1209         (WebCore::RenderTheme::paintSearchFieldDecorations):
1210         (WebCore::RenderTheme::paintSearchFieldCancelButton):
1211         (WebCore::RenderTheme::paintSearchFieldDecorationPart):
1212         (WebCore::RenderTheme::paintSearchFieldResultsDecorationPart):
1213         (WebCore::RenderTheme::paintSearchFieldResultsButton):
1214         (WebCore::RenderTheme::paintMediaFullscreenButton):
1215         (WebCore::RenderTheme::paintMediaPlayButton):
1216         (WebCore::RenderTheme::paintMediaOverlayPlayButton):
1217         (WebCore::RenderTheme::paintMediaMuteButton):
1218         (WebCore::RenderTheme::paintMediaSeekBackButton):
1219         (WebCore::RenderTheme::paintMediaSeekForwardButton):
1220         (WebCore::RenderTheme::paintMediaSliderTrack):
1221         (WebCore::RenderTheme::paintMediaSliderThumb):
1222         (WebCore::RenderTheme::paintMediaVolumeSliderContainer):
1223         (WebCore::RenderTheme::paintMediaVolumeSliderTrack):
1224         (WebCore::RenderTheme::paintMediaVolumeSliderThumb):
1225         (WebCore::RenderTheme::paintMediaRewindButton):
1226         (WebCore::RenderTheme::paintMediaReturnToRealtimeButton):
1227         (WebCore::RenderTheme::paintMediaToggleClosedCaptionsButton):
1228         (WebCore::RenderTheme::paintMediaControlsBackground):
1229         (WebCore::RenderTheme::paintMediaCurrentTime):
1230         (WebCore::RenderTheme::paintMediaTimeRemaining):
1231         (WebCore::RenderTheme::paintMediaFullScreenVolumeSliderTrack):
1232         (WebCore::RenderTheme::paintMediaFullScreenVolumeSliderThumb):
1233         (WebCore::RenderTheme::paintSnapshottedPluginOverlay):
1234         (WebCore::RenderTheme::paintImageControlsButton):
1235         * rendering/RenderThemeIOS.h:
1236         * rendering/RenderThemeIOS.mm:
1237         (WebCore::RenderThemeIOS::addRoundedBorderClip):
1238         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
1239         (WebCore::RenderThemeIOS::baselinePosition):
1240         (WebCore::RenderThemeIOS::paintRadioDecorations):
1241         (WebCore::RenderThemeIOS::paintTextFieldDecorations):
1242         (WebCore::RenderThemeIOS::paintTextAreaDecorations):
1243         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
1244         (WebCore::RenderThemeIOS::paintSliderTrack):
1245         (WebCore::RenderThemeIOS::paintSliderThumbDecorations):
1246         (WebCore::RenderThemeIOS::paintProgressBar):
1247         (WebCore::RenderThemeIOS::paintSearchFieldDecorations):
1248         (WebCore::RenderThemeIOS::paintButtonDecorations):
1249         (WebCore::RenderThemeIOS::paintPushButtonDecorations):
1250         (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
1251         * rendering/RenderThemeMac.h:
1252         (WebCore::RenderThemeMac::updateActiveState):
1253         * rendering/RenderThemeMac.mm:
1254         (WebCore::RenderThemeMac::documentViewFor):
1255         (WebCore::RenderThemeMac::adjustRepaintRect):
1256         (WebCore::RenderThemeMac::convertToPaintingRect):
1257         (WebCore::RenderThemeMac::updateCheckedState):
1258         (WebCore::RenderThemeMac::updateEnabledState):
1259         (WebCore::RenderThemeMac::updateFocusedState):
1260         (WebCore::RenderThemeMac::updatePressedState):
1261         (WebCore::RenderThemeMac::controlSupportsTints):
1262         (WebCore::RenderThemeMac::paintTextField):
1263         (WebCore::RenderThemeMac::paintCapsLockIndicator):
1264         (WebCore::RenderThemeMac::paintTextArea):
1265         (WebCore::RenderThemeMac::paintMenuList):
1266         (WebCore::RenderThemeMac::paintMeter):
1267         (WebCore::RenderThemeMac::progressBarRectForBounds):
1268         (WebCore::RenderThemeMac::paintProgressBar):
1269         (WebCore::RenderThemeMac::paintMenuListButtonGradients):
1270         (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
1271         (WebCore::RenderThemeMac::setPopupButtonCellState):
1272         (WebCore::RenderThemeMac::paintSliderTrack):
1273         (WebCore::RenderThemeMac::paintSliderThumb):
1274         (WebCore::RenderThemeMac::paintSearchField):
1275         (WebCore::RenderThemeMac::setSearchCellState):
1276         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1277         (WebCore::RenderThemeMac::paintSearchFieldDecorationPart):
1278         (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
1279         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
1280         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
1281         (WebCore::RenderThemeMac::paintImageControlsButton):
1282         (WebCore::RenderThemeMac::imageControlsButtonSize):
1283
1284 2014-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1285
1286         [GTK] HTML Media capture attribute is a boolean since r163958
1287         https://bugs.webkit.org/show_bug.cgi?id=132061
1288
1289         Reviewed by Gustavo Noronha Silva.
1290
1291         Add new methods webkit_dom_html_input_element_get_capture_enabled
1292         and webkit_dom_html_input_element_set_capture_enabled using a
1293         boolean and deprecate the old methods.
1294
1295         * bindings/gobject/WebKitDOMDeprecated.cpp:
1296         (webkit_dom_html_input_element_get_capture):
1297         (webkit_dom_html_input_element_set_capture):
1298         * bindings/gobject/WebKitDOMDeprecated.h:
1299         * bindings/gobject/WebKitDOMDeprecated.symbols:
1300         * bindings/gobject/webkitdom.symbols:
1301         * bindings/scripts/CodeGeneratorGObject.pm:
1302         (GetEffectiveFunctionName): Helper function to rename API methods
1303         for special cases.
1304         (GenerateFunction): Use GetEffectiveFunctionName().
1305
1306 2014-04-23  Praveen R Jadhav  <praveen.j@samsung.com>
1307
1308         [MediaStream] Implement MediaStream active attribute
1309         https://bugs.webkit.org/show_bug.cgi?id=131973
1310
1311         Reviewed by Eric Carlson.
1312
1313         MediaStream .active attribute are introduced which will replace
1314         .ended attribute. This patch implements the newly introduced attributes.
1315
1316         MediaStream-add-remove-tracks.html is updated to handle this scenario.
1317
1318         * Modules/mediastream/MediaStream.cpp:
1319         (WebCore::MediaStream::active): Added.
1320         (WebCore::MediaStream::setActive): Added.
1321         (WebCore::MediaStream::addTrack): Propagates 'onactive' event when required.
1322         (WebCore::MediaStream::removeTrack): Propagates 'oninactive' event when required.
1323         (WebCore::MediaStream::trackDidEnd): Propagates 'oninactive' event when required.
1324         (WebCore::MediaStream::streamDidEnd):
1325         (WebCore::MediaStream::setStreamIsActive): Added.
1326         * Modules/mediastream/MediaStream.h:
1327         * Modules/mediastream/MediaStream.idl:
1328         * dom/EventNames.h:
1329         * platform/mediastream/MediaStreamPrivate.cpp:
1330         (WebCore::MediaStreamPrivate::MediaStreamPrivate): Initialize .active attribute
1331         (WebCore::MediaStreamPrivate::setEnded):
1332         (WebCore::MediaStreamPrivate::setActive): Added.
1333         * platform/mediastream/MediaStreamPrivate.h:
1334         (WebCore::MediaStreamPrivate::active): Added.
1335
1336 2014-04-23  Darin Adler  <darin@apple.com>
1337
1338         [Cocoa] fix CF leaks found by code inspection
1339         https://bugs.webkit.org/show_bug.cgi?id=132106
1340
1341         Reviewed by Andreas Kling.
1342
1343         * page/CaptionUserPreferencesMediaAF.cpp:
1344         (WebCore::trackDisplayName): Added a missing adoptCF.
1345
1346         * platform/Language.cpp:
1347         (WebCore::displayNameForLanguageLocale): Added a missing adoptCF.
1348
1349         * platform/graphics/FontPlatformData.cpp:
1350         (WebCore::FontPlatformData::openTypeTable): Added a missing adoptCF.
1351
1352         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
1353         (WebCore::InbandTextTrackPrivateAVCF::label): Added two missing adoptCF.
1354
1355         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1356         (WebCore::AVFWrapper::createImageForTimeInRect): Added two missing adoptCF.
1357
1358         * platform/graphics/cg/PDFDocumentImage.cpp:
1359         (WebCore::PDFDocumentImage::createPDFDocument): Added missing adoptCF.
1360
1361         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1362         (WebCore::cascadeToLastResortFontDescriptor): Added two missing adoptCF.
1363
1364         * platform/graphics/mac/FontMac.mm:
1365         (WebCore::Font::primaryFontDataIsSystemFont): Added missing adoptCF.
1366
1367         * platform/graphics/mac/SimpleFontDataMac.mm:
1368         (WebCore::hasCustomTracking): Added missing adoptCF.
1369
1370         * platform/image-decoders/ImageDecoder.h:
1371         (WebCore::ImageDecoder::qcmsOutputDeviceProfile): Added CFRelease.
1372
1373         * plugins/mac/PluginPackageMac.cpp:
1374         (WebCore::readPListFile): Added two missing adoptCF.
1375
1376 2014-04-23  Ryosuke Niwa  <rniwa@webkit.org>
1377
1378         REGRESSION (r157328): popover to check into flight ba.com dismisses instantly when focusing form
1379         https://bugs.webkit.org/show_bug.cgi?id=131949
1380
1381         Address the review comment.
1382
1383         * dom/EventDispatcher.cpp:
1384         (WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope):
1385
1386 2014-04-23  Andreas Kling  <akling@apple.com>
1387
1388         CachedResourceLoader hoards URLs indefinitely for no good reason.
1389         <https://webkit.org/b/132102>
1390         <rdar://problem/16708265>
1391
1392         Since we don't care about CachedResourceLoader::m_validatedURL's after
1393         the Document has finished dispatching its initial load event, clear the
1394         set at that point, and don't add any new URLs to it.
1395
1396         Reviewed by Anders Carlsson.
1397
1398         * dom/Document.cpp:
1399         (WebCore::Document::dispatchWindowLoadEvent):
1400         * loader/cache/CachedResourceLoader.cpp:
1401         (WebCore::CachedResourceLoader::requestResource):
1402         (WebCore::CachedResourceLoader::documentDidFinishLoadEvent):
1403         * loader/cache/CachedResourceLoader.h:
1404
1405 2014-04-23  Andreas Kling  <akling@apple.com>
1406
1407         Canvas cache of clean URLs can grow without bounds.
1408         <https://webkit.org/b/132091>
1409         <rdar://problem/16695665>
1410
1411         Remove a silly "optimization" that kept a cache of clean URLs
1412         that can be drawn into a canvas without tainting it, all to avoid
1413         the "expensive" checks to determine whether it would taint.
1414
1415         Reviewed by Benjamin Poulain.
1416
1417         * html/canvas/CanvasRenderingContext.cpp:
1418         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
1419         * html/canvas/CanvasRenderingContext.h:
1420
1421 2014-04-23  Benjamin Poulain  <bpoulain@apple.com>
1422
1423         [iOS][WK2] Fix a few mistakes affecting the initial layout and the initial unobscured rect
1424         https://bugs.webkit.org/show_bug.cgi?id=132093
1425
1426         Reviewed by Tim Horton.
1427
1428         Change the minimum layout size to float point values to account for size defined on retina displays.
1429         The minimum layout size supports half-pixels, the value is rounded later when computing the layout size
1430         in document coordinates.
1431
1432         * WebCore.exp.in:
1433         * page/ViewportConfiguration.cpp:
1434         (WebCore::ViewportConfiguration::ViewportConfiguration):
1435         Setting the initial content size is incorrect. The layout size computation already take into account
1436         empty size for the first layout.
1437
1438         Setting the content size upfront make the first computation incorrect when the viewport arguments specify
1439         the initial scale.
1440
1441         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
1442         * page/ViewportConfiguration.h:
1443         (WebCore::ViewportConfiguration::minimumLayoutSize):
1444
1445 2014-04-23  Brent Fulgham  <bfulgham@apple.com>
1446
1447         [Mac, iOS] Stop buffering media when on an inactive tab. 
1448         https://bugs.webkit.org/show_bug.cgi?id=132077
1449
1450         Reviewed by Eric Carlson.
1451
1452         * html/HTMLMediaElement.cpp: Rename 'm_isDisplaySleepDisablingSuspended'
1453         to 'm_elementIsHidden'.
1454         (WebCore::HTMLMediaElement::HTMLMediaElement):
1455         (WebCore::HTMLMediaElement::visibilityStatusChanged): Notify the
1456         media session that the element is (or is not) hidden.
1457         (WebCore::HTMLMediaElement::setShouldBufferData): Added.
1458         * html/HTMLMediaElement.h:
1459         * platform/audio/MediaSession.cpp:
1460         (WebCore::MediaSession::clientWillBeginPlayback): Tell media to
1461         buffer if not hidden or playing.
1462         (WebCore::MediaSession::clientWillPausePlayback): Ditto.
1463         (WebCore::MediaSession::visibilityChanged): Added. Client API, just relays call
1464         to updateClientDataBuffering.
1465         (WebCore::MediaSession::updateClientDataBuffering): Tell client it should only
1466         buffer data if it's currently playing, or not hidden.
1467         * platform/audio/MediaSession.h:
1468         * platform/graphics/MediaPlayer.cpp:
1469         (WebCore::MediaPlayer::setShouldBufferData): Added: Just relays to
1470         MediaPlayerPrivate object.
1471         * platform/graphics/MediaPlayer.h:
1472         * platform/graphics/MediaPlayerPrivate.h:
1473         (WebCore::MediaPlayerPrivateInterface::setShouldBufferData):
1474         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1475         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1476         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
1477         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): Added.
1478         Detach the player item from the player if we don't want to continue
1479         buffering or other background tasks.
1480
1481 2014-04-23  Alexey Proskuryakov  <ap@apple.com>
1482
1483         Eliminate internals.setMockScrollbarsEnabled()
1484         https://bugs.webkit.org/show_bug.cgi?id=132085
1485
1486         Reviewed by Tim Horton.
1487
1488         This was essentially unused, and also didnt work.
1489
1490         * testing/InternalSettings.cpp:
1491         (WebCore::InternalSettings::Backup::restoreTo):
1492         (WebCore::InternalSettings::setMockScrollbarsEnabled): Deleted.
1493         * testing/InternalSettings.h:
1494         * testing/InternalSettings.idl:
1495
1496 2014-04-23  Anders Carlsson  <andersca@apple.com>
1497
1498         Don't migrate the WKView.h header from WebCore to WebKit
1499         https://bugs.webkit.org/show_bug.cgi?id=132086
1500
1501         Reviewed by Dan Bernstein.
1502
1503         * WebCore.xcodeproj/project.pbxproj:
1504         Add WAKViewInternal.h.
1505
1506         * platform/WAKViewInternal.h: Added.
1507
1508         * platform/ios/wak/WAKClipView.m:
1509         Import WAKViewInternal.h instead of WAKViewPrivate.h.
1510
1511         * platform/ios/wak/WAKScrollView.mm:
1512         Import WAKViewInternal.h instead of WAKViewPrivate.h.
1513
1514         * platform/ios/wak/WAKView.h:
1515         Move ivars to a class extension in WAKViewInternal.h and remove WKView.h import.
1516
1517         * platform/ios/wak/WAKView.mm:
1518         Import WAKViewInternal.h instead of WAKViewPrivate.h.
1519
1520         * platform/ios/wak/WAKViewPrivate.h:
1521         Import WKViewPrivate.h.
1522
1523 2014-04-23  David Hyatt  <hyatt@apple.com>
1524
1525         [New Multicolumn] fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode.html fails
1526         https://bugs.webkit.org/show_bug.cgi?id=132078
1527
1528         Reviewed by Anders Carlsson.
1529
1530         * rendering/RenderBox.cpp:
1531         (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
1532         Add a parameter to test for orthogonal writing modes. If we're perpendicular,
1533         then we should not skip the flow thread, since we resolve relative to the column width,
1534         and that is always set.
1535
1536         (WebCore::RenderBox::computePercentageLogicalHeight):
1537         Patched to pass in whether or not the box and the ancestor block are perpendicular.
1538
1539         * rendering/RenderBox.h:
1540         Patched the signature of skipContainingBlockForPercentHeightCalculation
1541
1542 2014-04-23  Myles C. Maxfield  <mmaxfield@apple.com>
1543
1544         [OS X] Make checking if a font is the system font more robust
1545         https://bugs.webkit.org/show_bug.cgi?id=132030
1546
1547         Reviewed by Dean Jackson.
1548
1549         Instead of inspecting a font's name to determine if it is a system font,
1550         on OS X we can ask the system directly.
1551
1552         This patch also moves a platform-specific check into platform-specific
1553         code, so that other platforms don't check for OS X-specific behavior.
1554
1555         Covered by existing tests.
1556
1557         * platform/graphics/Font.cpp:
1558         (WebCore::Font::hasValidAverageCharWidth):
1559         * platform/graphics/Font.h:
1560         * platform/graphics/mac/FontMac.mm:
1561         (WebCore::Font::primaryFontDataIsSystemFont):
1562
1563 2014-04-23  David Hyatt  <hyatt@apple.com>
1564
1565         [New Multicolumn] Assertion failure in huge-column-count.html
1566         https://bugs.webkit.org/show_bug.cgi?id=132071
1567
1568         Reviewed by Dean Jackson.
1569
1570         * rendering/RenderBlock.cpp:
1571         (WebCore::RenderBlock::regionAtBlockOffset):
1572         Back out this change, since it wasn't general enough.
1573
1574         * rendering/RenderFlowThread.cpp:
1575         (WebCore::RenderFlowThread::getRegionRangeForBox):
1576         The real issue was that this loop needed to consider the actual box
1577         rather than starting from the parent. This was a non-issue for normal
1578         regions (which cannot have nested flow threads), but for columns, you 
1579         have to consider the fact that the box could itself be a flow thread.
1580
1581 2014-04-23  Andreas Kling  <akling@apple.com>
1582
1583         [iOS] Memory pressure notification should fire on main thread.
1584         <https://webkit.org/b/132074>
1585
1586         Rejig the memory pressure notification to fire on the main queue
1587         directly instead of rerouting it manually.
1588
1589         Reviewed by Mark Rowe.
1590
1591         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1592         (WebCore::MemoryPressureHandler::install):
1593
1594 2014-04-23  Commit Queue  <commit-queue@webkit.org>
1595
1596         Unreviewed, rolling out r167720.
1597         https://bugs.webkit.org/show_bug.cgi?id=132075
1598
1599         broke eight newmulticol tests (Requested by thorton on
1600         #webkit).
1601
1602         Reverted changeset:
1603
1604         "[New Multicolumn] Assertion failure in huge-column-
1605         count.html"
1606         https://bugs.webkit.org/show_bug.cgi?id=132071
1607         http://trac.webkit.org/changeset/167720
1608
1609 2014-04-23  David Hyatt  <hyatt@apple.com>
1610
1611         [New Multicolumn] Assertion failure in huge-column-count.html
1612         https://bugs.webkit.org/show_bug.cgi?id=132071
1613
1614         Reviewed by Dean Jackson.
1615
1616         * rendering/RenderBlock.cpp:
1617         (WebCore::RenderBlock::regionAtBlockOffset):
1618         Remove the code that returned 0 here, since we're going to patch a lower-level
1619         function to catch all cases.
1620
1621         * rendering/RenderFlowThread.cpp:
1622         (WebCore::RenderFlowThread::getRegionRangeForBox):
1623         Don't allow in-flow RenderFlowThreads to ever have a region range. The sets
1624         are what should have ranges... the flow thread needs to just be ignored.
1625
1626 2014-04-23  David Hyatt  <hyatt@apple.com>
1627
1628         [New Multicolumn] Crasher when clearing out a flow thread in multicolumn layout.
1629         https://bugs.webkit.org/show_bug.cgi?id=132069
1630
1631         Reviewed by Dean Jackson.
1632
1633         This is imported from a patch Morten did for Blink, but I had to change it a fair
1634         bit. deleteLines() is used to handle simple line box layout instead of just calling
1635         deleteLineBoxTree.
1636         
1637         I also had to disable the layout state to stop asserts on repaint when the children
1638         get moved. Not sure why Blink didn't hit this, but it's simple enough to add a
1639         LayoutStateDisabler to stop the assert.
1640
1641         Added fast/multicol/inline-children-crash.html
1642
1643         * rendering/RenderMultiColumnFlowThread.cpp:
1644         (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
1645
1646 2014-04-23  Andreas Kling  <akling@apple.com>
1647
1648         [iOS WebKit2] IOSurfacePool should force CA to actually garbage collect surfaces.
1649         <https://webkit.org/b/132065>
1650         <rdar://problem/16110687>
1651
1652         Add a platformGarbageCollectNow() helper function to IOSurfacePool that
1653         triggers a sweep of the IOSurfaces. Call this from collectionTimerFired()
1654         and discardAllSurfaces().
1655
1656         This lets us drop all otherwise-unused 420f surfaces on memory pressure.
1657
1658         Reviewed by Tim Horton.
1659
1660         * WebCore.xcodeproj/project.pbxproj:
1661         * platform/graphics/cg/IOSurfacePool.cpp:
1662         (WebCore::IOSurfacePool::collectionTimerFired):
1663         (WebCore::IOSurfacePool::discardAllSurfaces):
1664         * platform/graphics/cg/IOSurfacePool.h:
1665         * platform/graphics/cocoa/IOSurfacePoolCocoa.mm: Added.
1666         (WebCore::IOSurfacePool::platformGarbageCollectNow):
1667
1668 2014-04-23  Morten Stenshorne  <mstensho@opera.com>
1669
1670         REGRESSION (Safari 6 - ToT): Incorrectly assumes that RenderStyle data can be shared
1671         https://bugs.webkit.org/show_bug.cgi?id=113058
1672
1673         Reviewed by David Hyatt.
1674
1675         Before sharing CSS properties with an element in the cache, we need to
1676         check that the new element is suitable for this, just like we check
1677         elements before inserting them into the cache.
1678
1679         Test: fast/css/identical-logical-height-decl.html
1680
1681         * css/StyleResolver.cpp:
1682         (WebCore::StyleResolver::applyMatchedProperties):
1683
1684 2014-04-23  Commit Queue  <commit-queue@webkit.org>
1685
1686         Unreviewed, rolling out r167713.
1687         https://bugs.webkit.org/show_bug.cgi?id=132070
1688
1689         broke hundreds of tests (Requested by thorton on #webkit).
1690
1691         Reverted changeset:
1692
1693         "[OS X] Make checking if a font is the system font more
1694         robust"
1695         https://bugs.webkit.org/show_bug.cgi?id=132030
1696         http://trac.webkit.org/changeset/167713
1697
1698 2014-04-22  David Hyatt  <hyatt@apple.com>
1699
1700         [New Multicolumn] Nested columns not working at all.
1701         https://bugs.webkit.org/show_bug.cgi?id=131805
1702
1703         Reviewed by Dean Jackson.
1704
1705         Add support for nested pagination contexts, allowing for an arbitrary level
1706         of nesting of multicolumn layouts. There were a number of things that had to
1707         be patched in order for this to work.
1708
1709         * rendering/RenderBlock.cpp:
1710         (WebCore::RenderBlock::regionAtBlockOffset):
1711         Make sure RenderMultiColumnFlowThreads just return null for regions at any
1712         block offset. Individual region sets will be created as you cross ancestor
1713         regions eventually, so this is just getting in the way.
1714
1715         * rendering/RenderLayer.cpp:
1716         (WebCore::RenderLayer::enclosingPaginationLayerInSubtree):
1717         Add a new helper method for obtaining an enclosingPaginationLayer when
1718         constrained by some root. This function ensures you don't accidentally
1719         cross your subtree root when looking for enclosing pagination layers.
1720
1721         (WebCore::RenderLayer::collectFragments):
1722         Patch collectFragments to know how to recur to collect ancestor fragments
1723         in order to apply nested splitting as you cross pagination boundaries.
1724
1725         (WebCore::RenderLayer::updatePaintingInfoForFragments):
1726         (WebCore::RenderLayer::calculateClipRects):
1727         * rendering/RenderLayer.h:
1728         (WebCore::LayerFragment::LayerFragment):
1729         (WebCore::LayerFragment::setRects):
1730         (WebCore::LayerFragment::moveBy):
1731         (WebCore::LayerFragment::intersect):
1732         Improve the LayerFragment so that it caches transformed bounding boxes as
1733         well. This is needed to fix intersectsDamageRect so that it doesn't grab
1734         the wrong bounding box when checking inline layers that are paginated.
1735
1736         * rendering/RenderMultiColumnFlowThread.cpp:
1737         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
1738         Ignore inserted flow threads inside an ancestor flow thread, since we only
1739         care about what the sets do.
1740         
1741         * rendering/RenderObject.cpp:
1742         (WebCore::RenderObject::insertedIntoTree):
1743         Make sure that nested flow thread layers return themselves when a child
1744         is inserted directly under them.
1745
1746 2014-04-22  Myles C. Maxfield  <mmaxfield@apple.com>
1747
1748         [OS X] Make checking if a font is the system font more robust
1749         https://bugs.webkit.org/show_bug.cgi?id=132030
1750
1751         Reviewed by Dean Jackson.
1752
1753         Instead of inspecting a font's name to determine if it is a system font,
1754         on OS X we can ask the system directly.
1755
1756         This patch also moves a platform-specific check into platform-specific
1757         code, so that other platforms don't check for OS X-specific behavior.
1758
1759         Covered by existing tests.
1760
1761         * platform/graphics/Font.cpp:
1762         (WebCore::Font::hasValidAverageCharWidth):
1763         * platform/graphics/Font.h:
1764         * platform/graphics/mac/FontMac.mm:
1765         (WebCore::Font::primaryFontDataIsSystemFont):
1766
1767 2014-04-23  Philippe Normand  <pnormand@igalia.com>
1768
1769         [GTK] Focus management API was moved from HTMLDocument to Document in r166668
1770         https://bugs.webkit.org/show_bug.cgi?id=132060
1771
1772         Reviewed by Carlos Garcia Campos.
1773
1774         Deprecate the removed methods in WebKitDOMHTMLDocument to keep API compatibility.
1775
1776         * bindings/gobject/WebKitDOMDeprecated.cpp:
1777         (webkit_dom_html_document_get_active_element):
1778         (webkit_dom_html_document_has_focus):
1779         * bindings/gobject/WebKitDOMDeprecated.h:
1780         * bindings/gobject/WebKitDOMDeprecated.symbols:
1781         * bindings/gobject/webkitdom.symbols:
1782
1783 2014-04-22  Andreas Kling  <akling@apple.com>
1784
1785         [iOS WebKit1] MemoryPressureHandler::respondToMemoryPressure called on wrong thread.
1786         <https://webkit.org/b/132041>
1787         <rdar://problem/16687238>
1788
1789         Always dispatch the memory pressure relief code on the main queue.
1790         This is really only needed for iOS/WK1, but we might as well share the code.
1791
1792         Reviewed by Michael Saboff.
1793
1794         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1795         (WebCore::MemoryPressureHandler::install):
1796
1797 2014-04-23  Philippe Normand  <pnormand@igalia.com>
1798
1799         [GTK] ShadowRoot API was removed in r164131
1800         https://bugs.webkit.org/show_bug.cgi?id=132059
1801
1802         Reviewed by Gustavo Noronha Silva.
1803
1804         Add ShadowRoot removed API to WebKitDOMDeprecated to keep API/ABI compatibility.
1805
1806         * bindings/gobject/WebKitDOMDeprecated.cpp:
1807         (webkit_dom_shadow_root_class_init):
1808         (webkit_dom_shadow_root_init):
1809         (webkit_dom_shadow_root_element_from_point):
1810         (webkit_dom_shadow_root_get_active_element):
1811         (webkit_dom_shadow_root_get_apply_author_styles):
1812         (webkit_dom_shadow_root_get_element_by_id):
1813         (webkit_dom_shadow_root_get_elements_by_class_name):
1814         (webkit_dom_shadow_root_get_elements_by_tag_name):
1815         (webkit_dom_shadow_root_get_elements_by_tag_name_ns):
1816         (webkit_dom_shadow_root_get_inner_html):
1817         (webkit_dom_shadow_root_get_reset_style_inheritance):
1818         (webkit_dom_shadow_root_get_selection):
1819         (webkit_dom_shadow_root_set_apply_author_styles):
1820         (webkit_dom_shadow_root_set_inner_html):
1821         (webkit_dom_shadow_root_set_reset_style_inheritance):
1822         * bindings/gobject/WebKitDOMDeprecated.h:
1823         * bindings/gobject/WebKitDOMDeprecated.symbols:
1824
1825 2014-04-23  Morten Stenshorne  <mstensho@opera.com>
1826
1827         [New Multicolumn] fast/multicol/overflow-content.html displays red
1828         https://bugs.webkit.org/show_bug.cgi?id=131809
1829
1830         Reviewed by David Hyatt.
1831
1832         Insert a break at end of content on our own in the multicol code, to make sure
1833         that overflow is accounted for, and also to make sure that we account for all
1834         content in non-final sets (i.e. those preceding spanners).
1835
1836         In other words, this will additionally fix balancing issues in sets preceding
1837         a spanner. Added a test for that.
1838
1839         Tests: fast/multicol/break-in-columns-before-spanner.html
1840                fast/multicol/newmulticol/compare-with-old-impl/overflow-content.html
1841
1842         * rendering/RenderFlowThread.cpp:
1843         (WebCore::RenderFlowThread::regionInRange): Deleted.
1844         * rendering/RenderFlowThread.h:
1845         * rendering/RenderMultiColumnSet.cpp:
1846         (WebCore::RenderMultiColumnSet::distributeImplicitBreaks):
1847         * rendering/RenderNamedFlowThread.cpp:
1848         (WebCore::RenderNamedFlowThread::applyBreakAfterContent):
1849         * rendering/RenderNamedFlowThread.h:
1850
1851 2014-04-23  Morten Stenshorne  <mstensho@opera.com>
1852
1853         Overflow propagation broken in BTT and RTL writing-modes
1854         https://bugs.webkit.org/show_bug.cgi?id=113781
1855
1856         Reviewed by David Hyatt.
1857
1858         Overflow rectangles are not quite physical, not quite logical. This
1859         means that we cannot use clientBoxRect() directly to represent a
1860         rectangle that expresses exactly no overflow. This rectangle is the
1861         padding box (relative to the border box) in vertical-lr and
1862         horizontal-tb, but the block-direction borders need to be flipped in
1863         vertical-rl and horizontal-bt.
1864
1865         Tests: fast/css/overflow-btt-border-after.html
1866                fast/css/overflow-rtl-border-after.html
1867
1868         * WebCore.exp.in:
1869         * rendering/RenderBlock.cpp:
1870         (WebCore::RenderBlock::computeOverflow):
1871         * rendering/RenderBox.cpp:
1872         (WebCore::RenderBox::addLayoutOverflow):
1873         (WebCore::RenderBox::addVisualOverflow):
1874         (WebCore::RenderBox::layoutOverflowRectForPropagation):
1875         * rendering/RenderBox.h:
1876         (WebCore::RenderBox::layoutOverflowRect):
1877
1878 2014-04-23  Andrei Bucur  <abucur@adobe.com>
1879
1880         [CSS Regions] Improve the debugging infrastructure
1881         https://bugs.webkit.org/show_bug.cgi?id=132042
1882
1883         Reviewed by Mihnea Ovidenie.
1884
1885         This patch improves the debugging code for CSS Regions.
1886
1887         Tests: No function change. No new tests.
1888
1889         * rendering/RenderObject.cpp:
1890         (WebCore::RenderObject::showRegionsInformation): Print brackets around the region range when dumping
1891         the render tree to the console.
1892         * rendering/RootInlineBox.cpp:
1893         (WebCore::RootInlineBox::containingRegion): Convert the ASSERT to an ASSERT_WITH_SECURITY_IMPLICATION.
1894
1895 2014-04-22  Ryosuke Niwa  <rniwa@webkit.org>
1896
1897         Cursor doesn't change back to pointer when leaving the Safari window
1898         https://bugs.webkit.org/show_bug.cgi?id=132038
1899
1900         Reviewed by Alexey Proskuryakov.
1901
1902         r147739 incorrectly added an early exit in EventHandler::selectCursor when hit test result didn't have
1903         any node associated with it. Since we will hit this code when the cursor is outside of the WebView,
1904         we still need to take the CURSOR_AUTO path as did the code before r147739.
1905
1906         No new test is added since this behavior can't be tested in DRT or WTR.
1907
1908         * page/EventHandler.cpp:
1909         (WebCore::EventHandler::selectCursor):
1910
1911 2014-04-22  Zalan Bujtas  <zalan@apple.com>
1912
1913         Do not paint border image when the border rect is empty.
1914         https://bugs.webkit.org/show_bug.cgi?id=131988
1915
1916         Reviewed by Darin Adler.
1917
1918         http://trac.webkit.org/changeset/167351 introduced an early return when border
1919         rect is empty. This patch ensures that border image is not painted either in that case.
1920
1921         Modified padding-margin-negative-border.html to cover border-image case.
1922
1923         * rendering/RenderBoxModelObject.cpp:
1924         (WebCore::RenderBoxModelObject::paintBorder):
1925
1926 2014-04-22  Tim Horton  <timothy_horton@apple.com>
1927
1928         ASSERTION FAILED: scrollerImp == scrollbarPainterForScrollbar(_scrollbar) on two API tests
1929         https://bugs.webkit.org/show_bug.cgi?id=132034
1930         <rdar://problem/16624332>
1931
1932         Reviewed by Simon Fraser.
1933
1934         * platform/mac/ScrollAnimatorMac.mm:
1935         (-[WebScrollbarPainterDelegate shouldUseLayerPerPartForScrollerImp:]):
1936         scrollerImpWithStyle:controlSize:horizontal:replacingScrollerImp: moves the delegate
1937         from the old scrollerImp to the new one, and also happens to call shouldUseLayerPerPartForScrollerImp.
1938         Since scrollerImpWithStyle: has not returned yet, the scrollbarPainterForScrollbar still returns the old scrollerImp,
1939         so this assertion fires. It's safe to remove this because supportsUpdateOnSecondaryThread doesn't make use of the imp.
1940
1941 2014-04-22  Ryosuke Niwa  <rniwa@webkit.org>
1942
1943         REGRESSION (r157328): popover to check into flight ba.com dismisses instantly when focusing form
1944         https://bugs.webkit.org/show_bug.cgi?id=131949
1945
1946         Reviewed by Darin Adler.
1947
1948         The regression was caused by two bugs:
1949         1. The event didn't stop propagating itself even when it should.
1950            If the related target is same as the event origin, the event propagation should stop when the event reaches
1951            the root of the related target's tree scope. Otherwise, it should stop when it reaches the related target.
1952
1953         2. Mouse event's related target exposed nodes inside a user-agent shadow DOM when the related target appeared
1954            inside the origin.
1955
1956         Fixed the bugs by re-introducing path shrinkage algorithm removed in r157328 into EventPath::setRelatedTarget
1957         and adding an algorithm to determine the least common ancestor of the related target and the current target
1958         in moveToParentOrShadowHost. The latter algorithm doesn't match the shadow DOM specification:
1959         http://www.w3.org/TR/2013/WD-shadow-dom-20130514/
1960         but it's good enough in terms of the Web exposed behavior as we don't support author defined insertion points.
1961
1962         Test: fast/events/shadow-event-path.html
1963
1964         * dom/EventDispatcher.cpp:
1965         (WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
1966         (WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope): Added.
1967         (WebCore::EventDispatcher::dispatchEvent):
1968         (WebCore::EventPath::setRelatedTarget):
1969
1970 2014-04-22  Ryosuke Niwa  <rniwa@webkit.org>
1971
1972         Rollout r156635 since the old behavior was intentional.
1973
1974         * page/EventHandler.cpp:
1975         (WebCore::EventHandler::selectCursor):
1976
1977 2014-04-22  Commit Queue  <commit-queue@webkit.org>
1978
1979         Unreviewed, rolling out r167674.
1980         https://bugs.webkit.org/show_bug.cgi?id=132025
1981
1982         Going a different way with this (Requested by bradee-oh on
1983         #webkit).
1984
1985         Reverted changeset:
1986
1987         "Change Image Controls replacement to use selection and paste"
1988         https://bugs.webkit.org/show_bug.cgi?id=131992
1989         http://trac.webkit.org/changeset/167674
1990
1991 2014-04-22  Brent Fulgham  <bfulgham@apple.com>
1992
1993         [Win] Support Python 2.7 in Cygwin
1994         https://bugs.webkit.org/show_bug.cgi?id=132023
1995
1996         Reviewed by Michael Saboff.
1997
1998         * DerivedSources.make: Use proper path to Cygwin on
1999         all platforms.
2000
2001 2014-04-22  Andreas Kling  <akling@apple.com>
2002
2003         REGRESSION (r151839): Subframe keeps getting mousemove events with the same coordinates after hiding a hovered element.
2004         <https://webkit.org/b/131974>
2005         <rdar://problem/15907469>
2006
2007         When the currently hovered element disappears as a result of style recalc,
2008         we send a fake mousemove event to the page, to see if anything newly added
2009         should become hovered.
2010
2011         The faking mechanism lives in EventHandler and simply synthesizes a new
2012         mousemove event using the last seen mouse location.
2013
2014         The problem here is that we were sending this fake mousemove event to the
2015         subframe where the hovered element lived. Since subframes aren't kept up
2016         to date on recent mouse locations, this could cause some strange behavior
2017         where a subframe would dispatch mousemove events with stale coordinates.
2018
2019         The solution is to always dispatch fake mousemove events from the main
2020         frame's event handler. This is how real event delivery happens, and hit
2021         testing will then find the appropriate subframe, if any.
2022
2023         Reviewed by Benjamin Poulain.
2024
2025         Test: fast/events/ghostly-mousemoves-in-subframe.html
2026
2027         * dom/Document.cpp:
2028         (WebCore::Document::recalcStyle):
2029
2030 2014-04-22  Myles C. Maxfield  <mmaxfield@apple.com>
2031
2032         [OS X] Glyph spacing for system fonts may be incorrect
2033         https://bugs.webkit.org/show_bug.cgi?id=131967
2034
2035         Unreviewed iOS build fix after r167679.
2036
2037         * platform/graphics/mac/SimpleFontDataMac.mm:
2038
2039 2014-04-22  Myles C. Maxfield  <mmaxfield@apple.com>
2040
2041         [OS X] Glyph spacing for system fonts may be incorrect
2042         https://bugs.webkit.org/show_bug.cgi?id=131967
2043
2044         Unreviewed build fix after r167679.
2045
2046         * platform/graphics/mac/SimpleFontDataMac.mm:
2047         (WebCore::hasCustomTracking):
2048
2049 2014-04-21  Myles C. Maxfield  <mmaxfield@apple.com>
2050
2051         [OS X] Glyph spacing for system fonts may be incorrect
2052         https://bugs.webkit.org/show_bug.cgi?id=131967
2053
2054         Reviewed by Simon Fraser.
2055
2056         Covered by existing tests.
2057
2058         * platform/graphics/mac/SimpleFontDataMac.mm:
2059         (WebCore::SimpleFontData::platformWidthForGlyph): Update to use CTFontGetAdvancesForGlyphs() for system fonts
2060         (WebCore::hasCustomTracking):
2061
2062 2014-04-22  David Hyatt  <hyatt@apple.com>
2063
2064         [New Multicolumn] widows/orphans cause assertion failures.
2065         https://bugs.webkit.org/show_bug.cgi?id=131233
2066
2067         Reviewed by Dean Jackson.
2068
2069         * rendering/RenderMultiColumnSet.cpp:
2070         (WebCore::RenderMultiColumnSet::recordSpaceShortage):
2071         Fix an obvious bug where the space shortage is recorded twice (and the
2072         if statement that kept it from being negative is accidentally ignored).
2073
2074 2014-04-22  David Hyatt  <hyatt@apple.com>
2075
2076         [New Multicolumn] Make sure columnTranslationForOffset has the same column-span-aware
2077         translation that fragment collection does.
2078         https://bugs.webkit.org/show_bug.cgi?id=131738
2079
2080         Reviewed by Anders Carlsson.
2081
2082         * rendering/RenderMultiColumnSet.cpp:
2083         (WebCore::RenderMultiColumnSet::collectLayerFragments):
2084         Remove a FIXME that is no longer needed, since the translation offset of the 
2085         column set did get patched.
2086
2087         (WebCore::RenderMultiColumnSet::columnTranslationForOffset):
2088         Add the exact same fix to columnTranslationForOffset that was applied to collectLayerFragments.
2089
2090 2014-04-22  Mark Lam  <mark.lam@apple.com>
2091
2092         WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript() needs to acquire the JSLock before calling into JS.
2093         <https://webkit.org/b/132021>
2094
2095         Reviewed by Mark Hahnenberg.
2096
2097         Covered by existing layout test.
2098
2099         * html/HTMLMediaElement.cpp:
2100         (WebCore::HTMLMediaElement::parseAttribute):
2101
2102 2014-04-22  Manuel Rego Casasnovas  <rego@igalia.com>
2103
2104         REGRESSION (r167652): Broke fast/regions/cssom/region-range-for-box-crash.html in debug mode
2105         https://bugs.webkit.org/show_bug.cgi?id=131982
2106
2107         Reviewed by David Hyatt.
2108
2109         The problem was creating the Range from the arguments received at RenderView::setSelection(). Specifically
2110         in this test endPos is 1 when the element has not children which creates an invalid Range.
2111
2112         * rendering/RenderView.cpp:
2113         (WebCore::RenderView::splitSelectionBetweenSubtrees): Pass 0 as startPos and endPos to Range::create() as we are
2114         not interested in the positions at this point.
2115
2116 2014-04-22  Brady Eidson  <beidson@apple.com>
2117
2118         Change Image Controls replacement to use selection and paste
2119         <rdar://problem/16302722> and https://bugs.webkit.org/show_bug.cgi?id=131992
2120
2121         Reviewed by Tim Horton.
2122
2123         * WebCore.exp.in: Remove deleted symbol.
2124
2125         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
2126         (WebCore::ImageControlsButtonElementMac::defaultEventHandler):
2127
2128         * page/ContextMenuController.cpp:
2129         (WebCore::ContextMenuController::showImageControlsMenu): Select the image element
2130           before showing the menu.
2131         (WebCore::ContextMenuController::replaceControlledImage): Deleted.
2132         * page/ContextMenuController.h:
2133
2134 2014-04-22  David Hyatt  <hyatt@apple.com>
2135
2136         REGRESSION: Hitting asserts in new flow thread selection code.
2137         https://bugs.webkit.org/show_bug.cgi?id=132019
2138
2139         Reviewed by Anders Carlsson.
2140
2141         Null checking flowThreadController is not enough. The list of threads
2142         can be null even when the flowThreadController is not. That's why you
2143         use hasRenderNamedFlowThreads. I patched the two bad places in the code
2144         to use hasRenderNamedFlowThreads to stop the crashes.
2145         
2146         * rendering/RenderView.cpp:
2147         (WebCore::RenderView::selectionBounds):
2148         (WebCore::RenderView::repaintSelection):
2149
2150 2014-04-22  Brent Fulgham  <bfulgham@apple.com>
2151
2152         Check (rather than assume) element is a RenderTableSection before using it
2153         https://bugs.webkit.org/show_bug.cgi?id=121858
2154
2155         Reviewed by David Kilzer.
2156
2157         Test: fast/table/table-insert-object-before-td-crash.html
2158
2159         * rendering/RenderTable.cpp:
2160         (WebCore::RenderTable::addChild): Check that lastBox is a table section before
2161         using the node as if it was one.
2162
2163 2014-04-22  Alex Christensen  <achristensen@webkit.org>
2164
2165         Begin implementation of video using Media Foundation.
2166         https://bugs.webkit.org/show_bug.cgi?id=131830
2167
2168         Reviewed by Brent Fulgham.
2169
2170         * WebCore.vcxproj/WebCore.vcxproj:
2171         * WebCore.vcxproj/WebCore.vcxproj.filters:
2172         Added MediaPlayerPrivateMediaFoundation files.
2173         * platform/graphics/MediaPlayer.cpp:
2174         Include MediaPlayerPrivateMediaFoundation inside new USE(MEDIA_FOUNDATION) flag.
2175         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: Added.
2176         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Added.
2177
2178 2014-04-22  Commit Queue  <commit-queue@webkit.org>
2179
2180         Unreviewed, rolling out r167658.
2181         https://bugs.webkit.org/show_bug.cgi?id=131993
2182
2183         Caused many crashes on media tests (Requested by ap on
2184         #webkit).
2185
2186         Reverted changeset:
2187
2188         "[Mac] don't ask for AVAssetTrack properties before they are
2189         available"
2190         https://bugs.webkit.org/show_bug.cgi?id=131902
2191         http://trac.webkit.org/changeset/167658
2192
2193 2014-04-22  David Hyatt  <hyatt@apple.com>
2194
2195         [New Multicolumn] fast/multicol/multicol-with-child-renderLayer-for-input.html puts the textfield in the wrong place
2196         https://bugs.webkit.org/show_bug.cgi?id=131808
2197
2198         Reviewed by Brady Eidson.
2199     
2200         Make sure FrameView is patched to pass in the update pagination flag when subtree layout
2201         is done on textfields. It had code for the old multicolumn system but did not have a check
2202         for the new multicolumn system.
2203
2204         Added fast/multicol/newmulticol/compare-with-old-impl/multicol-with-child-renderLayer-for-input.html
2205
2206         * page/FrameView.cpp:
2207         (WebCore::updateLayerPositionFlags):
2208
2209 2014-04-22  Zalan Bujtas  <zalan@apple.com>
2210
2211         border-style: double rendered as solid when combined with border-radius
2212         https://bugs.webkit.org/show_bug.cgi?id=131927
2213
2214         Reviewed by Simon Fraser.
2215
2216         BorderEdge::getDoubleBorderStripeWidths() should return the calculated inner, outer border widths. 
2217
2218         Test: fast/borders/hidpi-double-border-with-border-radius-always-produce-solid-line.html
2219
2220         * rendering/BorderEdge.cpp:
2221         (WebCore::BorderEdge::getDoubleBorderStripeWidths):
2222         * rendering/BorderEdge.h:
2223
2224 2014-04-22  Eric Carlson  <eric.carlson@apple.com>
2225
2226         [Mac] don't ask for AVAssetTrack properties before they are available
2227         https://bugs.webkit.org/show_bug.cgi?id=131902
2228         <rdar://problem/16505076>
2229
2230         Reviewed by Jer Noble.
2231
2232         No new tests, the behavior this changes can not be tested with a layout test.
2233
2234         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2235         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2236         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Initialize
2237             m_cachedTotalBytes.
2238         (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata): Don't report that
2239             metadata has been loaded until the track properties we need have been loaded too.
2240         (WebCore::MediaPlayerPrivateAVFoundationObjC::totalBytes): Cache totalBytes instead
2241             of recalculating it every time.
2242         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange): Invalidate cached
2243             total bytes.
2244         (WebCore::assetTrackMetadataKeyNames): Array of AVAssetTrack properties we use.
2245
2246 2014-04-22  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
2247
2248         Buildfix after r167650 broke non-Cocoa builds
2249         https://bugs.webkit.org/show_bug.cgi?id=131980
2250
2251         Reviewed by Mario Sanchez Prada.
2252
2253         * page/EventHandler.cpp:
2254         (WebCore::EventHandler::handleWheelEvent):
2255
2256 2014-04-22  Manuel Rego Casasnovas  <rego@igalia.com>
2257
2258         [CSS Regions] Selection highlight doesn't match DOM selection
2259         https://bugs.webkit.org/show_bug.cgi?id=131511
2260
2261         Reviewed by David Hyatt.
2262
2263         This patch implements a subtrees approach to fix selection interaction in CSS Regions.
2264
2265         The idea is to divide the Render tree in subtrees. One subtree will be the RenderView (which is always present),
2266         then for each RenderNamedFlowThread (which are children of RenderView) we will have an extra subtree.
2267
2268         For each subtree it determines the start and end positions according to the DOM tree. So, every subtree will
2269         always have a start and end position, and the selection algorithm will be able to reach the end from the start
2270         without problems (this allows us to remove the changes introduced in r155058).
2271
2272         Then selection related methods in RenderView are adapted to ensure that they are called for each subtree. Making
2273         the selection highlight to match DOM selection as expected.
2274
2275         Test: fast/regions/selection/selecting-text-including-region.html
2276
2277         * CMakeLists.txt: Add new class SelectionSubtreeRoot to build file.
2278         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
2279         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2280         * WebCore.xcodeproj/project.pbxproj: Ditto.
2281         * rendering/RenderNamedFlowThread.h: Inherit from SelectionSubtreeRoot.
2282         * rendering/RenderObject.cpp:
2283         (WebCore::RenderObject::selectionRoot): New method to return the RenderNamedFlowThread if any or the RenderView
2284         otherwise.
2285         (WebCore::RenderObject::selectionStartEnd): If it's inside a RenderNamedFlowThread use specific method instead
2286         of the RenderView's one.
2287         * rendering/RenderObject.h: Add new method signature.
2288         * rendering/RenderView.cpp:
2289         (WebCore::RenderView::selectionBounds): Adapt method to subtrees approach.
2290         (WebCore::RenderView::subtreeSelectionBounds): Modify previous method in order to use SelectionSubtreeRoot
2291         objects.
2292         (WebCore::RenderView::repaintSelection): Adapt method to subtrees approach.
2293         (WebCore::RenderView::repaintSubtreeSelection): Modify previous method in order to use SelectionSubtreeRoot
2294         objects.
2295         (getNextOrPrevRenderObjectBasedOnDirection): Deleted method from r155058 as it is not needed anymore. Each
2296         subtree will have start and end positions, so the selection algorithm will always find the end.
2297         (WebCore::RenderView::setSelection): Adapt method to subtrees approach.
2298         (WebCore::RenderView::splitSelectionBetweenSubtrees): Determine start and end positions for each subtree and
2299         call setSubtreeSelection().
2300         (WebCore::RenderView::setSubtreeSelection): Modify previous method in order to use SelectionSubtreeRoot objects.
2301         * rendering/RenderView.h: Inherit from SelectionSubtreeRoot. Add signature for new helper methods receiving
2302         SelectionSubtreeRoot objects.
2303         * rendering/SelectionSubtreeRoot.cpp: Added.
2304         (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot):
2305         (WebCore::SelectionSubtreeRoot::selectionStartEndPositions):
2306         * rendering/SelectionSubtreeRoot.h: Added. New class to identify root elements for the subtrees. With some basic
2307         attributes and methods to store the start and end positions and offsets.
2308         (WebCore::SelectionSubtreeRoot::selectionStart):
2309         (WebCore::SelectionSubtreeRoot::selectionStartPos):
2310         (WebCore::SelectionSubtreeRoot::selectionEnd):
2311         (WebCore::SelectionSubtreeRoot::selectionEndPos):
2312         (WebCore::SelectionSubtreeRoot::setSelectionStart):
2313         (WebCore::SelectionSubtreeRoot::setSelectionStartPos):
2314         (WebCore::SelectionSubtreeRoot::setSelectionEnd):
2315         (WebCore::SelectionSubtreeRoot::setSelectionEndPos):
2316
2317 2014-04-21  Brent Fulgham  <bfulgham@apple.com>
2318
2319         [Mac] Follow-up: After a horizontal overflow scroll with a mechanical wheel mouse, vertical scrolling no longer works
2320         https://bugs.webkit.org/show_bug.cgi?id=131960
2321         <rdar://problem/16142100>
2322
2323         Unreviewed build fix.
2324
2325         * page/EventHandler.cpp:
2326         (WebCore::EventHandler::handleWheelEvent): The test to clear the
2327         last scrolled node was too broad. It should only follow this path
2328         if both the phase and momentum phase are 'None'.
2329
2330 2014-04-21  Brent Fulgham  <bfulgham@apple.com>
2331
2332         [Mac] After a horizontal overflow scroll with a mechanical wheel mouse, vertical scrolling no longer works
2333         https://bugs.webkit.org/show_bug.cgi?id=131960
2334         <rdar://problem/16142100>
2335
2336         Reviewed by Darin Adler.
2337
2338         Test: platform/mac/fast/scrolling/scroll-div-no-latching.html
2339
2340         * page/EventHandler.cpp:
2341         (WebCore::EventHandler::handleWheelEvent): When not latching, always clear m_latchedWheelEventElement and m_previousWheelScrolledElement.
2342
2343 2014-04-21  Joseph Pecoraro  <pecoraro@apple.com>
2344
2345         WebProfilerAgent::disable is calling the wrong superclass method
2346         https://bugs.webkit.org/show_bug.cgi?id=131968
2347
2348         Reviewed by Simon Fraser.
2349
2350         * inspector/WebProfilerAgent.cpp:
2351         (WebCore::WebProfilerAgent::disable):
2352
2353 2014-04-21  Enrica Casucci  <enrica@apple.com>
2354
2355         Followup from http://trac.webkit.org/changeset/167624
2356
2357         Reviewed by Darin Adler.
2358
2359         Fixing incorrect use of ? : syntax.
2360
2361         * editing/VisibleUnits.cpp:
2362         (WebCore::characterBeforePosition):
2363
2364 2014-04-21  Ryuan Choi  <ryuan.choi@samsung.com>
2365
2366         Move CoordinatedGraphics related codes out of CMakeLists.txt
2367         https://bugs.webkit.org/show_bug.cgi?id=131931
2368
2369         Reviewed by Gyuyoung Kim.
2370
2371         Move CoordinatedGraphics related files to PlatformEfl.cmake because they are not common files.
2372
2373         * CMakeLists.txt: 
2374         * PlatformEfl.cmake:
2375
2376 2014-04-21  Jer Noble  <jer.noble@apple.com>
2377
2378         [MSE][Mac] AVSampleBufferDisplayLayer and AudioRenderer is overretained.
2379         https://bugs.webkit.org/show_bug.cgi?id=131963
2380
2381         Reviewed by Jon Honeycutt.
2382
2383         Adopt the results of -[[class alloc] init] rather than retaining them.
2384
2385         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2386         (WebCore::SourceBufferPrivateAVFObjC::hasVideo):
2387         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2388
2389 2014-04-21  Zalan Bujtas  <zalan@apple.com>
2390
2391         REGRESSION (r166784): Gradient at background of iCloud login page doesn’t go all the way to the bottom
2392         https://bugs.webkit.org/show_bug.cgi?id=131924
2393
2394         Computing tile dimension for contain/cover requires higher precision than what LayoutUnit has. Switching to floats.
2395
2396         Reviewed by Simon Fraser.
2397
2398         Test: fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision.html
2399
2400         * rendering/RenderBoxModelObject.cpp:
2401         (WebCore::RenderBoxModelObject::calculateFillTileSize):
2402
2403 2014-04-21  Dean Jackson  <dino@apple.com>
2404
2405         Build fix for Mountain Lion.
2406
2407         * platform/mac/SerializedPlatformRepresentationMac.mm:
2408         (WebCore::SerializedPlatformRepresentationMac::deserialize):
2409
2410 2014-04-21  Dan Bernstein  <mitz@apple.com>
2411
2412         WebCore part of <rdar://problem/16631323> Page::setDefersLoading doesn’t do anything when using the Network process
2413         https://bugs.webkit.org/show_bug.cgi?id=131939
2414
2415         Reviewed by David Kilzer.
2416
2417         * WebCore.exp.in: Exported WebCore::ResourceHandle::setDefersLoading.
2418
2419         * loader/ResourceLoadScheduler.cpp:
2420         (WebCore::ResourceLoadScheduler::setDefersLoading): Added a no-op implementation.
2421         * loader/ResourceLoadScheduler.h: Declared new virtual member function setDefersLoading.
2422
2423         * loader/ResourceLoader.cpp:
2424         (WebCore::ResourceLoader::setDefersLoading): Added a call to the above function.
2425
2426 2014-04-21  Brent Fulgham  <bfulgham@apple.com>
2427
2428         [Mac] Difficulty gesture scrolling vertically with trackpad after scrolling horizontally 
2429         https://bugs.webkit.org/show_bug.cgi?id=131959
2430         <rdar://problem/16654523>
2431
2432         Reviewed by Simon Fraser.
2433
2434         * page/mac/EventHandlerMac.mm:
2435         (WebCore::deltaIsPredominantlyVertical): Added.
2436         (WebCore::scrolledToEdgeInDominantDirection): Only consider current mouse wheel event. We don't care about
2437         overall history when deciding if we are bumping against the edge of a scrollable region. Short-circuit if
2438         the element style indicates that overflow is hidden, since this means there is no scroll possible in that
2439         direction.
2440         (WebCore::EventHandler::platformPrepareForWheelEvents): Update for new signature.
2441
2442 2014-04-21  Eric Carlson  <eric.carlson@apple.com>
2443
2444         [Mac] implement WebKitDataCue
2445         https://bugs.webkit.org/show_bug.cgi?id=131799
2446
2447         Reviewed by Dean Jackson.
2448
2449         Tests: http/tests/media/track-in-band-hls-metadata.html
2450                media/track/track-datacue-value.html
2451
2452         * Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.
2453         * DerivedSources.make: Add ENABLE_DATACUE_VALUE to HTML_FLAGS when appropriate.
2454
2455         * CMakeLists.txt: Add JSDataCueCustom.cpp.
2456         * bindings/js/JSBindingsAllInOne.cpp:
2457         * WebCore.xcodeproj/project.pbxproj: Add new files.
2458
2459         * bindings/js/JSDataCueCustom.cpp: Added.
2460         (WebCore::JSDataCue::value): 
2461         (WebCore::JSDataCue::setValue):
2462         (WebCore::JSDataCueConstructor::constructJSDataCue): Custom constructor.
2463
2464         * html/HTMLMediaElement.cpp:
2465         (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Drive-by fixes: don't schedule timeupdate
2466             events when paused, don't call sort on an Vector that can't be sorted.
2467
2468         * html/track/DataCue.cpp:
2469         (WebCore::DataCue::DataCue): Initialize m_type.
2470         (WebCore::DataCue::~DataCue): Unprotect the JSValue if necessary.
2471         (WebCore::DataCue::data): Ask the platform value for data if non-null.
2472         (WebCore::DataCue::setData): Clear m_platformValue and m_value.
2473         (WebCore::DataCue::isEqual): New.
2474         (WebCore::DataCue::value): Return a JSValue from the platform value, or the value passed
2475             to the constructor/set by script.
2476         (WebCore::DataCue::setValue): Set m_value.
2477         * html/track/DataCue.h:
2478         * html/track/DataCue.idl:
2479
2480         * html/track/InbandDataTextTrack.cpp:
2481         (WebCore::InbandDataTextTrack::addDataCue): Don't add the same cue more than once.
2482         (WebCore::InbandDataTextTrack::updateDataCue): Update a cue's duration.
2483         (WebCore::InbandDataTextTrack::removeDataCue): Remove an incomplete cue.
2484         (WebCore::InbandDataTextTrack::removeCue): Remove a cue from the incomplete cue map if necessary.
2485         * html/track/InbandDataTextTrack.h:
2486
2487         * html/track/InbandGenericTextTrack.cpp:
2488         (WebCore::InbandGenericTextTrack::addGenericCue): CueMatchRules is now in TextTrackCue instead
2489             of VTTCue.
2490         * html/track/InbandTextTrack.h:
2491
2492         * html/track/InbandWebVTTTextTrack.cpp:
2493         (WebCore::InbandWebVTTTextTrack::newCuesParsed): Ditto.
2494
2495         * html/track/TextTrack.cpp:
2496         (WebCore::TextTrack::hasCue): Ditto.
2497         * html/track/TextTrack.h:
2498
2499         * html/track/TextTrackCue.cpp:
2500         (WebCore::TextTrackCue::isEqual): New, test base class equality.
2501         * html/track/TextTrackCue.h:
2502
2503         * html/track/TextTrackCueGeneric.cpp:
2504         (WebCore::TextTrackCueGeneric::isEqual): Call TextTrackCue::isEqual first.
2505         * html/track/TextTrackCueGeneric.h:
2506
2507         * html/track/VTTCue.cpp:
2508         (WebCore::VTTCue::isEqual): Call TextTrackCue::isEqual first.
2509         * html/track/VTTCue.h:
2510
2511         * platform/SerializedPlatformRepresentation.h: Added.
2512         (WebCore::SerializedPlatformRepresentation::~SerializedPlatformRepresentation):
2513         (WebCore::SerializedPlatformRepresentation::SerializedPlatformRepresentation):
2514
2515         * platform/graphics/InbandTextTrackPrivateClient.h: Add methods for DataCue with SerializedPlatformRepresentation.
2516
2517         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: Added.
2518         (WebCore::InbandMetadataTextTrackPrivateAVF::create):
2519         (WebCore::InbandMetadataTextTrackPrivateAVF::InbandMetadataTextTrackPrivateAVF):
2520         (WebCore::InbandMetadataTextTrackPrivateAVF::~InbandMetadataTextTrackPrivateAVF):
2521         (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
2522         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
2523         (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
2524         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: Added.
2525
2526         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2527         (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): currentTrack -> currentTextTrack.
2528         (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted): Ditto.
2529         (WebCore::MediaPlayerPrivateAVFoundation::configureInbandTracks): Ditto.
2530         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2531         (WebCore::MediaPlayerPrivateAVFoundation::setCurrentTextTrack):
2532         (WebCore::MediaPlayerPrivateAVFoundation::setCurrentTrack): Deleted.
2533
2534         Renamed currentTrack and setCurrentTrack to currentTextTrack and setCurrentTextTrack.
2535         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2536         (WebCore::AVFWrapper::currentTextTrack):
2537         (WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTextTrack):
2538         (WebCore::MediaPlayerPrivateAVFoundationCF::currentTextTrack):
2539         (WebCore::AVFWrapper::setCurrentTextTrack):
2540         (WebCore::AVFWrapper::AVFWrapper):
2541         (WebCore::AVFWrapper::processCue):
2542         (WebCore::AVFWrapper::currentTrack): Deleted.
2543         (WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTrack): Deleted.
2544         (WebCore::MediaPlayerPrivateAVFoundationCF::currentTrack): Deleted.
2545         (WebCore::AVFWrapper::setCurrentTrack): Deleted.
2546         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
2547
2548         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2549         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2550         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2551         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): currentTrack -> currentTextTrack
2552         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): currentTrack -> currentTextTrack.
2553         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack): New.
2554         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): m_currentTrack -> m_currentTextTrack.
2555         (WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues): Ditto.
2556         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack): Renamed from setCurrentTextTrack.
2557         (WebCore::metadataType): Map an AVFoundation metadata key space to a metadata cue type.
2558         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): Process new metadata.
2559         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2560         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTrack): Deleted.
2561
2562         Create a JSValue representation from an AVMetadataItem.
2563         * platform/mac/SerializedPlatformRepresentationMac.h: Added.
2564         (WebCore::SerializedPlatformRepresentationMac::platformType):
2565         (WebCore::SerializedPlatformRepresentationMac::nativeValue):
2566         * platform/mac/SerializedPlatformRepresentationMac.mm: Added.
2567         (WebCore::SerializedPlatformRepresentationMac::SerializedPlatformRepresentationMac):
2568         (WebCore::SerializedPlatformRepresentationMac::~SerializedPlatformRepresentationMac):
2569         (WebCore::SerializedPlatformRepresentationMac::create):
2570         (WebCore::SerializedPlatformRepresentationMac::data):
2571         (WebCore::SerializedPlatformRepresentationMac::deserialize):
2572         (WebCore::SerializedPlatformRepresentationMac::isEqual):
2573         (WebCore::toSerializedPlatformRepresentationMac):
2574         (WebCore::jsValueWithValueInContext):
2575         (WebCore::jsValueWithDataInContext):
2576         (WebCore::jsValueWithArrayInContext):
2577         (WebCore::jsValueWithDictionaryInContext):
2578         (WebCore::jsValueWithAVMetadataItemInContext):
2579
2580 2014-04-21  Benjamin Poulain  <benjamin@webkit.org>
2581
2582         Add Element.matches, the standard name for webkitMatchesSelector
2583         https://bugs.webkit.org/show_bug.cgi?id=131922
2584
2585         Reviewed by Andreas Kling.
2586
2587         This patch just renames webkitMatchesSelector() to matches().
2588
2589         * bindings/scripts/CodeGeneratorObjC.pm:
2590         (GenerateImplementation):
2591         The Objective-C binding generator only supported ImplementedAs for getters and setters.
2592         This adds support for the option so that Element.matches can be generated for Obj-C.
2593
2594         * dom/Element.cpp:
2595         (WebCore::Element::matches):
2596         (WebCore::Element::webkitMatchesSelector): Deleted.
2597         * dom/Element.h:
2598         * dom/Element.idl:
2599         * inspector/InspectorCSSAgent.cpp:
2600         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
2601
2602 2014-04-21  Beth Dakin  <bdakin@apple.com>
2603
2604         topContentInset does not play well with fullscreen elements
2605         https://bugs.webkit.org/show_bug.cgi?id=131955
2606         -and corresponding-
2607         <rdar://problem/16651925>
2608
2609         Reviewed by Sam Weinig.
2610
2611         Calling setNeedsLayout() is not sufficient when the topContentInset has changed 
2612         dynamically. We need to perform the layout right away and update the scrollbars. 
2613         This works completely when the inset changes due to entering/exiting fullscreen, 
2614         but I left a FIXME behind because it is possible to change the inset dynamically 
2615         just through the WK2 API and end up in a situation where everything looks right 
2616         except for the scrollbars. 
2617         * page/FrameView.cpp:
2618         (WebCore::FrameView::topContentInsetDidChange):
2619         * page/FrameView.h:
2620         * page/Page.cpp:
2621         (WebCore::Page::setTopContentInset):
2622
2623 2014-04-18  Jon Honeycutt  <jhoneycutt@apple.com>
2624
2625         Empty RenderInline objects should not be line break objects.
2626
2627         https://bugs.webkit.org/show_bug.cgi?id=131861
2628         <rdar://problem/15663617>
2629
2630         Reviewed by David Hyatt.
2631
2632         * rendering/line/BreakingContextInlineHeaders.h:
2633         (WebCore::BreakingContext::canBreakAtThisPosition):
2634         Don't break at this position if this is an empty RenderInline.
2635
2636 2014-04-21  Enrica Casucci  <enrica@apple.com>
2637
2638         [iOS WebKit2] support replacements for misspelled words.
2639         https://bugs.webkit.org/show_bug.cgi?id=131827
2640         <rdar://problem/16319657>
2641
2642         Reviewed by Darin Adler.
2643
2644         Adds utility function to return the character before the current selection
2645         and converts the nbsp to the space character.
2646
2647         * WebCore.exp.in:
2648         * editing/VisibleUnits.cpp:
2649         (WebCore::characterBeforePosition):
2650         * editing/VisibleUnits.h:
2651
2652 2014-04-21  Eric Carlson  <eric.carlson@apple.com>
2653
2654         [iOS] enable plug-in replacement
2655         https://bugs.webkit.org/show_bug.cgi?id=131947
2656
2657         Reviewed by Jer Noble.
2658
2659         * bindings/generic/RuntimeEnabledFeatures.cpp:
2660         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): initialize m_isPluginReplacementEnabled
2661             to true on iOS.
2662
2663 2014-04-21  Rik Cabanier  <cabanier@adobe.com>
2664
2665         [CSS Blending] Remove support for non-separable blend modes from mix-blend-mode
2666         https://bugs.webkit.org/show_bug.cgi?id=131824
2667
2668         Reviewed by Dean Jackson.
2669
2670         Removed support for non-separable blend modes from the CSS parser.
2671
2672         Covered by existing tests
2673
2674         * css/CSSParser.cpp:
2675         (WebCore::isValidKeywordPropertyAndValue):
2676         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
2677         (PlatformCAFilters::setBlendingFiltersOnLayer):
2678
2679 2014-04-21  David Hyatt  <hyatt@apple.com>
2680
2681         [New Multicolumn] Column set drawing under horizontal scrollbar.
2682         https://bugs.webkit.org/show_bug.cgi?id=131812.
2683
2684         Reviewed by Sam Weinig.
2685
2686         Added fast/multicol/newmulticol/compare-with-old-impl/LeftToRight-tb.html.
2687
2688         * rendering/RenderBlockFlow.cpp:
2689         (WebCore::RenderBlockFlow::layoutBlock):
2690         (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
2691         * rendering/RenderBlockFlow.h:
2692         Pass in relayoutChildren as a reference boolean to checkForPaginationLogicalHeightChange.
2693         The new columns need to be able to set it to true if the amount of available column
2694         height ever changes, so that the RenderFlowThread and the sets get a layout call.
2695
2696         * rendering/style/RenderStyle.cpp:
2697         (WebCore::RenderStyle::setColumnStylesFromPaginationMode):
2698         Make sure that the pagination mode is set up with an auto column-fill specified. You
2699         don't ever want to balance when you set a pagination mode on the RenderView.
2700
2701 2014-04-21  Tim Horton  <timothy_horton@apple.com>
2702
2703         [iOS WebKit2] Implement CSS viewport units
2704         https://bugs.webkit.org/show_bug.cgi?id=131863
2705         <rdar://problem/16279088>
2706
2707         Reviewed by Darin Adler.
2708
2709         * WebCore.exp.in:
2710         * page/FrameView.cpp:
2711         (WebCore::FrameView::setViewportSize):
2712         * page/FrameView.h:
2713         (WebCore::FrameView::viewportSize):
2714         Add setViewportSize() and viewportSize().
2715         If the viewport size changes, we have to do style recalc.
2716         If we have an overridden viewport size, use it.
2717
2718         * rendering/RenderView.cpp:
2719         (WebCore::RenderView::viewportSize):
2720         * rendering/RenderView.h:
2721         Get the size from FrameView.
2722
2723 2014-04-21  Joseph Pecoraro  <pecoraro@apple.com>
2724
2725         Remove unused WebKitSystemInterface functions
2726         https://bugs.webkit.org/show_bug.cgi?id=131938
2727
2728         Reviewed by Alexey Proskuryakov.
2729
2730         * WebCore.exp.in:
2731         * platform/ios/WebCoreSystemInterfaceIOS.mm:
2732         * platform/mac/WebCoreSystemInterface.h:
2733         * platform/mac/WebCoreSystemInterface.mm:
2734
2735 2014-04-21  Andreas Kling  <akling@apple.com>
2736
2737         Move the JSString cache from DOMWrapperWorld to VM.
2738         <https://webkit.org/b/131940>
2739
2740         Since there's no need for JSStrings to be world-specific, this patch
2741         moves the string cache to JSC::VM. This makes jsStringWithCache()
2742         a lot faster since it no longer has to jump through twenty-eleven
2743         hoops to find the DOMWrapperWorld.
2744
2745         Reviewed by Geoff Garen.
2746
2747         * bindings/js/DOMWrapperWorld.cpp:
2748         (WebCore::DOMWrapperWorld::clearWrappers):
2749         * bindings/js/DOMWrapperWorld.h:
2750         * bindings/js/JSDOMBinding.cpp:
2751         (WebCore::jsStringWithCache):
2752
2753 2014-04-21  David Hyatt  <hyatt@apple.com>
2754
2755         [New Multicolumn] Column balancing is slow on float-multicol.html
2756         https://bugs.webkit.org/show_bug.cgi?id=131801
2757
2758         Reviewed by Enrica Casucci.
2759
2760         Added fast/multicol/tall-float.html
2761
2762         * rendering/RenderBlock.cpp:
2763         (WebCore::RenderBlock::expandsToEncloseOverhangingFloats):
2764         Make RenderFlowThreads expand to encompass floats. Also from Morten's patch for
2765         Blink (#361551).
2766
2767         * rendering/RenderBlockFlow.cpp:
2768         (WebCore::RenderBlockFlow::computeOverflow):
2769         Fix a bug where the new multi-column code was adding in overflow for floats
2770         when it should not. This was resulting in the creation of scrollbars when none
2771         should exist. This is my own addition.
2772
2773         (WebCore::RenderBlockFlow::addOverhangingFloats):
2774         Make RenderFlowThreads and RenderRegions ignore overhanging float additions. This
2775         comes from Morten's patch for Blink (#361551).
2776
2777 2014-04-21  Darin Adler  <darin@apple.com>
2778
2779         REGRESSION (r160908): Safari doesn't draw rotated images properly first time
2780         https://bugs.webkit.org/show_bug.cgi?id=131930
2781
2782         Reviewed by Anders Carlsson.
2783
2784         With render tree creation sufficiently lazy, we had to put some explicit
2785         calls to updateStyleIfNeeded into the ImageDocument class.
2786
2787         * dom/DOMImplementation.cpp:
2788         (WebCore::DOMImplementation::createDocument): Pass a Frame&.
2789
2790         * html/ImageDocument.cpp:
2791         (WebCore::ImageDocument::imageSize): Added this helper function. This updates
2792         style so we can use the renderer to compute an image size taking things like
2793         orientation into account, and also passes in the zoom factor.
2794         (WebCore::ImageDocument::updateDuringParsing): Moved the body of the
2795         ImageDocumentParser::appendBytes function into this function. Since it's a
2796         member of ImageDocument, it has better access to appropriate private members,
2797         and we don't have to expose as many functions to the public. Also changed to
2798         not use the frame so much. Also merged in the code that creates the document
2799         instead of having it be a side effect in the cachedImage helper function; all
2800         the other call sites were checking for null before calling cachedImage.
2801         (WebCore::ImageDocument::finishedParsing): Moved the body of the
2802         ImageDocumentParser::finish function here. Added a call to updateStyleIfNeeded
2803         before using the renderer to get the image size.
2804         (WebCore::ImageDocumentParser::document): Made this return a reference. It's
2805         just a convenience function used in the two functions below.
2806         (WebCore::ImageDocumentParser::appendBytes): Just call updateDuringParsing.
2807         (WebCore::ImageDocumentParser::finish): Just call finishedParsing.
2808         (WebCore::ImageDocument::ImageDocument): Take a reference for the argument,
2809         use nullptr, and also initialize m_shouldShrinkImage directly instead of using
2810         a shouldShrinkToFit() helper function to do it.
2811         (WebCore::ImageDocument::createDocumentStructure): Removed unneeded check of
2812         null for the frame, since the caller does it. Removed some unneeded
2813         IGNORE_EXCEPTON and a stray semicolon. Use m_shouldShrinkImage instead of
2814         calling shouldShrinkToFit since at this early point they will be identical.
2815         (WebCore::ImageDocument::scale): Make non-const so we can call the new
2816         imageSize helper. Use Document::view instead of Frame::view. Improved the
2817         conversion to floating point so it doesn't involve a static_cast and an extra
2818         conversion from int to LayoutUnit.
2819         (WebCore::ImageDocument::resizeImageToFit): Ditto.
2820         (WebCore::ImageDocument::imageClicked): Ditto.
2821         (WebCore::ImageDocument::imageUpdated): Ditto. Also use m_shouldShrinkImage
2822         ibnstead of shouldShrinkToFit.
2823         (WebCore::ImageDocument::restoreImageSize): Ditto.
2824         (WebCore::ImageDocument::imageFitsInWindow): Ditto.
2825         (WebCore::ImageDocument::windowSizeChanged): Ditto.
2826         (WebCore::ImageDocument::cachedImage): Deleted. Moved logic into updateDuringParsing.
2827         (WebCore::ImageDocument::shouldShrinkToFit): Deleted. Moved logic into constructor.
2828         (WebCore::ImageEventListener::handleEvent): Updated for changes above.
2829         (WebCore::ImageEventListener::operator==): Simplified. No reason this has to check
2830         whether both listeners are in the same document.
2831         (WebCore::ImageDocumentElement::didMoveToNewDocument): Use nullptr.
2832
2833         * html/ImageDocument.h: Deleted some unused things, updated for changes above,
2834         and made some memer functions private.
2835
2836         * loader/FrameLoaderClient.h: Deleted the allowScriptFromSource, allowPlugins,
2837         allowImage, and allowDisplayingInsecureContent functions. These were only used in
2838         Chromium and are now unneeded complexity. We could bring them back if anyone wants them.
2839
2840         * loader/MixedContentChecker.cpp:
2841         (WebCore::MixedContentChecker::canDisplayInsecureContent): Removed call to
2842         allowDisplayingInsecureContent, just use the setting directly.
2843         (WebCore::MixedContentChecker::canRunInsecureContent): Removed call to
2844         allowRunningInsecureContent, just use the setting directly.
2845
2846         * loader/SubframeLoader.cpp:
2847         (WebCore::SubframeLoader::allowPlugins): Removed call to allowPlugins, just
2848         use the arePluginsEnabled setting directly.
2849
2850         * loader/cache/CachedResourceLoader.cpp:
2851         (WebCore::CachedResourceLoader::canRequest): Removed call to allowScriptFromSource, just
2852         use the isScriptEnabled setting directly.
2853         (WebCore::CachedResourceLoader::clientDefersImage): Removed call to allowImage.
2854
2855 2014-04-21  David Hyatt  <hyatt@apple.com>
2856
2857         [New Multicolumn] Pagination mode messed up with non-inline axis and reversed direction.
2858         https://bugs.webkit.org/show_bug.cgi?id=131811
2859
2860         Reviewed by Dean Jackson.
2861
2862         Added fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb.html
2863         
2864         With block axis pagination mode, it is possible to set a column height that is not the same
2865         as the available fill height for a block. The new multi-column code had the assumption that
2866         the column height was the same as the amount of fill room you had available. This is not
2867         the case.
2868         
2869         To correct the issue, I added a member variable to RenderMultiColumnSet that stores the
2870         available column height as a separate variable from the computed column height. This allows
2871         the pagination API to specify a different column height that is not the same as the view's
2872         content height.
2873
2874         Even though it isn't involved in the solution, I also patched pageOrViewLogicalHeight on
2875         RenderView to work with the new column code as well.
2876
2877         To address the layout test failures (that caused the previous rollout), I made sure to
2878         initialize m_availableHeight to 0 when m_computedColumnHeight also gets reset to 0.
2879         
2880         The assertion is not something I could reproduce on any machine, but I can see the problem.
2881         I patched Page's pageCount method to not have column code directly in Page.cpp, 
2882         and to make a new pageCount() method on RenderView that Page calls
2883         into. This method is now patched to handle the new column code as well as the old. I have
2884         no real way of testing this method though, since I can't reproduce the assertion that the
2885         bots were experiencing.
2886
2887         * page/Page.cpp:
2888         (WebCore::Page::pageCount):
2889         * rendering/RenderMultiColumnSet.cpp:
2890         (WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
2891         (WebCore::RenderMultiColumnSet::setAndConstrainColumnHeight):
2892         (WebCore::RenderMultiColumnSet::prepareForLayout):
2893         (WebCore::RenderMultiColumnSet::computeLogicalHeight):
2894         * rendering/RenderMultiColumnSet.h:
2895         * rendering/RenderView.cpp:
2896         (WebCore::RenderView::pageOrViewLogicalHeight):
2897         (WebCore::RenderView::pageCount):
2898         * rendering/RenderView.h:
2899
2900 2014-04-18  Dean Jackson  <dino@apple.com>
2901
2902         [Media] Clean up localized strings in controls
2903         https://bugs.webkit.org/show_bug.cgi?id=131857
2904         <rdar://problem/16663005>
2905
2906         Reviewed by Eric Carlson.
2907
2908         There is no need for separate localization files
2909         on OS X and iOS. Move the small number of iOS-specific
2910         localizations into a shared file.
2911
2912         We also don't need a function to return a static table.
2913         Ultimately I think we want a top-level WebKit object that
2914         hold the table, but for now use a global variable
2915         called UIStringTable. Since we're in an isolated world, we
2916         won't clash with anything.
2917
2918         I noticed a few cases were we grab a localized string and
2919         then instantly run a replacement on it. This should be
2920         supported directly in the UIString() accessor.
2921
2922         * English.lproj/mediaControlsLocalizedStrings.js: Add iOS strings. Just
2923         use a static table.
2924         (mediaControlsLocalizedStrings): Deleted.
2925         * English.lproj/mediaControlsLocalizedStringsiOS.js: Removed.
2926         * Modules/mediacontrols/mediaControlsApple.js:
2927         (Controller.prototype.extend): Fix braces.
2928         (Controller.prototype.UIString): Use the string table, and allow replacement.
2929         (Controller.prototype.createControls): Use new UIString replacement.
2930         * Modules/mediacontrols/mediaControlsiOS.js:
2931         (ControllerIOS.prototype.updateWirelessPlaybackStatus): Use new UIString.
2932         (ControllerIOS.prototype.UIString): Deleted. Use the parent class version.
2933         * WebCore.xcodeproj/project.pbxproj: Remove file from Resources.
2934         * rendering/RenderThemeIOS.mm:
2935         (WebCore::RenderThemeIOS::mediaControlsScript): No need to include the iOS
2936         specific localization file.
2937
2938 2014-04-21  Brent Fulgham  <bfulgham@apple.com>
2939
2940         [Win] Unreviewed build fix.
2941
2942         * inspector/TimelineRecordFactory.cpp: Add missing include.
2943
2944 2014-04-21  Zan Dobersek  <zdobersek@igalia.com>
2945
2946         Move cross-port Source/WebCore/page/ code to std::unique_ptr
2947         https://bugs.webkit.org/show_bug.cgi?id=130534
2948
2949         Reviewed by Darin Adler.
2950
2951         Replace uses of OwnPtr and PassOwnPtr in cross-port code under Source/WebCore/page/ with
2952         std::unique_ptr. Unnecessary OwnPtr.h and PassOwnPtr.h header inclusions are removed as well.
2953
2954         * dom/Document.cpp:
2955         (WebCore::Document::initSecurityContext):
2956         * dom/SecurityContext.cpp:
2957         (WebCore::SecurityContext::setContentSecurityPolicy):
2958         * dom/SecurityContext.h:
2959         * page/CaptionUserPreferences.h:
2960         * page/ContentSecurityPolicy.cpp:
2961         (WebCore::CSPDirectiveList::create):
2962         (WebCore::CSPDirectiveList::checkEvalAndReportViolation):
2963         (WebCore::CSPDirectiveList::checkInlineAndReportViolation):
2964         (WebCore::CSPDirectiveList::checkSourceAndReportViolation):
2965         (WebCore::CSPDirectiveList::setCSPDirective):
2966         (WebCore::ContentSecurityPolicy::didReceiveHeader):
2967         * page/ContentSecurityPolicy.h:
2968         * page/DOMSecurityPolicy.h:
2969         * page/DOMWindow.cpp:
2970         (WebCore::PostMessageTimer::fired):
2971         (WebCore::DOMWindow::postMessageTimerFired):
2972         * page/DOMWindow.h:
2973         * page/EventHandler.cpp:
2974         (WebCore::EventHandler::EventHandler):
2975         * page/EventHandler.h:
2976         * page/Frame.cpp:
2977         (WebCore::Frame::Frame):
2978         (WebCore::createRegExpForLabels):
2979         (WebCore::Frame::searchForLabelsAboveCell):
2980         (WebCore::Frame::searchForLabelsBeforeElement):
2981         (WebCore::matchLabelsAgainstString):
2982         (WebCore::Frame::setTiledBackingStoreEnabled):
2983         * page/Frame.h:
2984         * page/FrameView.cpp:
2985         (WebCore::FrameView::addEmbeddedObjectToUpdate):
2986         (WebCore::FrameView::addSlowRepaintObject):
2987         (WebCore::FrameView::addViewportConstrainedObject):
2988         (WebCore::FrameView::addScrollableArea):
2989         * page/FrameView.h:
2990         * page/Page.cpp:
2991         (WebCore::Page::Page):
2992         * page/Page.h:
2993         * page/PageConsole.h:
2994         * page/PageThrottler.h:
2995         * page/SecurityPolicy.cpp:
2996         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
2997         * page/animation/AnimationController.h:
2998         * page/animation/CSSPropertyAnimation.cpp:
2999         (WebCore::PropertyWrapperVisitedAffectedColor::PropertyWrapperVisitedAffectedColor):
3000         (WebCore::CSSPropertyAnimationWrapperMap::instance):
3001         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
3002         * page/mac/PageMac.cpp:
3003         (WebCore::Page::addSchedulePair):
3004         * workers/WorkerGlobalScope.cpp:
3005         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyFromString):
3006
3007 2014-04-21  Darin Adler  <darin@apple.com>
3008
3009         Add HashSet::takeAny
3010         https://bugs.webkit.org/show_bug.cgi?id=131928
3011
3012         Reviewed by Benjamin Poulain.
3013
3014         * dom/Document.cpp:
3015         (WebCore::Document::takeAnyMediaCanStartListener): Use HashSet::takeAny.
3016         * dom/ScriptExecutionContext.cpp:
3017         (WebCore::takeAny): Deleted.
3018         (WebCore::ScriptExecutionContext::~ScriptExecutionContext): Use HashSet::takeAny.
3019
3020 2014-04-21  Zan Dobersek  <zdobersek@igalia.com>
3021
3022         iOS and non-iOS RemoteCommandListener::create() functions should use std::make_unique<>()
3023         https://bugs.webkit.org/show_bug.cgi?id=131916
3024
3025         Reviewed by Darin Adler.
3026
3027         A follow-up to r167197. Make RemoteCommandListener ctor public and use std::make_unique<>()
3028         in both versions of RemoteCommandListener::create() functions (iOS and non-iOS).
3029
3030         * platform/RemoteCommandListener.cpp:
3031         (WebCore::RemoteCommandListener::create):
3032         * platform/RemoteCommandListener.h:
3033         (WebCore::RemoteCommandListener::RemoteCommandListener):
3034         * platform/ios/RemoteCommandListenerIOS.mm:
3035         (WebCore::RemoteCommandListener::create):
3036
3037 2014-04-21  Andreas Kling  <akling@apple.com>
3038
3039         Micro-optimize the way we hand NodeLists to JSC.
3040         <https://webkit.org/b/131932>
3041
3042         Use HashMap::fastAdd() when returning cached node lists and collections.
3043         10.9% progression on Bindings/get-elements-by-tag-name.html
3044
3045         Reviewed by Antti Koivisto.
3046
3047         * dom/NodeRareData.h:
3048         (WebCore::NodeListsNodeData::addCacheWithAtomicName):
3049         (WebCore::NodeListsNodeData::addCacheWithName):
3050         (WebCore::NodeListsNodeData::addCacheWithQualifiedName):
3051         (WebCore::NodeListsNodeData::addCachedCollection):
3052
3053 2014-04-21  Commit Queue  <commit-queue@webkit.org>
3054
3055         Unreviewed, rolling out r167584.
3056         https://bugs.webkit.org/show_bug.cgi?id=131929
3057
3058         Broke Objective-C bindings test (Requested by ap on #webkit).
3059
3060         Reverted changeset:
3061
3062         "Add Element.matches, the standard name for
3063         webkitMatchesSelector"
3064         https://bugs.webkit.org/show_bug.cgi?id=131922
3065         http://trac.webkit.org/changeset/167584
3066
3067 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
3068
3069         Compile the :root pseudo class and fix a related issue with :nth-child()
3070         https://bugs.webkit.org/show_bug.cgi?id=131926
3071
3072         Reviewed by Andreas Kling.
3073
3074         Add the :root pseudo class. This is another trivial selector, we just need to compare
3075         the element pointer with the documentElement.
3076
3077         I discovered some issues with :nth-child(n) through the layout tests for ":root".
3078         When the pseudo class nth-child could match anything, no code was generated. That decision
3079         was taken when generating the fragments.
3080
3081         The specification of :nth-child() has two tests: the parent test and the counter test.
3082         Since some fragments would not generate any code for :nth-child(n), they would succeed on the root,
3083         which is incorrect since the root should fail the parent test.
3084
3085         This was fixed by moving the filtering of non-counting :nth-child() after we generate the parent
3086         check.
3087         We still don't generate any counter test unless required.
3088
3089         Test: fast/selectors/nth-child-on-root.html
3090
3091         * cssjit/SelectorCompiler.cpp:
3092         (WebCore::SelectorCompiler::addPseudoClassType):
3093         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
3094         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
3095         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsRoot):
3096         * dom/Document.h:
3097         (WebCore::Document::documentElementMemoryOffset):
3098
3099 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
3100
3101         Add Element.matches, the standard name for webkitMatchesSelector
3102         https://bugs.webkit.org/show_bug.cgi?id=131922
3103
3104         Reviewed by Andreas Kling.
3105
3106         This patch just renames webkitMatchesSelector() to matches().
3107
3108         * bindings/scripts/CodeGeneratorObjC.pm:
3109         (GenerateImplementation):
3110         The Objective-C binding generator only supported ImplementedAs for getters and setters.
3111         This adds support for the option so that Element.matches can be generated for Obj-C.
3112
3113         * dom/Element.cpp:
3114         (WebCore::Element::matches):
3115         (WebCore::Element::webkitMatchesSelector): Deleted.
3116         * dom/Element.h:
3117         * dom/Element.idl:
3118         * inspector/InspectorCSSAgent.cpp:
3119         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
3120
3121 2014-04-20  Zalan Bujtas  <zalan@apple.com>
3122
3123         Subpixel rendering: RenderLayer's size is set using enclosingRect() which can result in cruft.
3124         https://bugs.webkit.org/show_bug.cgi?id=131468
3125
3126         Reviewed by Darin Adler.
3127
3128         Layers marked opaque may not paint edge pixels, when RenderLayer bounds are non-integral and
3129         get device pixel snapped.
3130         For details see this: https://trac.webkit.org/r159463
3131
3132         Test: compositing/hidpi-non-simple-compositing-layer-with-fractional-size-and-background.html
3133
3134         * rendering/RenderLayerBacking.cpp:
3135         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
3136
3137 2014-04-19  Darin Adler  <darin@apple.com>
3138
3139         Simple layout can get confused by coordinate overflow
3140         https://bugs.webkit.org/show_bug.cgi?id=131890
3141         rdar://problem/15558510
3142
3143         Reviewed by Andreas Kling.
3144
3145         Test: fast/css/simple-layout-overflow.html
3146
3147         * rendering/SimpleLineLayoutResolver.h:
3148         (WebCore::SimpleLineLayout::RunResolver::rangeForRect):
3149         If lastLine is smaller than firstLine, just ignore it.
3150
3151 2014-04-20  Darin Adler  <darin@apple.com>
3152
3153         ScriptExecutionContext::stopActiveDOMObjects iterates a hash map that can change during iteration (for multiple reasons, including GC)
3154         https://bugs.webkit.org/show_bug.cgi?id=52719
3155
3156         Reviewed by Alexey Proskuryakov.
3157
3158         At least two specific ways this can happen:
3159
3160         1) XMLHttpRequest::stop can trigger a JavaScript garbage collection.
3161         2) NotificationCenter::stop can delete the last references to notifications;
3162            those notifications are also active DOM objects.
3163
3164         Besides fixing the iteration in that function, did some other fixes for the
3165         ScriptExecutionContext class, including some coding style changes. Many uses
3166         of nullptr instead of 0, without listing each function separately below.
3167
3168         * Modules/webdatabase/DatabaseContext.cpp:
3169         (WebCore::DatabaseContext::contextDestroyed): Call through to the base class
3170         version of contextDestroyed rather than repeating what it does (with a large
3171         comment that doesn't acknowledge the base class alread does it).
3172         * Modules/webdatabase/DatabaseContext.h: Removed some unneeded includes.
3173         Wrote out "private" explicitly for deriving from ActiveDOMObject. Made the
3174         ActiveDOMObject function overrides private, and marked them override and final.
3175
3176         * dom/ActiveDOMObject.h: Updated comments. Replaced suspendIfNeededCalled with
3177         assertSuspendIfNeededWasCalled, which has an empty inline version in the header.
3178         Renamed m_suspendIfNeededCalled to m_suspendIfNeededWasCalled.
3179
3180         * dom/ActiveDOMObject.cpp:
3181         (WebCore::ActiveDOMObject::ActiveDOMObject): Pass a reference instead of a pointer.
3182         (WebCore::ActiveDOMObject::~ActiveDOMObject): Ditto.
3183         (WebCore::ActiveDOMObject::suspendIfNeeded): Ditto.
3184
3185         * dom/ContextDestructionObserver.cpp:
3186         (WebCore::ContextDestructionObserver::observeContext): Pass a reference instead of a pointer.
3187
3188         * dom/MessagePort.cpp:
3189         (WebCore::MessagePort::MessagePort): Pass a reference instead of a pointer.
3190         (WebCore::MessagePort::~MessagePort): Ditto.
3191         (WebCore::MessagePort::disentangle): Ditto.
3192
3193         * dom/ScriptExecutionContext.cpp:
3194         (WebCore::ScriptExecutionContext::ScriptExecutionContext): Updated flags used
3195         for assertions so they are conditional and updated their names.
3196         (WebCore::takeAny): Added. Helper function that we can consider for HashSet in
3197         the future; makes loop below easier to read.
3198         (WebCore::checkConsistency): Added. Assertions that were done multiple places below,
3199         and should not be written over and over again.
3200         (WebCore::ScriptExecutionContext::~ScriptExecutionContext): Changed to use C++11
3201         for loops and the takeAny function above.
3202         (WebCore::ScriptExecutionContext::dispatchMessagePortEvents): Ditto.
3203         (WebCore::ScriptExecutionContext::createdMessagePort): Changed to take a reference
3204         for clarity and so it doesn't have to do an assert the pointer is non-null.
3205         (WebCore::ScriptExecutionContext::destroyedMessagePort): Ditto.
3206         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects): Changed to use
3207         C++11 for loop and reworded comment and redid assertions.
3208         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): Ditto.
3209         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): Ditto.
3210         (WebCore::ScriptExecutionContext::stopActiveDOMObjects): Changed to support
3211         removal of an active DOM object during the stop function. Included new comments
3212         to clarify what the rules are.
3213         (WebCore::ScriptExecutionContext::suspendActiveDOMObjectIfNeeded): Changed to take
3214         a reference for clarity and so it doesn't have to assert a pointer is non-null.
3215         (WebCore::ScriptExecutionContext::didCreateActiveDOMObject): Ditto. Also changed to
3216         use RELEASE_ASSERT instead of CRASH.
3217         (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject): Ditto.
3218         (WebCore::ScriptExecutionContext::didCreateDestructionObserver): Ditto.
3219         (WebCore::ScriptExecutionContext::willDestroyDestructionObserver): Ditto.
3220         (WebCore::ScriptExecutionContext::closeMessagePorts): Moved the body of this
3221         function into its one call site, ScriptExecutionContext::stopActiveDOMObjects,
3222         since it's simple enough when written as a C++11 for loop.
3223         (WebCore::ScriptExecutionContext::hasPendingActivity): Added. This function was
3224         already exported for workers, and implementing it outside this class required
3225         exposing the private HashSet members; more sensible to implement it here and
3226         simply make it public in WorkerGlobalScope.
3227
3228         * dom/ScriptExecutionContext.h: Removed unnecessary includes and forward declarations.
3229         Removed a long-ago-fixed FIXME. Changed various functions to take references instead of
3230         pointers. Added a protected hasPendingActivity function, deleted the closeMessagePorts
3231         function, deleted the ActiveDOMObjectsSet typedef, made the assertion flags be
3232         !ASSERT_DISABLED only, and deleted the messagePorts and activeDOMObjects functions.
3233
3234         * workers/WorkerGlobalScope.cpp:
3235         (WebCore::WorkerGlobalScope::hasPendingActivity): Deleted. This is now implemented
3236         in the base class.
3237
3238         * workers/WorkerGlobalScope.h: Make hasPendingActivity function from the base class
3239         public instead of declaring it in this class.
3240
3241 2014-04-20  Brent Fulgham  <bfulgham@apple.com>
3242
3243         [Mac] Unable to select 'Off' or 'Auto' from track menu when tracks consist of unsupported track types
3244         https://bugs.webkit.org/show_bug.cgi?id=131908
3245         <rdar://problem/15999882>
3246
3247         Reviewed by Eric Carlson.
3248
3249         * html/HTMLMediaElement.cpp:
3250         (WebCore::HTMLMediaElement::setSelectedTextTrack): When the user selects 'Off', make sure the currently 'showing'
3251         track is switched to 'disabled'.
3252
3253 2014-04-20  Andreas Kling  <akling@apple.com>
3254
3255         Speed up jsStringWithCache() through WeakGCMap inlining.
3256         <https://webkit.org/b/131923>
3257
3258         Inline the common path of WeakGCMap::add() in jsStringWithCache().
3259         26% progression on Bindings/id-getter.html
3260
3261         Reviewed by Darin Adler.
3262
3263         * WebCore.exp.in:
3264         * bindings/js/JSDOMBinding.h:
3265         * bindings/js/JSDOMBinding.cpp:
3266         (WebCore::jsStringWithCache):
3267
3268             Move jsStringWithCache() out of line since we're now blowing up
3269             its size quite a bit.
3270
3271 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
3272
3273         Fix the build after r167574
3274
3275         * cssjit/SelectorCompiler.cpp:
3276         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
3277
3278 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
3279
3280         Compile the pseudo class :target
3281         https://bugs.webkit.org/show_bug.cgi?id=131904
3282
3283         Reviewed by Andreas Kling.
3284
3285         The pseudo class :target is trivial, it just compare the current element with
3286         Document::cssTarget().
3287
3288         * cssjit/SelectorCompiler.cpp:
3289         (WebCore::SelectorCompiler::addPseudoType):
3290         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
3291         (WebCore::SelectorCompiler::getDocument):
3292         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
3293         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsTarget):
3294         * dom/Document.h:
3295         (WebCore::Document::cssTargetMemoryOffset):
3296
3297 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
3298
3299         Rename the CSSSelector PseudoType to PseudoClassType
3300         https://bugs.webkit.org/show_bug.cgi?id=131907
3301
3302         Reviewed by Andreas Kling.
3303
3304         Pseudo Elements and Page Pseudo Classes have been moved out of PseudoType in previous patches.
3305         The remaining values in the PseudoType enumeration are the pseudo classes.
3306
3307         This patch is the final clean up, PseudoType is renamed to PseudoClassType.
3308
3309         * css/CSSGrammar.y.in:
3310         * css/CSSParserValues.cpp:
3311         (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
3312         * css/CSSParserValues.h:
3313         (WebCore::CSSParserSelector::pseudoClassType):
3314         (WebCore::CSSParserSelector::pseudoType): Deleted.
3315         * css/CSSSelector.cpp:
3316         (WebCore::CSSSelector::specificityForOneSelector):
3317         (WebCore::appendPseudoClassFunctionTail):
3318         (WebCore::CSSSelector::selectorText):
3319         * css/CSSSelector.h:
3320         (WebCore::CSSSelector::pseudoClassType):
3321         (WebCore::CSSSelector::pseudoElementType):
3322         (WebCore::CSSSelector::pagePseudoClassType):
3323         (WebCore::pseudoClassIsRelativeToSiblings):
3324         (WebCore::CSSSelector::isSiblingSelector):
3325         (WebCore::CSSSelector::CSSSelector):
3326         (WebCore::CSSSelector::pseudoType): Deleted.
3327         * css/RuleSet.cpp:
3328         (WebCore::RuleSet::findBestRuleSetAndAdd):
3329         * css/SelectorChecker.cpp:
3330         (WebCore::SelectorChecker::checkOne):
3331         (WebCore::SelectorChecker::checkScrollbarPseudoClass):
3332         (WebCore::SelectorChecker::determineLinkMatchType):
3333         (WebCore::SelectorChecker::matchesFocusPseudoClass):
3334         * css/SelectorChecker.h:
3335         (WebCore::SelectorChecker::isCommonPseudoClassSelector):
3336         * css/SelectorCheckerFastPath.cpp:
3337         (WebCore::SelectorCheckerFastPath::commonPseudoClassSelectorMatches):
3338         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
3339         * css/SelectorPseudoTypeMap.h:
3340         * css/StyleResolver.cpp:
3341         (WebCore::StyleResolver::styleForElement):
3342         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
3343         (enumerablePseudoType):
3344         * cssjit/SelectorCompiler.cpp:
3345         (WebCore::SelectorCompiler::addPseudoClassType):
3346         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
3347         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
3348         (WebCore::SelectorCompiler::addPseudoType): Deleted.
3349         * inspector/InspectorCSSAgent.cpp:
3350         (WebCore::computePseudoClassMask):
3351         (WebCore::InspectorCSSAgent::forcePseudoState):
3352         * inspector/InspectorCSSAgent.h:
3353         * inspector/InspectorInstrumentation.cpp:
3354         (WebCore::InspectorInstrumentation::forcePseudoStateImpl):
3355         * inspector/InspectorInstrumentation.h:
3356         (WebCore::InspectorInstrumentation::forcePseudoState):
3357
3358 2014-04-19  Alexey Proskuryakov  <ap@apple.com>
3359
3360         Crashes in HTMLFormElement::submit.
3361         https://bugs.webkit.org/show_bug.cgi?id=131910
3362         <rdar://problem/15661790>
3363
3364         Based on a patch by Kent Tamura.
3365
3366         Reviewed by Anders Carlsson.
3367
3368         Tests: fast/forms/form-submission-crash-2.html
3369                fast/forms/form-submission-crash.html
3370
3371         Code that executes arbitrary JS needs to protect objects that it uses afterwards.
3372
3373         * html/HTMLFormElement.cpp:
3374         (WebCore::HTMLFormElement::prepareForSubmission):
3375         (WebCore::HTMLFormElement::submit):
3376         * loader/FrameLoader.cpp:
3377         (WebCore::FrameLoader::submitForm):
3378
3379 2014-04-20  Antti Koivisto  <antti@apple.com>
3380
3381         Text bounding box computation for simple line layout is wrong
3382         https://bugs.webkit.org/show_bug.cgi?id=131912
3383
3384         Reviewed by Andreas Kling.
3385
3386         Top-left is currently the first line top-left which is not always correct.
3387
3388         * WebCore.exp.in:
3389         * rendering/RenderText.cpp:
3390         (WebCore::RenderText::firstRunLocation):
3391         (WebCore::RenderText::firstRunOrigin): Deleted.
3392         (WebCore::RenderText::firstRunX): Deleted.
3393         (WebCore::RenderText::firstRunY): Deleted.
3394         
3395             Keep just one accessor and rename it.
3396             Encapsulate the line box and simple line versions.
3397
3398         * rendering/RenderText.h:
3399         * rendering/RenderTextLineBoxes.cpp:
3400         (WebCore::RenderTextLineBoxes::firstRunLocation):
3401
3402             Line box version.
3403
3404         * rendering/RenderTextLineBoxes.h:
3405         * rendering/RenderTreeAsText.cpp:
3406         
3407             Simplify RenderText dumping.
3408
3409         (WebCore::RenderTreeAsText::writeRenderObject):
3410         * rendering/SimpleLineLayoutFunctions.cpp:
3411         (WebCore::SimpleLineLayout::computeTextBoundingBox):
3412         
3413             Return the correct x position.
3414
3415         (WebCore::SimpleLineLayout::computeTextFirstRunLocation):
3416         
3417             Simple line version.
3418
3419         * rendering/SimpleLineLayoutFunctions.h:
3420         * rendering/svg/SVGRenderTreeAsText.cpp:
3421         (WebCore::writeSVGInlineText):
3422
3423 2014-04-19  Zalan Bujtas  <zalan@apple.com>
3424
3425         Subpixel rendering: RenderLayer's clipping should snap to device pixel boundaries.
3426         https://bugs.webkit.org/show_bug.cgi?id=131466
3427
3428         Reviewed by Simon Fraser.
3429
3430         Fractional pixel clipping can produce cruft on RenderLayers. Since RenderLayer
3431         sizing and painting are snapped, painting clip rect needs to be snapped the same way.
3432
3433         Test: fast/clip/clip-when-rect-has-fractional-pixel-value.html
3434
3435         * rendering/RenderLayer.cpp:
3436         (WebCore::RenderLayer::clipToRect):
3437
3438 2014-04-19  Brent Fulgham  <bfulgham@apple.com>
3439
3440         Latched scrolling may interact badly with custom programmatic scrolling
3441         https://bugs.webkit.org/show_bug.cgi?id=131869
3442         <rdar://problem/16249557>
3443
3444         Reviewed by Darin Adler.
3445
3446         * dom/Element.cpp:
3447         (WebCore::Element::setScrollLeft): Mark scrollable area as having
3448         been scrolled programmatically.
3449         (WebCore::Element::setScrollTop): Ditto.
3450         * page/EventHandler.cpp:
3451         (WebCore::EventHandler::handleWheelEvent): Check for programmatic scroll, and
3452         clear latched state if the handler manually scrolled. Clear programmatic
3453         scroll state at the end of event handling.
3454         (WebCore::EventHandler::clearLatchedState): Refactored code.
3455         * page/EventHandler.h:
3456         * page/mac/EventHandlerMac.mm:
3457         (WebCore::EventHandler::platformPrepareForWheelEvents): Check
3458         if scrollable area was scrolled programmatically. If it was, do
3459         not honor latching behavior.
3460         * platform/ScrollableArea.cpp:
3461         (WebCore::ScrollableArea::ScrollableArea): Initialize new member.
3462         * platform/ScrollableArea.h:
3463         (WebCore::ScrollableArea::isScrolledProgrammatically): Added.
3464         (WebCore::Scrollab