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