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