REGRESSION (r157328): popover to check into flight ba.com dismisses instantly when...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-04-22  Ryosuke Niwa  <rniwa@webkit.org>
2
3         REGRESSION (r157328): popover to check into flight ba.com dismisses instantly when focusing form
4         https://bugs.webkit.org/show_bug.cgi?id=131949
5
6         Reviewed by Darin Adler.
7
8         The regression was caused by two bugs:
9         1. The event didn't stop propagating itself even when it should.
10            If the related target is same as the event origin, the event propagation should stop when the event reaches
11            the root of the related target's tree scope. Otherwise, it should stop when it reaches the related target.
12
13         2. Mouse event's related target exposed nodes inside a user-agent shadow DOM when the related target appeared
14            inside the origin.
15
16         Fixed the bugs by re-introducing path shrinkage algorithm removed in r157328 into EventPath::setRelatedTarget
17         and adding an algorithm to determine the least common ancestor of the related target and the current target
18         in moveToParentOrShadowHost. The latter algorithm doesn't match the shadow DOM specification:
19         http://www.w3.org/TR/2013/WD-shadow-dom-20130514/
20         but it's good enough in terms of the Web exposed behavior as we don't support author defined insertion points.
21
22         Test: fast/events/shadow-event-path.html
23
24         * dom/EventDispatcher.cpp:
25         (WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
26         (WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope): Added.
27         (WebCore::EventDispatcher::dispatchEvent):
28         (WebCore::EventPath::setRelatedTarget):
29
30 2014-04-22  Ryosuke Niwa  <rniwa@webkit.org>
31
32         Rollout r156635 since the old behavior was intentional.
33
34         * page/EventHandler.cpp:
35         (WebCore::EventHandler::selectCursor):
36
37 2014-04-22  Commit Queue  <commit-queue@webkit.org>
38
39         Unreviewed, rolling out r167674.
40         https://bugs.webkit.org/show_bug.cgi?id=132025
41
42         Going a different way with this (Requested by bradee-oh on
43         #webkit).
44
45         Reverted changeset:
46
47         "Change Image Controls replacement to use selection and paste"
48         https://bugs.webkit.org/show_bug.cgi?id=131992
49         http://trac.webkit.org/changeset/167674
50
51 2014-04-22  Brent Fulgham  <bfulgham@apple.com>
52
53         [Win] Support Python 2.7 in Cygwin
54         https://bugs.webkit.org/show_bug.cgi?id=132023
55
56         Reviewed by Michael Saboff.
57
58         * DerivedSources.make: Use proper path to Cygwin on
59         all platforms.
60
61 2014-04-22  Andreas Kling  <akling@apple.com>
62
63         REGRESSION (r151839): Subframe keeps getting mousemove events with the same coordinates after hiding a hovered element.
64         <https://webkit.org/b/131974>
65         <rdar://problem/15907469>
66
67         When the currently hovered element disappears as a result of style recalc,
68         we send a fake mousemove event to the page, to see if anything newly added
69         should become hovered.
70
71         The faking mechanism lives in EventHandler and simply synthesizes a new
72         mousemove event using the last seen mouse location.
73
74         The problem here is that we were sending this fake mousemove event to the
75         subframe where the hovered element lived. Since subframes aren't kept up
76         to date on recent mouse locations, this could cause some strange behavior
77         where a subframe would dispatch mousemove events with stale coordinates.
78
79         The solution is to always dispatch fake mousemove events from the main
80         frame's event handler. This is how real event delivery happens, and hit
81         testing will then find the appropriate subframe, if any.
82
83         Reviewed by Benjamin Poulain.
84
85         Test: fast/events/ghostly-mousemoves-in-subframe.html
86
87         * dom/Document.cpp:
88         (WebCore::Document::recalcStyle):
89
90 2014-04-22  Myles C. Maxfield  <mmaxfield@apple.com>
91
92         [OS X] Glyph spacing for system fonts may be incorrect
93         https://bugs.webkit.org/show_bug.cgi?id=131967
94
95         Unreviewed iOS build fix after r167679.
96
97         * platform/graphics/mac/SimpleFontDataMac.mm:
98
99 2014-04-22  Myles C. Maxfield  <mmaxfield@apple.com>
100
101         [OS X] Glyph spacing for system fonts may be incorrect
102         https://bugs.webkit.org/show_bug.cgi?id=131967
103
104         Unreviewed build fix after r167679.
105
106         * platform/graphics/mac/SimpleFontDataMac.mm:
107         (WebCore::hasCustomTracking):
108
109 2014-04-21  Myles C. Maxfield  <mmaxfield@apple.com>
110
111         [OS X] Glyph spacing for system fonts may be incorrect
112         https://bugs.webkit.org/show_bug.cgi?id=131967
113
114         Reviewed by Simon Fraser.
115
116         Covered by existing tests.
117
118         * platform/graphics/mac/SimpleFontDataMac.mm:
119         (WebCore::SimpleFontData::platformWidthForGlyph): Update to use CTFontGetAdvancesForGlyphs() for system fonts
120         (WebCore::hasCustomTracking):
121
122 2014-04-22  David Hyatt  <hyatt@apple.com>
123
124         [New Multicolumn] widows/orphans cause assertion failures.
125         https://bugs.webkit.org/show_bug.cgi?id=131233
126
127         Reviewed by Dean Jackson.
128
129         * rendering/RenderMultiColumnSet.cpp:
130         (WebCore::RenderMultiColumnSet::recordSpaceShortage):
131         Fix an obvious bug where the space shortage is recorded twice (and the
132         if statement that kept it from being negative is accidentally ignored).
133
134 2014-04-22  David Hyatt  <hyatt@apple.com>
135
136         [New Multicolumn] Make sure columnTranslationForOffset has the same column-span-aware
137         translation that fragment collection does.
138         https://bugs.webkit.org/show_bug.cgi?id=131738
139
140         Reviewed by Anders Carlsson.
141
142         * rendering/RenderMultiColumnSet.cpp:
143         (WebCore::RenderMultiColumnSet::collectLayerFragments):
144         Remove a FIXME that is no longer needed, since the translation offset of the 
145         column set did get patched.
146
147         (WebCore::RenderMultiColumnSet::columnTranslationForOffset):
148         Add the exact same fix to columnTranslationForOffset that was applied to collectLayerFragments.
149
150 2014-04-22  Mark Lam  <mark.lam@apple.com>
151
152         WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript() needs to acquire the JSLock before calling into JS.
153         <https://webkit.org/b/132021>
154
155         Reviewed by Mark Hahnenberg.
156
157         Covered by existing layout test.
158
159         * html/HTMLMediaElement.cpp:
160         (WebCore::HTMLMediaElement::parseAttribute):
161
162 2014-04-22  Manuel Rego Casasnovas  <rego@igalia.com>
163
164         REGRESSION (r167652): Broke fast/regions/cssom/region-range-for-box-crash.html in debug mode
165         https://bugs.webkit.org/show_bug.cgi?id=131982
166
167         Reviewed by David Hyatt.
168
169         The problem was creating the Range from the arguments received at RenderView::setSelection(). Specifically
170         in this test endPos is 1 when the element has not children which creates an invalid Range.
171
172         * rendering/RenderView.cpp:
173         (WebCore::RenderView::splitSelectionBetweenSubtrees): Pass 0 as startPos and endPos to Range::create() as we are
174         not interested in the positions at this point.
175
176 2014-04-22  Brady Eidson  <beidson@apple.com>
177
178         Change Image Controls replacement to use selection and paste
179         <rdar://problem/16302722> and https://bugs.webkit.org/show_bug.cgi?id=131992
180
181         Reviewed by Tim Horton.
182
183         * WebCore.exp.in: Remove deleted symbol.
184
185         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
186         (WebCore::ImageControlsButtonElementMac::defaultEventHandler):
187
188         * page/ContextMenuController.cpp:
189         (WebCore::ContextMenuController::showImageControlsMenu): Select the image element
190           before showing the menu.
191         (WebCore::ContextMenuController::replaceControlledImage): Deleted.
192         * page/ContextMenuController.h:
193
194 2014-04-22  David Hyatt  <hyatt@apple.com>
195
196         REGRESSION: Hitting asserts in new flow thread selection code.
197         https://bugs.webkit.org/show_bug.cgi?id=132019
198
199         Reviewed by Anders Carlsson.
200
201         Null checking flowThreadController is not enough. The list of threads
202         can be null even when the flowThreadController is not. That's why you
203         use hasRenderNamedFlowThreads. I patched the two bad places in the code
204         to use hasRenderNamedFlowThreads to stop the crashes.
205         
206         * rendering/RenderView.cpp:
207         (WebCore::RenderView::selectionBounds):
208         (WebCore::RenderView::repaintSelection):
209
210 2014-04-22  Brent Fulgham  <bfulgham@apple.com>
211
212         Check (rather than assume) element is a RenderTableSection before using it
213         https://bugs.webkit.org/show_bug.cgi?id=121858
214
215         Reviewed by David Kilzer.
216
217         Test: fast/table/table-insert-object-before-td-crash.html
218
219         * rendering/RenderTable.cpp:
220         (WebCore::RenderTable::addChild): Check that lastBox is a table section before
221         using the node as if it was one.
222
223 2014-04-22  Alex Christensen  <achristensen@webkit.org>
224
225         Begin implementation of video using Media Foundation.
226         https://bugs.webkit.org/show_bug.cgi?id=131830
227
228         Reviewed by Brent Fulgham.
229
230         * WebCore.vcxproj/WebCore.vcxproj:
231         * WebCore.vcxproj/WebCore.vcxproj.filters:
232         Added MediaPlayerPrivateMediaFoundation files.
233         * platform/graphics/MediaPlayer.cpp:
234         Include MediaPlayerPrivateMediaFoundation inside new USE(MEDIA_FOUNDATION) flag.
235         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: Added.
236         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Added.
237
238 2014-04-22  Commit Queue  <commit-queue@webkit.org>
239
240         Unreviewed, rolling out r167658.
241         https://bugs.webkit.org/show_bug.cgi?id=131993
242
243         Caused many crashes on media tests (Requested by ap on
244         #webkit).
245
246         Reverted changeset:
247
248         "[Mac] don't ask for AVAssetTrack properties before they are
249         available"
250         https://bugs.webkit.org/show_bug.cgi?id=131902
251         http://trac.webkit.org/changeset/167658
252
253 2014-04-22  David Hyatt  <hyatt@apple.com>
254
255         [New Multicolumn] fast/multicol/multicol-with-child-renderLayer-for-input.html puts the textfield in the wrong place
256         https://bugs.webkit.org/show_bug.cgi?id=131808
257
258         Reviewed by Brady Eidson.
259     
260         Make sure FrameView is patched to pass in the update pagination flag when subtree layout
261         is done on textfields. It had code for the old multicolumn system but did not have a check
262         for the new multicolumn system.
263
264         Added fast/multicol/newmulticol/compare-with-old-impl/multicol-with-child-renderLayer-for-input.html
265
266         * page/FrameView.cpp:
267         (WebCore::updateLayerPositionFlags):
268
269 2014-04-22  Zalan Bujtas  <zalan@apple.com>
270
271         border-style: double rendered as solid when combined with border-radius
272         https://bugs.webkit.org/show_bug.cgi?id=131927
273
274         Reviewed by Simon Fraser.
275
276         BorderEdge::getDoubleBorderStripeWidths() should return the calculated inner, outer border widths. 
277
278         Test: fast/borders/hidpi-double-border-with-border-radius-always-produce-solid-line.html
279
280         * rendering/BorderEdge.cpp:
281         (WebCore::BorderEdge::getDoubleBorderStripeWidths):
282         * rendering/BorderEdge.h:
283
284 2014-04-22  Eric Carlson  <eric.carlson@apple.com>
285
286         [Mac] don't ask for AVAssetTrack properties before they are available
287         https://bugs.webkit.org/show_bug.cgi?id=131902
288         <rdar://problem/16505076>
289
290         Reviewed by Jer Noble.
291
292         No new tests, the behavior this changes can not be tested with a layout test.
293
294         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
295         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
296         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Initialize
297             m_cachedTotalBytes.
298         (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata): Don't report that
299             metadata has been loaded until the track properties we need have been loaded too.
300         (WebCore::MediaPlayerPrivateAVFoundationObjC::totalBytes): Cache totalBytes instead
301             of recalculating it every time.
302         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange): Invalidate cached
303             total bytes.
304         (WebCore::assetTrackMetadataKeyNames): Array of AVAssetTrack properties we use.
305
306 2014-04-22  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
307
308         Buildfix after r167650 broke non-Cocoa builds
309         https://bugs.webkit.org/show_bug.cgi?id=131980
310
311         Reviewed by Mario Sanchez Prada.
312
313         * page/EventHandler.cpp:
314         (WebCore::EventHandler::handleWheelEvent):
315
316 2014-04-22  Manuel Rego Casasnovas  <rego@igalia.com>
317
318         [CSS Regions] Selection highlight doesn't match DOM selection
319         https://bugs.webkit.org/show_bug.cgi?id=131511
320
321         Reviewed by David Hyatt.
322
323         This patch implements a subtrees approach to fix selection interaction in CSS Regions.
324
325         The idea is to divide the Render tree in subtrees. One subtree will be the RenderView (which is always present),
326         then for each RenderNamedFlowThread (which are children of RenderView) we will have an extra subtree.
327
328         For each subtree it determines the start and end positions according to the DOM tree. So, every subtree will
329         always have a start and end position, and the selection algorithm will be able to reach the end from the start
330         without problems (this allows us to remove the changes introduced in r155058).
331
332         Then selection related methods in RenderView are adapted to ensure that they are called for each subtree. Making
333         the selection highlight to match DOM selection as expected.
334
335         Test: fast/regions/selection/selecting-text-including-region.html
336
337         * CMakeLists.txt: Add new class SelectionSubtreeRoot to build file.
338         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
339         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
340         * WebCore.xcodeproj/project.pbxproj: Ditto.
341         * rendering/RenderNamedFlowThread.h: Inherit from SelectionSubtreeRoot.
342         * rendering/RenderObject.cpp:
343         (WebCore::RenderObject::selectionRoot): New method to return the RenderNamedFlowThread if any or the RenderView
344         otherwise.
345         (WebCore::RenderObject::selectionStartEnd): If it's inside a RenderNamedFlowThread use specific method instead
346         of the RenderView's one.
347         * rendering/RenderObject.h: Add new method signature.
348         * rendering/RenderView.cpp:
349         (WebCore::RenderView::selectionBounds): Adapt method to subtrees approach.
350         (WebCore::RenderView::subtreeSelectionBounds): Modify previous method in order to use SelectionSubtreeRoot
351         objects.
352         (WebCore::RenderView::repaintSelection): Adapt method to subtrees approach.
353         (WebCore::RenderView::repaintSubtreeSelection): Modify previous method in order to use SelectionSubtreeRoot
354         objects.
355         (getNextOrPrevRenderObjectBasedOnDirection): Deleted method from r155058 as it is not needed anymore. Each
356         subtree will have start and end positions, so the selection algorithm will always find the end.
357         (WebCore::RenderView::setSelection): Adapt method to subtrees approach.
358         (WebCore::RenderView::splitSelectionBetweenSubtrees): Determine start and end positions for each subtree and
359         call setSubtreeSelection().
360         (WebCore::RenderView::setSubtreeSelection): Modify previous method in order to use SelectionSubtreeRoot objects.
361         * rendering/RenderView.h: Inherit from SelectionSubtreeRoot. Add signature for new helper methods receiving
362         SelectionSubtreeRoot objects.
363         * rendering/SelectionSubtreeRoot.cpp: Added.
364         (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot):
365         (WebCore::SelectionSubtreeRoot::selectionStartEndPositions):
366         * rendering/SelectionSubtreeRoot.h: Added. New class to identify root elements for the subtrees. With some basic
367         attributes and methods to store the start and end positions and offsets.
368         (WebCore::SelectionSubtreeRoot::selectionStart):
369         (WebCore::SelectionSubtreeRoot::selectionStartPos):
370         (WebCore::SelectionSubtreeRoot::selectionEnd):
371         (WebCore::SelectionSubtreeRoot::selectionEndPos):
372         (WebCore::SelectionSubtreeRoot::setSelectionStart):
373         (WebCore::SelectionSubtreeRoot::setSelectionStartPos):
374         (WebCore::SelectionSubtreeRoot::setSelectionEnd):
375         (WebCore::SelectionSubtreeRoot::setSelectionEndPos):
376
377 2014-04-21  Brent Fulgham  <bfulgham@apple.com>
378
379         [Mac] Follow-up: After a horizontal overflow scroll with a mechanical wheel mouse, vertical scrolling no longer works
380         https://bugs.webkit.org/show_bug.cgi?id=131960
381         <rdar://problem/16142100>
382
383         Unreviewed build fix.
384
385         * page/EventHandler.cpp:
386         (WebCore::EventHandler::handleWheelEvent): The test to clear the
387         last scrolled node was too broad. It should only follow this path
388         if both the phase and momentum phase are 'None'.
389
390 2014-04-21  Brent Fulgham  <bfulgham@apple.com>
391
392         [Mac] After a horizontal overflow scroll with a mechanical wheel mouse, vertical scrolling no longer works
393         https://bugs.webkit.org/show_bug.cgi?id=131960
394         <rdar://problem/16142100>
395
396         Reviewed by Darin Adler.
397
398         Test: platform/mac/fast/scrolling/scroll-div-no-latching.html
399
400         * page/EventHandler.cpp:
401         (WebCore::EventHandler::handleWheelEvent): When not latching, always clear m_latchedWheelEventElement and m_previousWheelScrolledElement.
402
403 2014-04-21  Joseph Pecoraro  <pecoraro@apple.com>
404
405         WebProfilerAgent::disable is calling the wrong superclass method
406         https://bugs.webkit.org/show_bug.cgi?id=131968
407
408         Reviewed by Simon Fraser.
409
410         * inspector/WebProfilerAgent.cpp:
411         (WebCore::WebProfilerAgent::disable):
412
413 2014-04-21  Enrica Casucci  <enrica@apple.com>
414
415         Followup from http://trac.webkit.org/changeset/167624
416
417         Reviewed by Darin Adler.
418
419         Fixing incorrect use of ? : syntax.
420
421         * editing/VisibleUnits.cpp:
422         (WebCore::characterBeforePosition):
423
424 2014-04-21  Ryuan Choi  <ryuan.choi@samsung.com>
425
426         Move CoordinatedGraphics related codes out of CMakeLists.txt
427         https://bugs.webkit.org/show_bug.cgi?id=131931
428
429         Reviewed by Gyuyoung Kim.
430
431         Move CoordinatedGraphics related files to PlatformEfl.cmake because they are not common files.
432
433         * CMakeLists.txt: 
434         * PlatformEfl.cmake:
435
436 2014-04-21  Jer Noble  <jer.noble@apple.com>
437
438         [MSE][Mac] AVSampleBufferDisplayLayer and AudioRenderer is overretained.
439         https://bugs.webkit.org/show_bug.cgi?id=131963
440
441         Reviewed by Jon Honeycutt.
442
443         Adopt the results of -[[class alloc] init] rather than retaining them.
444
445         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
446         (WebCore::SourceBufferPrivateAVFObjC::hasVideo):
447         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
448
449 2014-04-21  Zalan Bujtas  <zalan@apple.com>
450
451         REGRESSION (r166784): Gradient at background of iCloud login page doesn’t go all the way to the bottom
452         https://bugs.webkit.org/show_bug.cgi?id=131924
453
454         Computing tile dimension for contain/cover requires higher precision than what LayoutUnit has. Switching to floats.
455
456         Reviewed by Simon Fraser.
457
458         Test: fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision.html
459
460         * rendering/RenderBoxModelObject.cpp:
461         (WebCore::RenderBoxModelObject::calculateFillTileSize):
462
463 2014-04-21  Dean Jackson  <dino@apple.com>
464
465         Build fix for Mountain Lion.
466
467         * platform/mac/SerializedPlatformRepresentationMac.mm:
468         (WebCore::SerializedPlatformRepresentationMac::deserialize):
469
470 2014-04-21  Dan Bernstein  <mitz@apple.com>
471
472         WebCore part of <rdar://problem/16631323> Page::setDefersLoading doesn’t do anything when using the Network process
473         https://bugs.webkit.org/show_bug.cgi?id=131939
474
475         Reviewed by David Kilzer.
476
477         * WebCore.exp.in: Exported WebCore::ResourceHandle::setDefersLoading.
478
479         * loader/ResourceLoadScheduler.cpp:
480         (WebCore::ResourceLoadScheduler::setDefersLoading): Added a no-op implementation.
481         * loader/ResourceLoadScheduler.h: Declared new virtual member function setDefersLoading.
482
483         * loader/ResourceLoader.cpp:
484         (WebCore::ResourceLoader::setDefersLoading): Added a call to the above function.
485
486 2014-04-21  Brent Fulgham  <bfulgham@apple.com>
487
488         [Mac] Difficulty gesture scrolling vertically with trackpad after scrolling horizontally 
489         https://bugs.webkit.org/show_bug.cgi?id=131959
490         <rdar://problem/16654523>
491
492         Reviewed by Simon Fraser.
493
494         * page/mac/EventHandlerMac.mm:
495         (WebCore::deltaIsPredominantlyVertical): Added.
496         (WebCore::scrolledToEdgeInDominantDirection): Only consider current mouse wheel event. We don't care about
497         overall history when deciding if we are bumping against the edge of a scrollable region. Short-circuit if
498         the element style indicates that overflow is hidden, since this means there is no scroll possible in that
499         direction.
500         (WebCore::EventHandler::platformPrepareForWheelEvents): Update for new signature.
501
502 2014-04-21  Eric Carlson  <eric.carlson@apple.com>
503
504         [Mac] implement WebKitDataCue
505         https://bugs.webkit.org/show_bug.cgi?id=131799
506
507         Reviewed by Dean Jackson.
508
509         Tests: http/tests/media/track-in-band-hls-metadata.html
510                media/track/track-datacue-value.html
511
512         * Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.
513         * DerivedSources.make: Add ENABLE_DATACUE_VALUE to HTML_FLAGS when appropriate.
514
515         * CMakeLists.txt: Add JSDataCueCustom.cpp.
516         * bindings/js/JSBindingsAllInOne.cpp:
517         * WebCore.xcodeproj/project.pbxproj: Add new files.
518
519         * bindings/js/JSDataCueCustom.cpp: Added.
520         (WebCore::JSDataCue::value): 
521         (WebCore::JSDataCue::setValue):
522         (WebCore::JSDataCueConstructor::constructJSDataCue): Custom constructor.
523
524         * html/HTMLMediaElement.cpp:
525         (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Drive-by fixes: don't schedule timeupdate
526             events when paused, don't call sort on an Vector that can't be sorted.
527
528         * html/track/DataCue.cpp:
529         (WebCore::DataCue::DataCue): Initialize m_type.
530         (WebCore::DataCue::~DataCue): Unprotect the JSValue if necessary.
531         (WebCore::DataCue::data): Ask the platform value for data if non-null.
532         (WebCore::DataCue::setData): Clear m_platformValue and m_value.
533         (WebCore::DataCue::isEqual): New.
534         (WebCore::DataCue::value): Return a JSValue from the platform value, or the value passed
535             to the constructor/set by script.
536         (WebCore::DataCue::setValue): Set m_value.
537         * html/track/DataCue.h:
538         * html/track/DataCue.idl:
539
540         * html/track/InbandDataTextTrack.cpp:
541         (WebCore::InbandDataTextTrack::addDataCue): Don't add the same cue more than once.
542         (WebCore::InbandDataTextTrack::updateDataCue): Update a cue's duration.
543         (WebCore::InbandDataTextTrack::removeDataCue): Remove an incomplete cue.
544         (WebCore::InbandDataTextTrack::removeCue): Remove a cue from the incomplete cue map if necessary.
545         * html/track/InbandDataTextTrack.h:
546
547         * html/track/InbandGenericTextTrack.cpp:
548         (WebCore::InbandGenericTextTrack::addGenericCue): CueMatchRules is now in TextTrackCue instead
549             of VTTCue.
550         * html/track/InbandTextTrack.h:
551
552         * html/track/InbandWebVTTTextTrack.cpp:
553         (WebCore::InbandWebVTTTextTrack::newCuesParsed): Ditto.
554
555         * html/track/TextTrack.cpp:
556         (WebCore::TextTrack::hasCue): Ditto.
557         * html/track/TextTrack.h:
558
559         * html/track/TextTrackCue.cpp:
560         (WebCore::TextTrackCue::isEqual): New, test base class equality.
561         * html/track/TextTrackCue.h:
562
563         * html/track/TextTrackCueGeneric.cpp:
564         (WebCore::TextTrackCueGeneric::isEqual): Call TextTrackCue::isEqual first.
565         * html/track/TextTrackCueGeneric.h:
566
567         * html/track/VTTCue.cpp:
568         (WebCore::VTTCue::isEqual): Call TextTrackCue::isEqual first.
569         * html/track/VTTCue.h:
570
571         * platform/SerializedPlatformRepresentation.h: Added.
572         (WebCore::SerializedPlatformRepresentation::~SerializedPlatformRepresentation):
573         (WebCore::SerializedPlatformRepresentation::SerializedPlatformRepresentation):
574
575         * platform/graphics/InbandTextTrackPrivateClient.h: Add methods for DataCue with SerializedPlatformRepresentation.
576
577         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: Added.
578         (WebCore::InbandMetadataTextTrackPrivateAVF::create):
579         (WebCore::InbandMetadataTextTrackPrivateAVF::InbandMetadataTextTrackPrivateAVF):
580         (WebCore::InbandMetadataTextTrackPrivateAVF::~InbandMetadataTextTrackPrivateAVF):
581         (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
582         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
583         (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
584         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: Added.
585
586         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
587         (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): currentTrack -> currentTextTrack.
588         (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted): Ditto.
589         (WebCore::MediaPlayerPrivateAVFoundation::configureInbandTracks): Ditto.
590         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
591         (WebCore::MediaPlayerPrivateAVFoundation::setCurrentTextTrack):
592         (WebCore::MediaPlayerPrivateAVFoundation::setCurrentTrack): Deleted.
593
594         Renamed currentTrack and setCurrentTrack to currentTextTrack and setCurrentTextTrack.
595         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
596         (WebCore::AVFWrapper::currentTextTrack):
597         (WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTextTrack):
598         (WebCore::MediaPlayerPrivateAVFoundationCF::currentTextTrack):
599         (WebCore::AVFWrapper::setCurrentTextTrack):
600         (WebCore::AVFWrapper::AVFWrapper):
601         (WebCore::AVFWrapper::processCue):
602         (WebCore::AVFWrapper::currentTrack): Deleted.
603         (WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTrack): Deleted.
604         (WebCore::MediaPlayerPrivateAVFoundationCF::currentTrack): Deleted.
605         (WebCore::AVFWrapper::setCurrentTrack): Deleted.
606         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
607
608         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
609         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
610         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
611         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): currentTrack -> currentTextTrack
612         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): currentTrack -> currentTextTrack.
613         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack): New.
614         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): m_currentTrack -> m_currentTextTrack.
615         (WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues): Ditto.
616         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack): Renamed from setCurrentTextTrack.
617         (WebCore::metadataType): Map an AVFoundation metadata key space to a metadata cue type.
618         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): Process new metadata.
619         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
620         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTrack): Deleted.
621
622         Create a JSValue representation from an AVMetadataItem.
623         * platform/mac/SerializedPlatformRepresentationMac.h: Added.
624         (WebCore::SerializedPlatformRepresentationMac::platformType):
625         (WebCore::SerializedPlatformRepresentationMac::nativeValue):
626         * platform/mac/SerializedPlatformRepresentationMac.mm: Added.
627         (WebCore::SerializedPlatformRepresentationMac::SerializedPlatformRepresentationMac):
628         (WebCore::SerializedPlatformRepresentationMac::~SerializedPlatformRepresentationMac):
629         (WebCore::SerializedPlatformRepresentationMac::create):
630         (WebCore::SerializedPlatformRepresentationMac::data):
631         (WebCore::SerializedPlatformRepresentationMac::deserialize):
632         (WebCore::SerializedPlatformRepresentationMac::isEqual):
633         (WebCore::toSerializedPlatformRepresentationMac):
634         (WebCore::jsValueWithValueInContext):
635         (WebCore::jsValueWithDataInContext):
636         (WebCore::jsValueWithArrayInContext):
637         (WebCore::jsValueWithDictionaryInContext):
638         (WebCore::jsValueWithAVMetadataItemInContext):
639
640 2014-04-21  Benjamin Poulain  <benjamin@webkit.org>
641
642         Add Element.matches, the standard name for webkitMatchesSelector
643         https://bugs.webkit.org/show_bug.cgi?id=131922
644
645         Reviewed by Andreas Kling.
646
647         This patch just renames webkitMatchesSelector() to matches().
648
649         * bindings/scripts/CodeGeneratorObjC.pm:
650         (GenerateImplementation):
651         The Objective-C binding generator only supported ImplementedAs for getters and setters.
652         This adds support for the option so that Element.matches can be generated for Obj-C.
653
654         * dom/Element.cpp:
655         (WebCore::Element::matches):
656         (WebCore::Element::webkitMatchesSelector): Deleted.
657         * dom/Element.h:
658         * dom/Element.idl:
659         * inspector/InspectorCSSAgent.cpp:
660         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
661
662 2014-04-21  Beth Dakin  <bdakin@apple.com>
663
664         topContentInset does not play well with fullscreen elements
665         https://bugs.webkit.org/show_bug.cgi?id=131955
666         -and corresponding-
667         <rdar://problem/16651925>
668
669         Reviewed by Sam Weinig.
670
671         Calling setNeedsLayout() is not sufficient when the topContentInset has changed 
672         dynamically. We need to perform the layout right away and update the scrollbars. 
673         This works completely when the inset changes due to entering/exiting fullscreen, 
674         but I left a FIXME behind because it is possible to change the inset dynamically 
675         just through the WK2 API and end up in a situation where everything looks right 
676         except for the scrollbars. 
677         * page/FrameView.cpp:
678         (WebCore::FrameView::topContentInsetDidChange):
679         * page/FrameView.h:
680         * page/Page.cpp:
681         (WebCore::Page::setTopContentInset):
682
683 2014-04-18  Jon Honeycutt  <jhoneycutt@apple.com>
684
685         Empty RenderInline objects should not be line break objects.
686
687         https://bugs.webkit.org/show_bug.cgi?id=131861
688         <rdar://problem/15663617>
689
690         Reviewed by David Hyatt.
691
692         * rendering/line/BreakingContextInlineHeaders.h:
693         (WebCore::BreakingContext::canBreakAtThisPosition):
694         Don't break at this position if this is an empty RenderInline.
695
696 2014-04-21  Enrica Casucci  <enrica@apple.com>
697
698         [iOS WebKit2] support replacements for misspelled words.
699         https://bugs.webkit.org/show_bug.cgi?id=131827
700         <rdar://problem/16319657>
701
702         Reviewed by Darin Adler.
703
704         Adds utility function to return the character before the current selection
705         and converts the nbsp to the space character.
706
707         * WebCore.exp.in:
708         * editing/VisibleUnits.cpp:
709         (WebCore::characterBeforePosition):
710         * editing/VisibleUnits.h:
711
712 2014-04-21  Eric Carlson  <eric.carlson@apple.com>
713
714         [iOS] enable plug-in replacement
715         https://bugs.webkit.org/show_bug.cgi?id=131947
716
717         Reviewed by Jer Noble.
718
719         * bindings/generic/RuntimeEnabledFeatures.cpp:
720         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): initialize m_isPluginReplacementEnabled
721             to true on iOS.
722
723 2014-04-21  Rik Cabanier  <cabanier@adobe.com>
724
725         [CSS Blending] Remove support for non-separable blend modes from mix-blend-mode
726         https://bugs.webkit.org/show_bug.cgi?id=131824
727
728         Reviewed by Dean Jackson.
729
730         Removed support for non-separable blend modes from the CSS parser.
731
732         Covered by existing tests
733
734         * css/CSSParser.cpp:
735         (WebCore::isValidKeywordPropertyAndValue):
736         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
737         (PlatformCAFilters::setBlendingFiltersOnLayer):
738
739 2014-04-21  David Hyatt  <hyatt@apple.com>
740
741         [New Multicolumn] Column set drawing under horizontal scrollbar.
742         https://bugs.webkit.org/show_bug.cgi?id=131812.
743
744         Reviewed by Sam Weinig.
745
746         Added fast/multicol/newmulticol/compare-with-old-impl/LeftToRight-tb.html.
747
748         * rendering/RenderBlockFlow.cpp:
749         (WebCore::RenderBlockFlow::layoutBlock):
750         (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
751         * rendering/RenderBlockFlow.h:
752         Pass in relayoutChildren as a reference boolean to checkForPaginationLogicalHeightChange.
753         The new columns need to be able to set it to true if the amount of available column
754         height ever changes, so that the RenderFlowThread and the sets get a layout call.
755
756         * rendering/style/RenderStyle.cpp:
757         (WebCore::RenderStyle::setColumnStylesFromPaginationMode):
758         Make sure that the pagination mode is set up with an auto column-fill specified. You
759         don't ever want to balance when you set a pagination mode on the RenderView.
760
761 2014-04-21  Tim Horton  <timothy_horton@apple.com>
762
763         [iOS WebKit2] Implement CSS viewport units
764         https://bugs.webkit.org/show_bug.cgi?id=131863
765         <rdar://problem/16279088>
766
767         Reviewed by Darin Adler.
768
769         * WebCore.exp.in:
770         * page/FrameView.cpp:
771         (WebCore::FrameView::setViewportSize):
772         * page/FrameView.h:
773         (WebCore::FrameView::viewportSize):
774         Add setViewportSize() and viewportSize().
775         If the viewport size changes, we have to do style recalc.
776         If we have an overridden viewport size, use it.
777
778         * rendering/RenderView.cpp:
779         (WebCore::RenderView::viewportSize):
780         * rendering/RenderView.h:
781         Get the size from FrameView.
782
783 2014-04-21  Joseph Pecoraro  <pecoraro@apple.com>
784
785         Remove unused WebKitSystemInterface functions
786         https://bugs.webkit.org/show_bug.cgi?id=131938
787
788         Reviewed by Alexey Proskuryakov.
789
790         * WebCore.exp.in:
791         * platform/ios/WebCoreSystemInterfaceIOS.mm:
792         * platform/mac/WebCoreSystemInterface.h:
793         * platform/mac/WebCoreSystemInterface.mm:
794
795 2014-04-21  Andreas Kling  <akling@apple.com>
796
797         Move the JSString cache from DOMWrapperWorld to VM.
798         <https://webkit.org/b/131940>
799
800         Since there's no need for JSStrings to be world-specific, this patch
801         moves the string cache to JSC::VM. This makes jsStringWithCache()
802         a lot faster since it no longer has to jump through twenty-eleven
803         hoops to find the DOMWrapperWorld.
804
805         Reviewed by Geoff Garen.
806
807         * bindings/js/DOMWrapperWorld.cpp:
808         (WebCore::DOMWrapperWorld::clearWrappers):
809         * bindings/js/DOMWrapperWorld.h:
810         * bindings/js/JSDOMBinding.cpp:
811         (WebCore::jsStringWithCache):
812
813 2014-04-21  David Hyatt  <hyatt@apple.com>
814
815         [New Multicolumn] Column balancing is slow on float-multicol.html
816         https://bugs.webkit.org/show_bug.cgi?id=131801
817
818         Reviewed by Enrica Casucci.
819
820         Added fast/multicol/tall-float.html
821
822         * rendering/RenderBlock.cpp:
823         (WebCore::RenderBlock::expandsToEncloseOverhangingFloats):
824         Make RenderFlowThreads expand to encompass floats. Also from Morten's patch for
825         Blink (#361551).
826
827         * rendering/RenderBlockFlow.cpp:
828         (WebCore::RenderBlockFlow::computeOverflow):
829         Fix a bug where the new multi-column code was adding in overflow for floats
830         when it should not. This was resulting in the creation of scrollbars when none
831         should exist. This is my own addition.
832
833         (WebCore::RenderBlockFlow::addOverhangingFloats):
834         Make RenderFlowThreads and RenderRegions ignore overhanging float additions. This
835         comes from Morten's patch for Blink (#361551).
836
837 2014-04-21  Darin Adler  <darin@apple.com>
838
839         REGRESSION (r160908): Safari doesn't draw rotated images properly first time
840         https://bugs.webkit.org/show_bug.cgi?id=131930
841
842         Reviewed by Anders Carlsson.
843
844         With render tree creation sufficiently lazy, we had to put some explicit
845         calls to updateStyleIfNeeded into the ImageDocument class.
846
847         * dom/DOMImplementation.cpp:
848         (WebCore::DOMImplementation::createDocument): Pass a Frame&.
849
850         * html/ImageDocument.cpp:
851         (WebCore::ImageDocument::imageSize): Added this helper function. This updates
852         style so we can use the renderer to compute an image size taking things like
853         orientation into account, and also passes in the zoom factor.
854         (WebCore::ImageDocument::updateDuringParsing): Moved the body of the
855         ImageDocumentParser::appendBytes function into this function. Since it's a
856         member of ImageDocument, it has better access to appropriate private members,
857         and we don't have to expose as many functions to the public. Also changed to
858         not use the frame so much. Also merged in the code that creates the document
859         instead of having it be a side effect in the cachedImage helper function; all
860         the other call sites were checking for null before calling cachedImage.
861         (WebCore::ImageDocument::finishedParsing): Moved the body of the
862         ImageDocumentParser::finish function here. Added a call to updateStyleIfNeeded
863         before using the renderer to get the image size.
864         (WebCore::ImageDocumentParser::document): Made this return a reference. It's
865         just a convenience function used in the two functions below.
866         (WebCore::ImageDocumentParser::appendBytes): Just call updateDuringParsing.
867         (WebCore::ImageDocumentParser::finish): Just call finishedParsing.
868         (WebCore::ImageDocument::ImageDocument): Take a reference for the argument,
869         use nullptr, and also initialize m_shouldShrinkImage directly instead of using
870         a shouldShrinkToFit() helper function to do it.
871         (WebCore::ImageDocument::createDocumentStructure): Removed unneeded check of
872         null for the frame, since the caller does it. Removed some unneeded
873         IGNORE_EXCEPTON and a stray semicolon. Use m_shouldShrinkImage instead of
874         calling shouldShrinkToFit since at this early point they will be identical.
875         (WebCore::ImageDocument::scale): Make non-const so we can call the new
876         imageSize helper. Use Document::view instead of Frame::view. Improved the
877         conversion to floating point so it doesn't involve a static_cast and an extra
878         conversion from int to LayoutUnit.
879         (WebCore::ImageDocument::resizeImageToFit): Ditto.
880         (WebCore::ImageDocument::imageClicked): Ditto.
881         (WebCore::ImageDocument::imageUpdated): Ditto. Also use m_shouldShrinkImage
882         ibnstead of shouldShrinkToFit.
883         (WebCore::ImageDocument::restoreImageSize): Ditto.
884         (WebCore::ImageDocument::imageFitsInWindow): Ditto.
885         (WebCore::ImageDocument::windowSizeChanged): Ditto.
886         (WebCore::ImageDocument::cachedImage): Deleted. Moved logic into updateDuringParsing.
887         (WebCore::ImageDocument::shouldShrinkToFit): Deleted. Moved logic into constructor.
888         (WebCore::ImageEventListener::handleEvent): Updated for changes above.
889         (WebCore::ImageEventListener::operator==): Simplified. No reason this has to check
890         whether both listeners are in the same document.
891         (WebCore::ImageDocumentElement::didMoveToNewDocument): Use nullptr.
892
893         * html/ImageDocument.h: Deleted some unused things, updated for changes above,
894         and made some memer functions private.
895
896         * loader/FrameLoaderClient.h: Deleted the allowScriptFromSource, allowPlugins,
897         allowImage, and allowDisplayingInsecureContent functions. These were only used in
898         Chromium and are now unneeded complexity. We could bring them back if anyone wants them.
899
900         * loader/MixedContentChecker.cpp:
901         (WebCore::MixedContentChecker::canDisplayInsecureContent): Removed call to
902         allowDisplayingInsecureContent, just use the setting directly.
903         (WebCore::MixedContentChecker::canRunInsecureContent): Removed call to
904         allowRunningInsecureContent, just use the setting directly.
905
906         * loader/SubframeLoader.cpp:
907         (WebCore::SubframeLoader::allowPlugins): Removed call to allowPlugins, just
908         use the arePluginsEnabled setting directly.
909
910         * loader/cache/CachedResourceLoader.cpp:
911         (WebCore::CachedResourceLoader::canRequest): Removed call to allowScriptFromSource, just
912         use the isScriptEnabled setting directly.
913         (WebCore::CachedResourceLoader::clientDefersImage): Removed call to allowImage.
914
915 2014-04-21  David Hyatt  <hyatt@apple.com>
916
917         [New Multicolumn] Pagination mode messed up with non-inline axis and reversed direction.
918         https://bugs.webkit.org/show_bug.cgi?id=131811
919
920         Reviewed by Dean Jackson.
921
922         Added fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb.html
923         
924         With block axis pagination mode, it is possible to set a column height that is not the same
925         as the available fill height for a block. The new multi-column code had the assumption that
926         the column height was the same as the amount of fill room you had available. This is not
927         the case.
928         
929         To correct the issue, I added a member variable to RenderMultiColumnSet that stores the
930         available column height as a separate variable from the computed column height. This allows
931         the pagination API to specify a different column height that is not the same as the view's
932         content height.
933
934         Even though it isn't involved in the solution, I also patched pageOrViewLogicalHeight on
935         RenderView to work with the new column code as well.
936
937         To address the layout test failures (that caused the previous rollout), I made sure to
938         initialize m_availableHeight to 0 when m_computedColumnHeight also gets reset to 0.
939         
940         The assertion is not something I could reproduce on any machine, but I can see the problem.
941         I patched Page's pageCount method to not have column code directly in Page.cpp, 
942         and to make a new pageCount() method on RenderView that Page calls
943         into. This method is now patched to handle the new column code as well as the old. I have
944         no real way of testing this method though, since I can't reproduce the assertion that the
945         bots were experiencing.
946
947         * page/Page.cpp:
948         (WebCore::Page::pageCount):
949         * rendering/RenderMultiColumnSet.cpp:
950         (WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
951         (WebCore::RenderMultiColumnSet::setAndConstrainColumnHeight):
952         (WebCore::RenderMultiColumnSet::prepareForLayout):
953         (WebCore::RenderMultiColumnSet::computeLogicalHeight):
954         * rendering/RenderMultiColumnSet.h:
955         * rendering/RenderView.cpp:
956         (WebCore::RenderView::pageOrViewLogicalHeight):
957         (WebCore::RenderView::pageCount):
958         * rendering/RenderView.h:
959
960 2014-04-18  Dean Jackson  <dino@apple.com>
961
962         [Media] Clean up localized strings in controls
963         https://bugs.webkit.org/show_bug.cgi?id=131857
964         <rdar://problem/16663005>
965
966         Reviewed by Eric Carlson.
967
968         There is no need for separate localization files
969         on OS X and iOS. Move the small number of iOS-specific
970         localizations into a shared file.
971
972         We also don't need a function to return a static table.
973         Ultimately I think we want a top-level WebKit object that
974         hold the table, but for now use a global variable
975         called UIStringTable. Since we're in an isolated world, we
976         won't clash with anything.
977
978         I noticed a few cases were we grab a localized string and
979         then instantly run a replacement on it. This should be
980         supported directly in the UIString() accessor.
981
982         * English.lproj/mediaControlsLocalizedStrings.js: Add iOS strings. Just
983         use a static table.
984         (mediaControlsLocalizedStrings): Deleted.
985         * English.lproj/mediaControlsLocalizedStringsiOS.js: Removed.
986         * Modules/mediacontrols/mediaControlsApple.js:
987         (Controller.prototype.extend): Fix braces.
988         (Controller.prototype.UIString): Use the string table, and allow replacement.
989         (Controller.prototype.createControls): Use new UIString replacement.
990         * Modules/mediacontrols/mediaControlsiOS.js:
991         (ControllerIOS.prototype.updateWirelessPlaybackStatus): Use new UIString.
992         (ControllerIOS.prototype.UIString): Deleted. Use the parent class version.
993         * WebCore.xcodeproj/project.pbxproj: Remove file from Resources.
994         * rendering/RenderThemeIOS.mm:
995         (WebCore::RenderThemeIOS::mediaControlsScript): No need to include the iOS
996         specific localization file.
997
998 2014-04-21  Brent Fulgham  <bfulgham@apple.com>
999
1000         [Win] Unreviewed build fix.
1001
1002         * inspector/TimelineRecordFactory.cpp: Add missing include.
1003
1004 2014-04-21  Zan Dobersek  <zdobersek@igalia.com>
1005
1006         Move cross-port Source/WebCore/page/ code to std::unique_ptr
1007         https://bugs.webkit.org/show_bug.cgi?id=130534
1008
1009         Reviewed by Darin Adler.
1010
1011         Replace uses of OwnPtr and PassOwnPtr in cross-port code under Source/WebCore/page/ with
1012         std::unique_ptr. Unnecessary OwnPtr.h and PassOwnPtr.h header inclusions are removed as well.
1013
1014         * dom/Document.cpp:
1015         (WebCore::Document::initSecurityContext):
1016         * dom/SecurityContext.cpp:
1017         (WebCore::SecurityContext::setContentSecurityPolicy):
1018         * dom/SecurityContext.h:
1019         * page/CaptionUserPreferences.h:
1020         * page/ContentSecurityPolicy.cpp:
1021         (WebCore::CSPDirectiveList::create):
1022         (WebCore::CSPDirectiveList::checkEvalAndReportViolation):
1023         (WebCore::CSPDirectiveList::checkInlineAndReportViolation):
1024         (WebCore::CSPDirectiveList::checkSourceAndReportViolation):
1025         (WebCore::CSPDirectiveList::setCSPDirective):
1026         (WebCore::ContentSecurityPolicy::didReceiveHeader):
1027         * page/ContentSecurityPolicy.h:
1028         * page/DOMSecurityPolicy.h:
1029         * page/DOMWindow.cpp:
1030         (WebCore::PostMessageTimer::fired):
1031         (WebCore::DOMWindow::postMessageTimerFired):
1032         * page/DOMWindow.h:
1033         * page/EventHandler.cpp:
1034         (WebCore::EventHandler::EventHandler):
1035         * page/EventHandler.h:
1036         * page/Frame.cpp:
1037         (WebCore::Frame::Frame):
1038         (WebCore::createRegExpForLabels):
1039         (WebCore::Frame::searchForLabelsAboveCell):
1040         (WebCore::Frame::searchForLabelsBeforeElement):
1041         (WebCore::matchLabelsAgainstString):
1042         (WebCore::Frame::setTiledBackingStoreEnabled):
1043         * page/Frame.h:
1044         * page/FrameView.cpp:
1045         (WebCore::FrameView::addEmbeddedObjectToUpdate):
1046         (WebCore::FrameView::addSlowRepaintObject):
1047         (WebCore::FrameView::addViewportConstrainedObject):
1048         (WebCore::FrameView::addScrollableArea):
1049         * page/FrameView.h:
1050         * page/Page.cpp:
1051         (WebCore::Page::Page):
1052         * page/Page.h:
1053         * page/PageConsole.h:
1054         * page/PageThrottler.h:
1055         * page/SecurityPolicy.cpp:
1056         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
1057         * page/animation/AnimationController.h:
1058         * page/animation/CSSPropertyAnimation.cpp:
1059         (WebCore::PropertyWrapperVisitedAffectedColor::PropertyWrapperVisitedAffectedColor):
1060         (WebCore::CSSPropertyAnimationWrapperMap::instance):
1061         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1062         * page/mac/PageMac.cpp:
1063         (WebCore::Page::addSchedulePair):
1064         * workers/WorkerGlobalScope.cpp:
1065         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyFromString):
1066
1067 2014-04-21  Darin Adler  <darin@apple.com>
1068
1069         Add HashSet::takeAny
1070         https://bugs.webkit.org/show_bug.cgi?id=131928
1071
1072         Reviewed by Benjamin Poulain.
1073
1074         * dom/Document.cpp:
1075         (WebCore::Document::takeAnyMediaCanStartListener): Use HashSet::takeAny.
1076         * dom/ScriptExecutionContext.cpp:
1077         (WebCore::takeAny): Deleted.
1078         (WebCore::ScriptExecutionContext::~ScriptExecutionContext): Use HashSet::takeAny.
1079
1080 2014-04-21  Zan Dobersek  <zdobersek@igalia.com>
1081
1082         iOS and non-iOS RemoteCommandListener::create() functions should use std::make_unique<>()
1083         https://bugs.webkit.org/show_bug.cgi?id=131916
1084
1085         Reviewed by Darin Adler.
1086
1087         A follow-up to r167197. Make RemoteCommandListener ctor public and use std::make_unique<>()
1088         in both versions of RemoteCommandListener::create() functions (iOS and non-iOS).
1089
1090         * platform/RemoteCommandListener.cpp:
1091         (WebCore::RemoteCommandListener::create):
1092         * platform/RemoteCommandListener.h:
1093         (WebCore::RemoteCommandListener::RemoteCommandListener):
1094         * platform/ios/RemoteCommandListenerIOS.mm:
1095         (WebCore::RemoteCommandListener::create):
1096
1097 2014-04-21  Andreas Kling  <akling@apple.com>
1098
1099         Micro-optimize the way we hand NodeLists to JSC.
1100         <https://webkit.org/b/131932>
1101
1102         Use HashMap::fastAdd() when returning cached node lists and collections.
1103         10.9% progression on Bindings/get-elements-by-tag-name.html
1104
1105         Reviewed by Antti Koivisto.
1106
1107         * dom/NodeRareData.h:
1108         (WebCore::NodeListsNodeData::addCacheWithAtomicName):
1109         (WebCore::NodeListsNodeData::addCacheWithName):
1110         (WebCore::NodeListsNodeData::addCacheWithQualifiedName):
1111         (WebCore::NodeListsNodeData::addCachedCollection):
1112
1113 2014-04-21  Commit Queue  <commit-queue@webkit.org>
1114
1115         Unreviewed, rolling out r167584.
1116         https://bugs.webkit.org/show_bug.cgi?id=131929
1117
1118         Broke Objective-C bindings test (Requested by ap on #webkit).
1119
1120         Reverted changeset:
1121
1122         "Add Element.matches, the standard name for
1123         webkitMatchesSelector"
1124         https://bugs.webkit.org/show_bug.cgi?id=131922
1125         http://trac.webkit.org/changeset/167584
1126
1127 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
1128
1129         Compile the :root pseudo class and fix a related issue with :nth-child()
1130         https://bugs.webkit.org/show_bug.cgi?id=131926
1131
1132         Reviewed by Andreas Kling.
1133
1134         Add the :root pseudo class. This is another trivial selector, we just need to compare
1135         the element pointer with the documentElement.
1136
1137         I discovered some issues with :nth-child(n) through the layout tests for ":root".
1138         When the pseudo class nth-child could match anything, no code was generated. That decision
1139         was taken when generating the fragments.
1140
1141         The specification of :nth-child() has two tests: the parent test and the counter test.
1142         Since some fragments would not generate any code for :nth-child(n), they would succeed on the root,
1143         which is incorrect since the root should fail the parent test.
1144
1145         This was fixed by moving the filtering of non-counting :nth-child() after we generate the parent
1146         check.
1147         We still don't generate any counter test unless required.
1148
1149         Test: fast/selectors/nth-child-on-root.html
1150
1151         * cssjit/SelectorCompiler.cpp:
1152         (WebCore::SelectorCompiler::addPseudoClassType):
1153         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
1154         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
1155         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsRoot):
1156         * dom/Document.h:
1157         (WebCore::Document::documentElementMemoryOffset):
1158
1159 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
1160
1161         Add Element.matches, the standard name for webkitMatchesSelector
1162         https://bugs.webkit.org/show_bug.cgi?id=131922
1163
1164         Reviewed by Andreas Kling.
1165
1166         This patch just renames webkitMatchesSelector() to matches().
1167
1168         * bindings/scripts/CodeGeneratorObjC.pm:
1169         (GenerateImplementation):
1170         The Objective-C binding generator only supported ImplementedAs for getters and setters.
1171         This adds support for the option so that Element.matches can be generated for Obj-C.
1172
1173         * dom/Element.cpp:
1174         (WebCore::Element::matches):
1175         (WebCore::Element::webkitMatchesSelector): Deleted.
1176         * dom/Element.h:
1177         * dom/Element.idl:
1178         * inspector/InspectorCSSAgent.cpp:
1179         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
1180
1181 2014-04-20  Zalan Bujtas  <zalan@apple.com>
1182
1183         Subpixel rendering: RenderLayer's size is set using enclosingRect() which can result in cruft.
1184         https://bugs.webkit.org/show_bug.cgi?id=131468
1185
1186         Reviewed by Darin Adler.
1187
1188         Layers marked opaque may not paint edge pixels, when RenderLayer bounds are non-integral and
1189         get device pixel snapped.
1190         For details see this: https://trac.webkit.org/r159463
1191
1192         Test: compositing/hidpi-non-simple-compositing-layer-with-fractional-size-and-background.html
1193
1194         * rendering/RenderLayerBacking.cpp:
1195         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
1196
1197 2014-04-19  Darin Adler  <darin@apple.com>
1198
1199         Simple layout can get confused by coordinate overflow
1200         https://bugs.webkit.org/show_bug.cgi?id=131890
1201         rdar://problem/15558510
1202
1203         Reviewed by Andreas Kling.
1204
1205         Test: fast/css/simple-layout-overflow.html
1206
1207         * rendering/SimpleLineLayoutResolver.h:
1208         (WebCore::SimpleLineLayout::RunResolver::rangeForRect):
1209         If lastLine is smaller than firstLine, just ignore it.
1210
1211 2014-04-20  Darin Adler  <darin@apple.com>
1212
1213         ScriptExecutionContext::stopActiveDOMObjects iterates a hash map that can change during iteration (for multiple reasons, including GC)
1214         https://bugs.webkit.org/show_bug.cgi?id=52719
1215
1216         Reviewed by Alexey Proskuryakov.
1217
1218         At least two specific ways this can happen:
1219
1220         1) XMLHttpRequest::stop can trigger a JavaScript garbage collection.
1221         2) NotificationCenter::stop can delete the last references to notifications;
1222            those notifications are also active DOM objects.
1223
1224         Besides fixing the iteration in that function, did some other fixes for the
1225         ScriptExecutionContext class, including some coding style changes. Many uses
1226         of nullptr instead of 0, without listing each function separately below.
1227
1228         * Modules/webdatabase/DatabaseContext.cpp:
1229         (WebCore::DatabaseContext::contextDestroyed): Call through to the base class
1230         version of contextDestroyed rather than repeating what it does (with a large
1231         comment that doesn't acknowledge the base class alread does it).
1232         * Modules/webdatabase/DatabaseContext.h: Removed some unneeded includes.
1233         Wrote out "private" explicitly for deriving from ActiveDOMObject. Made the
1234         ActiveDOMObject function overrides private, and marked them override and final.
1235
1236         * dom/ActiveDOMObject.h: Updated comments. Replaced suspendIfNeededCalled with
1237         assertSuspendIfNeededWasCalled, which has an empty inline version in the header.
1238         Renamed m_suspendIfNeededCalled to m_suspendIfNeededWasCalled.
1239
1240         * dom/ActiveDOMObject.cpp:
1241         (WebCore::ActiveDOMObject::ActiveDOMObject): Pass a reference instead of a pointer.
1242         (WebCore::ActiveDOMObject::~ActiveDOMObject): Ditto.
1243         (WebCore::ActiveDOMObject::suspendIfNeeded): Ditto.
1244
1245         * dom/ContextDestructionObserver.cpp:
1246         (WebCore::ContextDestructionObserver::observeContext): Pass a reference instead of a pointer.
1247
1248         * dom/MessagePort.cpp:
1249         (WebCore::MessagePort::MessagePort): Pass a reference instead of a pointer.
1250         (WebCore::MessagePort::~MessagePort): Ditto.
1251         (WebCore::MessagePort::disentangle): Ditto.
1252
1253         * dom/ScriptExecutionContext.cpp:
1254         (WebCore::ScriptExecutionContext::ScriptExecutionContext): Updated flags used
1255         for assertions so they are conditional and updated their names.
1256         (WebCore::takeAny): Added. Helper function that we can consider for HashSet in
1257         the future; makes loop below easier to read.
1258         (WebCore::checkConsistency): Added. Assertions that were done multiple places below,
1259         and should not be written over and over again.
1260         (WebCore::ScriptExecutionContext::~ScriptExecutionContext): Changed to use C++11
1261         for loops and the takeAny function above.
1262         (WebCore::ScriptExecutionContext::dispatchMessagePortEvents): Ditto.
1263         (WebCore::ScriptExecutionContext::createdMessagePort): Changed to take a reference
1264         for clarity and so it doesn't have to do an assert the pointer is non-null.
1265         (WebCore::ScriptExecutionContext::destroyedMessagePort): Ditto.
1266         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects): Changed to use
1267         C++11 for loop and reworded comment and redid assertions.
1268         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): Ditto.
1269         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): Ditto.
1270         (WebCore::ScriptExecutionContext::stopActiveDOMObjects): Changed to support
1271         removal of an active DOM object during the stop function. Included new comments
1272         to clarify what the rules are.
1273         (WebCore::ScriptExecutionContext::suspendActiveDOMObjectIfNeeded): Changed to take
1274         a reference for clarity and so it doesn't have to assert a pointer is non-null.
1275         (WebCore::ScriptExecutionContext::didCreateActiveDOMObject): Ditto. Also changed to
1276         use RELEASE_ASSERT instead of CRASH.
1277         (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject): Ditto.
1278         (WebCore::ScriptExecutionContext::didCreateDestructionObserver): Ditto.
1279         (WebCore::ScriptExecutionContext::willDestroyDestructionObserver): Ditto.
1280         (WebCore::ScriptExecutionContext::closeMessagePorts): Moved the body of this
1281         function into its one call site, ScriptExecutionContext::stopActiveDOMObjects,
1282         since it's simple enough when written as a C++11 for loop.
1283         (WebCore::ScriptExecutionContext::hasPendingActivity): Added. This function was
1284         already exported for workers, and implementing it outside this class required
1285         exposing the private HashSet members; more sensible to implement it here and
1286         simply make it public in WorkerGlobalScope.
1287
1288         * dom/ScriptExecutionContext.h: Removed unnecessary includes and forward declarations.
1289         Removed a long-ago-fixed FIXME. Changed various functions to take references instead of
1290         pointers. Added a protected hasPendingActivity function, deleted the closeMessagePorts
1291         function, deleted the ActiveDOMObjectsSet typedef, made the assertion flags be
1292         !ASSERT_DISABLED only, and deleted the messagePorts and activeDOMObjects functions.
1293
1294         * workers/WorkerGlobalScope.cpp:
1295         (WebCore::WorkerGlobalScope::hasPendingActivity): Deleted. This is now implemented
1296         in the base class.
1297
1298         * workers/WorkerGlobalScope.h: Make hasPendingActivity function from the base class
1299         public instead of declaring it in this class.
1300
1301 2014-04-20  Brent Fulgham  <bfulgham@apple.com>
1302
1303         [Mac] Unable to select 'Off' or 'Auto' from track menu when tracks consist of unsupported track types
1304         https://bugs.webkit.org/show_bug.cgi?id=131908
1305         <rdar://problem/15999882>
1306
1307         Reviewed by Eric Carlson.
1308
1309         * html/HTMLMediaElement.cpp:
1310         (WebCore::HTMLMediaElement::setSelectedTextTrack): When the user selects 'Off', make sure the currently 'showing'
1311         track is switched to 'disabled'.
1312
1313 2014-04-20  Andreas Kling  <akling@apple.com>
1314
1315         Speed up jsStringWithCache() through WeakGCMap inlining.
1316         <https://webkit.org/b/131923>
1317
1318         Inline the common path of WeakGCMap::add() in jsStringWithCache().
1319         26% progression on Bindings/id-getter.html
1320
1321         Reviewed by Darin Adler.
1322
1323         * WebCore.exp.in:
1324         * bindings/js/JSDOMBinding.h:
1325         * bindings/js/JSDOMBinding.cpp:
1326         (WebCore::jsStringWithCache):
1327
1328             Move jsStringWithCache() out of line since we're now blowing up
1329             its size quite a bit.
1330
1331 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
1332
1333         Fix the build after r167574
1334
1335         * cssjit/SelectorCompiler.cpp:
1336         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
1337
1338 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
1339
1340         Compile the pseudo class :target
1341         https://bugs.webkit.org/show_bug.cgi?id=131904
1342
1343         Reviewed by Andreas Kling.
1344
1345         The pseudo class :target is trivial, it just compare the current element with
1346         Document::cssTarget().
1347
1348         * cssjit/SelectorCompiler.cpp:
1349         (WebCore::SelectorCompiler::addPseudoType):
1350         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
1351         (WebCore::SelectorCompiler::getDocument):
1352         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
1353         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsTarget):
1354         * dom/Document.h:
1355         (WebCore::Document::cssTargetMemoryOffset):
1356
1357 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
1358
1359         Rename the CSSSelector PseudoType to PseudoClassType
1360         https://bugs.webkit.org/show_bug.cgi?id=131907
1361
1362         Reviewed by Andreas Kling.
1363
1364         Pseudo Elements and Page Pseudo Classes have been moved out of PseudoType in previous patches.
1365         The remaining values in the PseudoType enumeration are the pseudo classes.
1366
1367         This patch is the final clean up, PseudoType is renamed to PseudoClassType.
1368
1369         * css/CSSGrammar.y.in:
1370         * css/CSSParserValues.cpp:
1371         (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
1372         * css/CSSParserValues.h:
1373         (WebCore::CSSParserSelector::pseudoClassType):
1374         (WebCore::CSSParserSelector::pseudoType): Deleted.
1375         * css/CSSSelector.cpp:
1376         (WebCore::CSSSelector::specificityForOneSelector):
1377         (WebCore::appendPseudoClassFunctionTail):
1378         (WebCore::CSSSelector::selectorText):
1379         * css/CSSSelector.h:
1380         (WebCore::CSSSelector::pseudoClassType):
1381         (WebCore::CSSSelector::pseudoElementType):
1382         (WebCore::CSSSelector::pagePseudoClassType):
1383         (WebCore::pseudoClassIsRelativeToSiblings):
1384         (WebCore::CSSSelector::isSiblingSelector):
1385         (WebCore::CSSSelector::CSSSelector):
1386         (WebCore::CSSSelector::pseudoType): Deleted.
1387         * css/RuleSet.cpp:
1388         (WebCore::RuleSet::findBestRuleSetAndAdd):
1389         * css/SelectorChecker.cpp:
1390         (WebCore::SelectorChecker::checkOne):
1391         (WebCore::SelectorChecker::checkScrollbarPseudoClass):
1392         (WebCore::SelectorChecker::determineLinkMatchType):
1393         (WebCore::SelectorChecker::matchesFocusPseudoClass):
1394         * css/SelectorChecker.h:
1395         (WebCore::SelectorChecker::isCommonPseudoClassSelector):
1396         * css/SelectorCheckerFastPath.cpp:
1397         (WebCore::SelectorCheckerFastPath::commonPseudoClassSelectorMatches):
1398         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
1399         * css/SelectorPseudoTypeMap.h:
1400         * css/StyleResolver.cpp:
1401         (WebCore::StyleResolver::styleForElement):
1402         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
1403         (enumerablePseudoType):
1404         * cssjit/SelectorCompiler.cpp:
1405         (WebCore::SelectorCompiler::addPseudoClassType):
1406         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
1407         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
1408         (WebCore::SelectorCompiler::addPseudoType): Deleted.
1409         * inspector/InspectorCSSAgent.cpp:
1410         (WebCore::computePseudoClassMask):
1411         (WebCore::InspectorCSSAgent::forcePseudoState):
1412         * inspector/InspectorCSSAgent.h:
1413         * inspector/InspectorInstrumentation.cpp:
1414         (WebCore::InspectorInstrumentation::forcePseudoStateImpl):
1415         * inspector/InspectorInstrumentation.h:
1416         (WebCore::InspectorInstrumentation::forcePseudoState):
1417
1418 2014-04-19  Alexey Proskuryakov  <ap@apple.com>
1419
1420         Crashes in HTMLFormElement::submit.
1421         https://bugs.webkit.org/show_bug.cgi?id=131910
1422         <rdar://problem/15661790>
1423
1424         Based on a patch by Kent Tamura.
1425
1426         Reviewed by Anders Carlsson.
1427
1428         Tests: fast/forms/form-submission-crash-2.html
1429                fast/forms/form-submission-crash.html
1430
1431         Code that executes arbitrary JS needs to protect objects that it uses afterwards.
1432
1433         * html/HTMLFormElement.cpp:
1434         (WebCore::HTMLFormElement::prepareForSubmission):
1435         (WebCore::HTMLFormElement::submit):
1436         * loader/FrameLoader.cpp:
1437         (WebCore::FrameLoader::submitForm):
1438
1439 2014-04-20  Antti Koivisto  <antti@apple.com>
1440
1441         Text bounding box computation for simple line layout is wrong
1442         https://bugs.webkit.org/show_bug.cgi?id=131912
1443
1444         Reviewed by Andreas Kling.
1445
1446         Top-left is currently the first line top-left which is not always correct.
1447
1448         * WebCore.exp.in:
1449         * rendering/RenderText.cpp:
1450         (WebCore::RenderText::firstRunLocation):
1451         (WebCore::RenderText::firstRunOrigin): Deleted.
1452         (WebCore::RenderText::firstRunX): Deleted.
1453         (WebCore::RenderText::firstRunY): Deleted.
1454         
1455             Keep just one accessor and rename it.
1456             Encapsulate the line box and simple line versions.
1457
1458         * rendering/RenderText.h:
1459         * rendering/RenderTextLineBoxes.cpp:
1460         (WebCore::RenderTextLineBoxes::firstRunLocation):
1461
1462             Line box version.
1463
1464         * rendering/RenderTextLineBoxes.h:
1465         * rendering/RenderTreeAsText.cpp:
1466         
1467             Simplify RenderText dumping.
1468
1469         (WebCore::RenderTreeAsText::writeRenderObject):
1470         * rendering/SimpleLineLayoutFunctions.cpp:
1471         (WebCore::SimpleLineLayout::computeTextBoundingBox):
1472         
1473             Return the correct x position.
1474
1475         (WebCore::SimpleLineLayout::computeTextFirstRunLocation):
1476         
1477             Simple line version.
1478
1479         * rendering/SimpleLineLayoutFunctions.h:
1480         * rendering/svg/SVGRenderTreeAsText.cpp:
1481         (WebCore::writeSVGInlineText):
1482
1483 2014-04-19  Zalan Bujtas  <zalan@apple.com>
1484
1485         Subpixel rendering: RenderLayer's clipping should snap to device pixel boundaries.
1486         https://bugs.webkit.org/show_bug.cgi?id=131466
1487
1488         Reviewed by Simon Fraser.
1489
1490         Fractional pixel clipping can produce cruft on RenderLayers. Since RenderLayer
1491         sizing and painting are snapped, painting clip rect needs to be snapped the same way.
1492
1493         Test: fast/clip/clip-when-rect-has-fractional-pixel-value.html
1494
1495         * rendering/RenderLayer.cpp:
1496         (WebCore::RenderLayer::clipToRect):
1497
1498 2014-04-19  Brent Fulgham  <bfulgham@apple.com>
1499
1500         Latched scrolling may interact badly with custom programmatic scrolling
1501         https://bugs.webkit.org/show_bug.cgi?id=131869
1502         <rdar://problem/16249557>
1503
1504         Reviewed by Darin Adler.
1505
1506         * dom/Element.cpp:
1507         (WebCore::Element::setScrollLeft): Mark scrollable area as having
1508         been scrolled programmatically.
1509         (WebCore::Element::setScrollTop): Ditto.
1510         * page/EventHandler.cpp:
1511         (WebCore::EventHandler::handleWheelEvent): Check for programmatic scroll, and
1512         clear latched state if the handler manually scrolled. Clear programmatic
1513         scroll state at the end of event handling.
1514         (WebCore::EventHandler::clearLatchedState): Refactored code.
1515         * page/EventHandler.h:
1516         * page/mac/EventHandlerMac.mm:
1517         (WebCore::EventHandler::platformPrepareForWheelEvents): Check
1518         if scrollable area was scrolled programmatically. If it was, do
1519         not honor latching behavior.
1520         * platform/ScrollableArea.cpp:
1521         (WebCore::ScrollableArea::ScrollableArea): Initialize new member.
1522         * platform/ScrollableArea.h:
1523         (WebCore::ScrollableArea::isScrolledProgrammatically): Added.
1524         (WebCore::ScrollableArea::setScrolledProgrammatically): Added.
1525
1526 2014-04-19  Chris Fleizach  <cfleizach@apple.com>
1527
1528         AX: grid rows are not recognized do to lack of explicit role="row", role="gridcell"
1529         https://bugs.webkit.org/show_bug.cgi?id=131819
1530
1531         Reviewed by Darin Adler.
1532
1533         Test: accessibility/table-with-missing-aria-role-rows.html
1534
1535         If a table is using role="grid", and it has <tr> elements that do not have
1536         role="row", we should still treat them as row elements.
1537
1538         * accessibility/AccessibilityARIAGrid.cpp:
1539         (WebCore::AccessibilityARIAGrid::addTableCellChild):
1540
1541 2014-04-19  Chris Fleizach  <cfleizach@apple.com>
1542
1543         AX: Malformed tables exposing incorrect col and colSpans
1544         https://bugs.webkit.org/show_bug.cgi?id=131796
1545
1546         Reviewed by Darin Adler.
1547
1548         Test: accessibility/table-incorrect-colspan-cell.html
1549
1550         When a developer has specified malformed colspans, accessibility is reporting those values instead of the effective column information.
1551
1552         * accessibility/AccessibilityTableCell.cpp:
1553         (WebCore::AccessibilityTableCell::columnIndexRange):
1554
1555 2014-04-19  Benjamin Poulain  <bpoulain@apple.com>
1556
1557         Make the CSS JIT compile for ARM64
1558         https://bugs.webkit.org/show_bug.cgi?id=131834
1559
1560         Reviewed by Gavin Barraclough.
1561
1562         Add the CPU specific code required to compile SelectorCompiler on ARM64.
1563         The code is absolutely non-functional, it would crash immediately, but it compiles.
1564
1565         * cssjit/FunctionCall.h:
1566         (WebCore::FunctionCall::FunctionCall):
1567         (WebCore::FunctionCall::callAndBranchOnCondition):
1568         * cssjit/RegisterAllocator.h:
1569         What am I supposed to do with all those registers? There are so many of them :)
1570         The array calleeSavedRegisters is defined for compatibility but it cannot be reached at the moment.
1571
1572         (WebCore::RegisterAllocator::isValidRegister):
1573         * cssjit/SelectorCompiler.cpp:
1574         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
1575         Implement modulo by doing dividend - (divisor * int(dividend/divisor)).
1576
1577         * cssjit/StackAllocator.h:
1578         StackAllocator will need a small redesign to handle the 16 bytes alligned stack of
1579         ARM64.
1580         The code has been modified to build but it is pretty useless.
1581
1582         (WebCore::StackAllocator::allocateUninitialized):
1583         (WebCore::StackAllocator::push):
1584         (WebCore::StackAllocator::pop):
1585         (WebCore::StackAllocator::popAndDiscard):
1586         (WebCore::StackAllocator::popAndDiscardUpTo):
1587         (WebCore::StackAllocator::alignStackPreFunctionCall):
1588         (WebCore::StackAllocator::unalignStackPostFunctionCall):
1589
1590 2014-04-19  Simon Fraser  <simon.fraser@apple.com>
1591
1592         [UI-side compositing] Implement blend modes
1593         https://bugs.webkit.org/show_bug.cgi?id=131891
1594         <rdar://problem/16490085>
1595
1596         Reviewed by Tim Horton.
1597
1598         Implement blend modes with UI-side compositing.
1599         
1600         PlatformCALayer::setBlendMode() becomes pure virtual, and overridden in
1601         PlatformCALayerMac and PlatformCALayerRemote.
1602         PlatformCAFilters::setBlendingFiltersOnLayer() now takes a raw platform
1603         layer, so it can be called from the UI process on a CALayer*.
1604         
1605         Fix an issue with GraphicsLayerCA::LayerChange flags. 1 << 31 shifts
1606         a signed integer, so it ended up setting all the high bits in m_uncommittedChanges,
1607         causing us to push blend modes to the UI process for every layer. Fix by shifting
1608         an unsigned long long (1LLU << 31). This should also fix a build warning on Windows.
1609
1610         * WebCore.exp.in:
1611         * platform/graphics/ca/GraphicsLayerCA.h:
1612         * platform/graphics/ca/PlatformCAFilters.h:
1613         * platform/graphics/ca/PlatformCALayer.h:
1614         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
1615         (PlatformCAFilters::setBlendingFiltersOnLayer):
1616         * platform/graphics/ca/mac/PlatformCALayerMac.h:
1617         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1618         (PlatformCALayerMac::setFilters):
1619         (PlatformCALayerMac::setBlendMode):
1620         (PlatformCALayer::setBlendMode): Deleted.
1621
1622 2014-04-19  Joseph Pecoraro  <pecoraro@apple.com>
1623
1624         Fix AVPlayerController leak on pages with video
1625         https://bugs.webkit.org/show_bug.cgi?id=131878
1626
1627         Reviewed by Eric Carlson.
1628
1629         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1630         (-[WebAVPlayerController init]):
1631         Assigning to the retain property will increment the count,
1632         so balance the alloc with an autorelease.
1633
1634 2014-04-19  Andreas Kling  <akling@apple.com>
1635
1636         Slap ALWAYS_INLINE on Element attribute lookup things.
1637         <https://webkit.org/b/131892>
1638
1639         Most of the "inline" helpers for setting/getting attributes were not
1640         actually getting inlined by the compiler, so let's make that happen.
1641
1642         Reviewed by Geoffrey Garen.
1643
1644         * dom/Element.cpp:
1645         (WebCore::Element::synchronizeAttribute):
1646         * dom/ElementData.h:
1647         (WebCore::ElementData::findAttributeByName):
1648         (WebCore::ElementData::findAttributeIndexByName):
1649
1650 2014-04-19  Darin Adler  <darin@apple.com>
1651
1652         Telephone number detection should respect its setting consistently
1653         https://bugs.webkit.org/show_bug.cgi?id=131893
1654         rdar://problem/16597639
1655
1656         Reviewed by Tim Horton.
1657
1658         * editing/Editor.cpp:
1659         (WebCore::Editor::respondToChangedSelection): Only start the timer
1660         if shouldDetectTelephoneNumbers returns true.
1661         (WebCore::Editor::shouldDetectTelephoneNumbers): Added. Calls both
1662         isTelephoneNumberParsingEnabled and TelephoneNumberDetector::isSupported.
1663         (WebCore::Editor::scanSelectionForTelephoneNumbers): Use
1664         shouldDetectTelephoneNumbers.
1665         (WebCore::Editor::clearDataDetectedTelephoneNumbers): Use document()
1666         instead of m_frame.document().
1667
1668         * editing/Editor.h: Added declaration of shouldDetectTelephoneNumbers.
1669
1670 2014-04-19  Andrei Bucur  <abucur@adobe.com>
1671
1672         [CSS Regions] Harden the layout in case there are no regions
1673         https://bugs.webkit.org/show_bug.cgi?id=131517
1674
1675         Reviewed by Mihnea Ovidenie.
1676
1677         The patch fixes the cases when the content of a flow thread is not
1678         properly invalidated when all the regions of its chain are removed.
1679
1680         Test: fast/regions/simplified-layout-no-regions.html
1681
1682         * rendering/RenderFlowThread.cpp:
1683         (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
1684         * rendering/RenderRegion.cpp:
1685         (WebCore::RenderRegion::ensureOverflowForBox):
1686
1687 2014-04-19  Zalan Bujtas  <zalan@apple.com>
1688
1689         https://bugs.webkit.org/show_bug.cgi?id=131594
1690         Subpixel rendering: WK1: Wrong repaint rect is calculated when layer has non-compositing transform.
1691
1692         Reviewed by Simon Fraser.
1693
1694         We need to snap the repaint rect for transformed object the same way when we paint them.
1695
1696         Test: fast/repaint/hidpi-wrong-repaint-rect-when-parent-has-noncompositing-transform.html
1697
1698         * rendering/RenderBox.cpp:
1699         (WebCore::RenderBox::computeRectForRepaint):
1700
1701 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
1702
1703         Use 'override' in GraphicsLayerCA
1704         https://bugs.webkit.org/show_bug.cgi?id=131882
1705
1706         Reviewed by Tim Horton.
1707
1708         Add 'override' to all overridden functions. Found a few that need
1709         not have been virtual. Removed "allowTiledLayer" stuff that was
1710         never called.
1711
1712         * WebCore.exp.in:
1713         * platform/graphics/ca/GraphicsLayerCA.cpp:
1714         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
1715         (WebCore::GraphicsLayerCA::requiresTiledLayer):
1716         (WebCore::GraphicsLayerCA::setAllowTiledLayer): Deleted.
1717         * platform/graphics/ca/GraphicsLayerCA.h:
1718         (WebCore::GraphicsLayerCA::platformCALayer):
1719         (WebCore::GraphicsLayerCA::hasContentsLayer): Deleted.
1720         (WebCore::GraphicsLayerCA::allowTiledLayer): Deleted.
1721         (WebCore::GraphicsLayerCA::isGraphicsLayerCA): Deleted.
1722         (WebCore::GraphicsLayerCA::platformCALayerLayoutSublayersOfLayer): Deleted.
1723         (WebCore::GraphicsLayerCA::platformCALayerRespondsToLayoutChanges): Deleted.
1724         (WebCore::GraphicsLayerCA::platformCALayerContentsOrientation): Deleted.
1725         (WebCore::GraphicsLayerCA::platformCALayerShowDebugBorders): Deleted.
1726         (WebCore::GraphicsLayerCA::platformCALayerIncrementRepaintCount): Deleted.
1727         (WebCore::GraphicsLayerCA::platformCALayerContentsOpaque): Deleted.
1728         (WebCore::GraphicsLayerCA::platformCALayerDrawsContent): Deleted.
1729         (WebCore::GraphicsLayerCA::platformCALayerLayerDidDisplay): Deleted.
1730
1731 2014-04-18  Timothy Hatcher  <timothy@apple.com>
1732
1733         Web Inspector: Move InspectorProfilerAgent to JavaScriptCore
1734         https://bugs.webkit.org/show_bug.cgi?id=131673
1735
1736         Passes existing profiler and inspector tests.
1737
1738         Reviewed by Joseph Pecoraro.
1739
1740         * CMakeLists.txt:
1741         * DerivedSources.make:
1742         * ForwardingHeaders/inspector/agents/InspectorProfilerAgent.h: Added.
1743         * WebCore.exp.in:
1744         * WebCore.vcxproj/WebCore.vcxproj:
1745         * WebCore.vcxproj/WebCore.vcxproj.filters:
1746         * WebCore.xcodeproj/project.pbxproj:
1747         * bindings/js/ScriptProfile.cpp: Removed.
1748         * bindings/js/ScriptProfile.h:
1749         * bindings/js/ScriptProfiler.cpp: Removed.
1750         * bindings/js/ScriptProfiler.h: Removed.
1751         * inspector/InspectorAllInOne.cpp:
1752         * inspector/InspectorConsoleInstrumentation.h:
1753         (WebCore::InspectorInstrumentation::profilerEnabled):
1754         (WebCore::InspectorInstrumentation::startProfiling):
1755         (WebCore::InspectorInstrumentation::stopProfiling):
1756         * inspector/InspectorController.cpp:
1757         (WebCore::InspectorController::InspectorController):
1758         * inspector/InspectorController.h:
1759         * inspector/InspectorInstrumentation.cpp:
1760         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
1761         (WebCore::InspectorInstrumentation::startProfilingImpl):
1762         (WebCore::InspectorInstrumentation::stopProfilingImpl):
1763         (WebCore::InspectorInstrumentation::consoleTimeStampImpl): Deleted.
1764         * inspector/InspectorInstrumentation.h:
1765         * inspector/InspectorProfilerAgent.cpp: Removed.
1766         * inspector/InspectorProfilerAgent.h: Removed.
1767         * inspector/InspectorTimelineAgent.cpp:
1768         (WebCore::startProfiling):
1769         (WebCore::stopProfiling):
1770         (WebCore::InspectorTimelineAgent::willCallFunction):
1771         (WebCore::InspectorTimelineAgent::didCallFunction):
1772         (WebCore::InspectorTimelineAgent::willEvaluateScript):
1773         (WebCore::InspectorTimelineAgent::didEvaluateScript):
1774         (WebCore::InspectorTimelineAgent::didDispatchXHRLoadEvent): Deleted.
1775         * inspector/InstrumentingAgents.h:
1776         (WebCore::InstrumentingAgents::inspectorProfilerAgent):
1777         (WebCore::InstrumentingAgents::setInspectorProfilerAgent):
1778         * inspector/PageDebuggerAgent.cpp:
1779         (WebCore::PageDebuggerAgent::sourceMapURLForScript): Deleted.
1780         * inspector/PageDebuggerAgent.h:
1781         * inspector/PageProfilerAgent.cpp: Added.
1782         (WebCore::PageProfilerAgent::PageProfilerAgent):
1783         (WebCore::PageProfilerAgent::profilingGlobalExecState):
1784         * inspector/PageProfilerAgent.h: Added.
1785         (WebCore::PageProfilerAgent::~PageProfilerAgent):
1786         * inspector/ScriptProfile.idl:
1787         * inspector/TimelineRecordFactory.cpp:
1788         (WebCore::TimelineRecordFactory::appendProfile):
1789         * inspector/TimelineRecordFactory.h:
1790         * inspector/WebConsoleAgent.cpp:
1791         * inspector/WebProfilerAgent.cpp: Added.
1792         (WebCore::WebProfilerAgent::WebProfilerAgent):
1793         (WebCore::WebProfilerAgent::enable):
1794         (WebCore::WebProfilerAgent::disable):
1795         * inspector/WebProfilerAgent.h: Added.
1796         (WebCore::WebProfilerAgent::~WebProfilerAgent):
1797         * inspector/WorkerInspectorController.cpp:
1798         (WebCore::WorkerInspectorController::WorkerInspectorController):
1799         * inspector/WorkerProfilerAgent.cpp: Added.
1800         (WebCore::WorkerProfilerAgent::WorkerProfilerAgent):
1801         (WebCore::WorkerProfilerAgent::profilingGlobalExecState):
1802         * inspector/WorkerProfilerAgent.h: Added.
1803         (WebCore::WorkerProfilerAgent::~WorkerProfilerAgent):
1804         * loader/appcache/ApplicationCacheGroup.cpp:
1805         * page/PageConsole.cpp:
1806         (WebCore::PageConsole::profile):
1807         (WebCore::PageConsole::profileEnd):
1808         (WebCore::PageConsole::time): Deleted.
1809         (WebCore::PageConsole::timeEnd): Deleted.
1810         (WebCore::PageConsole::timeStamp): Deleted.
1811         * page/PageConsole.h:
1812         * testing/Internals.cpp:
1813         * testing/Internals.h:
1814         * xml/XMLHttpRequest.cpp:
1815
1816 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
1817
1818         Contents of directly composited image layers are sometimes missing
1819         https://bugs.webkit.org/show_bug.cgi?id=131880
1820
1821         Reviewed by Tim Horton.
1822         
1823         RenderLayerBacking::updateGraphicsLayerGeometry() tested whether a
1824         GraphicsLayer had a contents layer to determine whether to call code
1825         that updates the contents rect. However, on Mac, we don't make a contents
1826         layer until later at layer flush time. That would result in an empty
1827         contentsRect being set.
1828         
1829         Fix by renaming GraphicsLayer::hasContentsLayer() to usesContentsLayer(),
1830         and on Mac consulting the m_contentsLayerPurpose flag, which is set
1831         at the appropriate time.
1832
1833         Test: compositing/images/update-content-rect.html
1834
1835         * platform/ScrollView.cpp:
1836         (WebCore::positionScrollbarLayer):
1837         * platform/graphics/GraphicsLayer.cpp:
1838         (WebCore::GraphicsLayer::getDebugBorderInfo):
1839         * platform/graphics/GraphicsLayer.h:
1840         (WebCore::GraphicsLayer::usesContentsLayer):
1841         (WebCore::GraphicsLayer::hasContentsLayer): Deleted.
1842         * platform/graphics/ca/GraphicsLayerCA.h:
1843         (WebCore::GraphicsLayerCA::hasContentsLayer): Deleted.
1844         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
1845         (WebCore::GraphicsLayerTextureMapper::usesContentsLayer):
1846         (WebCore::GraphicsLayerTextureMapper::hasContentsLayer): Deleted.
1847         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1848         * rendering/RenderLayerBacking.cpp:
1849         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
1850         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
1851         (WebCore::RenderLayerBacking::compositingLayerType):
1852
1853 2014-04-18  Commit Queue  <commit-queue@webkit.org>
1854
1855         Unreviewed, rolling out r167527.
1856         https://bugs.webkit.org/show_bug.cgi?id=131883
1857
1858         Broke 32-bit build (Requested by ap on #webkit).
1859
1860         Reverted changeset:
1861
1862         "[Mac] implement WebKitDataCue"
1863         https://bugs.webkit.org/show_bug.cgi?id=131799
1864         http://trac.webkit.org/changeset/167527
1865
1866 2014-04-18  Eric Carlson  <eric.carlson@apple.com>
1867
1868         [Mac] implement WebKitDataCue
1869         https://bugs.webkit.org/show_bug.cgi?id=131799
1870
1871         Reviewed by Dean Jackson.
1872
1873         Tests: http/tests/media/track-in-band-hls-metadata.html
1874                media/track/track-datacue-value.html
1875
1876         * Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.
1877         * DerivedSources.make: Add ENABLE_DATACUE_VALUE to HTML_FLAGS when appropriate.
1878
1879         * CMakeLists.txt: Add JSDataCueCustom.cpp.
1880         * bindings/js/JSBindingsAllInOne.cpp:
1881         * WebCore.xcodeproj/project.pbxproj: Add new files.
1882
1883         * bindings/js/JSDataCueCustom.cpp: Added.
1884         (WebCore::JSDataCue::value): 
1885         (WebCore::JSDataCue::setValue):
1886         (WebCore::JSDataCueConstructor::constructJSDataCue): Custom constructor.
1887
1888         * html/HTMLMediaElement.cpp:
1889         (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Drive-by fixes: don't schedule timeupdate
1890             events when paused, don't call sort on an Vector that can't be sorted.
1891
1892         * html/track/DataCue.cpp:
1893         (WebCore::DataCue::DataCue): Initialize m_type.
1894         (WebCore::DataCue::~DataCue): Unprotect the JSValue if necessary.
1895         (WebCore::DataCue::data): Ask the platform value for data if non-null.
1896         (WebCore::DataCue::setData): Clear m_platformValue and m_value.
1897         (WebCore::DataCue::isEqual): New.
1898         (WebCore::DataCue::value): Return a JSValue from the platform value, or the value passed
1899             to the constructor/set by script.
1900         (WebCore::DataCue::setValue): Set m_value.
1901         * html/track/DataCue.h:
1902         * html/track/DataCue.idl:
1903
1904         * html/track/InbandDataTextTrack.cpp:
1905         (WebCore::InbandDataTextTrack::addDataCue): Don't add the same cue more than once.
1906         (WebCore::InbandDataTextTrack::updateDataCue): Update a cue's duration.
1907         (WebCore::InbandDataTextTrack::removeDataCue): Remove an incomplete cue.
1908         (WebCore::InbandDataTextTrack::removeCue): Remove a cue from the incomplete cue map if necessary.
1909         * html/track/InbandDataTextTrack.h:
1910
1911         * html/track/InbandGenericTextTrack.cpp:
1912         (WebCore::InbandGenericTextTrack::addGenericCue): CueMatchRules is now in TextTrackCue instead
1913             of VTTCue.
1914         * html/track/InbandTextTrack.h:
1915
1916         * html/track/InbandWebVTTTextTrack.cpp:
1917         (WebCore::InbandWebVTTTextTrack::newCuesParsed): Ditto.
1918
1919         * html/track/TextTrack.cpp:
1920         (WebCore::TextTrack::hasCue): Ditto.
1921         * html/track/TextTrack.h:
1922
1923         * html/track/TextTrackCue.cpp:
1924         (WebCore::TextTrackCue::isEqual): New, test base class equality.
1925         * html/track/TextTrackCue.h:
1926
1927         * html/track/TextTrackCueGeneric.cpp:
1928         (WebCore::TextTrackCueGeneric::isEqual): Call TextTrackCue::isEqual first.
1929         * html/track/TextTrackCueGeneric.h:
1930
1931         * html/track/VTTCue.cpp:
1932         (WebCore::VTTCue::isEqual): Call TextTrackCue::isEqual first.
1933         * html/track/VTTCue.h:
1934
1935         * platform/SerializedPlatformRepresentation.h: Added.
1936         (WebCore::SerializedPlatformRepresentation::~SerializedPlatformRepresentation):
1937         (WebCore::SerializedPlatformRepresentation::SerializedPlatformRepresentation):
1938
1939         * platform/graphics/InbandTextTrackPrivateClient.h: Add methods for DataCue with SerializedPlatformRepresentation.
1940
1941         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: Added.
1942         (WebCore::InbandMetadataTextTrackPrivateAVF::create):
1943         (WebCore::InbandMetadataTextTrackPrivateAVF::InbandMetadataTextTrackPrivateAVF):
1944         (WebCore::InbandMetadataTextTrackPrivateAVF::~InbandMetadataTextTrackPrivateAVF):
1945         (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
1946         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
1947         (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
1948         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: Added.
1949
1950         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1951         (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): currentTrack -> currentTextTrack.
1952         (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted): Ditto.
1953         (WebCore::MediaPlayerPrivateAVFoundation::configureInbandTracks): Ditto.
1954         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1955         (WebCore::MediaPlayerPrivateAVFoundation::setCurrentTextTrack):
1956         (WebCore::MediaPlayerPrivateAVFoundation::setCurrentTrack): Deleted.
1957
1958         Renamed currentTrack and setCurrentTrack to currentTextTrack and setCurrentTextTrack.
1959         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1960         (WebCore::AVFWrapper::currentTextTrack):
1961         (WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTextTrack):
1962         (WebCore::MediaPlayerPrivateAVFoundationCF::currentTextTrack):
1963         (WebCore::AVFWrapper::setCurrentTextTrack):
1964         (WebCore::AVFWrapper::AVFWrapper):
1965         (WebCore::AVFWrapper::processCue):
1966         (WebCore::AVFWrapper::currentTrack): Deleted.
1967         (WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTrack): Deleted.
1968         (WebCore::MediaPlayerPrivateAVFoundationCF::currentTrack): Deleted.
1969         (WebCore::AVFWrapper::setCurrentTrack): Deleted.
1970         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1971
1972         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1973         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1974         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
1975         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): currentTrack -> currentTextTrack
1976         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): currentTrack -> currentTextTrack.
1977         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack): New.
1978         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): m_currentTrack -> m_currentTextTrack.
1979         (WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues): Ditto.
1980         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack): Renamed from setCurrentTextTrack.
1981         (WebCore::metadataType): Map an AVFoundation metadata key space to a metadata cue type.
1982         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): Process new metadata.
1983         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1984         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTrack): Deleted.
1985
1986         Create a JSValue representation from an AVMetadataItem.
1987         * platform/mac/SerializedPlatformRepresentationMac.h: Added.
1988         (WebCore::SerializedPlatformRepresentationMac::platformType):
1989         (WebCore::SerializedPlatformRepresentationMac::nativeValue):
1990         * platform/mac/SerializedPlatformRepresentationMac.mm: Added.
1991         (WebCore::SerializedPlatformRepresentationMac::SerializedPlatformRepresentationMac):
1992         (WebCore::SerializedPlatformRepresentationMac::~SerializedPlatformRepresentationMac):
1993         (WebCore::SerializedPlatformRepresentationMac::create):
1994         (WebCore::SerializedPlatformRepresentationMac::data):
1995         (WebCore::SerializedPlatformRepresentationMac::deserialize):
1996         (WebCore::SerializedPlatformRepresentationMac::isEqual):
1997         (WebCore::toSerializedPlatformRepresentationMac):
1998         (WebCore::jsValueWithValueInContext):
1999         (WebCore::jsValueWithDataInContext):
2000         (WebCore::jsValueWithArrayInContext):
2001         (WebCore::jsValueWithDictionaryInContext):
2002         (WebCore::jsValueWithAVMetadataItemInContext):
2003
2004 2014-04-18  Jon Honeycutt  <jhoneycutt@apple.com>
2005
2006         Harden RenderInline::inlineElementContinuation()
2007
2008         <https://bugs.webkit.org/show_bug.cgi?id=131858>
2009
2010         Reviewed by Sam Weinig.
2011
2012         No new tests, as there are no known cases of this happening.
2013
2014         * rendering/RenderInline.cpp:
2015         (WebCore::RenderInline::inlineElementContinuation):
2016         Return nullptr if the continuation is neither a RenderInline nor a
2017         RenderBlock.
2018
2019 2014-04-18  Stephanie Lewis  <slewis@apple.com>
2020
2021         We shouldn’t create page throttlers for other pages than WebKit2 pages.
2022         Part of <rdar://problem/16473045> Visibility state counters are often incorrect
2023         https://bugs.webkit.org/show_bug.cgi?id=131696
2024
2025         Reviewed by Gavin Barraclough.
2026
2027         No new test since not web exposed.
2028
2029         Page throttlers were being created for SVG images and other page instances that
2030         were not accurately tracking the states that enable and disable page throttling.
2031         Make the throttler an unique ptr and only initialize it for WebKit2.
2032
2033         This also fixes an inefficiency where we would throttle a new page on creation because 
2034         we assumed it was visible even if that was not the case.
2035
2036         * WebCore.exp.in:
2037         * html/HTMLMediaElement.cpp:
2038         (WebCore::HTMLMediaElement::parseAttribute): Check page throttler exists.
2039         * loader/FrameLoader.cpp:
2040         (WebCore::FrameLoader::started): ditto
2041         * page/Page.cpp:
2042         (WebCore::Page::Page): Don’t automatically create page throttler.
2043         (WebCore::Page::createPageThrottler): Create page throttler.
2044         (WebCore::Page::setViewState): Check page throttler exists.
2045         * page/Page.h:
2046         (WebCore::Page::pageThrottler): Make the page throttler a unique ptr.
2047         * page/PageThrottler.h:
2048         * page/Settings.cpp: 
2049         (WebCore::Settings::setHiddenPageDOMTimerThrottlingEnabled): Check page throttler exists.
2050
2051 2014-04-18  Stephanie Lewis  <slewis@apple.com>
2052
2053         Move DOM throttling out of the page throttler
2054         <rdar://problem/16473004>
2055         https://bugs.webkit.org/show_bug.cgi?id=131697
2056
2057         Reviewed by Gavin Barraclough.
2058
2059         No new tests since it's not web exposed.
2060
2061         DOM timer throttling is currently part of the page throttler which uses per process 
2062         state and per page state to determine when to throttle.  This led us to being overly 
2063         conservative when turning DOM throttling off.  It should only respond to view state changes.
2064
2065         Additionally since creating extra page throttlers SVG images caused bugs 
2066         in tracking state we'll reserve the page throttler for WebKit2 views.  To avoid regressing 
2067         WebKit1 we should move DOM timer throttling back to the page.
2068
2069         * page/Page.cpp:
2070         (WebCore::Page::Page): set DOM timer throttling.
2071         (WebCore::Page::setIsVisuallyIdleInternal): ditto.
2072         (WebCore::Page::hiddenPageDOMTimerThrottlingStateChanged): ditto.
2073         (WebCore::Page::setIsVisible): Update view state masks for WebKit1 to include IsVisibleOrOccluded and IsVisuallyIdle
2074         * page/Page.h:
2075         * page/PageThrottler.cpp:
2076         (WebCore::PageThrottler::PageThrottler): remove DOM timer throttling.
2077         (WebCore::PageThrottler::started): ditto.
2078         (WebCore::PageThrottler::stopped): ditto.
2079         (WebCore::PageThrottler::hiddenPageDOMTimerThrottlingStateChanged): Deleted.
2080         * page/PageThrottler.h:
2081         * page/Settings.cpp:
2082         (WebCore::Settings::setHiddenPageDOMTimerThrottlingEnabled):
2083
2084 2014-04-18  Dean Jackson  <dino@apple.com>
2085
2086         [WebGL] Limit maximum texture sizes on older Intel hardware
2087         https://bugs.webkit.org/show_bug.cgi?id=131867
2088
2089         Reviewed by Geoffrey Garen.
2090
2091         Both Chrome and Firefox limit the MAX_TEXTURE_SIZE on
2092         older Intel hardware to be at most 4096. This does the
2093         same for WebKit.
2094
2095         * platform/graphics/Extensions3D.h: Add requiresRestrictedMaximumTextureSize() accessor.
2096         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2097         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon): Record the value of GL_RENDERER
2098         and test for "Intel HD Graphics 3000", which is the problematic hardware.
2099         * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
2100         (WebCore::Extensions3DOpenGLCommon::requiresRestrictedMaximumTextureSize): Getter.
2101         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2102         (WebCore::GraphicsContext3D::getIntegerv): If you're asking for MAX_TEXTURE_SIZE or
2103         MAX_CUBE_MAP_TEXTURE_SIZE, and you're on problematic hardware, return a clamped value
2104         (4096 and 1024 respectively).
2105
2106 2014-04-18  Hans Muller  <hmuller@adobe.com>
2107
2108         [CSS Shapes] Add parsing support for gradients
2109         https://bugs.webkit.org/show_bug.cgi?id=131444
2110
2111         Reviewed by Bem Jones-Bey.
2112
2113         Added support for shape-outside gradient values.
2114
2115         Test: fast/shapes/shape-outside-floats/shape-outside-linear-gradient.html
2116
2117         * css/DeprecatedStyleBuilder.cpp:
2118         (WebCore::ApplyPropertyShape::applyValue): Accept generated images as shape-outside values.
2119         * rendering/shapes/ShapeOutsideInfo.cpp:
2120         (WebCore::checkShapeImageOrigin): Generated images get a pass, others do not.
2121         (WebCore::getShapeImageAndRect): Use StyleImage::image() to get a generated image.
2122         (WebCore::ShapeOutsideInfo::isEnabledFor):
2123         * rendering/style/ShapeValue.h:
2124         (WebCore::ShapeValue::isImageValid): Generated images are always considered valid.
2125
2126 2014-04-18  Brady Eidson  <beidson@apple.com>
2127
2128         REGRESSION (r155700): Pasting an image into content-editable regions is broken.
2129         <rdar://problem/16654156> and https://bugs.webkit.org/show_bug.cgi?id=131844
2130
2131         Reviewed by Enrica Casucci.
2132
2133         * editing/mac/EditorMac.mm:
2134         (WebCore::Editor::createFragmentForImageResourceAndAddResource): Add the ArchiveResource before
2135           creating the element that uses it.
2136
2137 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
2138
2139         [iOS WK2] Make window.scroll() and window.scrollBy() work
2140         https://bugs.webkit.org/show_bug.cgi?id=131848
2141         <rdar://problem/16638319>
2142
2143         Reviewed by Beth Dakin.
2144
2145         The scrolling-related functions in DOMWindow were #ifdeffed for iOS
2146         to use the hacky WK1-specific "actual scroll" functions, which do nothing
2147         in WK2.
2148         
2149         Fix by adding a scroll position wrapper (contentsScrollPosition) which does
2150         the right thing on WK1 and WK2, and change almost all the places that used "actualScrollPosition"
2151         to us it (with the exception of contentsScrollOffset() in MouseRelatedEvent.cpp, which has
2152         confusing scaling behavior).
2153
2154         * dom/MouseRelatedEvent.cpp:
2155         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
2156         * dom/TreeScope.cpp:
2157         (WebCore::nodeFromPoint): Remove #ifdefs. 
2158         * html/HTMLBodyElement.cpp:
2159         (WebCore::HTMLBodyElement::scrollLeft):
2160         (WebCore::HTMLBodyElement::scrollTop):
2161         * page/DOMWindow.cpp:
2162         (WebCore::DOMWindow::scrollX):
2163         (WebCore::DOMWindow::scrollY):
2164         (WebCore::DOMWindow::scrollBy):
2165         (WebCore::DOMWindow::scrollTo):
2166         * platform/ScrollView.cpp:
2167         (WebCore::ScrollView::contentsScrollPosition):
2168         (WebCore::ScrollView::setContentsScrollPosition):
2169         * platform/ScrollView.h:
2170
2171 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
2172
2173         Worse animation performance on pages with 3D transforms
2174         https://bugs.webkit.org/show_bug.cgi?id=131838
2175         <rdar://problem/16428630&15705876>
2176
2177         Reviewed by Dean Jackson.
2178         
2179         r155977 added logic to adjust the contentsScale of compositing layers
2180         based on a root-relative transform. However, this resulted in
2181         the contentsScale continually changing on layers whose transforms
2182         are changed dynamically, which caused lots of expensive painting.
2183         
2184         Fix by bucketing the part of the scale computed from the root-relative transform
2185         into buckets of 0.25 via rounding.
2186
2187         Test: compositing/contents-scale/rounded-contents-scale.html
2188
2189         * platform/graphics/ca/GraphicsLayerCA.cpp:
2190         (WebCore::clampedContentsScaleForScale):
2191         (WebCore::GraphicsLayerCA::updateContentsOpaque):
2192         (WebCore::GraphicsLayerCA::updateContentsScale):
2193         (WebCore::GraphicsLayerCA::updateContentsVisibility): Deleted.
2194         (WebCore::GraphicsLayerCA::animatedLayerClones): Deleted.
2195
2196 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
2197
2198         Remove some includes from image-related headers, and Document.h
2199         https://bugs.webkit.org/show_bug.cgi?id=131797
2200
2201         Reviewed by Martin Robinson.
2202
2203         Remove some #includes from Document.h, DragImage.h, GradientImage.h,
2204         Image.h, and ImageBuffer.h and deal with the fallout.
2205
2206         * dom/ContainerNode.h:
2207         * dom/Document.cpp:
2208         (WebCore::Document::setInputCursor):
2209         * dom/Document.h:
2210         (WebCore::Document::inputCursor):
2211         * dom/MutationObserverRegistration.cpp:
2212         * html/canvas/WebGLRenderingContext.cpp:
2213         * page/FrameSnapshotting.cpp:
2214         * page/Page.cpp:
2215         * platform/DragImage.h:
2216         * platform/graphics/BitmapImage.cpp:
2217         * platform/graphics/GradientImage.cpp:
2218         (WebCore::GradientImage::GradientImage):
2219         (WebCore::GradientImage::~GradientImage):
2220         * platform/graphics/GradientImage.h:
2221         * platform/graphics/Image.h:
2222         * platform/graphics/ImageBuffer.cpp:
2223         * platform/graphics/ImageBuffer.h:
2224         (WebCore::ImageBuffer::create):
2225         (WebCore::ImageBuffer::internalSize):
2226         (WebCore::ImageBuffer::logicalSize):
2227         (WebCore::ImageBuffer::baseTransform):
2228         (WebCore::ImageBuffer::spaceSize):
2229         (WebCore::ImageBuffer::setSpaceSize):
2230         * rendering/RenderThemeMac.mm:
2231         * rendering/shapes/Shape.cpp:
2232         * rendering/svg/RenderSVGContainer.cpp:
2233         * svg/SVGURIReference.h:
2234
2235 2014-04-18  Gabor Rapcsanyi  <rgabor@webkit.org>
2236
2237         Unreviewed. ARM64 buildfix after r167473.
2238
2239         * platform/audio/DenormalDisabler.h: Put back the MathExtras.h include.
2240
2241 2014-04-18  Radu Stavila  <stavila@adobe.com>
2242
2243         [CSSRegions] Incorrect background paint on positioned element hover
2244         https://bugs.webkit.org/show_bug.cgi?id=131617
2245
2246         Reviewed by Andrei Bucur.
2247
2248         When computing the repaint rect for absolute elements flowed into regions, the Y location of the
2249         region within the flow thread must no longer be added to the repaint rect's location because absolute
2250         positioned elements get pushed down through the regions by their absolute top. So adding the region's
2251         position in the flow thread and then adding the element's absolute top would cause us to add
2252         something twice.
2253
2254         Tests: fast/regions/repaint/repaint-absolute-pushed-to-next-region.html
2255
2256         * rendering/RenderBox.cpp:
2257         (WebCore::RenderBox::computeRectForRepaint):
2258
2259 2014-04-18  Philippe Normand  <pnormand@igalia.com>
2260
2261         Remove NETWORK_INFO support
2262         https://bugs.webkit.org/show_bug.cgi?id=131841
2263
2264         Reviewed by Gyuyoung Kim.
2265
2266         * CMakeLists.txt:
2267         * Modules/networkinfo/NavigatorNetworkInfoConnection.cpp: Removed.
2268         * Modules/networkinfo/NavigatorNetworkInfoConnection.h: Removed.
2269         * Modules/networkinfo/NavigatorNetworkInfoConnection.idl: Removed.
2270         * Modules/networkinfo/NetworkInfo.cpp: Removed.
2271         * Modules/networkinfo/NetworkInfo.h: Removed.
2272         * Modules/networkinfo/NetworkInfoClient.h: Removed.
2273         * Modules/networkinfo/NetworkInfoConnection.cpp: Removed.
2274         * Modules/networkinfo/NetworkInfoConnection.h: Removed.
2275         * Modules/networkinfo/NetworkInfoConnection.idl: Removed.
2276         * Modules/networkinfo/NetworkInfoController.cpp: Removed.
2277         * Modules/networkinfo/NetworkInfoController.h: Removed.
2278         * PlatformEfl.cmake:
2279         * dom/EventTargetFactory.in:
2280         * platform/efl/NetworkInfoProviderEfl.cpp: Removed.
2281         * platform/efl/NetworkInfoProviderEfl.h: Removed.
2282         * testing/Internals.cpp:
2283         (WebCore::Internals::setNetworkInformation): Deleted.
2284         * testing/Internals.h:
2285         * testing/Internals.idl:
2286
2287 2014-04-17  Commit Queue  <commit-queue@webkit.org>
2288
2289         Unreviewed, rolling out r167478.
2290         https://bugs.webkit.org/show_bug.cgi?id=131840
2291
2292         Broke multicol tests (Requested by ap on #webkit).
2293
2294         Reverted changeset:
2295
2296         "[New Multicolumn] Pagination mode messed up with non-inline
2297         axis and reversed direction."
2298         https://bugs.webkit.org/show_bug.cgi?id=131811
2299         http://trac.webkit.org/changeset/167478
2300
2301 2014-04-17  Daniel Bates  <dabates@apple.com>
2302
2303         [iOS] Hook up screen.{availHeight, availWidth, height, width}
2304         https://bugs.webkit.org/show_bug.cgi?id=131821
2305         <rdar://problem/16413795>
2306
2307         Reviewed by Benjamin Poulain and Tim Horton.
2308
2309         Implement support for screen.{availHeight, availWidth, height, width} in WebKit2 for iOS.
2310
2311         Additionally substitute "screenSize" for "viewporScreenSize" to make the code more understandable.
2312
2313         * WebCore.exp.in: Export symbol for WebCore System Interface function
2314         _wkGetAvailableScreenSize.
2315         * dom/Document.cpp:
2316         (WebCore::Document::processViewport): Modified to call Chrome::screenSize(); formerly it
2317         called ChromeClient::viewportScreenSize().
2318         * page/Chrome.cpp:
2319         (WebCore::Chrome::screenSize): Added; turns around and calls ChromeClient::screenSize().
2320         (WebCore::Chrome::availableScreenSize): Added; turns around and calls ChromeClient::availableScreenSize().
2321         * page/Chrome.h:
2322         * page/ChromeClient.h:
2323         (WebCore::ChromeClient::screenSize): Renamed; formerly named viewportScreenSize.
2324         (WebCore::ChromeClient::availableScreenSize): Added; default implementation, which
2325         returns the size of Chrome::windowRect().
2326         * page/ViewportConfiguration.cpp:
2327         (WebCore::ViewportConfiguration::textDocumentParameters):
2328         * platform/HostWindow.h: Added declarations for availableScreenSize() and screenSize()
2329         so that a caller (e.g. WebCore::screenRect()) can query for such screen information using
2330         only the HostWindow interface. That is, a caller doesn't need to know about ChromeClient.
2331         * platform/ios/PlatformScreenIOS.mm:
2332         (WebCore::screenRect): Modified to query HostWindow::screenSize() when computing the
2333         screen rectangle in WebKit2 for iOS.
2334         (WebCore::screenAvailableRect): Modified to query HostWindow::availableScreenSize()
2335         when computing the available screen rectangle in WebKit2 for iOS.
2336         * platform/ios/WebCoreSystemInterfaceIOS.mm:
2337         * platform/mac/WebCoreSystemInterface.h:
2338
2339 2014-04-17  Darin Adler  <darin@apple.com>
2340
2341         origin spoofing possible (HTTP Origin, postMessage event.origin) due to inappropriate URL escape sequence decoding
2342         https://bugs.webkit.org/show_bug.cgi?id=131837
2343         rdar://problem/15211936
2344
2345         Reviewed by Anders Carlsson and Dave Hyatt.
2346
2347         Tests: fast/dom/DOMURL/parsing.html
2348                fast/dom/HTMLAnchorElement/anchor-element-href-parsing.html
2349
2350         * platform/URL.cpp:
2351         (WebCore::URL::host): Removed unnecessary call to decodeURLEscapeSequences, which caused
2352         problems and was not needed.
2353
2354 2014-04-17  David Hyatt  <hyatt@apple.com>
2355
2356         [New Multicolumn] Pagination mode messed up with non-inline axis and reversed direction.
2357         https://bugs.webkit.org/show_bug.cgi?id=131811
2358
2359         Reviewed by Dean Jackson.
2360
2361         Added fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb.html
2362         
2363         With block axis pagination mode, it is possible to set a column height that is not the same
2364         as the available fill height for a block. The new multi-column code had the assumption that
2365         the column height was the same as the amount of fill room you had available. This is not
2366         the case.
2367         
2368         To correct the issue, I added a member variable to RenderMultiColumnSet that stores the
2369         available column height as a separate variable from the computed column height. This allows
2370         the pagination API to specify a different column height that is not the same as the view's
2371         content height.
2372
2373         Even though it isn't involved in the solution, I also patched pageOrViewLogicalHeight on
2374         RenderView to work with the new column code as well.
2375
2376         * rendering/RenderMultiColumnSet.cpp:
2377         (WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
2378         (WebCore::RenderMultiColumnSet::setAndConstrainColumnHeight):
2379         (WebCore::RenderMultiColumnSet::computeLogicalHeight):
2380         * rendering/RenderMultiColumnSet.h:
2381         * rendering/RenderView.cpp:
2382         (WebCore::RenderView::pageOrViewLogicalHeight):
2383
2384 2014-04-17  Anders Carlsson  <andersca@apple.com>
2385
2386         Build fix.
2387
2388         * svg/animation/SMILTime.h:
2389
2390 2014-04-17  Bem Jones-Bey  <bjonesbe@adobe.com>
2391
2392         Unreviewed, rolling out r167384.
2393
2394         Sounds like this isn't the right fix, and causes generation to
2395         run far too often.
2396
2397         Reverted changeset:
2398
2399         "Fix CodeGenerator.pm to only write files if the generated
2400         content has changed"
2401         https://bugs.webkit.org/show_bug.cgi?id=131756
2402         http://trac.webkit.org/changeset/167384
2403
2404 2014-04-17  Ryuan Choi  <ryuan.choi@samsung.com>
2405
2406         Remove unnecessary MathExtras.h includes
2407         https://bugs.webkit.org/show_bug.cgi?id=131789
2408
2409         Reviewed by Anders Carlsson.
2410
2411         * platform/FileSystem.h:
2412         * platform/Scrollbar.h:
2413         * platform/animation/AnimationUtilities.h:
2414         * platform/audio/DenormalDisabler.h:
2415         * platform/graphics/Font.h:
2416         * platform/graphics/IntPoint.h: Included cmath instad of MathExtras.h.
2417         * platform/graphics/LayoutPoint.h:
2418         * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
2419         * rendering/svg/SVGMarkerData.h:
2420         * svg/animation/SMILTime.h:
2421
2422 2014-04-16  Huang Dongsung  <luxtella@company100.net>
2423
2424         Make RenderLayerBacking get the timingFunction of the correct animation.
2425         https://bugs.webkit.org/show_bug.cgi?id=100632
2426
2427         Reviewed by Simon Fraser.
2428
2429         When an element has multiple animations that have different timingFunctions,
2430         the progress of each animation should be calculated using its respective
2431         timingFunction. But at this point, the timingFunction of the first animation is
2432         only used in RenderLayerBacking::startAnimation(), regardless of how many
2433         animations the element has.
2434
2435         getAnimationFromStyleByName() was introduced in r89462 so that the
2436         timingFunction of the correct animation searched by its name would be
2437         used. This patch moves the function to KeyframeValue::timingFunction()
2438         so that RenderLayerBacking reuses this method.
2439
2440         Test: animations/keyframe-multiple-timing-functions-transform.html
2441
2442         * page/animation/KeyframeAnimation.cpp:
2443         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty):
2444         * rendering/RenderLayerBacking.cpp:
2445         (WebCore::RenderLayerBacking::startAnimation):
2446         * rendering/style/KeyframeList.cpp:
2447         (WebCore::KeyframeValue::timingFunction):
2448         (WebCore):
2449         * rendering/style/KeyframeList.h:
2450         (WebCore):
2451         (KeyframeValue):
2452
2453 2014-04-17  Andreas Kling  <akling@apple.com>
2454
2455         Rollout: Add a way to cache never-changing IDL attributes in the wrapper.
2456         <https://webkit.org/b/131759>
2457
2458         This behavior may be observable from the web, so we can't do it this way.
2459
2460         * bindings/scripts/CodeGeneratorJS.pm:
2461         (GenerateImplementation):
2462         * bindings/scripts/IDLAttributes.txt:
2463         * bindings/scripts/test/*:
2464         * dom/Element.idl:
2465         * dom/Node.idl:
2466
2467 2014-04-17  Andreas Kling  <akling@apple.com>
2468
2469         Cheesy Mountain Lion build fix.
2470
2471         * platform/MemoryPressureHandler.h:
2472         (WebCore::MemoryPressureHandler::ReliefLogger::logString):
2473
2474 2014-04-17  David Hyatt  <hyatt@apple.com>
2475
2476         [New Multicolumn] Column rules don't respect the specified stacking order.
2477         https://bugs.webkit.org/show_bug.cgi?id=131804
2478
2479         Reviewed by Beth Dakin.
2480
2481         Added fast/multicol/newmulticol/compare_with_old_impl/column-rules-stacking.html
2482
2483         * rendering/RenderBlockFlow.cpp:
2484         (WebCore::RenderBlockFlow::paintBoxDecorations):
2485         * rendering/RenderBlockFlow.h:
2486         Override paintBoxDecorations for block flows so that we can iterate over our column sets
2487         and paint their rules just after painting our background and border. We can't wait until
2488         the child column sets paint their backgrounds, since that is specified as being above negative
2489         z-index children. We have to pretend that the column sets don't exist as
2490         far as column rule painting is concerned.
2491
2492         * rendering/RenderMultiColumnSet.cpp:
2493         (WebCore::RenderMultiColumnSet::paintObject): Deleted.
2494         * rendering/RenderMultiColumnSet.h:
2495         Turn paintObject in RenderMultiColumnSet into an override that doesn't paint anything.
2496
2497 2014-04-17  Beth Dakin  <bdakin@apple.com>
2498
2499         Hit-testing is incorrect for plugins inside iframes when there is a 
2500         topContentInset
2501         https://bugs.webkit.org/show_bug.cgi?id=131826
2502         -and corresponding-
2503         <rdar://problem/16649996>
2504
2505         Reviewed by Tim Horton.
2506
2507         I missed one coordinate-conversion spot when getting hit-testing to work. Like 
2508         headerHeight() which also manipulates the location of the root layer, 
2509         topContentInset() has to be factored into all of these conversions.
2510         * page/FrameView.cpp:
2511         (WebCore::FrameView::convertFromRenderer):
2512
2513 2014-04-17  Andreas Kling  <akling@apple.com>
2514
2515         Stub out MemoryPressureHandler::ReliefLogger on older OS X'es.
2516
2517         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2518         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog):
2519         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
2520
2521 2014-04-17  Dirk Schulze  <krit@webkit.org>
2522
2523         Remove CANVAS_PATH where possible
2524         https://bugs.webkit.org/show_bug.cgi?id=131788
2525
2526         Reviewed by Dean Jackson.
2527
2528         Since Firefox and Chrome ship the same interoperable subset of Path2D soon, 
2529         it is time to remove CANVAS_PATH where possible.
2530
2531         * html/canvas/CanvasRenderingContext2D.cpp:
2532         (WebCore::CanvasRenderingContext2D::clip):
2533         (WebCore::CanvasRenderingContext2D::isPointInStroke):
2534         * html/canvas/CanvasRenderingContext2D.h:
2535         * html/canvas/CanvasRenderingContext2D.idl:
2536         * html/canvas/DOMPath.h:
2537         * html/canvas/DOMPath.idl:
2538
2539 2014-04-17  Brendan Long  <b.long@cablelabs.com>
2540
2541         [GStreamer] Store TrackPrivateBaseGStreamer's label and language as AtomicStrings
2542         https://bugs.webkit.org/show_bug.cgi?id=130404
2543
2544         Reviewed by Philippe Normand.
2545
2546         No new tests, this just makes things more efficient.
2547
2548         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
2549         (WebCore::TrackPrivateBaseGStreamer::getLanguageCode):
2550         (WebCore::TrackPrivateBaseGStreamer::getTag):
2551         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
2552
2553 2014-04-17  Andreas Kling  <akling@apple.com>
2554
2555         Fix Cocoa build.
2556
2557         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2558         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
2559
2560 2014-04-17  Rik Cabanier  <cabanier@adobe.com>
2561
2562         [CSS Blending] Remove the -webkit- prefix for mix-blend-mode and isolation CSS properties
2563         https://bugs.webkit.org/show_bug.cgi?id=131355
2564
2565         Reviewed by Dean Jackson.
2566
2567         Removed webkit prefix from mix-blend-mode and isolation. These properties
2568         never shipped and their spec is now in CR.
2569
2570         Covered by existing tests.
2571
2572         * css/CSSComputedStyleDeclaration.cpp:
2573         (WebCore::ComputedStyleExtractor::propertyValue):
2574         * css/CSSParser.cpp:
2575         (WebCore::isValidKeywordPropertyAndValue):
2576         (WebCore::isKeywordPropertyID):
2577         (WebCore::CSSParser::parseValue):
2578         * css/CSSPropertyNames.in:
2579         * css/DeprecatedStyleBuilder.cpp:
2580         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2581
2582 2014-04-17  David Kilzer  <ddkilzer@apple.com>
2583
2584         Tidy up isIsolatedInline() and highestContainingIsolateWithinRoot()
2585         <http://webkit.org/b/131117>
2586
2587         Reviewed by Daniel Bates.
2588
2589         Based on review feedback for r166650.
2590
2591         * rendering/InlineIterator.h:
2592         (WebCore::isIsolatedInline):
2593         - Switch argument to a reference since it is never called with a
2594           nullptr.
2595         (WebCore::highestContainingIsolateWithinRoot):
2596         - Switch first argument to a reference since it's never a
2597           nullptr.
2598         - Use nullptr for pointer initialization.
2599         - Switch while() loop to for() loop. Pass reference to
2600           isIsolatedInline().
2601         (WebCore::numberOfIsolateAncestors):
2602         - Switch while() loop to for() loop. Pass reference to
2603           isIsolatedInline().
2604         * rendering/RenderBlockLineLayout.cpp:
2605         (WebCore::constructBidiRunsForSegment):
2606         - Rename startObj to startObject.
2607         - No longer need to pass the address of startObject here.
2608
2609 2014-04-17  Andreas Kling  <akling@apple.com>
2610
2611         Log number of bytes reclaimed at each step of memory pressure relief.
2612         <https://webkit.org/b/131751>
2613
2614         Reviewed by Antti Koivisto.
2615
2616         * platform/MemoryPressureHandler.h:
2617         * platform/MemoryPressureHandler.cpp:
2618         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog):
2619         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
2620         (WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
2621         (WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
2622         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2623         (WebCore::MemoryPressureHandlerCocoa::ReliefLogger::platformMemoryUsage):
2624         (WebCore::MemoryPressureHandlerCocoa::ReliefLogger::platformLog):
2625
2626             Add a simple RAII helper to check memory usage before and after
2627             a block of code, and then dump the delta to system log.
2628
2629         (WebCore::MemoryPressureHandler::releaseMemory):
2630         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2631         (WebCore::MemoryPressureHandler::platformReleaseMemory):
2632
2633             Use ReliefLogger to annotate the various attempts to reduce
2634             our memory footprint. This will help us understand the efficiency
2635             of our current strategy.
2636
2637 2014-04-17  David Hyatt  <hyatt@apple.com>
2638
2639         [New Multicolumn] columnNumberForOffset is not patched for new multicolumn code yet.
2640         https://bugs.webkit.org/show_bug.cgi?id=131740
2641
2642         Reviewed by Enrica Casucci.
2643         
2644         I took the opportunity to clean this code up while adding support for the new columns.
2645         columnNumberForOffset only applied for paginated RenderViews and was really about
2646         pages and not columns. It also only returns an actual page number if the columns are
2647         block progressed (e.g., right-to-left vertical Japanese books).
2648         
2649         Therefore I renamed columnNumberForOffset to pageNumberForBlockProgressionOffset and
2650         moved it to RenderView.
2651         
2652         I also renamed the member variable of SelectionRect to be pageNumber instead of
2653         columnNumber in order to make it more obvious that this isn't about columns per se
2654         (since the fact that we implemented RenderView's pagination mode using columns is an
2655         implementation detail).
2656
2657         * dom/Range.cpp:
2658         (WebCore::coalesceSelectionRects):
2659         (WebCore::Range::collectSelectionRects):
2660         * platform/ios/SelectionRect.h:
2661         (WebCore::SelectionRect::pageNumber):
2662         (WebCore::SelectionRect::columnNumber): Deleted.
2663         * rendering/RenderImage.cpp:
2664         (WebCore::RenderImage::collectSelectionRects):
2665         * rendering/RenderObject.cpp:
2666         (WebCore::RenderObject::collectSelectionRects):
2667         (WebCore::RenderObject::columnNumberForOffset): Deleted.
2668         * rendering/RenderObject.h:
2669         * rendering/RenderText.cpp:
2670         (WebCore::RenderText::collectSelectionRects):
2671         * rendering/RenderView.cpp:
2672         (WebCore::RenderView::pageNumberForBlockProgressionOffset):
2673         * rendering/RenderView.h:
2674
2675 2014-04-16  Brent Fulgham  <bfulgham@apple.com>
2676
2677         [Win] A few final cleanups to the DataObject classes.
2678         https://bugs.webkit.org/show_bug.cgi?id=131784
2679
2680         Reviewed by Anders Carlsson.
2681
2682         * platform/win/WCDataObject.cpp:
2683         (WebCore::WCDataObject::clearData): Use 'last()' method.
2684
2685 2014-04-15  Jer Noble  <jer.noble@apple.com>
2686
2687         Fullscreen media controls are unusable in pagination mode
2688         https://bugs.webkit.org/show_bug.cgi?id=131705
2689
2690         Reviewed by Darin Adler.
2691
2692         When pagination mode is enabled, the full screen media will (depending on the width of the
2693         pagination columns) overflow its column, and hit testing will be clipped to the column. In extreme
2694         cases, where the column width < 0.5 * media element width, the media controls will be entirely
2695         unclickable.
2696
2697         Rather than making the RenderFullScreen a child of the full screen element's parent's renderer,
2698         make it a child of the RenderView, putting it outside of the columns entirely. Always create and
2699         insert the fullscreenRenderer's placeholder, using it as the remembered insertion point for the
2700         fullscreen element's renderer when we exit full screen.
2701
2702         Drive-by fix: don't wrap the full screen element's renderer in webkitWillEnterFullScreenForElement();
2703         it will just be re-wrapped in createRendererIfNeeded().
2704
2705         * dom/Document.cpp:
2706         (WebCore::Document::webkitWillEnterFullScreenForElement): Don't wrap the full screen element's renderer.
2707         (WebCore::Document::setFullScreenRenderer): Call setPlaceholderStyle.
2708         * rendering/RenderFullScreen.cpp:
2709         (WebCore::RenderFullScreenPlaceholder::willBeDestroyed): Call clearPlaceholder.
2710         (WebCore::RenderFullScreen::wrapRenderer): Make fullscreenRenderer a child of the view().
2711         (WebCore::RenderFullScreen::unwrapRenderer): Return the children to the parent of the placeholder().
2712         (WebCore::RenderFullScreen::clearPlaceholder): Renamed from setPlaceholder().
2713         (WebCore::RenderFullScreen::ensurePlaceholder): Added. 
2714         (WebCore::RenderFullScreen::setPlaceholderStyle): Renamed from createPlaceholder().
2715         (WebCore::RenderFullScreen::setPlaceholder): Deleted.
2716         (WebCore::RenderFullScreen::createPlaceholder): Deleted.
2717         * rendering/RenderFullScreen.h:
2718
2719 2014-04-16  Jer Noble  <jer.noble@apple.com>
2720
2721         [MSE] Multiple initialization segments with same codecs in tracks fail validation.
2722         https://bugs.webkit.org/show_bug.cgi?id=131768
2723
2724         Additional initialization segments added to the same SourceBuffer with the same
2725         codec values will fail validation. Update the validation check to add the correct
2726         codec information for the initial segment, and check against the correct codecs during
2727         the validation step.
2728
2729         Additionally, after validation, if successful update the Audio, Video, and TextTracks
2730         for the SourceBuffer with the updated initialization segment information.
2731
2732         Reviewed by Eric Carlson.
2733
2734         Test: media/media-source/media-source-multiple-initialization-segments.html
2735
2736         * Modules/mediasource/SourceBuffer.cpp:
2737         (WebCore::SourceBuffer::appendBufferTimerFired): m_source may have been cleared
2738             as a result of the append, so check it before using.
2739         (WebCore::SourceBuffer::sourceBufferPrivateDidEndStream): Call streamEndedWithError
2740             instead of endOfStream as the latter is safe to call within an update.
2741         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): Ditto.
2742             Update the track lists if validation succeeds.
2743         (WebCore::SourceBuffer::validateInitializationSegment): Switch the audio and video
2744             codec checks.
2745
2746         Add the ability for Audio, Video, and InbandTextTracks to replace their private tracks:
2747         * html/track/AudioTrack.cpp:
2748         (WebCore::AudioTrack::AudioTrack): Call updateKindFromPrivate().
2749         (WebCore::AudioTrack::setPrivate):
2750         (WebCore::AudioTrack::updateKindFromPrivate): Split out from constructor.
2751         * html/track/AudioTrack.h:
2752         * html/track/InbandTextTrack.cpp:
2753         (WebCore::InbandTextTrack::InbandTextTrack): Call updateKindFromPrivate().
2754         (WebCore::InbandTextTrack::setPrivate):
2755         (WebCore::InbandTextTrack::setMode): Split up into setModeInternal().
2756         (WebCore::InbandTextTrack::setModeInternal): Broke out from setMode().
2757         (WebCore::InbandTextTrack::updateKindFromPrivate): Split out from constructor.
2758         * html/track/InbandTextTrack.h:
2759         * html/track/TextTrack.h:
2760         (WebCore::TextTrack::isInband): Added, returns false.
2761         * html/track/VideoTrack.cpp:
2762         (WebCore::VideoTrack::VideoTrack): Call updateKindFromPrivate().
2763         (WebCore::VideoTrack::setPrivate):
2764         (WebCore::VideoTrack::updateKindFromPrivate):  Split out from constructor.
2765         * html/track/VideoTrack.h:
2766
2767 2014-04-17  David Hyatt  <hyatt@apple.com>
2768
2769         [New Multicolumn] Column sets below spanners don't repaint properly.
2770         https://bugs.webkit.org/show_bug.cgi?id=131778
2771
2772         Reviewed by Beth Dakin.
2773
2774         Added fast/repaint/spanner-with-margins.html.
2775
2776         * rendering/RenderBox.cpp:
2777         (WebCore::RenderBox::computeRectForRepaint):
2778         Turn off some code that was running for in-flow RenderFlowThreads that made no sense.
2779         I'm not convinced the code is right for other types of RenderFlowThreads either,
2780         but will leave that to the named flow thread experts. :)
2781
2782 2014-04-17  Koji Ishii  <kojishi@gmail.com>
2783
2784         Catch up ruby and its tag omission rule changes in HTML5 CR Feb 2014
2785         https://bugs.webkit.org/show_bug.cgi?id=131175
2786
2787         Reviewed by Darin Adler.
2788
2789         Tests: html5lib/resources/ruby.dat
2790                html5lib/resources/tests19.dat
2791
2792         This patch makes WebKit HTML parser to match to the tag omission rules of HTML5 CR Feb 2014:
2793         http://www.w3.org/TR/2014/CR-html5-20140204/syntax.html#syntax-tag-omission
2794         with the support for two new elements (rb, rtc) which were also defined in the spec:
2795         http://www.w3.org/TR/2014/CR-html5-20140204/text-level-semantics.html#the-rb-element
2796         http://www.w3.org/TR/2014/CR-html5-20140204/text-level-semantics.html#the-rtc-element
2797         to better support use cases presented by W3C I18N WG:
2798         http://www.w3.org/TR/ruby-use-cases/
2799
2800         * html/HTMLTagNames.in: rb and rtc added as HTMLElement interfaces.
2801         * html/parser/HTMLConstructionSite.cpp:
2802         (WebCore::hasImpliedEndTag): the spec says rb and rtc have implied end tags.
2803         * html/parser/HTMLTreeBuilder.cpp:
2804         (WebCore::HTMLTreeBuilder::processStartTagForInBody): rb and rtc added. rt excludes rtc from its implied end tags.
2805
2806 2014-04-17  Darin Adler  <darin@apple.com>
2807
2808         Try to fix EFL and GTK builds.
2809
2810         * workers/WorkerGlobalScope.idl: Touch file to make it rebuild, assuming that
2811         module dependencies aren't working right with CMake. Tweaked formatting quite a
2812         bit while I was in here.
2813
2814 2014-04-17  David Hyatt  <hyatt@apple.com>
2815
2816         [New Multicolumn] REGRESSION: Column set styles don't update when zooming etc.
2817         https://bugs.webkit.org/show_bug.cgi?id=131777
2818
2819         Reviewed by Enrica Casucci.
2820
2821         Added fast/multicol/zoom-test.html
2822
2823         * rendering/RenderBlockFlow.cpp:
2824         (WebCore::RenderBlockFlow::styleDidChange):
2825         Put back in the code that propagates new styles to the flow thread and column sets
2826         when styles change. This propagation was removed when the column span code landed.
2827         This patch puts it back in but qualifies the types of objects that get styles
2828         propagated to avoid accidentally propagating the wrong style to column spans.
2829
2830 2014-04-17  Darin Adler  <darin@apple.com>
2831
2832         Add separate flag for IndexedDatabase in workers since the current implementation is not threadsafe
2833         https://bugs.webkit.org/show_bug.cgi?id=131785
2834         rdar://problem/16003108
2835
2836         Reviewed by Brady Eidson.
2837
2838         * Configurations/FeatureDefines.xcconfig: Added INDEXED_DATABASE_IN_WORKERS.
2839
2840         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp: Use the new conditional
2841         instead of the old one.
2842         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h: Ditto.
2843         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl: Ditto.
2844
2845 2014-04-17  Dan Bernstein  <mitz@apple.com>
2846
2847         WebCore part of <rdar://problem/16601336> [Cocoa] _userInitiated is always NO in WKNavigationAction passed to -webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:
2848         https://bugs.webkit.org/show_bug.cgi?id=131783
2849
2850         Reviewed by Tim Horton.
2851
2852         * loader/NavigationAction.cpp:
2853         (WebCore::NavigationAction::NavigationAction): Initialize m_processingUserGesture to
2854         ScriptController::processingUserGesture() at the time the NavigationAction is constructed.
2855         * loader/NavigationAction.h:
2856         Added boolean member variable m_processionUserGesture
2857         (WebCore::NavigationAction::processingUserGesture): Added this getter.
2858
2859 2014-04-17  Ion Rosca  <rosca@adobe.com>
2860
2861         [CSS Blending] Isolation descendant dependent flags are not updated correctly
2862         https://bugs.webkit.org/show_bug.cgi?id=130892
2863
2864         Reviewed by Dean Jackson.
2865
2866         The isolation descendant dependent flag (m_hasUnisolatedBlendingDescendants)
2867         will help us to determine if a layer should isolate blending descendants or not.
2868         The m_hasUnisolatedBlendingDescendants flag should be set for layers that have blending descendant layers
2869         not isolated by descendant stacking contexts.
2870         An element isolatesBlending() if it has this flag set and creates stacking context.
2871
2872         Tests: css3/compositing/blend-mode-isolation-flags-append-non-stacking-context-blending.html
2873                css3/compositing/blend-mode-isolation-flags-append-stacking-context-blending.html
2874                css3/compositing/blend-mode-isolation-flags-remove-non-stacking-context-blending.html
2875                css3/compositing/blend-mode-isolation-flags-remove-stacking-context-blending.html
2876                css3/compositing/blend-mode-isolation-flags-turn-off-blending-no-isolation.html
2877                css3/compositing/blend-mode-isolation-flags-turn-off-blending.html
2878                css3/compositing/blend-mode-isolation-flags-turn-off-stacking-context.html
2879                css3/compositing/blend-mode-isolation-flags-turn-on-blending.html
2880                css3/compositing/blend-mode-isolation-flags-turn-on-stacking-context.html
2881
2882         * rendering/RenderLayer.cpp:
2883         (WebCore::RenderLayer::RenderLayer):
2884         (WebCore::RenderLayer::updateBlendMode):
2885         (WebCore::RenderLayer::updateAncestorChainHasBlendingDescendants):
2886             When a layer has blending and it hasn't had it before, we set the isolation
2887         flag for all its ancestors up to the first layer creating stacking context.
2888         I removed the isComposited() check here. Isolation flags should be correct regardless
2889         of compositing state. Moreover, if this method is called from styleChanged(),
2890         the compositing state might not be accurate, it's going to be recalculated afterwards.  
2891         (WebCore::RenderLayer::dirtyAncestorChainHasBlendingDescendants):
2892             When a layer doesn't have blending, but it used to have it before, we mark
2893         the isolation flag as dirty for all its ancestors up to the first layer
2894         creating stacking context. The isolation flags will be recalculated by
2895         RenderLayer::updateDescendantDependentFlags.
2896         (WebCore::RenderLayer::updateDescendantDependentFlags):
2897             Evaluates if the layer has unisolated blending descendants by traversing
2898         the layer subtree.
2899         (WebCore::RenderLayer::addChild):
2900             When adding a subtree that has blending or has some unisolated descendants,
2901         we set the flag for all the ancestors, up to the stacking context layer.
2902         (WebCore::RenderLayer::removeChild):
2903             When removing a subtree that had blending or had some unisolated descendants,
2904         we dirty the flag so that it could be reevaluated.
2905         (WebCore::RenderLayer::calculateClipRects):
2906         (WebCore::RenderLayer::updateTransform):
2907         * rendering/RenderLayer.h:
2908             Rename m_hasBlendedElementInChildStackingContext => m_hasUnisolatedBlendingDescendants
2909         and m_hasBlendedElementInChildStackingContextStatusDirty => m_hasUnisolatedBlendingDescendantsStatusDirty,
2910         * rendering/RenderLayerCompositor.cpp:
2911         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2912             Add an assert to make sure that if m_hasUnisolatedCompositedBlendingDescendants is true,
2913         then m_hasUnisolatedBlendingDescendants is true as well.
2914
2915 2014-04-17  Tim Horton  <timothy_horton@apple.com>
2916
2917         Uninline blend(Color, Color) to get AnimationUtilities out of Color.h
2918         https://bugs.webkit.org/show_bug.cgi?id=131781
2919
2920         Reviewed by Simon Fraser.
2921
2922         * platform/graphics/Color.cpp:
2923         (WebCore::blend):
2924         Un-inline.
2925
2926         * platform/graphics/Color.h:
2927         No more AnimationUtilities.
2928
2929 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
2930
2931         Fix the build after r167412
2932
2933         * platform/ScrollView.cpp:
2934         (WebCore::ScrollView::updateScrollbars):
2935
2936 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
2937
2938         [iOS][WK2] Fix annoying scrolling bugs
2939         https://bugs.webkit.org/show_bug.cgi?id=131722
2940
2941         Reviewed by Simon Fraser.
2942
2943         * platform/ScrollView.cpp:
2944         (WebCore::ScrollView::updateScrollbars):
2945         Since ScrollingStateScrollingNode::setRequestedScrollPosition() was added, we see ScrollView::updateScrollbars()
2946         keep changing the scroll position to incorrect values.
2947
2948         On iOS, the scrollbars are handled by the native UI, the code just compute incorrect scroll position. On WebKit1,
2949         the code does not run because there is a platformWidget().
2950
2951         Just #ifdef the whole useless code.
2952
2953 2014-04-16  Alexandru Chiculita  <achicu@adobe.com>
2954
2955         Improve performance of the RenderLayerCompositor::OverlapMap
2956         https://bugs.webkit.org/show_bug.cgi?id=115063
2957
2958         Reviewed by Simon Fraser.
2959
2960         No new tests, no new functionality or behavior.
2961
2962         Do not use the OverlapMap in RenderLayerCompositor::computeCompositingRequirements if the layer already
2963         has a 3D transform. This way we can avoid a potential expensive lookups when we know for sure the layer
2964         is already supposed to be composited. 
2965
2966         Also, added a bounding box of the overlap map, so that it can catch cases when the new layer is not overlapping
2967         any of the previous layers. This is pretty common when having composited layers laid out in a vertical/horizontal list.
2968
2969
2970         * rendering/RenderLayerCompositor.cpp:
2971         (OverlapMapContainer):
2972         (WebCore::OverlapMapContainer::add):
2973         (WebCore::OverlapMapContainer::overlapsLayers):
2974         (WebCore::OverlapMapContainer::unite):
2975         (WebCore):
2976         (WebCore::RenderLayerCompositor::OverlapMap::add):
2977         (WebCore::RenderLayerCompositor::OverlapMap::overlapsLayers):
2978         (WebCore::RenderLayerCompositor::OverlapMap::pushCompositingContainer):
2979         (WebCore::RenderLayerCompositor::OverlapMap::popCompositingContainer):
2980         (RenderLayerCompositor::OverlapMap):
2981         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2982
2983 2014-04-16  Brian J. Burg  <burg@cs.washington.edu>
2984
2985         Web Replay: memoize fallback time values for document.lastModified
2986         https://bugs.webkit.org/show_bug.cgi?id=131318
2987
2988         Reviewed by Joseph Pecoraro.
2989
2990         If a document's Last-Modified header can't be found or used, then 
2991         document.lastModified is derived from the current system time or
2992         from filesystem data, which is obviously nondeterministic.
2993
2994         It's better to handle this inside Document::lastModified rather than using
2995         MemoizedDOMResult, because only the fallback case is nondeterministic.
2996
2997         Test: http/tests/inspector/replay/document-last-modified-fallback-value.html
2998
2999         The test is skipped for now, as it will be very flaky without the
3000         functionality introduced by bugs 130728 and 129391.
3001
3002         * dom/Document.cpp:
3003         (WebCore::Document::lastModified): Save or reuse memoized fallback value.
3004         * replay/WebInputs.json: Add input DocumentLastModifiedDate.
3005
3006 2014-04-16  David Hyatt  <hyatt@apple.com>
3007
3008         [New Multicolumn] Selection gets confused when the mouse is in the column gaps.
3009         https://bugs.webkit.org/show_bug.cgi?id=131739
3010
3011         Reviewed by Enrica Casucci.
3012
3013         * rendering/RenderBlock.cpp:
3014         (WebCore::RenderBlock::selectionGaps):
3015         Make sure not to paint selection gaps. This matches the old multi-column behavior. Even though
3016         selection gaps *nearly* work with the new multi-column code, I am disabling them so that we
3017         can turn them on without visual regressions.
3018         
3019         (WebCore::isChildHitTestCandidate):
3020         Don't allow in-flow RenderFlowThreads to be descended into from positionForPoint. We always want
3021         to look only at the spanners and at the sets.
3022
3023         * rendering/RenderMultiColumnFlowThread.cpp:
3024         (WebCore::RenderMultiColumnFlowThread::nodeAtPoint):
3025         * rendering/RenderMultiColumnFlowThread.h:
3026         Override nodeAtPoint to disallow the RenderMultiColumnFlowThread from being considered for hit
3027         testing when no DOM node is found. It's better to just let RenderBlock's positionForPoint run
3028         to drill back down into the appropriate column set.
3029
3030         * rendering/RenderMultiColumnSet.cpp:
3031         (WebCore::RenderMultiColumnSet::positionForPoint):
3032         Implement positionForPoint for RenderMultiColumnSets. This is a straight-up port of the
3033         old multi-column code's adjustPointToColumnContents function.
3034
3035         * rendering/RenderMultiColumnSet.h:
3036         Add override of positionForPoint.
3037
3038 2014-04-16  Dean Jackson  <dino@apple.com>
3039
3040         MediaDocument on iOS should be full page
3041         https://bugs.webkit.org/show_bug.cgi?id=131774
3042
3043         Reviewed by Jer Noble.
3044
3045         A MediaDocument on iOS has two problems. It can't rely
3046         on intrinsic size, since it doesn't load the content until
3047         a user gesture. Secondly, on a small screen you want the
3048         media to fill the page.
3049
3050         Add width/height 100% for iOS documents.
3051
3052         Test: platform/iphone-simulator/media/media-document-controls-size.html
3053
3054         * html/MediaDocument.cpp:
3055         (WebCore::MediaDocumentParser::createDocumentStructure):
3056
3057 2014-04-16  Roger Fong  <roger_fong@apple.com>
3058
3059         Add a way for layout tests to determine whether or not a plugin is snapshotted.
3060         https://bugs.webkit.org/show_bug.cgi?id=131650.
3061         <rdar://problem/16615528>
3062
3063         Reviewed by Dean Jackson.
3064
3065         * testing/Internals.cpp:
3066         (WebCore::Internals::isPluginSnapshotted):
3067         * testing/Internals.h:
3068         * testing/Internals.idl:
3069
3070 2014-04-16  Zoltan Horvath  <zoltan@webkit.org>
3071
3072         Vanish unnecessary includes from Shapes.{h|cpp}
3073         https://bugs.webkit.org/show_bug.cgi?id=131762
3074
3075         Reviewed by Andreas Kling.
3076
3077         No new tests, no behavior change.
3078
3079         * rendering/shapes/BoxShape.h:
3080         * rendering/shapes/Shape.cpp:
3081         * rendering/shapes/Shape.h:
3082         * rendering/shapes/ShapeOutsideInfo.h:
3083
3084 2014-04-16  Andreas Kling  <akling@apple.com>
3085
3086         Revert direct caching of tagName and nodeName from r167383.
3087
3088         Ryosuke tells me this is not entirely safe, will need to rethink.
3089
3090         * dom/Element.idl:
3091         * dom/Node.idl:
3092
3093 2014-04-16  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
3094
3095         Improve security mitigation added in webkit r94001.
3096         We missed the case where attachLine was called when we already had an inline box wrapper.
3097         https://bugs.webkit.org/show_bug.cgi?id=127285
3098
3099         Reviewed by Brent Fulgham.
3100
3101         Merged from Blink: https://src.chromium.org/viewvc/blink?revision=150697&view=revision
3102
3103         * rendering/RenderBox.cpp:
3104         (WebCore::RenderBox::positionLineBox):
3105         * rendering/RenderBox.h:
3106         (WebCore::RenderBox::setInlineBoxWrapper):
3107
3108 2014-04-16  Bem Jones-Bey  <bjonesbe@adobe.com>
3109
3110         Fix CodeGenerator.pm to only write files if the generated content has changed
3111         https://bugs.webkit.org/show_bug.cgi?id=131756
3112
3113         Reviewed by Sam Weinig.
3114
3115         To improve build speed, don't touch generated files unless the newly
3116         generated content is actually different.
3117
3118         * bindings/scripts/CodeGenerator.pm:
3119         (UpdateFile):
3120
3121 2014-04-16  Andreas Kling  <akling@apple.com>
3122
3123         Add a way to cache never-changing IDL attributes in the wrapper.
3124         <https://webkit.org/b/131759>
3125
3126         Some IDL attributes will always return the same value when queried
3127         on an object, so let's have a way to avoid calling into C++ code
3128         every time they are queried.
3129
3130         This patch adds a custom IDL thingy called "ReturnsCacheableValue"
3131         which causes the code generator to emit code to cache the returned
3132         value directly in the JS wrapper object.
3133
3134         Reviewed by Oliver Hunt.
3135
3136         * bindings/scripts/IDLAttributes.txt:
3137         * bindings/scripts/CodeGeneratorJS.pm:
3138         (GenerateImplementation):
3139
3140             Add ReturnsCacheableValue custom attribute.
3141
3142         * dom/Element.idl:
3143         * dom/Node.idl:
3144
3145             Annotate some attributes that return fully cacheable values.
3146
3147         * bindings/scripts/test/*:
3148
3149             Rebaseline.
3150
3151 2014-04-16  Noel Gordon  <noel.gordon@gmail.com>
3152
3153         Progressive JPEG outputScanlines() calls should handle failure
3154         https://bugs.webkit.org/show_bug.cgi?id=116701
3155
3156         Reviewed by Brent Fulgham.
3157
3158         outputScanlines() can fail and delete |this|. Copy the decoder pointer
3159         member and use that copy to detect and handle the failure case.
3160
3161         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
3162         (WebCore::JPEGImageReader::decode):
3163
3164 2014-04-16  Robert Sipka  <sipka@inf.u-szeged.hu>
3165
3166         [curl] Add WEB_TIMING support
3167         https://bugs.webkit.org/show_bug.cgi?id=127555
3168
3169         Reviewed by Brent Fulgham.
3170
3171         Access timing information related to navigation.
3172
3173         * platform/network/curl/ResourceHandleManager.cpp:
3174         (WebCore::milisecondsSinceRequest):
3175         (WebCore::calculateWebTimingInformations):
3176         (WebCore::sockoptfunction):
3177         (WebCore::headerCallback):
3178         (WebCore::ResourceHandleManager::downloadTimerCallback):
3179         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
3180         (WebCore::ResourceHandleManager::initializeHandle):
3181
3182 2014-04-16  Zoltan Horvath  <zoltan@webkit.org>
3183
3184         Cleanup header includes in ShapeOutsideInfo.h
3185         https://bugs.webkit.org/show_bug.cgi?id=131750
3186
3187         Reviewed by Antti Koivisto.
3188
3189         Make the build faster by removing unnecessary header includes.
3190
3191         No new tests, no behavior change.
3192
3193         * rendering/shapes/ShapeOutsideInfo.h:
3194
3195 2014-04-16  Simon Fraser  <simon.fraser@apple.com>
3196
3197         Fix the iOS build.
3198
3199         * platform/graphics/cg/BitmapImageCG.cpp:
3200         (WebCore::BitmapImage::draw):
3201
3202 2014-04-16  Alexey Proskuryakov  <ap@apple.com>
3203
3204         DataTransfer should cache its FileList
3205         https://bugs.webkit.org/show_bug.cgi?id=131694
3206
3207         Reviewed by Darin Adler.
3208
3209         Test: fast/events/data-transfer-files-attribute-identity.html
3210
3211         * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readTerminal):
3212         Switched to a new FileList constructor, CloneDeserializer doesn't really need to modify
3213         the FileList with append().
3214
3215         * dom/DataTransfer.h:
3216         * dom/DataTransfer.cpp:
3217         (WebCore::DataTransfer::types): Added a FIXME.
3218         (WebCore::DataTransfer::files): Changed to reuse a cached FileList. It's currently
3219         easy, because we don't support DataTransferItemList. Once we do, making any changes
3220         through it will also require updating the FileList in a way that doesn't replace
3221         File objects for unchanged files.
3222
3223         * fileapi/FileList.h:
3224         (WebCore::FileList::create):
3225         (WebCore::FileList::isEmpty):
3226         (WebCore::FileList::FileList):
3227         (WebCore::FileList::append):
3228         (WebCore::FileList::clear):
3229         Made non-const functions private, because neither DataTransfer nor FileInputType
3230         expect the list to be modified without their knowledge. Added a new Vector based
3231         constructor so that a FileList could be created without the use of append().
3232
3233         * html/FileInputType.cpp: (WebCore::FileInputType::createFileList): Simplified
3234         the code a little bit. FileInputType still needs to modify the list for clear(),
3235         but doesn't need to add to it dynamically - unlike with DataTransfer, it's expected
3236         to create a new FileList when it's modified.
3237
3238 2014-04-15  Brent Fulgham  <bfulgham@apple.com>
3239
3240         [Win] Eliminate use of deleteAllValues in Windows Files
3241         https://bugs.webkit.org/show_bug.cgi?id=131631
3242
3243         Reviewed by Darin Adler.
3244
3245         Update to use std::unique_ptr for object lifetime. Get rid of
3246         deleteAllValues now that it is no loner needed. Use ranged for
3247         loops where possible.
3248
3249         * platform/win/WCDataObject.cpp:
3250         (WebCore::WCEnumFormatEtc::WCEnumFormatEtc):
3251         (WebCore::WCDataObject::~WCDataObject):
3252         (WebCore::WCDataObject::GetData):
3253         (WebCore::WCDataObject::QueryGetData):
3254         (WebCore::WCDataObject::SetData):
3255         (WebCore::WCDataObject::clearData):
3256         * platform/win/WCDataObject.h:
3257
3258 2014-04-16  Chris Fleizach  <cfleizach@apple.com>
3259
3260         AX: Accessing a table cell with an invalid column header crashes
3261         https://bugs.webkit.org/show_bug.cgi?id=131719
3262
3263         Reviewed by Darin Adler.
3264
3265         If no tableCell is available as a column/row header, then do not continue processing.
3266
3267         Test: accessibility/table-missing-column-header-crash.html
3268
3269         * accessibility/AccessibilityTableCell.cpp:
3270         (WebCore::AccessibilityTableCell::columnHeaders):
3271         (WebCore::AccessibilityTableCell::rowHeaders):
3272
3273 2014-04-16  Brendan Long  <b.long@cablelabs.com>
3274
3275         [GTK] Fix unused parameter warnings
3276         https://bugs.webkit.org/show_bug.cgi?id=131721
3277
3278         Reviewed by Darin Adler.
3279
3280         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
3281         (WebCore::toJS): Remove unused 'exec' parameter.
3282
3283 2014-04-16  Simon Fraser  <simon.fraser@apple.com>
3284
3285         Convert the boolean param of Image::startAnimation() to an enum
3286         https://bugs.webkit.org/show_bug.cgi?id=131742
3287
3288         Reviewed by Tim Horton.
3289
3290         Use an enum to make the code more readable.
3291
3292         * platform/graphics/BitmapImage.cpp:
3293         (WebCore::BitmapImage::startAnimation):
3294         * platform/graphics/BitmapImage.h:
3295         * platform/graphics/Image.cpp:
3296         (WebCore::Image::drawTiled):
3297         * platform/graphics/Image.h:
3298         (WebCore::Image::startAnimation):
3299         * svg/graphics/SVGImage.cpp:
3300         (WebCore::SVGImage::startAnimation):
3301         * svg/graphics/SVGImage.h:
3302
3303 2014-04-16  David Hyatt  <hyatt@apple.com>
3304
3305         Make sure to skip the RenderMultiColumnFlowThread when resolving percentage heights inside columns against
3306         containing blocks. The flow thread's auto height should not interfere if a fixed height is specified on
3307         an ancestor.
3308
3309         https://bugs.webkit.org/show_bug.cgi?id=131741
3310
3311         Reviewed by Simon Fraser.
3312
3313         Added fast/multicol/percent-height.html.
3314
3315         * rendering/RenderBox.cpp:
3316         (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
3317         Add an isInFlowRenderFlowThread check so that we skip those blocks and don't consider them at all
3318         when resolving percentage heights.
3319
3320 2014-04-16  Daewoong Jang  <daewoong.jang@navercorp.com>
3321
3322         [WinCairo][cURL] Build fix for WinCairo build with USE(CURL).
3323         https://bugs.webkit.org/show_bug.cgi?id=131614
3324
3325         Reviewed by Brent Fulgham.
3326
3327         Build fix, no new tests needed.
3328
3329         * platform/network/curl/CurlCacheEntry.cpp:
3330         (WebCore::CurlCacheEntry::loadResponseHeaders):
3331         * platform/network/curl/CurlCacheManager.cpp:
3332         (WebCore::CurlCacheManager::loadIndex):
3333         * platform/network/soup/ResourceError.h:
3334         * platform/network/soup/SocketStreamHandle.h:
3335
3336 2014-04-16  Martin Hodovan  <mhodovan@inf.u-szeged.hu>
3337
3338         ASSERTION FAILED: x2 >= x1 in WebCore::RenderObject::drawLineForBoxSide
3339         https://bugs.webkit.org/show_bug.cgi?id=127835
3340
3341         In some cases when a negative margin and a positive padding are applied
3342         together to the right and/or left side of the box, the logical width of
3343         the borders can be set to a negative value, making the assertion fire.
3344         The fix checks if the width or height of the box is negative, and if so,
3345         it will not display the borders and shadows of the box.
3346
3347         Reviewed by Darin Adler.
3348
3349         Test: fast/css/padding-margin-negative-border.html
3350
3351         * rendering/RenderBoxModelObject.cpp:
3352         (WebCore::RenderBoxModelObject::paintBorder):
3353
3354 2014-04-16  Jer Noble  <jer.noble@apple.com>
3355
3356         [MSE] Seeks into buffered ranges will never complete.
3357         https://bugs.webkit.org/show_bug.cgi?id=131717
3358
3359         Reviewed by Eric Carlson.
3360
3361         Test: media/media-source/media-source-seek-complete.html
3362
3363         Run the SourceBuffer Monitoring step after initiating a seek.
3364
3365         * Modules/mediasource/SourceBuffer.cpp:
3366         (WebCore::SourceBuffer::sourceBufferPrivateSeekToTime):
3367
3368 2014-04-15  Hyowon Kim  <hw1008.kim@samsung.com>
3369
3370         [EFL] Fix problems with the pixel dump.
3371         https://bugs.webkit.org/show_bug.cgi?id=131265
3372
3373         Reviewed by Gyuyoung Kim.
3374
3375         Painting and compositing paths of WebKit-EFL were totally modified from r166768.
3376         However pixel dump codes still call deprecated functions like ewk_view_paint(),
3377         which causes that nothing is drawn.
3378
3379         This patch adds new member functions to AcceleratedCompositingContext to support pixel dump.
3380         One of new functions is AcceleratedCompositingContext::extractImageData(),
3381         which replaces deprecated function calls. Besides the extractImageData() is invoked by
3382         ewk_view_screenshot_contents_get() in order to take the visible content displayed on the EFL webview.
3383
3384         * platform/graphics/cairo/CairoUtilities.cpp:
3385         (WebCore::flipImageSurfaceVertically): Flip pixel data of given cairo_surface_t vertically up/down.
3386         Whereas Cairo uses the top-left corner as being 0,0 of the coordinate system,
3387         OpenGL uses the bottom-left corner being 0,0.
3388         So we need to vertically flip resultant images taken by glReadPixels().
3389         * platform/graphics/cairo/CairoUtilities.h:
3390
3391 2014-04-15  Hyowon Kim  <hw1008.kim@samsung.com>
3392
3393         Make page overlay functionality working on coordinated graphics.
3394         https://bugs.webkit.org/show_bug.cgi?id=131425
3395
3396         Reviewed by Darin Adler.
3397
3398         Page overlay functionality did not work on coordinated graphics since r166975.
3399         This patch removes deprecated code related to the PageOverlay GraphicsLayer management.
3400         and makes CoordinatedLayerTreeHost use PageOverlayController.
3401
3402         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
3403         (WebCore::CompositingCoordinator::setRootCompositingLayer):
3404         (WebCore::CompositingCoordinator::flushPendingLayerChanges):
3405         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
3406
3407 2014-04-10  Roger Fong  <roger_fong@apple.com>
3408
3409         Snapshotted plugins may need to be restarted if style properties are changed after initial load of plugin.
3410         https://bugs.webkit.org/show_bug.cgi?id=131553.
3411         <rdar://problem/15443375>
3412
3413         Reviewed by Timothy Horton.
3414
3415         Test: plugins/snapshotting/set-plugin-size-to-tiny.html
3416
3417         When updating embedded objects during our post layout checks, check for certain style changes
3418         that may result in the plugin needing to be restarted.
3419
3420         * html/HTMLPlugInImageElement.h: 
3421         Add m_plugInDimensionsSpecified field to keep track of whether or not dimensions on the plugin’s renderer have been specified.
3422         * html/HTMLPlugInImageElement.cpp:
3423         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
3424         Initialize m_plugInDimensionsSpecified.
3425         (WebCore::isSmallerThanTinySizingThreshold):
3426         Refactoring, move check for whether or not plugin is smaller than the tiny plugin size threshold to this method.
3427         (WebCore::HTMLPlugInImageElement::isTopLevelFullPage): 
3428         Refactoring, move check for whether or not plugin is top level full page to this method.
3429         (WebCore::HTMLPlugInImageElement::checkSnapshotStatus): 
3430         Use refactored checks here as well to determine whether or not we need to restart the snapshotted plugin.
3431         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Use refactored checks.
3432         If plugin dimensions were specified, set m_plugInDimensionsSpecified to true.
3433
3434 2014-04-15  Andreas Kling  <akling@apple.com>
3435
3436         [iOS WebKit2] Listen for system memory pressure notifications.
3437         <https://webkit.org/b/131653>
3438         <rdar://problem/16208123>
3439
3440         Reviewed by Antti Koivisto.
3441
3442         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3443         (WebCore::MemoryPressureHandler::install):
3444
3445             Use the right invocation to summon the memory pressure handler.
3446
3447       &nbs