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