0945ab5b7c06688f03ba3bdfde12c5d3287bd76b
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-05-22  Manuel Rego Casasnovas  <rego@igalia.com>
2
3         [CSS Grid Layout] Guard RenderObject::isRenderGrid() method
4         https://bugs.webkit.org/show_bug.cgi?id=132380
5
6         Reviewed by Benjamin Poulain.
7
8         Guard RenderObject::isRenderGrid() method under ENABLE_CSS_GRID_LAYOUT compilation flag.
9
10         * rendering/RenderBox.cpp:
11         (WebCore::RenderBox::computeLogicalWidthInRegion):
12         * rendering/RenderObject.h:
13
14 2014-05-21  Antti Koivisto  <antti@apple.com>
15
16         REGRESSION(r167870): Crash in simple line layout code with :after
17         https://bugs.webkit.org/show_bug.cgi?id=133155
18         <rdar://problem/16977696>
19
20         Reviewed by Darin Adler.
21         
22         Fix https://bugs.webkit.org/show_bug.cgi?id=132241 in a safer way.
23         The underline behavior is tested by the existing fast/text/simple-lines-hover-underline.html
24
25         Test: fast/text/simple-lines-hover-after.html
26
27         * rendering/RenderBlock.cpp:
28         (WebCore::RenderBlock::invalidateLineLayoutPath): Deleted.
29
30             Move to RenderBlockFlow.
31
32         * rendering/RenderBlock.h:
33         (WebCore::RenderBlock::invalidateLineLayoutPath):
34         * rendering/RenderBlockFlow.cpp:
35         (WebCore::RenderBlockFlow::styleDidChange):
36         
37             Invalidate layout if style changes in a manner that makes us ineligible to use the simple line layout path.
38
39         (WebCore::RenderBlockFlow::invalidateLineLayoutPath):
40         
41             Drop the simple line layout on path invalidation if it exists. It may not be valid anymore.
42             Also invalidate the layout if this happens so we'll reconstruct the lines later.
43
44         (WebCore::RenderBlockFlow::simpleLineLayout): Deleted.
45         (WebCore::RenderBlockFlow::ensureLineBoxes):
46         (WebCore::RenderBlockFlow::createLineBoxes): Deleted.
47                 
48             Revert some of the changes made it r167870.
49
50         * rendering/RenderBlockFlow.h:
51         (WebCore::RenderBlockFlow::simpleLineLayout):
52         
53             Add strong validity assert.
54
55 2014-05-21  Eric Carlson  <eric.carlson@apple.com>
56
57         [iOS] two media control button strings are not localized
58         https://bugs.webkit.org/show_bug.cgi?id=133160
59
60         Reviewed by Geoffrey Garen.
61
62         * English.lproj/mediaControlsLocalizedStrings.js:
63
64 2014-05-21  Dean Jackson  <dino@apple.com>
65
66         [iOS] Update some of the media controls buttons to be bigger
67         https://bugs.webkit.org/show_bug.cgi?id=133158
68         <rdar://problem/16475828>
69
70         Reviewed by Simon Fraser.
71
72         The buttons in the media controls on iOS are too small
73         to be comfortably pressed. Make them the size of the controls
74         panel and the expected iOS button size (44x44px).
75
76         The artwork for the buttons now includes the padding. I've
77         added a file from which you can edit the artwork, then
78         copy it into the CSS (because editing directly in CSS is
79         a huge pain).
80
81         So far just the play/pause and fullscreen button have been
82         updated. There will be a follow-up patch to fix the remaining
83         buttons and the scrubber.
84
85         * Modules/mediacontrols/assets-apple-iOS.svg: Added.
86         * Modules/mediacontrols/mediaControlsiOS.css:
87         (audio::-webkit-media-controls-panel):
88         (audio::-webkit-media-controls-fullscreen-button):
89         (audio::-webkit-media-controls-play-button):
90         (audio::-webkit-media-controls-play-button:active):
91         (audio::-webkit-media-controls-play-button.paused):
92         (audio::-webkit-media-controls-fullscreen-button:active):
93         (@media only screen and (-webkit-min-device-pixel-ratio: 2)): Deleted.
94
95 2014-05-21  Zalan Bujtas  <zalan@apple.com>
96
97         Garbage when rubber-banding at the right edge of a page zoomed to non-integral scale.
98         https://bugs.webkit.org/show_bug.cgi?id=133139
99         <rdar://problem/16503353>
100
101         Reviewed by Simon Fraser.
102
103         Do not pixel align the root content layer. The alignment code expands the graphics's layer size
104         which makes the right and bottom tiles bigger than the content.
105         Painting the body's background color produces pixel cracks, because the content can not
106         fill the expanded tiles completely.
107
108         Not testable.
109
110         * platform/graphics/GraphicsLayerClient.h:
111         (WebCore::GraphicsLayerClient::needsPixelAligment):
112         * platform/graphics/ca/GraphicsLayerCA.cpp:
113         (WebCore::GraphicsLayerCA::updateGeometry):
114         (WebCore::GraphicsLayerCA::computePixelAlignment):
115         * platform/graphics/ca/mac/TileGrid.mm:
116         (WebCore::TileGrid::rectForTileIndex):
117         * rendering/RenderLayerBacking.cpp:
118         (WebCore::RenderLayerBacking::needsPixelAligment):
119         * rendering/RenderLayerBacking.h:
120
121 2014-05-21  Radu Stavila  <stavila@adobe.com>
122
123         REGRESSION (r168046): Invalid layout in WebCore::RenderBox::containingBlockLogicalWidthForPositioned
124         https://bugs.webkit.org/show_bug.cgi?id=132933
125
126         Reviewed by Darin Adler.
127
128         Invalid layout is performed when calling containingBlockLogicalWidthForPositioned for a RenderTableSection object.
129
130         Test: fast/multicol/newmulticol/table-section-crash.html
131
132         * rendering/RenderBox.cpp:
133         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
134
135 2014-05-21  Simon Pena  <simon.pena@samsung.com>
136
137         [EFL] Ensure EGLOffScreenContext::initialize calls platformMakeCurrent on the surface
138         https://bugs.webkit.org/show_bug.cgi?id=124832
139
140         Reviewed by Antonio Gomes.
141
142         The original code was only calling platformMakeCurrent when the
143         GL_EXT_robustness extension is supported: the alternate code path
144         would only create a context, but it wouldn't make that context
145         current. This patch ensures platformMakeCurrent is also called for
146         the alternate code path, and, if it fails to make the context
147         current, will destroy the context. Effectively, this makes both
148         code paths behave in the same way.
149
150         * platform/graphics/surfaces/egl/EGLContext.cpp:
151         (WebCore::EGLOffScreenContext::initialize):
152
153 2014-05-20  Brent Fulgham  <bfulgham@apple.com>
154
155         [Mac] DataCues do not work properly when rewinding video
156         https://bugs.webkit.org/show_bug.cgi?id=133138
157         <rdar://problem/16979086>
158
159         Reviewed by Eric Carlson.
160
161         Make the TrackPrivateBase responsible for knowing if a type of track needs a non-zero
162         startTimeVariance value.
163
164         Also, correct a bug in the equality test for DataCue objects.
165
166         * html/track/DataCue.cpp:
167         (WebCore::DataCue::isEqual): Handle the JSValue data types consistently, so that we don't attempt
168         to compare a JSNull against a default JSValue object.
169         * html/track/InbandTextTrack.cpp:
170         (WebCore::InbandTextTrack::startTimeVariance): Added.
171         * html/track/InbandTextTrack.h:
172         * html/track/TextTrack.cpp:
173         (WebCore::TextTrack::hasCue): Use new startTimeVariance method location.
174         * html/track/TextTrack.h:
175         (WebCore::TextTrack::startTimeVariance): Added.
176         * html/track/TextTrackCue.cpp:
177         (WebCore::TextTrackCue::hasEquivalentStartTime): Use new startTimeVariance location.
178         * html/track/TextTrackCue.h:
179         (WebCore::TextTrackCue::startTimeVariance): Deleted.
180         * html/track/TextTrackCueGeneric.h:
181         * platform/graphics/TrackPrivateBase.h:
182         (WebCore::TrackPrivateBase::startTimeVariance): Added.
183         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
184
185 2014-05-20  Mark Hahnenberg  <mhahnenberg@apple.com>
186
187         Watchdog timer should be lazily allocated
188         https://bugs.webkit.org/show_bug.cgi?id=133135
189
190         Reviewed by Geoffrey Garen.
191
192         No new tests.
193
194         We incur a noticeable amount of overhead on some benchmarks due to checking if the Watchdog ever fired. 
195         There is no reason to do this checking if we never activated the Watchdog, which can only be done through 
196         JSContextGroupSetExecutionTimeLimit or JSContextGroupClearExecutionTimeLimit. 
197
198         By allocating the Watchdog lazily on the VM we can avoid all of the associated overhead when we don't use 
199         these two API functions (which is true of most clients).
200
201         * bindings/js/JSEventListener.cpp:
202         (WebCore::JSEventListener::handleEvent):
203         * bindings/js/WorkerScriptController.cpp:
204         (WebCore::WorkerScriptController::evaluate):
205         (WebCore::WorkerScriptController::scheduleExecutionTermination):
206         (WebCore::WorkerScriptController::isExecutionTerminating):
207
208 2014-05-20  Dean Jackson  <dino@apple.com>
209
210         [Mac] Allow popup menus to override default appearance
211         https://bugs.webkit.org/show_bug.cgi?id=133129
212
213         Reviewed by Tim Horton.
214
215         WebKitSystemInterface's WKPopupMenu has a flag to hide
216         the arrows at the end of a popup-menu (e.g. <select>).
217         Expose that via adding a hasDefaultAppearance flag to
218         PopupMenuStyle, which then passes it on to WKSI.
219
220         * platform/PopupMenuStyle.h:
221         (WebCore::PopupMenuStyle::PopupMenuStyle): New flag in constructor.
222         (WebCore::PopupMenuStyle::hasDefaultAppearance): New flag.
223         * platform/mac/WebCoreSystemInterface.h: wkPopupMenu signature has changed to accept
224         the new flag.
225         * platform/mac/WebCoreSystemInterface.mm: Ditto.
226         * rendering/RenderMenuList.cpp:
227         (RenderMenuList::itemStyle): Pass in true as default appearance when creating
228         the PopupMenuStyle. We don't need it.
229         (RenderMenuList::menuStyle): In this case we pass in the negated value of
230         style().hasAppearance(), which indicates if we are overriding the built-in drawing.
231         * rendering/RenderSearchField.cpp:
232         (WebCore::RenderSearchField::menuStyle): Use true as the default value.
233
234 2014-05-20  Eric Carlson  <eric.carlson@apple.com>
235
236         [Mac] do not deactivate an audio session that has running I/O
237         https://bugs.webkit.org/show_bug.cgi?id=133127
238
239         Reviewed by Jer Noble.
240
241         * page/Settings.h:
242         (WebCore::Settings::setShouldManageAudioSessionCategory): Renamed from setShouldManageAudioSession.
243         (WebCore::Settings::shouldManageAudioSessionCategory): Renamed from shouldManageAudioSession.
244         (WebCore::Settings::setShouldManageAudioSession): Deleted.
245         (WebCore::Settings::shouldManageAudioSession): Deleted.
246
247         * platform/audio/mac/MediaSessionManagerMac.cpp:
248         (MediaSessionManager::updateSessionState): Don't deactivate the session if there are any
249             Video or Audio sessions.
250
251         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
252         (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus): Drive-by change to log errors 
253             returned by -statusOfValueForKey:error: in debug builds.
254
255 2014-05-20  Beth Dakin  <bdakin@apple.com>
256
257         REGRESSION: All non-mainframe scrollbars don't paint after r169065
258         https://bugs.webkit.org/show_bug.cgi?id=133132
259         -and corresponding-
260         <rdar://problem/16968850>
261
262         Reviewed by Geoff Garen.
263
264         We should not universally return true here. This feature will only work for 
265         scrollbars with layers.
266         * platform/ScrollableArea.h:
267         * platform/Scrollbar.cpp:
268         (WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
269
270 2014-05-20  Daniel Bates  <dabates@apple.com>
271
272         Element within flattened frame may update its scroll state during the layout phase of the wrong RenderView
273         https://bugs.webkit.org/show_bug.cgi?id=133013
274         <rdar://problem/16760154>
275
276         Reviewed by David Hyatt.
277
278         Fixes an issue where the scroll state of an element may be updated during the layout of the wrong
279         RenderView. In particular, the scroll state of an element inside a CSS flex box in a flattened
280         frame f is updated during the layout of the RenderView associated with the parent frame of f instead
281         of during the layout of the RenderView associated with f.
282
283         The layout machinery assumes that the scroll state of each scrollable element is updated before the
284         completion of layout for its associated RenderView. Currently we have logic to defer updating the scroll
285         state of a scrollable element until completion of recursive layout. For a page with a flattened frame, we
286         defer such updates until completion of layout for all RenderViews along the ancestor frame hierarchy of
287         each flattened frame regardless of the RenderView associated with the element that originated the
288         deferred scroll state request. Instead, only the RenderView associated with the element that deferred its
289         scroll state update should dispatch the scroll state update.
290
291         Tests: fast/frames/flattening/scrollable-flexbox-inside-iframe-with-zero-height-and-needs-full-repaint-crash.html
292                fast/frames/flattening/scrollable-flexbox-inside-iframe-with-zero-height-assertion-failure.html
293
294         * rendering/RenderBlock.cpp: Removed WTF::-prefix in typedef definition for ContinuationOutlineTableMap.
295         (WebCore::UpdateScrollInfoAfterLayoutTransaction::UpdateScrollInfoAfterLayoutTransaction): Added; a struct
296         that represents a RenderView v, nested transaction count, and a list of RenderBlocks in v that will need
297         to have their scroll state updated.
298         (WebCore::updateScrollInfoAfterLayoutTransactionStack): Added; returns the global stack of transactions.
299         (WebCore::RenderBlock::willBeDestroyed): Call removeFromUpdateScrollInfoAfterLayoutTransaction(), which
300         was formerly named as removeFromDelayedUpdateScrollInfoSet.
301         (WebCore::currentUpdateScrollInfoAfterLayoutTransaction): Added; returns the top-most transaction in the
302         global stack.
303         (WebCore::RenderBlock::beginUpdateScrollInfoAfterLayoutTransaction): Modified as appropriate to make use
304         of the global stack of transactions; formerly named startDelayUpdateScrollInfo.
305         (WebCore::RenderBlock::endAndCommitUpdateScrollInfoAfterLayoutTransaction): Modified as appropriate to
306         make use of the global stack of transactions; formerly named finishDelayUpdateScrollInfo.
307         (WebCore::RenderBlock::removeFromUpdateScrollInfoAfterLayoutTransaction): Modified as appropriate to make
308         use of the global stack of transactions; formerly named removeFromDelayedUpdateScrollInfoSet.
309         (WebCore::RenderBlock::updateScrollInfoAfterLayout): Modified as appropriate to make use of the global
310         stack of transactions.
311         (WebCore::RenderBlock::layout): Ditto.
312         (WebCore::RenderBlock::startDelayUpdateScrollInfo): Deleted.
313         (WebCore::RenderBlock::finishDelayUpdateScrollInfo): Deleted.
314         (WebCore::RenderBlock::removeFromDelayedUpdateScrollInfoSet): Deleted.
315         * rendering/RenderBlock.h:
316         * rendering/RenderBlockFlow.cpp:
317         (WebCore::RenderBlockFlow::willBeDestroyed): Call removeFromUpdateScrollInfoAfterLayoutTransaction(), which
318         was formerly named removeFromDelayedUpdateScrollInfoSet.
319         * rendering/RenderDeprecatedFlexibleBox.cpp:
320         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox): Call {begin, end}UpdateScrollInfoAfterLayoutTransaction(),
321         which was formerly named {start, end}DelayUpdateScrollInfo.
322         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox): Ditto.
323         * rendering/RenderFlexibleBox.cpp:
324         (WebCore::RenderFlexibleBox::layoutBlock): Ditto.
325
326 2014-05-20  Beth Dakin  <bdakin@apple.com>
327
328         REGRESSION (r169065): Mountain Lion run-api-tests failures: ASSERTION FAILED: 
329         Uncaught exception - -[NSRegularLegacyScrollerImp setPresentationValue:]: 
330         unrecognized selector sent to instance 0x7ff51aa38000
331         https://bugs.webkit.org/show_bug.cgi?id=133121
332
333         Reviewed by Tim Horton.
334
335         * platform/mac/ScrollbarThemeMac.mm:
336         (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
337
338 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
339
340         REGRESSION (r169063) Fixed and sticky nodes misplaced on scrolling sometimes
341         https://bugs.webkit.org/show_bug.cgi?id=133106
342         <rdar://problem/16967648>
343
344         Reviewed by Sam Weinig.
345
346         Fix regression from r169063. That commit removed scrolledContentsLayers from 
347         frame scrolling nodes, but they do actually use them.
348         
349         So put them back; not in the base class, because they have a somewhat different
350         meaning for overflow scrolling and frame scrolling.
351
352         * WebCore.exp.in:
353         * page/scrolling/AsyncScrollingCoordinator.cpp:
354         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
355         (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
356         * page/scrolling/AsyncScrollingCoordinator.h:
357         * page/scrolling/ScrollingCoordinator.h:
358         (WebCore::ScrollingCoordinator::updateFrameScrollingNode):
359         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
360         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
361         (WebCore::ScrollingStateFrameScrollingNode::setScrolledContentsLayer):
362         * page/scrolling/ScrollingStateFrameScrollingNode.h:
363         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
364         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
365         * rendering/RenderLayerCompositor.cpp:
366         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
367
368 2014-05-20  Radu Stavila  <stavila@adobe.com>
369
370         REGRESSION: [CSS Regions] Content flowed directly into the flow thread that ends up in the second region is not properly repainted
371         https://bugs.webkit.org/show_bug.cgi?id=133111
372
373         Reviewed by David Hyatt.
374
375         When computing the repaint rect of an element flowed into a flow thread, if the element is flowed directly into
376         the flow thread (meaning its containing block is the flow thread itself), the region's position within the flow
377         must no longer be taken into consideration, because its already included in the element's |topLeft|.
378
379         Test: fast/regions/hover-element-flowed-second-region.html
380
381         * rendering/RenderBox.cpp:
382         (WebCore::RenderBox::computeRectForRepaint):
383
384 2014-05-20  Alex Christensen  <achristensen@webkit.org>
385
386         Fix web timing assertion failure.
387         https://bugs.webkit.org/show_bug.cgi?id=133094
388         <rdar://problem/16966032>
389
390         Reviewed by Alexey Proskuryakov.
391
392         * platform/network/mac/ResourceHandleMac.mm:
393         (WebCore::ResourceHandle::getConnectionTimingData):
394         Set requestStart and responseStart to 0 instead of -1 to match the 
395         ResourceLoadTiming constructor and prevent the assertion failure in
396         PerformanceTiming::responseStart.
397
398 2014-05-20  Prashant Hiremath  <hiremathprashants@gmail.com>
399
400         Only set title on SVG documents
401         https://bugs.webkit.org/show_bug.cgi?id=133068
402
403         Reviewed by Dirk Schulze.
404
405         Test: svg/custom/html_document_set_title.html
406
407         * svg/SVGTitleElement.cpp:
408         (WebCore::SVGTitleElement::insertedInto):
409         (WebCore::SVGTitleElement::removedFrom):
410         (WebCore::SVGTitleElement::childrenChanged):
411
412 2014-05-20  peavo@outlook.com  <peavo@outlook.com>
413
414         [Curl] Invalid content in cache file, causes broken rendering.
415         https://bugs.webkit.org/show_bug.cgi?id=133069
416
417         Reviewed by Brent Fulgham.
418
419         When data for a url is received as multiple parts, the cache file for the url is truncated when opened for writing,
420         and will only contain the last part of data received.
421         This is fixed by only opening the file once, and close it after all data has been received.
422
423         * platform/network/curl/CurlCacheEntry.cpp:
424         (WebCore::CurlCacheEntry::CurlCacheEntry): Initialize cache file handle member.
425         (WebCore::CurlCacheEntry::~CurlCacheEntry): Close cache file.
426         (WebCore::CurlCacheEntry::saveCachedData): Only open cache file once to avoid truncating.
427         (WebCore::CurlCacheEntry::didFail): Close cache file.
428         (WebCore::CurlCacheEntry::didFinishLoading): Ditto.
429         (WebCore::CurlCacheEntry::openContentFile): Added method to open cache file.
430         (WebCore::CurlCacheEntry::closeContentFile): Added method to close cache file.
431         * platform/network/curl/CurlCacheEntry.h: Added file handle member, and methods to open and close cache file.
432
433 2014-05-20  Radu Stavila  <stavila@adobe.com>
434
435         [CSS Regions] Block incorrectly sized when containing an unsplittable box
436         https://bugs.webkit.org/show_bug.cgi?id=132601
437
438         Reviewed by Antti Koivisto.
439
440         When laying out elements in a region, when an inline element is encountered
441         the size of its parent must not be increased beyond the bottom of the current region,
442         unless if its the last region. This will ensure that the next sibling of the
443         inline element is correctly laid out at the top of the next region, instead
444         of leaving an empty space equal to the height of the overflow, as it did until now.
445
446         Tests: fast/regions/inline-block-inside-anonymous-overflow.html
447                fast/regions/inline-block-overflow.html
448
449         * rendering/RenderBlockFlow.cpp:
450         (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
451         (WebCore::RenderBlockFlow::hasNextPage):
452         * rendering/RenderBlockFlow.h:
453         * rendering/RenderBlockLineLayout.cpp:
454         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
455         (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
456         (WebCore::RenderBlockFlow::determineStartPosition):
457         (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
458
459 2014-05-20  Mihnea Ovidenie  <mihnea@adobe.com>
460
461         [CSS Regions] Crash while painting block selection gaps in regions
462         https://bugs.webkit.org/show_bug.cgi?id=132720
463
464         Reviewed by David Hyatt.
465
466         The fix for WebKit bug https://bugs.webkit.org/show_bug.cgi?id=131511
467         allowed selection highlight to match the DOM selection when the start
468         and end point of the selection were in different flow threads. In order
469         to enable that, the selection was performed separately on view and
470         render flow threads, considered selection subtrees.
471
472         However, the start and end points for each selection subtree were computed
473         by means of Range class but it is not always possible to construct a valid
474         Range from two pairs of RenderObjects and offsets.
475
476         This patch keeps the substrees approach but instead of storing the endpoints
477         for each subtree in a Range and continuously extending the Range, it stores them
478         using the already available SelectionSubtreeRoot class. After the end points are
479         computed for each subtree and before processing the subtree selection, the end points
480         are adjusted in a similar fashion as the one used in FrameSelection::updateAppearance(),
481         to make sure we are passing the same expected information to the method implementing
482         the visible selection processing.
483
484         Test: fast/regions/selection-gaps-paint-crash.html
485
486         * rendering/RenderView.cpp:
487         (WebCore::RenderView::splitSelectionBetweenSubtrees):
488         * rendering/SelectionSubtreeRoot.cpp:
489         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
490         * rendering/SelectionSubtreeRoot.h:
491         (WebCore::SelectionSubtreeRoot::selectionClear):
492
493 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
494
495         Scrolling pages with large TiledBacking content layers creates way too many tiles
496         https://bugs.webkit.org/show_bug.cgi?id=133101
497
498         Reviewed by Tim Horton.
499
500         Fix the GraphicsLayerCA::adjustTiledLayerVisibleRect() logic to avoid making giant rects if the old
501         and new visible rects don't overlap.
502
503         * platform/graphics/TiledBacking.h:
504         * platform/graphics/ca/GraphicsLayerCA.cpp:
505         (WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect):
506         * platform/graphics/ca/mac/TileController.h:
507
508 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
509
510         Correctly maintain the "isInWindow" state for all TiledBackings
511         https://bugs.webkit.org/show_bug.cgi?id=133095
512
513         Reviewed by Tim Horton.
514         
515         We never updated the "isInWindow" state for TiledBacking that wasn't the RenderView's
516         backing. Fix it by having RenderLayerCompositor::setIsInWindow() recurse through all
517         layers (if necessary), updating their state. Also set the state on newly created
518         TiledBackings.
519
520         * rendering/RenderLayerCompositor.cpp:
521         (WebCore::RenderLayerCompositor::layerTiledBackingUsageChanged):
522         (WebCore::RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants):
523         (WebCore::RenderLayerCompositor::setIsInWindow):
524         (WebCore::RenderLayerCompositor::pageTiledBacking): Deleted.
525         * rendering/RenderLayerCompositor.h:
526
527 2014-05-19  Dean Jackson  <dino@apple.com>
528
529         [iOS] Use status display for live streams
530         https://bugs.webkit.org/show_bug.cgi?id=133097
531
532         Reviewed by Sam Weinig.
533
534         Follow-on from https://bugs.webkit.org/show_bug.cgi?id=131390
535         Allow the iOS controls to use the status display field.
536
537         * Modules/mediacontrols/mediaControlsiOS.js:
538         (ControllerIOS.prototype.configureInlineControls): Live streams should
539         not have a timeline or rewind button.
540
541 2014-05-19  Myles C. Maxfield  <litherum@gmail.com>
542
543         Text decorations do not contribute to visual overflow
544         https://bugs.webkit.org/show_bug.cgi?id=132773
545
546         Reviewed by Antti Koivisto.
547
548         This patch creates a function, visualOverflowForDecorations, which computes
549         how much visual overflow to add around a text box due to text decorations. Most of the time,
550         text decorations are fully contained within the text box, so the result is usually 0.
551
552         This function exists within style/InlineTextBoxStyle.cpp, which is an added file. This is
553         so that it can be called from setLogicalWidthForTextRun() inside RenderBlockLineLayout.cpp
554         and from RenderStyle::changeAffectsVisualOverflow(). The former case passes in the full
555         InlineTextBox and the latter case just passes in a RenderStyle (because the InlineTextBox
556         is unavailable.)
557
558         This patch also modifies RenderTableSection::spannedColumns() to fix an off-by-one error
559         that was causing table borders to not be drawn when they existed right on the edge of
560         a repaint rect.
561
562         Tests: fast/css3-text/css3-text-decoration/repaint/underline-outside-of-layout-rect.html
563         Tests: fast/repaint/border-collapse-table-off-by-one-expected.html
564
565         * WebCore.vcxproj/WebCore.vcxproj: Adding reference to new InlineTextBoxStyle.cpp file
566         * WebCore.vcxproj/WebCore.vcxproj.filters: Adding reference to new InlineTextBoxStyle files
567         * WebCore.xcodeproj/project.pbxproj: Adding reference to new InlineTextBoxStyle files
568         * rendering/InlineTextBox.cpp:
569         (WebCore::computeUnderlineOffset): Moved to InlineTextBox.cpp
570         (WebCore::getWavyStrokeParameters): Moved to InlineTextBox.cpp
571         (WebCore::InlineTextBox::paintDecoration): Update to use newly refactored functions
572         * rendering/RenderBlockLineLayout.cpp:
573         (WebCore::setLogicalWidthForTextRun): Call visualOverflowForDecorations()
574         * rendering/RenderTableSection.cpp:
575         * rendering/RenderTableSelection.cpp: Fix off-by-one error when the boundary of a repaint
576         rect lies exactly on top of a table column position
577         * rendering/style/RenderStyle.cpp:
578         (WebCore::RenderStyle::changeAffectsVisualOverflow): Inspects shadows and text decorations
579         (WebCore::RenderStyle::changeRequiresLayout): Calls changeAffectsVisualOverflow()
580         (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline): Moved code from here
581         to changeAffectsVisualOverflow().
582         * rendering/style/RenderStyle.h: Function signature
583         * style/InlineTextBoxStyle.cpp: Added.
584         (WebCore::computeUnderlineOffset): Moved from InlineTextBox.cpp
585         (WebCore::getWavyStrokeParameters): Moved from InlineTextBox.cpp
586         (WebCore::extendIntToFloat): Convenience function for dealing with the fact that
587         underline bounding boxes use floats and GlyphOverflow uses ints
588         (WebCore::visualOverflowForDecorations): Given
589         vertical overflow bounds, possibly extend those to include location of
590         decorations.
591         * style/InlineTextBoxStyle.h: Added. Function signatures.
592         (WebCore::textDecorationStrokeThickness): Refactored from InlineTextBox.cpp
593         (WebCore::wavyOffsetFromDecoration): Refactored from InlineTextBox.cpp
594         * platform/graphics/Font.h:
595         (WebCore::GlyphOverflow::isEmpty): Convenience function
596         (WebCore::GlyphOverflow::extendTo): Convenience function
597
598 2014-05-19  Alex Christensen  <achristensen@webkit.org>
599
600         Unreviewed build fix after r169082
601
602         * platform/network/ResourceHandle.h:
603         Added NSDictionary declaration.
604
605 2014-05-19  Beth Dakin  <bdakin@apple.com>
606
607         REGRESSION: Standalone images need to take topContentInset into account
608         https://bugs.webkit.org/show_bug.cgi?id=133092
609         -and corresponding-
610         <rdar://problem/16945791>
611
612         Reviewed by Darin Adler.
613
614         The FrameView’s size is accurate in terms of the NSWindow size, but that is not 
615         really what the ImageDocument code is looking for here. The ImageDocument wants to 
616         know the size of the unobscured viewport area. We should use visibleSize() for 
617         that.
618         * html/ImageDocument.cpp:
619         (WebCore::ImageDocument::scale):
620         (WebCore::ImageDocument::imageFitsInWindow):
621         (WebCore::ImageDocument::imageClicked):
622
623 2014-05-19  Alex Christensen  <achristensen@webkit.org>
624
625         Collect web timing data on iOS.
626         https://bugs.webkit.org/show_bug.cgi?id=133075
627
628         Reviewed by Sam Weinig.
629
630         * platform/network/ResourceHandle.h:
631         Added setCollectsTimingData wrapper and getConnectionTimingData declarations.
632         getConnectionTimingData with a dictionary parameter is a private helper function.
633         * platform/network/cf/ResourceHandleCFNet.cpp:
634         (WebCore::ResourceHandle::start):
635         Call setCollectsTimingData wrapper when creating a connection to ensure that timing data is collected.
636         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
637         (WebCore::ResourceHandleCFURLConnectionDelegate::didReceiveResponseCallback):
638         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
639         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
640         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
641         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
642         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
643         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
644         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
645         Pass the CFURLConnectionRef to didReceiveResponse to get timing data from.
646         * platform/network/mac/ResourceHandleMac.mm:
647         (WebCore::ResourceHandle::getConnectionTimingData):
648         Moved from getTimingData to compile regardless of using CFNetwork and added wrapper with CFDictionaryRef.
649         (WebCore::ResourceHandle::setCollectsTimingData):
650         Added wrapper to call objc function from c++.
651         (WebCore::ResourceHandle::getTimingData):
652         Renamed to getConnectionTimingData.
653         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
654         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
655         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
656         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
657         Updated function name from getTimingData to getConnectionTimingData.
658
659 2014-05-19  Chris Fleizach  <cfleizach@apple.com>
660
661         AX: VoiceOver sees the WebArea out of order when topContentInset is used
662         https://bugs.webkit.org/show_bug.cgi?id=133091
663
664         Reviewed by Simon Fraser.
665
666         Modify the scroll view's frame so that it recognizes the content inset.
667         This is needed so that when VoiceOver sorts elements to create an ordering,
668         the web area is not ordered at the top of the screen.
669
670         Test: platform/mac-wk2/accessibility/content-inset-scrollview-frame.html
671
672         * accessibility/AccessibilityScrollView.cpp:
673         (WebCore::AccessibilityScrollView::elementRect):
674
675 2014-05-19  Beth Dakin  <bdakin@apple.com>
676
677         Scrollbars display incorrectly after switching between fast and slow scrolling 
678         mode, affects Find and real sites
679         https://bugs.webkit.org/show_bug.cgi?id=133077
680         -and corresponding-
681         <rdar://problem/16888608>
682
683         Reviewed by Tim Horton.
684
685         We should always return true here when updating on the secondary thread is 
686         supported. It does not need to be gated on whether we are actively taking 
687         advantage of that support at this moment.
688         * platform/Scrollbar.cpp:
689         (WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
690
691         Always update the presentationValue whenever we update the doubleValue just to 
692         keep them in sync.
693         * platform/mac/ScrollbarThemeMac.mm:
694         (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
695
696 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
697
698         Split scrolling tree ScrollingNodes into FrameScrollingNodes and OverflowScrollingNodes
699         https://bugs.webkit.org/show_bug.cgi?id=133022
700
701         Reviewed by Sam Weinig.
702
703         In both the scrolling state tree and the scrolling tree, split the "scrolling nodes"
704         into FrameScrolling and OverflowScrolling nodes.
705         
706         Move what was the "viewportSize" property onto the base class for the scrolling
707         nodes, calling it "scrollableAreaSize".
708         
709         Make minimum/maximumScrollPosition() virtual so we can share more code (and there
710         is more code sharing to be done in future).
711
712         * Configurations/WebCore.xcconfig: Remove ScrollingStateScrollingNodeMac.mm and ScrollingTreeScrollingNodeMac.mm
713         from the list, using #ifdefs in the file instead.
714         * WebCore.exp.in: Lots of exports.
715         * WebCore.xcodeproj/project.pbxproj: New files.
716         * page/scrolling/AsyncScrollingCoordinator.cpp:
717         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
718         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
719         (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
720         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
721         (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
722         (WebCore::AsyncScrollingCoordinator::updateScrollingNode): Deleted.
723         (WebCore::AsyncScrollingCoordinator::setScrollbarPaintersFromScrollbarsForNode): Deleted.
724         This tiny function didn't need to exist.
725         * page/scrolling/AsyncScrollingCoordinator.h:
726         * page/scrolling/ScrollingCoordinator.h:
727         (WebCore::ScrollingCoordinator::updateFrameScrollingNode):
728         (WebCore::ScrollingCoordinator::updateOverflowScrollingNode):
729         (WebCore::ScrollingCoordinator::updateScrollingNode): Deleted.
730         * page/scrolling/ScrollingStateFrameScrollingNode.cpp: Copied from Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp.
731         (WebCore::ScrollingStateFrameScrollingNode::create):
732         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
733         (WebCore::ScrollingStateFrameScrollingNode::~ScrollingStateFrameScrollingNode):
734         (WebCore::ScrollingStateFrameScrollingNode::clone):
735         (WebCore::ScrollingStateFrameScrollingNode::setFrameScaleFactor):
736         (WebCore::ScrollingStateFrameScrollingNode::setNonFastScrollableRegion):
737         (WebCore::ScrollingStateFrameScrollingNode::setWheelEventHandlerCount):
738         (WebCore::ScrollingStateFrameScrollingNode::setSynchronousScrollingReasons):
739         (WebCore::ScrollingStateFrameScrollingNode::setScrollBehaviorForFixedElements):
740         (WebCore::ScrollingStateFrameScrollingNode::setHeaderHeight):
741         (WebCore::ScrollingStateFrameScrollingNode::setFooterHeight):
742         (WebCore::ScrollingStateFrameScrollingNode::setTopContentInset):
743         (WebCore::ScrollingStateFrameScrollingNode::setCounterScrollingLayer):
744         (WebCore::ScrollingStateFrameScrollingNode::setInsetClipLayer):
745         (WebCore::ScrollingStateFrameScrollingNode::setContentShadowLayer):
746         (WebCore::ScrollingStateFrameScrollingNode::setHeaderLayer):
747         (WebCore::ScrollingStateFrameScrollingNode::setFooterLayer):
748         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
749         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
750         * page/scrolling/ScrollingStateFrameScrollingNode.h: Copied from Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h.
751         * page/scrolling/ScrollingStateNode.h:
752         (WebCore::LayerRepresentation::layerID):
753         (WebCore::ScrollingStateNode::isFrameScrollingNode):
754         (WebCore::ScrollingStateNode::isOverflowScrollingNode):
755         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: Added.
756         (WebCore::ScrollingStateOverflowScrollingNode::create):
757         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
758         (WebCore::ScrollingStateOverflowScrollingNode::~ScrollingStateOverflowScrollingNode):
759         (WebCore::ScrollingStateOverflowScrollingNode::clone):
760         (WebCore::ScrollingStateOverflowScrollingNode::setScrolledContentsLayer):
761         (WebCore::ScrollingStateOverflowScrollingNode::dumpProperties):
762         * page/scrolling/ScrollingStateOverflowScrollingNode.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingStateScrollingNodeMac.mm.
763         (WebCore::ScrollingStateOverflowScrollingNode::scrolledContentsLayer):
764         * page/scrolling/ScrollingStateScrollingNode.cpp:
765         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
766         (WebCore::ScrollingStateScrollingNode::setScrollableAreaSize):
767         (WebCore::ScrollingStateScrollingNode::setTotalContentsSize):
768         (WebCore::ScrollingStateScrollingNode::dumpProperties):
769         (WebCore::ScrollingStateScrollingNode::create): Deleted.
770         (WebCore::ScrollingStateScrollingNode::clone): Deleted.
771         (WebCore::ScrollingStateScrollingNode::setViewportSize): Deleted.
772         (WebCore::ScrollingStateScrollingNode::setFrameScaleFactor): Deleted.
773         (WebCore::ScrollingStateScrollingNode::setNonFastScrollableRegion): Deleted.
774         (WebCore::ScrollingStateScrollingNode::setWheelEventHandlerCount): Deleted.
775         (WebCore::ScrollingStateScrollingNode::setSynchronousScrollingReasons): Deleted.
776         (WebCore::ScrollingStateScrollingNode::setScrollBehaviorForFixedElements): Deleted.
777         (WebCore::ScrollingStateScrollingNode::setHeaderHeight): Deleted.
778         (WebCore::ScrollingStateScrollingNode::setFooterHeight): Deleted.
779         (WebCore::ScrollingStateScrollingNode::setTopContentInset): Deleted.
780         (WebCore::ScrollingStateScrollingNode::setScrolledContentsLayer): Deleted.
781         (WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer): Deleted.
782         (WebCore::ScrollingStateScrollingNode::setInsetClipLayer): Deleted.
783         (WebCore::ScrollingStateScrollingNode::setContentShadowLayer): Deleted.
784         (WebCore::ScrollingStateScrollingNode::setHeaderLayer): Deleted.
785         (WebCore::ScrollingStateScrollingNode::setFooterLayer): Deleted.
786         (WebCore::ScrollingStateScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
787         * page/scrolling/ScrollingStateScrollingNode.h:
788         (WebCore::ScrollingStateScrollingNode::scrollableAreaSize):
789         (WebCore::ScrollingStateScrollingNode::totalContentsSize):
790         * page/scrolling/ScrollingStateTree.cpp:
791         (WebCore::ScrollingStateTree::attachNode):
792         (WebCore::ScrollingStateTree::commit):
793         * page/scrolling/ScrollingStateTree.h:
794         (WebCore::ScrollingStateTree::rootStateNode):
795         (WebCore::ScrollingStateTree::setRootStateNode):
796         * page/scrolling/ScrollingTree.cpp:
797         (WebCore::ScrollingTree::commitNewTreeState):
798         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Added.
799         (WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
800         (WebCore::ScrollingTreeFrameScrollingNode::~ScrollingTreeFrameScrollingNode):
801         (WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren):
802         * page/scrolling/ScrollingTreeFrameScrollingNode.h: Copied from Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h.
803         (WebCore::ScrollingTreeFrameScrollingNode::updateLayersAfterDelegatedScroll):
804         (WebCore::ScrollingTreeFrameScrollingNode::synchronousScrollingReasons):
805         (WebCore::ScrollingTreeFrameScrollingNode::shouldUpdateScrollLayerPositionSynchronously):
806         (WebCore::ScrollingTreeFrameScrollingNode::frameScaleFactor):
807         (WebCore::ScrollingTreeFrameScrollingNode::headerHeight):
808         (WebCore::ScrollingTreeFrameScrollingNode::footerHeight):
809         (WebCore::ScrollingTreeFrameScrollingNode::topContentInset):
810         (WebCore::ScrollingTreeFrameScrollingNode::scrollBehaviorForFixedElements):
811         * page/scrolling/ScrollingTreeNode.h:
812         (WebCore::ScrollingTreeNode::isFrameScrollingNode):
813         (WebCore::ScrollingTreeNode::isOverflowScrollingNode):
814         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp: Copied from Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h.
815         (WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
816         (WebCore::ScrollingTreeOverflowScrollingNode::~ScrollingTreeOverflowScrollingNode):
817         * page/scrolling/ScrollingTreeOverflowScrollingNode.h: Copied from Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h.
818         * page/scrolling/ScrollingTreeScrollingNode.cpp:
819         (WebCore::ScrollingTreeScrollingNode::ScrollingTreeScrollingNode):
820         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
821         (WebCore::ScrollingTreeScrollingNode::updateAfterChildren):
822         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
823         (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints):
824         (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition):
825         (WebCore::ScrollingTreeScrollingNode::maximumScrollPosition):
826         * page/scrolling/ScrollingTreeScrollingNode.h:
827         (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize):
828         (WebCore::ScrollingTreeScrollingNode::totalContentsSize):
829         (WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand):
830         (WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand):
831         (WebCore::ScrollingTreeScrollingNode::synchronousScrollingReasons): Deleted.
832         (WebCore::ScrollingTreeScrollingNode::shouldUpdateScrollLayerPositionSynchronously): Deleted.
833         (WebCore::ScrollingTreeScrollingNode::viewportSize): Deleted.
834         (WebCore::ScrollingTreeScrollingNode::frameScaleFactor): Deleted.
835         (WebCore::ScrollingTreeScrollingNode::headerHeight): Deleted.
836         (WebCore::ScrollingTreeScrollingNode::footerHeight): Deleted.
837         (WebCore::ScrollingTreeScrollingNode::scrollBehaviorForFixedElements): Deleted.
838         (WebCore::ScrollingTreeScrollingNode::topContentInset): Deleted.
839         * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
840         (WebCore::ScrollingCoordinatorIOS::createScrollingTreeNode):
841         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Renamed from Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h.
842         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer):
843         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Renamed from Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm.
844         (WebCore::ScrollingTreeFrameScrollingNodeIOS::create):
845         (WebCore::ScrollingTreeFrameScrollingNodeIOS::ScrollingTreeFrameScrollingNodeIOS):
846         (WebCore::ScrollingTreeFrameScrollingNodeIOS::~ScrollingTreeFrameScrollingNodeIOS):
847         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateBeforeChildren):
848         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateAfterChildren):
849         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollPosition):
850         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
851         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
852         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition):
853         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterViewportChange):
854         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterDelegatedScroll):
855         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll):
856         (WebCore::ScrollingTreeFrameScrollingNodeIOS::minimumScrollPosition):
857         (WebCore::ScrollingTreeFrameScrollingNodeIOS::maximumScrollPosition):
858         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollBy):
859         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollByWithoutContentEdgeConstraints):
860         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
861         (WebCore::ScrollingCoordinatorMac::createScrollingTreeNode):
862         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingStateScrollingNodeMac.mm.
863         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
864         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h.
865         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm.
866         (WebCore::ScrollingTreeFrameScrollingNodeMac::create):
867         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
868         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
869         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
870         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateAfterChildren):
871         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
872         (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsHorizontalStretching):
873         (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsVerticalStretching):
874         (WebCore::ScrollingTreeFrameScrollingNodeMac::stretchAmount):
875         (WebCore::ScrollingTreeFrameScrollingNodeMac::pinnedInDirection):
876         (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollHorizontally):
877         (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollVertically):
878         (WebCore::ScrollingTreeFrameScrollingNodeMac::shouldRubberBandInDirection):
879         (WebCore::ScrollingTreeFrameScrollingNodeMac::absoluteScrollPosition):
880         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollBy):
881         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollByWithoutContentEdgeConstraints):
882         (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer):
883         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer):
884         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary):
885         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition):
886         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
887         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
888         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
889         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange):
890         (WebCore::ScrollingTreeFrameScrollingNodeMac::minimumScrollPosition):
891         (WebCore::ScrollingTreeFrameScrollingNodeMac::maximumScrollPosition):
892         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollBy):
893         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollByWithoutContentEdgeConstraints):
894         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
895         (WebCore::ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea):
896         (WebCore::logThreadedScrollingMode):
897         (WebCore::logWheelEventHandlerCountChanged):
898         * rendering/RenderLayerCompositor.cpp:
899         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
900
901 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
902
903         Images missing sometimes with composited clipping layers
904         https://bugs.webkit.org/show_bug.cgi?id=133065
905         <rdar://problem/15224559>
906
907         Reviewed by Beth Dakin.
908         
909         When support for solid colors on layers was added, a layer was considered a candidate
910         for the solid color optimization without regard to whether it had descendent layers
911         with "paintsIntoCompositedAncestor" requirements.
912         
913         Fix hasVisibleNonCompositingDescendantLayers(), renaming it to isPaintDestinationForDescendentLayers()
914         and having it take into account whether descendent layers need to paint into an
915         ancestor.
916         
917         Also, this test has to happen after those descendent layers have had their
918         compositing state updated, so move the isSimpleContainerCompositingLayer() to
919         a new updateAfterDescendents() function which is called from the various
920         places we do compositing-udpate-tree-walks.
921
922         Test: compositing/backing/solid-color-with-paints-into-ancestor.html
923
924         * rendering/RenderLayerBacking.cpp:
925         (WebCore::RenderLayerBacking::updateGeometry):
926         (WebCore::RenderLayerBacking::updateAfterDescendents):
927         (WebCore::RenderLayerBacking::paintsChildren):
928         (WebCore::compositedWithOwnBackingStore):
929         (WebCore::descendentLayerPaintsIntoAncestor):
930         (WebCore::RenderLayerBacking::isPaintDestinationForDescendentLayers):
931         (WebCore::hasVisibleNonCompositingDescendant): Deleted.
932         (WebCore::RenderLayerBacking::hasVisibleNonCompositingDescendantLayers): Deleted.
933         * rendering/RenderLayerBacking.h:
934         * rendering/RenderLayerCompositor.cpp:
935         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
936         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
937         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
938
939 2014-05-19  Zalan Bujtas  <zalan@apple.com>
940
941         REGRESSION (r133351, sub-pixel layout): Right-to-left block with text-overflow: ellipsis truncates prematurely (breaks facebook.com Hebrew UI)
942         https://bugs.webkit.org/show_bug.cgi?id=112227
943
944         Reviewed by Maciej Stachowiak.
945
946         This patch removes unnecessary integral snapping of inlines at layout time.
947
948         The general rule of thumb of using round/floor/ceil at layout time is to not use them.
949  
950         When some computed values (x, y, width, height) get snapped during layout, while others don't,
951         intersecting/measuring mismatches could occur and they could end up producing visual artifacts such as truncations.
952         This patch also enables iframe content to be positioned on odd device pixel positions on retina displays.
953         
954         Tests: fast/frames/hidpi-position-iframe-on-device-pixel.html
955                fast/inline/hidpi-rtl-text-does-not-fit-line-and-gets-cut-off.html
956
957         * rendering/RenderBlock.h:
958         (WebCore::RenderBlock::logicalLeftOffsetForLine):
959         (WebCore::RenderBlock::pixelSnappedLogicalLeftOffsetForLine): Deleted.
960         (WebCore::RenderBlock::pixelSnappedLogicalRightOffsetForLine): Deleted.
961         * rendering/RenderBlockLineLayout.cpp:
962         (WebCore::updateLogicalInlinePositions):
963         (WebCore::RenderBlockFlow::deleteEllipsisLineBoxes):
964         (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
965
966 2014-05-18  Chris Fleizach  <cfleizach@apple.com>
967
968         AX: iOS: using AXAttributeCacheEnabler is too slow for every accessibilityElementAtIndex:
969         https://bugs.webkit.org/show_bug.cgi?id=133043
970
971         Reviewed by Mario Sanchez Prada.
972
973         iOS Accessibility code tries to improve performance by caching attributes when accessing
974         elements through the platform API. However, those API calls can be used very frequently when 
975         iterating elements. Creating the AXAttributeCacheEnabler object and tearing it down is proving
976         to be the hottest code path in samples for accessibility access.
977
978         We need to move the logic for enabling/disabling the attribute cache to a level that can make
979         a more informed decision about when to enable/disable.
980
981         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
982         (-[WebAccessibilityObjectWrapper enableAttributeCaching]):
983         (-[WebAccessibilityObjectWrapper disableAttributeCaching]):
984         (-[WebAccessibilityObjectWrapper accessibilityElementCount]):
985         (-[WebAccessibilityObjectWrapper accessibilityElementAtIndex:]):
986         (-[WebAccessibilityObjectWrapper indexOfAccessibilityElement:]):
987
988 2014-05-18  Simon Fraser  <simon.fraser@apple.com>
989
990         Use RenderStyle& in more places in RenderLayerBacking
991         https://bugs.webkit.org/show_bug.cgi?id=133061
992
993         Reviewed by Andreas Kling.
994
995         Convert several member functions to use references to RenderStyle rather
996         than pointers. Move canCreateTiledImage() higher in the file (no code
997         changes). Other minor cleanup.
998
999         * rendering/RenderLayerBacking.cpp:
1000         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
1001         (WebCore::RenderLayerBacking::updateOpacity):
1002         (WebCore::RenderLayerBacking::updateTransform):
1003         (WebCore::RenderLayerBacking::updateFilters):
1004         (WebCore::RenderLayerBacking::updateBlendMode):
1005         (WebCore::RenderLayerBacking::updateGeometry):
1006         (WebCore::hasBoxDecorations):
1007         (WebCore::canCreateTiledImage):
1008         (WebCore::hasBoxDecorationsOrBackgroundImage):
1009         (WebCore::hasPerspectiveOrPreserves3D):
1010         (WebCore::supportsDirectBoxDecorationsComposition):
1011         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
1012         (WebCore::RenderLayerBacking::contentChanged):
1013         (WebCore::RenderLayerBacking::startTransition):
1014         * rendering/RenderLayerBacking.h:
1015
1016 2014-05-17  Simon Fraser  <simon.fraser@apple.com>
1017
1018         Rename some RenderLayerBacking member functions
1019         https://bugs.webkit.org/show_bug.cgi?id=133030
1020
1021         Reviewed by Sam Weinig.
1022
1023         Remove "GraphicsLayer" from some member function names on RenderLayerBacking.
1024         
1025         No behavior change.
1026
1027         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1028         (WebCore::AVFWrapper::createAVCFVideoLayer):
1029         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1030         (WebCore::MediaPlayerPrivateQTKit::createQTMovieLayer):
1031         * rendering/RenderLayer.cpp:
1032         (WebCore::RenderLayer::calculateClipRects):
1033         * rendering/RenderLayerBacking.cpp:
1034         (WebCore::RenderLayerBacking::updateAfterLayout):
1035         (WebCore::RenderLayerBacking::updateConfiguration):
1036         (WebCore::RenderLayerBacking::updateGeometry):
1037         (WebCore::RenderLayerBacking::contentChanged):
1038         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
1039         (WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration): Deleted.
1040         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Deleted.
1041         * rendering/RenderLayerBacking.h:
1042         * rendering/RenderLayerCompositor.cpp:
1043         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
1044         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
1045         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
1046         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
1047         (WebCore::RenderLayerCompositor::attachRootLayer):
1048
1049 2014-05-19  Antti Koivisto  <antti@apple.com>
1050
1051         Fix assertion failure with simple line layout debug borders enabled.
1052
1053         Rubber-stamped by Andreas Kling.
1054
1055         * rendering/SimpleLineLayoutFunctions.cpp:
1056         (WebCore::SimpleLineLayout::paintDebugBorders): We shoudn't try to paint empty rects.
1057
1058 2014-05-18  Andreas Kling  <akling@apple.com>
1059
1060         Reduce constructor copypasta in RenderText and RenderElement.
1061         <https://webkit.org/b/133056>
1062
1063         Use delegating constructors to remove duplicated initializer lists
1064         from the constructors of RenderText and RenderElement.
1065
1066         Reviewed by Anders Carlsson.
1067
1068         * rendering/RenderElement.cpp:
1069         (WebCore::RenderElement::RenderElement):
1070         * rendering/RenderElement.h:
1071         * rendering/RenderText.cpp:
1072         (WebCore::RenderText::RenderText):
1073         * rendering/RenderText.h:
1074
1075 2014-05-18  Brent Fulgham  <bfulgham@apple.com>
1076
1077         Crash during scroll when latched
1078         https://bugs.webkit.org/show_bug.cgi?id=133064
1079
1080         Reviewed by Simon Fraser.
1081
1082         * page/mac/EventHandlerMac.mm:
1083         (WebCore::EventHandler::platformPrepareForWheelEvents): Prevent dereference of NULL
1084         wheelEventTarget argument.
1085
1086 2014-05-18  Svetlana Redchenko  <redchenko@yandex-team.ru>
1087
1088         Input ::selection pseudo class does not work leading to hidden selection
1089         https://bugs.webkit.org/show_bug.cgi?id=38943
1090
1091         Reviewed by Darin Adler.
1092
1093         Test: fast/selectors/input-with-selection-pseudo-element.html
1094
1095         When text is selected inside input element, it should change the
1096         color and background color according to the ::selection pseudo element.
1097
1098         * rendering/RenderObject.cpp:
1099         (WebCore::RenderObject::selectionBackgroundColor):
1100         (WebCore::RenderObject::selectionColor):
1101         (WebCore::RenderObject::selectionPseudoStyle):
1102         * rendering/RenderObject.h:
1103
1104 2014-05-18  Sam Weinig  <sam@webkit.org>
1105
1106         [WebKit2] Implement ScriptMessageHandlers
1107         https://bugs.webkit.org/show_bug.cgi?id=133053
1108
1109         Reviewed by Anders Carlsson.
1110
1111         * DerivedSources.make:
1112         * WebCore.exp.in:
1113         * WebCore.xcodeproj/project.pbxproj:
1114         * bindings/js/JSDOMWindowBase.cpp:
1115         (WebCore::JSDOMWindowBase::finishCreation):
1116         * bindings/js/JSUserMessageHandlersNamespaceCustom.cpp: Added.
1117         (WebCore::JSUserMessageHandlersNamespace::getOwnPropertySlotDelegate):
1118         * page/DOMWindow.cpp:
1119         (WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld):
1120         (WebCore::DOMWindow::webkitNamespace):
1121         * page/DOMWindow.h:
1122         * page/UserContentController.cpp:
1123         (WebCore::UserContentController::addUserMessageHandlerDescriptor):
1124         (WebCore::UserContentController::removeUserMessageHandlerDescriptor):
1125         * page/UserContentController.h:
1126         (WebCore::UserContentController::userMessageHandlerDescriptors):
1127         * page/UserMessageHandler.cpp: Added.
1128         (WebCore::UserMessageHandler::UserMessageHandler):
1129         (WebCore::UserMessageHandler::~UserMessageHandler):
1130         (WebCore::UserMessageHandler::postMessage):
1131         (WebCore::UserMessageHandler::name):
1132         (WebCore::UserMessageHandler::world):
1133         * page/UserMessageHandler.h: Added.
1134         (WebCore::UserMessageHandler::create):
1135         * page/UserMessageHandler.idl: Added.
1136         * page/UserMessageHandlerDescriptor.cpp: Added.
1137         (WebCore::UserMessageHandlerDescriptor::UserMessageHandlerDescriptor):
1138         (WebCore::UserMessageHandlerDescriptor::~UserMessageHandlerDescriptor):
1139         (WebCore::UserMessageHandlerDescriptor::name):
1140         (WebCore::UserMessageHandlerDescriptor::world):
1141         * page/UserMessageHandlerDescriptor.h: Added.
1142         (WebCore::UserMessageHandlerDescriptor::Client::~Client):
1143         (WebCore::UserMessageHandlerDescriptor::create):
1144         (WebCore::UserMessageHandlerDescriptor::client):
1145         * page/UserMessageHandlerDescriptorTypes.h: Added.
1146         * page/UserMessageHandlersNamespace.cpp: Added.
1147         (WebCore::UserMessageHandlersNamespace::UserMessageHandlersNamespace):
1148         (WebCore::UserMessageHandlersNamespace::~UserMessageHandlersNamespace):
1149         (WebCore::UserMessageHandlersNamespace::handler):
1150         * page/UserMessageHandlersNamespace.h: Added.
1151         (WebCore::UserMessageHandlersNamespace::create):
1152         * page/UserMessageHandlersNamespace.idl: Added.
1153         * page/WebKitNamespace.cpp: Added.
1154         (WebCore::WebKitNamespace::WebKitNamespace):
1155         (WebCore::WebKitNamespace::~WebKitNamespace):
1156         (WebCore::WebKitNamespace::messageHandlers):
1157         * page/WebKitNamespace.h: Added.
1158         (WebCore::WebKitNamespace::create):
1159         * page/WebKitNamespace.idl: Added.
1160
1161 2014-05-18  Maciej Stachowiak  <mjs@apple.com>
1162
1163         REGRESSION (r156546): Default media controls are laid out incorrectly when media element is styled with direction:rtl
1164         https://bugs.webkit.org/show_bug.cgi?id=132531
1165         <rdar://problem/16806267>
1166         
1167         Reviewed by Mark Rowe.
1168
1169         This was already tested by the media/video-rtl.htm reftest, now unskipped.
1170
1171         * Modules/mediacontrols/mediaControlsApple.css:
1172         (audio::-webkit-media-controls-panel): Add missing direction: ltr
1173
1174 2014-05-18  Rik Cabanier  <cabanier@adobe.com>
1175
1176         support for navigator.hardwareConcurrency
1177         https://bugs.webkit.org/show_bug.cgi?id=132588
1178
1179         Reviewed by Filip Pizlo.
1180
1181         Added a new API that returns the number of CPU cores up to 8.
1182
1183         Test: fast/dom/navigator-hardwareConcurrency.html
1184
1185         * Configurations/FeatureDefines.xcconfig:
1186         * page/Navigator.cpp:
1187         (WebCore::Navigator::hardwareConcurrency):
1188         * page/Navigator.h:
1189         * page/Navigator.idl:
1190
1191 2014-05-18  Anders Carlsson  <andersca@apple.com>
1192
1193         Fix iOS build.
1194
1195         * WebCore.exp.in:
1196         Move UserContentController symbols to the right place.
1197
1198 2014-05-18  Jon Lee  <jonlee@apple.com>
1199
1200         Build fix for r169006.
1201
1202         Unreviewed.
1203
1204         * loader/ResourceLoader.h: Return didCreateQuickLookHandle() to public.
1205
1206 2014-05-18  Antti Koivisto  <antti@apple.com>
1207
1208         REGRESSION (r160259): text-combine glyphs are not rendered
1209         https://bugs.webkit.org/show_bug.cgi?id=127324
1210
1211         Reviewed by Andreas Kling.
1212         
1213         The original text gets overwritten by a change that is supposed to affect rendered text only.
1214         Fixed by giving the text update functions well-defined purposes.
1215
1216         Test: fast/text/text-combine-rendering.html
1217
1218         * rendering/RenderCombineText.cpp:
1219         (WebCore::RenderCombineText::styleDidChange):
1220         (WebCore::RenderCombineText::setRenderedText):
1221         (WebCore::RenderCombineText::combineText):
1222         (WebCore::RenderCombineText::setTextInternal): Deleted.
1223         * rendering/RenderCombineText.h:
1224         * rendering/RenderCounter.cpp:
1225         (WebCore::RenderCounter::computePreferredLogicalWidths):
1226         * rendering/RenderText.cpp:
1227         (WebCore::RenderText::setRenderedText):
1228         
1229             This function now updates the rendered text but does not change the original.
1230             Get the original text by calling originalText().
1231
1232         (WebCore::RenderText::setText):
1233         
1234             This the only place original text now changes.
1235
1236         (WebCore::RenderText::setTextInternal): Deleted.
1237         
1238             Renamed to setRenderedText.
1239
1240         * rendering/RenderText.h:
1241         * rendering/svg/RenderSVGInlineText.cpp:
1242         (WebCore::RenderSVGInlineText::setRenderedText):
1243         (WebCore::RenderSVGInlineText::setTextInternal): Deleted.
1244         * rendering/svg/RenderSVGInlineText.h:
1245
1246 2014-05-17  Maciej Stachowiak  <mjs@apple.com>
1247
1248         Don't attempt to update id or name for nodes that are already removed
1249         https://bugs.webkit.org/show_bug.cgi?id=133041
1250
1251         Reviewed by Sam Weinig.
1252
1253         Tests: fast/dom/remove-element-with-id-that-was-inserted-on-DOMNodeRemoved.html
1254                fast/dom/remove-element-with-name-that-was-inserted-on-DOMNodeRemoved.html
1255
1256         * dom/Element.cpp:
1257         (WebCore::Element::removedFrom): Skip updating ids and names for an element not
1258         in a treescope, as we already do for elements not in a document.
1259
1260 2014-05-17  Alexey Proskuryakov  <ap@apple.com>
1261
1262         REGRESSION (NetworkProcess): Trying to use appcache fallback crashes in ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache
1263         https://bugs.webkit.org/show_bug.cgi?id=133007
1264         <rdar://problem/13702706>
1265
1266         appcache tests often fail on the Mac WebKit2 bot
1267         https://bugs.webkit.org/show_bug.cgi?id=82061
1268
1269         Reviewed by Maciej Stachowiak.
1270
1271         Covered by existing tests, which this patch enables.
1272
1273         * WebCore.exp.in: Export ResourceLoader::cancel(const ResourceError&). It used
1274         to be virtual, but marking subclasses final has resulted in the compiler calling
1275         it directly from WebKitLegacy framework. Seeing that no subclass overrides it,
1276         I then made it non-virtual.
1277         Also export ApplicationCacheHost functions that are now used from WebKit2.
1278
1279         * loader/ResourceLoader.h: Made the class abstract (as I didn't realize at first
1280         that it's always either a SubresourceLoader or a NetscapePlugInStreamLoader).
1281         Made ResourceHandleClient functions private, as they should never be called other
1282         than via a ResourceHandleClient pointer.
1283
1284         * loader/NetscapePlugInStreamLoader.h:
1285         * loader/SubresourceLoader.h:
1286         Marked these final.
1287
1288         * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::willSwitchToSubstituteResource):
1289         Added a function to be called when switching to a substitute resource. We still
1290         need a ResourceLoader at this point, as substitute resource will be delivered through
1291         it, but we don't want it to continue its current load.
1292
1293         * loader/appcache/ApplicationCacheHost.cpp:
1294         (WebCore::ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache):
1295         Call the ResourceLoader function instead of using handle, which is null when
1296         using out of process networking.
1297
1298 2014-05-17  Andreas Kling  <akling@apple.com>
1299
1300         We shouldn't make a ScrollingThread on iOS.
1301         <https://webkit.org/b/133038>
1302         <rdar://problem/16947589>
1303
1304         Don't call ScrollingThred::dispatch() from the pressure relief
1305         code on iOS since that will end up instantiating a scrolling thread
1306         which we'd otherwise never have.
1307
1308         Reviewed by Sam Weinig.
1309
1310         * platform/MemoryPressureHandler.cpp:
1311         (WebCore::MemoryPressureHandler::releaseMemory):
1312
1313 2014-05-17  Piotr Grad  <p.grad@samsung.com>
1314
1315         Setting playback rate on video with media controller is not ignored.
1316         https://bugs.webkit.org/show_bug.cgi?id=129048
1317
1318         Reviewed by Jer Noble.
1319
1320         Replaced queries for m_playbackRate with effectivePlaybackRate()
1321         which includes media controller playback rate.
1322
1323         Test: media/video-controller-child-rate.html
1324
1325         * html/HTMLMediaElement.cpp:
1326         (WebCore::HTMLMediaElement::parseAttribute):
1327         * html/HTMLMediaElement.h:
1328
1329 2014-05-16  Anders Carlsson  <andersca@apple.com>
1330
1331         Expose WKUserScript as API
1332         https://bugs.webkit.org/show_bug.cgi?id=133017
1333         <rdar://problem/16948059>
1334
1335         Reviewed by Sam Weinig.
1336
1337         * WebCore.exp.in:
1338         Export symbols.
1339
1340         * WebCore.xcodeproj/project.pbxproj:
1341         Change UserContentController.h to be a private header.
1342
1343         * page/Page.cpp:
1344         (WebCore::Page::Page):
1345         Set m_userContentController from the page configuration and add it if it's not null.
1346
1347         * page/Page.h:
1348         Add UserContentController to PageClients.
1349
1350         * page/PageGroup.cpp:
1351         (WebCore::PageGroup::addPage):
1352         Only try to add a user content controller if the page doesn't already have one.
1353
1354         (WebCore::PageGroup::removePage):
1355         Only try to remove the user content controller if it's the group one.
1356
1357 2014-05-17  Andreas Kling  <akling@apple.com>
1358
1359         REGRESSION (r166422): All RenderBox objects grew 104 bytes from adding repaint timers.
1360         <https://webkit.org/b/133027>
1361         <rdar://problem/16867410>
1362
1363         Instead of storing a rarely-used repaint timer on every RenderBox, store one
1364         on the RenderView, and keep a hash set of renderers needing repaint.
1365
1366         Renderers get a flag tracking whether they have a pending lazy repaint.
1367         This way we can avoid hash lookups in the common case.
1368
1369         Also added a static assertion to catch RenderBox growing in the future.
1370
1371         Reviewed by Antti Koivisto.
1372
1373         * rendering/RenderBox.cpp:
1374         (WebCore::SameSizeAsRenderBox::~SameSizeAsRenderBox):
1375         (WebCore::RenderBox::RenderBox):
1376         (WebCore::RenderBox::~RenderBox):
1377         (WebCore::RenderBox::paintBoxDecorations):
1378         (WebCore::RenderBox::layoutOverflowRectForPropagation):
1379         * rendering/RenderBox.h:
1380         * rendering/RenderElement.cpp:
1381         (WebCore::RenderElement::RenderElement):
1382         * rendering/RenderElement.h:
1383         (WebCore::RenderElement::setRenderBoxNeedsLazyRepaint):
1384         (WebCore::RenderElement::renderBoxNeedsLazyRepaint):
1385         * rendering/RenderView.cpp:
1386         (WebCore::RenderView::RenderView):
1387         (WebCore::RenderView::scheduleLazyRepaint):
1388         (WebCore::RenderView::unscheduleLazyRepaint):
1389         (WebCore::RenderView::lazyRepaintTimerFired):
1390         * rendering/RenderView.h:
1391
1392 2014-05-16  Jer Noble  <jer.noble@apple.com>
1393
1394         [Mac][MSE] setCurrentTime() goes down fastSeek path in MediaPlayerPrivateMediaSourceAVFObjC.
1395         https://bugs.webkit.org/show_bug.cgi?id=133023
1396
1397         Reviewed by Eric Carlson.
1398
1399         When seeking a MSE video, do not go down the fastSeekForMediaTime() path if the
1400         seek resulted from a setCurrentTime() call. The logic can lead to attempted seeks
1401         before buffered ranges.
1402
1403         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1404         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
1405         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
1406         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1407         (WebCore::MediaSourcePrivateAVFObjC::seekToTime):
1408
1409 2014-05-16  Benjamin Poulain  <bpoulain@apple.com>
1410
1411         [iOS] ScrollView::visibleContentRectInternal is bypassing the iOS code for unobscuredContentRect
1412         https://bugs.webkit.org/show_bug.cgi?id=133008
1413
1414         Reviewed by Simon Fraser.
1415
1416         * platform/ScrollView.cpp:
1417         (WebCore::ScrollView::visibleContentRectInternal):
1418         ScrollView::visibleContentRectInternal() was calling the internal implementation of visibleContentRect().
1419         That was skipping the iOS implementation and getting the framerect directly. That size is invalid on iOS
1420         when the exposed rect and unobscured rect are not the same.
1421
1422 2014-05-16  Jer Noble  <jer.noble@apple.com>
1423
1424         [Mac] naturalSize not updated when preload=metadata
1425         https://bugs.webkit.org/show_bug.cgi?id=132994
1426
1427         Reviewed by Eric Carlson.
1428
1429         Test: media/video-load-preload-metadata-naturalsize.html
1430
1431         When preload=metadata, we never create an AVPlayerItem, and therefore never receive a
1432         presentationSize KVO. When an AVAsset informs us that its tracks have changed, and there
1433         is no AVPlayerItem, recalculate presentation size based on the first video track's natural
1434         size.
1435
1436         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1437         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1438         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1439         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
1440
1441 2014-05-16  Simon Fraser  <simon.fraser@apple.com>
1442
1443         Remove "region-based columns" prefs
1444         https://bugs.webkit.org/show_bug.cgi?id=133006
1445         <rdar://problem/16945824>
1446
1447         Reviewed by Dave Hyatt.
1448
1449         Remove "region-based columns" prefs and related code, since this is only
1450         way to render columns now.
1451
1452         * page/Settings.in:
1453
1454 2014-05-16  Antti Koivisto  <antti@apple.com>
1455
1456         Link search area for touch events is too large in some cases
1457         https://bugs.webkit.org/show_bug.cgi?id=132988
1458         <rdar://problem/16917843>
1459
1460         Reviewed by Simon Fraser.
1461
1462         * page/ios/FrameIOS.mm:
1463         (WebCore::Frame::qualifyingNodeAtViewportLocation):
1464         
1465             - Adjust the search area to screen ppi.
1466             - Remove cut-off at scale 1. This made us pick physically far-away elements when zoomed in.
1467             
1468         * platform/PlatformScreen.h:
1469         * platform/ios/PlatformScreenIOS.mm:
1470         (WebCore::mobileGestaltFloatValue):
1471         (WebCore::screenPPIFactor):
1472
1473             Figure out screens physical PPI relative to a base.
1474
1475 2014-05-16  Jer Noble  <jer.noble@apple.com>
1476
1477         [MSE] Crash at  WebCore::SourceBuffer::~SourceBuffer + 110
1478         https://bugs.webkit.org/show_bug.cgi?id=132973
1479
1480         Reviewed by Eric Carlson.
1481
1482         Change SourceBuffer::m_private into a Ref<>, and add an assertion to
1483         SourceBufferPrivateAVFObjC's destructor if its client has not been cleared.
1484
1485         Eliminate unnecessary churn in MediaSourcePrivateAVFObjC by having the predicate
1486         functor take bare pointers, rather than a PassRefPtr.
1487
1488         The underlying problem seems to be in WebAVStreamDataParserListener. RefPtrs were
1489         being created off the main thread to a non-thread safe ref counted class. In some
1490         situations, this would result in double decrementing the ref, which would cause an
1491         early destruction of the underlying object. Instead replace these RefPtr strong
1492         pointers with explicit weak ones. Ensure the parser and its delegate are not freed
1493         before the append operation completes by passing strong pointers into the async
1494         append operation lambda.
1495
1496         There were a few places where we weren't null checking m_mediaSource before using it,
1497         and at least one place where we weren't clearing m_mediaSource.
1498
1499         * Modules/mediasource/SourceBuffer.cpp:
1500         (WebCore::SourceBuffer::SourceBuffer): Use Ref instead of RefPtr.
1501         (WebCore::SourceBuffer::appendBufferTimerFired): Ditto.
1502         * Modules/mediasource/SourceBuffer.h:
1503         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1504         (WebCore::MediaSourcePrivateAVFObjCHasAudio): Take a bare pointer, instead of a PassRefPtr.
1505         (WebCore::MediaSourcePrivateAVFObjCHasVideo): Ditto.
1506         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1507         (WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer): Clear the back pointer when removing a buffer.
1508         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1509         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1510         (-[WebAVStreamDataParserListener initWithParser:parent:WebCore::]): Use WeakPtr instead of RefPtr.
1511         (-[WebAVStreamDataParserListener invalidate]): Ditto.
1512         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]): Ditto.
1513         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]): Ditto.
1514         (-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]): Ditto.
1515         (-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]): Ditto.
1516         (-[WebAVStreamDataParserListener streamDataParser:didReachEndOfTrackWithTrackID:mediaType:]): Ditto.
1517         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]): Ditto.
1518         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
1519         (WebCore::SourceBufferPrivateAVFObjC::append): Ditto.
1520
1521 2014-05-16  Zalan Bujtas  <zalan@apple.com>
1522
1523         Subpixel rendering: Push named flows in region to device pixel when painting.
1524         https://bugs.webkit.org/show_bug.cgi?id=132986
1525
1526         Reviewed by Simon Fraser.
1527
1528         Remove integral rounding when named flow sets the painting offset on the graphics context.
1529         Use device pixel snapping instead to ensure that we can paint on odd device pixel positions on retina displays. 
1530
1531         Test: fast/regions/hidpi-region-with-auto-margin-on-subpixel-position.html
1532
1533         * rendering/RenderLayer.cpp:
1534         (WebCore::RenderLayer::calculateClipRects):
1535
1536 2014-05-16  Radu Stavila  <stavila@adobe.com>
1537
1538         [CSS Regions] Add ASSERT to make sure using the flowThread cache does not return incorrect results
1539         https://bugs.webkit.org/show_bug.cgi?id=132906
1540
1541         Reviewed by Simon Fraser.
1542
1543         If flowThreadContainingBlock() is called on an object which is in a different
1544         flow thread than the one currently being laid out, this method will return an incorrect
1545         result. I added an assertion for that to make sure we catch and treat any such scenarios.
1546         For the moment, this assertion is only validated for regions, as multicol still has some issues.
1547
1548         No new tests required.
1549
1550         * rendering/RenderObject.cpp:
1551         (WebCore::RenderObject::locateFlowThreadContainingBlockNoCache):
1552         (WebCore::RenderObject::locateFlowThreadContainingBlock):
1553         * rendering/RenderObject.h:
1554
1555 2014-05-16  Martin Hock  <mhock@apple.com>
1556
1557         MemoryCache::addImageToCache should return the result of add().
1558         https://bugs.webkit.org/show_bug.cgi?id=132928
1559         <rdar://problem/16651547>
1560
1561         Reviewed by Alexey Proskuryakov.
1562
1563         API test: WebKit1.MemoryCacheADdImageToCache (MemoryCacheAddImageToCacheIOS.mm)
1564
1565         * loader/cache/MemoryCache.cpp:
1566         (WebCore::MemoryCache::addImageToCache):
1567
1568 2014-05-16  Andrei Bucur  <abucur@adobe.com>
1569
1570         [CSS Regions] Reduce the RenderRegion invasiveness in rendering code
1571         https://bugs.webkit.org/show_bug.cgi?id=132121
1572
1573         Reviewed by Antti Koivisto.
1574
1575         Remove the RenderRegion / RenderNamedFlowFragment parameters and fields from
1576         the painting / hit testing data structures and use a stateful approach to
1577         correctly handle regions.
1578
1579         When painting or hit testing, the current flow thread is saved along the current
1580         region. They are accessed through the |currentRenderNamedFlowFragment| helper
1581         method on RenderObject or RenderLayer.
1582
1583         The patch also changes a bunch of 0s to nullptrs.
1584
1585         Tests: No new tests, no functional change.
1586
1587         * html/shadow/MediaControlElements.cpp:
1588         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
1589         * rendering/HitTestLocation.cpp:
1590         (WebCore::HitTestLocation::HitTestLocation):
1591         (WebCore::HitTestLocation::operator=):
1592         * rendering/HitTestLocation.h:
1593         (WebCore::HitTestLocation::region): Deleted.
1594         * rendering/HitTestResult.h:
1595         * rendering/PaintInfo.h:
1596         (WebCore::PaintInfo::PaintInfo):
1597         * rendering/RenderBlock.cpp:
1598         (WebCore::RenderBlock::paint):
1599         (WebCore::RenderBlock::paintObject):
1600         (WebCore::RenderBlock::selectionGaps):
1601         (WebCore::RenderBlock::nodeAtPoint):
1602         * rendering/RenderBox.cpp:
1603         (WebCore::RenderBox::nodeAtPoint):
1604         (WebCore::RenderBox::paintBoxDecorations):
1605         (WebCore::RenderBox::pushContentsClip):
1606         * rendering/RenderBoxModelObject.cpp:
1607         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
1608         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1609         * rendering/RenderBoxModelObject.h:
1610         * rendering/RenderLayer.cpp:
1611         (WebCore::RenderLayer::paint):
1612         (WebCore::RenderLayer::paintLayer):
1613         (WebCore::RenderLayer::paintLayerContents):
1614         (WebCore::RenderLayer::paintLayerByApplyingTransform):
1615         (WebCore::RenderLayer::collectFragments):
1616         (WebCore::RenderLayer::updatePaintingInfoForFragments):
1617         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
1618         (WebCore::RenderLayer::paintBackgroundForFragments):
1619         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
1620         (WebCore::RenderLayer::paintOutlineForFragments):
1621         (WebCore::RenderLayer::paintMaskForFragments):
1622         (WebCore::RenderLayer::hitTest):
1623         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
1624         (WebCore::RenderLayer::hitTestLayer):
1625         (WebCore::RenderLayer::hitTestTransformedLayerInFragments):
1626         (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
1627         (WebCore::RenderLayer::calculateClipRects):
1628         * rendering/RenderLayer.h:
1629         * rendering/RenderLayerBacking.cpp:
1630         (WebCore::RenderLayerBacking::updateCompositedBounds):
1631         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
1632         * rendering/RenderLayerCompositor.cpp:
1633         (WebCore::RenderLayerCompositor::addToOverlapMap):
1634         (WebCore::RenderLayerCompositor::clippedByAncestor):
1635         * rendering/RenderObject.cpp:
1636         (WebCore::RenderObject::currentRenderNamedFlowFragment):
1637         * rendering/RenderObject.h:
1638         * rendering/RenderReplaced.cpp:
1639         (WebCore::RenderReplaced::shouldPaint):
1640         * rendering/RenderReplica.cpp:
1641         (WebCore::RenderReplica::paint):
1642         * rendering/RenderTable.cpp:
1643         (WebCore::RenderTable::nodeAtPoint):
1644         * rendering/RenderTableSection.cpp:
1645         (WebCore::RenderTableSection::nodeAtPoint):
1646         * rendering/RenderTreeAsText.cpp:
1647         (WebCore::writeLayers):
1648         * rendering/RootInlineBox.cpp:
1649         (WebCore::RootInlineBox::paint):
1650         * rendering/svg/RenderSVGRoot.cpp:
1651         (WebCore::RenderSVGRoot::paintReplaced):
1652
1653 2014-05-16  Kiran  <kiran.guduru@samsung.com>
1654
1655         RTCDtmfSender default values need to be updated.
1656         https://bugs.webkit.org/show_bug.cgi?id=132952
1657
1658         Reviewed by Eric Carlson.
1659
1660         The default ToneDuration and ToneGap values are modified in the updated spec.
1661         So these values need to be updated.
1662
1663         Test: fast/mediastream/RTCPeerConnection-dtmf.html.
1664
1665         * Modules/mediastream/RTCDTMFSender.cpp:
1666
1667 2014-05-15  Daniel Bates  <dabates@apple.com>
1668
1669         Attempt to fix the Apple Mavericks Release, Apple MountainLion Release,
1670         Apple MountainLion Release (32-bit Build), EFL, and GTK builds following
1671         <http://trac.webkit.org/changeset/168921> (https://bugs.webkit.org/show_bug.cgi?id=132669)
1672
1673         * dom/ContainerNode.cpp: Include SVGElement.h for the definition of Node::hasTagName(const SVGQualifiedName&).
1674
1675 2014-05-15  Daniel Bates  <dabates@apple.com>
1676
1677         ASSERT_NOT_REACHED() in DocumentOrderedMap::get() when removing SVG subtree
1678         https://bugs.webkit.org/show_bug.cgi?id=132669
1679         <rdar://problem/14931432>
1680
1681         Reviewed by Brent Fulgham and Ryosuke Niwa.
1682
1683         Fixes an assertion failure when removing an SVG element with a duplicate id.
1684
1685         When removing an SVG element with id A we synchronously instruct each element that references A
1686         to find the first element with id A, call this N, from the document root and register itself to
1687         either receive subsequent notifications from N (say, there is another element with id A) or as
1688         waiting for an element with id A (say, N = nullptr; => we removed the last element with id A from
1689         the document). Because the elements that reference A perform this operation synchronously when
1690         removing an element they consult an transient state of the DocumentOrderedMap when querying for the
1691         element with id A.
1692     
1693         Without loss of generality, let E, E_1, E_2, and E_3 be elements, where E_1, E_2, E_3 are children
1694         of E in that order and E_1.id = E_2.id = A and E_3.href = #A (that is, it references an element
1695         with id A). Suppose we remove E then we remove E_1, update DocumentOrderedMap to decrement its count
1696         for id A, and notify E_3 to look for an element with id A. This leads to an assertion failure since
1697         DocumentOrderedMap expects to find an element with id A, E_2, but cannot find such an element when
1698         traversing from the document root because E was unlinked from the document root (i.e. E_2 is in a
1699         disjoint subtree).
1700
1701         Tests: svg/custom/change-id-of-use-during-removal.html
1702                svg/custom/remove-subtree-including-path-with-duplicate-id-referenced-by-later-textpath.html
1703                svg/custom/remove-subtree-including-text-with-duplicate-id-referenced-by-later-tref.html
1704                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-earlier-use.html
1705                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-later-animate.html
1706                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-later-feimage.html
1707                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-later-mpath.html
1708                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-later-use.html
1709                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-later-use2.html
1710                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-use-in-different-subtree.html
1711                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-use-with-duplicate-id-in-different-subtree.html
1712                svg/custom/remove-use-with-duplicate-id-referenced-by-later-use.html
1713
1714         * dom/ContainerNode.cpp:
1715         (WebCore::ContainerNode::removeChild): Call SVGDocumentExtensions::rebuildElements() after we remove
1716         a DOM subtree so that applicable SVG elements can update their referenced element when the DocumentOrderedMap
1717         is in a stable-state.
1718         (WebCore::ContainerNode::removeChildren): Ditto.
1719         * svg/SVGDocumentExtensions.cpp:
1720         (WebCore::SVGDocumentExtensions::rebuildElements): Added; notifies SVG elements that their href attribute
1721         changed so that they query the DocumentOrderedMap for the element they reference by id in their href attribute.
1722         (WebCore::SVGDocumentExtensions::clearTargetDependencies): Added; Called from removing
1723         an SVG element S from the DOM. Appends all elements that reference the id of S to the end of a Vector of
1724         elements to be rebuilt (when SVGDocumentExtensions::rebuildElements() is called) and notifies these elements
1725         that have been marked to be rebuilt so that they can invalidate their state (e.g. stop animating).
1726         (WebCore::SVGDocumentExtensions::rebuildAllElementReferencesForTarget): Changed to take its argument by reference
1727         (since it's always non-null) and simplified logic to synchronously notify SVG updates that their referenced element
1728         may have changed. Calling SVGElement::svgAttributeChanged() on an element E should at most remove the dependencies
1729         of E.
1730         * svg/SVGDocumentExtensions.h:
1731         * svg/SVGElement.cpp:
1732         (WebCore::SVGElement::~SVGElement): Substitute "*this" for "this" as SVGDocumentExtensions::rebuildAllElementReferencesForTarget()
1733         now takes a reference instead of a pointer.
1734         (WebCore::SVGElement::removedFrom): Modified to call SVGDocumentExtensions::clearTargetDependencies().
1735         (WebCore::SVGElement::attributeChanged): Substitute "*this" for "this" as SVGDocumentExtensions::rebuildAllElementReferencesForTarget()
1736         now takes a reference instead of a pointer.
1737         * svg/SVGElement.h:
1738         (WebCore::SVGElement::callClearTarget): Added; calls through to private virtual SVGElement::clearTarget().
1739         (WebCore::SVGElement::clearTarget): Added.
1740         * svg/SVGTRefElement.cpp:
1741         (WebCore::SVGTRefElement::clearTarget): Added.
1742         * svg/SVGTRefElement.h:
1743         * svg/animation/SVGSMILElement.cpp:
1744         (WebCore::SVGSMILElement::clearTarget): Added.
1745         * svg/animation/SVGSMILElement.h:
1746
1747 2014-05-15  Simon Fraser  <simon.fraser@apple.com>
1748
1749         [iOS WK2] When zoomed, fixed elements jump at the start of a scroll, and jump back at the end.
1750         https://bugs.webkit.org/show_bug.cgi?id=132978
1751         <rdar://problem/16894428>
1752
1753         Reviewed by Benjamin Poulain.
1754
1755         This was the actual cause of the bug; r168560 changed the rect passed in here
1756         to be the customFixedPositionRect rather than the unobscured rect, but we
1757         used it to call FrameView::rectForViewportConstrainedObjects() which gave back
1758         another bogus rect. So just use the rect passed in.
1759
1760         * page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm:
1761         (WebCore::ScrollingTreeScrollingNodeIOS::updateLayersAfterViewportChange):
1762
1763 2014-05-15  Daniel Bates  <dabates@apple.com>
1764
1765         SVG element may reference arbitrary DOM element before running its insertion logic
1766         https://bugs.webkit.org/show_bug.cgi?id=132757
1767         <rdar://problem/15703817>
1768
1769         Reviewed by Ryosuke Niwa.
1770
1771         Fixes an issue where an SVG element may reference an arbitrary DOM element e before e finished being
1772         inserted in the tree.
1773
1774         Currently when an SVG element A is inserted into a document we use document.getElementById() to find the
1775         element B it references (if any). If A is inserted before B and B has the same id as a later element in
1776         the document then A can find B before B is notified that its been inserted into the document (i.e. before
1777         Element::insertedFrom() is called on B). Instead, A should call document.getElementById() only after
1778         cessation of the insertion operation that inserted it to ensure that all inserted nodes (including B)
1779         processed their insertion-specific logic.
1780
1781         Tests: svg/custom/reparent-animate-element.html
1782                svg/custom/reparent-feimage-element.html
1783                svg/custom/reparent-mpath-element.html
1784                svg/custom/reparent-textpath-element.html
1785                svg/custom/reparent-tref-element.html
1786                svg/custom/reparent-use-element.html
1787
1788         * svg/SVGFEImageElement.cpp:
1789         (WebCore::SVGFEImageElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
1790         we are called back to resolve our target element (i.e. call SVGFEImageElement::buildPendingResources())
1791         after the subtree we're in is inserted.
1792         (WebCore::SVGFEImageElement::didNotifySubtreeInsertions): Added; turns around and calls SVGFEImageElement::buildPendingResources().
1793         * svg/SVGFEImageElement.h:
1794         * svg/SVGMPathElement.cpp:
1795         (WebCore::SVGMPathElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
1796         we are called back to resolve our target element (i.e. call SVGMPathElement::buildPendingResources())
1797         after the subtree we're in is inserted.
1798         (WebCore::SVGMPathElement::didNotifySubtreeInsertions): Added; turns around and calls SVGMPathElement::buildPendingResources().
1799         * svg/SVGMPathElement.h:
1800         * svg/SVGTRefElement.cpp:
1801         (WebCore::SVGTRefElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
1802         we are called back to resolve our target element (i.e. call SVGTRefElement::buildPendingResources())
1803         after the subtree we're in is inserted.
1804         (WebCore::SVGTRefElement::didNotifySubtreeInsertions): Added; turns around and calls SVGTRefElement::buildPendingResources().
1805         * svg/SVGTRefElement.h:
1806         * svg/SVGTextPathElement.cpp:
1807         (WebCore::SVGTextPathElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
1808         we are called back to resolve our target element (i.e. call SVGTextPathElement::buildPendingResources())
1809         after the subtree we're in is inserted.
1810         (WebCore::SVGTextPathElement::didNotifySubtreeInsertions): Added; turns around and calls SVGTextPathElement::buildPendingResources().
1811         * svg/SVGTextPathElement.h:
1812         * svg/SVGUseElement.cpp:
1813         (WebCore::SVGUseElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
1814         we are called back to resolve our target element (i.e. call SVGUseElement::buildPendingResources()) after its subtree is
1815         inserted.
1816         (WebCore::SVGUseElement::didNotifySubtreeInsertions): Added; turns around and calls SVGUseElement::buildPendingResources().
1817         * svg/SVGUseElement.h:
1818         * svg/animation/SVGSMILElement.cpp:
1819         (WebCore::SVGSMILElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
1820         we are called back to resolve our target element (i.e. call SVGSMILElement::buildPendingResources())
1821         after the subtree we're in is inserted.
1822         (WebCore::SVGSMILElement::didNotifySubtreeInsertions): Added; turns around and calls SVGSMILElement::buildPendingResources().
1823         * svg/animation/SVGSMILElement.h:
1824
1825 2014-05-15  Mark Hahnenberg  <mhahnenberg@apple.com>
1826
1827         JSDOMWindow should not claim HasImpureGetOwnPropertySlot
1828         https://bugs.webkit.org/show_bug.cgi?id=132918
1829
1830         Reviewed by Geoffrey Garen.
1831
1832         Tests: js/cached-window-properties.html
1833                js/cached-window-prototype-properties.html
1834
1835         We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the 
1836         blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding
1837         any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow 
1838         us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used 
1839         across the web.
1840
1841         * bindings/js/JSDOMWindowCustom.cpp:
1842         (WebCore::JSDOMWindow::getOwnPropertySlot):
1843         * bindings/scripts/CodeGeneratorJS.pm:
1844         (HasComplexGetOwnProperty):
1845         (InterfaceRequiresAttributesOnInstance):
1846         (InstanceOverridesGetOwnPropertySlot):
1847         (GenerateHeader):
1848
1849 2014-05-15  Alexey Proskuryakov  <ap@apple.com>
1850
1851         NetworkProcess crashes at ResourceHandle::continueDidReceiveResponse
1852         https://bugs.webkit.org/show_bug.cgi?id=132966
1853         <rdar://problem/16373694>
1854
1855         Reviewed by Brady Eidson.
1856
1857         Covered by many fast/files tests.
1858
1859         * platform/network/BlobResourceHandle.cpp: (WebCore::BlobResourceHandle::continueDidReceiveResponse):
1860         * platform/network/BlobResourceHandle.h:
1861         * platform/network/ResourceHandle.h:
1862         Don't call delegate's continueDidReceiveResponse when loading a blob:// URL,
1863         the delegate is null. On the Mac, we used to lazily create it, which was also wrong,
1864         but at least not observable.
1865
1866 2014-05-15  Commit Queue  <commit-queue@webkit.org>
1867
1868         Unreviewed, rolling out r168899.
1869         https://bugs.webkit.org/show_bug.cgi?id=132965
1870
1871         Broke some compositing regions tests on Mavericks (Requested
1872         by mihnea___ on #webkit).
1873
1874         Reverted changeset:
1875
1876         "[CSS Regions] Reduce the RenderRegion invasiveness in
1877         rendering code"
1878         https://bugs.webkit.org/show_bug.cgi?id=132121
1879         http://trac.webkit.org/changeset/168899
1880
1881 2014-05-15  Alex Christensen  <achristensen@webkit.org>
1882
1883         Add pointer lock to features without enabling it.
1884         https://bugs.webkit.org/show_bug.cgi?id=132961
1885
1886         Reviewed by Sam Weinig.
1887
1888         * Configurations/FeatureDefines.xcconfig:
1889         Added ENABLE_POINTER_LOCK to list of features.
1890         * WebCore.exp.in:
1891         Added linker symbols which differ with pointer lock enabled.
1892         * WebCore.xcodeproj/project.pbxproj:
1893         Added PointerLockController.cpp to build.
1894
1895 2014-05-15  Mark Hahnenberg  <mhahnenberg@apple.com>
1896
1897         Move subframe name getter lookup later in JSDOMWindow::getOwnPropertySlot
1898         https://bugs.webkit.org/show_bug.cgi?id=132922
1899
1900         Reviewed by Geoffrey Garen.
1901
1902         No new tests.
1903
1904         In JSDOMWindow::getOwnPropertySlot, we currently look for the property on the JSDOMWindow, 
1905         then we search the window's subframes for name getters, then we look in the window's prototype 
1906         chain. Apparently we were doing the lookup in this order to be compatible with Mozilla, but 
1907         Mozilla no longer implements this behavior. Instead, they do the lookup on the prototype before 
1908         looking for subframe name getters. We should change this to match Mozilla. This has the convenient 
1909         side effect of allowing us to cache lookups in the window's prototype chain.
1910
1911         * bindings/js/JSDOMWindowCustom.cpp:
1912         (WebCore::JSDOMWindow::getOwnPropertySlot):
1913
1914 2014-05-15  Simon Fraser  <simon.fraser@apple.com>
1915
1916         [UI-side compositing] Fix copying animations between layers, and pausing them
1917         https://bugs.webkit.org/show_bug.cgi?id=132943
1918         <rdar://problem/16906369&16906541>
1919
1920         Reviewed by Tim Horton.
1921
1922         Pass the animation key back to animationStarted(), though this isn't used
1923         when animations are running in-process.
1924
1925         * platform/graphics/ca/PlatformCALayer.h:
1926         * platform/graphics/ca/mac/PlatformCALayerMac.h:
1927         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1928         (-[WebAnimationDelegate animationDidStart:]):
1929         (PlatformCALayerMac::animationStarted):
1930         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1931         (PlatformCALayerWin::animationStarted):
1932         * platform/graphics/ca/win/PlatformCALayerWin.h:
1933
1934 2014-05-15  Andrei Bucur  <abucur@adobe.com>
1935
1936         [CSS Regions] Reduce the RenderRegion invasiveness in rendering code
1937         https://bugs.webkit.org/show_bug.cgi?id=132121
1938
1939         Reviewed by Antti Koivisto.
1940
1941         Remove the RenderRegion / RenderNamedFlowFragment parameters and fields from
1942         the painting / hit testing data structures and use a stateful approach to
1943         correctly handle regions.
1944
1945         When painting or hit testing, the current flow thread is saved along the current
1946         region. They are accessed through the |currentRenderNamedFlowFragment| helper
1947         method on RenderObject or RenderLayer.
1948
1949         The patch also changes a bunch of 0s to nullptrs.
1950
1951         Tests: No new tests, no functional change.
1952
1953         * html/shadow/MediaControlElements.cpp:
1954         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
1955         * rendering/HitTestLocation.cpp:
1956         (WebCore::HitTestLocation::HitTestLocation):
1957         (WebCore::HitTestLocation::operator=):
1958         * rendering/HitTestLocation.h:
1959         (WebCore::HitTestLocation::region): Deleted.
1960         * rendering/HitTestResult.h:
1961         * rendering/PaintInfo.h:
1962         (WebCore::PaintInfo::PaintInfo):
1963         * rendering/RenderBlock.cpp:
1964         (WebCore::RenderBlock::paint):
1965         (WebCore::RenderBlock::paintObject):
1966         (WebCore::RenderBlock::selectionGaps):
1967         (WebCore::RenderBlock::nodeAtPoint):
1968         * rendering/RenderBox.cpp:
1969         (WebCore::RenderBox::nodeAtPoint):
1970         (WebCore::RenderBox::paintBoxDecorations):
1971         (WebCore::RenderBox::pushContentsClip):
1972         * rendering/RenderBoxModelObject.cpp:
1973         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
1974         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1975         * rendering/RenderBoxModelObject.h:
1976         * rendering/RenderLayer.cpp:
1977         (WebCore::RenderLayer::paint):
1978         (WebCore::RenderLayer::paintLayer):
1979         (WebCore::RenderLayer::paintLayerContents):
1980         (WebCore::RenderLayer::paintLayerByApplyingTransform):
1981         (WebCore::RenderLayer::collectFragments):
1982         (WebCore::RenderLayer::updatePaintingInfoForFragments):
1983         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
1984         (WebCore::RenderLayer::paintBackgroundForFragments):
1985         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
1986         (WebCore::RenderLayer::paintOutlineForFragments):
1987         (WebCore::RenderLayer::paintMaskForFragments):
1988         (WebCore::RenderLayer::hitTest):
1989         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
1990         (WebCore::RenderLayer::hitTestLayer):
1991         (WebCore::RenderLayer::hitTestTransformedLayerInFragments):
1992         (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
1993         (WebCore::RenderLayer::calculateClipRects):
1994         * rendering/RenderLayer.h:
1995         * rendering/RenderLayerBacking.cpp:
1996         (WebCore::RenderLayerBacking::updateCompositedBounds):
1997         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
1998         * rendering/RenderLayerCompositor.cpp:
1999         (WebCore::RenderLayerCompositor::addToOverlapMap):
2000         (WebCore::RenderLayerCompositor::clippedByAncestor):
2001         * rendering/RenderObject.cpp:
2002         (WebCore::RenderObject::currentRenderNamedFlowFragment):
2003         * rendering/RenderObject.h:
2004         * rendering/RenderReplaced.cpp:
2005         (WebCore::RenderReplaced::shouldPaint):
2006         * rendering/RenderReplica.cpp:
2007         (WebCore::RenderReplica::paint):
2008         * rendering/RenderTable.cpp:
2009         (WebCore::RenderTable::nodeAtPoint):
2010         * rendering/RenderTableSection.cpp:
2011         (WebCore::RenderTableSection::nodeAtPoint):
2012         * rendering/RenderTreeAsText.cpp:
2013         (WebCore::writeLayers):
2014         * rendering/RootInlineBox.cpp:
2015         (WebCore::RootInlineBox::paint):
2016         * rendering/svg/RenderSVGRoot.cpp:
2017         (WebCore::RenderSVGRoot::paintReplaced):
2018
2019 2014-05-14  Simon Fraser  <simon.fraser@apple.com>
2020
2021         Clean up "has non-zero begin time" terminology in animations
2022         https://bugs.webkit.org/show_bug.cgi?id=132942
2023
2024         Reviewed by Tim Horton.
2025
2026         Change the "non-zero beginTime" terminology in the platform CA animations
2027         code to "explicit beginTime": this flag really means that we explicitly set
2028         the beginTime of the animation, rather than let CA set the beginTime when
2029         committing the animation. This flag is used for animations with negative
2030         delay, and when pausing.
2031         
2032         The WKNonZeroBeginTimeFlag key was spread across PlatformCALayerMac and PlatformCAAnimationMac,
2033         so hide it behind getter/setter functions.
2034         
2035         Remove lots of m_layer.get() in PlatformCAAnimationMac.
2036
2037         * platform/graphics/ca/mac/PlatformCAAnimationMac.h:
2038         * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
2039         (WebCore::hasExplicitBeginTime):
2040         (WebCore::setHasExplicitBeginTime):
2041         (PlatformCAAnimationMac::copy):
2042         (PlatformCAAnimationMac::keyPath):
2043         (PlatformCAAnimationMac::beginTime):
2044         (PlatformCAAnimationMac::setBeginTime):
2045         (PlatformCAAnimationMac::duration):
2046         (PlatformCAAnimationMac::setDuration):
2047         (PlatformCAAnimationMac::speed):
2048         (PlatformCAAnimationMac::setSpeed):
2049         (PlatformCAAnimationMac::timeOffset):
2050         (PlatformCAAnimationMac::setTimeOffset):
2051         (PlatformCAAnimationMac::repeatCount):
2052         (PlatformCAAnimationMac::setRepeatCount):
2053         (PlatformCAAnimationMac::autoreverses):
2054         (PlatformCAAnimationMac::setAutoreverses):
2055         (PlatformCAAnimationMac::fillMode):
2056         (PlatformCAAnimationMac::setFillMode):
2057         (PlatformCAAnimationMac::setTimingFunction):
2058         (PlatformCAAnimationMac::copyTimingFunctionFrom):
2059         (PlatformCAAnimationMac::isRemovedOnCompletion):
2060         (PlatformCAAnimationMac::setRemovedOnCompletion):
2061         (PlatformCAAnimationMac::isAdditive):
2062         (PlatformCAAnimationMac::setAdditive):
2063         (PlatformCAAnimationMac::valueFunction):
2064         (PlatformCAAnimationMac::setValueFunction):
2065         (hasNonZeroBeginTimeFlag): Deleted.
2066         (setNonZeroBeginTimeFlag): Deleted.
2067         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2068         (-[WebAnimationDelegate animationDidStart:]):
2069
2070 2014-05-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2071
2072         [GTK] Compile all installed resources as GResources
2073         https://bugs.webkit.org/show_bug.cgi?id=131099
2074
2075         Reviewed by Philippe Normand.
2076
2077         * PlatformGTK.cmake: Do not install the resources.
2078         * platform/audio/gtk/AudioBusGtk.cpp:
2079         (WebCore::AudioBus::loadPlatformResource): Load the audio resource
2080         from GResources and use createBusFromInMemoryAudioFile().
2081         * platform/graphics/Image.h: Remove unsued function loadPlatformThemeIcon.
2082         * platform/graphics/gtk/ImageGtk.cpp:
2083         (WebCore::loadImageFromGResource): Load the given icon name from GResources.
2084         (WebCore::loadResourceSharedBuffer): Use char* instead of CString.
2085         (WebCore::loadMissingImageIconFromTheme): Try to load the missing
2086         icon from the current GTK icon theme.
2087         (WebCore::Image::loadPlatformResource): Call
2088         loadMissingImageIconFromTheme for missing icon or
2089         loadImageFromGResource for any other icon name.
2090         (WebCore::getPathToImageResource): Deleted.
2091         (WebCore::getThemeIconFileName): Deleted.
2092         (WebCore::loadImageFromFile): Deleted.
2093         (WebCore::Image::loadPlatformThemeIcon): Deleted.
2094
2095 2014-05-14  Beth Dakin  <bdakin@apple.com>
2096
2097         Tiled scrolling indicator needs to take topContentInset into account
2098         https://bugs.webkit.org/show_bug.cgi?id=132940
2099
2100         Reviewed by Simon Fraser.
2101
2102         The tiled scrolling indicator needs to move down by the value of the 
2103         topContentInset. This patch makes that happen by caching the topContentInset in 
2104         the TileController. This does feel a little silly since there is already a 
2105         function called setTiledScrollingIndicatorPosition() on TiledBacking. However, it 
2106         was often the case that calling that function had no effect because m_coverageMap 
2107         had not yet been created, and then the information was lost. So instead, we cache 
2108         the value.
2109
2110         Set TiledBacking’s copy of topContentInset whenever it changes for the FrameView.
2111         * page/FrameView.cpp:
2112         (WebCore::FrameView::topContentInsetDidChange):
2113
2114         New function to set the inset. Use the inset to position the coverage map.
2115         * platform/graphics/TiledBacking.h:
2116         * platform/graphics/ca/mac/TileController.h:
2117         * platform/graphics/ca/mac/TileController.mm:
2118         (WebCore::TileController::TileController):
2119         (WebCore::TileController::setTopContentInset):
2120
2121         When the coverage map is created, consult the value of the inset.
2122         * platform/graphics/ca/mac/TileCoverageMap.mm:
2123         (WebCore::TileCoverageMap::TileCoverageMap):
2124
2125         Once the backing has been ensured, set the inset.
2126         * rendering/RenderLayerCompositor.cpp:
2127         (WebCore::RenderLayerCompositor::updateBacking):
2128
2129 2014-05-14  Brent Fulgham  <bfulgham@apple.com>
2130
2131         Merge r1267628 from branch.
2132         <rdar://problem/15751219>
2133
2134             Pratik Solanki  <psolanki@apple.com>
2135
2136             Reviewed by Simon Fraser.",
2137
2138             TileController relied on the tiling mode in TileCache to determine if it should use low-res
2139             tiles when zooming. Unfortunately, sometimes the tiling mode gets set to Zooming even though
2140             it's actually a pan. Thus we can end up with blurry tiles. Fix this by adding a new flag on
2141             TileCache that controls this behavior and have UIKit set it only when we have an actual zoom
2142             operation.
2143  
2144         * platform/ios/LegacyTileCache.h:
2145         (WebCore::LegacyTileCache::tileControllerShouldUseLowScaleTiles):
2146         (WebCore::LegacyTileCache::setTileControllerShouldUseLowScaleTiles):
2147         * platform/ios/LegacyTileCache.mm:
2148         (WebCore::LegacyTileCache::LegacyTileCache):
2149         * platform/ios/wak/WAKWindow.h:
2150         * platform/ios/wak/WAKWindow.mm:
2151         (-[WAKWindow setTileControllerShouldUseLowScaleTiles:]):
2152         * rendering/RenderLayerCompositor.cpp:
2153         (WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles):
2154
2155 2014-05-14  Commit Queue  <commit-queue@webkit.org>
2156
2157         Unreviewed, rolling out r168750.
2158         https://bugs.webkit.org/show_bug.cgi?id=132935
2159
2160         Caused repaint bugs (Requested by weinig on #webkit).
2161
2162         Reverted changeset:
2163
2164         "Text decorations do not contribute to visual overflow"
2165         https://bugs.webkit.org/show_bug.cgi?id=132773
2166         http://trac.webkit.org/changeset/168750
2167
2168 2014-05-14  Simon Fraser  <simon.fraser@apple.com>
2169
2170         [New multicolumn] Spin in RenderMultiColumnSet::repaintFlowThreadContent()
2171         https://bugs.webkit.org/show_bug.cgi?id=132884
2172
2173         Reviewed by Beth Dakin.
2174
2175         On iOS, wikipedia pages can hang under RenderMultiColumnSet::repaintFlowThreadContent().
2176         It appears that computedColumnHeight is set to 0 in prepareForLayout, but layout never happens
2177         on the RenderMultiColumnSet in some cases, leaving the column height set to zero.
2178         This caused columnIndexAtOffset() to return bad values, which resulted in very long loops
2179         in repaintFlowThreadContent().
2180         
2181         This fix is a stop-gap.
2182
2183         * rendering/RenderMultiColumnSet.cpp:
2184         (WebCore::RenderMultiColumnSet::columnIndexAtOffset):
2185
2186 2014-05-14  Benjamin Poulain  <bpoulain@apple.com>
2187
2188         Remove FrameView::viewportConstrainedExtentRect, it is unused
2189         https://bugs.webkit.org/show_bug.cgi?id=132927
2190
2191         Reviewed by Simon Fraser.
2192
2193         * page/FrameView.cpp:
2194         (WebCore::FrameView::viewportConstrainedExtentRect): Deleted.
2195         * page/FrameView.h:
2196         Simon replaced this by viewportConstrainedVisibleContentRect, remove the old code.
2197
2198 2014-05-14  Matthew Hanson  <matthew_hanson@apple.com>
2199
2200         Only define MAX_GRID_TRACK_REPETITIONS if CSS_GRID_LAYOUT is enabled.
2201
2202         Reviewed by Dean Jackson.
2203
2204         This was causing -Wunused-const-variable errors.
2205
2206         * css/CSSParser.cpp: Add include guard.
2207
2208 2014-05-14  Beth Dakin  <bdakin@apple.com>
2209
2210         Tile cache has way too many tiles when pinch-zoomed in
2211         https://bugs.webkit.org/show_bug.cgi?id=132929
2212         -and corresponding-
2213         <rdar://problem/16527172>
2214
2215         Reviewed by Benjamin Poulain.
2216
2217         This patch makes the margin sizing functions return the set margin size scaled by 
2218         the TileGrid's scale. We also need to get rid of the old notion we used to have
2219         that margin tiles might be allowed to have a different size than the other tiles. 
2220         We don't want that. They should have the normal margin size, but they should
2221         affect the overall coverage area.
2222
2223         Scale by the TileGrid's scale.
2224         * platform/graphics/ca/mac/TileController.mm:
2225         (WebCore::TileController::topMarginHeight):
2226         (WebCore::TileController::bottomMarginHeight):
2227         (WebCore::TileController::leftMarginWidth):
2228         (WebCore::TileController::rightMarginWidth):
2229
2230         Get rid of adjustRectAtTileIndexForMargin() since we do not want to ever do this 
2231         adjustment. Use tileSize instead of margin size for all sizing computations.
2232         * platform/graphics/ca/mac/TileGrid.h:
2233         * platform/graphics/ca/mac/TileGrid.mm:
2234         (WebCore::TileGrid::rectForTileIndex):
2235         (WebCore::TileGrid::getTileIndexRangeForRect):
2236         (WebCore::TileGrid::adjustRectAtTileIndexForMargin): Deleted.
2237
2238 2014-05-14  Dean Jackson  <dino@apple.com>
2239
2240         [Mac] Search fields should not use centered look
2241         https://bugs.webkit.org/show_bug.cgi?id=132930
2242         <rdar://problem/16825842>
2243
2244         Reviewed by Beth Dakin.
2245
2246         We need to explicitly set the centeredLook property
2247         to NO on modern releases of Mac.
2248
2249         * rendering/RenderThemeMac.mm: Declare a new private property and set it to NO.
2250         (WebCore::RenderThemeMac::search):
2251
2252 2014-05-14  Zalan Bujtas  <zalan@apple.com>
2253
2254         Subpixel layout: Change Element.offset* client* scroll* return type to double.
2255         https://bugs.webkit.org/show_bug.cgi?id=132895
2256
2257         Reviewed by Simon Fraser.
2258
2259         This patch changes Element.offset*, Element.client* and Element.scroll* APIs return
2260         type from long to double to match the latest CSSOM View Module spec[1].
2261         Element.offset* and Element.client* do return subpixel values from now on.
2262         Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet.
2263
2264         subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off
2265         from WK2 preferences. It toggles the return value from subpixel to floored integral.
2266         It does not change layout/rendering behavior.
2267
2268         Reference list of what other browsers do:
2269         IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx
2270         Blink: http://www.chromestatus.com/features/5497402177880064
2271         Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607
2272
2273         [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/
2274
2275         Test: cssom/subpixel-offsetleft-top-width-height-values.html
2276
2277         * dom/Element.cpp:
2278         (WebCore::localZoomForRenderer):
2279         (WebCore::adjustForLocalZoom):
2280         (WebCore::convertToNonSubpixelValueIfNeeded):
2281         (WebCore::Element::offsetLeft):
2282         (WebCore::Element::offsetTop):
2283         (WebCore::Element::offsetWidth):
2284         (WebCore::Element::offsetHeight):
2285         (WebCore::Element::clientLeft):
2286         (WebCore::Element::clientTop):
2287         (WebCore::Element::clientWidth):
2288         (WebCore::Element::clientHeight):
2289         (WebCore::Element::scrollLeft):
2290         (WebCore::Element::scrollTop):
2291         (WebCore::Element::setScrollLeft):
2292         (WebCore::Element::setScrollTop):
2293         (WebCore::Element::scrollWidth):
2294         (WebCore::Element::scrollHeight):
2295         * dom/Element.h:
2296         * dom/Element.idl:
2297         * html/HTMLBodyElement.cpp:
2298         (WebCore::adjustForZoom):
2299         (WebCore::HTMLBodyElement::scrollLeft):
2300         (WebCore::HTMLBodyElement::setScrollLeft):
2301         (WebCore::HTMLBodyElement::scrollTop):
2302         (WebCore::HTMLBodyElement::setScrollTop):
2303         (WebCore::HTMLBodyElement::scrollHeight):
2304         (WebCore::HTMLBodyElement::scrollWidth):
2305         * html/HTMLBodyElement.h:
2306         * page/Settings.in:
2307
2308 2014-05-14  Brady Eidson  <beidson@apple.com>
2309
2310         Implement NSSharingServiceDelegate method "transitionImageForShareItem"
2311         <rdar://problem/16878020> and https://bugs.webkit.org/show_bug.cgi?id=132911
2312
2313         Reviewed by Tim Horton.
2314
2315         * WebCore.exp.in:
2316         * WebCore.xcodeproj/project.pbxproj:
2317
2318 2014-05-14  Alex Christensen  <achristensen@webkit.org>
2319
2320         Another unreviewed build fix.
2321
2322         * platform/network/mac/ResourceHandleMac.mm:
2323         (WebCore::ResourceHandle::getTimingData):
2324         Added necessary UNUSED_PARAMs.
2325
2326 2014-05-14  Alex Christensen  <achristensen@webkit.org>
2327
2328         Unreviewed build fix after r168849.
2329
2330         * platform/network/mac/ResourceHandleMac.mm:
2331         (WebCore::ResourceHandle::getTimingData):
2332         Protect use of timing data with ENABLE(WEB_TIMING).
2333
2334 2014-05-14  Alex Christensen  <achristensen@webkit.org>
2335
2336         Refactor duplicate code in web timing.
2337         https://bugs.webkit.org/show_bug.cgi?id=132917
2338
2339         Reviewed by Alexey Proskuryakov.
2340
2341         * platform/network/ResourceHandle.h:
2342         Added getTimingData declaration.
2343         * platform/network/mac/ResourceHandleMac.mm:
2344         (WebCore::ResourceHandle::getTimingData):
2345         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2346         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
2347         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2348         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
2349         Moved duplicate code to ResourceHandle.
2350
2351 2014-05-14  Alex Christensen  <achristensen@webkit.org>
2352
2353         Use references instead of pointers with ResourceLoadTiming.
2354         https://bugs.webkit.org/show_bug.cgi?id=132846
2355
2356         Reviewed by Alexey Proskuryakov.
2357
2358         * WebCore.exp.in:
2359         Removed ResourceResponseBase::setResourceLoadTiming linker symbol.
2360         * inspector/InspectorResourceAgent.cpp:
2361         (WebCore::buildObjectForResourceResponse):
2362         * page/PerformanceResourceTiming.cpp:
2363         (WebCore::PerformanceResourceTiming::domainLookupStart):
2364         (WebCore::PerformanceResourceTiming::domainLookupEnd):
2365         (WebCore::PerformanceResourceTiming::connectStart):
2366         (WebCore::PerformanceResourceTiming::connectEnd):
2367         (WebCore::PerformanceResourceTiming::secureConnectionStart):
2368         (WebCore::PerformanceResourceTiming::requestStart):
2369         Use references instead of pointers.
2370         * page/PerformanceResourceTiming.h:
2371         Make an instance instead of a RefPtr.
2372         * page/PerformanceTiming.cpp:
2373         (WebCore::PerformanceTiming::domainLookupStart):
2374         (WebCore::PerformanceTiming::domainLookupEnd):
2375         (WebCore::PerformanceTiming::connectStart):
2376         (WebCore::PerformanceTiming::connectEnd):
2377         (WebCore::PerformanceTiming::secureConnectionStart):
2378         (WebCore::PerformanceTiming::requestStart):
2379         (WebCore::PerformanceTiming::responseStart):
2380         Check to see if the loader exists, then use ResourceLoadTiming reference.
2381         (WebCore::PerformanceTiming::resourceLoadTiming): Deleted.
2382         * page/PerformanceTiming.h:
2383         Removed resourceLoadTiming declaration.
2384         * platform/network/ResourceLoadTiming.h:
2385         (WebCore::ResourceLoadTiming::ResourceLoadTiming):
2386         (WebCore::ResourceLoadTiming::operator=):
2387         Replaced reference counting with copy constructors.
2388         (WebCore::ResourceLoadTiming::create): Deleted.
2389         (WebCore::ResourceLoadTiming::deepCopy): Deleted.
2390         * platform/network/ResourceResponseBase.cpp:
2391         (WebCore::ResourceResponseBase::adopt):
2392         (WebCore::ResourceResponseBase::copyData):
2393         (WebCore::ResourceResponseBase::resourceLoadTiming):
2394         (WebCore::ResourceResponseBase::setResourceLoadTiming):
2395         (WebCore::ResourceResponseBase::compare):
2396         * platform/network/ResourceResponseBase.h:
2397         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2398         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
2399         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2400         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
2401         * platform/network/soup/ResourceHandleSoup.cpp:
2402         (WebCore::ResourceHandle::didStartRequest):
2403         (WebCore::networkEventCallback):
2404         Use references instead of pointers.
2405
2406 2014-05-14  Commit Queue  <commit-queue@webkit.org>
2407
2408         Unreviewed, rolling out r168837.
2409         https://bugs.webkit.org/show_bug.cgi?id=132913
2410
2411         The patch added an assertion which fires on 6 tests (Requested
2412         by ap on #webkit).
2413
2414         Reverted changeset:
2415
2416         "[CSS Regions] Add ASSERT to make sure using the flowThread
2417         cache does not return incorrect results"
2418         https://bugs.webkit.org/show_bug.cgi?id=132906
2419         http://trac.webkit.org/changeset/168837
2420
2421 2014-05-13  Jon Honeycutt  <jhoneycutt@apple.com>
2422
2423         Revert "Don't dispatch 'beforeload' event inside FrameView::layout()",
2424         commit 84fe8cf6fbe8b5de9a06300ca3ef6d0ffc96948c, and associated
2425         follow-up fixes:
2426
2427             "platform/mac/plugins/testplugin-onnew-onpaint.html failing after
2428                 r168668", commit c17be3bf5127baf94310af4b4b9bf5a57d29aaf4
2429             "[Win] Unreviewed build fix after r168668.", commit
2430                 4fa470ad12c38ee7d4c114541b6dd321181a8bc9
2431
2432         The original merged patch appears to have caused a regression in
2433         fast/dom/HTMLObjectElement/object-as-frame.html.
2434
2435         <https://bugs.webkit.org/show_bug.cgi?id=132886>
2436
2437         Reviewed by Alexey Proskuryakov.
2438
2439         * WebCore.exp.in:
2440         * dom/Document.cpp:
2441         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
2442         * dom/Document.h:
2443         * html/HTMLAppletElement.cpp:
2444         (WebCore::HTMLAppletElement::renderWidgetForJSBindings):
2445         * html/HTMLEmbedElement.cpp:
2446         (WebCore::HTMLEmbedElement::renderWidgetForJSBindings):
2447         * html/HTMLObjectElement.cpp:
2448         (WebCore::HTMLObjectElement::renderWidgetForJSBindings):
2449         * page/FrameView.cpp:
2450         (WebCore::FrameView::FrameView):
2451         (WebCore::FrameView::reset):
2452         (WebCore::FrameView::flushAnyPendingPostLayoutTasks):
2453         (WebCore::FrameView::performPostLayoutTasks):
2454         (WebCore::FrameView::updateEmbeddedObjectsTimerFired): Deleted.
2455         * page/FrameView.h:
2456         * testing/Internals.cpp:
2457         (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks): Deleted.
2458         * testing/Internals.h:
2459         * testing/Internals.idl:
2460
2461 2014-05-14  Kiran  <kiran.guduru@samsung.com>
2462
2463         alidation for getUserMedia() errorCallback is missing.
2464         https://bugs.webkit.org/show_bug.cgi?id=132901
2465
2466         Reviewed by Darin Adler.
2467
2468         The patch adds the validation for getUserMedia errorCallBack
2469         and throws TypeMismatchError.
2470
2471         Test: fast/mediastream/getusermedia.html 
2472
2473         * Modules/mediastream/NavigatorUserMedia.cpp:
2474         (WebCore::NavigatorUserMedia::webkitGetUserMedia):
2475
2476 2014-05-14  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
2477
2478         Remove CSS_STICKY_POSITION guards
2479         https://bugs.webkit.org/show_bug.cgi?id=132676
2480
2481         Reviewed by Simon Fraser.
2482
2483         * Configurations/FeatureDefines.xcconfig:
2484         * css/CSSParser.cpp:
2485         (WebCore::isValidKeywordPropertyAndValue):
2486         * css/CSSPrimitiveValueMappings.h:
2487         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2488         (WebCore::CSSPrimitiveValue::operator EPosition):
2489         * css/CSSValueKeywords.in:
2490         * editing/EditingStyle.cpp:
2491         (WebCore::EditingStyle::convertPositionStyle):
2492
2493 2014-05-14  Radu Stavila  <stavila@adobe.com>
2494
2495         [CSS Regions] Add ASSERT to make sure using the flowThread cache does not return incorrect results
2496         https://bugs.webkit.org/show_bug.cgi?id=132906
2497
2498         Reviewed by Andrei Bucur.
2499
2500         If flowThreadContainingBlock() is called on an object which is in a different
2501         flow thread than the one currently being laid out, this method will return an incorrect
2502         result. I added an assertion for that to make sure we catch and treat any such scenarios.
2503
2504         No new tests required.
2505
2506         * rendering/RenderObject.cpp:
2507         (WebCore::RenderObject::locateFlowThreadContainingBlockNoCache):
2508         (WebCore::RenderObject::locateFlowThreadContainingBlock):
2509         * rendering/RenderObject.h:
2510
2511 2014-05-14  Andrei Bucur  <abucur@adobe.com>
2512
2513         [CSS Regions] Don't relayout when updating the region range unless necessary
2514         https://bugs.webkit.org/show_bug.cgi?id=132120
2515
2516         Reviewed by Antti Koivisto.
2517
2518         The patch reduces the cases when a relayout is made for boxes that change the region range.
2519         This lowers the amount of nested layouts in most cases and produces big layout speedups for trees
2520         without overhanging floats.
2521
2522         Tests: Major performance improvement with speedups of 50-60% on:
2523         Layout/RegionsAuto.html, Layout/RegionsAutoMaxHeight.html and Layout/RegionsFixed.html
2524
2525         * rendering/RenderBlock.cpp:
2526         (WebCore::RenderBlock::updateRegionRangeForBoxChild): Ask the child box if it needs a relayout
2527         in case its region range changes.
2528         * rendering/RenderBlockFlow.cpp:
2529         (WebCore::RenderBlockFlow::layoutBlockChild): It's not necessary to do two layouts here because
2530         there's no block direction position change between them for the child.
2531         (WebCore::RenderBlockFlow::needsLayoutAfterRegionRangeChange): If the block doesn't have floats
2532         or if it expands to enclose the floats it doesn't need to relayout after a region range chage.
2533         It's not possible for it to have a float inside overflow that must be repositioned using the new
2534         range.
2535         * rendering/RenderBlockFlow.h:
2536         * rendering/RenderBox.h:
2537         (WebCore::RenderBox::needsLayoutAfterRegionRangeChange): By default don't relayout after a region
2538         range change.
2539
2540 2014-05-14  Antti Koivisto  <antti@apple.com>
2541
2542         RuleData should ref the StyleRule
2543         https://bugs.webkit.org/show_bug.cgi?id=132865
2544
2545         Reviewed by Andreas Kling.
2546
2547         As a defensive move make RuleData ref the StyleRule. 
2548         This adds some ref churn but the overall performance impact should be minimal.
2549
2550         * css/RuleSet.h:
2551         (WebCore::RuleData::rule):
2552
2553 2014-05-14  Antti Koivisto  <antti@apple.com>
2554
2555         GIF animations don't restart after scrolling on iOS WebKit1
2556         https://bugs.webkit.org/show_bug.cgi?id=132900
2557
2558         Reviewed by Andreas Kling.
2559
2560         * WebCore.exp.in:
2561
2562 2014-05-13  Andrei Bucur  <abucur@adobe.com>
2563
2564         [CSS Regions] Assertion failure in some cases with inline blocks
2565         https://bugs.webkit.org/show_bug.cgi?id=132859
2566
2567         Reviewed by Mihnea Ovidenie.
2568
2569         The patch hardens the conditions when the region range caches are
2570         populated to avoid desynchronizations when objects move during layout.
2571         This is true especially in the case of the boxes found inside
2572         inline blocks, that get their range from the containing line.
2573
2574         There is a new function |computedRegionRangeForBox| that will always
2575         return a region range for a box using a best effort algorithm. This should
2576         be used only when there's no need to cache region information.
2577
2578         This change also allows better control over the lifecycle of the
2579         |RenderBoxRegionInfo| objects stored on the regions. We can now iterate
2580         over the full range of the box when cleaning up the region box info. The
2581         same applies for the width change detection function.
2582
2583         Test: fast/regions/inline-block-shifted-region.html
2584
2585         * rendering/RenderBlockLineLayout.cpp:
2586         (WebCore::RenderBlockFlow::updateRegionForLine): Don't set the containing
2587         region if the block doesn't have a range. The returned value would not
2588         be correctly clamped.
2589         * rendering/RenderBox.cpp:
2590         (WebCore::RenderBlock::hasRegionRangeInFlowThread):
2591         * rendering/RenderBox.h:
2592         * rendering/RenderFlowThread.cpp:
2593         (WebCore::RenderFlowThread::removeRenderBoxRegionInfo): Iterate only over
2594         the range of the box, not from the start of the region chain.
2595         (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock): Same as
2596         above.
2597         (WebCore::RenderFlowThread::hasCachedRegionRangeForBox):
2598         (WebCore::RenderFlowThread::getRegionRangeForBoxFromCachedInfo):
2599         (WebCore::RenderFlowThread::getRegionRangeForBox):
2600         (WebCore::RenderFlowThread::computedRegionRangeForBox): Best effort function
2601         to determine the range of a box. It will always return something as long
2602         as the flow thread has regions.
2603         (WebCore::RenderFlowThread::objectShouldFragmentInFlowRegion): Use the new function
2604         to determine the range.
2605         * rendering/RenderFlowThread.h:
2606         * rendering/RenderNamedFlowThread.cpp:
2607         (WebCore::RenderNamedFlowThread::absoluteQuadsForBox): Use the new function to determine
2608         the range.
2609
2610 2014-05-13  Simon Fraser  <simon.fraser@apple.com>
2611
2612         Fix "ASSERTION FAILED: m_representation == PlatformLayerRepresentation" with UI-side compositing
2613         https://bugs.webkit.org/show_bug.cgi?id=132899
2614
2615         Reviewed by Beth Dakin.
2616
2617         Export some things
2618
2619         * WebCore.exp.in:
2620
2621 2014-05-13  Hans Muller  <hmuller@adobe.com>
2622
2623         [CSS Shapes] line height grows around polygon and incorrectly causes text to wrap to next line
2624         https://bugs.webkit.org/show_bug.cgi?id=131622
2625
2626         Reviewed by Bem Jones-Bey.
2627
2628         Corrected an earlier PolygonShape fix https://bugs.webkit.org/show_bug.cgi?id=132132
2629         When the top or bottom of a layout line is coincident with a polygon edge vertex, we
2630         only consider it an intersection if the edge extends into the line.
2631
2632         Test: fast/shapes/shape-outside-floats/shape-outside-edge-case.html
2633
2634         * rendering/shapes/PolygonShape.cpp:
2635         (WebCore::OffsetPolygonEdge::clippedEdgeXRange):
2636
2637 2014-05-13  Beth Dakin  <bdakin@apple.com>
2638
2639         m_layerForOverhangAreas is sometimes not positioned correctly when topContentInset 
2640         has changed
2641         https://bugs.webkit.org/show_bug.cgi?id=132898
2642         -and corresponding-
2643         <rdar://problem/16644710>
2644
2645         Reviewed by Anders Carlsson.
2646
2647         This function is called whenever the topContentInset changes, so use it as an 
2648         opportunity to ensure that m_layerForOverhangAreas has been positioned correctly.
2649         * rendering/RenderLayerCompositor.cpp:
2650         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
2651
2652         Everyone gets an anchor point!
2653         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2654
2655 2014-05-13  Dean Jackson  <dino@apple.com>
2656
2657         Attempted build fix after https://bugs.webkit.org/show_bug.cgi?id=132891
2658
2659         * page/PageDebuggable.cpp:
2660
2661 2014-05-13  Timothy Hatcher  <timothy@apple.com>
2662
2663         Force developerExtrasEnabled when a remote Inspector client connects.
2664
2665         https://bugs.webkit.org/show_bug.cgi?id=132891
2666
2667         Reviewed by Joseph Pecoraro.
2668
2669         * page/PageDebuggable.cpp:
2670         (WebCore::PageDebuggable::PageDebuggable): Initialize m_forcedDeveloperExtrasEnabled to false.
2671         (WebCore::PageDebuggable::connect): Set m_forcedDeveloperExtrasEnabled if the setting is changed.
2672         (WebCore::PageDebuggable::disconnect): Switch developerExtrasEnabled back to false
2673         if m_forcedDeveloperExtrasEnabled is true.
2674         * page/PageDebuggable.h: Added m_forcedDeveloperExtrasEnabled.
2675
2676 2014-05-13  Beth Dakin  <bdakin@apple.com>
2677
2678         REGRESSION (topContentInset): Searching through Facebook Messenger's chat causes 
2679         scrolling in News Feed
2680         https://bugs.webkit.org/show_bug.cgi?id=132889
2681         -and corresponding-
2682         <rdar://problem/16715716>
2683
2684         Reviewed by Simon Fraser.
2685
2686         First of all, scrollOffsetRelativeToDocument() was very poorly named. This patch 
2687         re-names it to the much more accurate documentScrollOffsetRelativeToViewOrigin(). 
2688         Re-naming it makes it clear that ONE call site was not getting the right offset. 
2689         That call site does not want to know the document’s position relative to the view 
2690         origin, but rather it wants to know the Document’s position relative to the 
2691         scrolling origin.
2692
2693         Export new name.
2694         * WebCore.exp.in:
2695
2696         Use newly re-named documentScrollPositionRelativeToViewOrigin().
2697         * page/FrameView.cpp:
2698         (WebCore::FrameView::convertToRenderer):
2699         * platform/ScrollView.cpp:
2700         (WebCore::ScrollView::documentScrollOffsetRelativeToViewOrigin):
2701         (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin):
2702         (WebCore::ScrollView::documentScrollOffsetRelativeToScrollableAreaOrigin):
2703         (WebCore::ScrollView::rootViewToContents):
2704         (WebCore::ScrollView::windowToContents):
2705         (WebCore::ScrollView::scrollOffsetRelativeToDocument): Deleted.
2706         (WebCore::ScrollView::scrollPositionRelativeToDocument): Deleted.
2707         * platform/ScrollView.h:
2708
2709         THIS is the spot that needs the new function, 
2710         documentScrollOffsetRelativeToScrollableAreaOrigin()()
2711         * rendering/RenderLayer.cpp:
2712         (WebCore::RenderLayer::scrollRectToVisible):
2713
2714 2014-05-13  Dean Jackson  <dino@apple.com>
2715
2716         [iOS] Page scale update messages for media controls should only fire at the end of zooming
2717         https://bugs.webkit.org/show_bug.cgi?id=132857
2718         <rdar://problem/16631009>
2719
2720         Reviewed by Simon Fraser.
2721
2722         As the user was zooming, the media controls that responded
2723         to the page scale (and resized themselves) would do so
2724         slightly out of sync with the screen refreshes, and it looked
2725         terrible. They really only need to get told at the end
2726         of the zoom that they need to relayout.
2727
2728         Allow setPageScaleFactor to accept another parameter
2729         that indicates if the change is stable. That way, changes
2730         during a user triggers zoom gesture can be ignored for
2731         media controls.
2732
2733         * WebCore.exp.in: Page::setPageScaleFactor takes a new parameter.
2734         * dom/Document.cpp:
2735         (WebCore::Document::pageScaleFactorChangedAndStable): Renamed from pageScaleFactorChanged.
2736         (WebCore::Document::pageScaleFactorChanged): Deleted.
2737         * dom/Document.h:
2738         * page/Page.cpp:
2739         (WebCore::Page::setPageScaleFactor): Accepts a new inStableState parameter,
2740         and tells the main frame that the scale factor has changed if it's stable.
2741         * page/Page.h:
2742
2743 2014-05-13  Eric Carlson  <eric.carlson@apple.com>
2744
2745         Unreviewed build fix after r168755.
2746
2747         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2748         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
2749
2750 2014-05-13  Eric Carlson  <eric.carlson@apple.com>
2751
2752         [Mac] hasVideo should return true when video is ready to display
2753         https://bugs.webkit.org/show_bug.cgi?id=132885
2754
2755         Reviewed by Jer Noble.
2756
2757         * html/HTMLMediaElement.cpp:
2758         (WebCore::HTMLMediaElement::parseAttribute):
2759
2760         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
2761         (WebCore::AudioTrackPrivateAVFObjC::resetPropertiesFromTrack): Don't change the
2762             enabled state of the AVPlayerItemTrack during setup.
2763
2764         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2765         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2766         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Initialize
2767             m_cachedIsReadyForDisplay.
2768         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Remove "enabled" KVO observers.
2769         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer): Observe "readyForDisplay"
2770             change notifications.
2771         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer): Remove for "readyForDisplay"
2772             observer.
2773         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame): Return cached readyForDisplay
2774             state instead of polling every time.
2775         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Call setHasVideo(true) if the
2776             player layer is ready for display.
2777         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks): Update logging.
2778         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks): Ditto.
2779         (WebCore::MediaPlayerPrivateAVFoundationObjC::firstFrameAvailableDidChange): Cache readyForDisplay
2780             state, call tracksChanged() if we haven't seen a video track yet.
2781         (WebCore::MediaPlayerPrivateAVFoundationObjC::trackEnabledDidChange): New.
2782         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): Correct logging.
2783         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange): Remove old "enabled" listeners
2784             before release tracks, add new ones to new tracks.
2785         (WebCore::assetTrackMetadataKeyNames): Add "enabled" to the list of properties we require to 
2786             be loaded before announcing that metadata has loaded.
2787         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): Observe 
2788             "readyForDisplay" and "enabled".
2789
2790         * platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp:
2791         (WebCore::VideoTrackPrivateAVFObjC::resetPropertiesFromTrack): Don't change the
2792             enabled state of the AVPlayerItemTrack during setup.
2793
2794 2014-05-13  Myles C. Maxfield  <litherum@gmail.com>
2795
2796         Text decorations do not contribute to visual overflow
2797         https://bugs.webkit.org/show_bug.cgi?id=132773
2798
2799         Reviewed by Darin Adler.
2800
2801         Tests: fast/css3-text/css3-text-decoration/repaint/underline-outside-of-layout-rect.html
2802
2803         * rendering/InlineTextBox.cpp:
2804         (WebCore::textDecorationStrokeThickness): Refactor into a common function
2805         (WebCore::wavyOffsetFromDecoration): Ditto
2806         (WebCore::InlineTextBox::extendVerticalVisualOverflowForDecorations): Given
2807         vertical overflow bounds, possibly extend those to include location of
2808         decorations.
2809         (WebCore::InlineTextBox::paintDecoration): Use refactored functions.
2810         * rendering/InlineTextBox.h: Function signature
2811         * rendering/RenderBlockLineLayout.cpp:
2812         (WebCore::setLogicalWidthForTextRun): Call extendVerticalVisualOverflowForDecorations()
2813         * rendering/style/RenderStyle.cpp:
2814         (WebCore::RenderStyle::changeAffectsVisualOverflow): Inspects shadows and text decorations
2815         (WebCore::RenderStyle::changeRequiresLayout): Calls changeAffectsVisualOverflow()
2816         (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline): Moved code from here
2817         to changeAffectsVisualOverflow().
2818         * rendering/style/RenderStyle.h: Function signature
2819
2820 2014-05-13  Enrica Casucci  <enrica@apple.com>
2821
2822         REGRESSION (WebKit2): Zooming to text field leaves it partially hidden by the form assistant.
2823         https://bugs.webkit.org/show_bug.cgi?id=132879
2824         <rdar://problem/16318049>
2825
2826         Reviewed by Benjamin Poulain.
2827
2828         Adding some exports. The fix to setScrollPosition is to avoid clamping the scroll
2829         position when using delegate scrolling.
2830
2831         * WebCore.exp.in:
2832         * platform/ScrollView.cpp:
2833         (WebCore::ScrollView::setScrollPosition):
2834
2835 2014-05-13  Brady Eidson  <beidson@apple.com>
2836
2837         Followup to: Update positioning/drawing of the image controls button.
2838         <rdar://problem/16885077> and https://bugs.webkit.org/show_bug.cgi?id=132883
2839
2840         Reviewed by Tim Horton.
2841
2842         Cleared up the actual intent behind review feedback on the original patch.
2843
2844         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
2845         (WebCore::ImageControlsButtonElementMac::maybeCreate):
2846
2847 2014-05-13  Brady Eidson  <beidson@apple.com>
2848
2849         Update positioning/drawing of the image controls button.
2850         <rdar://problem/16885077> and https://bugs.webkit.org/show_bug.cgi?id=132883
2851
2852         Reviewed by Tim Horton.
2853
2854         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
2855         (WebCore::ImageControlsButtonElementMac::maybeCreate): Add inline style for top/right
2856           positioning based on the metrics from the render theme.
2857
2858         * html/shadow/mac/imageControlsMac.css:
2859         (.x-webkit-image-controls-button): Can’t hard code any positioning.
2860
2861         * rendering/RenderTheme.h:
2862         (WebCore::RenderTheme::imageControlsButtonPositionOffset):
2863         * rendering/RenderThemeMac.h:
2864         * rendering/RenderThemeMac.mm:
2865         (WebCore::RenderThemeMac::servicesRolloverButtonCell):
2866         (WebCore::RenderThemeMac::imageControlsButtonPositionOffset):
2867
2868 2014-05-13  Simon Fraser  <simon.fraser@apple.com>
2869
2870         [iOS WK2] background-attachment:fixed behaves very poorly
2871         https://bugs.webkit.org/show_bug.cgi?id=132881
2872         <rdar://problem/16789526>
2873
2874         Reviewed by Beth Dakin.
2875
2876         Remove the old ENABLE_FAST_MOBILE_SCROLLING code, and add a setting that
2877         controls whether fixed backgrounds paint relative to the document, which
2878         is enabled for iOS (WK1 and WK2). This setting is consulted when we repaint
2879         fixed backgrounds on scrolling, when we paint them, and when we decide to make
2880         a layer for fixed backgrounds.
2881         
2882         * page/Settings.cpp:
2883         * page/Settings.in:
2884         * rendering/RenderBoxModelObject.cpp:
2885         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
2886         * rendering/RenderElement.cpp:
2887         (WebCore::RenderElement::styleWillChange):
2888         (WebCore::RenderElement::willBeRemovedFromTree):
2889         (WebCore::shouldRepaintFixedBackgroundsOnScroll): Deleted.
2890         * rendering/RenderLayerCompositor.cpp:
2891         (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer):
2892
2893 2014-05-13  Zalan Bujtas  <zalan@apple.com>
2894
2895         REGRESSSION(r168528) Subpixel rendering: Selection rect is not positioned properly when SVG text is selected.
2896         https://bugs.webkit.org/show_bug.cgi?id=132868
2897
2898         Reviewed by Dirk Schulze.
2899
2900         Scale the selection rect. r168528 missed applying this final transform on the selection/painting rect.
2901
2902         Test: svg/text/hidpi-text-selection-rect-position.html
2903
2904         * rendering/svg/SVGInlineTextBox.cpp:
2905         (WebCore::SVGInlineTextBox::selectionRectForTextFragment):
2906
2907 2014-05-13  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
2908
2909         ASSERTION FAILED: leftCategory != CalcOther && rightCategory != CalcOther
2910         in WebCore::CSSCalcBinaryOperation::createSimplified
2911         https://bugs.webkit.org/show_bug.cgi?id=132870
2912
2913         According to the standard, calc() should be able to handle angle, time
2914         and frequency values as well: http://www.w3.org/TR/css3-values/#calc
2915
2916         Reviewed by Darin Adler.
2917
2918         Test: fast/css/calc-with-angle-time-frequency.html
2919
2920         * css/CSSCalculationValue.cpp:
2921         (WebCore::unitCategory):
2922         (WebCore::CSSCalcPrimitiveValue::createCalcExpression):
2923         (WebCore::CSSCalcPrimitiveValue::computeLengthPx):
2924         (WebCore::CSSCalcPrimitiveValue::addSubtractResult):
2925         (WebCore::CSSCalcPrimitiveValue::determineCategory):
2926         (WebCore::CSSCalcBinaryOperation::primitiveType)
2927         * css/CSSCalculationValue.h: extending CalculationCategory
2928         * css/CSSParser.cpp:
2929         (WebCore::CSSParser::validCalculationUnit):
2930         * css/CSSPrimitiveValue.cpp:
2931         (WebCore::CSSPrimitiveValue::primitiveType):
2932
2933 2014-05-13  Darin Adler  <darin@apple.com>
2934
2935         Try to fix the !ENABLE(ICONDATABASE) build
2936
2937         * loader/icon/IconDatabase.h: Include WTFString.h.
2938
2939 2014-05-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2940
2941         REGRESSION(r167771): [GTK] Text fields and areas are rendered unthemed
2942         https://bugs.webkit.org/show_bug.cgi?id=132864
2943
2944         Reviewed by Philippe Normand.
2945
2946         This is because the virtual methods changed the API in the parent,
2947         and since we don't have the methods marked as override we didn't
2948         noticed it. After using override keyword for all virtual methods
2949         in the derived class another problem showed up, the ActiveListBox
2950         selection methods were incorrectly named.
2951
2952         * platform/gtk/RenderThemeGtk.cpp:
2953         (WebCore::RenderThemeGtk::paintTextArea): Update to API changes in the
2954         parent class.
2955         * platform/gtk/RenderThemeGtk.h: Mark all virtual methods as
2956         override and the class as final.
2957         * platform/gtk/RenderThemeGtk2.cpp:
2958         (WebCore::RenderThemeGtk::paintTextField): Update to API changes
2959         in the parent class.
2960         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor):
2961         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor):
2962         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor):
2963         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor):
2964         (WebCore::RenderThemeGtk::activeListBoxSelectionBackgroundColor): Deleted.
2965         (WebCore::RenderThemeGtk::inactiveListBoxSelectionBackgroundColor): Deleted.
2966         (WebCore::RenderThemeGtk::activeListBoxSelectionForegroundColor): Deleted.
2967         (WebCore::RenderThemeGtk::inactiveListBoxSelectionForegroundColor): Deleted.
2968         * platform/gtk/RenderThemeGtk3.cpp:
2969         (WebCore::RenderThemeGtk::paintTextField): Update to API changes
2970         in the parent class.
2971         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor):
2972         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor):
2973         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor):
2974         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor):
2975         (WebCore::RenderThemeGtk::activeListBoxSelectionBackgroundColor): Deleted.
2976         (WebCore::RenderThemeGtk::inactiveListBoxSelectionBackgroundColor): Deleted.
2977         (WebCore::RenderThemeGtk::activeListBoxSelectionForegroundColor): Deleted.
2978         (WebCore::RenderThemeGtk::inactiveListBoxSelectionForegroundColor): Deleted.
2979
2980 2014-05-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2981
2982         [GStreamer] Move toGstClockTime to utilities
2983         https://bugs.webkit.org/show_bug.cgi?id=132702
2984
2985         Reviewed by Philippe Normand.
2986
2987         toGstClockTime should be in GStreamerUtilities and corrected typo
2988         in getGstPlayFlag.
2989
2990         No new tests needed.
2991
2992         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
2993         (WebCore::getGstPlayFlag): Renamed from getGstPlaysFlag.
2994         (WebCore::toGstClockTime): Moved from MediaPlayerPrivateGStreamer.
2995         (WebCore::getGstPlaysFlag): Deleted.
2996         * platform/graphics/gstreamer/GStreamerUtilities.h:
2997         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2998         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
2999         Corrected getGstPlayFlag typo.
3000         (WebCore::toGstClockTime): Deleted.
3001
3002 2014-05-12  Darin Adler  <darin@apple.com>
3003
3004         Make a few icon database improvements
3005         https://bugs.webkit.org/show_bug.cgi?id=132812
3006
3007         Reviewed by Brady Eidson.
3008
3009         * WebCore.exp.in: Export more IconDatabase functions, since they are now called
3010         by WebKit2 through pointers to a class marked final.
3011
3012         * loader/icon/IconDatabase.cpp: Removed unneeded includes. Use override for
3013         virtual functions.
3014
3015         * loader/icon/IconDatabase.h: Removed unneeded includes. Marked the class final.
3016         Use override for virtual functions. Use a public constructor instead of a create
3017         function.
3018
3019         * loader/icon/IconDatabaseBase.h: Removed unneeded includes.
3020
3021 2014-05-13  Kiran  <kiran.guduru@samsung.com>
3022
3023         [MediaStream] MediaStream.addTrack Should not check for active state.
3024         https://bugs.webkit.org/show_bug.cgi?id=132558
3025
3026         Reviewed by Eric Carlson.
3027
3028         MediaStream.addTrack method is checking for active state of a
3029         MediaStream, but it should not check for active state while adding a Track.
3030
3031         Test: fast/mediastream/MediaStream-add-tracks-to-inactive-stream.html
3032
3033         * Modules/mediastream/MediaStream.cpp:
3034         (WebCore::MediaStream::addTrack):
3035
3036 2014-05-12  Mark Lam  <mark.lam@apple.com>
3037
3038         WebKit2 on iOS needs to capture the main thread's floating point environment.
3039         <https://webkit.org/b/132755>
3040
3041         Reviewed by Geoffrey Garen.
3042
3043         For iOS, WorkerThread::workerThread() expects to be able to initialize the
3044         worker thread's floating point environment to be the same as the one in the
3045         main thread.  The FP env of the main thread is expected to have been captured
3046         in the mainThreadFEnv global.  On WebKit2 for iOS, we neglected to initialize
3047         mainThreadFEnv.
3048
3049         We now introduce a FloatingPointEnvironment class that will encapsulate the main
3050         thread (aka "UIThread") fenv, and we'll call FloatingPointEnv::saveMainThreadEnvironment()
3051         from ChildProcess::platformInitialize() to ensure that the FloatingPointEnvironment
3052         singleton instance is initialized properly for WebKit2.
3053
3054         In the ChildProcess::platformInitialize(), we also need to initialize the ARMv7
3055         FP env to support denormalized numbers.  We'll do this before calling
3056         saveMainThreadEnvironment().
3057
3058         Tests: fast/workers/worker-floating-point.html
3059                js/floating-point-denormalized.html
3060
3061         * WebCore.exp.in:
3062         * WebCore.xcodeproj/project.pbxproj:
3063         * platform/ios/wak/FloatingPointEnvironment.cpp: Added.
3064         (WebCore::FloatingPointEnvironment::env):
3065         (WebCore::FloatingPointEnvironment::FloatingPointEnvironment):
3066         (WebCore::FloatingPointEnvironment::enableDenormalSupport):
3067         (WebCore::FloatingPointEnvironment::saveMainThreadEnvironment):
3068         (WebCore::FloatingPointEnvironment::propagateMainThreadEnvironment):
3069         * platform/ios/wak/FloatingPointEnvironment.h: Added.
3070         * platform/ios/wak/WebCoreThread.h:
3071         * platform/ios/wak/WebCoreThread.mm:
3072         (RunWebThread):
3073         (StartWebThread):
3074         * workers/WorkerThread.cpp:
3075         (WebCore::WorkerThread::workerThread):
3076
3077 2014-05-12  Dirk Schulze  <krit@webkit.org>
3078
3079         SVG root element accepts background color but fails to repaint it
3080         https://bugs.webkit.org/show_bug.cgi?id=63153
3081
3082         Reviewed by Dean Jackson.
3083
3084         This is back ported from Blink. Don't know the exact commit though.
3085         The patch checks if the SVGSVGElement is an outermost root element.
3086         If it is, mark the whole element for repaint.
3087
3088         Test: svg/custom/svg-root-background.html
3089
3090         * rendering/RenderBoxModelObject.cpp:
3091         (WebCore::RenderBoxModelObject::calculateHasBoxDecorations):
3092         (WebCore::RenderBoxModelObject::updateFromStyle):
3093         * rendering/RenderBoxModelObject.h:
3094         * rendering/svg/RenderSVGRoot.cpp:
3095         (WebCore::RenderSVGRoot::RenderSVGRoot):
3096         (WebCore::RenderSVGRoot::layout):
3097         (WebCore::RenderSVGRoot::paintReplaced):
3098         (WebCore::RenderSVGRoot::clippedOverflowRectForRepaint):
3099             This is a simple optimization by taking the necessary parts
3100             from RenderReplaced and SVGRenderSupport.
3101         * rendering/svg/RenderSVGRoot.h:
3102
3103 2014-05-12  Simon Fraser  <simon.fraser@apple.com>
3104
3105         [iOS] Fixed items are sometimes clipped after rubber-banding
3106         https://bugs.webkit.org/show_bug.cgi?id=132851
3107         <rdar://problem/16870790>
3108
3109         Reviewed by Benjamin Poulain.
3110
3111         On iOS fixed-position layers would get clipped to the document rect,
3112         but with rubber-banding, we can now have a custom fixed postion rect
3113         that extends outside the document rect.
3114         
3115         Another issue was that we would un-composite fixed elements sometimes
3116         when scrolling fast, again because they could fall outside of the document rect.
3117         
3118         A final issue was that pinching could reveal parts of fixed elements that should
3119         lie outside the viewport, rather than clipping the layers.
3120         
3121         Fix by converting both call points to use viewportConstrainedVisibleContentRect()
3122         rather than viewportConstrainedExtentRect(). On non-iOS platforms these are
3123         the same, but on iOS viewportConstrainedVisibleContentRect() uses the
3124         custom fixed position rect, which is the correct rect to intersect with.
3125
3126         * rendering/RenderLayerBacking.cpp:
3127         (WebCore::RenderLayerBacking::updateCompositedBounds):
3128         * rendering/RenderLayerCompositor.cpp:
3129         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
3130
3131 2014-05-06  Jon Honeycutt  <jhoneycutt@apple.com>
3132
3133         Don't dispatch 'beforeload' event inside FrameView::layout()
3134
3135         https://bugs.webkit.org/show_bug.cgi?id=132621
3136         <rdar://problem/15661470>
3137
3138         This merges Blink revision 162073 with minor renaming and style
3139         changes. From that commit:
3140
3141         Executing JavaScript code inside FrameView::layout() is problematic.
3142         e.g. an assertion failure tested in fast/events/beforeload-assertion.html.
3143         We should avoid it.
3144
3145         This CL makes 'beforeload' event dispatching for plugins and iframes asynchronous,
3146         except plugin access from JavaScript code (HTMLPlugInElement::
3147         renderWidgetForJSBindings).
3148
3149         Reviewed by Brent Fulgham.
3150
3151         Tests: fast/events/beforeload-assertion.html
3152                fast/events/beforeload-iframe-crash.html
3153                fast/events/beforeload-input-time-crash.html
3154
3155         * WebCore.exp.in:
3156         * dom/Document.cpp:
3157         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
3158         * dom/Document.h:
3159         * html/HTMLAppletElement.cpp:
3160         (WebCore::HTMLAppletElement::renderWidgetForJSBindings):
3161         * html/HTMLEmbedElement.cpp:
3162         (WebCore::HTMLEmbedElement::renderWidgetForJSBindings):
3163         * html/HTMLObjectElement.cpp:
3164         (WebCore::HTMLObjectElement::renderWidgetForJSBindings):
3165         * page/FrameView.cpp:
3166         (WebCore::FrameView::FrameView):
3167         (WebCore::FrameView::reset):
3168         (WebCore::FrameView::updateEmbeddedObjectsTimerFired):
3169         (WebCore::FrameView::flushAnyPendingPostLayoutTasks):
3170         (WebCore::FrameView::performPostLayoutTasks):
3171         * page/FrameView.h:
3172         * testing/Internals.cpp:
3173         (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks):
3174         * testing/Internals.h:
3175         * testing/Internals.idl:
3176
3177 2014-05-12  Roger Fong  <roger_fong@apple.com>
3178
3179         Limit number of active graphics contexts per web process.
3180         https://bugs.webkit.org/show_bug.cgi?id=132833.
3181         <rdar://problem/16888459>
3182
3183         Reviewed by Dean Jackson.
3184
3185         Test: webgl/many-contexts.html
3186
3187         * platform/graphics/GraphicsContext3D.h:
3188         * platform/graphics/mac/GraphicsContext3DMac.mm: Limit number of active contexts to 16.
3189         (WebCore::GraphicsContext3D::create):
3190         (WebCore::GraphicsContext3D::~GraphicsContext3D):
3191
3192 2014-05-12  Simon Fraser  <simon.fraser@apple.com>
3193
3194         Build fix fix.
3195
3196         * page/scrolling/ScrollingCoordinator.cpp:
3197         (WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
3198
3199 2014-05-12  Brent Fulgham  <bfulgham@apple.com>
3200
3201         DataDetectorUI doesn't update with resize
3202         https://bugs.webkit.org/show_bug.cgi?id=132830
3203         <rdar://problem/16871179>
3204
3205         Reviewed by Simon Fraser.
3206
3207         * editing/Editor.cpp:
3208         (WebCore::Editor::scanSelectionForTelephoneNumbers): Add public, no-argument
3209         version that can be called after layout changes.
3210         (WebCore::Editor::didLayout): Reprocess telephone number data
3211         since Ranges will have changed.
3212         * editing/Editor.h:
3213         * editing/FrameSelection.cpp:
3214         (WebCore::FrameSelection::updateDataDetectorsForSelection): Added.
3215         * editing/FrameSelection.h:
3216         * page/FrameView.cpp:
3217         (WebCore::FrameView::performPostLayoutTasks): Ask the FrameSelection to update the
3218         Range information for selected phone numbers.
3219
3220 2014-05-12  Simon Fraser  <simon.fraser@apple.com>
3221
3222         Fix the iOS build.
3223
3224         * page/scrolling/ScrollingCoordinator.cpp:
3225         (WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
3226
3227 2014-05-12  Simon Fraser  <simon.fraser@apple.com>
3228
3229         [iOS WK2] Fuzzy tiles on some sites on loading
3230         https://bugs.webkit.org/show_bug.cgi?id=132847
3231         <rdar://problem/16816178>
3232
3233         Reviewed by Benjamin Poulain.
3234
3235         Export WebCore::TileController::contentsScale() const
3236
3237         * WebCore.exp.in:
3238
3239 2014-05-12  Simon Fraser  <simon.fraser@apple.com>
3240
3241         Add debug dumping for ViewportConfiguration
3242         https://bugs.webkit.org/show_bug.cgi?id=132843
3243
3244         Reviewed by Benjamin Poulain.
3245
3246         Add some TextStream-based dumping for ViewportConfiguration.
3247
3248         * page/ViewportConfiguration.cpp:
3249         (WebCore::ViewportConfiguration::updateConfiguration):
3250         (WebCore::ViewportConfigurationTextStream::ViewportConfigurationTextStream):
3251         (WebCore::ViewportConfigurationTextStream::increaseIndent):
3252         (WebCore::ViewportConfigurationTextStream::decreaseIndent):
3253         (WebCore::dumpProperty):
3254         (WebCore::ViewportConfigurationTextStream::writeIndent):
3255         (WebCore::ViewportConfigurationTextStream::operator<<):
3256         (WebCore::ViewportConfiguration::description):
3257         (WebCore::ViewportConfiguration::dump):
3258         * page/ViewportConfiguration.h:
3259
3260 2014-05-12  Brady Eidson  <beidson@apple.com>
3261
3262         Followup to "Teach Editor to support more direct replacement of a Node"
3263         <rdar://problem/16817952> and https://bugs.webkit.org/show_bug.cgi?id=132834
3264
3265         Pair programmed and pair reviewed by Brady Eidson and Darin Adler.
3266
3267         * editing/mac/EditorMac.mm:
3268         (WebCore::maybeCopyNodeAttributesToFragment):
3269         (WebCore::Editor::replaceNodeFromPasteboard):
3270
3271 2014-05-12  Beth Dakin  <bdakin@apple.com>
3272
3273         Content shadow layer needs to move in sync with the content layer
3274         https://bugs.webkit.org/show_bug.cgi?id=132841
3275         -and corresponding-
3276         <rdar://problem/16641115>
3277
3278         Reviewed by Simon Fraser.
3279
3280         Now that the root content layer moves a little bit (for y scroll positions between 
3281         0 and topContentInset), the shadow layer needs to move along with it since the 
3282         shadow layer should always have the same position as the root content layer.
3283
3284         Set the root state node’s shadow layer, and update the position whenever the root 
3285         content layer’s position is updated.
3286         * page/scrolling/AsyncScrollingCoordinator.cpp:
3287         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
3288         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
3289
3290         Fetch the compositor’s layerForContentShadow().
3291         * page/scrolling/ScrollingCoordinator.cpp:
3292         (WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
3293         * page/scrolling/ScrollingCoordinator.h:
3294
3295         Hook up the contentShadowLayer in the state node.
3296         * page/scrolling/ScrollingStateScrollingNode.cpp:
3297         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
3298         (WebCore::ScrollingStateScrollingNode::setContentShadowLayer):
3299
3300         Hook it up in the ScrollingTreeNode as well. Move the layer whenever the m
3301         _scrolledContentsLayer is moved.
3302         * page/scrolling/ScrollingStateScrollingNode.h:
3303         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
3304         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
3305         (WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren):
3306         (WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):
3307
3308         The shadow layer needs an anchor point now that we are moving it around.
3309         * rendering/RenderLayerCompositor.cpp:
3310         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
3311
3312 2014-05-12  Dirk Schulze  <krit@webkit.org>
3313
3314         <svg> with opacity and compositing double-applies its opacity
3315         https://bugs.webkit.org/show_bug.cgi?id=116856
3316
3317         Reviewed by Simon Fraser.
3318
3319         The opacity is applied by the compositor. However, all SVG elements
3320         create transparency layers on their own to apply opacity. So did
3321         SVGSVGElement.
3322
3323         Added a check if the current element has a compositing layer and skip
3324         creating transparency layer if it has.
3325
3326         Test: svg/custom/composited-svg-with-opacity.html
3327
3328         * rendering/svg/SVGRenderingContext.cpp:
3329         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
3330
3331 2014-05-12  Brady Eidson  <beidson@apple.com>
3332
3333         Teach Editor to support more direct replacement of a Node
3334         <rdar://problem/16817952> and https://bugs.webkit.org/show_bug.cgi?id=132834
3335
3336         Reviewed by Enrica Casucci.
3337
3338         The new method "Editor::replaceNodeFromPasteboard" has the intent that the new DocumentFragment
3339         from the pasteboard is as similar to the old Node as possible.
3340
3341         In practice, the new DocumentFragment:
3342         1 - Can represent a single node that's missing various attributes the original Node had.
3343         2 - Can be an unwanted fragment of arbitrary depth when the replacement happens inside Mail.app
3344
3345         This fixes both of these issues.
3346
3347         Add a MailBlockquoteHandling enum class for various Editor operations to pass through to the
3348         ReplaceSelectionCommand:
3349         * editing/Editor.cpp:
3350         (WebCore::Editor::handleTextEvent):
3351         (WebCore::Editor::pasteAsFragment):
3352         (WebCore::Editor::pasteWithPasteboard):
3353         (WebCore::Editor::replaceSelectionWithFragment):
3354         * editing/Editor.h:
3355
3356         * dom/TextEvent.cpp:
3357         (WebCore::TextEvent::createForPlainTextPaste):
3358         (WebCore::TextEvent::createForFragmentPaste):
3359         (WebCore::TextEvent::TextEvent):
3360         * dom/TextEvent.h:
3361         (WebCore::TextEvent::mailBlockquoteHandling):
3362
3363         * editing/ReplaceSelectionCommand.cpp:
3364         (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
3365         (WebCore::ReplaceSelectionCommand::doApply): Consider whether or not this particular Editor
3366           operation was meant to give special consideration to Mail's Blockquotes.
3367         * editing/ReplaceSelectionCommand.h:
3368
3369         * editing/efl/EditorEfl.cpp:
3370         (WebCore::Editor::pasteWithPasteboard):
3371         * editing/ios/EditorIOS.mm:
3372         (WebCore::Editor::pasteWithPasteboard):
3373
3374         * editing/mac/EditorMac.mm:
3375         (WebCore::Editor::pasteWithPasteboard):
3376         (WebCore::Editor::readSelectionFromPasteboard):
3377         (WebCore::maybeCopyNodeAttributesToFragment): If the new DocumentFragment represents a single HTML node
3378           with the same tag name is the original HTML node, copy over most attributes from the original node.
3379         (WebCore::Editor::replaceNodeFromPasteboard): Create the fragment, run it through maybeCopyNodeAttributesToFragment.
3380
3381         * WebCore.exp.in:
3382
3383 2014-05-12  Alex Christensen  <achristensen@webkit.org>
3384
3385         Progress on web timing.
3386         https://bugs.webkit.org/show_bug.cgi?id=132574
3387
3388         Reviewed by Alexey Proskuryakov.
3389
3390         * CMakeLists.txt:
3391         Removed ResourceLoadTiming.cpp.
3392         * WebCore.exp.in:
3393         Added linker symbols for ResourceLoadTiming.
3394         * WebCore.xcodeproj/project.pbxproj:
3395         * WebCore.vcxproj/WebCore.vcxproj:
3396         * WebCore.vcxproj/WebCore.vcxproj.filters:
3397         Removed ResourceLoadTiming.cpp.
3398         * inspector/InspectorResourceAgent.cpp:
3399         (WebCore::buildObjectForTiming):
3400         * inspector/protocol/Network.json:
3401         Updated ResourceTiming structure.
3402         * loader/DocumentLoadTiming.cpp:
3403         (WebCore::DocumentLoadTiming::setNavigationStart):
3404         * loader/DocumentLoadTiming.h:
3405          Deleted unused setNavigationStart function.
3406         * page/Performance.idl:
3407         Updated spec URL.
3408         * page/PerformanceResourceTiming.cpp:
3409         (WebCore::PerformanceResourceTiming::domainLookupStart):
3410         (WebCore::PerformanceResourceTiming::domainLookupEnd):
3411         (WebCore::PerformanceResourceTiming::connectStart):
3412         (WebCore::PerformanceResourceTiming::secureConnectionStart):
3413         (WebCore::PerformanceResourceTiming::responseEnd):
3414         Updated ResourceLoadTiming member variable names.
3415         (WebCore::PerformanceResourceTiming::responseStart):
3416         * page/PerformanceResourceTiming.h:
3417         * page/PerformanceResourceTiming.idl:
3418         Deleted responseStart because it is not in the spec.
3419         * page/PerformanceTiming.cpp:
3420         (WebCore::PerformanceTiming::domainLookupStart):
3421         (WebCore::PerformanceTiming::domainLookupEnd):
3422         (WebCore::PerformanceTiming::connectStart):
3423         (WebCore::PerformanceTiming::secureConnectionStart):
3424         (WebCore::PerformanceTiming::requestStart):
3425         (WebCore::PerformanceTiming::responseStart):
3426         Updated ResourceLoadTiming member variable names.
3427         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToAbsolute):
3428         Use navigationStart as base for resource load times.
3429         * page/PerformanceTiming.idl:
3430         Updated spec URL.
3431         * platform/network/HTTPParsers.h:
3432         Removed unused class declarations.
3433         * platform/network/ResourceHandle.h:
3434         Moved soup request time from ResourceLoadTiming to ResourceHandle.
3435         * platform/network/ResourceLoadTiming.cpp: Removed.
3436         * platform/network/ResourceLoadTiming.h:
3437         (WebCore::ResourceLoadTiming::deepCopy):
3438         (WebCore::ResourceLoadTiming::operator==):
3439         (WebCore::ResourceLoadTiming::ResourceLoadTiming):
3440         Updated ResourceLoadTiming member variable names.
3441         * platform/network/mac/ResourceHandleMac.mm:
3442         (WebCore::ResourceHandle::createNSURLConnection):
3443         Collect timing data.
3444         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
3445         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
3446         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3447         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
3448         Save timing data to a ResourceLoadTiming on the ResourceResponse.
3449         * platform/network/soup/ResourceHandleSoup.cpp:
3450         (WebCore::gotHeadersCallback):
3451         (WebCore::restartedCallback):
3452         (WebCore::milisecondsSinceRequest):
3453         (WebCore::ResourceHandle::didStartRequest):
3454         (WebCore::networkEventCallback):
3455         (WebCore::createSoupMessageForHandleAndRequest):
3456         (WebCore::ResourceHandle::sendPendingRequest):
3457         Updated ResourceLoadTiming member variable names.
3458         (WebCore::wroteBodyCallback): Deleted.
3459
3460 2014-05-12  Dirk Schulze  <krit@webkit.org>
3461
3462         SVG outline property is broken and inefficient
3463         https://bugs.webkit.org/show_bug.cgi?id=113666
3464
3465         Reviewed by Dean Jackson.
3466
3467         Patch by Erik Dahlström backported from Blink.
3468
3469         "[SVG2] css 'outline' property should apply to svg elements 
3470
3471         The 'outline' property was only partially working in SVG before
3472         this patch, this makes it work on text and text content child
3473         elements too. 
3474
3475         This makes SVG render the outlines as part of the foreground paint
3476         phase. 
3477
3478         Partly based on Florin Malita's webkit patch https://bugs.webkit.org/show_bug.cgi?id=113666#c12."
3479
3480         Tests: svg/custom/outline-stacking-expected.svg
3481                svg/custom/outline-stacking.svg
3482                svg/custom/rgba-color-outline.svg
3483                svg/text/text-outline-expected.svg
3484                svg/text/text-outline-rgba.html
3485                svg/text/text-outline.html
3486                svg/text/textpath-outline-expected.svg
3487                svg/text/textpath-outline.svg
3488                svg/text/tspan-multiple-outline.svg
3489                svg/text/tspan-outline-2-expected.svg
3490                svg/text/tspan-outline-2.svg
3491                svg/text/tspan-outline-expected.svg
3492                svg/text/tspan-outline.html
3493
3494         * rendering/svg/RenderSVGContainer.cpp:
3495         (WebCore::RenderSVGContainer::paint): Draw outline in forground
3496             paint phase.
3497         * rendering/svg/RenderSVGImage.cpp:
3498         (WebCore::RenderSVGImage::paint): Draw outline in forground
3499             paint phase.
3500         * rendering/svg/RenderSVGRoot.cpp:
3501         (WebCore::RenderSVGRoot::paintReplaced): Pass paint offset.
3502         * rendering/svg/RenderSVGShape.cpp:
3503         (WebCore::RenderSVGShape::paint): Draw outline in forground
3504             paint phase.
3505         * rendering/svg/RenderSVGText.cpp:
3506         (WebCore::RenderSVGText::paint): Draw outline in forground
3507             paint phase.
3508         * rendering/svg/SVGInlineFlowBox.cpp:
3509         (WebCore::SVGInlineFlowBox::paint): Pass paint offset.
3510         * rendering/svg/SVGInlineTextBox.cpp:
3511         (WebCore::SVGInlineTextBox::paint): Draw outline in forground
3512             paint phase.
3513         * rendering/svg/SVGRootInlineBox.cpp:
3514         (WebCore::SVGRootInlineBox::paint): Pass paint offset.
3515
3516 2014-05-12  Beth Dakin  <bdakin@apple.com>
3517
3518         Layer for bottom overhang area needs to be offset by the topContentInset
3519         https://bugs.webkit.org/show_bug.cgi?id=132835
3520         -and corresponding-
3521         <rdar://problem/16641115>
3522
3523         Reviewed by Simon Fraser.
3524
3525         Push this layer down by the topContentInset in addition to the root layer height, 
3526         footer height, and header height.
3527         * rendering/RenderLayerCompositor.cpp:
3528         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
3529
3530 2014-05-09  Jon Honeycutt  <jhoneycutt@apple.com>
3531
3532         REGRESSION (r167818): editing/inserting/typing-space-to-trigger-smart-link.html fails on WebKit1 bots
3533
3534         <https://bugs.webkit.org/show_bug.cgi?id=132207>
3535         <rdar://problem/16730393>
3536
3537         Reverts the previous workaround in favor of a more specific fix for the
3538         null dereference.
3539
3540         Reviewed by Darin Adler.
3541
3542         * editing/ApplyStyleCommand.cpp:
3543         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
3544         Check whether the run's start and end are still in the document, as
3545         removeConflictingInlineStyleFromRun() may have removed them.
3546
3547         * editing/CompositeEditCommand.cpp:
3548         (WebCore::CompositeEditCommand::apply):
3549         Reverted previous workaround.
3550         (WebCore::ApplyEditCommand::ReentrancyGuard::isRecursiveCall): Deleted.
3551         (WebCore::ApplyEditCommand::ReentrancyGuard::Scope::Scope): Deleted.
3552         (WebCore::ApplyEditCommand::ReentrancyGuard::Scope::~Scope): Deleted.
3553
3554 2014-05-12  Zan Dobersek  <zdobersek@igalia.com>
3555
3556         Clean up CrossThreadTask
3557         https://bugs.webkit.org/show_bug.cgi?id=132800
3558
3559         Reviewed by Darin Adler.
3560
3561         Remove the createCallbackTask overloads and the related CrossThreadTask helper classes.
3562
3563         Instead, have one simple CrossThreadTask class that derives from ScriptExecutionContext::Task.
3564         Its templated constructor takes in the method and the variadic pack of parameters. The cross-thread
3565         copies of the parameters are then bound to that method and the resulting bind expression is used to
3566         initialize the base class. The bind expression is constructed with a placeholder for the
3567         ScriptExecutionContext* parameter that's provided through ScriptExecutionContext::Task::performTask().
3568
3569         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
3570         (WebCore::ThreadableWebSocketChannelClientWrapper::didConnect):
3571         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessage):
3572         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
3573         (WebCore::ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmount):
3574         (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake):
3575         (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
3576         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageError):
3577         (WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks):
3578         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
3579         (WebCore::WorkerThreadableWebSocketChannel::Peer::send):
3580         (WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount):
3581         (WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect):
3582         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage):
3583         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
3584         (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount):
3585         (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
3586         (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
3587         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
3588         (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
3589         (WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize):
3590         (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
3591         (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
3592         (WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount):
3593         (WebCore::WorkerThreadableWebSocketChannel::Bridge::close):
3594         (WebCore::WorkerThreadableWebSocketChannel::Bridge::fail):
3595         (WebCore::WorkerThreadableWebSocketChannel::Bridge::disconnect):
3596         (WebCore::WorkerThreadableWebSocketChannel::Bridge::suspend):
3597         (WebCore::WorkerThreadableWebSocketChannel::Bridge::resume):
3598         * dom/CrossThreadTask.h:
3599         (WebCore::CrossThreadTask::CrossThreadTask):
3600         (WebCore::CrossThreadTask1::CrossThreadTask1): Deleted.
3601         (WebCore::CrossThreadTask1::performTask): Deleted.
3602         (WebCore::CrossThreadTask2::CrossThreadTask2): Deleted.
3603         (WebCore::CrossThreadTask2::performTask): Deleted.
3604         (WebCore::CrossThreadTask3::CrossThreadTask3): Deleted.
3605         (WebCore::CrossThreadTask3::performTask): Deleted.
3606         (WebCore::CrossThreadTask4::CrossThreadTask4): Deleted.
3607         (WebCore::CrossThreadTask4::performTask): Deleted.
3608         (WebCore::CrossThreadTask5::CrossThreadTask5): Deleted.
3609         (WebCore::CrossThreadTask5::performTask): Deleted.
3610         (WebCore::CrossThreadTask6::CrossThreadTask6): Deleted.
3611         (WebCore::CrossThreadTask6::performTask): Deleted.
3612         (WebCore::CrossThreadTask7::CrossThreadTask7): Deleted.
3613         (WebCore::CrossThreadTask7::performTask): Deleted.
3614         (WebCore::CrossThreadTask8::CrossThreadTask8): Deleted.
3615         (WebCore::CrossThreadTask8::performTask): Deleted.
3616         (WebCore::createCallbackTask): Deleted.
3617         * fileapi/FileReader.cpp:
3618         (WebCore::FileReader::abort):
3619         * loader/WorkerThreadableLoader.cpp:
3620         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
3621         (WebCore::WorkerThreadableLoader::MainThreadBridge::destroy):
3622         (WebCore::WorkerThreadableLoader::MainThreadBridge::cancel):
3623         (WebCore::WorkerThreadableLoader::MainThreadBridge::didSendData):
3624         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse):
3625         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData):
3626         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
3627         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail):
3628         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailAccessControlCheck):
3629         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck):
3630         * loader/WorkerThreadableLoader.h:
3631         * loader/cache/MemoryCache.cpp:
3632         (WebCore::MemoryCache::removeRequestFromCache):
3633         (WebCore::MemoryCache::removeRequestFromSessionCaches):
3634         * workers/DefaultSharedWorkerRepository.cpp:
3635         (WebCore::SharedWorkerProxy::postExceptionToWorkerObject):
3636         (WebCore::SharedWorkerProxy::postConsoleMessageToWorkerObject):
3637         * workers/WorkerMessagingProxy.cpp:
3638         (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject):
3639         (WebCore::WorkerMessagingProxy::workerObjectDestroyed):
3640         (WebCore::WorkerMessagingProxy::connectToInspector):
3641         (WebCore::WorkerMessagingProxy::disconnectFromInspector):
3642         (WebCore::WorkerMessagingProxy::sendMessageToInspector):
3643
3644 2014-05-12  Alex Christensen  <achristensen@webkit.org>
3645
3646         Implement EXT_shader_texture_lod in WebGL.
3647         https://bugs.webkit.org/show_bug.cgi?id=128985
3648         <rdar://problem/16111396>
3649
3650         Based on Chromium patch by bajones@chromium.org.
3651         https://src.chromium.org/viewvc/blink?revision=171465&view=revision
3652
3653         Reviewed by Dean Jackson.
3654
3655         Test: webgl/conformance/extensions/ext-shader-texture-lod.html
3656         
3657         * CMakeLists.txt:
3658         * DerivedSources.cpp:
3659         * DerivedSources.make:
3660         * WebCore.vcxproj/WebCore.vcxproj:
3661         * WebCore.vcxproj/WebCore.vcxproj.filters:
3662         * WebCore.xcodeproj/project.pbxproj:
3663         Added new EXTShaderTextureLOD files.
3664         * bindings/js/JSWebGLRenderingContextCustom.cpp:
3665         (WebCore::toJS):
3666         Added EXTShaderTextureLOD.
3667         * html/canvas/EXTShaderTextureLOD.cpp: Added.
3668         (WebCore::EXTShaderTextureLOD::EXTShaderTextureLOD):
3669         (WebCore::EXTShaderTextureLOD::~EXTShaderTextureLOD):
3670         (WebCore::EXTShaderTextureLOD::getName):
3671         * html/canvas/EXTShaderTextureLOD.h: Added.
3672         * html/canvas/EXTShaderTextureLOD.idl: Added.
3673         * html/canvas/WebGLExtension.h:
3674         Added EXTShaderTextureLODName.
3675         * html/canvas/WebGLObject.cpp:
3676         Removed unused inclusion of EXTTextureFilterAnisotropic.h.
3677         * html/canvas/WebGLRenderingContext.cpp:
3678         (WebCore::WebGLRenderingContext::getExtension):
3679         Added EXT_shader_texture_lod.
3680         * html/canvas/WebGLRenderingContext.h:
3681         Added a EXTShaderTextureLOD member variable.
3682
3683 2014-05-12  Martin Hock  <mhock@apple.com>
3684
3685         Disallow drag and drop of non-displayable resources.
3686         https://bugs.webkit.org/show_bug.cgi?id=132745
3687         <rdar://problem/10562662>
3688
3689         Reviewed by Alexey Proskuryakov.
3690
3691         Test: http/tests/security/drag-drop-local-file.html
3692
3693         * page/DragController.cpp:
3694         (WebCore::DragController::startDrag):
3695
3696 2014-05-12  Jozsef Berta  <jberta.u-szeged@partner.samsung.com>
3697
3698         WinCairo buildfix after r168611
3699         https://bugs.webkit.org/show_bug.cgi?id=132825
3700
3701         Reviewed by Darin Adler.
3702
3703         * platform/network/curl/CurlDownload.cpp:
3704         (WebCore::CurlDownloadManager::downloadThread):
3705         (WebCore::CurlDownload::didReceiveHeader):
3706         (WebCore::CurlDownload::didReceiveData):
3707
3708 2014-05-12  Antti Koivisto  <antti@apple.com>
3709
3710         REGRESSION (r159560): Text clips on tile border if line-height < font-size
3711         https://bugs.webkit.org/show_bug.cgi?id=132822
3712
3713         Reviewed by Andreas Kling.
3714         
3715         The first line of simple line layout run range was miscomputed.
3716
3717         Test: fast/text/simple-lines-range-low-line-height.html
3718
3719         * rendering/SimpleLineLayoutResolver.h:
3720         (WebCore::SimpleLineLayout::RunResolver::lineIndexForHeight):
3721         
3722             Lines may overlap if line-height < font-size. Apply different adjustment when searching for range begin
3723             so that overflowing earlier lines are taken into account.
3724
3725         (WebCore::SimpleLineLayout::RunResolver::rangeForRect):
3726
3727 2014-05-12  Radu Stavila  <stavila@adobe.com>
3728
3729         Invalid information remaining in lineToRegion map of RenderFlowThread.
3730         https://bugs.webkit.org/show_bug.cgi?id=132690
3731
3732         Reviewed by Antti Koivisto.
3733
3734         Test: fast/multicol/newmulticol/lines-region-map-crash.html
3735
3736         * rendering/RenderFlowThread.cpp:
3737         (WebCore::RenderFlowThread::deleteLines):
3738         * rendering/RenderFlowThread.h:
3739
3740 2014-05-12  Zan Dobersek  <zdobersek@igalia.com>
3741
3742         Clean up MainThreadTask
3743         https://bugs.webkit.org/show_bug.cgi?id=132799
3744
3745         Reviewed by Darin Adler.
3746
3747         Only have one simple MainThreadTask class that derives from std::function<void ()>.
3748         Its templated constructor takes in the method and a variadic pack of parameters.
3749         The cross-thread copies of the parameter are then bound to the given method through
3750         std::bind(), with the resulting bind expression used to initialize the base
3751         std::function<void ()> class.
3752
3753         The WebCore::callOnMainThread() functions and the helper classes are removed in favor
3754         of passing MainThreadTask rvalues directly to WTF::callOnMainThread().
3755
3756         * fileapi/AsyncFileStream.cpp:
3757         (WebCore::AsyncFileStream::startOnFileThread):
3758         (WebCore::AsyncFileStream::stopOnFileThread):
3759         (WebCore::AsyncFileStream::getSizeOnFileThread):
3760         (WebCore::AsyncFileStream::openForReadOnFileThread):
3761         (WebCore::AsyncFileStream::openForWriteOnFileThread):
3762         (WebCore::AsyncFileStream::readOnFileThread):
3763         (WebCore::AsyncFileStream::writeOnFileThread):
3764         (WebCore::AsyncFileStream::truncateOnFileThread):
3765         * platform/MainThreadTask.h:
3766         (WebCore::MainThreadTask::MainThreadTask):
3767         (WebCore::MainThreadTaskBase::MainThreadTaskBase): Deleted.
3768         (WebCore::MainThreadTaskBase::~MainThreadTaskBase): Deleted.
3769         (WebCore::MainThreadTask1::create): Deleted.
3770         (WebCore::MainThreadTask1::MainThreadTask1): Deleted.
3771         (WebCore::MainThreadTask2::create): Deleted.
3772         (WebCore::MainThreadTask2::MainThreadTask2): Deleted.
3773         (WebCore::MainThreadTask3::create): Deleted.
3774         (WebCore::MainThreadTask3::MainThreadTask3): Deleted.
3775         (WebCore::MainThreadTask4::create): Deleted.
3776         (WebCore::MainThreadTask4::MainThreadTask4): Deleted.
3777         (WebCore::MainThreadTask5::create): Deleted.
3778         (WebCore::MainThreadTask5::MainThreadTask5): Deleted.
3779         (WebCore::MainThreadTask6::create): Deleted.
3780         (WebCore::MainThreadTask6::MainThreadTask6): Deleted.
3781         (WebCore::MainThreadTask7::create): Deleted.
3782         (WebCore::MainThreadTask7::MainThreadTask7): Deleted.
3783         (WebCore::MainThreadTask8::create): Deleted.
3784         (WebCore::MainThreadTask8::MainThreadTask8): Deleted.
3785         (WebCore::executeMainThreadTask): Deleted.
3786         (WebCore::callOnMainThread): Deleted.
3787
3788 2014-05-11  Zan Dobersek  <zdobersek@igalia.com>
3789
3790         Simplify FileThread::Task usage
3791         https://bugs.webkit.org/show_bug.cgi?id=132798
3792
3793         Reviewed by Darin Adler.
3794
3795         Remove the createFileThreadTask functions and the related FileThreadTask helper classes.
3796
3797         Instead, the FileThread::Task class now has a templated constructor that takes in a pointer
3798         to the object instance, a method, and a variadic pack of parameters. The pointer and the
3799         cross-thread copies of all the parameters are then bound to the given method through std::bind().
3800
3801         Instead of createFileThreadTask, std::make_unique<>() should be used to construct unique pointers
3802         that wrap FileThread::Task objects.
3803
3804         * WebCore.vcxproj/WebCore.vcxproj:
3805         * WebCore.vcxproj/WebCore.vcxproj.filters:
3806         * WebCore.xcodeproj/project.pbxproj:
3807         * fileapi/AsyncFileStream.cpp:
3808         (WebCore::AsyncFileStream::create):
3809         (WebCore::AsyncFileStream::stop):
3810         (WebCore::AsyncFileStream::getSize):
3811         (WebCore::AsyncFileStream::openForRead):
3812         (WebCore::AsyncFileStream::openForWrite):
3813         (WebCore::AsyncFileStream::close):
3814         (WebCore::AsyncFileStream::read):
3815         (WebCore::AsyncFileStream::write):
3816         (WebCore::AsyncFileStream::truncate):
3817         * fileapi/FileThread.h:
3818         (WebCore::FileThread::Task::Task):
3819         (WebCore::FileThread::Task::performTask):
3820         (WebCore::FileThread::Task::~Task): Deleted.
3821         * fileapi/FileThreadTask.h: Removed.
3822
3823 2014-05-11  Benjamin Poulain  <benjamin@webkit.org>
3824
3825         Do not create a temporary string to append the SVGLength's unit
3826         https://bugs.webkit.org/show_bug.cgi?id=132807
3827
3828         Reviewed by Geoffrey Garen.
3829
3830         * svg/SVGLength.cpp:
3831         (WebCore::lengthTypeToString):
3832         The caller just append the string to a number string. The function
3833         lengthTypeToString() was creating a new WTF::String from scratch,
3834         copied the characters to make a new string, and destroyed the WTF::String.
3835
3836         Instead, just append the string literal.
3837
3838 2014-05-11  Yusuke Suzuki  <utatane.tea@gmail.com>
3839
3840         CSS JIT: reduce cost of computing backtracking height
3841         https://bugs.webkit.org/show_bug.cgi?id=132546
3842
3843         Reviewed by Benjamin Poulain.
3844
3845         Because compiler previously compute backtracking height for
3846         previous child fragment, by leveraging this, we can limit the
3847         `maxPrefixSize` for `computeBacktrackingHeightFromDescendant`.
3848
3849         For example, consider selector "c>a>b>d>a>b e"'s descendant chain,
3850         "c>a>b>d>a>b".
3851
3852         At the <a> position, we have matching pattern [b, a, d, b, a] and
3853         calculate the backtracking height by following method.
3854
3855         pattern:    [b, a, d, b, a]
3856         candidate0:    [b, a, d, b]  => Not matched.
3857         candidate1:       [b, a, d]  => Not matched.
3858         candidate2:          [b, a]  => Matched against the pattern.
3859
3860         At this time, first candidate0's pattern size is `pattern.size() - 1`.
3861         And get backtracking height from descendant 3, that is
3862         `pattern.size() - candidate.size()`, `5 - 2`.
3863
3864         And next, at the <c> position, we calcucate the backtracking height
3865         for this pattern.
3866
3867         pattern:    [b, a, d, b, a, c]
3868         candidate0:    [b, a, d, b, a]  => Not matched.
3869         candidate1:       [b, a, d, b]  => Not matched.
3870         candidate2:          [b, a, d]  => Not matched.
3871         candidate3:             [b, a]  => Not matched.
3872         candidate4:                [b]  => Not matched.
3873         candidate5:                 []  => Matched against the pattern.
3874
3875         Then, we get the backtracking height, which is 6 (6 - 0).
3876         However, in the above case, we already know that attempts from candidate0
3877         to candidate1 always fail, since parts of these are already tested at
3878         the <b> position trial and we know they don't match.
3879
3880         So in this case, we should start this computation from candidate2,
3881         such as,
3882
3883         pattern:    [b, a, d, b, a, c]
3884         candidate2:          [b, a, d]  => Not matched.
3885         candidate3:             [b, a]  => Not matched.
3886         candidate4:                [b]  => Not matched.
3887         candidate5:                 []  => Matched against the pattern.
3888
3889         We can start computation with candidate size
3890         `pattern.size() - previousChildFragmentBacktrackingHeight`.
3891         In this example, `pattern.size()` is 6 and
3892         `previousChildFragmentBacktrackingHeight` is 3, so candidate size is
3893         3, that is candidate2.
3894
3895         * cssjit/SelectorCompiler.cpp:
3896         (WebCore::SelectorCompiler::computeBacktrackingStartHeightFromDescendant):
3897         (WebCore::SelectorCompiler::computeBacktrackingHeightFromDescendant):
3898
3899 2014-05-11  Beth Dakin  <bdakin@apple.com>
3900
3901         Headers and footers are not positioned correctly with topContentInset
3902         https://bugs.webkit.org/show_bug.cgi?id=132787
3903         -and corresponding-
3904         <rdar://problem/16641115>
3905
3906         Reviewed by Tim Horton.
3907
3908         Headers and footers need to take the inset into account, and they also need to 
3909         factor in the fact that the root layer moves around now too.
3910
3911         The existing yPositionForRootContentLayer() is actually the right calculation for 
3912         the header layer. The root content layer wants that value, but pushed down by the 
3913         header height. Now there are static functions for both of them and the footer to 
3914         avoid duplicated code in the three spots where we need this information.
3915         * page/FrameView.cpp:
3916         (WebCore::FrameView::yPositionForHeaderLayer):
3917         (WebCore::FrameView::yPositionForRootContentLayer):
3918         (WebCore::FrameView::yPositionForFooterLayer):
3919         * page/FrameView.h:
3920
3921         Use the static functions to compute the layer positions.
3922         * page/scrolling/AsyncScrollingCoordinator.cpp:
3923         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
3924
3925         How did headers ever work with this bug?? I don’t know. We need to return that 
3926         layer.
3927         * page/scrolling/ScrollingCoordinator.cpp:
3928         (WebCore::ScrollingCoordinator::headerLayerForFrameView):
3929
3930         Use the static functions to compute the layer positions.
3931         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
3932         (WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):
3933         * rendering/RenderLayerCompositor.cpp:
3934         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
3935         (WebCore::RenderLayerCompositor::updateLayerForHeader):
3936         (WebCore::RenderLayerCompositor::updateLayerForFooter):
3937
3938 2014-05-11  Zalan Bujtas  <zalan@apple.com>
3939
3940         Subpixel rendering[iOS]: <select> decoration is misaligned when the renderer is on subpixel position.
3941         https://bugs.webkit.org/show_bug.cgi?id=132779
3942         <rdar://problem/16631071>
3943
3944         Reviewed by Simon Fraser.
3945
3946         Push <select> theme decoration's rect to device pixel position to ensure
3947         that the theme bounds are aligned with the renderer's bounds. (in painting terms)
3948         However, as the decoration code paints multiple items, they all need to use snapped 
3949         final coordinates for painting : tracked here https://bugs.webkit.org/show_bug.cgi?id=132780
3950         This patch also changes the padding values for <select> [iOS] to compensate for the integer
3951         truncation that happened before subpixel. 
3952
3953         Not testable.
3954
3955         * css/html.css:
3956         (select):
3957         * platform/efl/RenderThemeEfl.cpp:
3958         (WebCore::RenderThemeEfl::paintMenuListButtonDecorations):
3959         * platform/efl/RenderThemeEfl.h:
3960         * platform/gtk/RenderThemeGtk.cpp:
3961         (WebCore::RenderThemeGtk::paintMenuListButtonDecorations):
3962         * platform/gtk/RenderThemeGtk.h:
3963         * rendering/RenderTheme.cpp:
3964         (WebCore::RenderTheme::paintDecorations):
3965         * rendering/RenderTheme.h:
3966         (WebCore::RenderTheme::paintMenuListButtonDecorations):
3967      &n