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