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