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