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