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