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