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