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