Invalid cast in WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients()
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-03-05  Jon Honeycutt  <jhoneycutt@apple.com>
2
3         Invalid cast in WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients()
4
5         <https://bugs.webkit.org/show_bug.cgi?id=121887>
6         <rdar://problem/15073043>
7
8         Clang appears to be optimizing out a branch in RenderObject::node()
9         when compiling RenderLayer::FilterInfo::updateReferenceFilterClients().
10         We'll work around this by factoring out the code in question into a
11         separate member function marked NEVER_INLINE.
12
13         No test possible due to <https://bugs.webkit.org/show_bug.cgi?id=129757>.
14
15         Reviewed by David Kilzer.
16
17         * rendering/RenderLayerFilterInfo.cpp:
18         (WebCore::RenderLayer::FilterInfo::layerElement):
19         Code moved from updateReferenceFilterClients(). Returns the Element*
20         for m_layer.
21         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
22         Use layerElement().
23
24         * rendering/RenderLayerFilterInfo.h:
25         Declared layerElement().
26
27 2014-03-06  Joseph Pecoraro  <pecoraro@apple.com>
28
29         Web Inspector: Expose the console object in JSContexts to interact with Web Inspector
30         https://bugs.webkit.org/show_bug.cgi?id=127944
31
32         Reviewed by Geoffrey Garen.
33
34         Covered by existing tests.
35
36         * CMakeLists.txt:
37         * DerivedSources.cpp:
38         * DerivedSources.make:
39         * ForwardingHeaders/runtime/ConsoleClient.h: Added.
40         * ForwardingHeaders/runtime/ConsoleTypes.h: Renamed from Source/WebCore/ForwardingHeaders/inspector/ConsoleTypes.h.
41         * GNUmakefile.list.am:
42         * PlatformGTK.cmake:
43         * WebCore.exp.in:
44         * WebCore.vcxproj/WebCore.vcxproj:
45         * WebCore.vcxproj/WebCore.vcxproj.filters:
46         * WebCore.xcodeproj/project.pbxproj:
47         * bindings/gobject/GNUmakefile.am:
48         Update build systems.
49
50         * page/Console.cpp: Removed.
51         * page/Console.h: Removed.
52         * page/Console.idl: Removed.
53         * page/DOMWindow.cpp:
54         (WebCore::DOMWindow::~DOMWindow):
55         (WebCore::DOMWindow::resetDOMWindowProperties):
56         * page/DOMWindow.h:
57         (WebCore::DOMWindow::defaultStatus):
58         * page/DOMWindow.idl:
59         Removed the old IDL generated Console object on window.
60
61         * page/PageConsole.cpp:
62         (WebCore::PageConsole::shouldPrintExceptions):
63         (WebCore::PageConsole::setShouldPrintExceptions):
64         (WebCore::PageConsole::mute):
65         (WebCore::PageConsole::unmute):
66         (WebCore::PageConsole::messageWithTypeAndLevel):
67         (WebCore::PageConsole::count):
68         (WebCore::PageConsole::profile):
69         (WebCore::PageConsole::profileEnd):
70         (WebCore::PageConsole::time):
71         (WebCore::PageConsole::timeEnd):
72         (WebCore::PageConsole::timeStamp):
73         (WebCore::PageConsole::group):
74         (WebCore::PageConsole::groupCollapsed):
75         (WebCore::PageConsole::groupEnd):
76         (WebCore::PageConsole::clearProfiles):
77         * page/PageConsole.h:
78         Move the handling of Console object into PageConsole.
79
80         * bindings/js/ScriptCachedFrameData.cpp:
81         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
82         (WebCore::ScriptCachedFrameData::restore):
83         * bindings/js/ScriptController.cpp:
84         (WebCore::ScriptController::clearWindowShell):
85         (WebCore::ScriptController::initScript):
86         Set the PageConsole as the ConsoleClient of the JSGlobalObject
87         so that WebCore may handle console messages directly. For instance
88         it may pass messages on to the ChromeClient.
89
90         * testing/Internals.cpp:
91         (WebCore::Internals::consoleProfiles):
92         To access profiles, go through PageConsole now instead of Console.
93
94         * bindings/js/JSDOMWindowBase.cpp:
95         * bindings/objc/WebScriptObject.mm:
96         * css/MediaList.cpp:
97         * dom/ScriptExecutionContext.h:
98         * dom/UIEvent.cpp:
99         * dom/ViewportArguments.cpp:
100         * html/parser/XSSAuditorDelegate.cpp:
101         * inspector/CommandLineAPIHost.h:
102         * inspector/InspectorInstrumentation.cpp:
103         * inspector/InspectorInstrumentation.h:
104         * inspector/InspectorProfilerAgent.cpp:
105         * inspector/WebConsoleAgent.cpp:
106         * loader/FrameLoader.cpp:
107         * loader/MixedContentChecker.cpp:
108         * loader/appcache/ApplicationCacheGroup.cpp:
109         * loader/cache/CachedResourceLoader.cpp:
110         * page/ChromeClient.h:
111         * page/ContentSecurityPolicy.cpp:
112         * page/Page.cpp:
113         * page/Page.h:
114         * svg/SVGDocumentExtensions.cpp:
115         * workers/WorkerMessagingProxy.cpp:
116         * workers/WorkerReportingProxy.h:
117         Update includes.
118
119 2014-03-06  Zsolt Borbely  <borbezs@inf.u-szeged.hu>
120
121         Fix the !ENABLE(CSS_STICKY_POSITION) build
122         https://bugs.webkit.org/show_bug.cgi?id=129793
123
124         Reviewed by Simon Fraser.
125
126         Add missing ENABLE(CSS_STICKY_POSITION) guard to EditingStyle::convertPositionStyle().
127
128         * editing/EditingStyle.cpp:
129         (WebCore::EditingStyle::convertPositionStyle):
130
131 2014-03-06  Joseph Pecoraro  <pecoraro@apple.com>
132
133         [Mac] Leak: dispatch_semaphore leak allocated in MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange
134         https://bugs.webkit.org/show_bug.cgi?id=129792
135
136         Reviewed by Anders Carlsson.
137
138         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
139         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
140
141 2014-03-06  Brendan Long  <b.long@cablelabs.com>
142
143         Implement VideoTrackList.selectedIndex
144         https://bugs.webkit.org/show_bug.cgi?id=129770
145
146         Reviewed by Eric Carlson.
147
148         Tests: media/track/video/video-track-mkv-theora-selected.html
149
150         * html/track/VideoTrackList.idl:
151
152 2014-03-06  Lorenzo Tilve  <ltilve@igalia.com>
153
154         [GTK][CMake] Fix the GTK+ CMake build
155         https://bugs.webkit.org/show_bug.cgi?id=129801
156
157         Reviewed by Martin Robinson.
158
159         Include missing files for CMake build
160
161         * CMakeLists.txt: Add a missing references to DOMURLMediaStream
162
163 2014-03-06  Zalan Bujtas  <zalan@apple.com>
164
165         Subpixel rendering: Setting content to opaque on m_graphicsLayer depends on subpixel accumulation.
166         https://bugs.webkit.org/show_bug.cgi?id=129776
167
168         Reviewed by Simon Fraser.
169
170         isEmpty() returns true when any of the dimensions is <= 0. Subpixel accumulation could happen
171         in one direction only. Use isZero() instead().
172
173         * rendering/RenderLayerBacking.cpp:
174         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
175
176 2014-03-06  Gurpreet Kaur  <k.gurpreet@samsung.com>
177
178         REGRESSION (r158254): Rubber-banding at Bing image search causes the toolbar to move up and away
179         https://bugs.webkit.org/show_bug.cgi?id=128873
180
181         Reviewed by Antonio Gomes.
182
183         This regression is caused by  http://trac.webkit.org/changeset/154614 
184         and http://trac.webkit.org/changeset/156605. So reverting the changes
185         to make it Web compatible as earlier.
186
187         * dom/Element.cpp:
188         (WebCore::Element::scrollLeft):
189         (WebCore::Element::scrollTop):
190         (WebCore::Element::setScrollLeft):
191         (WebCore::Element::setScrollTop):
192         Reverting changes as it caused regression.
193
194 2014-03-06  Zan Dobersek  <zdobersek@igalia.com>
195
196         Move Source/WebCore/html/canvas/ code to std::unique_ptr
197         https://bugs.webkit.org/show_bug.cgi?id=129668
198
199         Reviewed by Anders Carlsson.
200
201         Replace uses of OwnPtr and PassOwnPtr in code under Source/WebCore/html/canvas/ to std::unique_ptr.
202
203         * html/HTMLCanvasElement.cpp:
204         (WebCore::HTMLCanvasElement::~HTMLCanvasElement):
205         (WebCore::HTMLCanvasElement::getContext):
206         * html/HTMLCanvasElement.h:
207         * html/canvas/ANGLEInstancedArrays.cpp:
208         * html/canvas/ANGLEInstancedArrays.h:
209         * html/canvas/CanvasRenderingContext2D.h:
210         * html/canvas/EXTTextureFilterAnisotropic.cpp:
211         * html/canvas/EXTTextureFilterAnisotropic.h:
212         * html/canvas/OESElementIndexUint.cpp:
213         * html/canvas/OESElementIndexUint.h:
214         * html/canvas/OESStandardDerivatives.cpp:
215         * html/canvas/OESStandardDerivatives.h:
216         * html/canvas/OESTextureFloat.cpp:
217         * html/canvas/OESTextureFloat.h:
218         * html/canvas/OESTextureFloatLinear.cpp:
219         * html/canvas/OESTextureFloatLinear.h:
220         * html/canvas/OESTextureHalfFloat.cpp:
221         * html/canvas/OESTextureHalfFloat.h:
222         * html/canvas/OESTextureHalfFloatLinear.cpp:
223         * html/canvas/OESTextureHalfFloatLinear.h:
224         * html/canvas/OESVertexArrayObject.cpp:
225         * html/canvas/OESVertexArrayObject.h:
226         * html/canvas/WebGLCompressedTextureATC.cpp:
227         * html/canvas/WebGLCompressedTextureATC.h:
228         * html/canvas/WebGLCompressedTexturePVRTC.cpp:
229         * html/canvas/WebGLCompressedTexturePVRTC.h:
230         * html/canvas/WebGLCompressedTextureS3TC.cpp:
231         * html/canvas/WebGLCompressedTextureS3TC.h:
232         * html/canvas/WebGLDebugRendererInfo.cpp:
233         * html/canvas/WebGLDebugRendererInfo.h:
234         * html/canvas/WebGLDebugShaders.cpp:
235         * html/canvas/WebGLDebugShaders.h:
236         * html/canvas/WebGLDepthTexture.cpp:
237         * html/canvas/WebGLDepthTexture.h:
238         * html/canvas/WebGLDrawBuffers.cpp:
239         * html/canvas/WebGLDrawBuffers.h:
240         * html/canvas/WebGLLoseContext.cpp:
241         * html/canvas/WebGLLoseContext.h:
242         * html/canvas/WebGLRenderingContext.cpp:
243         (WebCore::WebGLRenderingContext::create):
244         (WebCore::WebGLRenderingContext::getExtension):
245         * html/canvas/WebGLRenderingContext.h:
246
247 2014-03-06  Zan Dobersek  <zdobersek@igalia.com>
248
249         Move Source/WebCore/editing/ code to std::unique_ptr
250         https://bugs.webkit.org/show_bug.cgi?id=129665
251
252         Reviewed by Anders Carlsson.
253
254         Replace uses of OwnPtr and PassOwnPtr in code under Source/WebCore/editing/ with std::unique_ptr.
255
256         * editing/EditingStyle.cpp:
257         (WebCore::htmlElementEquivalents):
258         (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement):
259         (WebCore::htmlAttributeEquivalents):
260         (WebCore::EditingStyle::conflictsWithImplicitStyleOfAttributes):
261         (WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes):
262         (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
263         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
264         * editing/Editor.cpp:
265         (WebCore::Editor::Editor):
266         (WebCore::Editor::clear):
267         * editing/Editor.h:
268         * page/Frame.cpp:
269         (WebCore::Frame::Frame):
270         * page/Frame.h:
271
272 2014-03-06  Zan Dobersek  <zdobersek@igalia.com>
273
274         Move to using std::unique_ptr for KeyboardEvent, ScriptExecutionContext::PendingException
275         https://bugs.webkit.org/show_bug.cgi?id=129061
276
277         Reviewed by Eric Carlson.
278
279         Replace uses of OwnPtr and PassOwnPtr for KeyboardEvent and ScriptExecutionContext::PendingException
280         classes with std::unique_ptr. ScriptExecutionContext::Task objects are still handled through OwnPtr,
281         but this will be addressed later.
282
283         * dom/KeyboardEvent.cpp:
284         (WebCore::KeyboardEvent::KeyboardEvent):
285         * dom/KeyboardEvent.h:
286         * dom/ScriptExecutionContext.cpp:
287         (WebCore::ScriptExecutionContext::reportException):
288         * dom/ScriptExecutionContext.h:
289         * dom/ScriptRunner.h: Remove an unnecessary PassOwnPtr header inclusion.
290
291 2014-03-06  Commit Queue  <commit-queue@webkit.org>
292
293         Unreviewed, rolling out r165175.
294         http://trac.webkit.org/changeset/165175
295         https://bugs.webkit.org/show_bug.cgi?id=129788
296
297         Linking failures on GTK, EFL due to missing gstreamer-tag-1.0
298         dependency (Requested by zdobersek on #webkit).
299
300         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
301         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
302
303 2014-03-05  Brendan Long  <b.long@cablelabs.com>
304
305         [GStreamer] human readable language code for tracks
306         https://bugs.webkit.org/show_bug.cgi?id=124514
307
308         Reviewed by Philippe Normand.
309
310         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
311         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): Run language codes though gst_tag_get_language_code_iso_639_1() to make sure they're valid.
312
313 2014-03-05  Ryuan Choi  <ryuan.choi@samsung.com>
314
315         Remove unused method from Vibration
316         https://bugs.webkit.org/show_bug.cgi?id=129732
317
318         Reviewed by Gyuyoung Kim.
319
320         * Modules/vibration/Vibration.cpp:
321         Removed isActive(), which is never called since r152441.
322         * Modules/vibration/Vibration.h: Ditto.
323
324 2014-03-05  Commit Queue  <commit-queue@webkit.org>
325
326         Unreviewed, rolling out r165141, r165157, and r165158.
327         http://trac.webkit.org/changeset/165141
328         http://trac.webkit.org/changeset/165157
329         http://trac.webkit.org/changeset/165158
330         https://bugs.webkit.org/show_bug.cgi?id=129772
331
332         "broke ftl" (Requested by olliej_ on #webkit).
333
334         * ForwardingHeaders/jit/SpillRegistersMode.h: Removed.
335
336 2014-03-05  Martin Robinson  <mrobinson@igalia.com>
337
338         [GTK][CMake] The GObject DOM bindings should always be built
339         https://bugs.webkit.org/show_bug.cgi?id=127963
340
341         Reviewed by Ryosuke Niwa.
342
343         * PlatformGTK.cmake: Make compilation of the WebKitGTK+ GObject DOM bindings
344         unconditional, instead of conditional on the WebKit2 build.
345
346 2014-03-05  Jer Noble  <jer.noble@apple.com>
347
348         [MSE] Crash in SourceBuffer::sourceBufferPrivateDidReceiveSample() - received samples after SourceBuffer was removed.
349         https://bugs.webkit.org/show_bug.cgi?id=129761
350
351         Reviewed by Eric Carlson.
352
353         Guard against the possibility that SourceBufferPrivates will continue to generate samples even after
354         a parse error. Bail out early from sourceBufferPrivateDidReceiveInitializationSegment and
355         sourceBufferPrivateDidReceiveSample if the SourceBuffer has been removed.
356
357         * Modules/mediasource/SourceBuffer.cpp:
358         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
359         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
360
361 2014-03-05  Enrica Casucci  <enrica@apple.com>
362
363         Build fix, take 2.
364
365         * platform/mac/HTMLConverter.mm:
366
367 2014-03-05  Enrica Casucci  <enrica@apple.com>
368
369         Build fix.
370
371         * platform/mac/HTMLConverter.mm:
372
373 2014-03-05  Enrica Casucci  <enrica@apple.com>
374
375         Crash when copying content that contains <sup>.
376         https://bugs.webkit.org/show_bug.cgi?id=129765
377         <rdar://problem/16139498>
378         
379         Reviewed by Benjamin Poulain.
380
381         Adding static definition of NSAttributeSuperscriptName.
382
383         * platform/mac/HTMLConverter.mm:
384
385 2014-03-05  Gavin Barraclough  <barraclough@apple.com>
386
387         https://bugs.webkit.org/show_bug.cgi?id=128625
388         Add fast mapping from StringImpl to JSString
389
390         Unreviewed roll-out.
391
392         Reverting r164347, r165054, r165066 - not clear the performance tradeoff was right.
393
394         * bindings/js/DOMWrapperWorld.cpp:
395         (WebCore::DOMWrapperWorld::clearWrappers):
396         * bindings/js/DOMWrapperWorld.h:
397         * bindings/js/JSDOMBinding.h:
398         (WebCore::jsStringWithCache):
399         * bindings/js/JSDOMWindowBase.cpp:
400         (WebCore::JSDOMWindowBase::commonVM):
401         * bindings/scripts/StaticString.pm:
402         (GenerateStrings):
403
404 2014-03-05  Daniel Bates  <dabates@apple.com>
405             And Alexey Proskuryakov  <ap@apple.com>
406
407         ASSERT(newestManifest) fails in WebCore::ApplicationCacheGroup::didFinishLoadingManifest()
408         https://bugs.webkit.org/show_bug.cgi?id=129753
409         <rdar://problem/12069835>
410
411         Reviewed by Alexey Proskuryakov.
412
413         Fixes an issue where an assertion failure would occur when visiting a web site whose on-disk
414         app cache doesn't contain a manifest resource.
415
416         For some reason an app cache for a web site may be partially written to disk. In particular, the
417         app cache may only contain a CacheGroups entry. That is, the manifest resource and origin records
418         may not be persisted to disk. From looking over the code, we're unclear how such a situation can occur
419         and hence have been unable to create such an app cache. We were able to reproduce this issue using
420         an app cache database file that was provided by a person that was affected by this issue.
421
422         No test included because it's not straightforward to write a test for this change.
423
424         * loader/appcache/ApplicationCacheGroup.cpp:
425         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete): Assert that m_cacheBeingUpdated->manifestResource()
426         is non-null. Currently we only document this assumption in a code comment. Also separated a single assertion
427         expression into two assertion expressions to make it straightforward to identify the failing sub-expression
428         on failure.
429         * loader/appcache/ApplicationCacheStorage.cpp:
430         (WebCore::ApplicationCacheStorage::store): Modified to call ApplicationCacheStorage::deleteCacheGroupRecord()
431         to remove a cache group and associated cache records (if applicable) before inserting a cache group entry.
432         This replacement approach will ultimately repair incomplete app cache data for people affected by this bug.
433         (WebCore::ApplicationCacheStorage::loadCache): Log an error and return nullptr if the cache we loaded doesn't
434         have a manifest resource.
435         (WebCore::ApplicationCacheStorage::deleteCacheGroupRecord): Added.
436         (WebCore::ApplicationCacheStorage::deleteCacheGroup): Extracted deletion logic for cache group record into
437         ApplicationCacheStorage::deleteCacheGroupRecord().
438         * loader/appcache/ApplicationCacheStorage.h:
439
440 2014-03-05  Oliver Hunt  <oliver@apple.com>
441
442         Support caching of custom setters
443         https://bugs.webkit.org/show_bug.cgi?id=129519
444
445         Reviewed by Filip Pizlo.
446
447         Add forwarding header
448
449         Tests: js/regress/assign-custom-setter-polymorphic.html
450                js/regress/assign-custom-setter.html
451
452         * ForwardingHeaders/jit/SpillRegistersMode.h: Added.
453
454 2014-03-05  David Kilzer  <ddkilzer@apple.com>
455
456         Fix crash in CompositeEditCommand::cloneParagraphUnderNewElement()
457         <http://webkit.org/b/129751>
458         <rdar://problem/16237965>
459
460         Reviewed by Jon Honeycutt.
461
462         Merged from Blink (patch by Yuta Kitamura):
463         https://src.chromium.org/viewvc/blink?revision=168160&view=revision
464         http://crbug.com/345005
465
466             The root cause is CompositeEditCommand::moveParagraphWithClones() passing
467             two positions |start| and |end| which do not follow the document order,
468             i.e. in some situations |start| is located after |end| because of
469             the difference in affinity.
470
471             This patch fixes this crash by normalizing |end| to |start| in such situations.
472             It also adds an ASSERT that checks the relationship between |start| and |end|.
473
474         Test: editing/execCommand/format-block-crash.html
475
476         * editing/CompositeEditCommand.cpp:
477         (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
478         (WebCore::CompositeEditCommand::moveParagraphWithClones):
479         * editing/CompositeEditCommand.h:
480
481 2014-03-05  Radu Stavila  <stavila@adobe.com>
482
483         [CSS Regions] Scrollable regions
484         https://bugs.webkit.org/show_bug.cgi?id=129301
485
486         Reviewed by David Hyatt.
487
488         Named flow fragments do not inherit the overflow property from the fragment container.
489         When asked if the flow thread content should be clipped, the named flow fragments
490         will respond using the overflow property of the named flow fragment container.
491
492         When painting the flow thread layer inside the region, the scrolled content offset of
493         the region must be used to offset the flow thread's layer.
494
495         Tests: fast/regions/scrollable-last-region.html
496                fast/regions/scrollable-single-region-bt.html
497                fast/regions/scrollable-single-region-lr.html
498                fast/regions/scrollable-single-region-relative-element.html
499                fast/regions/scrollable-single-region-rl.html
500                fast/regions/scrollable-single-region.html
501
502         * rendering/RenderLayer.cpp:
503         (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
504         (WebCore::RenderLayer::calculateClipRects):
505         * rendering/RenderNamedFlowFragment.cpp:
506         (WebCore::RenderNamedFlowFragment::createStyle):
507         (WebCore::RenderNamedFlowFragment::shouldClipFlowThreadContent):
508         * rendering/RenderNamedFlowFragment.h:
509         * rendering/RenderNamedFlowThread.cpp:
510         (WebCore::RenderNamedFlowThread::decorationsClipRectForBoxInNamedFlowFragment):
511         * rendering/RenderRegion.cpp:
512         (WebCore::RenderRegion::shouldClipFlowThreadContent):
513         * rendering/RenderRegion.h:
514
515 2014-03-05  Zalan Bujtas  <zalan@apple.com>
516
517         Subpixel rendering: Device pixel round accumulated subpixel value when the RenderLayer with transform paints its content.
518         https://bugs.webkit.org/show_bug.cgi?id=129079
519
520         Reviewed by Simon Fraser.
521
522         Snap the content to the device pixel position (as opposed to integral position) before
523         applying the transform. Recalculate the remaining subpixels that need offsetting at painting time.
524
525         Test: compositing/hidpi-absolute-subpixel-positioned-transformed-elements.html
526
527         * platform/graphics/LayoutPoint.h:
528         (WebCore::roundedForPainting):
529         * rendering/RenderLayer.cpp:
530         (WebCore::RenderLayer::paintLayerByApplyingTransform):
531
532 2014-03-05  Eric Carlson  <eric.carlson@apple.com>
533
534         [iOS] Show external device name/type in placeholder
535         https://bugs.webkit.org/show_bug.cgi?id=129723
536
537         Reviewed by Jer Noble.
538
539         Make the name and type of the external device available to the JS based controls.
540         * Modules/mediacontrols/MediaControlsHost.cpp:
541         (WebCore::MediaControlsHost::externalDeviceDisplayName):
542         (WebCore::MediaControlsHost::externalDeviceType):
543         * Modules/mediacontrols/MediaControlsHost.h:
544         * Modules/mediacontrols/MediaControlsHost.idl:
545
546         * Modules/mediacontrols/mediaControlsiOS.js:
547         (ControllerIOS.prototype.updateWirelessPlaybackStatus): Display device type-specific infomation
548             in the placeholder image.
549
550         * WebCore.exp.in: Export new WebKitSystemInterface functions.
551
552         * platform/graphics/MediaPlayer.cpp:
553         (WebCore::MediaPlayer::wirelessPlaybackTargetName): Added.
554         (WebCore::MediaPlayer::wirelessPlaybackTargetType): Ditto.
555         * platform/graphics/MediaPlayer.h:
556         * platform/graphics/MediaPlayerPrivate.h:
557
558         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
559         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
560         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType): Added.
561         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName): Ditto.
562
563         * platform/ios/WebCoreSystemInterfaceIOS.mm:
564         * platform/mac/WebCoreSystemInterface.h:
565         * platform/mac/WebCoreSystemInterface.mm:
566
567 2014-03-05  Benjamin Poulain  <bpoulain@apple.com>
568
569         [iOS] Rename the various VisibleExtent variations to exposedContentRect
570         https://bugs.webkit.org/show_bug.cgi?id=129728
571
572         Reviewed by Simon Fraser.
573
574         Rename DocumentVisibleExtent and VisibleExtentContentRect to ExposedContentRect in a desperate
575         attempt to make things a tiny little bit less confusing.
576
577         The name is ExposedContentRect and not ExposedRect as that rect is exposed on ScrollView, while the
578         rect is in document coordinates (which does not make any difference on WebKit1...).
579
580         * WebCore.exp.in:
581         * platform/ScrollView.h:
582         * platform/ios/ScrollViewIOS.mm:
583         (WebCore::ScrollView::exposedContentRect):
584         (WebCore::ScrollView::setExposedContentRect):
585         * platform/ios/wak/WAKScrollView.h:
586         * platform/ios/wak/WAKScrollView.mm:
587         (-[WAKScrollView exposedContentRect]):
588         * rendering/RenderLayerCompositor.cpp:
589         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
590         (WebCore::RenderLayerCompositor::didChangeVisibleRect):
591
592 2014-03-05  Simon Fraser  <simon.fraser@apple.com>
593
594         ObjC exception when dropping files into a WKView: drag and drop uses code from WebKit.framework
595         https://bugs.webkit.org/show_bug.cgi?id=129752
596
597         Reviewed by Enrica Casucci.
598
599         Add C functions for NSURL-related functionality required by WebKit2
600
601         * WebCore.exp.in:
602         * platform/mac/WebCoreNSURLExtras.h:
603         * platform/mac/WebCoreNSURLExtras.mm:
604         (WebCore::URLByCanonicalizingURL):
605         (WebCore::rangeOfURLScheme):
606         (WebCore::looksLikeAbsoluteURL):
607
608 2014-03-05  Martin Hock  <mhock@apple.com>
609
610         Add support for sessions to MemoryCache.
611         https://bugs.webkit.org/show_bug.cgi?id=127794
612
613         Reviewed by Sam Weinig.
614
615         * WebCore.exp.in:
616         * editing/DeleteButtonController.cpp:
617         (WebCore::DeleteButtonController::createDeletionUI): Initialize CachedImage with sessionID.
618         * html/DOMURL.cpp:
619         (WebCore::DOMURL::revokeObjectURL): Remove URL from MemoryCache for all sessions.
620         * inspector/InspectorPageAgent.cpp:
621         (WebCore::InspectorPageAgent::cachedResource): Pass sessionID to MemoryCache.
622         * inspector/InspectorResourceAgent.cpp:
623         (WebCore::InspectorResourceAgent::replayXHR): Ditto.
624         * loader/DocumentLoader.cpp:
625         (WebCore::areAllLoadersPageCacheAcceptable): Ditto.
626         * loader/FrameLoader.cpp:
627         (WebCore::FrameLoader::tellClientAboutPastMemoryCacheLoads): Ditto.
628         * loader/ImageLoader.cpp:
629         (WebCore::ImageLoader::updateFromElement): Initialize CachedImage with sessionID.
630         * loader/archive/cf/LegacyWebArchive.cpp:
631         (WebCore::LegacyWebArchive::create): Pass sessionID to MemoryCache.
632         * loader/cache/CachedCSSStyleSheet.cpp:
633         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet): Constructor takes sessionID.
634         * loader/cache/CachedCSSStyleSheet.h:
635         * loader/cache/CachedFont.cpp: Ditto.
636         (WebCore::CachedFont::CachedFont):
637         * loader/cache/CachedFont.h:
638         * loader/cache/CachedImage.cpp: Ditto.
639         (WebCore::CachedImage::CachedImage):
640         * loader/cache/CachedImage.h:
641         * loader/cache/CachedRawResource.cpp: Ditto.
642         (WebCore::CachedRawResource::CachedRawResource):
643         * loader/cache/CachedRawResource.h:
644         * loader/cache/CachedResource.cpp: Ditto.
645         (WebCore::CachedResource::CachedResource):
646         (WebCore::CachedResource::~CachedResource): Pass sessionID to MemoryCache.
647         * loader/cache/CachedResource.h:
648         (WebCore::CachedResource::sessionID):
649         * loader/cache/CachedResourceLoader.cpp:
650         (WebCore::createResource): Constructors take sessionID.
651         (WebCore::CachedResourceLoader::sessionID): Retrieve sessionID from page.
652         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Pass sessionID to MemoryCache.
653         (WebCore::CachedResourceLoader::requestResource): Initialize CachedCSSStyleSheet with sessionID.
654         (WebCore::CachedResourceLoader::revalidateResource): Initialize cached resource with sessionID.
655         (WebCore::CachedResourceLoader::loadResource): Pass sessionID to MemoryCache and initialize cached resource with sessionID.
656         * loader/cache/CachedResourceLoader.h:
657         * loader/cache/CachedSVGDocument.cpp: Constructor takes sessionID.
658         (WebCore::CachedSVGDocument::CachedSVGDocument):
659         * loader/cache/CachedSVGDocument.h:
660         * loader/cache/CachedScript.cpp: Ditto.
661         (WebCore::CachedScript::CachedScript):
662         * loader/cache/CachedScript.h:
663         * loader/cache/CachedTextTrack.cpp: Ditto.
664         (WebCore::CachedTextTrack::CachedTextTrack):
665         * loader/cache/CachedTextTrack.h:
666         * loader/cache/CachedXSLStyleSheet.cpp: Ditto.
667         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
668         * loader/cache/CachedXSLStyleSheet.h:
669         * loader/cache/MemoryCache.cpp:
670         (WebCore::MemoryCache::getSessionMap): Retrieve CachedResourceMap based on sessionID.
671         (WebCore::MemoryCache::add): Use sessionID from CachedResource parameter.
672         (WebCore::MemoryCache::revalidationSucceeded): Add sessionID parameter.
673         (WebCore::MemoryCache::resourceForURL): Ditto.
674         (WebCore::MemoryCache::resourceForRequest): Ditto, also move impl into impl method.
675         (WebCore::MemoryCache::resourceForRequestImpl): Add CachedResourceMap parameter.
676         (WebCore::MemoryCache::addImageToCache): Use default sessionID.
677         (WebCore::MemoryCache::removeImageFromCache): Ditto.
678         (WebCore::MemoryCache::evict): Use sessionID from CachedResource parameter.
679         (WebCore::MemoryCache::removeResourcesWithOrigin): Iterate through all CachedResourceMaps.
680         (WebCore::MemoryCache::getOriginsWithCache): Ditto.
681         (WebCore::MemoryCache::removeUrlFromCache): Add sessionID parameter.
682         (WebCore::MemoryCache::removeRequestFromCache): Ditto.
683         (WebCore::MemoryCache::removeRequestFromSessionCaches): Remove request from all CachedResourceMaps, with multithread support.
684         (WebCore::MemoryCache::removeRequestFromCacheImpl): Add sessionID parameter.
685         (WebCore::MemoryCache::removeRequestFromSessionCachesImpl): Iterate through all CachedResourceMaps.
686         (WebCore::MemoryCache::crossThreadRemoveRequestFromCache): Add sessionID parameter.
687         (WebCore::MemoryCache::crossThreadRemoveRequestFromSessionCaches): Pass on request to removeRequestFromSessionCachesImpl.
688         (WebCore::MemoryCache::getStatistics): Iterate through all CachedResourceMaps.
689         (WebCore::MemoryCache::setDisabled): Ditto.
690         * loader/cache/MemoryCache.h: Create another level for cache.
691         * platform/CrossThreadCopier.cpp: Allow copying SessionIDs across threads.
692         (WebCore::SessionID>::copy):
693         * platform/CrossThreadCopier.h:
694         * platform/network/cf/ResourceRequest.h:
695         (WebCore::ResourceRequest::ResourceRequest): Remove trailing whitespace.
696         * rendering/RenderSnapshottedPlugIn.cpp:
697         (WebCore::RenderSnapshottedPlugIn::updateSnapshot): Initialize CachedImage with sessionID.
698         * testing/Internals.cpp:
699         (WebCore::Internals::isLoadingFromMemoryCache): Pass sessionID to MemoryCache.
700
701 2014-03-03  Martin Robinson  <mrobinson@igalia.com>
702
703         [GTK][CMake] Generate documentation for the DOM bindings
704         https://bugs.webkit.org/show_bug.cgi?id=126211
705
706         Reviewed by Carlos Garcia Campos.
707
708         * PlatformGTK.cmake: Add some files to the GObjectDOMBindings build, so that the
709         doc generation succeeds. Have the GObjectDOMBindings_INSTALLED_HEADERS variable contain
710         all installed headers and use another variable for GIR generation. Create the configuration
711         file for the gtkdoc generation.
712
713 2014-03-05  Zalan Bujtas  <zalan@apple.com>
714
715         Subpixel rendering: Wrong cliprect on absolute positioned elements.
716         https://bugs.webkit.org/show_bug.cgi?id=129656
717
718         Reviewed by Simon Fraser.
719
720         outlineBoundsForRepaint() is expected to return the outline repaint rect. Using enclosingIntRect()
721         to calculate the outline boundaries breaks repaint logic in RenderElement::repaintAfterLayoutIfNeeded().
722         Since enclosingIntRect() can return bigger rect than repaint rect, the old/new bounds' dimensions could end up
723         being different which triggers the size change repaint code path.
724
725         Test: fast/repaint/hidpi-absolute-positioned-element-wrong-cliprect-after-move.html
726
727         * rendering/RenderBox.cpp:
728         (WebCore::RenderBox::outlineBoundsForRepaint):
729         * rendering/RenderElement.cpp:
730         (WebCore::RenderElement::repaintAfterLayoutIfNeeded):
731         * rendering/svg/RenderSVGModelObject.cpp:
732         (WebCore::RenderSVGModelObject::outlineBoundsForRepaint):
733
734 2014-03-05  Krzysztof Czech  <k.czech@samsung.com>
735
736         [ATK] Expose missing functionalities of AtkTableCell to AT.
737         https://bugs.webkit.org/show_bug.cgi?id=129492
738
739         Reviewed by Mario Sanchez Prada.
740
741         Implemented missing API of AtkTableCell.
742
743         No new tests. Covered by existing ones.
744
745         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
746         (webkitAccessibleTableCellGetColumnSpan):
747         (webkitAccessibleTableCellGetRowSpan):
748         (webkitAccessibleTableCellGetPosition):
749         (webkitAccessibleTableCellGetTable):
750         (webkitAccessibleTableCellInterfaceInit):
751
752 2014-03-05  Andres Gomez  <agomez@igalia.com>
753
754         [GStreamer] WebSource doesn't need the "iradio-mode" property
755         https://bugs.webkit.org/show_bug.cgi?id=129685
756
757         Reviewed by Philippe Normand.
758
759         Removed the "iradio-mode" property from the WK source element
760         since this was only available for its modification from
761         playbin/uridecodebin and, as discussed in GStreamer bug #725383,
762         it was not being set and now is going to be removed.
763
764         It is safe just to send always the "icy-metadata" header set and
765         deal with returning "icy" headers as we were already doing.
766
767         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
768         (webKitWebSrcSetProperty):
769         (webKitWebSrcGetProperty):
770         (webKitWebSrcStart):
771
772 2014-03-05  Chang Shu  <cshu@webkit.org>
773
774         Copying wrapping text results in multiple spaces between wrapped lines stripped.
775         https://bugs.webkit.org/show_bug.cgi?id=129609.
776
777         Reviewed by Ryosuke Niwa.
778
779         While checking the condition of restoring the missing space, the collapsed spaces
780         may not be exactly one.
781
782         editing/pasteboard/copy-text-with-wrapped-tag.html is enhanced to test this case.
783
784         * editing/TextIterator.cpp:
785         (WebCore::TextIterator::handleTextBox):
786
787 2014-03-05  Ryosuke Niwa  <rniwa@webkit.org>
788
789         appendChild shouldn't invalidate LiveNodeLists and HTMLCollections if they don't have valid caches
790         https://bugs.webkit.org/show_bug.cgi?id=129727
791
792         Reviewed by Andreas Kling.
793
794         Before this patch, invalidateNodeListAndCollectionCachesInAncestors invalidated node lists and HTML
795         collections on ancestors of a node whenever we're inserting or removing a child node. This patch
796         makes HTMLCollections and LiveNodeLists register themselves with Document only when they have valid
797         caches.
798
799         Each user of CollectionIndexCache now implements willValidateIndexCache member function that gets
800         called when CollectionIndexCache caches any state and necessitates the registration with document.
801
802         * dom/ChildNodeList.h: Added an empty willValidateIndexCache since child node lists are never
803         registered with document.
804
805         * dom/CollectionIndexCache.h:
806         (WebCore::CollectionIndexCache::hasValidCache): Added.
807         (WebCore::CollectionIndexCache::nodeCount): Calls willValidateIndexCache when caching node count.
808         (WebCore::CollectionIndexCache::nodeAfterCached): Ditto. Also assert that hasValidCache() true in
809         the cases where we're simply updating our caches or adding more caches.
810         (WebCore::CollectionIndexCache::nodeAt): Ditto. Also added a code to set the length cache when
811         we've reached the end of the list. This should be a slight speed up on some cases.
812
813         * dom/Document.cpp:
814         (WebCore::Document::Document): Initializes a variable used by assertions.
815         (WebCore::Document::unregisterNodeList): Added an early exit for when m_listsInvalidatedAtDocument
816         is empty since invalidateNodeListAndCollectionCaches swaps out the list.
817         (WebCore::Document::registerCollection): Removed the boolean hasIdNameMap since we now explicitly
818         call collectionCachedIdNameMap in HTMLCollection.
819         (WebCore::Document::unregisterCollection): Ditto. Exit early if m_collectionsInvalidatedAtDocument
820         is empty since invalidateNodeListAndCollectionCaches swaps out the list.
821         * dom/Document.h:
822
823         * dom/LiveNodeList.cpp:
824         (WebCore::LiveNodeList::invalidateCache): Unregister the node list with document if we had caches.
825         * dom/LiveNodeList.h:
826         (WebCore::LiveNodeList::LiveNodeList):
827         (WebCore::LiveNodeList::~LiveNodeList): Ditto.
828         (WebCore::LiveNodeList::invalidateCache): Pass around document. This is necessary since document()
829         had already moved to the new document inside NodeListsNodeData::invalidateCaches.
830         (WebCore::LiveNodeList::willValidateIndexCache): Added. Registers itself with document.
831
832         * dom/Node.cpp:
833         (WebCore::Document::invalidateNodeListAndCollectionCaches): Swap the lists since invalidateCache
834         tries to unregister node lists and HTML collections with document. Since this is the only case in
835         which node lists and HTML collections being removed may not be in the lists in unregisterNodeList
836         and unregisterCollection, assert this condition via m_inInvalidateNodeListAndCollectionCaches.
837         (WebCore::NodeListsNodeData::invalidateCaches):
838
839         * dom/NodeRareData.h:
840         (WebCore::NodeListsNodeData::adoptDocument): Unregister node lists and HTML collections from old
841         document via invalidateCache. We need to explicitly pass in oldDocument here since owner node's
842         document had already been changed to newDocument at this point. Since we're invalidating caches,
843         there is no need to register node lists and HTML collections with newDocument.
844
845         * html/HTMLCollection.cpp:
846         (WebCore::HTMLCollection::HTMLCollection):
847         (WebCore::HTMLCollection::~HTMLCollection): Unregister the node list with document if we had caches.
848         (WebCore::HTMLCollection::invalidateCache): Ditto.
849         (WebCore::HTMLCollection::invalidateNamedElementCache):
850         * html/HTMLCollection.h:
851         (WebCore::HTMLCollection::invalidateCache): Pass around document as done in LiveNodeList.
852         (WebCore::HTMLCollection::willValidateIndexCache): Ditto.
853
854         * html/HTMLFormControlsCollection.cpp:
855         (WebCore::HTMLFormControlsCollection::invalidateCache): Ditto.
856         * html/HTMLFormControlsCollection.h:
857
858         * html/HTMLSelectElement.cpp:
859         (WebCore::HTMLSelectElement::invalidateSelectedItems): Ditto.
860         (WebCore::HTMLSelectElement::setRecalcListItems): Ditto.
861
862 2014-03-05  Jon Lee  <jonlee@apple.com>
863
864         Fix linker error after r165087
865         https://bugs.webkit.org/show_bug.cgi?id=129730
866
867         Reviewed by Csaba Osztrogonác.
868
869         * WebCore.exp.in: Remove undefined symbol __ZN7WebCore32WebVideoFullscreenChangeObserverD2Ev.
870
871 2014-03-04  Zalan Bujtas  <zalan@apple.com>
872
873         Enable device pixel repaint rect tracking.
874         https://bugs.webkit.org/show_bug.cgi?id=129712
875
876         Reviewed by Simon Fraser.
877
878         Tracked repaint rects are device pixel snapped now to support hiDPI test cases.
879
880         Test: fast/repaint/hidpi-device-pixel-based-repaint-rect-tracking.html
881
882         * WebCore.exp.in:
883         * page/FrameView.cpp:
884         (WebCore::FrameView::addTrackedRepaintRect):
885         (WebCore::FrameView::trackedRepaintRectsAsText): Print them as LayoutUnits to get
886         trailing zeros cut off.
887         * page/FrameView.h:
888         * rendering/RenderLayer.cpp:
889         (WebCore::RenderLayer::calculateClipRects):
890         * rendering/RenderLayer.h:
891         * rendering/RenderLayerBacking.cpp:
892         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
893         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
894         * rendering/RenderView.cpp:
895         (WebCore::RenderView::repaintViewRectangle):
896
897 2014-03-04  Simon Fraser  <simon.fraser@apple.com>
898
899         Don't clamp scrolling node offsets when the offset is changed by delegated scrolling
900         https://bugs.webkit.org/show_bug.cgi?id=129724
901
902         Reviewed by Sam Weinig.
903         
904         Call setScrollPositionWithoutContentEdgeConstraints() from
905         ScrollingTree::scrollPositionChangedViaDelegatedScrolling() so that
906         layers are not clamped during rubber-banding.
907         
908         This requires making setScrollPositionWithoutContentEdgeConstraints()
909         a pure virtual function on the base class.
910
911         * page/scrolling/ScrollingTree.cpp:
912         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
913         * page/scrolling/ScrollingTreeScrollingNode.h:
914         * page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h:
915         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
916
917 2014-03-04  Jeremy Jones  <jeremyj@apple.com>
918
919         WebVideoFullscreen, should make the hand off of the video layer explicit.
920         https://bugs.webkit.org/show_bug.cgi?id=128844
921
922         Reviewed by Simon Fraser.
923
924         This change introduces a more explicit hand-off of the video layer.
925         This describes the interactions between WebVideoFullscreenInterface and WebVideoFullscreenModel
926         WebVideoFullscreenModel <-> WebVideoFullscreenInterface
927               enterFullScreen(*) ->
928                                 <- borrowVideoLayer
929               willLendVideoLayer ->
930                didLendVideoLayer ->
931                                 <- didEnterFullscreen
932                                 ...
933                                 <- requestExitFullscreen
934                   exitFullscreen ->
935                                 <- returnVideoLayer
936                                 <- didExitFullscreen
937         (*) enterFullScreen actually comes from WebVideoFullscreenControllerAVKit.
938
939         * WebCore.exp.in:
940         Export new functions in WebVideoFullscreenInterfaceAVKit, WebVideoFullscreenModelMediaElement, etc.
941
942         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
943         Add WebVideoFullscreenControllerChangeObserver to forward fullscreen callbacks to WebVideoFullscreenController
944
945         (WebVideoFullscreenControllerChangeObserver::setTarget):
946         Sets obj-c target of fullscreen change callbacks.
947
948         (-[WebVideoFullscreenController init]):
949         Point _changeObserver's target at self.
950
951         (-[WebVideoFullscreenController dealloc]):
952         Clear _changeObserver's target.
953
954         (-[WebVideoFullscreenController enterFullscreen:]):
955         Retain self to prevent dealloc during animation or while fullscreen.
956         Connect _interface to _changeObserver.
957
958         (-[WebVideoFullscreenController exitFullscreen]):
959         Remove use of completion move cleanup to -didExitFullscreen.
960
961         (-[WebVideoFullscreenController didEnterFullscreen]):
962         Nothing to see here.
963
964         (-[WebVideoFullscreenController didExitFullscreen]):
965         Move clean up code that was in a completion to here.
966
967         * platform/ios/WebVideoFullscreenInterface.h:
968         Add delarations for more explicit hand-off of video layer.
969
970         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
971         Add WebVideoFullscreenChangeObserver to notify when fullscreen animations complete.
972         Add declarations for more explicit hand-off of video layer.
973         Add WebAVPlayerLayer now always wraps the m_videoLayer to prevent default behavior
974         of AVPlayerLayer.
975
976         (WebCore::WebVideoFullscreenChangeObserver::~WebVideoFullscreenChangeObserver):
977         Add empty virtual destructor.
978
979         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
980         Include AVKit headers instead of declaring everything locally.
981         AVPlayerLayer protocol renamed to AVVideoLayer per AVKit.
982
983         (-[WebAVPlayerController dealloc]):
984         Don't refer to self.
985
986         (-[WebAVPlayerController playerViewController:shouldDismissWithReason:]):
987         Pause before requesting exit fullscreen.
988
989         (-[WebAVPlayerLayer setPlayerController:]):
990         This is required by AVVideoLayer, but we don't need it.
991
992         (WebVideoFullscreenInterfaceAVKit::playerController):
993         White space.
994
995         (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenChangeObserver):
996         Set observer to forward fullscreen changes to.
997
998         (WebVideoFullscreenInterfaceAVKit::enterFullscreen):
999         Use more explicit video layer hand-off.
1000
1001         (WebVideoFullscreenInterfaceAVKit::doEnterFullscreen):
1002         Move enterFullscreen logic here.
1003         AVPlayerViewController now takes the video layer at init time.
1004         Always provide a video layer wrapped in a WebAVPlayerLayer.
1005
1006         (WebVideoFullscreenInterfaceAVKit::willLendVideoLayer):
1007         Use more explicit video layer hand-off.
1008
1009         (WebVideoFullscreenInterfaceAVKit::didLendVideoLayer):
1010         Use more explicit video layer hand-off.
1011
1012         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
1013         Use more explicit video layer hand-off.
1014
1015         * platform/ios/WebVideoFullscreenModel.h:
1016         Add functions for more explicit video layer hand-off.
1017
1018         * platform/ios/WebVideoFullscreenModelMediaElement.h:
1019         Mark virtual functions as virtual.
1020         Add changes for WebVideoFullscreenModel.
1021
1022         * platform/ios/WebVideoFullscreenModelMediaElement.mm:
1023         Use more explicit video layer hand-off.
1024
1025         (WebVideoFullscreenModelMediaElement::setMediaElement):
1026         Don't push the video layer. Wait for a request for it.
1027
1028         (WebVideoFullscreenModelMediaElement::handleEvent):
1029         Make sure m_videoFullscreenInterface is valid.
1030
1031         (WebVideoFullscreenModelMediaElement::borrowVideoLayer):
1032         Use more explicit video layer hand-off.
1033         Lend videoLayer in request to a request to borrow the videoLayer.
1034         Make sure to retain the video layer before it is removed from the layer tree.
1035
1036         (WebVideoFullscreenModelMediaElement::returnVideoLayer):
1037         Use more explicit video layer hand-off.
1038
1039         (WebVideoFullscreenModelMediaElement::requestExitFullscreen):
1040         Don't clear the mediaElement reference until completely exited from fullscreen.
1041
1042 2014-03-04  Simon Fraser  <simon.fraser@apple.com>
1043
1044         Get position:fixed working slightly better on iOS
1045         https://bugs.webkit.org/show_bug.cgi?id=129714
1046
1047         Reviewed by Benjamin Poulain.
1048
1049         Send the scroll position as a FloatPoint, rather than an IntPoint.
1050
1051         * WebCore.exp.in:
1052         * page/scrolling/ScrollingTree.cpp:
1053         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
1054         * page/scrolling/ScrollingTree.h:
1055
1056 2014-03-04  Alex Christensen  <achristensen@webkit.org>
1057
1058         Fixed Windows build without MEDIA_CONTROLS_SCRIPT enabled.
1059         https://bugs.webkit.org/show_bug.cgi?id=129701
1060
1061         Reviewed by Jer Noble.
1062
1063         * WebCore.vcxproj/WebCore.vcxproj:
1064         * DerivedSources.cpp:
1065         Moved UserAgentScriptsData.cpp to DerivedSources.cpp to only be built if MEDIA_CONTROLS_SCRIPT is enabled.
1066         * DerivedSources.make:
1067         Only generate UserAgentScripts.cpp/h when USER_AGENT_SCRIPTS is non-empty.
1068         * rendering/RenderThemeWin.cpp:
1069         Only include UserAgentScripts.h when MEDIA_CONTROLS_SCRIPT is enabled.
1070
1071 2014-03-04  Simon Fraser  <simon.fraser@apple.com>
1072
1073         Allow iOS DumpRenderTree crashes to show application-specific information
1074         https://bugs.webkit.org/show_bug.cgi?id=129705
1075
1076         Reviewed by David Kilzer.
1077
1078         Make the WKSI function SetCrashReportApplicationSpecificInformation available
1079         in iOS simulator builds.
1080
1081         * WebCore.exp.in:
1082         * platform/ios/WebCoreSystemInterfaceIOS.mm:
1083         * platform/mac/WebCoreSystemInterface.h:
1084
1085 2014-03-04  Andreas Kling  <akling@apple.com>
1086
1087         Spam static branch prediction hints on JS bindings.
1088         <https://webkit.org/b/129703>
1089
1090         Add UNLIKELY hints to all !castedThis and exec->hadException() paths
1091         in the JS bindings since they are almost always going to get skipped.
1092
1093         Reviewed by Geoff Garen.
1094
1095         * bindings/scripts/CodeGeneratorJS.pm:
1096         (GenerateImplementation):
1097         (GenerateParametersCheck):
1098         (GenerateImplementationFunctionCall):
1099         (GenerateConstructorDefinition):
1100
1101 2014-03-04  Adenilson Cavalcanti  <cavalcantii@gmail.com>
1102
1103         Remove unused StdDeviation from Gaussian Blur effect
1104         https://bugs.webkit.org/show_bug.cgi?id=129693
1105
1106         Reviewed by Simon Fraser.
1107
1108         No new tests, no change on behavior.
1109
1110         * platform/graphics/filters/FEGaussianBlur.cpp:
1111         * platform/graphics/filters/FEGaussianBlur.h:
1112
1113 2014-03-04  Andreas Kling  <akling@apple.com>
1114
1115         Add a Document::updateStyleIfNeededForNode(Node&).
1116         <https://webkit.org/b/129689>
1117
1118         Generalize the mechanism that computed style uses to avoid doing full
1119         style updates when the node we're interested in isn't actually dirty.
1120
1121         Reviewed by Antti Koivisto.
1122
1123         * css/CSSComputedStyleDeclaration.cpp:
1124         (WebCore::ComputedStyleExtractor::propertyValue):
1125         * dom/Document.cpp:
1126         (WebCore::nodeOrItsAncestorNeedsStyleRecalc):
1127         (WebCore::Document::updateStyleIfNeededForNode):
1128         * dom/Document.h:
1129         * editing/htmlediting.cpp:
1130         (WebCore::isEditablePosition):
1131         * html/HTMLInputElement.cpp:
1132         (WebCore::HTMLInputElement::defaultEventHandler):
1133
1134 2014-03-04  Mark Hahnenberg  <mhahnenberg@apple.com>
1135
1136         Merge API shims and JSLock
1137         https://bugs.webkit.org/show_bug.cgi?id=129650
1138
1139         Reviewed by Mark Lam.
1140
1141         No new tests.
1142
1143         JSLock is now taking on all of APIEntryShim's responsibilities since there is never a reason 
1144         to take just the JSLock. Ditto for DropAllLocks and APICallbackShim.
1145
1146         * bindings/js/DOMRequestState.h:
1147         (WebCore::DOMRequestState::Scope::Scope):
1148         * bindings/js/JSDOMPromise.h:
1149         (WebCore::DeferredWrapper::resolve):
1150         (WebCore::DeferredWrapper::reject):
1151         (WebCore::DeferredWrapper::resolve<String>):
1152         (WebCore::DeferredWrapper::resolve<bool>):
1153         (WebCore::char>>):
1154         (WebCore::DeferredWrapper::reject<String>):
1155         * bindings/js/ScriptController.cpp:
1156         (WebCore::ScriptController::evaluateInWorld):
1157         * bindings/js/SerializedScriptValue.cpp:
1158         (WebCore::SerializedScriptValue::create):
1159         (WebCore::SerializedScriptValue::deserialize):
1160
1161 2014-03-04  Beth Dakin  <bdakin@apple.com>
1162
1163         REGRESSION: Overlay scrollbars that have grown are sometimes askew in the track
1164         https://bugs.webkit.org/show_bug.cgi?id=129691
1165         -and corresponding-
1166         <rdar://problem/15666846>
1167
1168         Reviewed by Simon Fraser.
1169
1170         This regression started happening after we adopted the setPresentationValue 
1171         ScrollbarPainter API which allows us to update the position of the scrollbar knob 
1172         from our secondary scrolling thread. The bug occurs when the scrollbar grows while 
1173         it still thinks it is in presentation-value mode. Whenever the scrollbar grows, it 
1174         should be in non-presentation value mode.
1175
1176         If the wheel event has ended or been cancelled, we can switch out of presentation 
1177         value mode.
1178         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
1179         (WebCore::ScrollingTreeScrollingNodeMac::handleWheelEvent):
1180
1181         Sometimes we will grow the scrollbar before we have received a wheel event with 
1182         the end or cancelled phase, and so automatically switch out of presentation-value 
1183         mode whenever we start one of these animations.
1184         * platform/mac/ScrollAnimatorMac.mm:
1185         (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
1186
1187 2014-03-04  Zan Dobersek  <zdobersek@igalia.com>
1188
1189         Move Source/WebCore/html/track/ code to std::unique_ptr
1190         https://bugs.webkit.org/show_bug.cgi?id=129666
1191
1192         Reviewed by Eric Carlson.
1193
1194         Replace uses of OwnPtr and PassOwnPtr in code under Source/WebCore/html/track/ with std::unique_ptr.
1195
1196         * html/track/AudioTrack.h:
1197         * html/track/InbandWebVTTTextTrack.cpp:
1198         (WebCore::InbandWebVTTTextTrack::parseWebVTTCueData):
1199         * html/track/InbandWebVTTTextTrack.h:
1200         * html/track/LoadableTextTrack.cpp:
1201         (WebCore::LoadableTextTrack::loadTimerFired):
1202         (WebCore::LoadableTextTrack::newCuesAvailable):
1203         (WebCore::LoadableTextTrack::cueLoadingCompleted):
1204         (WebCore::LoadableTextTrack::newRegionsAvailable):
1205         * html/track/LoadableTextTrack.h:
1206         * html/track/TextTrack.h:
1207         * html/track/TextTrackCue.h:
1208         * html/track/TextTrackRegion.h:
1209         * html/track/VTTCue.cpp:
1210         (WebCore::VTTCue::createWebVTTNodeTree):
1211         (WebCore::VTTCue::markFutureAndPastNodes):
1212         * html/track/VTTCue.h:
1213         * html/track/VideoTrack.h:
1214         * html/track/WebVTTParser.cpp:
1215         (WebCore::WebVTTParser::WebVTTParser):
1216         * html/track/WebVTTParser.h:
1217         * html/track/WebVTTTokenizer.h:
1218         * loader/TextTrackLoader.cpp:
1219         (WebCore::TextTrackLoader::processNewCueData):
1220         * loader/TextTrackLoader.h:
1221
1222 2014-03-04  Zalan Bujtas  <zalan@apple.com>
1223
1224         Subpixel rendering: Make border-radius painting device pixel aware.
1225         https://bugs.webkit.org/show_bug.cgi?id=129558
1226
1227         Reviewed by Simon Fraser.
1228
1229         Snap rounded rects to device pixels right before passing them to GraphicsContext.
1230
1231         * rendering/RenderBoxModelObject.cpp:
1232         (WebCore::RenderBoxModelObject::clipRoundedInnerRect):
1233         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1234         (WebCore::RenderBoxModelObject::paintBorder):
1235         * rendering/RenderBoxModelObject.h:
1236         * rendering/RenderReplaced.cpp:
1237         (WebCore::RenderReplaced::paint):
1238         * rendering/RenderWidget.cpp:
1239         (WebCore::RenderWidget::paint):
1240
1241 2014-03-04  Simon Fraser  <simon.fraser@apple.com>
1242
1243         Crashes and assertions running iOS compositing tests
1244         https://bugs.webkit.org/show_bug.cgi?id=129688
1245
1246         Reviewed by Dean Jackson.
1247         
1248         When a layer is no longer composited, we need to unregister it
1249         from the scrolling coordinator, and remove it from m_scrollCoordinatedLayers.
1250
1251         Tested by compositing tests on iOS.
1252
1253         * rendering/RenderLayerCompositor.cpp:
1254         (WebCore::RenderLayerCompositor::updateBacking):
1255
1256 2014-03-04  Antti Koivisto  <antti@apple.com>
1257
1258         Update bindings test results after r165046.
1259
1260         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1261         (webkit_dom_test_obj_set_property):
1262         (webkit_dom_test_obj_set_reflected_string_attr):
1263         (webkit_dom_test_obj_set_reflected_url_attr):
1264         (webkit_dom_test_obj_set_reflected_custom_url_attr):
1265         * bindings/scripts/test/JS/JSTestObj.cpp:
1266         (WebCore::setJSTestObjReflectedStringAttr):
1267         (WebCore::setJSTestObjReflectedURLAttr):
1268         (WebCore::setJSTestObjReflectedCustomURLAttr):
1269         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1270         (-[DOMTestObj setReflectedStringAttr:]):
1271         (-[DOMTestObj setReflectedURLAttr:]):
1272         (-[DOMTestObj setReflectedCustomURLAttr:]):
1273
1274 2014-03-04  Martin Robinson  <mrobinson@igalia.com>
1275
1276         [GTK] Simplify the GObject DOM bindings API break check into one step
1277         https://bugs.webkit.org/show_bug.cgi?id=129571
1278
1279         Reviewed by Carlos Garcia Campos.
1280
1281         * bindings/gobject/GNUmakefile.am: We no longer generate the webkitdom.symbols file in the
1282         DerivedSources directory. All the logic is handled internally in the script now.
1283         * bindings/scripts/gobject-run-api-break-test: Removed.
1284
1285 2014-03-04  Zalan Bujtas  <zalan@apple.com>
1286
1287         Build fix for iOS.
1288
1289         * rendering/RenderThemeIOS.mm:
1290         (WebCore::RenderThemeIOS::addRoundedBorderClip):
1291         (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
1292
1293 2014-03-04  Zalan Bujtas  <zalan@apple.com>
1294
1295         Subpixel rendering: Make GraphicsLayer::fillRect FloatRoundedRect based and cleanup dependencies.
1296         https://bugs.webkit.org/show_bug.cgi?id=129557
1297
1298         Reviewed by Simon Fraser.
1299
1300         This is the preparation for snapping rounded rects to device pixel position. It enables
1301         device pixel aware border-radius painting.
1302
1303         No change in functionality.
1304
1305         * platform/efl/RenderThemeEfl.cpp:
1306         (WebCore::RenderThemeEfl::paintMediaSliderThumb):
1307         * platform/graphics/FloatRoundedRect.cpp:
1308         (WebCore::FloatRoundedRect::FloatRoundedRect):
1309         (WebCore::FloatRoundedRect::isRenderable):
1310         * platform/graphics/FloatRoundedRect.h:
1311         * platform/graphics/GraphicsContext.cpp:
1312         (WebCore::GraphicsContext::clipRoundedRect):
1313         (WebCore::GraphicsContext::clipOutRoundedRect):
1314         (WebCore::GraphicsContext::fillRoundedRect):
1315         (WebCore::GraphicsContext::fillRectWithRoundedHole):
1316         * platform/graphics/GraphicsContext.h:
1317         * platform/graphics/Path.cpp:
1318         (WebCore::Path::addRoundedRect):
1319         * platform/graphics/Path.h:
1320         * platform/graphics/RoundedRect.cpp:
1321         (WebCore::RoundedRect::pixelSnappedRoundedRectForPainting):
1322         * platform/graphics/RoundedRect.h:
1323         * platform/graphics/ShadowBlur.cpp:
1324         (WebCore::ShadowBlur::drawRectShadow):
1325         (WebCore::ShadowBlur::drawInsetShadow):
1326         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
1327         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
1328         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
1329         (WebCore::ShadowBlur::drawRectShadowWithTiling):
1330         * platform/graphics/ShadowBlur.h:
1331         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1332         (WebCore::GraphicsContext::fillRect):
1333         (WebCore::GraphicsContext::platformFillRoundedRect):
1334         (WebCore::GraphicsContext::fillRectWithRoundedHole):
1335         * platform/graphics/cg/GraphicsContextCG.cpp:
1336         (WebCore::GraphicsContext::fillRect):
1337         (WebCore::GraphicsContext::platformFillRoundedRect):
1338         (WebCore::GraphicsContext::fillRectWithRoundedHole):
1339         * platform/graphics/wince/GraphicsContextWinCE.cpp:
1340         (WebCore::GraphicsContext::fillRoundedRect):
1341         * platform/gtk/RenderThemeGtk.cpp:
1342         (WebCore::borderRadiiFromStyle):
1343         (WebCore::RenderThemeGtk::paintMediaSliderTrack):
1344         (WebCore::RenderThemeGtk::paintMediaSliderThumb):
1345         (WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack):
1346         * platform/win/DragImageWin.cpp:
1347         (WebCore::createDragImageForLink):
1348         * rendering/RenderBox.cpp:
1349         (WebCore::RenderBox::paintBoxDecorations):
1350         (WebCore::RenderBox::pushContentsClip):
1351         * rendering/RenderBoxModelObject.cpp:
1352         (WebCore::RenderBoxModelObject::clipRoundedInnerRect):
1353         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1354         (WebCore::RenderBoxModelObject::paintBorder):
1355         (WebCore::RenderBoxModelObject::drawBoxSideFromPath):
1356         (WebCore::RenderBoxModelObject::clipBorderSideForComplexInnerPath):
1357         (WebCore::RenderBoxModelObject::paintBoxShadow):
1358         * rendering/RenderLayer.cpp:
1359         (WebCore::RenderLayer::clipToRect):
1360         * rendering/RenderThemeIOS.mm:
1361         (WebCore::RenderThemeIOS::paintRadioDecorations):
1362         (WebCore::RenderThemeIOS::paintTextFieldDecorations):
1363         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
1364         (WebCore::RenderThemeIOS::paintSliderTrack):
1365         (WebCore::RenderThemeIOS::paintProgressBar):
1366         (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
1367         * rendering/RenderThemeMac.mm:
1368         (WebCore::RenderThemeMac::paintMenuListButtonGradients):
1369         (WebCore::RenderThemeMac::paintSliderTrack):
1370         * rendering/RenderThemeSafari.cpp:
1371         (WebCore::RenderThemeSafari::paintMenuListButtonGradients):
1372         (WebCore::RenderThemeSafari::paintSliderTrack):
1373         * rendering/shapes/BoxShape.cpp:
1374         (WebCore::BoxShape::buildDisplayPaths):
1375         * rendering/style/BasicShapes.cpp:
1376         (WebCore::BasicShapeInset::path):
1377
1378 2014-03-04  Andreas Kling  <akling@apple.com>
1379
1380         Micro-optimize Strings in JS bindings.
1381         <https://webkit.org/b/129673>
1382
1383         Tweaked for new jsStringWithWeakOwner signature. This patch removes
1384         36 bytes of code from every wrapper getter that returns a DOMString.
1385
1386         Reviewed by Ryosuke Niwa.
1387
1388         * bindings/js/JSDOMBinding.h:
1389         (WebCore::jsStringWithCache):
1390
1391 2014-03-03  David Kilzer  <ddkilzer@apple.com>
1392
1393         SVGPropertyTearOffs should detachChildren before deleting its value.
1394         <http://webkit.org/b/129618>
1395         <rdar://problem/15661617>
1396
1397         Reviewed by Maciej Stachowiak.
1398
1399         Merged from Blink (patch by kouhei@chromium.org):
1400         https://src.chromium.org/viewvc/blink?revision=158563&view=revision
1401         http://crbug.com/296276
1402
1403         Test: svg/transforms/svg-matrix-tearoff-crash.html
1404
1405         NOTE: The test does not reproduce a crash on WebKit using
1406         JavaScriptCore.
1407
1408         * svg/properties/SVGPropertyTearOff.h:
1409         (WebCore::SVGPropertyTearOff::setValue):
1410         (WebCore::SVGPropertyTearOff::~SVGPropertyTearOff):
1411         - Call detachChildren() if m_value is a copy.  The original
1412           Blink patch did not modify the destructor code path, although
1413           that seems obvious via code inspection.
1414
1415 2014-03-04  Zalan Bujtas  <zalan@apple.com>
1416
1417         Subpixel rendering: Incorrect repaint rect cuts off content's right edge after move.
1418         https://bugs.webkit.org/show_bug.cgi?id=129652
1419
1420         Reviewed by Simon Fraser.
1421
1422         When repaint rect is adjusted in order to take the distance from renderer into account,
1423         the accumulated fraction value need to be added too. This is always a positive value.
1424
1425         Test: fast/borders/hidpi-border-clipping-right-after-move.html
1426
1427         * rendering/RenderLayerBacking.cpp:
1428         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
1429
1430 2014-03-04  Ryuan Choi  <ryuan.choi@samsung.com>
1431
1432         Remove unused member variable of NetworkInfoController
1433         https://bugs.webkit.org/show_bug.cgi?id=129674
1434
1435         Reviewed by Gyuyoung Kim.
1436
1437         * Modules/networkinfo/NetworkInfoController.cpp:
1438         (WebCore::NetworkInfoController::NetworkInfoController):
1439         (WebCore::NetworkInfoController::create):
1440         (WebCore::provideNetworkInfoTo):
1441         * Modules/networkinfo/NetworkInfoController.h: Removed m_page which is not really used.
1442
1443 2014-02-07  Sergio Villar Senin  <svillar@igalia.com>
1444
1445         [CSS Grid Layout] Percentages of indefinite sizes should compute to auto
1446         https://bugs.webkit.org/show_bug.cgi?id=128173
1447
1448         Reviewed by Darin Adler.
1449
1450         We should treat percentages of indefinite sizes as auto as
1451         mandated by the spec. Otherwise we would end up calculating a
1452         percentage of -1, the value we use to represent infinite.
1453
1454         Added some test cases to the current tests.
1455
1456         * rendering/RenderGrid.cpp:
1457         (WebCore::RenderGrid::gridTrackSize):
1458         * rendering/style/GridTrackSize.h:
1459         (WebCore::GridTrackSize::isPercentage):
1460
1461 2014-03-04  Ryosuke Niwa  <rniwa@webkit.org>
1462
1463         Don't synchronize attributes in reflect setters when we don't need to
1464         https://bugs.webkit.org/show_bug.cgi?id=129662
1465
1466         Reviewed by Andreas Kling.
1467
1468         The vast majority of attributes don't need synchronization. Avoid calling synchronizeAttribute in setters
1469         for those content attributes generated by "Reflect" keyword in IDL.
1470
1471         * bindings/scripts/CodeGenerator.pm:
1472         (SetterExpression):
1473         * dom/Element.cpp:
1474         (WebCore::Element::setAttributeWithoutSynchronization): Added.
1475         * dom/Element.h:
1476
1477 2014-03-04  Andreas Kling  <akling@apple.com>
1478
1479         Remove Document::idAttributeName().
1480         <https://webkit.org/b/129663>
1481
1482         Reviewed by Ryosuke "DYEB" Niwa.
1483
1484         This abstraction is not actually used and causes unnecessary indirection
1485         in some pretty hot code paths.
1486
1487         Replace it with hard-coded HTMLNames::idAttr instead which is a compile
1488         time constant pointer. We can revisit this in the future if we wish to
1489         implement support for custom id attributes.
1490
1491         * dom/Attr.cpp:
1492         (WebCore::Attr::isId):
1493         * dom/Document.cpp:
1494         (WebCore::Document::Document):
1495         * dom/Document.h:
1496         * dom/Element.cpp:
1497         (WebCore::Element::attributeChanged):
1498         (WebCore::Element::willModifyAttribute):
1499         * dom/Element.h:
1500         (WebCore::Element::getIdAttribute):
1501         (WebCore::Element::getNameAttribute):
1502         (WebCore::Element::setIdAttribute):
1503         * html/HTMLElement.cpp:
1504         (WebCore::HTMLElement::parseAttribute):
1505         * html/HTMLFrameElementBase.cpp:
1506         (WebCore::HTMLFrameElementBase::parseAttribute):
1507         * html/HTMLMapElement.cpp:
1508         (WebCore::HTMLMapElement::parseAttribute):
1509         * svg/SVGElement.cpp:
1510         (WebCore::SVGElement::attributeChanged):
1511         (WebCore::SVGElement::isKnownAttribute):
1512         (WebCore::SVGElement::svgAttributeChanged):
1513
1514 2014-03-04  Ryosuke Niwa  <rniwa@webkit.org>
1515
1516         REGRESSION(r164856): Use after free in WebCore::QualifiedName::operator== / WebCore::StyledElement::attributeChanged
1517         https://bugs.webkit.org/show_bug.cgi?id=129550
1518
1519         Reviewed by Andreas Kling.
1520
1521         We can't store a reference to QualifiedName here because ensureUniqueElementData could delete QualifiedName inside Attribute.
1522
1523         Test: fast/dom/uniquing-attributes-via-setAttribute.html
1524
1525         * dom/Element.cpp:
1526         (WebCore::Element::setAttributeInternal):
1527
1528 2014-03-04  Hyowon Kim  <hw1008.kim@samsung.com>
1529
1530         Move EvasGLContext and EvasGLSurface files into the efl common directory.
1531         https://bugs.webkit.org/show_bug.cgi?id=129603
1532
1533         Reviewed by Gyuyoung Kim.
1534
1535         EFL port will use EvasGLContext and EvasGLSurface files in both WK1 and WK2.
1536
1537         No new tests, just refactorings.
1538
1539         * PlatformEfl.cmake:
1540         * platform/graphics/efl/EvasGLContext.cpp: Renamed from Source/WebKit2/UIProcess/API/efl/EvasGLContext.cpp.
1541         (WebKit::EvasGLContext::EvasGLContext):
1542         (WebKit::EvasGLContext::~EvasGLContext):
1543         * platform/graphics/efl/EvasGLContext.h: Renamed from Source/WebKit2/UIProcess/API/efl/EvasGLContext.h.
1544         (WebKit::EvasGLContext::create):
1545         (WebKit::EvasGLContext::context):
1546         * platform/graphics/efl/EvasGLSurface.cpp: Renamed from Source/WebKit2/UIProcess/API/efl/EvasGLSurface.cpp.
1547         (WebKit::EvasGLSurface::EvasGLSurface):
1548         (WebKit::EvasGLSurface::~EvasGLSurface):
1549         * platform/graphics/efl/EvasGLSurface.h: Renamed from Source/WebKit2/UIProcess/API/efl/EvasGLSurface.h.
1550         (WebKit::EvasGLSurface::create):
1551         (WebKit::EvasGLSurface::surface):
1552
1553 2014-03-03  Martin Robinson  <mrobinson@igalia.com>
1554
1555         Fix the GTK+ CMake build
1556
1557         * PlatformGTK.cmake: Add a missing file to the source list.
1558
1559 2014-03-03  Sanghyup Lee  <sh53.lee@samsung.com>
1560
1561         :active style is not cleared when its display property is set to none before mouse released.
1562         https://bugs.webkit.org/show_bug.cgi?id=129465
1563
1564         Reviewed by Antonio Gomes.
1565
1566         Source/WebCore:
1567
1568         We currently clearing the :active style when element has a renderer.
1569         This patch makes elements clear its active style regardless of renderer. 
1570
1571         * dom/Document.cpp:
1572         (WebCore::Document::updateHoverActiveState):
1573
1574         LayoutTests:
1575
1576         * fast/css/active-display-none-expected.txt: Added.
1577         * fast/css/active-display-none.html: Added.
1578
1579
1580 2014-03-03  Andreas Kling  <akling@apple.com>
1581
1582         Remove 2 unnecessary includes from JSDOMBinding.h
1583         <https://webkit.org/b/129619>
1584
1585         Reviewed by Antti Koivisto.
1586
1587         * bindings/js/JSDOMBinding.h:
1588
1589 2014-03-03  Myles C. Maxfield  <mmaxfield@apple.com>
1590
1591         GraphicsContext::drawLineForText needs to be exported from WebCore.dylib for iOS builds
1592         https://bugs.webkit.org/show_bug.cgi?id=129647
1593
1594         Reviewed by NOBODY (This is a build fix).
1595
1596         Fixing after r165025 and r165016.
1597
1598         No new tests as this is a build fix.
1599
1600         * WebCore.exp.in:
1601
1602 2014-03-03  Jer Noble  <jer.noble@apple.com>
1603
1604         [iOS] Start playback button misplaced
1605         https://bugs.webkit.org/show_bug.cgi?id=129628
1606
1607         Reviewed by Simon Fraser.
1608
1609         On YouTube embeds, while the video is loading it is placed into the DOM with a 0x0 size.
1610         This causes the start playback button to be visible in the upper-left corner of the embed
1611         area. The button wasn't visible previously (in plugin mode) because the plugin clipped its
1612         drawing to its bounds, and so the <video> shadow should do the same.
1613
1614         * Modules/mediacontrols/mediaControlsiOS.css:
1615         (::-webkit-media-controls):
1616
1617 2014-03-03  Enrica Casucci  <enrica@apple.com>
1618
1619         Build fix for iOS simulator.
1620
1621         * WebCore.exp.in:
1622
1623 2014-03-03  Jeremy Jones  <jeremyj@apple.com>
1624
1625         Forward application suspend resume notifications to the web process.
1626         https://bugs.webkit.org/show_bug.cgi?id=129356
1627
1628         Reviewed by Eric Carlson.
1629
1630         * platform/audio/ios/MediaSessionManagerIOS.mm:
1631         (-[WebMediaSessionHelper initWithCallback:]):
1632         Observe UIApplicationDidBecomeActiveNotification,
1633         WebUIApplicationDidBecomeActiveNotification,
1634         WebUIApplicationWillEnterForegroundNotification, and
1635         WebUIApplicationWillResignActiveNotification
1636         
1637         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
1638         Resume session.
1639
1640 2014-03-03  Commit Queue  <commit-queue@webkit.org>
1641
1642         Unreviewed, rolling out r165013.
1643         http://trac.webkit.org/changeset/165013
1644         https://bugs.webkit.org/show_bug.cgi?id=129646
1645
1646         New code is not thread safe, asserting on a worker test
1647         (Requested by ap on #webkit).
1648
1649         * WebCore.exp.in:
1650         * editing/DeleteButtonController.cpp:
1651         (WebCore::DeleteButtonController::createDeletionUI):
1652         * html/DOMURL.cpp:
1653         (WebCore::DOMURL::revokeObjectURL):
1654         * inspector/InspectorPageAgent.cpp:
1655         (WebCore::InspectorPageAgent::cachedResource):
1656         * inspector/InspectorResourceAgent.cpp:
1657         (WebCore::InspectorResourceAgent::replayXHR):
1658         * loader/DocumentLoader.cpp:
1659         (WebCore::areAllLoadersPageCacheAcceptable):
1660         * loader/FrameLoader.cpp:
1661         (WebCore::FrameLoader::tellClientAboutPastMemoryCacheLoads):
1662         * loader/ImageLoader.cpp:
1663         (WebCore::ImageLoader::updateFromElement):
1664         * loader/archive/cf/LegacyWebArchive.cpp:
1665         (WebCore::LegacyWebArchive::create):
1666         * loader/cache/CachedCSSStyleSheet.cpp:
1667         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
1668         * loader/cache/CachedCSSStyleSheet.h:
1669         * loader/cache/CachedFont.cpp:
1670         (WebCore::CachedFont::CachedFont):
1671         * loader/cache/CachedFont.h:
1672         * loader/cache/CachedImage.cpp:
1673         (WebCore::CachedImage::CachedImage):
1674         * loader/cache/CachedImage.h:
1675         * loader/cache/CachedRawResource.cpp:
1676         (WebCore::CachedRawResource::CachedRawResource):
1677         * loader/cache/CachedRawResource.h:
1678         * loader/cache/CachedResource.cpp:
1679         (WebCore::CachedResource::CachedResource):
1680         (WebCore::CachedResource::~CachedResource):
1681         * loader/cache/CachedResource.h:
1682         * loader/cache/CachedResourceLoader.cpp:
1683         (WebCore::createResource):
1684         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
1685         (WebCore::CachedResourceLoader::requestResource):
1686         (WebCore::CachedResourceLoader::revalidateResource):
1687         (WebCore::CachedResourceLoader::loadResource):
1688         * loader/cache/CachedResourceLoader.h:
1689         * loader/cache/CachedSVGDocument.cpp:
1690         (WebCore::CachedSVGDocument::CachedSVGDocument):
1691         * loader/cache/CachedSVGDocument.h:
1692         * loader/cache/CachedScript.cpp:
1693         (WebCore::CachedScript::CachedScript):
1694         * loader/cache/CachedScript.h:
1695         * loader/cache/CachedTextTrack.cpp:
1696         (WebCore::CachedTextTrack::CachedTextTrack):
1697         * loader/cache/CachedTextTrack.h:
1698         * loader/cache/CachedXSLStyleSheet.cpp:
1699         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
1700         * loader/cache/CachedXSLStyleSheet.h:
1701         * loader/cache/MemoryCache.cpp:
1702         (WebCore::MemoryCache::add):
1703         (WebCore::MemoryCache::revalidationSucceeded):
1704         (WebCore::MemoryCache::resourceForURL):
1705         (WebCore::MemoryCache::resourceForRequest):
1706         (WebCore::MemoryCache::addImageToCache):
1707         (WebCore::MemoryCache::removeImageFromCache):
1708         (WebCore::MemoryCache::evict):
1709         (WebCore::MemoryCache::removeResourcesWithOrigin):
1710         (WebCore::MemoryCache::getOriginsWithCache):
1711         (WebCore::MemoryCache::removeUrlFromCache):
1712         (WebCore::MemoryCache::removeRequestFromCache):
1713         (WebCore::MemoryCache::removeRequestFromCacheImpl):
1714         (WebCore::MemoryCache::crossThreadRemoveRequestFromCache):
1715         (WebCore::MemoryCache::getStatistics):
1716         (WebCore::MemoryCache::setDisabled):
1717         * loader/cache/MemoryCache.h:
1718         * platform/CrossThreadCopier.cpp:
1719         * platform/CrossThreadCopier.h:
1720         * platform/network/cf/ResourceRequest.h:
1721         (WebCore::ResourceRequest::ResourceRequest):
1722         * rendering/RenderSnapshottedPlugIn.cpp:
1723         (WebCore::RenderSnapshottedPlugIn::updateSnapshot):
1724         * testing/Internals.cpp:
1725         (WebCore::Internals::isLoadingFromMemoryCache):
1726
1727 2014-03-03  Sam Weinig  <sam@webkit.org>
1728
1729         Fix the iOS Simulator build.
1730
1731         * WebCore.exp.in:
1732
1733 2014-03-03  Myles C. Maxfield  <mmaxfield@apple.com>
1734
1735         Space between double underlines does not scale with font size
1736         https://bugs.webkit.org/show_bug.cgi?id=129521
1737
1738         Reviewed by Simon Fraser.
1739
1740         This patch moves the logic about how far to draw the second underline (when text-decoration-style: double
1741         is specified) from InlineTextBox to GraphicsContext, because GraphicsContext is the authoritative source
1742         about how thick underlines should be. The space between the two underlines is set to the thickness of
1743         each of the underlines.
1744
1745         This patch also deletes some unused code in InlineTextBox that was never getting triggered, in addition
1746         to unifying drawLineForText with drawLinesForText. This didn't have any performance impact in my testing.
1747
1748         Test: fast/css3-text/css3-text-decoration/text-decoration-style-double-space-scales.html
1749
1750         * platform/graphics/GraphicsContext.h: drawLineForText takes a boolean for if we should draw double
1751         underlines.
1752         * platform/graphics/cg/GraphicsContextCG.cpp:
1753         (WebCore::GraphicsContext::drawLineForText):
1754         (WebCore::GraphicsContext::drawLinesForText):
1755         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1756         (WebCore::GraphicsContext::drawLineForText):
1757         * platform/graphics/wince/GraphicsContextWinCE.cpp:
1758         (WebCore::GraphicsContext::drawLineForText):
1759         * rendering/InlineTextBox.cpp: Use new boolean argument
1760         (WebCore::drawSkipInkUnderline):
1761         (WebCore::InlineTextBox::paintDecoration):
1762
1763 2014-02-28  Chris Fleizach  <cfleizach@apple.com>
1764
1765         AX: Support IOS Accessibility in WK2
1766         https://bugs.webkit.org/show_bug.cgi?id=129527
1767
1768         Reviewed by Sam Weinig.
1769
1770         Update the iOS wrapper so that it can convert points to screen space in WebKit2.
1771
1772         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1773         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
1774         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
1775
1776 2014-03-03  Martin Hock  <mhock@apple.com>
1777
1778         Add support for sessions to MemoryCache.
1779         https://bugs.webkit.org/show_bug.cgi?id=127794
1780
1781         Reviewed by Sam Weinig.
1782
1783         * WebCore.exp.in:
1784         * editing/DeleteButtonController.cpp:
1785         (WebCore::DeleteButtonController::createDeletionUI): Initialize CachedImage with sessionID.
1786         * html/DOMURL.cpp:
1787         (WebCore::DOMURL::revokeObjectURL): Remove URL from MemoryCache for all sessions.
1788         * inspector/InspectorPageAgent.cpp:
1789         (WebCore::InspectorPageAgent::cachedResource): Pass sessionID to MemoryCache.
1790         * inspector/InspectorResourceAgent.cpp:
1791         (WebCore::InspectorResourceAgent::replayXHR): Ditto.
1792         * loader/DocumentLoader.cpp:
1793         (WebCore::areAllLoadersPageCacheAcceptable): Ditto.
1794         * loader/FrameLoader.cpp:
1795         (WebCore::FrameLoader::tellClientAboutPastMemoryCacheLoads): Ditto.
1796         * loader/ImageLoader.cpp:
1797         (WebCore::ImageLoader::updateFromElement): Initialize CachedImage with sessionID.
1798         * loader/archive/cf/LegacyWebArchive.cpp:
1799         (WebCore::LegacyWebArchive::create): Pass sessionID to MemoryCache.
1800         * loader/cache/CachedCSSStyleSheet.cpp:
1801         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet): Constructor takes sessionID.
1802         * loader/cache/CachedCSSStyleSheet.h:
1803         * loader/cache/CachedFont.cpp: Ditto.
1804         (WebCore::CachedFont::CachedFont):
1805         * loader/cache/CachedFont.h:
1806         * loader/cache/CachedImage.cpp: Ditto.
1807         (WebCore::CachedImage::CachedImage):
1808         * loader/cache/CachedImage.h:
1809         * loader/cache/CachedRawResource.cpp: Ditto.
1810         (WebCore::CachedRawResource::CachedRawResource):
1811         * loader/cache/CachedRawResource.h:
1812         * loader/cache/CachedResource.cpp: Ditto.
1813         (WebCore::CachedResource::CachedResource):
1814         (WebCore::CachedResource::~CachedResource): Pass sessionID to MemoryCache.
1815         * loader/cache/CachedResource.h:
1816         (WebCore::CachedResource::sessionID):
1817         * loader/cache/CachedResourceLoader.cpp:
1818         (WebCore::createResource): Constructors take sessionID.
1819         (WebCore::CachedResourceLoader::sessionID): Retrieve sessionID from page.
1820         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Pass sessionID to MemoryCache.
1821         (WebCore::CachedResourceLoader::requestResource): Initialize CachedCSSStyleSheet with sessionID.
1822         (WebCore::CachedResourceLoader::revalidateResource): Initialize cached resource with sessionID.
1823         (WebCore::CachedResourceLoader::loadResource): Pass sessionID to MemoryCache and initialize cached resource with sessionID.
1824         * loader/cache/CachedResourceLoader.h:
1825         * loader/cache/CachedSVGDocument.cpp: Constructor takes sessionID.
1826         (WebCore::CachedSVGDocument::CachedSVGDocument):
1827         * loader/cache/CachedSVGDocument.h:
1828         * loader/cache/CachedScript.cpp: Ditto.
1829         (WebCore::CachedScript::CachedScript):
1830         * loader/cache/CachedScript.h:
1831         * loader/cache/CachedTextTrack.cpp: Ditto.
1832         (WebCore::CachedTextTrack::CachedTextTrack):
1833         * loader/cache/CachedTextTrack.h:
1834         * loader/cache/CachedXSLStyleSheet.cpp: Ditto.
1835         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
1836         * loader/cache/CachedXSLStyleSheet.h:
1837         * loader/cache/MemoryCache.cpp:
1838         (WebCore::MemoryCache::getSessionMap): Retrieve CachedResourceMap based on sessionID.
1839         (WebCore::MemoryCache::add): Use sessionID from CachedResource parameter.
1840         (WebCore::MemoryCache::revalidationSucceeded): Add sessionID parameter.
1841         (WebCore::MemoryCache::resourceForURL): Ditto.
1842         (WebCore::MemoryCache::resourceForRequest): Ditto, also move impl into impl method.
1843         (WebCore::MemoryCache::resourceForRequestImpl): Add CachedResourceMap parameter.
1844         (WebCore::MemoryCache::addImageToCache): Use default sessionID.
1845         (WebCore::MemoryCache::removeImageFromCache): Ditto.
1846         (WebCore::MemoryCache::evict): Use sessionID from CachedResource parameter.
1847         (WebCore::MemoryCache::removeResourcesWithOrigin): Iterate through all CachedResourceMaps.
1848         (WebCore::MemoryCache::getOriginsWithCache): Ditto.
1849         (WebCore::MemoryCache::removeUrlFromCache): Add sessionID parameter.
1850         (WebCore::MemoryCache::removeRequestFromCache): Ditto.
1851         (WebCore::MemoryCache::removeRequestFromCacheImpl): Ditto.
1852         (WebCore::MemoryCache::removeRequestFromSessionCaches): Iterate through all CachedResourceMaps.
1853         (WebCore::MemoryCache::crossThreadRemoveRequestFromCache): Add sessionID parameter.
1854         (WebCore::MemoryCache::getStatistics): Iterate through all CachedResourceMaps.
1855         (WebCore::MemoryCache::setDisabled): Ditto.
1856         * loader/cache/MemoryCache.h: Create another level for cache.
1857         * platform/CrossThreadCopier.cpp: Allow copying SessionIDs across threads.
1858         (WebCore::SessionID>::copy):
1859         * platform/CrossThreadCopier.h:
1860         * platform/network/cf/ResourceRequest.h:
1861         (WebCore::ResourceRequest::ResourceRequest): Remove trailing whitespace.
1862         * rendering/RenderSnapshottedPlugIn.cpp:
1863         (WebCore::RenderSnapshottedPlugIn::updateSnapshot): Initialize CachedImage with sessionID.
1864         * testing/Internals.cpp:
1865         (WebCore::Internals::isLoadingFromMemoryCache): Pass sessionID to MemoryCache.
1866
1867 2014-03-03  Andreas Kling  <akling@apple.com>
1868
1869         Remove unused DataView code from JSDOMBinding.h
1870         <https://webkit.org/b/129616>
1871
1872         Reviewed by Antti Koivisto.
1873
1874         * bindings/js/JSDOMBinding.h:
1875
1876 2014-03-03  Simon Fraser  <simon.fraser@apple.com>
1877
1878         Allow overflow-scroll to be one-finger scrolled until we hook up UIScrollViews
1879         https://bugs.webkit.org/show_bug.cgi?id=129621
1880
1881         Reviewed by Benjamin Poulain.
1882
1883         Temporary change to allow overflow:scroll to be scrolled in iOS WK2.
1884
1885         * rendering/RenderLayer.cpp:
1886         (WebCore::RenderLayer::hasAcceleratedTouchScrolling):
1887
1888 2014-03-03  Antti Koivisto  <antti@apple.com>
1889
1890         Find results on simple lines are not marked correctly
1891         https://bugs.webkit.org/show_bug.cgi?id=129586
1892
1893         Reviewed by Andreas Kling.
1894
1895         Tests: editing/text-iterator/count-mark-lineboxes.html
1896                editing/text-iterator/count-mark-simple-lines.html
1897                
1898         TextIterator operating on simple lines failed to take the end of the range into account.
1899         This also causes performance issues on long documents as range traversals would miss the end
1900         node and end up going through the entire document.
1901
1902         * editing/TextIterator.cpp:
1903         (WebCore::TextIterator::handleTextNode):
1904         
1905             Stop when hitting the range end on simple text nodes.
1906
1907         (WebCore::SimplifiedBackwardsTextIterator::handleTextNode):
1908         
1909             Use hasRenderedText test instead of linebox-only firstTextBox.
1910
1911         * testing/Internals.cpp:
1912         (WebCore::Internals::countMatchesForText):
1913         * testing/Internals.h:
1914         * testing/Internals.idl:
1915         
1916             Add testing interface for counting and marking matches.
1917
1918 2014-03-03  Benjamin Poulain  <benjamin@webkit.org>
1919
1920         SelectorQuery failing RightMostWithIdMatch are compiling their selectors for each execution
1921         https://bugs.webkit.org/show_bug.cgi?id=129601
1922
1923         Reviewed by Andreas Kling.
1924
1925         This caused a regression after r164924 for documents in quirks mode. Since those always fail
1926         selectorForIdLookup(), they ended up compiling the selector every time they were called.
1927
1928         * dom/SelectorQuery.cpp:
1929         (WebCore::SelectorDataList::execute):
1930
1931 2014-03-01  Jer Noble  <jer.noble@apple.com>
1932
1933         [Mac] Crash in MediaPlayer::rateChanged()
1934         https://bugs.webkit.org/show_bug.cgi?id=129548
1935
1936         Reviewed by Darin Adler.
1937
1938         WTF::bind will automatically ref the parameters added to it. But MediaPlayerPrivate-
1939         AVFoundation and -MediaSOurceAVFObjC are not RefCounted, so by the time the bound
1940         function is called, the underlying objects may have been freed.
1941
1942         Replace or augment callOnMainThread arguments with lambdas and weakPtrs so that
1943         if the argument has been destroyed, its methods will not be called.
1944
1945         Make the MediaPlayerPrivateAVFoundation::Notification function type a std::function:
1946         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1947         (WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification):
1948         (WebCore::MediaPlayerPrivateAVFoundation::Notification::function):
1949
1950         Make createWeakPtr() public so that it can be called from non-class methods:
1951         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1952         (WebCore::MediaPlayerPrivateAVFoundationObjC::createWeakPtr): 
1953         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1954         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::createWeakPtr): 
1955
1956         Use a weakPtr to abort callOnMainThread() if the object has been destroyed:
1957         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1958         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1959         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1960         (WebCore::CMTimebaseEffectiveRateChangedCallback):
1961         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
1962         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
1963         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
1964
1965 2014-02-28  Jer Noble  <jer.noble@apple.com>
1966
1967         [MSE] YouTube videos fail to play
1968         https://bugs.webkit.org/show_bug.cgi?id=129525
1969
1970         Reviewed by Darin Adler.
1971
1972         Test: media/media-source/media-source-fudge-factor.html
1973
1974         Add a very simple playability metric to SourceBuffer. Track the number of seconds buffered
1975         and use that metric to determine whether the MediaSource has buffered enough data to play
1976         through.
1977
1978         * Modules/mediasource/MediaSource.cpp:
1979         (WebCore::MediaSource::currentTime): Added simple accessor.
1980         (WebCore::MediaSource::monitorSourceBuffers): Replace the functor-based iterators with lambdas.
1981         (WebCore::MediaSource::addSourceBuffer): Drive-by fix; only add new source buffers to the
1982             activeSourceBuffers list if those buffers are actually active.
1983         * Modules/mediasource/MediaSource.h:
1984         * Modules/mediasource/SourceBuffer.cpp:
1985         (WebCore::SourceBuffer::SourceBuffer): Initialize new ivars.
1986         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Measure the number of seconds buffered.
1987         (WebCore::SourceBuffer::monitorBufferingRate): Use a simple Exponential moving average to
1988             track the buffering rate.
1989         (WebCore::SourceBuffer::hasCurrentTime): Return true if the current time is within 1/24 s
1990             of a buffered range.
1991         (WebCore::SourceBuffer::hasFutureTime): Moved from MediaSource.
1992         (WebCore::SourceBuffer::canPlayThrough): Return true if the buffering rate is > 1s per
1993             second, or if the rate is sufficient to keep up over the remaining time.
1994         * Modules/mediasource/SourceBuffer.h:
1995
1996 2014-03-03  Bear Travis  <betravis@adobe.com>
1997
1998         [CSS Shapes] Serialize circle positions
1999         https://bugs.webkit.org/show_bug.cgi?id=129404
2000
2001         Reviewed by Dirk Schulze.
2002
2003         Circle positions should always be present when serialized, and should
2004         only have the 2 or 4-valued form. Keywords are converted to percentages
2005         and simplified where possible. This patch adds some additional processing
2006         that converts the parsed position into the serialized format, before
2007         converting it to text. See http://dev.w3.org/csswg/css-shapes/#basic-shape-serialization.
2008
2009         Updated existing parsing tests.
2010
2011         * css/CSSBasicShapes.cpp:
2012         (WebCore::serializePositionOffset): Convert a position offset to a serialized string.
2013         The offset must be a pair, as generated by buildSerializablePositionOffset.
2014         (WebCore::buildSerializablePositionOffset): Generates a keyword + offset pair for each
2015         position offset. The keywords may later be dropped during serialization.
2016         (WebCore::CSSBasicShapeCircle::cssText): Use the new serialization methods.
2017
2018 2014-03-03  Lorenzo Tilve  <ltilve@igalia.com>
2019
2020         Optimize StylePropertiesSet::findPropertyIndex() to improve CSS properties performance
2021         https://bugs.webkit.org/show_bug.cgi?id=129605
2022
2023         Reviewed by Andreas Kling.
2024
2025         Merged from Blink (patch by Mikhail Pozdnyakov):
2026         https://src.chromium.org/viewvc/blink?view=revision&revision=167325
2027
2028         Avoid checking whether 'StylePropertiesSet' is mutable and accesing directly to its
2029         data members to achieve performance improvements
2030
2031         Before the optimization applied:
2032             mean: 3064.8337171934063 runs/s
2033             median: 3097.5899379343855 runs/s
2034             stdev: 66.89274074044187 runs/s
2035             min: 2891.7479324362585 runs/s
2036             max: 3113.288683440125 runs/s
2037
2038         After the optimization applied:
2039             mean: 3343.8356114138105 runs/s
2040             median: 3356.25682957446 runs/s
2041             stdev: 36.297533087489036 runs/s
2042             min: 3238.5468032264243 runs/s
2043             max: 3368.664837531425 runs/s
2044
2045         Performance gain for the average value is approx. 9.1%, in the
2046         range of the 10% - 8.2% for the min and max measured
2047         values (Linux desktop x64).
2048
2049         * css/StyleProperties.cpp:
2050         (WebCore::ImmutableStyleProperties::findPropertyIndex):
2051         (WebCore::MutableStyleProperties::findPropertyIndex):
2052         * css/StyleProperties.h:
2053         (WebCore::toMutableStyleProperties):
2054         (WebCore::toImmutableStyleProperties):
2055         (WebCore::StyleProperties::findPropertyIndex):
2056
2057 2014-03-03  Brian Burg  <bburg@apple.com>
2058
2059         Unreviewed build fix for Windows after r164986.
2060
2061         * WebCore.vcxproj/build-generated-files.sh: Export WebReplayScripts
2062         so that the build system knows how to find CodeGeneratorReplayInputs.py.
2063
2064 2014-03-03  Andrei Bucur  <abucur@adobe.com>
2065
2066         [CSS Regions] Overset computation is incorrect in some cases
2067         https://bugs.webkit.org/show_bug.cgi?id=129032
2068
2069         Reviewed by Mihnea Ovidenie.
2070
2071         This patch reworks the way overset is computed for regions and named flows.
2072
2073         1. Regions overflow no longer trigger an overset changed event. This is because
2074         the overflow of a box is contained within the region range of the box. The content
2075         edge should be considered the logical bottom position of the content inside the
2076         flow thread.
2077
2078         2. The regions events logic was moved from RenderFlowThread to RenderNamedFlowThread
2079         and from RenderRegion to RenderNamedFlowFragment (including the regionOverset property).
2080
2081         3. The overset value of the named flow is no longer stored in the named flow. It is
2082         extracted from the overset of the last region in the chain.
2083
2084         4. The regions overset is not computed every time the flow thread is laid out which
2085         should improve performance for flows with many regions. With the patch, each region
2086         computes the overset value during its layout when the flow thread is in the overflow
2087         or the final layout phase.
2088
2089         5. The overset changed event is dispatched only at the end of the layout of the named flows,
2090         after all the region overset changes have been considered. This means that the overset
2091         event can't be dispatched in the middle of the auto-height processing algorithm that
2092         requires multiple layout passes for the flow threads.
2093
2094         However, the region layout update event dispatch timing was not changed, it is dispatched
2095         every time the flow thread has a layout. This preserves the current behavior of the event.
2096
2097         Tests: The old tests were modified to take into account the change.
2098
2099         * dom/Element.cpp:
2100         (WebCore::Element::webkitRegionOverset):
2101         * dom/WebKitNamedFlow.cpp:
2102         (WebCore::WebKitNamedFlow::overset):
2103         * inspector/InspectorCSSAgent.cpp:
2104         (WebCore::InspectorCSSAgent::buildArrayForRegions):
2105         * rendering/FlowThreadController.cpp:
2106         (WebCore::FlowThreadController::updateFlowThreadsIntoMeasureContentPhase):
2107         * rendering/RenderBlock.cpp:
2108         (WebCore::RenderBlock::computeOverflow):
2109         * rendering/RenderFlowThread.cpp:
2110         (WebCore::RenderFlowThread::RenderFlowThread):
2111         (WebCore::RenderFlowThread::layout):
2112         * rendering/RenderFlowThread.h:
2113         * rendering/RenderNamedFlowFragment.cpp:
2114         (WebCore::RenderNamedFlowFragment::layoutBlock):
2115         (WebCore::RenderNamedFlowFragment::setRegionOversetState):
2116         (WebCore::RenderNamedFlowFragment::regionOversetState):
2117         (WebCore::RenderNamedFlowFragment::updateOversetState):
2118         * rendering/RenderNamedFlowFragment.h:
2119         * rendering/RenderNamedFlowThread.cpp:
2120         (WebCore::RenderNamedFlowThread::RenderNamedFlowThread):
2121         (WebCore::RenderNamedFlowThread::computeOverflow):
2122         (WebCore::RenderNamedFlowThread::layout):
2123         (WebCore::RenderNamedFlowThread::dispatchNamedFlowEvents):
2124         (WebCore::RenderNamedFlowThread::dispatchRegionLayoutUpdateEventIfNeeded):
2125         (WebCore::RenderNamedFlowThread::dispatchRegionOversetChangeEventIfNeeded):
2126         * rendering/RenderNamedFlowThread.h:
2127         There's a new field called m_flowContentBottom that tracks the content bottom of the flow thread
2128         after layout. This value is used to compute the overset value of the regions because it's not
2129         affected by relative positioning or visual overflow such as shadows.
2130         * rendering/RenderRegion.cpp:
2131         * rendering/RenderRegion.h:
2132
2133 2014-03-03  Tomas Popela  <tpopela@redhat.com>
2134
2135         [GTK] CodeGeneratorGObject.pm remove usage of undefined variable
2136         https://bugs.webkit.org/show_bug.cgi?id=129602
2137
2138         Reviewed by Martin Robinson.
2139
2140         Remove usage of undefined variable hdrPropIncludes in CodeGeneratorGObject.pm
2141
2142         * bindings/scripts/CodeGeneratorGObject.pm:
2143         (WriteData):
2144
2145 2014-03-03  Brian Burg  <bburg@apple.com>
2146
2147         Web Replay: upstream input storage, capture/replay machinery, and inspector domain
2148         https://bugs.webkit.org/show_bug.cgi?id=128782
2149
2150         Reviewed by Timothy Hatcher, Joseph Pecoraro, and Andreas Kling.
2151
2152         No new tests yet, as they rely on infrastructure tracked in https://webkit.org/b/129190.
2153
2154         Replayable executions are organized into ReplaySessions, which can
2155         contain several ReplaySessionSegments that divide overall execution
2156         at main frame navigation boundaries. NondeterministicInput subclasses
2157         are stored in SegmentedInputStorage according to the input's InputQueue.
2158
2159         Capture and playback are controlled at the page granularity by the Page's
2160         ReplayController. The controller knows how to create new segments, replay to
2161         arbitrary positions in the ReplaySession, and track the active InputCursor.
2162
2163         The capturing and replaying input cursor subclasses encapsulate state for
2164         storing new inputs and loading/dispatching saved inputs, respectively.
2165
2166         The ReplayAgent and associated inspector protocol domain is the friendly
2167         public API for programmatically capturing and replaying sessions.
2168
2169         * DerivedSources.make: Add replay inputs code generation target. Add the
2170         replay domain specification to the list of inspector domains.
2171
2172         * ForwardingHeaders/replay/EncodedValue.h: Added.
2173         * WebCore.xcodeproj/project.pbxproj: Add many files, and export
2174         `WebReplayScripts` environment variable to DerivedSources.make.
2175
2176         * inspector/InspectorController.cpp: Add the replay agent.
2177         (WebCore::InspectorController::InspectorController):
2178
2179         * inspector/InspectorInstrumentation.cpp:
2180         Add events for segment lifecycle events, and loading/unloading of sessions
2181         and segments, and capture/replay progress events. The replay controller
2182         also needs to know about detached and committed frames.
2183
2184         (WebCore::InspectorInstrumentation::frameDetachedFromParentImpl):
2185         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
2186         (WebCore::InspectorInstrumentation::sessionCreatedImpl):
2187         (WebCore::InspectorInstrumentation::sessionLoadedImpl):
2188         (WebCore::InspectorInstrumentation::sessionModifiedImpl):
2189         (WebCore::InspectorInstrumentation::segmentCreatedImpl):
2190         (WebCore::InspectorInstrumentation::segmentCompletedImpl):
2191         (WebCore::InspectorInstrumentation::segmentLoadedImpl):
2192         (WebCore::InspectorInstrumentation::segmentUnloadedImpl):
2193         (WebCore::InspectorInstrumentation::captureStartedImpl):
2194         (WebCore::InspectorInstrumentation::captureStoppedImpl):
2195         (WebCore::InspectorInstrumentation::playbackStartedImpl):
2196         (WebCore::InspectorInstrumentation::playbackPausedImpl):
2197         (WebCore::InspectorInstrumentation::playbackHitPositionImpl):
2198         (WebCore::InspectorInstrumentation::replayAgentEnabled):
2199         * inspector/InspectorInstrumentation.h:
2200         (WebCore::InspectorInstrumentation::replayAgentEnabled):
2201         (WebCore::InspectorInstrumentation::sessionCreated):
2202         (WebCore::InspectorInstrumentation::sessionLoaded):
2203         (WebCore::InspectorInstrumentation::sessionModified):
2204         (WebCore::InspectorInstrumentation::segmentCreated):
2205         (WebCore::InspectorInstrumentation::segmentCompleted):
2206         (WebCore::InspectorInstrumentation::segmentLoaded):
2207         (WebCore::InspectorInstrumentation::segmentUnloaded):
2208         (WebCore::InspectorInstrumentation::captureStarted):
2209         (WebCore::InspectorInstrumentation::captureStopped):
2210         (WebCore::InspectorInstrumentation::playbackStarted):
2211         (WebCore::InspectorInstrumentation::playbackPaused):
2212         (WebCore::InspectorInstrumentation::playbackHitPosition):
2213
2214         * inspector/InspectorReplayAgent.cpp: Added.
2215         (WebCore::buildInspectorObjectForPosition):
2216         (WebCore::buildInspectorObjectForInput):
2217         (WebCore::buildInspectorObjectForSession):
2218         (WebCore::SerializeInputToJSONFunctor::SerializeInputToJSONFunctor):
2219         (WebCore::SerializeInputToJSONFunctor::~SerializeInputToJSONFunctor):
2220         (WebCore::SerializeInputToJSONFunctor::operator()):
2221         (WebCore::SerializeInputToJSONFunctor::returnValue):
2222         (WebCore::buildInspectorObjectForSegment):
2223         (WebCore::InspectorReplayAgent::InspectorReplayAgent):
2224         (WebCore::InspectorReplayAgent::~InspectorReplayAgent):
2225         (WebCore::InspectorReplayAgent::sessionState):
2226         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
2227         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
2228         (WebCore::InspectorReplayAgent::frameNavigated):
2229         (WebCore::InspectorReplayAgent::frameDetached):
2230         (WebCore::InspectorReplayAgent::sessionCreated):
2231         (WebCore::InspectorReplayAgent::sessionModified):
2232         (WebCore::InspectorReplayAgent::sessionLoaded):
2233         (WebCore::InspectorReplayAgent::segmentCreated):
2234         (WebCore::InspectorReplayAgent::segmentCompleted):
2235         (WebCore::InspectorReplayAgent::segmentLoaded):
2236         (WebCore::InspectorReplayAgent::segmentUnloaded):
2237         (WebCore::InspectorReplayAgent::captureStarted):
2238         (WebCore::InspectorReplayAgent::captureStopped):
2239         (WebCore::InspectorReplayAgent::playbackStarted):
2240         (WebCore::InspectorReplayAgent::playbackPaused):
2241         (WebCore::InspectorReplayAgent::playbackHitPosition):
2242         (WebCore::InspectorReplayAgent::startCapturing):
2243         (WebCore::InspectorReplayAgent::stopCapturing):
2244         (WebCore::InspectorReplayAgent::replayToPosition):
2245         (WebCore::InspectorReplayAgent::replayToCompletion):
2246         (WebCore::InspectorReplayAgent::pausePlayback):
2247         (WebCore::InspectorReplayAgent::cancelPlayback):
2248         (WebCore::InspectorReplayAgent::switchSession):
2249         (WebCore::InspectorReplayAgent::insertSessionSegment):
2250         (WebCore::InspectorReplayAgent::removeSessionSegment):
2251         Provide a public API for modifying sessions. This is the backend support
2252         for user editing of replay sessions to add/remove specific segments.
2253
2254         (WebCore::InspectorReplayAgent::findSession):
2255         (WebCore::InspectorReplayAgent::findSegment):
2256         (WebCore::InspectorReplayAgent::getAvailableSessions):
2257         (WebCore::InspectorReplayAgent::getSerializedSession):
2258         (WebCore::InspectorReplayAgent::getSerializedSegment):
2259         Most of the replay protocol domain speaks in terms of sesssion and
2260         segment identifiers. These functions return the actual data associated
2261         with these identifiers.
2262
2263         * inspector/InspectorReplayAgent.h: Added.
2264         * inspector/InstrumentingAgents.cpp:
2265         (WebCore::InstrumentingAgents::InstrumentingAgents):
2266         (WebCore::InstrumentingAgents::reset):
2267         * inspector/InstrumentingAgents.h:
2268         (WebCore::InstrumentingAgents::inspectorReplayAgent): Added.
2269         (WebCore::InstrumentingAgents::setInspectorReplayAgent): Added.
2270         * inspector/protocol/Replay.json: Added.
2271
2272         * page/Page.cpp:
2273         (WebCore::Page::Page):
2274         * page/Page.h:
2275         (WebCore::Page::replayController): Added.
2276         * platform/Logging.h: Add WebReplay logging channel.
2277         * replay/AllReplayInputs.h: Added. Simplifies importing all input definitions.
2278
2279         * replay/CapturingInputCursor.cpp: Added.
2280         (WebCore::CapturingInputCursor::CapturingInputCursor):
2281         (WebCore::CapturingInputCursor::~CapturingInputCursor):
2282         (WebCore::CapturingInputCursor::create):
2283         (WebCore::CapturingInputCursor::storeInput):
2284         (WebCore::CapturingInputCursor::loadInput):
2285         (WebCore::CapturingInputCursor::uncheckedLoadInput):
2286         * replay/CapturingInputCursor.h: Added.
2287
2288         * replay/EventLoopInput.h:
2289         (WebCore::EventLoopInputBase::EventLoopInputBase):
2290         (WebCore::EventLoopInputBase::timestamp):
2291         (WebCore::EventLoopInputBase::setTimestamp): Support deserialization.
2292
2293         * replay/EventLoopInputDispatcher.cpp: Added. This class encapsulates the timers
2294         and measurements used to dispatch event loop inputs during replay.
2295
2296         (WebCore::EventLoopInputDispatcher::EventLoopInputDispatcher):
2297         (WebCore::EventLoopInputDispatcher::run):
2298         (WebCore::EventLoopInputDispatcher::pause):
2299         (WebCore::EventLoopInputDispatcher::timerFired):
2300         (WebCore::EventLoopInputDispatcher::dispatchInputSoon):
2301         (WebCore::EventLoopInputDispatcher::dispatchInput):
2302         * replay/EventLoopInputDispatcher.h: Added.
2303         (WebCore::EventLoopInputDispatcherClient::EventLoopInputDispatcherClient):
2304         (WebCore::EventLoopInputDispatcherClient::~EventLoopInputDispatcherClient):
2305
2306         * replay/FunctorInputCursor.h: Added.
2307         (WebCore::FunctorInputCursor::~FunctorInputCursor):
2308         (WebCore::FunctorInputCursor::forEachInputInQueue):
2309         (WebCore::FunctorInputCursor::FunctorInputCursor):
2310         (WebCore::FunctorInputCursor::storeInput):
2311         (WebCore::FunctorInputCursor::loadInput):
2312         (WebCore::FunctorInputCursor::uncheckedLoadInput):
2313
2314         * replay/ReplayController.cpp: Added.
2315         (WebCore::ReplayController::ReplayController):
2316         (WebCore::ReplayController::switchSession):
2317         (WebCore::ReplayController::createSegment):
2318         (WebCore::ReplayController::completeSegment):
2319         (WebCore::ReplayController::loadSegment):
2320         (WebCore::ReplayController::unloadSegment):
2321         (WebCore::ReplayController::startCapturing):
2322         (WebCore::ReplayController::stopCapturing):
2323         (WebCore::ReplayController::startPlayback):
2324         (WebCore::ReplayController::pausePlayback):
2325         (WebCore::ReplayController::cancelPlayback):
2326         (WebCore::ReplayController::replayToPosition):
2327         (WebCore::ReplayController::frameDetached):
2328         (WebCore::ReplayController::frameNavigated):
2329         (WebCore::ReplayController::loadedSession):
2330         (WebCore::ReplayController::loadedSegment):
2331         (WebCore::ReplayController::activeInputCursor):
2332         (WebCore::ReplayController::dispatcher):
2333         (WebCore::ReplayController::willDispatchInput):
2334         (WebCore::ReplayController::didDispatchInput):
2335         (WebCore::ReplayController::didDispatchFinalInput):
2336         * replay/ReplayController.h: Added.
2337         (WebCore::ReplayPosition::ReplayPosition):
2338         (WebCore::ReplayPosition::operator<):
2339         (WebCore::ReplayPosition::operator==):
2340
2341         * replay/ReplayInputCreationMethods.cpp: Added.
2342         Static factory implementations for inputs belong here.
2343         (WebCore::InitialNavigation::createFromPage):
2344
2345         * replay/ReplayInputDispatchMethods.cpp: Added.
2346         All dispatch() implementations for generated replay inputs belong here.
2347         (WebCore::BeginSegmentSentinel::dispatch):
2348         (WebCore::EndSegmentSentinel::dispatch):
2349         (WebCore::InitialNavigation::dispatch):
2350
2351         * replay/ReplayInputTypes.cpp:
2352         (WebCore::ReplayInputTypes::ReplayInputTypes):
2353         * replay/ReplayInputTypes.h: Define strings for WebCore inputs.
2354
2355         * replay/ReplaySession.cpp: Added.
2356         (WebCore::ReplaySession::create):
2357         (WebCore::ReplaySession::ReplaySession):
2358         (WebCore::ReplaySession::~ReplaySession):
2359         (WebCore::ReplaySession::appendSegment):
2360         (WebCore::ReplaySession::insertSegment):
2361         (WebCore::ReplaySession::removeSegment):
2362         * replay/ReplaySession.h: Added.
2363         (WebCore::ReplaySession::identifier):
2364         (WebCore::ReplaySession::timestamp):
2365         (WebCore::ReplaySession::size):
2366         (WebCore::ReplaySession::at):
2367         (WebCore::ReplaySession::begin):
2368         (WebCore::ReplaySession::end):
2369
2370         * replay/ReplaySessionSegment.cpp: Added.
2371         (WebCore::ReplaySessionSegment::create):
2372         (WebCore::ReplaySessionSegment::ReplaySessionSegment):
2373         (WebCore::ReplaySessionSegment::~ReplaySessionSegment):
2374         (WebCore::ReplaySessionSegment::createCapturingCursor):
2375         (WebCore::ReplaySessionSegment::createReplayingCursor):
2376         (WebCore::ReplaySessionSegment::createFunctorCursor):
2377         * replay/ReplaySessionSegment.h: Added.
2378         (WebCore::ReplaySessionSegment::identifier):
2379         (WebCore::ReplaySessionSegment::timestamp):
2380
2381         * replay/ReplayingInputCursor.cpp: Added.
2382         (WebCore::ReplayingInputCursor::ReplayingInputCursor):
2383         (WebCore::ReplayingInputCursor::~ReplayingInputCursor):
2384         (WebCore::ReplayingInputCursor::create):
2385         (WebCore::ReplayingInputCursor::storeInput):
2386         (WebCore::ReplayingInputCursor::loadInput):
2387         (WebCore::ReplayingInputCursor::uncheckedLoadInput):
2388         * replay/ReplayingInputCursor.h: Added.
2389
2390         * replay/SegmentedInputStorage.cpp: Added.
2391         (WebCore::queueTypeToLogPrefix):
2392         (WebCore::jsonStringForInput):
2393         (WebCore::offsetForInputQueue):
2394         (WebCore::SegmentedInputStorage::SegmentedInputStorage):
2395         (WebCore::SegmentedInputStorage::~SegmentedInputStorage):
2396         (WebCore::SegmentedInputStorage::load):
2397         (WebCore::SegmentedInputStorage::store):
2398         (WebCore::SegmentedInputStorage::queueSize):
2399         * replay/SegmentedInputStorage.h: Added.
2400
2401         * replay/SerializationMethods.cpp: Added.
2402         Specializations of EncodingTraits for WebCore types belong here.
2403
2404         (JSC::EncodingTraits<NondeterministicInputBase>::encodeValue):
2405         (JSC::EncodingTraits<NondeterministicInputBase>::decodeValue):
2406         (JSC::EncodingTraits<SecurityOrigin>::encodeValue):
2407         (JSC::EncodingTraits<SecurityOrigin>::decodeValue):
2408         (JSC::EncodingTraits<URL>::encodeValue):
2409         (JSC::EncodingTraits<URL>::decodeValue):
2410         * replay/SerializationMethods.h: Added.
2411         * replay/WebInputs.json: Added.
2412         In this inital patch, we define BeginSegmentSentinel,
2413         EndSegmentSentinel, and InitialNavigation inputs.
2414
2415 2014-03-03  Antoine Quint  <graouts@webkit.org>
2416
2417         Respect SVG fragment identifiers in <img> src attribute
2418         https://bugs.webkit.org/show_bug.cgi?id=129387
2419
2420         Reviewed by Dirk Schulze.
2421
2422         Following Dirk Schulze's suggestion, we set the URL on the SVGImage itself and handle the URL's
2423         fragment identifier at draw time in the SVGImage itself, which will provide a sounder base for
2424         handling of fragment identifier in SVG resource URLs in CSS properties, and should also deal
2425         with the crasher reported in http://webkit.org/b/129498 since there is a guaranteed Frame at the
2426         time we call SVGImage::draw().
2427
2428         * svg/graphics/SVGImage.cpp:
2429         (WebCore::SVGImage::draw):
2430         * svg/graphics/SVGImage.h:
2431         * svg/graphics/SVGImageForContainer.cpp:
2432         * svg/graphics/SVGImageForContainer.h:
2433
2434 2014-03-03  Laszlo Vidacs  <lvidacs.u-szeged@partner.samsung.com>
2435
2436         Move function calls outside loop in dom
2437         https://bugs.webkit.org/show_bug.cgi?id=126525
2438
2439         Reviewed by Csaba Osztrogonác.
2440
2441         Store the result of length() in a local variable and use it in each iteration.
2442
2443         * dom/DOMImplementation.cpp:
2444         (WebCore::DOMImplementation::isXMLMIMEType):
2445         * dom/ElementData.cpp:
2446         (WebCore::UniqueElementData::UniqueElementData):
2447         * dom/EventContext.cpp:
2448         (WebCore::TouchEventContext::checkReachability):
2449
2450 2014-03-03  Tomas Popela  <tpopela@redhat.com>
2451
2452         [GTK] webkit_dom_range_compare_boundary_points fails when 0 is passed as how parameter
2453         https://bugs.webkit.org/show_bug.cgi?id=129145
2454
2455         Reviewed by Carlos Garcia Campos.
2456
2457         While generating GObject DOM API the generator should skip non pointer
2458         types while generating the g_return_val_if_fail macro.
2459         This will avoid the situation when Range.START_TO_START is defined as 0,
2460         thus the webkit_dom_range_compare_boundary_points function will fail
2461         everytime it is called with 0 as how value.
2462
2463         * bindings/scripts/CodeGeneratorGObject.pm:
2464         (GenerateFunction):
2465
2466 2014-03-03  Jozsef Berta  <jberta.u-szeged@partner.samsung.com>
2467
2468         [cmake] *Names.cpp file should be regenerated after touching StaticString.pm
2469         https://bugs.webkit.org/show_bug.cgi?id=129031
2470
2471         Reviewed by Csaba Osztrogonác.
2472
2473         * CMakeLists.txt: Added make_names.pl dependencies: bindings/scripts/Hasher.pm and bindings/scripts/StaticString.pm
2474
2475 2014-03-03  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2476
2477         [GTK] Multimedia controls captions icon needs its own metaphor
2478         https://bugs.webkit.org/show_bug.cgi?id=129091
2479
2480         Reviewed by Martin Robinson.
2481
2482         As we got the new icon created, we used it with a fallback to the
2483         old icon to keep run-time compatibility.
2484
2485         No new tests, current ones suffice.
2486
2487         * platform/gtk/RenderThemeGtk.cpp:
2488         (WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
2489         Replicated RenderThemeGtk::paintMediaButton to check for the
2490         necessary icon first and do the fallback to the old and stock
2491         icons.
2492         * platform/gtk/RenderThemeGtk2.cpp:
2493         (WebCore::getStockIconForWidgetType): Added ASSERT for non-empty
2494         icon name.
2495         (WebCore::getStockSymbolicIconForWidgetType): Check for non empty
2496         icon name before calling getStockIconForWidgetType. Fixed coding
2497         style.
2498         * platform/gtk/RenderThemeGtk3.cpp:
2499         (WebCore::getStockIconForWidgetType): Added ASSERT for non-empty
2500         icon name.
2501         (WebCore::getStockSymbolicIconForWidgetType): Check for non empty
2502         icon name before calling getStockIconForWidgetType. Fixed coding
2503         style.
2504
2505 2014-03-02  Benjamin Poulain  <benjamin@webkit.org>
2506
2507         Add a fallback path for compiling the remaining attribute checkers
2508         https://bugs.webkit.org/show_bug.cgi?id=129580
2509
2510         Reviewed by Darin Adler.
2511
2512         The remaining attribute checkers appear to be less common than the simple value match.
2513         This patch adds them to SelectorCompiler for completeness but no attempt is made at optimizing them,
2514         they all default to function calls.
2515
2516         If the assumption that those selectors are not common turn out to be incorrect, we should see
2517         the function calls in profiles and optimize them as needed.
2518
2519         * css/SelectorChecker.cpp:
2520         (WebCore::attributeValueMatches):
2521         If we get anything but attribute match here, something has gone horribly wrong. Update the code
2522         to fail if that were to happen.
2523
2524         * cssjit/SelectorCompiler.cpp:
2525         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
2526         Add the missing match type to the selector fragment.
2527
2528         Begin, End, Contain cannot match an empty value per specification. We can test that at compile time
2529         and fail immediately. See http://www.w3.org/TR/css3-selectors/#attribute-substrings
2530
2531         List has the extra requirement that a value containing a space does not match anything. It also cannot
2532         match with an empty string. See http://www.w3.org/TR/css3-selectors/#attribute-representation
2533
2534         (WebCore::SelectorCompiler::attributeValueBeginsWith):
2535         (WebCore::SelectorCompiler::attributeValueContains):
2536         (WebCore::SelectorCompiler::attributeValueEndsWith):
2537         (WebCore::SelectorCompiler::attributeValueMatchHyphenRule):
2538         (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
2539         The slow fallbacks.
2540
2541         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueMatching):
2542         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
2543         A generic code generator making function call to match an attribute value.
2544
2545 2014-02-25  Andreas Kling  <akling@apple.com>
2546
2547         JSDOMWindow::commonVM() should return a reference.
2548         <https://webkit.org/b/129293>
2549
2550         Since this function always returns a VM and never null, make it
2551         return a reference instead. There are more VM getters that never
2552         return null, but I tried to keep the patch from snowballing.
2553
2554         Reviewed by Geoff Garen.
2555
2556 2014-03-02  Timothy Hatcher  <timothy@apple.com>
2557
2558         Remove ASSERT in ~IDBRequest since it is firing during legitimate uses in Web Inspector.
2559
2560         Adding the ASSERT back is tracked by https://webkit.org/b/129593.
2561
2562         https://bugs.webkit.org/show_bug.cgi?id=129328
2563
2564         Reviewed by Sam Weinig.
2565
2566         * Modules/indexeddb/IDBRequest.cpp:
2567         (WebCore::IDBRequest::~IDBRequest):
2568
2569 2014-03-02  Commit Queue  <commit-queue@webkit.org>
2570
2571         Unreviewed, rolling out r164961.
2572         http://trac.webkit.org/changeset/164961
2573         https://bugs.webkit.org/show_bug.cgi?id=129596
2574
2575         Caused many assertion failures (Requested by ap on #webkit).
2576
2577         * css/SelectorChecker.cpp:
2578         (WebCore::attributeValueMatches):
2579         * cssjit/SelectorCompiler.cpp:
2580         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
2581         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueMatching):
2582
2583 2014-03-02  Darin Adler  <darin@apple.com>
2584
2585         Streamline use of TextIterator, cutting down includes and use of soon-to-be-deleted functions
2586         https://bugs.webkit.org/show_bug.cgi?id=129592
2587
2588         Reviewed by Sam Weinig.
2589
2590         * WebCore.exp.in: Re-sorted this file. Not sure how it got unsorted.
2591
2592         * accessibility/AccessibilityObject.cpp:
2593         (WebCore::AccessibilityObject::stringForVisiblePositionRange): Call TextIterator::text
2594         instead of TextIterator::length. Also removed unneeded special case for empty string
2595         and exception code.
2596         (WebCore::AccessibilityObject::lengthForVisiblePositionRange): Ditto.
2597
2598         * accessibility/AccessibilityObject.h: Include TextIteratorBehavior.h instead of
2599         TextIterator.h.
2600
2601         * accessibility/AccessibilityRenderObject.cpp: Include TextIterator.h.
2602
2603         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: Removed unneeded
2604         TextIterator.h include.
2605
2606         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2607         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): Call
2608         TextIterator::text instead of TextIterator::length.
2609
2610         * dom/Element.cpp: Include TextIterator.h.
2611
2612         * dom/Node.cpp: Include Range.h.
2613
2614         * dom/Position.cpp:
2615         (WebCore::Position::isCandidate): Cast to RenderBlockFlow since that's what the
2616         type check above does. Use a return statement instead of an else for better flow.
2617         (WebCore::Position::leadingWhitespacePosition): Call
2618         deprecatedIsCollapsibleWhitespace by its new name (newly deprecated).
2619         (WebCore::Position::trailingWhitespacePosition): Ditto.
2620
2621         * dom/Range.cpp:
2622         (WebCore::Range::firstNode): Added a FIXME about code that clearly does not
2623         belong. This is something we really need to fix.
2624
2625         * editing/AlternativeTextController.cpp: Include TextIterator.h.
2626         * editing/ApplyStyleCommand.cpp: Ditto.
2627
2628         * editing/CompositeEditCommand.cpp:
2629         (WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit): Call
2630         deprecatedIsCollapsibleWhitespace by its new name (newly deprecated).
2631
2632         * editing/Editor.h: Include TextIteratorBehavior.h instead of TextIterator.h.
2633
2634         * editing/HTMLInterchange.cpp:
2635         (WebCore::convertHTMLTextToInterchangeFormat): Call
2636         deprecatedIsCollapsibleWhitespace by its new name (newly deprecated).
2637
2638         * editing/SpellingCorrectionCommand.cpp: Include TextIterator.h.
2639
2640         * editing/TextIterator.h: Moved isCollapsibleWhitespace from here into
2641         htmlediting.h and renamed it deprecatedIsCollapsibleWhitespace.
2642
2643         * editing/TextIterator.cpp: Call
2644         deprecatedIsCollapsibleWhitespace by its new name (newly deprecated).
2645
2646         * editing/TypingCommand.cpp: Include TextIterator.h.
2647
2648         * editing/VisibleUnits.cpp:
2649         (WebCore::previousBoundary): Call TextIterator::text instead of
2650         TextIterator::length.
2651         (WebCore::nextBoundary): Ditto.
2652
2653         * editing/htmlediting.cpp: Include TextIterator.h.
2654
2655         * editing/htmlediting.h: Removed non-helpful section comments.
2656         Added FIXME about isWhitespace. Added deprecatedIsCollapsibleWhitespace,
2657         formerly not deprecated and in TextIterator.h.
2658
2659         * editing/markup.cpp: Include TextIterator.h.
2660
2661         * html/HTMLTextAreaElement.cpp: Include TextIterator.h.
2662
2663         * page/ContextMenuController.cpp:
2664         (WebCore::selectionContainsPossibleWord): Call TextIterator::text
2665         instead of TextIterator::length and TextIterator::characterAt.
2666
2667         * page/EventHandler.cpp: Sorted conditional includes alphabetically by condition.
2668
2669         * platform/mac/HTMLConverter.mm:
2670         (+[WebHTMLConverter editingAttributedStringFromRange:]): Call TextIterator::text
2671         instead of TextIterator::length.
2672
2673 2014-03-02  Benjamin Poulain  <benjamin@webkit.org>
2674
2675         Add a fallback path for compiling the remaining attribute checkers
2676         https://bugs.webkit.org/show_bug.cgi?id=129580
2677
2678         Reviewed by Darin Adler.
2679
2680         The remaining attribute checkers appear to be less common than the simple value match.
2681         This patch adds them to SelectorCompiler for completeness but no attempt is made at optimizing them,
2682         they all default to function calls.
2683
2684         If the assumption that those selectors are not common turn out to be incorrect, we should see
2685         the function calls in profiles and optimize them as needed.
2686
2687         * css/SelectorChecker.cpp:
2688         (WebCore::attributeValueMatches):
2689         If we get anything but attribute match here, something has gone horribly wrong. Update the code
2690         to fail if that were to happen.
2691
2692         * cssjit/SelectorCompiler.cpp:
2693         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
2694         Add the missing match type to the selector fragment.
2695
2696         Begin, End, Contain cannot match an empty value per specification. We can test that at compile time
2697         and fail immediately. See http://www.w3.org/TR/css3-selectors/#attribute-substrings
2698
2699         List has the extra requirement that a value containing a space does not match anything. It also cannot
2700         match with an empty string. See http://www.w3.org/TR/css3-selectors/#attribute-representation
2701
2702         (WebCore::SelectorCompiler::attributeValueBeginsWith):
2703         (WebCore::SelectorCompiler::attributeValueContains):
2704         (WebCore::SelectorCompiler::attributeValueEndsWith):
2705         (WebCore::SelectorCompiler::attributeValueMatchHyphenRule):
2706         (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
2707         The slow fallbacks.
2708
2709         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueMatching):
2710         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
2711         A generic code generator making function call to match an attribute value.
2712
2713 2014-03-02  Darin Adler  <darin@apple.com>
2714
2715         Fix build for case-sensitive file systems.
2716
2717         * platform/UserActivity.h: Runloop -> RunLoop.
2718
2719 2014-03-02  Gavin Barraclough  <barraclough@apple.com>
2720
2721         HysteresisTimer should use WebCore::Timer
2722         https://bugs.webkit.org/show_bug.cgi?id=129587
2723
2724         Reviewed by Sam Weinig.
2725
2726         * platform/HysteresisActivity.h:
2727         (WebCore::HysteresisActivity::HysteresisActivity):
2728         (WebCore::HysteresisActivity::hysteresisTimerFired):
2729             - RunLoop::Timer -> WebCore::Timer.
2730         * platform/UserActivity.h:
2731
2732 2014-03-02  Darin Adler  <darin@apple.com>
2733
2734         Split TextIteratorBehavior into a separate header
2735         https://bugs.webkit.org/show_bug.cgi?id=129578
2736
2737         Reviewed by Sam Weinig.
2738
2739         This is in preparation to greatly cut down on includes of TextIterator.h.
2740
2741         * GNUmakefile.list.am: Added new header.
2742         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
2743         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2744         * WebCore.xcodeproj/project.pbxproj: Ditto.
2745
2746          * editing/FindOptions.h: Changed typedef to unsigned char;
2747         there is no reason to store these in a 32-bit integer.
2748
2749          * editing/TextIterator.h: Added include of TextIteratorBehavior.h
2750         and moved comments about the meanings of flag bits to their definition.
2751
2752         * editing/TextIteratorBehavior.h: Added.
2753
2754         * WebCore.exp.in: Updated for type changes.
2755
2756 2014-03-02  Enrica Casucci  <enrica@apple.com>
2757
2758         [iOS WebKit2] Form controls handling
2759         https://bugs.webkit.org/show_bug.cgi?id=129344
2760         <rdar://problem/16053643>
2761
2762         Reviewed by Simon Fraser.
2763
2764         Updates localizable strings and adds some exports.
2765
2766         * English.lproj/Localizable.strings:
2767         * WebCore.exp.in:
2768         * WebCore.xcodeproj/project.pbxproj:
2769
2770 2014-03-02  Benjamin Poulain  <bpoulain@apple.com>
2771
2772         [iOS][WK2] Pages using tiled compositing layers allocate too many tiles on zoom
2773         https://bugs.webkit.org/show_bug.cgi?id=129471
2774
2775         Reviewed by Simon Fraser.
2776
2777         A few issues with TileController were causing sublayers of the root layers
2778         to tile incorrect surfaces on zoom.
2779
2780         First, the exposedRect API was not updating the sublayers. The layers go correctly
2781         into tiling mode, but the tiles cover the full document instead of the visible area.
2782
2783         The other major issue was the margins being applied to the coverage size in document
2784         coordinates. Since each margin is 512px, the total coverage size after zoom was
2785         gigantic.
2786
2787         To solve this, this patch switch from the exposedRect API to the generic concept
2788         of VisibleExtentContentRect introduced for iOS WebKit1.
2789
2790         * WebCore.exp.in:
2791         * platform/ScrollView.h:
2792         Define a VisibleExtentContentRect on the scrollview itself when there is no
2793         platformWidget().
2794         The case with inside frame is untested due to stability issues :(.
2795         (see <rdar://problem/16199219>)
2796
2797         * platform/graphics/ca/mac/TileController.mm:
2798         (WebCore::TileController::computeTileCoverageRect):
2799         Remove the margin from the tile coverage.
2800
2801         On iOS, m_tileCoverage is always zero at the moment. Previously, the tile coverage
2802         was artificially extended by the margins. With the margins removed, I temporarily added
2803         a factor of 1.5.
2804         ViewUpdateDispatcher has all the information to compute a great tile coverage, I will need
2805         a follow up patch to fix that.
2806
2807         * platform/ios/ScrollViewIOS.mm:
2808         (WebCore::ScrollView::visibleExtentContentRect):
2809         (WebCore::ScrollView::setVisibleExtentContentRect):
2810
2811 2014-03-02  Darin Adler  <darin@apple.com>
2812
2813         Sort Mac platform export files so they merge better
2814         https://bugs.webkit.org/show_bug.cgi?id=129581
2815
2816         Reviewed by Sam Weinig.
2817
2818         * WebCore.exp.in: Ran the new sort-export-file on this.
2819
2820 2014-03-02  Dean Jackson  <dino@apple.com>
2821
2822         Add protected casting to FilterOperation classes.
2823         https://bugs.webkit.org/show_bug.cgi?id=124062
2824
2825         Reviewed by Sam Weinig.
2826
2827         Use the type cast macro generators to produce some toFilterOperation-style
2828         functions, and then use them in our PlatformCA filter code.
2829
2830         Test: css3/filters/animation-from-initial-values-with-color-matrix.html
2831
2832         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm: Use the toFilterOperation methods, in
2833         some cases removing the unnecessary double cast.
2834         (PlatformCAFilters::filterValueForOperation):
2835         (PlatformCAFilters::colorMatrixValueForFilter):
2836         * platform/graphics/filters/FilterOperation.cpp:
2837         (WebCore::BasicColorMatrixFilterOperation::blend):
2838         (WebCore::BasicColorMatrixFilterOperation::operator==): Move this to the .cpp file so it can use the casting methods.
2839         (WebCore::BasicComponentTransferFilterOperation::blend):
2840         (WebCore::BasicComponentTransferFilterOperation::operator==): Ditto.
2841         * platform/graphics/filters/FilterOperation.h: Add the casting macros.
2842
2843 2014-03-02  Yoav Weiss  <yoav@yoav.ws>
2844
2845         Fix srcset related bugs
2846         https://bugs.webkit.org/show_bug.cgi?id=129539
2847
2848         Fixed a bug reported against Blink's srcset implementation at https://code.google.com/p/chromium/issues/detail?id=347998
2849         When both src and srcset had only 1x descriptors and the DPR was higher than 1, the src's resource was picked.
2850
2851         Also fixed the invalid descriptor handling, which wasn't aligned with the spec, and therefore was not as forward compatible as it should be.
2852         Invalid descriptors caused the entire resource to be ignored, rather than just the descriptors themselves.
2853
2854         Reviewed by Andreas Kling.
2855
2856         Tests: fast/hidpi/image-srcset-invalid-descriptor.html
2857                fast/hidpi/image-srcset-src-selection-1x-both.html
2858
2859         * html/parser/HTMLParserIdioms.cpp:
2860         (WebCore::parseDescriptors):
2861         (WebCore::parseImagesWithScaleFromSrcsetAttribute):
2862         (WebCore::bestFitSourceForImageAttributes):
2863
2864 2014-03-01  Gavin Barraclough  <barraclough@apple.com>
2865
2866         Split UserActivity, simplify PageThrottler
2867         https://bugs.webkit.org/show_bug.cgi?id=129551
2868
2869         Reviewed by Darin Adler.
2870
2871         The class UserActivity currently implements two things – a hysteresis mechanism, and
2872         an abstraction of NSActivity controlled by that mechanism. PageThrottler implements
2873         its own hysteresis mechanism, which directly controls DOM timer throttling and also
2874         controls a couple of UserActivities, giving a total of 3 separate hysteresis mechanisms,
2875         layered two deep.
2876
2877         Split UserActivity into three, with HysteresisActivity implementing an abstract hysteresis
2878         mechanism, UserActivity::Impl controlling the NSActivity, and then UserActivity combining
2879         these two back together. The interface to UserActivity is unchanged.
2880
2881         Remove PageThrottler's bespoke hysteresis, replacing it with a use of HysteresisActivity.
2882         Replace the two UserActivities with a single UserActivity::Impl, so there are no longer
2883         layered hysteresis mechanisms.
2884
2885         * WebCore.exp.in:
2886             - exports changed.
2887         * WebCore.xcodeproj/project.pbxproj:
2888             - added HysteresisActivity.h.
2889         * page/PageThrottler.cpp:
2890         (WebCore::PageThrottler::PageThrottler):
2891             - if the page starts visible, begin activity. If it starts hidden throttle DOM timers.
2892         (WebCore::PageThrottler::hiddenPageDOMTimerThrottlingStateChanged):
2893             - when the DOM timer throttling setting changes, make sure we update.
2894         (WebCore::PageThrottler::incrementActivityCount):
2895         (WebCore::PageThrottler::decrementActivityCount):
2896             - when m_activityCount changes update the hysteresis state.
2897         (WebCore::PageThrottler::updateHysteresis):
2898         (WebCore::PageThrottler::setViewState):
2899             - when IsVisuallyIdle changes update the hysteresis state.
2900         (WebCore::PageThrottler::started):
2901         (WebCore::PageThrottler::stopped):
2902             - callbacks from HysteresisActivity, these control m_activity and DOM timer throttling.
2903         * page/PageThrottler.h:
2904         (WebCore::PageThrottler::didReceiveUserInput):
2905         (WebCore::PageThrottler::pluginDidEvaluate):
2906             - call impulse to temporarily enable the activity.
2907         * platform/HysteresisActivity.h: Copied from Source/WebCore/platform/UserActivity.h.
2908         (WebCore::HysteresisActivity::HysteresisActivity):
2909             - constructor takes a delegate optionally a timeout.
2910         (WebCore::HysteresisActivity::start):
2911             - start activity immediately. If stopped, call started method on delegate. If in timeout period, cancel the timer.
2912         (WebCore::HysteresisActivity::stop):
2913             - stop activity after hysteresis. If started, initiate timeout period.
2914         (WebCore::HysteresisActivity::impulse):
2915             - ensure activity for at least the timeout period.
2916         (WebCore::HysteresisActivity::hysteresisTimerFired):
2917             - delayed stop - when the timer fires call stopped on the delegate.
2918         * platform/UserActivity.cpp:
2919         (WebCore::UserActivity::Impl::Impl):
2920         (WebCore::UserActivity::Impl::beginActivity):
2921         (WebCore::UserActivity::Impl::endActivity):
2922             - nop implementation.
2923         (WebCore::UserActivity::UserActivity):
2924             - UserActivity maintains existing interface with hysteresis.
2925         (WebCore::UserActivity::started):
2926         (WebCore::UserActivity::stopped):
2927             - callbacks from HysteresisTimer; forward to Impl.
2928         * platform/UserActivity.h:
2929         * platform/mac/UserActivityMac.mm:
2930         (WebCore::UserActivity::Impl::Impl):
2931             - UserActivity::Impl, abstraction for NSActivity without added hysteresis.
2932         (WebCore::UserActivity::Impl::beginActivity):
2933             - allocate NSActivity.
2934         (WebCore::UserActivity::Impl::endActivity):
2935             - release NSActivity.
2936
2937 2014-03-02  Brian Burg  <bburg@apple.com>
2938
2939         DocumentLoader should keep maps of ResourceLoaders instead of sets
2940         https://bugs.webkit.org/show_bug.cgi?id=129388
2941
2942         Reviewed by Darin Adler.
2943
2944         For web replay, we need to be able to pull a ResourceLoader instance by
2945         identifier from the DocumentLoader. This is easy to do if we convert
2946         ResourceLoaderSet to ResourceLoaderMap, keyed by the loader's identifier.
2947
2948         Added assertions whenever adding or removing from the map to ensure
2949         that we don't try to add duplicates or resources with zero identifiers.
2950
2951         No new tests required. No functionality was added.
2952
2953         * loader/DocumentLoader.cpp:
2954         (WebCore::cancelAll):
2955         (WebCore::setAllDefersLoading):
2956         (WebCore::areAllLoadersPageCacheAcceptable):
2957         (WebCore::DocumentLoader::addSubresourceLoader):
2958         (WebCore::DocumentLoader::removeSubresourceLoader):
2959         (WebCore::DocumentLoader::addPlugInStreamLoader):
2960         (WebCore::DocumentLoader::removePlugInStreamLoader):
2961         (WebCore::DocumentLoader::subresourceLoaderFinishedLoadingOnePart):
2962         * loader/DocumentLoader.h:
2963         * loader/NetscapePlugInStreamLoader.cpp:
2964         (WebCore::NetscapePlugInStreamLoader::create): Only add the loader
2965         to the document loader's map if it initialized successfully.
2966         The old code was probably leaking resource loaders that failed to
2967         initialize.
2968
2969         * loader/mac/DocumentLoaderMac.cpp:
2970         (WebCore::scheduleAll):
2971         (WebCore::unscheduleAll):
2972
2973 2014-03-02  Dirkjan Ochtman  <d.ochtman@activevideo.com>
2974
2975         Support ENABLE_ENCRYPTED_MEDIA in cmake builds
2976         https://bugs.webkit.org/show_bug.cgi?id=129575
2977
2978         Reviewed by Philippe Normand.
2979
2980         No new tests, only fixes the build.
2981
2982         * CMakeLists.txt:
2983         Add support for ENABLE_ENCRYPTED_MEDIA.
2984         * Modules/encryptedmedia/MediaKeySession.cpp:
2985         (WebCore::MediaKeySession::close):
2986         Assign nullptr instead of 0 to OwnPtr to appease gcc-4.7.
2987
2988 2014-03-01  Tim Horton  <timothy_horton@apple.com>
2989
2990         WebKit2 View Gestures (Smart Magnification): Support for iOS
2991         https://bugs.webkit.org/show_bug.cgi?id=129146
2992         <rdar://problem/16032668>
2993
2994         Reviewed by Benjamin Poulain.
2995
2996         * WebCore.exp.in:
2997         Add an export.
2998
2999 2014-03-01  Commit Queue  <commit-queue@webkit.org>
3000
3001         Unreviewed, rolling out r164929 and r164934.
3002         http://trac.webkit.org/changeset/164929
3003         http://trac.webkit.org/changeset/164934
3004         https://bugs.webkit.org/show_bug.cgi?id=129570
3005
3006         Caused assertions on two srcset tests (Requested by ap on
3007         #webkit).
3008
3009         * html/parser/HTMLParserIdioms.cpp:
3010         (WebCore::isHTMLSpaceOrComma):
3011         (WebCore::parseImagesWithScaleFromSrcsetAttribute):
3012         (WebCore::bestFitSourceForImageAttributes):
3013
3014 2014-03-01  Dan Bernstein  <mitz@apple.com>
3015
3016         Build fix.
3017
3018         * html/parser/HTMLParserIdioms.cpp: Removed an unused function.
3019
3020 2014-03-01  David Kilzer  <ddkilzer@apple.com>
3021
3022         Ensure keySplines is valid in SMIL animations
3023         <http://webkit.org/b/129547>
3024         <rdar://problem/15676128>
3025
3026         Reviewed by Darin Adler.
3027
3028         Merged from Blink (patch by Philip Rogers):
3029         https://src.chromium.org/viewvc/blink?revision=156452&view=revision
3030         http://crbug.com/276111
3031
3032             This patch fixes a crash in SMIL animations when keySplines are not
3033             specified. The SMIL spec is clear on this:
3034             http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncCalcMode
3035             "If there are any errors in the keyTimes specification (bad values,
3036             too many or too few values), the animation will have no effect."
3037
3038             This patch simply checks that keyTimes is not empty. Previously,
3039             splinesCount was set to be m_keySplines.size() + 1 in
3040             SVGAnimationElement.cpp; this patch changes splinesCount to be equal
3041             to m_keySplines.size() to make the logic easier to follow and to
3042             match other checks in SVGAnimationElement::startedActiveInterval.
3043
3044         Test: svg/animations/animate-keysplines-crash.html
3045
3046         * svg/SVGAnimationElement.cpp:
3047         (WebCore::SVGAnimationElement::startedActiveInterval):
3048
3049 2014-03-01  Benjamin Poulain  <benjamin@webkit.org>
3050
3051         Tighten minimumRegisterRequirements()
3052         https://bugs.webkit.org/show_bug.cgi?id=129538
3053
3054         Reviewed by Andreas Kling.
3055
3056         Fix small things that made minimumRegisterRequirements() a little optimistic
3057         when dealing with attributes.
3058
3059         Test: fast/selectors/adjacent-descendant-tail-register-requirement.html
3060
3061         * cssjit/SelectorCompiler.cpp:
3062         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
3063         Attribute Set does not do value matching, the case sensitive value matching is irrelevant
3064         The problem is that flag is also used by minimumRegisterRequirements()
3065         to find if one more register is needed.
3066
3067         Set the flag to case sensitive to avoid reserving one extra register.
3068
3069         (WebCore::SelectorCompiler::minimumRegisterRequirements):
3070         Use a new backtrackingFlag to know if there is a descendant tail, thus a backtracking register
3071         reserved.
3072         This is better than using the backtracking action because the backtracking chain could be
3073         an adjacent chain inside a descendant chain.
3074
3075         The flags are designed for that, just set one for minimumRegisterRequirements().
3076
3077         The 2 extra registers for the attribute count and address become limited to all attributes
3078         except the last one. We don't keep a copy for the last matching, those registers were not needed.
3079
3080         (WebCore::SelectorCompiler::SelectorCodeGenerator::computeBacktrackingInformation):
3081
3082 2014-03-01  Pratik Solanki  <psolanki@apple.com>
3083
3084         [iOS] selectionImageForcingBlackText should return autoreleased object
3085         https://bugs.webkit.org/show_bug.cgi?id=129437
3086         <rdar://problem/15810384>
3087
3088         Reviewed by Darin Adler.
3089
3090         * bindings/objc/DOM.mm:
3091         (-[DOMRange renderedImageForcingBlackText:renderedImageForcingBlackText:]):
3092
3093 2014-03-01  Yoav Weiss  <yoav@yoav.ws>
3094
3095         Fix srcset related bugs
3096         https://bugs.webkit.org/show_bug.cgi?id=129539
3097
3098         Fixed a bug reported against Blink's srcset implementation at https://code.google.com/p/chromium/issues/detail?id=347998
3099         When both src and srcset had only 1x descriptors and the DPR was higher than 1, the src's resource was picked.
3100
3101         Also fixed the invalid descriptor handling, which wasn't aligned with the spec, and therefore was not as forward compatible as it should be.
3102         Invalid descriptors caused the entire resource to be ignored, rather than just the descriptors themselves.
3103
3104         Reviewed by Andreas Kling.
3105
3106         Tests: fast/hidpi/image-srcset-invalid-descriptor.html
3107                fast/hidpi/image-srcset-src-selection-1x-both.html
3108
3109         * html/parser/HTMLParserIdioms.cpp:
3110         (WebCore::parseDescriptors):
3111         (WebCore::parseImagesWithScaleFromSrcsetAttribute):
3112         (WebCore::bestFitSourceForImageAttributes):
3113
3114 2014-03-01  Darin Adler  <darin@apple.com>
3115
3116         Improve "bad parent" and "bad child list" assertions in line boxes
3117         https://bugs.webkit.org/show_bug.cgi?id=125656
3118
3119         Reviewed by Sam Weinig.
3120
3121         My previous fix for this problem was incomplete. This continuation of that fix addresses
3122         the flaw in the original and adds additional lifetime checking so problems can be seen in
3123         debug builds without a memory debugger.
3124
3125         * rendering/InlineBox.cpp:
3126         (WebCore::InlineBox::assertNotDeleted): Added. Poor man's memory debugging helper.
3127         (WebCore::InlineBox::~InlineBox): Refactored body into a new function named
3128         invalidateParentChildList. Added code to update the deletion sentinel to record
3129         that this object is deleted.
3130         (WebCore::InlineBox::setHasBadParent): Moved here from header since this debug-only
3131         feature does not need to be inlined. Added a call to assertNotDeleted.
3132         (WebCore::InlineBox::invalidateParentChildList): Added. Refactored from the destructor,
3133         this is used by RenderTextLineBoxes.
3134
3135         * rendering/InlineBox.h: Added the deletion sentinel, and called it in the parent
3136         function. Also changed the expansion/setExpansion functions to use the type name "int",
3137         since we don't use the type name "signed" in the WebKit coding style.
3138
3139         * rendering/InlineFlowBox.cpp:
3140         (WebCore::InlineFlowBox::~InlineFlowBox): Call setHasBadChildList rather than doing the
3141         setHasBadParent work on children directly, to avoid code duplication.
3142         (WebCore::InlineFlowBox::setHasBadChildList): Moved here from header. Added code to set
3143         "has bad parent" on all children, something we previously did only on destruction. Also
3144         added assertNotDeleted.
3145         (WebCore::InlineFlowBox::checkConsistency): Added call to assertNotDeleted. Also tweaked
3146         code style and variable names a little bit.
3147
3148         * rendering/InlineFlowBox.h: Moved setHasBadChildList out of the header when it's on.
3149         The empty version for ASSERT_WITH_SECURITY_IMPLICATION_DISABLED is still in the header.
3150
3151         * rendering/RenderTextLineBoxes.cpp:
3152         (WebCore::RenderTextLineBoxes::invalidateParentChildLists): Call the new
3153         InlineBox::invalidateParentChildList function instead of calling setHasBadChildList directly.
3154         The new function checks m_hasBadParent, something we couldn't do here.
3155
3156 2014-03-01  Benjamin Poulain  <benjamin@webkit.org>
3157
3158         Optimized querySelector(All) when selector contains #id
3159         https://bugs.webkit.org/show_bug.cgi?id=116502
3160
3161         Reviewed by Andreas Kling.
3162
3163         Test: fast/selectors/querySelector-id-filtering.html
3164
3165         The idea of this patch is to perform querySelector on a subtree
3166         rooted at the last element with #id matching. For example, if we have the selector
3167         "#foobar div a", we start by looking for the element with ID foobar in the TreeScope
3168         cache, and start matching the children from there.
3169
3170         The idea comes from Rune for
3171         https://chromium.googlesource.com/chromium/blink/+/1cd83d3588973a02ab15d94b1b05a28620853624
3172         but the code as diverged too much so it had to be reimplemented specifically for WebKit.
3173
3174         * css/CSSSelectorList.cpp:
3175         (WebCore::CSSSelectorList::CSSSelectorList):
3176         (WebCore::CSSSelectorList::operator=):
3177         * css/CSSSelectorList.h:
3178         (WebCore::CSSSelectorList::~CSSSelectorList):
3179         * css/StyleRule.h:
3180         (WebCore::StyleRule::wrapperAdoptSelectorList):
3181         (WebCore::StyleRulePage::wrapperAdoptSelectorList):
3182         * dom/SelectorQuery.cpp:
3183         (WebCore::isSingleTagNameSelector):
3184         (WebCore::isSingleClassNameSelector):
3185         (WebCore::findIdMatchingType):
3186         (WebCore::SelectorDataList::SelectorDataList):
3187         (WebCore::filterRootById):
3188         (WebCore::SelectorDataList::executeCompiledSimpleSelectorChecker):
3189         (WebCore::SelectorDataList::execute):
3190         (WebCore::SelectorQuery::SelectorQuery):
3191         (WebCore::SelectorQueryCache::add):
3192         * dom/SelectorQuery.h:
3193         (WebCore::SelectorDataList::SelectorData::SelectorData):
3194
3195 2014-02-28  Alexey Proskuryakov  <ap@apple.com>
3196
3197         Node::compareDocumentPosition leaks memory structure
3198         https://bugs.webkit.org/show_bug.cgi?id=120244
3199
3200         Reviewed by Ryosuke Niwa.
3201
3202         * dom/Node.cpp: (WebCore::Node::compareDocumentPosition): Don't do it.
3203
3204 2014-03-01  David Kilzer  <ddkilzer@apple.com>
3205
3206         Fix lifetime handling of SVGPropertyTearOffs
3207         <http://webkit.org/b/129211>
3208         <rdar://problem/15696025>
3209
3210         Reviewed by Maciej Stachowiak.
3211
3212         Merged from Blink (patch by Ojan Vafai):
3213         https://src.chromium.org/viewvc/blink?revision=157801&view=revision
3214         http://crbug.com/288771
3215
3216             -Replace SVGStaticPropertyWithParentTearOff with SVGMatrixTearOff
3217             since it's only used in that one place. This means we can get rid
3218             of the templatizing and the method pointer.
3219             -Change SVGPropertyTearOff to keep track of it's child tearoffs
3220             and call detachWrapper on its child tearoffs when it's destroyed
3221             or when it's wrapper is detached.
3222             -Have SVGPropertyTearOff hold WeakPtrs to the child tearoffs
3223             to avoid having a cycle.
3224
3225         Test: svg/transforms/svg-matrix-tearoff-crash.html
3226
3227         * GNUmakefile.list.am:
3228         * WebCore.vcxproj/WebCore.vcxproj:
3229         * WebCore.vcxproj/WebCore.vcxproj.filters:
3230         * WebCore.xcodeproj/project.pbxproj:
3231         * bindings/scripts/CodeGeneratorJS.pm:
3232         (NativeToJSValue):
3233         * svg/properties/SVGMatrixTearOff.h: Renamed from Source/WebCore/svg/properties/SVGStaticPropertyWithParentTearOff.h.
3234         (WebCore::SVGMatrixTearOff::create):
3235         (WebCore::SVGMatrixTearOff::commitChange):
3236         (WebCore::SVGMatrixTearOff::SVGMatrixTearOff):
3237         * svg/properties/SVGPropertyTearOff.h:
3238         (WebCore::SVGPropertyTearOff::addChild):
3239         (WebCore::SVGPropertyTearOff::detachChildren):
3240
3241 2014-03-01  Zan Dobersek  <zdobersek@igalia.com>
3242
3243         Unreviewed build fix after r164913.
3244
3245         * platform/CountedUserActivity.h: Some ports don't (yet) support forwarding headers for WebCore,
3246         so UserActivity.h should be included as non-forwarding.
3247
3248 2014-03-01  Gavin Barraclough  <barraclough@apple.com>
3249
3250         Change PageActivityAssertionToken to use a WeakPtr
3251         https://bugs.webkit.org/show_bug.cgi?id=129526
3252
3253         Reviewed by Sam Weinig.
3254
3255         PageThrottler effectively implements a bespoke weak pointer mechanism; remove this & just use WeakPtr.
3256
3257         * page/PageActivityAssertionToken.cpp:
3258         (WebCore::PageActivityAssertionToken::PageActivityAssertionToken):
3259         (WebCore::PageActivityAssertionToken::~PageActivityAssertionToken):
3260             - addActivityToken->incrementActivityCount, removeActivityToken->decrementActivityCount
3261         * page/PageActivityAssertionToken.h:
3262             - removed invalidate, made m_throttler a WeakPtr
3263         * page/PageThrottler.cpp:
3264         (WebCore::PageThrottler::PageThrottler):
3265             - initialize m_weakPtrFactory, m_activityCount.
3266         (WebCore::PageThrottler::~PageThrottler):
3267             - removed called to invalidate.
3268         (WebCore::PageThrottler::startThrottleHysteresisTimer):
3269             - m_activityTokens.size()->m_activityCount
3270         (WebCore::PageThrottler::throttleHysteresisTimerFired):
3271             - m_activityTokens.size()->m_activityCount
3272         (WebCore::PageThrottler::incrementActivityCount):
3273             - m_activityTokens.add->++
3274         (WebCore::PageThrottler::decrementActivityCount):
3275             - m_activityTokens.remove->--
3276         * page/PageThrottler.h:
3277         (WebCore::PageThrottler::weakPtr):
3278             - replaced HashSet with WeakPtrFactory & count.
3279
3280 2014-03-01  Gavin Barraclough  <barraclough@apple.com>
3281
3282         Split UserActivity/CountedUserActivity
3283         https://bugs.webkit.org/show_bug.cgi?id=129520
3284
3285         Reviewed by Sam Weinig.
3286
3287         UserActivity currently provides an interface allowing counted, nested calls to enable/disable.
3288         In some cases it would be easier to use if it were a simpler boolean enabled/disabled interface.
3289
3290         * WebCore.exp.in:
3291             - beginActivity->start, endActivity->stop.
3292         * WebCore.xcodeproj/project.pbxproj:
3293         * page/PageThrottler.cpp:
3294         (WebCore::PageThrottler::PageThrottler):
3295         (WebCore::PageThrottler::~PageThrottler):
3296         (WebCore::PageThrottler::throttlePage):
3297         (WebCore::PageThrottler::unthrottlePage):
3298         (WebCore::PageThrottler::setIsVisuallyIdle):
3299             - beginActivity->increment, endActivity->decrement.
3300         * page/PageThrottler.h:
3301             - UserActivity->CountedUserActivity for m_pageActivity
3302         * platform/CountedUserActivity.h: Copied from Source/WebCore/platform/UserActivity.h.
3303         (WebCore::CountedUserActivity::CountedUserActivity):
3304         (WebCore::CountedUserActivity::increment):
3305         (WebCore::CountedUserActivity::decrement):
3306             - Added, provides counted interface to UserActivity.
3307         * platform/UserActivity.cpp:
3308         (WebCore::UserActivity::UserActivity):
3309             - m_count removed
3310         (WebCore::UserActivity::start):
3311         (WebCore::UserActivity::stop):
3312             - beginActivity->start, endActivity->stop, implentation now empty.
3313         * platform/UserActivity.h:
3314             - beginActivity->start, endActivity->stop, m_count moved to HAVE(NS_ACTIVITY)
3315         * platform/mac/UserActivityMac.mm:
3316         (WebCore::UserActivity::UserActivity):
3317             - m_count->m_started
3318         (WebCore::UserActivity::isValid):
3319             - m_count->m_started
3320         (WebCore::UserActivity::start):
3321         (WebCore::UserActivity::stop):
3322             - beginActivity->start, endActivity->stop, no longer nest
3323
3324
3325 2014-02-28  Benjamin Poulain  <benjamin@webkit.org>
3326
3327         Caller saved registers can be accidentally discarded when clearing the local stack
3328         https://bugs.webkit.org/show_bug.cgi?id=129532
3329
3330         Reviewed by Andreas Kling.
3331
3332         Tests: fast/selectors/tree-modifying-case-insensitive-selectors.html
3333                fast/selectors/tree-modifying-selectors.html
3334
3335         StackAllocator::discard() no longer make sense now that we can use caller saved regsiter.
3336         We should instead discard everything up to the beginning of the local stack.
3337
3338         * cssjit/SelectorCompiler.cpp:
3339         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
3340         * cssjit/StackAllocator.h:
3341         (WebCore::StackAllocator::popAndDiscardUpTo):
3342
3343 2014-02-28  Andy Estes  <aestes@apple.com>
3344
3345         [iOS] FrameLoader has a NULL m_progressTracker when initialized with initForSynthesizedDocument()
3346         https://bugs.webkit.org/show_bug.cgi?id=129534
3347
3348         Reviewed by Simon Fraser.
3349
3350         No new tests because TestWebKitAPI does not yet support iOS. See <http://webkit.org/b/129535>.
3351
3352         * loader/FrameLoader.cpp:
3353         (WebCore::FrameLoader::initForSynthesizedDocument): Create a FrameProgressTracker.
3354
3355 2014-02-28  Sam Weinig  <sam@webkit.org>
3356
3357         ASSERT(isMainThread()) hit under platformUserPreferredLanguages() with WebKit1 and WebKit2 in the same process
3358         https://bugs.webkit.org/show_bug.cgi?id=129528
3359
3360         Reviewed by Andreas Kling.
3361
3362         * platform/mac/Language.mm:
3363         (WebCore::preferredLanguagesMutex):
3364         (WebCore::preferredLanguages):
3365         (+[WebLanguageChangeObserver languagePreferencesDidChange:]):
3366         (WebCore::httpStyleLanguageCode):
3367         (WebCore::platformUserPreferredLanguages):
3368         Add a mutex and do an isolated copy of the strings to allow this function to be called from multiple threads.
3369
3370 2014-02-28  Dean Jackson  <dino@apple.com>
3371
3372         Crash at ebay.com when viewing auction items at com.apple.WebCore: WebCore::GraphicsContext3D::getExtensions + 10
3373         https://bugs.webkit.org/show_bug.cgi?id=129523
3374
3375         Reviewed by Simon Fraser.
3376
3377         * html/canvas/WebGLRenderingContext.cpp:
3378         (WebCore::WebGLRenderingContext::getSupportedExtensions): Early return if the
3379         context is pending policy resolution.
3380
3381 2014-02-28  Andreas Kling  <akling@apple.com>
3382
3383         Micro-optimize JSNodeOwner::isReachableFromOpaqueRoots().
3384         <https://webkit.org/b/129518>
3385
3386         Only do image and audio element specific checks for element nodes.
3387         Time spent in here goes from 0.8% to 0.5% on DYEB.
3388
3389         Reviewed by Benjamin Poulain.
3390
3391         * bindings/js/JSNodeCustom.cpp:
3392         (WebCore::isReachableFromDOM):
3393
3394 2014-02-28  Geoffrey Garen  <ggaren@apple.com>
3395
3396         JSC Assertion failure every time I start Safari (r164846)
3397         https://bugs.webkit.org/show_bug.cgi?id=129510
3398
3399         Reviewed by Mark Hahnenberg.
3400
3401         Take the lock before allocating objects because afterward is too late.
3402
3403         * bindings/js/ScriptController.cpp:
3404         (WebCore::ScriptController::evaluateInWorld):
3405         (WebCore::ScriptController::windowScriptNPObject):
3406         (WebCore::ScriptController::jsObjectForPluginElement):
3407
3408 2014-02-28  Joseph Pecoraro  <pecoraro@apple.com>
3409
3410         Web Inspector: ASSERT in WebCore::JSDOMWindowBase::supportsRichSourceInfo inspecting iOS
3411         https://bugs.webkit.org/show_bug.cgi?id=129512
3412
3413         Reviewed by Simon Fraser.
3414
3415         * page/PageDebuggable.cpp:
3416         (WebCore::PageDebuggable::connect):
3417         (WebCore::PageDebuggable::disconnect):
3418
3419 2014-02-28  Anders Carlsson  <andersca@apple.com>
3420
3421         VisitedLinkStore should be able to invalidate link styles for associated pages
3422         https://bugs.webkit.org/show_bug.cgi?id=129515
3423
3424         Reviewed by Dan Bernstein.
3425
3426         * page/Page.cpp:
3427         (WebCore::Page::Page):
3428         Add the VisitedLinkStore if we have one.
3429
3430         (WebCore::Page::~Page):
3431         Remove the VisitedLinkStore if we have one.
3432
3433         * page/VisitedLinkStore.cpp:
3434         (WebCore::VisitedLinkStore::~VisitedLinkStore):
3435         Assert that we don't have any pages.
3436
3437         (WebCore::VisitedLinkStore::addPage):
3438         Add the page to the set.
3439
3440         (WebCore::VisitedLinkStore::removePage):
3441         Remove the page from the set.
3442
3443         (WebCore::VisitedLinkStore::invalidateStylesForAllLinks):
3444         Traverse all the pages and invalidate the style for all links.
3445
3446         (WebCore::VisitedLinkStore::invalidateStylesForLink):
3447         Traverse all the pages and invalidate the style for a given link.
3448
3449         * page/VisitedLinkStore.h:
3450         Add new members.
3451
3452 2014-02-28  Benjamin Poulain  <bpoulain@apple.com>
3453
3454         [iOS][WK2] highlight rects should never big bigger than the