[Cocoa] System fonts do not get correct tracking
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-04-07  Myles C. Maxfield  <mmaxfield@apple.com>
2
3         [Cocoa] System fonts do not get correct tracking
4         https://bugs.webkit.org/show_bug.cgi?id=143395
5
6         Reviewed by Ryosuke Niwa.
7
8         Inside FontPlatformData, we have two CTFonts. If the user has specified
9         -webkit-system-font, we will pass in a CTFont, and the FontPlatformData
10         will wrap it. However, we will then roundtrip through CGFont in order
11         to create a second CTFont. We were basing our tracking and system
12         font knowledge off of this round-tripped font instead of the original font.
13
14         Note that this design is terrible and needs to be overhauled.
15         FontPlatformData should only have a single platform font inside it.
16
17         This patch also caches whether or not a font is a system font.
18
19         No new tests because it is impossible to test the tracking of the
20         system font in a robust way.
21
22         * platform/graphics/Font.cpp:
23         (WebCore::Font::Font): Rearrange member variables.
24         * platform/graphics/Font.h: Move member variables around for better
25         packing, and cache whether or not the font is a system font.
26         * platform/graphics/FontData.h: Add comment
27         * platform/graphics/cocoa/FontCocoa.mm:
28         (WebCore::Font::platformInit): Cache whether or not the font is a system
29         font.
30         (WebCore::hasCustomTracking): Use cached value.
31         (WebCore::canUseFastGlyphAdvanceGetter):
32         (WebCore::Font::platformWidthForGlyph):
33
34 2015-04-07  Alex Christensen  <achristensen@webkit.org>
35
36         Block popups from content extensions.
37         https://bugs.webkit.org/show_bug.cgi?id=143497
38
39         Reviewed by Brady Eidson.
40
41         Test: http/tests/contentextensions/popups.html
42
43         * loader/ResourceLoadInfo.cpp:
44         (WebCore::readResourceType):
45         * loader/ResourceLoadInfo.h:
46         * page/DOMWindow.cpp:
47         (WebCore::DOMWindow::open):
48         * page/UserContentController.cpp:
49         (WebCore::UserContentController::actionsForResourceLoad):
50         * page/UserContentController.h:
51         Check content extensions before opening a window.
52
53 2015-04-07  Benjamin Poulain  <benjamin@webkit.org>
54
55         Get the features.json files ready for open contributions
56         https://bugs.webkit.org/show_bug.cgi?id=143436
57
58         Reviewed by Darin Adler.
59
60         * features.json:
61
62 2015-04-07  Alex Christensen  <achristensen@webkit.org>
63
64         More unreviewed fixing API tests.
65
66         * contentextensions/ContentExtensionsBackend.cpp:
67         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
68         Don't check for javascript protocol.
69
70 2015-04-07  Eric Carlson  <eric.carlson@apple.com>
71
72         [Mac] never update caption user style sheet during parsing
73         https://bugs.webkit.org/show_bug.cgi?id=143499
74
75         Reviewed by Jer Noble.
76
77         * page/CaptionUserPreferencesMediaAF.cpp:
78         (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges):
79         (WebCore::CaptionUserPreferencesMediaAF::captionPreferencesChanged):  Ignore a
80             "preferences changed" notification fired while registering for said notification, we 
81             already create and insert the style sheet after a brief delay anyway.
82         * page/CaptionUserPreferencesMediaAF.h:
83
84 2015-04-07  Alex Christensen  <achristensen@webkit.org>
85
86         [Win] Unreviewed build fix after r182494.
87
88         * platform/win/ContextMenuItemWin.cpp:
89         (WebCore::ContextMenuItem::ContextMenuItem): Deleted.
90
91 2015-04-07  Alex Christensen  <achristensen@webkit.org>
92
93         Unreviewed fixing API tests.
94
95         * contentextensions/ContentExtensionsBackend.cpp:
96         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
97         * platform/URL.cpp:
98         (WebCore::URL::init):
99         * platform/URL.h:
100         (WebCore::URL::protocolIsData):
101         (WebCore::URL::protocolIsJavaScript): Deleted.
102         Revert part of r182492 that changed URL.h.
103
104 2015-04-07  Anders Carlsson  <andersca@apple.com>
105
106         More work on making the application cache storage be per page
107         https://bugs.webkit.org/show_bug.cgi?id=143498
108
109         Reviewed by Andreas Kling.
110
111         * loader/appcache/ApplicationCacheStorage.cpp:
112         (WebCore::ApplicationCacheStorage::create):
113         (WebCore::ApplicationCacheStorage::singleton):
114         * loader/appcache/ApplicationCacheStorage.h:
115         * page/Page.cpp:
116         (WebCore::Page::Page):
117         * page/Page.h:
118         (WebCore::Page::applicationCacheStorage):
119         * page/PageConfiguration.cpp:
120         (WebCore::PageConfiguration::PageConfiguration): Deleted.
121         * page/PageConfiguration.h:
122
123 2015-04-07  Matthew Mirman  <mmirman@apple.com>
124
125         Source and stack information should get appended only to native errors
126         and should be added directly after construction rather than when thrown.
127         This fixes frozen objects being unfrozen when thrown while conforming to 
128         ecma script standard and other browser behavior.
129         rdar://problem/19927293
130         https://bugs.webkit.org/show_bug.cgi?id=141871
131         
132         Reviewed by Geoffrey Garen.
133
134         Covered by existing tests.
135         
136         Sets line, column, source and stack information for DOMExceptions as 
137         expected by the webinspector for native errors.
138         
139         * bindings/js/JSDOMBinding.cpp:
140         (WebCore::setDOMException):
141
142 2015-04-07  Brady Eidson  <beidson@apple.com>
143
144         ContextMenuItem refactoring
145         https://bugs.webkit.org/show_bug.cgi?id=143485
146
147         Reviewed by Beth Dakin.
148
149         * platform/ContextMenuItem.h:
150         (WebCore::ContextMenuItem::isNull):
151
152         * platform/gtk/ContextMenuItemGtk.cpp:
153         (WebCore::ContextMenuItem::ContextMenuItem):
154
155         * platform/mac/ContextMenuItemMac.mm:
156         (WebCore::ContextMenuItem::ContextMenuItem):
157         (WebCore::ContextMenuItem::platformDescription):
158         (WebCore::ContextMenuItem::setSubMenu):
159         (WebCore::ContextMenuItem::releasePlatformDescription): Deleted.
160         (WebCore::ContextMenuItem::getPlatformDescription): Deleted.
161
162         * platform/mac/ContextMenuMac.mm:
163         (WebCore::ContextMenu::appendItem):
164         (WebCore::ContextMenu::insertItem):
165         (WebCore::platformMenuDescription):
166
167         * platform/win/ContextMenuItemWin.cpp:
168         (WebCore::ContextMenuItem::ContextMenuItem):
169
170 2015-04-07  Alex Christensen  <achristensen@webkit.org>
171
172         Optimize content extensions interpreting speed.
173         https://bugs.webkit.org/show_bug.cgi?id=143490
174
175         Reviewed by Brady Eidson.
176
177         * contentextensions/ContentExtensionCompiler.cpp:
178         (WebCore::ContentExtensions::compileRuleList):
179         * contentextensions/ContentExtensionsBackend.cpp:
180         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
181         Measure total time added by content extensions.
182         * contentextensions/DFABytecodeCompiler.cpp:
183         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
184         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
185         When jumping to the root, don't re-add all the actions.
186         * contentextensions/DFABytecodeCompiler.h:
187         * platform/URL.cpp:
188         (WebCore::URL::init):
189         * platform/URL.h:
190         (WebCore::URL::protocolIsJavaScript): Added.
191
192 2015-04-07  Simon Fraser  <simon.fraser@apple.com>
193
194         Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
195         https://bugs.webkit.org/show_bug.cgi?id=143495
196
197         Reviewed by Tim Horton.
198
199         Add a new Setting, antialiasedFontDilationEnabled, which defaults to true. This 
200         will be used in an upcoming patch.
201
202         * page/Settings.in:
203
204 2015-04-07  Andy Estes  <aestes@apple.com>
205
206         [Content Filtering] Add logging
207         https://bugs.webkit.org/show_bug.cgi?id=143470
208
209         Reviewed by Daniel Bates.
210
211         Added a new ContentFiltering logging channel, and started logging some useful diagnostic messages.
212
213         * loader/ContentFilter.cpp:
214         (WebCore::ContentFilter::~ContentFilter):
215         (WebCore::ContentFilter::willSendRequest):
216         (WebCore::ContentFilter::startFilteringMainResource):
217         (WebCore::ContentFilter::responseReceived):
218         (WebCore::ContentFilter::dataReceived):
219         (WebCore::ContentFilter::notifyFinished):
220         (WebCore::ContentFilter::didDecide):
221         * platform/Logging.h:
222         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
223         (WebCore::ContentFilterUnblockHandler::canHandleRequest):
224         (WebCore::ContentFilterUnblockHandler::requestUnblockAsync):
225         * platform/cocoa/NetworkExtensionContentFilter.mm:
226         (WebCore::NetworkExtensionContentFilter::enabled):
227         (WebCore::NetworkExtensionContentFilter::unblockHandler):
228         (WebCore::NetworkExtensionContentFilter::handleDecision):
229         * platform/cocoa/ParentalControlsContentFilter.mm:
230         (WebCore::ParentalControlsContentFilter::enabled):
231         (WebCore::ParentalControlsContentFilter::updateFilterState):
232         * testing/MockContentFilter.cpp:
233         (WebCore::MockContentFilter::enabled):
234         (WebCore::MockContentFilter::unblockHandler):
235         (WebCore::MockContentFilter::maybeDetermineStatus):
236
237 2015-04-07  Eric Carlson  <eric.carlson@apple.com>
238
239         [Mac] video playing to external device should not be interrupted
240         https://bugs.webkit.org/show_bug.cgi?id=143492
241
242         Reviewed by Jer Noble.
243
244         * Modules/mediacontrols/mediaControlsApple.js:
245         (Controller.prototype.handlePanelTransitionEnd):  Drive-by fix to make sure the controls are 
246             not hidden if the opacity timer is primed before they go into a state where they should
247             never be hidden.
248
249         * html/HTMLMediaElement.cpp:
250         (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget): Make it const.
251         (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget): New.
252         * html/HTMLMediaElement.h:
253
254         * html/HTMLMediaSession.cpp:
255         (WebCore::HTMLMediaSession::canPlayToWirelessPlaybackTarget): New. Short-circuit call to
256             client when we already know the answer.
257         (WebCore::HTMLMediaSession::isPlayingToWirelessPlaybackTarget): Ditto.
258         (WebCore::HTMLMediaSession::startPlayingToPlaybackTarget): Ditto.
259         (WebCore::HTMLMediaSession::stopPlayingToPlaybackTarget): Ditto.
260         * html/HTMLMediaSession.h:
261
262         * platform/audio/MediaSession.cpp:
263         (WebCore::MediaSession::canPlayToWirelessPlaybackTarget): Deleted, moved inline and neutered
264             because only HTMLMediaSession needs to use them.
265         (WebCore::MediaSession::startPlayingToPlaybackTarget): Ditto.
266         (WebCore::MediaSession::stopPlayingToPlaybackTarget): Ditto.
267         * platform/audio/MediaSession.h:
268         (WebCore::MediaSession::canPlayToWirelessPlaybackTarget):
269         (WebCore::MediaSession::isPlayingToWirelessPlaybackTarget):
270         (WebCore::MediaSession::startPlayingToPlaybackTarget):
271         (WebCore::MediaSession::stopPlayingToPlaybackTarget):
272         (WebCore::MediaSessionClient::canPlayToWirelessPlaybackTarget):
273         (WebCore::MediaSessionClient::isPlayingToWirelessPlaybackTarget):
274
275         * platform/audio/MediaSessionManager.cpp:
276         (WebCore::MediaSessionManager::MediaSessionManager):
277         (WebCore::MediaSessionManager::sessionShouldBeginPlayingToWirelessPlaybackTarget): New.
278         (WebCore::MediaSessionManager::sessionWillBeginPlayback): Don't interrupt an active session
279             playing to a target device.
280         * platform/audio/MediaSessionManager.h:
281
282         * platform/graphics/MediaPlayer.cpp:
283         (WebCore::MediaPlayer::isPlayingToWirelessPlaybackTarget): New, passthrough.
284         * platform/graphics/MediaPlayer.h:
285         * platform/graphics/MediaPlayerPrivate.h:
286         (WebCore::MediaPlayerPrivateInterface::isPlayingToWirelessPlaybackTarget):
287
288         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
289         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget):
290         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
291         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Explicitly call 
292             when passed a nil or inactive target context.
293         (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): Add logging.
294         (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): Ditto.
295         (WebCore::MediaPlayerPrivateAVFoundationObjC::isPlayingToWirelessPlaybackTarget): New. Return
296             true when playing with an active context.
297         (WebCore::playerKVOProperties): "outputContext" is not observable.
298
299 2015-04-07  Sam Weinig  <sam@webkit.org>
300
301         Re-add JSReadableStream and JSReadableStreamReader the Xcode project to
302         make Xcode happy.
303
304         * WebCore.xcodeproj/project.pbxproj:
305
306 2015-02-25  Sergio Villar Senin  <svillar@igalia.com>
307
308         [CSS Grid Layout] Update track sizes after distributing extra space
309         https://bugs.webkit.org/show_bug.cgi?id=141422
310
311         Reviewed by Antti Koivisto.
312
313         Both old and new tracks sizing algorithms instruct us to update
314         the sizes of the content sized tracks only after distributing the
315         extra space for all the items in the same span group. So far we
316         were doing it inside distributeSpaceToTracks(), i.e., once for
317         every single item. That is wrong because it makes the algorithm
318         order dependent.
319
320         Our old implementation looked something like this (pseudocode):
321
322         resolveContentBasedTrackSizingFunctions()
323           foreach item
324             resolveContentBasedTrackSizingFunctionsForItems() (x4)
325               distributeSpaceToTracks()
326                 updateTrackSizes()
327
328         Now it's done this way (pseudocode):
329
330         resolveContentBasedTrackSizingFunctions()
331           foreach spanGroup
332             resolveContentBasedTrackSizingFunctionsForItems() (x4)
333               foreach item in spanGroup
334                 distributeSpaceToTracks()
335               updateTrackSizes()
336
337         As it can be seen the update of track sizes only happens after
338         processing all the items of a given span group. In order to
339         accomplish this a new field was added to GridTrack called
340         tempIncrease which stores per-track increases while distributing
341         the extra space among the items in the same span group. That
342         temporal increase could eventually be used to update the
343         plannedIncrease which is the one we use to finally set the new
344         size of the track.
345
346         This change makes our implementation closer to the spec, removes
347         the order dependency and ensures that every track satisfies their
348         min track sizing functions before starting to consider the max
349         track sizing functions.
350
351         Test: fast/css-grid-layout/grid-update-sizes-after-distributing-all.html
352
353         * rendering/RenderGrid.cpp:
354         (WebCore::GridTrack::plannedSize):
355         (WebCore::GridTrack::setPlannedSize): New setter.
356         (WebCore::GridTrack::tempSize): New attribute.
357         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
358         RenderGrid::distributeSpaceToTracks() no longer updates the track
359         sizes so we have to do it after the call returns.
360         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
361         Call RenderGrid::resolveContentBasedTrackSizingFunctionsForItems()
362         passing a span group instead of a single item.
363         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
364         It now receives a span group instead of a single item. Apart from
365         that we need an extra function to get the unaltered track size (as
366         the current one returns the base size whenever the growth limit is
367         infinity).
368         (WebCore::RenderGrid::distributeSpaceToTracks): This no longer
369         updates track sizes but only the track's planned size;
370         * rendering/RenderGrid.h:
371
372 2015-04-06  Chris Dumez  <cdumez@apple.com>
373
374         Bing video search result pages are not PageCacheable
375         https://bugs.webkit.org/show_bug.cgi?id=143463
376         <rdar://problem/20440916>
377
378         Reviewed by Alexey Proskuryakov.
379
380         Bing video search result pages are not PageCacheable (tested on iOS).
381         It both:
382         - is bad for power usage as it causes a reload when clicking one of the
383           results then navigating back in history.
384         - degrades user experience because the results page uses infinite
385           scrolling and the scroll position is not properly restored when
386           navigating back, not to mention the user has to wait for the reload
387           to complete.
388
389         The issue was that the bing search page was doing a ping load when
390         clicking on one of the search results. The ping load was done by
391         create an image and its 'src' attribute to the ping URL. This load
392         usually did not have time to complete when navigating away so we would
393         cancel it and the main document would end up with an error that would
394         prevent the page from entering the page cache. We already have code
395         making sure load cancellations do not prevent page caching as long as
396         the loads are for XHR or images. However, the latter check was broken
397         in the case where the ResourceRequest's cachePartition was non-empty.
398         This is because the check was using the MemoryCache::ResourceForUrl()
399         API which rarely does what we want because it will request a dummy
400         ResourceRequest (without cachePartition) and then call
401         MemoryCache::resourceForRequest(). This patch updates the check
402         to use resourceForRequest() directly as we have the ResourceRequest
403         at this point.
404
405         This patch also gets rid of the  MemoryCache::ResourceForUrl() API as
406         it rarely does what we want and it is bug prone. It was only used in
407         2 places, one of them causing this bug and the other in Internals.
408
409         Tests: http/tests/navigation/page-cache-pending-image-load-cache-partition.html
410                http/tests/navigation/page-cache-pending-image-load.html
411
412         * loader/DocumentLoader.cpp:
413         (WebCore::areAllLoadersPageCacheAcceptable):
414         Use MemoryCache::resourceForRequest() instead of resourceForUrl() as
415         we have the ResourceRequest and calling resourceForUrl() would loose
416         the cachePartition.
417
418         * loader/cache/MemoryCache.cpp:
419         (WebCore::MemoryCache::resourceForURL): Deleted.
420         Drop this API as it is bug prone and rarely does what we want.
421
422         * testing/Internals.cpp:
423         (WebCore::Internals::isLoadingFromMemoryCache):
424         Update call to create a dummy ResourceRequest and call
425         resourceForRequest() instead of resourceForUrl(), as this API no
426         longer exists. The new code also set the cachePartition on the
427         dummy request so that this function actually behaves as expected
428         if the cachePartition in the memory cache is non-empty.
429
430
431 2015-04-06  Jer Noble  <jer.noble@apple.com>
432
433         Synchronize fullscreen animation between processes.
434         https://bugs.webkit.org/show_bug.cgi?id=143131
435
436         Reviewed by Simon Fraser.
437
438         Rather than attempt to synchcronize animations across the WebProcess / UIProcess boundary,
439         do the bounds-change animation in-process by applying a sublayer transformation to the
440         video layer. This gives the same visual effect as a synchronized bounds animation, but
441         without needing a synchronization fence. Resolve the difference between the transformation
442         and bounds by doing a fence-synchronized bounds change after the current animation is
443         scheduled to complete.
444
445         To do this calculation correctly, WebAVPlayer needs to query both the effective
446         videoLayerFrame and the videoLayerGravity. To that end, add getter methods for
447         videoLayerFrame() and videoLayerGravity().
448
449         * html/HTMLMediaElement.h:
450         (WebCore::HTMLMediaElement::videoFullscreenGravity):
451         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
452         (-[WebAVVideoLayer dealloc]): Cancel outstanding performSelector requests.
453         (-[WebAVVideoLayer setBounds:]): Add a scale transform to simulate a bonuds change.
454         (-[WebAVVideoLayer resolveBounds]): Reset the scale transform and set the bounds.
455         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Set the initial video frame bounds.
456         (-[WebAVPlayerController layoutSublayersOfLayer:]): Deleted.
457         * platform/ios/WebVideoFullscreenModel.h:
458         * platform/ios/WebVideoFullscreenModelVideoElement.h:
459         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
460         (WebVideoFullscreenModelVideoElement::videoLayerFrame): Added; simple getter.
461         (WebVideoFullscreenModelVideoElement::videoLayerGravity): Ditto.
462
463 2015-04-06  Zalan Bujtas  <zalan@apple.com>
464
465         Simple line layout: RunResolver::Iterator class cleanup.
466         https://bugs.webkit.org/show_bug.cgi?id=143445
467
468         Reviewed by Antti Koivisto.
469
470         1. SimpleLineLayout::Run is an intermediate structure and should not be publicly accessible through RunResolver::Iterator.
471         RunResolver::Run is the class to use to access run properties.
472         2. Also move advance()/advanceLine() to private. Callers should use LineResolver to advance on lines.
473
474         No change in functionality.
475
476         * rendering/SimpleLineLayoutResolver.h:
477
478 2015-04-06  Simon Fraser  <simon.fraser@apple.com>
479
480         Use a RenderObject bit for isRenderFlowThread()
481         https://bugs.webkit.org/show_bug.cgi?id=143439
482
483         Reviewed by Darin Adler.
484
485         Turning isRenderFlowThread() into a bit in rare data rather than a virtual function reduces
486         the time under RenderLayer::scrollTo() on a large overflow:scroll table from 56% to 44%.
487
488         * rendering/RenderFlowThread.cpp:
489         (WebCore::RenderFlowThread::RenderFlowThread):
490         * rendering/RenderFlowThread.h:
491         * rendering/RenderObject.cpp:
492         (WebCore::RenderObject::setIsRenderFlowThread):
493         * rendering/RenderObject.h:
494         (WebCore::RenderObject::isDragging):
495         (WebCore::RenderObject::hasReflection):
496         (WebCore::RenderObject::isRenderFlowThread):
497         (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
498
499 2015-04-06  Myles C. Maxfield  <mmaxfield@apple.com>
500
501         [Win] [SVG -> OTF Converter] Support the SVG -> OTF Font Converter
502         https://bugs.webkit.org/show_bug.cgi?id=143402
503
504         Reviewed by Darin Adler.
505
506         There are a few pieces to the converter that Windows requires that we haven't already
507         implemented:
508         1. Checksums were being calculated with the wrong endianness
509         2. Windows requires a format 4 'cmap' subtable in addition to the format 12 one we already
510         were using
511         3. Windows requires a reference to a Private DICT inside the CFF table, even if the DICT
512         is of 0 length.
513
514         Covered by all our existing SVG font tests.
515
516         * svg/SVGFontFaceElement.h: Add capHeight accessor.
517         * svg/SVGFontFaceElement.cpp:
518         (WebCore::SVGFontFaceElement::capHeight): Ditto.
519         * svg/SVGToOTFConversion.cpp: Update the conversion process according to the above
520         requirements.
521         (WebCore::SVGToOTFFontConverter::appendFormat12CMAPTable):
522         (WebCore::SVGToOTFFontConverter::appendFormat4CMAPTable):
523         (WebCore::SVGToOTFFontConverter::appendCMAPTable): Use helpers.
524         (WebCore::SVGToOTFFontConverter::appendHHEATable): Use member variables.
525         (WebCore::SVGToOTFFontConverter::appendOS2Table): Update to version 2.
526         (WebCore::SVGToOTFFontConverter::appendCFFTable): Create a reference to a
527         zero-sized Private DICT
528         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Populate member
529         variables.
530         (WebCore::SVGToOTFFontConverter::calculateChecksum): Flip endianness
531
532 2015-04-06  Yusuke Suzuki  <utatane.tea@gmail.com>
533
534         Return Optional<uint32_t> from PropertyName::asIndex
535         https://bugs.webkit.org/show_bug.cgi?id=143422
536
537         Reviewed by Darin Adler.
538
539         * bindings/js/JSDOMWindowCustom.cpp:
540         (WebCore::JSDOMWindow::getOwnPropertySlot):
541         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
542         * bindings/js/JSHTMLAllCollectionCustom.cpp:
543         (WebCore::callHTMLAllCollection):
544         (WebCore::JSHTMLAllCollection::item):
545         * bindings/scripts/CodeGeneratorJS.pm:
546         (GenerateGetOwnPropertySlotBody):
547         (GenerateImplementation):
548         * bindings/scripts/test/JS/JSFloat64Array.cpp:
549         (WebCore::JSFloat64Array::getOwnPropertySlot):
550         (WebCore::JSFloat64Array::getOwnPropertyDescriptor):
551         (WebCore::JSFloat64Array::put):
552         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
553         (WebCore::JSTestEventTarget::getOwnPropertySlot):
554         * bridge/runtime_array.cpp:
555         (JSC::RuntimeArray::getOwnPropertySlot):
556         (JSC::RuntimeArray::put):
557
558 2015-04-06  Žan Doberšek  <zdobersek@igalia.com>
559
560         FileList constructor should move the passed-in Vector<> rvalue reference into the member variable
561         https://bugs.webkit.org/show_bug.cgi?id=143412
562
563         Reviewed by Darin Adler.
564
565         * fileapi/FileList.h:
566         (WebCore::FileList::FileList): An explicit move of the passed-in rvalue
567         reference into the member variable is required, otherwise a copy is
568         performed since an rvalue reference is just an lvalue.
569
570 2015-04-06  Žan Doberšek  <zdobersek@igalia.com>
571
572         UserScript, UserStyleSheet constructors should take in Vector<String> rvalue references
573         https://bugs.webkit.org/show_bug.cgi?id=143411
574
575         Reviewed by Darin Adler.
576
577         Have the UserScript and UserStyleSheet constructors take in Vector<String>
578         rvalue references for the whitelist and blacklist parameters. Both classes
579         store these Vector<String> objects, so the referenced objects can simply be
580         moved into the member variable.
581
582         Because the constructor is now demanding an rvalue, it's up to the caller
583         to move in the desired object if possible, or create an explicit copy
584         otherwise.
585
586         * page/UserScript.h:
587         (WebCore::UserScript::UserScript):
588         * page/UserStyleSheet.h:
589         (WebCore::UserStyleSheet::UserStyleSheet):
590
591 2015-04-05  Andy Estes  <aestes@apple.com>
592
593         [Content Filtering] Only pass http(s) requests to -[NEFilterSource willSendRequest:...]
594         https://bugs.webkit.org/show_bug.cgi?id=143437
595
596         Reviewed by Dan Bernstein.
597
598         No new tests. We can't test NEFilterSource directly.
599
600         * platform/cocoa/NetworkExtensionContentFilter.mm:
601         (WebCore::NetworkExtensionContentFilter::willSendRequest): Immediately allow requests with url schemes other than http and https.
602
603 2015-04-05  Darin Adler  <darin@apple.com>
604
605         FrameView code uses page() without null checking
606         https://bugs.webkit.org/show_bug.cgi?id=143425
607         rdar://problem/18920601
608
609         Reviewed by Anders Carlsson.
610
611         While we don't have tests that cover this, we are seeing crashes coming in
612         that indicate the shouldEnableSpeculativeTilingDuringLoading function is
613         being called when the page is null. This patch adds null checks to all the
614         places in FrameView that use page() without doing null checking.
615
616         * page/FrameView.cpp:
617         (WebCore::FrameView::layout): If page is null, don't try to do the
618         auto-sizing logic that involves the textAutosizingWidth value from the page.
619         (WebCore::FrameView::setFixedVisibleContentRect): Get settings from the
620         frame rather than the page to avoid possible null-dereference.
621         (WebCore::FrameView::scrollPositionChanged): Check the page for null when
622         getting the event throttling delay.
623         (WebCore::FrameView::updateLayerFlushThrottling): Check the page for null,
624         and return early if it is null.
625         (WebCore::shouldEnableSpeculativeTilingDuringLoading): Check the page for
626         null, and return false if it is null.
627         (WebCore::FrameView::performPostLayoutTasks): Guard the code that calls
628         didLayout on the page client by a check if the page is null.
629         (WebCore::FrameView::pagination): Don't call Page::pagination on a null
630         page here.
631         (WebCore::FrameView::visibleContentScaleFactor): Use a scale factor of 1
632         if the page is null.
633         (WebCore::FrameView::setVisibleScrollerThumbRect): Don't call through to
634         the page client if the page is null.
635         (WebCore::FrameView::scrollbarStyleChanged): Ditto.
636         (WebCore::FrameView::setScrollPinningBehavior): Check the page for null
637         before asking it for the scrolling coordinator.
638
639 2015-04-05  Simon Fraser  <simon.fraser@apple.com>
640
641         Free up some bits in RenderObject by moving rarely used bits into a side table
642         https://bugs.webkit.org/show_bug.cgi?id=143432
643
644         Reviewed by Darin Adler.
645         
646         Add a side table (global hash) on RenderObject to store data that is rarely
647         used. Move the "isDragging" and "hasReflection" bits there. Re-use one of
648         those bits for "hasRareData", and leave the other unused (I have plans for it).
649         
650         * rendering/RenderBlock.cpp:
651         (WebCore::getBlockRareData): Renamed for consistency.
652         (WebCore::ensureBlockRareData): Renamed to avoid conflict with RenderObject::ensureRareData().
653         (WebCore::RenderBlock::cachedFlowThreadContainingBlock):
654         (WebCore::RenderBlock::cachedFlowThreadContainingBlockNeedsUpdate):
655         (WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate):
656         (WebCore::RenderBlock::updateCachedFlowThreadContainingBlock):
657         (WebCore::RenderBlock::locateFlowThreadContainingBlock):
658         (WebCore::RenderBlock::paginationStrut):
659         (WebCore::RenderBlock::pageLogicalOffset):
660         (WebCore::RenderBlock::setPaginationStrut):
661         (WebCore::RenderBlock::setPageLogicalOffset):
662         (WebCore::getRareData): Deleted.
663         (WebCore::ensureRareData): Deleted.
664         * rendering/RenderObject.cpp:
665         (WebCore::RenderObject::~RenderObject): Assert that rare data hasn't been resurrected
666         since willBeDestroyed().
667         (WebCore::RenderObject::willBeDestroyed): Clear the rare data.
668         (WebCore::RenderObject::setIsDragging): If setting, ensure that we have rare data and
669         set the bit. Otherwise, only clear the bit of we have rare data.
670         (WebCore::RenderObject::setHasReflection): Ditto.
671         (WebCore::RenderObject::rareDataMap):
672         (WebCore::RenderObject::rareData):
673         (WebCore::RenderObject::ensureRareData):
674         (WebCore::RenderObject::clearRareData):
675         * rendering/RenderObject.h:
676         (WebCore::RenderObject::isDragging): Fast-fail on the hasRareData() bit, then do the
677         slower lookup in rare data.
678         (WebCore::RenderObject::hasReflection): Ditto.
679         (WebCore::RenderObject::setEverHadLayout): Moved up to group with other bit setters.
680         (WebCore::RenderObject::hasRareData):
681         (WebCore::RenderObject::setHasRareData):
682         (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
683         (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
684         (WebCore::RenderObject::setHasReflection): Deleted. Out of line now.
685         (WebCore::RenderObject::setIsDragging): Deleted. Ditto.
686
687 2015-04-05  Darin Adler  <darin@apple.com>
688
689         REGRESSION (r181778): Crash after scrolling Google search result page
690         https://bugs.webkit.org/show_bug.cgi?id=143431
691
692         Reviewed by Simon Fraser.
693
694         I can't reproduce this crash, nor was I able to make a regression test,
695         but the crash data makes it clear this is a null dereference.
696
697         * page/animation/AnimationController.cpp:
698         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Check the result
699         of Frame::view for null. We know this is only called when there is a
700         valid FrameView, but it can be called after Frame::m_view is already null.
701
702 2015-04-05  Andy Estes  <aestes@apple.com>
703
704         [Content Filtering] Tell the filter about requests and redirects
705         https://bugs.webkit.org/show_bug.cgi?id=143414
706         rdar://problem/19239549
707
708         Reviewed by Darin Adler.
709
710         Tests: contentfiltering/allow-after-will-send-request.html
711                contentfiltering/block-after-will-send-request.html
712                http/tests/contentfiltering/allow-after-redirect.html
713                http/tests/contentfiltering/block-after-redirect.html
714
715         NEFilterSource supports making filter decisions based on NSURLRequests, so this patch adds support for telling
716         ContentFilter about the original main resource request as well as redirect requests.
717
718         * bindings/js/JSMockContentFilterSettingsCustom.cpp: Updated decisionPoint values to include AfterWillSendRequest and AfterRedirect.
719         (WebCore::JSMockContentFilterSettings::decisionPoint):
720         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
721         * loader/ContentFilter.cpp:
722         (WebCore::ContentFilter::willSendRequest): Called willSendRequest() on each filter using forEachContentFilterUntilBlocked().
723         (WebCore::ContentFilter::redirectReceived): Called willSendRequest().
724         * loader/ContentFilter.h:
725         * loader/DocumentLoader.cpp:
726         (WebCore::DocumentLoader::willSendRequest): Called ContentFilter::willSendRequest() if there is a content filter.
727         Asserted that this is not a redirect, and that ContentFilter does not set the request to null.
728         * loader/SubresourceLoader.cpp:
729         (WebCore::SubresourceLoader::willSendRequest): Called redirectReceived() instead of willSendRequest().
730         * loader/cache/CachedRawResource.cpp:
731         (WebCore::CachedRawResource::redirectReceived): Renamed from willSendRequest(), since this function is only called during redirects.
732         (WebCore::CachedRawResource::willSendRequest): Deleted.
733         * loader/cache/CachedRawResource.h:
734         * loader/cache/CachedResource.cpp:
735         (WebCore::CachedResource::redirectReceived): Renamed from willSendRequest(), since this function is only called during redirects.
736         (WebCore::CachedResource::willSendRequest): Deleted.
737         * loader/cache/CachedResource.h:
738         * platform/PlatformContentFilter.h:
739         * platform/cocoa/NetworkExtensionContentFilter.h:
740         * platform/cocoa/NetworkExtensionContentFilter.mm:
741         (WebCore::NetworkExtensionContentFilter::willSendRequest): Called responseReceived() if there was a redirectResponse.
742         Then called -[NEFilterSource willSendRequest:decisionHandler:].
743         * platform/cocoa/ParentalControlsContentFilter.h:
744         * platform/spi/cocoa/NEFilterSourceSPI.h: Added a #define for NEFilterSourceOptionsPageData.
745         * testing/MockContentFilter.cpp:
746         (WebCore::MockContentFilter::willSendRequest): Added support for willSendRequest.
747         * testing/MockContentFilter.h: Added decision points for AfterWillSendRequest and AfterRedirect.
748         * testing/MockContentFilterSettings.h:
749         * testing/MockContentFilterSettings.idl:
750
751 2015-04-05  Sungmann Cho  <sungmann.cho@navercorp.com>
752
753         Remove DocumentLoader::requestURL().
754         https://bugs.webkit.org/show_bug.cgi?id=140001
755
756         Reviewed by Darin Adler.
757
758         No new tests, no behavior change.
759
760         * loader/DocumentLoader.cpp:
761         (WebCore::DocumentLoader::documentURL):
762         (WebCore::DocumentLoader::requestURL): Deleted.
763         * loader/DocumentLoader.h:
764         * loader/ResourceLoadNotifier.cpp:
765         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
766
767 2015-04-05  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
768
769         Use constants of sqlite3 directly for status of SQL result in webdatabase
770         https://bugs.webkit.org/show_bug.cgi?id=143329
771
772         Reviewed by Darin Adler.
773
774         In webdatabase, it has used own constant vairables as well as using sqlite3 constants directly.
775         It causes to use if~else statement which consumes more cpu cycles compared to switch~case. This
776         patch makes to use constants of sqlite3. Additionally if~else statment is changed to switch~case
777         to save cpu cycles.
778
779         No new tests, no behavior changes.
780
781         * Modules/webdatabase/Database.cpp:
782         (WebCore::Database::performGetTableNames):
783         * Modules/webdatabase/DatabaseBackendBase.cpp:
784         (WebCore::retrieveTextResultFromDatabase):
785         (WebCore::setTextValueInDatabase):
786         (WebCore::DatabaseBackendBase::incrementalVacuumIfNeeded):
787         * Modules/webdatabase/DatabaseTracker.cpp:
788         (WebCore::DatabaseTracker::hasEntryForOriginNoLock):
789         (WebCore::DatabaseTracker::hasEntryForDatabase):
790         (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
791         (WebCore::DatabaseTracker::origins):
792         (WebCore::DatabaseTracker::databaseNamesForOriginNoLock):
793         (WebCore::DatabaseTracker::detailsForNameAndOrigin):
794         (WebCore::DatabaseTracker::setDatabaseDetails):
795         (WebCore::DatabaseTracker::quotaForOriginNoLock):
796         (WebCore::DatabaseTracker::setQuota):
797         (WebCore::DatabaseTracker::addDatabase):
798         (WebCore::DatabaseTracker::deleteOrigin):
799         (WebCore::DatabaseTracker::deleteDatabase):
800         (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
801         (WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty):
802         * Modules/webdatabase/SQLStatementBackend.cpp:
803         (WebCore::SQLStatementBackend::execute):
804         * Modules/webdatabase/SQLStatementBackend.h:
805         * Modules/webdatabase/SQLTransactionBackend.cpp:
806         (WebCore::SQLTransactionBackend::runCurrentStatementAndGetNextState):
807         Change to use a reference instead of a pointer in arguemnt of execute().
808         * loader/appcache/ApplicationCacheStorage.cpp:
809         (WebCore::ApplicationCacheStorage::loadCacheGroup):
810         (WebCore::ApplicationCacheStorage::loadManifestHostHashes):
811         (WebCore::ApplicationCacheStorage::cacheGroupForURL):
812         (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
813         (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
814         (WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
815         (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
816         (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
817         (WebCore::ApplicationCacheStorage::verifySchemaVersion):
818         (WebCore::ApplicationCacheStorage::store):
819         (WebCore::ApplicationCacheStorage::storeUpdatedType):
820         (WebCore::ApplicationCacheStorage::ensureOriginRecord):
821         (WebCore::ApplicationCacheStorage::storeNewestCache):
822         (WebCore::ApplicationCacheStorage::loadCache):
823         (WebCore::ApplicationCacheStorage::remove):
824         (WebCore::ApplicationCacheStorage::getManifestURLs):
825         (WebCore::ApplicationCacheStorage::cacheGroupSize):
826         (WebCore::ApplicationCacheStorage::deleteCacheGroupRecord):
827         (WebCore::ApplicationCacheStorage::checkForMaxSizeReached):
828         (WebCore::ApplicationCacheStorage::checkForDeletedResources):
829         (WebCore::ApplicationCacheStorage::flatFileAreaSize):
830         * loader/icon/IconDatabase.cpp:
831         (WebCore::IconDatabase::checkIntegrity):
832         (WebCore::IconDatabase::performURLImport):
833         (WebCore::IconDatabase::pruneUnretainedIcons):
834         (WebCore::readySQLiteStatement):
835         (WebCore::IconDatabase::setIconIDForPageURLInSQLDatabase):
836         (WebCore::IconDatabase::removePageURLFromSQLDatabase):
837         (WebCore::IconDatabase::getIconIDForIconURLFromSQLDatabase):
838         (WebCore::IconDatabase::addIconURLToSQLDatabase):
839         (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
840         (WebCore::IconDatabase::removeIconFromSQLDatabase):
841         (WebCore::IconDatabase::writeIconSnapshotToSQLDatabase):
842         * platform/sql/SQLiteDatabase.cpp:
843         (WebCore::SQLiteDatabase::setMaximumSize):
844         * platform/sql/SQLiteDatabase.h:
845         * platform/sql/SQLiteFileSystem.cpp:
846         (WebCore::SQLiteFileSystem::getFileNameForNewDatabase):
847         * platform/sql/SQLiteStatement.cpp:
848         (WebCore::SQLiteStatement::step):
849         (WebCore::SQLiteStatement::returnIntResults):
850         (WebCore::SQLiteStatement::returnInt64Results):
851
852 2015-04-05  Simon Fraser  <simon.fraser@apple.com>
853
854         Remove "go ahead and" from comments
855         https://bugs.webkit.org/show_bug.cgi?id=143421
856
857         Reviewed by Darin Adler, Benjamin Poulain.
858
859         Remove the phrase "go ahead and" from comments where it doesn't add
860         anything (which is almost all of them).
861
862         * Modules/webdatabase/DatabaseTracker.cpp:
863         (WebCore::DatabaseTracker::deleteOriginLockFor):
864         * css/CSSFontFaceSrcValue.cpp:
865         (WebCore::CSSFontFaceSrcValue::isSupportedFormat):
866         * css/CSSPrimitiveValue.h:
867         * css/StyleResolver.cpp:
868         (WebCore::StyleResolver::styleForKeyframe):
869         (WebCore::StyleResolver::styleForPage):
870         (WebCore::StyleResolver::applyMatchedProperties):
871         * editing/ApplyStyleCommand.cpp:
872         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
873         * loader/DocumentLoader.cpp:
874         (WebCore::DocumentLoader::detachFromFrame):
875         * loader/cache/CachedImage.cpp:
876         (WebCore::CachedImage::addIncrementalDataBuffer):
877         * loader/icon/IconDatabase.cpp:
878         (WebCore::IconDatabase::performURLImport):
879         * page/PageOverlay.cpp:
880         (WebCore::PageOverlay::fadeAnimationTimerFired):
881         * platform/ScrollView.cpp:
882         (WebCore::ScrollView::updateScrollbars):
883         (WebCore::ScrollView::scrollContents):
884         * platform/graphics/DisplayRefreshMonitor.cpp:
885         (WebCore::DisplayRefreshMonitor::create):
886         * platform/graphics/GraphicsContext.cpp:
887         * platform/graphics/mac/ComplexTextController.cpp:
888         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
889         * platform/network/HTTPParsers.cpp:
890         (WebCore::parseHTTPRefresh):
891         * rendering/RenderBlock.cpp:
892         (WebCore::RenderBlock::removeChild):
893         (WebCore::RenderBlock::layoutPositionedObjects):
894         (WebCore::RenderBlock::selectionGaps):
895         (WebCore::RenderBlock::blockSelectionGaps):
896         (WebCore::RenderBlock::absoluteRects):
897         (WebCore::RenderBlock::absoluteQuads):
898         (WebCore::RenderBlock::addFocusRingRects):
899         * rendering/RenderBlockFlow.cpp:
900         (WebCore::RenderBlockFlow::layoutBlockChild):
901         (WebCore::RenderBlockFlow::handleAfterSideOfBlock):
902         (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
903         (WebCore::RenderBlockFlow::insertFloatingObject):
904         (WebCore::RenderBlockFlow::addOverhangingFloats):
905         (WebCore::RenderBlockFlow::inlineSelectionGaps):
906         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
907         * rendering/RenderBlockLineLayout.cpp:
908         (WebCore::RenderBlockFlow::appendRunsForObject):
909         * rendering/RenderBox.cpp:
910         (WebCore::RenderBox::positionLineBox):
911         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
912         * rendering/RenderBoxModelObject.cpp:
913         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
914         * rendering/RenderLayer.cpp:
915         (WebCore::RenderLayer::updateLayerPositions):
916         (WebCore::RenderLayer::hitTestLayer):
917         (WebCore::RenderLayer::calculateClipRects):
918         * rendering/RenderLayerModelObject.cpp:
919         (WebCore::RenderLayerModelObject::styleWillChange):
920         * rendering/RenderLineBoxList.cpp:
921         (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
922         * rendering/RenderTextLineBoxes.cpp:
923         (WebCore::RenderTextLineBoxes::dirtyRange):
924         * rendering/line/BreakingContext.h:
925         (WebCore::BreakingContext::handleOutOfFlowPositioned):
926         (WebCore::BreakingContext::handleText):
927         * rendering/line/LineBreaker.cpp:
928         (WebCore::LineBreaker::nextLineBreak):
929         * style/StyleResolveTree.cpp:
930         (WebCore::Style::resolveLocal):
931         * xml/XMLHttpRequestProgressEventThrottle.cpp:
932         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent):
933         * xml/parser/XMLDocumentParser.cpp:
934         (WebCore::XMLDocumentParser::append):
935
936 2015-04-04  Andy Estes  <aestes@apple.com>
937
938         [Content Filtering] Blocked page is not always displayed when it should be
939         https://bugs.webkit.org/show_bug.cgi?id=143410
940         rdar://problem/20211099
941
942         Reviewed by Andreas Kling.
943
944         These tests now pass: contentfiltering/block-after-add-data.html
945                               contentfiltering/block-after-response.html
946
947         There were several problems with how ContentFilter loaded replacement data:
948         (1) Replacement data was delivered to DocumentLoader as if it were the original document's data. This assumes
949             that the original data was a UTF-8 encoded HTML document, which is not always true. We had a way to reset
950             the encoding, but not the content type.
951         (2) Replacement data was never delivered when the filter blocks in DocumentLoader::responseReceived().
952         (3) The main resource load was cancelled before the replacement data could be rendered when the filter blocks
953             in DocumentLoader::dataReceived().
954         The result was that only when the load was blocked after DocumentLoader::notifyFinished() would the replacement
955         data be shown properly, and only when problem (1) wasn't occurring.
956
957         This patch addresses these issues by using the substitute data mechanism to deliver replacement data. By using
958         substitute data, we can ensure that the original load is cancelled at the earliest opportunity and that the
959         replacement data is loaded with the proper content type and encoding.
960
961         Accomplishing this required changing the way ContentFilter interacts with DocumentLoader. Instead of placing
962         ContentFilter hooks throughout DocumentLoader, this patch makes ContentFilter itself the client of the
963         CachedRawResource for the duration of the filtering. If the filter decides to allow the load, DocumentLoader
964         adds itself as a client causing CachedRawResource to deliver to it the response and buffered data. If the
965         filter decides to block the load, DocumentLoader schedules a substitute data load. An added benefit of this
966         approach is that ContentFilter can reuse CachedRawResource's original data buffer instead of keeping its own.
967
968         * loader/ContentFilter.cpp:
969         (WebCore::ContentFilter::createIfNeeded): Changed to take a DecisionFunction rather than a ResourceResponse and DocumentLoader.
970         (WebCore::ContentFilter::ContentFilter): Ditto.
971         (WebCore::ContentFilter::~ContentFilter): Removed ourself as a CachedRawResource client if needed.
972         (WebCore::ContentFilter::startFilteringMainResource): Became the client of the CachedRawResource in order to start the filtering process.
973         (WebCore::ContentFilter::unblockHandler): Returned the unblock handler.
974         (WebCore::ContentFilter::replacementData): Returned the replacement data.
975         (WebCore::ContentFilter::unblockRequestDeniedScript): Returned the unblock request denied script.
976         (WebCore::ContentFilter::responseReceived): Called responseReceived() on each filter using forEachContentFilterUntilBlocked().
977         (WebCore::ContentFilter::dataReceived): Ditto for dataReceived().
978         (WebCore::ContentFilter::notifyFinished): Ditto for finishedLoading().
979         (WebCore::ContentFilter::forEachContentFilterUntilBlocked): For each filter that needs more data, called the function.
980         If the filter blocked the load, called didDecide() with State::Blocked.
981         If all filters allowed the load, called didDecide() with State::Allowed.
982         (WebCore::ContentFilter::didDecide): Set m_state and called m_decisionFunction().
983         (WebCore::ContentFilter::addData): Deleted.
984         (WebCore::ContentFilter::finishedAddingData): Deleted.
985         (WebCore::ContentFilter::needsMoreData): Deleted.
986         (WebCore::ContentFilter::didBlockData): Deleted.
987         (WebCore::ContentFilter::getReplacementData): Deleted.
988         * loader/ContentFilter.h:
989         (WebCore::ContentFilter::type):
990         * loader/DocumentLoader.cpp:
991         (WebCore::DocumentLoader::DocumentLoader): Called ContentFilter::createIfNeeded() if not loading substitute data.
992         (WebCore::DocumentLoader::finishedLoading): Removed old ContentFilter code.
993         (WebCore::DocumentLoader::responseReceived): Ditto.
994         (WebCore::DocumentLoader::commitData): Ditto.
995         (WebCore::DocumentLoader::dataReceived): Ditto.
996         (WebCore::DocumentLoader::detachFromFrame): Set m_contentFilter to nullptr.
997         (WebCore::DocumentLoader::startLoadingMainResource): Called becomeMainResourceClientIfFilterAllows() instead of
998         becoming m_mainResource's client.
999         (WebCore::DocumentLoader::clearMainResource): Set m_contentFilter to nullptr.
1000         (WebCore::DocumentLoader::becomeMainResourceClientIfFilterAllows): If ContentFilter is initialized, called
1001         ContentFilter::startFilteringMainResource(). Otherwise added ourself as a client of m_mainResource.
1002         (WebCore::DocumentLoader::installContentFilterUnblockHandler): Added a helper for creating and notifying
1003         FrameLoaderClient of the unblock handler.
1004         (WebCore::DocumentLoader::contentFilterDidDecide): Set m_contentFilter to nullptr. If the content filter
1005         allowed the load, then added ourself as the CachedRawResource's client. Otherwise, installed the unblock handler
1006         and scheduled a substitute data load with the replacement data.
1007         * loader/DocumentLoader.h:
1008         * loader/FrameLoader.cpp:
1009         (WebCore::FrameLoader::prepareForLoadStart): Removed call to PolicyChecker::prepareForLoadStart().
1010         * loader/NavigationScheduler.cpp:
1011         (WebCore::ScheduledSubstituteDataLoad::ScheduledSubstituteDataLoad): Added a ScheduledNavigation subclass that
1012         calls FrameLoader::load() with a FrameLoadRequest containing substitute data.
1013         (WebCore::NavigationScheduler::scheduleSubstituteDataLoad): Scheduled a substitute data load.
1014         * loader/NavigationScheduler.h:
1015         * loader/PolicyChecker.cpp:
1016         (WebCore::PolicyChecker::checkNavigationPolicy): Reset m_contentFilterUnblockHandler if it couldn't handle the request.
1017         (WebCore::PolicyChecker::prepareForLoadStart): Deleted.
1018         * loader/PolicyChecker.h:
1019         * platform/ContentFilterUnblockHandler.h:
1020         (WebCore::ContentFilterUnblockHandler::unreachableURL):
1021         (WebCore::ContentFilterUnblockHandler::setUnreachableURL):
1022         (WebCore::ContentFilterUnblockHandler::unblockURLScheme): Renamed to ContentFilter::urlScheme().
1023         * platform/PlatformContentFilter.h:
1024         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
1025         (WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler): Added a helper to wrap the unblock handler with an outer DecisionHandlerFunction.
1026         (WebCore::ContentFilterUnblockHandler::encode): Added m_unreachableURL to the encoding.
1027         (WebCore::ContentFilterUnblockHandler::decode): Ditto for the decoding.
1028         (WebCore::ContentFilterUnblockHandler::canHandleRequest): Changed to call ContentFilter::urlScheme().
1029         * platform/cocoa/NetworkExtensionContentFilter.h:
1030         * platform/cocoa/NetworkExtensionContentFilter.mm:
1031         (replacementDataFromDecisionInfo): Added a helper to extract replacement data from the decisionInfo dictionary.
1032         (WebCore::NetworkExtensionContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
1033         (WebCore::NetworkExtensionContentFilter::create): Created a new object.
1034         (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Created a NEFilterSource immediately when using the modern API.
1035         (WebCore::NetworkExtensionContentFilter::responseReceived): Created a NEFilterSource when using the legacy API.
1036         Called -[NEFilterSource receivedResponse:decisionHandler:] when using the modern API.
1037         (WebCore::NetworkExtensionContentFilter::addData): Stopped buffering the original data.
1038         (WebCore::NetworkExtensionContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
1039         (WebCore::NetworkExtensionContentFilter::canHandleResponse): Deleted.
1040         (WebCore::createNEFilterSource): Deleted.
1041         (WebCore::NetworkExtensionContentFilter::getReplacementData): Deleted.
1042         * platform/cocoa/ParentalControlsContentFilter.h:
1043         * platform/cocoa/ParentalControlsContentFilter.mm:
1044         (WebCore::ParentalControlsContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
1045         (WebCore::ParentalControlsContentFilter::create): Created a new object.
1046         (WebCore::ParentalControlsContentFilter::ParentalControlsContentFilter): Initialized m_filterState to kWFEStateBuffering.
1047         (WebCore::canHandleResponse): Added a helper to check if the response can be filtered.
1048         (WebCore::ParentalControlsContentFilter::responseReceived): If !canHandleResponse(), set m_filterState to kWFEStateAllowed and return.
1049         Otherwise created a new WebFilterEvaluator with the response.
1050         (WebCore::ParentalControlsContentFilter::addData): Called updateFilterState().
1051         (WebCore::ParentalControlsContentFilter::finishedAddingData): Ditto.
1052         (WebCore::ParentalControlsContentFilter::needsMoreData): Changed to check m_filterState.
1053         (WebCore::ParentalControlsContentFilter::didBlockData): Ditto.
1054         (WebCore::ParentalControlsContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
1055         (WebCore::ParentalControlsContentFilter::updateFilterState): Updated m_filterState by calling -[WebFilterEvaluator filterState].
1056         (WebCore::ParentalControlsContentFilter::canHandleResponse): Deleted.
1057         (WebCore::ParentalControlsContentFilter::getReplacementData): Deleted.
1058         * platform/spi/cocoa/NEFilterSourceSPI.h:
1059         * platform/spi/cocoa/WebFilterEvaluatorSPI.h:
1060         * testing/MockContentFilter.cpp:
1061         (WebCore::MockContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
1062         (WebCore::MockContentFilter::create): Created a new object.
1063         (WebCore::MockContentFilter::responseReceived): Called maybeDetermineStatus().
1064         (WebCore::MockContentFilter::addData): Stopped buffering the original data.
1065         (WebCore::MockContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
1066         (WebCore::MockContentFilter::unblockHandler): Asserted that we blocked data.
1067         (WebCore::MockContentFilter::canHandleResponse): Deleted.
1068         (WebCore::MockContentFilter::MockContentFilter): Deleted.
1069         (WebCore::MockContentFilter::getReplacementData): Deleted.
1070         * testing/MockContentFilter.h:
1071         * testing/MockContentFilterSettings.cpp:
1072         (WebCore::MockContentFilterSettings::unblockRequestURL): Changed to use a StringBuilder.
1073
1074 2015-04-04  Chris Fleizach  <cfleizach@apple.com>
1075
1076         AX: Heuristic: Avoid exposing an element as clickable if mouse event delegation is handled on an AXElement with more than one descendant AXElement
1077         https://bugs.webkit.org/show_bug.cgi?id=136247
1078
1079         Reviewed by Mario Sanchez Prada.
1080
1081         Modify the logic for determining whether an element supports the press action by trying to filter out objects being handled by event delegation.
1082         The heuristic is if an element handles click actions and has more than one of a {static text, image, control, link, heading}, then we think
1083         it's using event delegation, and do not expose the press action.
1084
1085         Test: platform/mac/accessibility/press-action-not-exposed-for-event-delegation.html
1086
1087         * accessibility/AccessibilityObject.cpp:
1088         (WebCore::AccessibilityObject::supportsPressAction):
1089
1090 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
1091
1092         More const in CSSToStyleMap
1093         https://bugs.webkit.org/show_bug.cgi?id=143409
1094
1095         Reviewed by Andreas Kling.
1096
1097         The CSSValues passed to CSSToStyleMap functions can mostly be treated
1098         as |const|, except for CSSImageValues which have special behavior.
1099         
1100         This makes it clearer what the inputs and outputs of these
1101         functions are.
1102
1103         * css/CSSPrimitiveValue.cpp:
1104         (WebCore::CSSPrimitiveValue::computeDegrees):
1105         * css/CSSPrimitiveValue.h:
1106         (WebCore::CSSPrimitiveValue::computeTime):
1107         * css/CSSToStyleMap.cpp:
1108         (WebCore::CSSToStyleMap::mapFillAttachment):
1109         (WebCore::CSSToStyleMap::mapFillClip):
1110         (WebCore::CSSToStyleMap::mapFillComposite):
1111         (WebCore::CSSToStyleMap::mapFillBlendMode):
1112         (WebCore::CSSToStyleMap::mapFillOrigin):
1113         (WebCore::CSSToStyleMap::mapFillRepeatX):
1114         (WebCore::CSSToStyleMap::mapFillRepeatY):
1115         (WebCore::CSSToStyleMap::mapFillSize):
1116         (WebCore::CSSToStyleMap::mapFillXPosition):
1117         (WebCore::CSSToStyleMap::mapFillYPosition):
1118         (WebCore::CSSToStyleMap::mapFillMaskSourceType):
1119         (WebCore::CSSToStyleMap::mapAnimationDelay):
1120         (WebCore::CSSToStyleMap::mapAnimationDirection):
1121         (WebCore::CSSToStyleMap::mapAnimationDuration):
1122         (WebCore::CSSToStyleMap::mapAnimationFillMode):
1123         (WebCore::CSSToStyleMap::mapAnimationIterationCount):
1124         (WebCore::CSSToStyleMap::mapAnimationName):
1125         (WebCore::CSSToStyleMap::mapAnimationPlayState):
1126         (WebCore::CSSToStyleMap::mapAnimationProperty):
1127         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
1128         (WebCore::CSSToStyleMap::mapAnimationTrigger):
1129         * css/CSSToStyleMap.h:
1130
1131 2015-04-04  Dan Bernstein  <mitz@apple.com>
1132
1133         Tried to fix the build.
1134
1135         * loader/icon/IconController.cpp:
1136         (WebCore::iconsFromLinkElements):
1137
1138 2015-04-02  Darin Adler  <darin@apple.com>
1139
1140         Streamline icon-related code, mostly unused
1141         https://bugs.webkit.org/show_bug.cgi?id=143306
1142
1143         Reviewed by Antti Koivisto.
1144
1145         I started on this path because Document::iconURLs had a poor implementation,
1146         storing results in a data member with no benefit, using HTMLCollection for
1147         iteration of the children of the head element instead of using the simpler
1148         faster technique we use inside the engine. Then, I discovered this function was
1149         mostly-unused code left over from before the Blink fork. I removed most of it.
1150         We can add this back later if someone finds a use for it, but if we do we
1151         should do a higher quality implementation without the quirks of the old one.
1152
1153         Refactoring also made it clear that logic isn't exactly sensible. There's a
1154         set of rules about what order to return the list in that is not followed by
1155         the code that tries to find the "default touch icon". Later we could add some
1156         more test coverage and tighten up the logic. But the reality is that at this
1157         time, with some small exceptions, icon logic is in the web browsers, not in WebKit.
1158
1159         * CMakeLists.txt: Removed IconURL.cpp.
1160         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
1161         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1162         * WebCore.xcodeproj/project.pbxproj: Ditto.
1163         * dom/DOMAllInOne.cpp: Ditto.
1164
1165         * dom/Document.cpp:
1166         (WebCore::Document::evaluate): Tweaked formatting.
1167         (WebCore::Document::shortcutIconURLs): Removed. Unused function.
1168         (WebCore::Document::iconURLs): Removed. Moved code to IconController.
1169         (WebCore::Document::addIconURL): Removed. Moved code to LinkLoader.
1170
1171         * dom/Document.h: Removed shortcutIconURLs, iconURLs, addIconURL,
1172         and m_iconURLs.
1173
1174         * dom/IconURL.cpp: Removed.
1175         * dom/IconURL.h: Removed everything from this header except for the
1176         IconType enum. Added a FIXME about possibly renaming the header.
1177
1178         * html/HTMLLinkElement.cpp:
1179         (WebCore::HTMLLinkElement::HTMLLinkElement): Pass a reference when creating
1180         the link loading.
1181         (WebCore::HTMLLinkElement::setDisabledState): Access members of the struct
1182         LinkRelElement without "m_" prefix.
1183         (WebCore::HTMLLinkElement::parseAttribute): Changed to use early return style,
1184         and made the part of this for parsing title use a more normal idiom.
1185         (WebCore::HTMLLinkElement::process): Removed many unneeded arguments, made the
1186         logic of the code a little easier to follow.
1187         (WebCore::HTMLLinkElement::removedFrom): Removed a call to a function that had
1188         an empty body.
1189         (WebCore::HTMLLinkElement::iconType): Updated for change to LinkRelElement.
1190         (WebCore::HTMLLinkElement::addSubresourceAttributeURLs): Ditto.
1191         * html/HTMLLinkElement.h: More of the same.
1192
1193         * html/LinkRelAttribute.cpp:
1194         (WebCore::LinkRelAttribute::LinkRelAttribute): Initialize data members in the
1195         struct itself. Got rid of "m_" prefix since this is a struct, not a class.
1196         Changed code to use modern for loop; even better would be to eliminate the
1197         splitting into a vector entirely and use StringView (do that next time).
1198         * html/LinkRelAttribute.h: See above.
1199
1200         * html/parser/HTMLPreloadScanner.cpp:
1201         (WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet):
1202         Updated for chnages to LinkRelAttribute and give the local variable a clearer name.
1203
1204         * loader/FrameLoader.cpp:
1205         (WebCore::FrameLoader::didChangeIcons): Removed.
1206         * loader/FrameLoader.h: Removed didChangeIcons.
1207
1208         * loader/FrameLoaderClient.h: Added include for String since it's no longer
1209         taken care of by IconURLs.h.
1210
1211         * loader/LinkLoader.cpp:
1212         (WebCore::LinkLoader::LinkLoader): Take a reference instead of a pointer.
1213         (WebCore::LinkLoader::linkLoadTimerFired): Use m_client reference instead of pointer.
1214         (WebCore::LinkLoader::linkLoadingErrorTimerFired): Ditto.
1215         (WebCore::LinkLoader::notifyFinished): Use nullptr.
1216         (WebCore::LinkLoader::loadLink): Tweak formatting. Move the dispatchDidChangeIcons
1217         call in here instead of going through Document to FrameLoader and then FrameLoader to
1218         FrameLoaderClient, and passing extra unused arguments, the way the old code did.
1219         Use a reference instead of a pointer for the document.
1220         (WebCore::LinkLoader::released): Removed. Empty function.
1221
1222         * loader/LinkLoader.h: Changed constructor argument to be a reference. Made more
1223         things private. Removed empty released function.
1224
1225         * loader/icon/IconController.cpp:
1226         (WebCore::IconController::IconController): Moved initialization of data members to
1227         the class definition in the header.
1228         (WebCore::iconsFromLinkElements): Added. This function replaces the existing
1229         Document::iconURLs function, but has a simpler implementation and interface.
1230         It focuses on exactly what the code in this file needs. If we want to add some
1231         more features to the icon controller we might make this more complex again.
1232         Even now, building a vector is not necessarily helpful; the only client of this
1233         function ends up extracting only one of the URLs this function returns.
1234         (WebCore::IconController::url): Rewrote this. It's the only function actually
1235         using the icon URLs. This contains a combination of the logic from the various
1236         functions in this class before, including iconURL, urlsForTypes, appendToIconURLs,
1237         and defaultURL. Among other improvements, replaced the unusual code to construct
1238         the icon URL with a call to Document::completeURL.
1239         (WebCore::IconController::startLoader): Refactored a bit to remove a local variable.
1240         (WebCore::IconController::continueLoadWithDecision): Ditto.
1241
1242         * loader/icon/IconController.h: Removed unneeded includes, unneeded use of
1243         WTF_MAKE_NONCOPYABLE (since classes with data members of reference type are
1244         automatically noncopyable), unused fucntions. Also initialize m_waitingForLoadDecision.
1245
1246         * testing/Internals.cpp:
1247         (WebCore::Internals::iconURLs): Removed.
1248         (WebCore::Internals::shortcutIconURLs): Left this in place since it is used by
1249         tests. Changed it to return the actual value from the IconController::url function,
1250         since that's the interface to our icon machinery that is actually exposed on some
1251         platforms. That means this returns only a single URL.
1252         (WebCore::Internals::allIconURLs): Removed.
1253         * testing/Internals.h: Removed allIconURLs and iconURLs.
1254         * testing/Internals.idl: Removed allIconURLs.
1255
1256 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
1257
1258         Fix EFL and Gtk build.
1259
1260         * dom/Document.cpp:
1261         (WebCore::Document::didRemoveTouchEventHandler):
1262
1263 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
1264
1265         Crash under Document::absoluteRegionForEventTargets on build.webkit.org/dashboard
1266         https://bugs.webkit.org/show_bug.cgi?id=143406
1267         rdar://problem/20407080
1268
1269         Reviewed by Ryosuke Niwa.
1270         
1271         We failed to remove elements from Document's m_wheelEventTargets HashSet when the
1272         elements were destroyed with wheel handlers still on them. Fix by removing the
1273         node from the set via Node::willBeDeletedFrom().
1274
1275         Tests: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-element-with-multiple-handlers-crash.html
1276                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-crash.html
1277                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-parent-crash.html
1278
1279         * dom/Document.cpp:
1280         (WebCore::removeHandlerFromSet): Helper to remove one or all handlers on the given node.
1281         (WebCore::Document::didRemoveWheelEventHandler): Add a parameter to specify whether we're
1282         removing all handlers on the given node.
1283         (WebCore::Document::didRemoveTouchEventHandler): Use removeHandlerFromSet().
1284         * dom/Document.h:
1285         * dom/Node.cpp:
1286         (WebCore::Node::willBeDeletedFrom): Tell the document we're removing all handlers
1287         for this node.
1288
1289 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
1290
1291         REGRESSION (r182215): Feedly crashes when closing article
1292         https://bugs.webkit.org/show_bug.cgi?id=143405
1293         rdar://problem/20382734, rdar://problem/20395497
1294
1295         Reviewed by Tim Horton.
1296         
1297         Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go
1298         is bad, because it can cause FrameView::layout() to get called in the middle of
1299         RenderObject destruction, which leaves the render tree in a bad state.
1300         
1301         Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit.
1302         
1303         AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets
1304         a flag to say that the non-fast region needs to be recomputed, and that schedules
1305         a scrolling tree commit. When the commit happens, we recompute the region. If the
1306         region didn't change, and no other changes are pending, there's no need to commit.
1307
1308         Test: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/compute-region-inside-delete-renderer-crash.html
1309
1310         * page/scrolling/AsyncScrollingCoordinator.cpp:
1311         (WebCore::AsyncScrollingCoordinator::setNonFastScrollableRegionDirty):
1312         (WebCore::AsyncScrollingCoordinator::willCommitTree):
1313         (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
1314         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1315         (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
1316         (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText): Need to eagerly update
1317         the non-fast scrollable region.
1318         * page/scrolling/AsyncScrollingCoordinator.h:
1319         (WebCore::AsyncScrollingCoordinator::nonFastScrollableRegionDirty):
1320         * page/scrolling/ScrollingCoordinator.cpp:
1321         (WebCore::ScrollingCoordinator::ScrollingCoordinator):
1322         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
1323         * page/scrolling/ScrollingCoordinator.h:
1324         (WebCore::ScrollingCoordinator::willCommitTree):
1325         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1326         (WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
1327         (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
1328         (WebCore::ScrollingCoordinatorMac::commitTreeState):
1329
1330 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
1331
1332         Differentiate between composited scrolling, and async scrolling
1333         https://bugs.webkit.org/show_bug.cgi?id=143291
1334
1335         Reviewed by Sam Weinig.
1336         
1337         ScrollableArea::usesCompositedScrolling() meant "uses aysnc scrolling", but
1338         FrameView::contentsInCompositedLayer() covered a related concept, that scrolling
1339         happens by moving compositing layers around.
1340         
1341         Make the difference between these more explicit by adding ScrollableArea::usesAsyncScrolling(),
1342         which means that scrolling for that ScrollableArea is asynchronous and managed
1343         by a ScrollingCoordinator. This is the meaning that ScrollingCoordinator::computeNonFastScrollableRegion()
1344         understands.
1345         
1346         ScrollableArea::usesCompositedScrolling() is now repurposed to mean "scrolling
1347         occurs by moving layers around, not requiring repaint". FrameView::contentsInCompositedLayer()
1348         is renamed to usesCompositedScrolling(), and overrides the base class function.
1349
1350         This only changes behavior in tests that call setScrollingTreeIncludesFrames(true).
1351
1352         * page/FrameView.cpp:
1353         (WebCore::FrameView::useSlowRepaints):
1354         (WebCore::FrameView::usesCompositedScrolling):
1355         (WebCore::FrameView::usesAsyncScrolling):
1356         (WebCore::FrameView::scrollContentsFastPath):
1357         (WebCore::FrameView::scrollContentsSlowPath):
1358         (WebCore::FrameView::contentsInCompositedLayer): Deleted.
1359         * page/FrameView.h:
1360         * page/scrolling/ScrollingCoordinator.cpp:
1361         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
1362         * platform/ScrollableArea.h:
1363         (WebCore::ScrollableArea::usesAsyncScrolling):
1364         * rendering/RenderLayer.cpp:
1365         (WebCore::RenderLayer::usesAsyncScrolling):
1366         * rendering/RenderLayer.h:
1367
1368 2015-04-04  Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1369
1370         [Streams API] Collecting a ReadableStreamReader should not unlock its stream
1371         https://bugs.webkit.org/show_bug.cgi?id=143333
1372
1373         Reviewed by Benjamin Poulain.
1374
1375         This patch stores as a boolean whether the stream is locked to a reader.
1376         In case the reader forget to unlock the stream, the reader can be collected and destructor called.
1377         In that case, the link between reader and stream will be reset but the stream will remain in locked state.
1378
1379         Covered by new test in streams/readablestreamreader-constructor.html.
1380
1381         * Modules/streams/ReadableStream.h:
1382         (WebCore::ReadableStream::isLocked):
1383         (WebCore::ReadableStream::lock):
1384         (WebCore::ReadableStream::release):
1385         (WebCore::ReadableStream::releaseButKeepLocked): Introduced to cut the link between reader and stream but stil keeping the stream locked.
1386         * Modules/streams/ReadableStreamReader.cpp:
1387         (WebCore::ReadableStreamReader::~ReadableStreamReader):
1388         * bindings/js/JSReadableStreamCustom.cpp:
1389         (WebCore::JSReadableStream::getReader):
1390         * bindings/js/JSReadableStreamReaderCustom.cpp:
1391         (WebCore::constructJSReadableStreamReader):
1392
1393 2015-04-03  Zan Dobersek  <zdobersek@igalia.com>
1394
1395         MediaDevices possesses a vtable despite using ImplementationLacksVTable IDL attribute
1396         https://bugs.webkit.org/show_bug.cgi?id=143367
1397
1398         Reviewed by Eric Carlson.
1399
1400         * Modules/mediastream/MediaDevices.idl: MediaDevices ends up with a vtable
1401         because of inheriting from ContextDestructionObserver. This collides with
1402         the ImplementationLacksVTable IDL attribute, causing compilation errors
1403         with Clang. Since MediaDevices isn't being inherited from, but will still
1404         end up with a vtable, the IDL attribute should be removed.
1405
1406 2015-04-03  Alex Christensen  <achristensen@webkit.org>
1407
1408         [Content Extensions] Add memory reporting.
1409         https://bugs.webkit.org/show_bug.cgi?id=143386
1410
1411         Reviewed by Benjamin Poulain.
1412
1413         * contentextensions/CompiledContentExtension.cpp:
1414         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
1415         * contentextensions/CompiledContentExtension.h:
1416         * contentextensions/ContentExtension.cpp:
1417         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
1418         * contentextensions/ContentExtension.h:
1419         * contentextensions/ContentExtensionsBackend.cpp:
1420         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1421         * contentextensions/ContentExtensionsDebugging.h:
1422         * contentextensions/DFABytecodeInterpreter.cpp:
1423         (WebCore::ContentExtensions::getBits):
1424         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
1425         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
1426         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
1427         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1428         * contentextensions/DFABytecodeInterpreter.h:
1429         (WebCore::ContentExtensions::DFABytecodeInterpreter::DFABytecodeInterpreter):
1430         (WebCore::ContentExtensions::DFABytecodeInterpreter::~DFABytecodeInterpreter):
1431         Keep track of which memory pages in the bytecode are being hit if CONTENT_EXTENSIONS_MEMORY_REPORTING is 1.
1432         When CONTENT_EXTENSIONS_MEMORY_REPORTING is 0, this makes an empty vector in ContentExtension
1433         and passes some pointers on the stack, many of which can be optimized out by the C++ compiler.
1434
1435 2015-04-03  Brent Fulgham  <bfulgham@apple.com>
1436
1437         Expand test infrastructure to support scrolling tests
1438         https://bugs.webkit.org/show_bug.cgi?id=143383
1439
1440         Reviewed by Darin Adler.
1441
1442         No new tests: No change in behavior.
1443
1444         This is an initial set of changes that clean up a few things I noticed while extending testing support
1445         for scroll animations and wheel event gestures.
1446         1. Reduce the amount of #ifdef code in EventHandler{Mac}.
1447         2. Consolidate the idea of an "End Gesture" in the PlatformWheelEvent class.
1448         3. Remove a number of unneeded null checks in EventHandler.
1449         4. ScrollController must always have a client, so hold a reference instead of using a pointer.
1450
1451         * page/EventHandler.cpp:
1452         (WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
1453         (WebCore::EventHandler::handleWheelEvent): Call 'platformNotifySnapIfNecessary' at method exit points.
1454         (WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
1455         * page/EventHandler.h:
1456         * page/mac/EventHandlerMac.mm:
1457         (WebCore::EventHandler::platformCompleteWheelEvent):  Remove unneeded null checks for 'view'. Remove
1458         CSS_SNAP-specific call to 'platformNotifySnapIfNecessary'. This logic is now handled in the new
1459         'platformNotifyIfEndGesture' method.
1460         (WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
1461         (WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
1462         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1463         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac): Pass 'this' as
1464         reference to ScrollController constructor.
1465         * platform/PlatformWheelEvent.h:
1466         (WebCore::PlatformWheelEvent::shouldResetLatching): Call new 'isEndGesture' method.
1467         (WebCore::PlatformWheelEvent::isEndGesture): Added method to encapsulate some code that was duplicated
1468         in a number of places.
1469         * platform/ScrollAnimator.cpp:
1470         (WebCore::ScrollAnimator::ScrollAnimator): Pass 'this' as reference to ScrollController constructor.
1471         * platform/cocoa/ScrollController.h:
1472         * platform/cocoa/ScrollController.mm:
1473         (WebCore::ScrollController::ScrollController): Update to reflect m_client is now a reference.
1474         (WebCore::ScrollController::handleWheelEvent): Ditto.
1475         (WebCore::ScrollController::snapRubberBandTimerFired): Ditto. Also, a drive-by fix for ending rubberband
1476         snapping. This end-state wasn't deactivating the timer (even when the animation finished). This isn't a
1477         huge problem, but I (will) rely on the state of the animation timer in a future patch to decide if
1478         tests should run or continue waiting.
1479         (WebCore::ScrollController::isRubberBandInProgress): Ditto.
1480         (WebCore::ScrollController::startSnapRubberbandTimer): Ditto.
1481         (WebCore::ScrollController::stopSnapRubberbandTimer): Ditto.
1482         (WebCore::ScrollController::shouldRubberBandInHorizontalDirection): Ditto.
1483         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Ditto.
1484         (WebCore::ScrollController::startScrollSnapTimer): Ditto.
1485         (WebCore::ScrollController::stopScrollSnapTimer): Ditto.
1486         (WebCore::ScrollController::scrollSnapAnimationUpdate): Ditto.
1487         (WebCore::ScrollController::beginScrollSnapAnimation): Ditto.
1488         (WebCore::ScrollController::computeSnapDelta): Ditto.
1489         (WebCore::ScrollController::computeGlideDelta): Ditto.
1490         * platform/mac/ScrollAnimatorMac.mm:
1491         (WebCore::gestureShouldBeginSnap): Use new PlatformWheelEvent::isEndGesture() method.
1492
1493 2015-04-03  Chris Fleizach  <cfleizach@apple.com>
1494
1495         AX: Toggling check box state not speaking using plain space, not VO space.
1496         https://bugs.webkit.org/show_bug.cgi?id=143356
1497
1498         Reviewed by Darin Adler.
1499
1500         The checkbox state change needs to result in a value change being generated, otherwise accessibility won't know the value has changed through keyboard usage.
1501   
1502         Test: platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space.html
1503
1504         * accessibility/mac/AXObjectCacheMac.mm:
1505         (WebCore::AXObjectCache::postPlatformNotification):
1506
1507 2015-04-03  Zalan Bujtas  <zalan@apple.com>
1508
1509         Simple line layout: Use pre-computed simple line runs to produce innerText content.
1510         https://bugs.webkit.org/show_bug.cgi?id=143351
1511
1512         Reviewed by Antti Koivisto.
1513
1514         This is in preparation to cover <br> with simple line layout.
1515         Runs provide line layout information that can be used to cover hard line break cases.
1516         (similar to TextIterator::handleTextBox())
1517
1518         Covered by existing tests.
1519
1520         * editing/TextIterator.cpp:
1521         (WebCore::TextIterator::handleTextNode):
1522         (WebCore::TextIterator::emitCharacter):
1523         (WebCore::TextIterator::emitText):
1524         * editing/TextIterator.h:
1525         * rendering/SimpleLineLayoutResolver.h:
1526         (WebCore::SimpleLineLayout::RunResolver::Run::isEndOfLine):
1527
1528 2015-04-03  Antti Koivisto  <antti@apple.com>
1529
1530         Add non-counting bloom filter class
1531         https://bugs.webkit.org/show_bug.cgi?id=143366
1532
1533         Reviewed by Sam Weinig.
1534
1535         * css/SelectorFilter.cpp:
1536         (WebCore::SelectorFilter::setupParentStack):
1537         * css/SelectorFilter.h:
1538
1539         Update names.
1540
1541 2015-04-03  Alex Christensen  <achristensen@webkit.org>
1542
1543         Remove dead code.
1544         https://bugs.webkit.org/show_bug.cgi?id=143352
1545
1546         Reviewed by Gyuyoung Kim.
1547
1548         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
1549         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
1550         * loader/EmptyClients.cpp:
1551         (WebCore::EmptyChromeClient::openDateTimeChooser): Deleted.
1552         * loader/EmptyClients.h:
1553         * page/Chrome.cpp:
1554         (WebCore::Chrome::openDateTimeChooser): Deleted.
1555         * page/Chrome.h:
1556         * page/ChromeClient.h:
1557         Remove ChromeClient::openDateTimeChooser.
1558
1559 2015-04-03  Zan Dobersek  <zdobersek@igalia.com>
1560
1561         Unreviewed, fixing Clang builds of the GTK port on Linux.
1562
1563         * Modules/mediastream/MediaDevices.h:
1564         Include the <functional> header for uses of std::function<>.
1565
1566 2015-04-01 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1567
1568         [Streams API] Split ReadableStream/Reader implementation according source type (JS vs native)
1569         https://bugs.webkit.org/show_bug.cgi?id=143130
1570
1571         Reviewed by Benjamin Poulain.
1572
1573         Introduce ReadableJSStream and ReadableJSStreamReader as subclasses of ReadableStream and ReadableStreamReader.
1574         These classes manage JS based sources: ReadableStream JS constructor instantiates ReadableJStream.
1575         These classes are expected to handle JS source specific handling, in particular JSValue error storage and JSValue chunk queue.
1576         Making ReadableStream and ReadableStreamReader abstract, to be subclassed for native sources.
1577
1578         Current tests cover the changes.
1579
1580         * Modules/streams/ReadableStream.cpp:
1581         (WebCore::ReadableStream::ReadableStream): Moved suspendIfNeeded inside constructor to ease subclassing.
1582         (WebCore::ReadableStream::create): Deleted as ReadableStream is now abstarct.
1583         * Modules/streams/ReadableStream.h: Made createReader virtual pure.
1584         * Modules/streams/ReadableStream.idl: Skipping VTable validation as subclasses of ReadableStream may be JS wrapped.
1585         * Modules/streams/ReadableStreamReader.cpp: Removed ReadableStreamReader::create.
1586         * Modules/streams/ReadableStreamReader.h: Ditto.
1587         * Modules/streams/ReadableStreamReader.idl: Skipping VTable validation as subclasses of ReadableStreamReader may be JS wrapped.
1588         * bindings/js/JSReadableStreamCustom.cpp:
1589         (WebCore::constructJSReadableStream): Instantiating ReadableJSStream in lieu of ReadableStream within JS constructor.
1590         * bindings/js/ReadableStreamJSSource.cpp:
1591         (WebCore::ReadableJSStream::create):
1592         (WebCore::ReadableJSStream::createReader): Instantiating ReadableJSStreamReader.
1593         (WebCore::ReadableJSStream::ReadableJSStream):
1594         (WebCore::ReadableJSStreamReader::create):
1595         (WebCore::ReadableJSStreamReader::ReadableJSStreamReader):
1596         * bindings/js/ReadableStreamJSSource.h: Definition of ReadableJSStream and ReadableJSStreamReader.
1597
1598 2015-04-02  Timothy Horton  <timothy_horton@apple.com>
1599
1600         Scrollbars are left in the wrong position when resizing a fixed layout view
1601         https://bugs.webkit.org/show_bug.cgi?id=143360
1602
1603         Reviewed by Beth Dakin.
1604
1605         Test: fast/fixed-layout/fixed-layout.html
1606
1607         * platform/ScrollView.cpp:
1608         (WebCore::ScrollView::setFrameRect):
1609         Update scrollbars when the ScrollView frameRect changes. We were previously
1610         depending on the layout that always happens after this to update scrollbars,
1611         but with fixed layout mode, there won't be a layout! Also, FrameView's
1612         setFrameRect override will sync this scrollbar update with the scrollbar
1613         layers (via RenderLayerCompositor::frameViewDidChangeSize) immediately afterwards.
1614
1615         * testing/Internals.cpp:
1616         (WebCore::Internals::resetToConsistentState):
1617         Turn off fixed layout when resetting state.
1618
1619         (WebCore::Internals::setUseFixedLayout):
1620         (WebCore::Internals::setFixedLayoutSize):
1621         * testing/Internals.h:
1622         * testing/Internals.idl:
1623         Add internals functions to set the fixed layout size and to turn on fixed layout.
1624
1625 2015-04-02  Brady Eidson  <beidson@apple.com>
1626
1627         Unreviewed: Reapplied Change after rollout.
1628
1629         Expose the "Share" menu for text selections on platforms where it's available.
1630         rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
1631
1632         * page/ContextMenuClient.h:
1633         (WebCore::ContextMenuClient::shareSelectedTextMenuItem):
1634
1635         * page/ContextMenuContext.h:
1636         (WebCore::ContextMenuContext::setSelectedText):
1637         (WebCore::ContextMenuContext::selectedText):
1638
1639         * page/ContextMenuController.cpp:
1640         (WebCore::ContextMenuController::populate): Add a Share menu item returned from the client.
1641         (WebCore::ContextMenuController::checkOrEnableIfNeeded):
1642
1643         * platform/ContextMenuItem.cpp:
1644         (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
1645
1646         * platform/ContextMenuItem.h:
1647         (WebCore::ContextMenuItem::supportsShareMenu):
1648
1649         * platform/gtk/ContextMenuItemGtk.cpp:
1650         (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
1651
1652         * platform/mac/ContextMenuItemMac.mm:
1653         (WebCore::ContextMenuItem::releasePlatformDescription):
1654         (WebCore::ContextMenuItem::getPlatformDescription):
1655         (WebCore::ContextMenuItem::supportsShareMenu):
1656         (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Use NSMenu SPI to get the Share menu.
1657
1658         * platform/spi/mac/NSMenuSPI.h: Forward declare instead of #include
1659
1660 2015-04-02  Commit Queue  <commit-queue@webkit.org>
1661
1662         Unreviewed, rolling out r182293.
1663         https://bugs.webkit.org/show_bug.cgi?id=143355
1664
1665         Broke GTK and EFL builds. (Requested by bfulgham on #webkit).
1666
1667         Reverted changeset:
1668
1669         "Expose the "Share" menu for text selections on platforms
1670         where it's available."
1671         https://bugs.webkit.org/show_bug.cgi?id=143318
1672         http://trac.webkit.org/changeset/182293
1673
1674 2015-04-02  Brent Fulgham  <bfulgham@apple.com>
1675
1676         REGRESSION: Caption Menus show language codes instead of display names.
1677         https://bugs.webkit.org/show_bug.cgi?id=143350
1678         <rdar://problem/20094145>
1679
1680         Reviewed by Jer Noble.
1681
1682         The generic caption/track label handling in CaptionUserPreferences does not convert language codes
1683         (e.g. 'fr-CA') into display names (e.g., 'French (Canada)'). Because we did not have an AudioTrack
1684         override to process these types of menu items, they were being handled using the generic code.
1685
1686         * page/CaptionUserPreferencesMediaAF.cpp:
1687         (WebCore::buildStringForTrackBase): Helper function to share code with the two flavors
1688         of 'trackDisplayName'.
1689         (WebCore::trackDisplayName): Add a version to support AudioTracks, and modify the TextTrack
1690         version to use the new 'buildStringForTrackBase' function.
1691         (WebCore::CaptionUserPreferencesMediaAF::displayNameForTrack): Add an AudioTrack override so
1692         our AVFoundation tracks are processed in our CaptionUserPreferencesMediaAF implementation, not the
1693         generic version.
1694         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Add an AudioTrack override so
1695         that the menu items are sorted in order of display name, not language code.
1696         * page/CaptionUserPreferencesMediaAF.h:
1697
1698 2015-04-02  Brady Eidson  <beidson@apple.com>
1699
1700         Expose the "Share" menu for text selections on platforms where it's available.
1701         rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
1702
1703         Reviewed by Sam Weinig.
1704
1705         * page/ContextMenuClient.h:
1706         (WebCore::ContextMenuClient::shareSelectedTextMenuItem):
1707
1708         * page/ContextMenuContext.h:
1709         (WebCore::ContextMenuContext::setSelectedText):
1710         (WebCore::ContextMenuContext::selectedText):
1711
1712         * page/ContextMenuController.cpp:
1713         (WebCore::ContextMenuController::populate): Add a Share menu item returned from the client.
1714         (WebCore::ContextMenuController::checkOrEnableIfNeeded):
1715
1716         * platform/ContextMenuItem.cpp:
1717         (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
1718
1719         * platform/ContextMenuItem.h:
1720         (WebCore::ContextMenuItem::supportsShareMenu):
1721
1722         * platform/gtk/ContextMenuItemGtk.cpp:
1723         (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
1724
1725         * platform/mac/ContextMenuItemMac.mm:
1726         (WebCore::ContextMenuItem::releasePlatformDescription):
1727         (WebCore::ContextMenuItem::getPlatformDescription):
1728         (WebCore::ContextMenuItem::supportsShareMenu):
1729         (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Use NSMenu SPI to get the Share menu.
1730
1731         * platform/spi/mac/NSMenuSPI.h: Forward declare instead of #include
1732
1733 2015-04-02  Jer Noble  <jer.noble@apple.com>
1734
1735         [Mac] Only pass in the AVURLAssetClientBundleIdentifierKey on iOS.
1736         https://bugs.webkit.org/show_bug.cgi?id=143347
1737
1738         Reviewed by Brent Fulgham.
1739
1740         Only pass in the main app bundle id into AVURLAsset via the AVURLAssetClientBundleIdentifierKey option
1741         on iOS. On OS X, setting this key can cause media playback to fail.
1742
1743         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1744         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
1745
1746 2015-04-02  Roger Fong  <roger_fong@apple.com>
1747
1748         Show audio media controls on OSX.
1749         https://bugs.webkit.org/show_bug.cgi?id=143346.
1750         <rdar://problem/20306240>
1751
1752         Reviewed by Dean Jackson.
1753
1754         * Modules/mediacontrols/mediaControlsApple.css:
1755         (audio::-webkit-media-controls-panel:hover):
1756         Revert part of r180893.
1757
1758 2015-04-02  Myles C. Maxfield  <mmaxfield@apple.com>
1759
1760         Disallow ruby base from having leading or trailing expansions
1761         https://bugs.webkit.org/show_bug.cgi?id=142608
1762
1763         Reviewed by David Hyatt.
1764
1765         If we determine that a ruby base should have either a leading or trailing expansion,
1766         we shunt that expansion over to the neighboring RenderText, assuming one exists. This
1767         requires that we teach RenderText how to force leading or trailing expansions if one
1768         wouldn't naturally be present.
1769
1770         Tests: fast/ruby/ruby-expansion-cjk-2.html
1771                fast/ruby/ruby-expansion-cjk-3.html
1772                fast/ruby/ruby-expansion-cjk-4.html
1773                fast/ruby/ruby-expansion-cjk-5.html
1774                fast/ruby/ruby-expansion-cjk.html
1775
1776         * rendering/InlineFlowBox.cpp:
1777         (WebCore::InlineFlowBox::removeChild): Delete contentIsKnownToFollow.
1778         * rendering/InlineTextBox.cpp:
1779         (WebCore::InlineTextBox::expansionBehavior): Support forced leading and trailing
1780         expansions.
1781         * rendering/InlineTextBox.h:
1782         (WebCore::InlineTextBox::expansionBehavior): Moved to .cpp
1783         * rendering/RenderBlockLineLayout.cpp:
1784         (WebCore::RenderBlockFlow::updateRubyForJustifiedText): Perform relayout even if
1785         there are no expansions left. This is so that ruby bases with no expansions will get
1786         centered.
1787         (WebCore::expansionBehaviorForInlineTextBox): Update to inspect neighboring rubies.
1788         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment): Use updated
1789         expansionBehaviorForInlineTextBox(). Also center ruby bases if they have no expansion
1790         opportunities.
1791         (WebCore::RenderBlockFlow::createLineBoxesFromBidiRuns): Use nullptr.
1792         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): Ditto.
1793         * rendering/RenderText.cpp:
1794         (WebCore::RenderText::RenderText): Delete contentIsKnownToFollow.
1795         * rendering/RenderText.h:
1796         (WebCore::RenderText::contentIsKnownToFollow): Deleted.
1797         (WebCore::RenderText::setContentIsKnownToFollow): Deleted.
1798
1799 2015-04-02  Alexey Proskuryakov  <ap@apple.com>
1800
1801         Clean up access checks in JSHistoryCustom.cpp
1802         https://bugs.webkit.org/show_bug.cgi?id=143227
1803
1804         Reviewed by Sam Weinig.
1805
1806         * bindings/js/JSHistoryCustom.cpp:
1807         (WebCore::JSHistory::putDelegate):
1808         (WebCore::JSHistory::deleteProperty):
1809         (WebCore::JSHistory::deletePropertyByIndex):
1810         (WebCore::JSHistory::getOwnPropertyNames):
1811         (WebCore::JSHistory::pushState):
1812         (WebCore::JSHistory::replaceState):
1813
1814 2015-04-02  Alex Christensen  <achristensen@webkit.org>
1815
1816         [Content Extensions] Only add unique universal action locations.
1817         https://bugs.webkit.org/show_bug.cgi?id=143325
1818
1819         Reviewed by Benjamin Poulain.
1820
1821         * contentextensions/ContentExtensionCompiler.cpp:
1822         (WebCore::ContentExtensions::compileRuleList):
1823         Use a HashSet instead of a Vector for the universal action locations to remove duplicates.
1824
1825 2015-04-01  Roger Fong  <roger_fong@apple.com>
1826
1827         Fix slider colors for media controls on OSX.
1828         https://bugs.webkit.org/show_bug.cgi?id=143328.
1829         <rdar://problem/20357858>
1830
1831         Reviewed by Darin Adler.
1832
1833         Fill in bottom portion of volume slider.
1834         Adjust colors to make slider controls look better. Will likely be tweaked later.
1835         * Modules/mediacontrols/mediaControlsApple.js:
1836         (Controller.prototype.drawTimelineBackground):
1837         (Controller.prototype.drawVolumeBackground):
1838
1839 2015-04-02  Yusuke Suzuki  <utatane.tea@gmail.com>
1840
1841         Clean up EnumerationMode to easily extend
1842         https://bugs.webkit.org/show_bug.cgi?id=143276
1843
1844         Reviewed by Geoffrey Garen.
1845
1846         Use default EnumerationMode().
1847
1848         * bindings/js/Dictionary.cpp:
1849         (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
1850         (WebCore::Dictionary::getOwnPropertyNames):
1851         * bindings/js/SerializedScriptValue.cpp:
1852         (WebCore::CloneSerializer::serialize):
1853         * bindings/scripts/CodeGeneratorJS.pm:
1854         (GenerateHeader):
1855         * bindings/scripts/test/JS/JSFloat64Array.h:
1856         * bindings/scripts/test/JS/JSTestEventTarget.h:
1857         * bridge/NP_jsobject.cpp:
1858         (_NPN_Enumerate):
1859         * bridge/runtime_array.cpp:
1860         (JSC::RuntimeArray::getOwnPropertyNames):
1861
1862 2015-04-02  David Hyatt  <hyatt@apple.com>
1863
1864         [New Block-Inside-Inline Model] Implement the correct paint order for blocks inside inlines.
1865         https://bugs.webkit.org/show_bug.cgi?id=143320
1866
1867         Reviewed by Darin Adler.
1868
1869         Added new tests in fast/block/inside-inlines.
1870
1871         * rendering/EllipsisBox.cpp:
1872         (WebCore::EllipsisBox::nodeAtPoint):
1873         * rendering/EllipsisBox.h:
1874         * rendering/InlineBox.h:
1875         * rendering/InlineElementBox.cpp:
1876         (WebCore::InlineElementBox::paint):
1877         (WebCore::InlineElementBox::nodeAtPoint):
1878         * rendering/InlineElementBox.h:
1879         * rendering/InlineFlowBox.cpp:
1880         (WebCore::InlineFlowBox::nodeAtPoint):
1881         (WebCore::InlineFlowBox::paint):
1882         * rendering/InlineFlowBox.h:
1883         * rendering/InlineTextBox.cpp:
1884         (WebCore::InlineTextBox::nodeAtPoint):
1885         * rendering/InlineTextBox.h:
1886         The HitTestAction has to be passed to nodeAtPoint so that hit test actions can be honored. All the nodeAtPoint
1887         functions have been patched to include this argument. Painting and hit testing have been patched for InlineElementBox
1888         to honor phases/actions when the element is an anonymous inline block.
1889
1890         The phase filter on RenderLineBoxList has been pushed in to InlineFlowBox::paint and InlineFlowBox::nodeAtPoint so that
1891         we can respect it properly when inlines are painting by themselves (e.g., because they have a layer).
1892
1893         * rendering/RenderBlockLineLayout.cpp:
1894         (WebCore::RenderBlockFlow::createLineBoxes):
1895         (WebCore::RenderBlockFlow::constructLine):
1896         Go ahead and include all of the inline flow boxes between the root and the anonymous inline block if it turns out they
1897         need to be constructed. This will end up being relevant for outlines and for self-painting layers (e.g., opacity).
1898
1899         * rendering/RenderLineBoxList.cpp:
1900         (WebCore::RenderLineBoxList::paint):
1901         (WebCore::RenderLineBoxList::hitTest):
1902         Remove the filters here, since they get pushed in to InlineFlowBox.
1903
1904         * rendering/RootInlineBox.cpp:
1905         (WebCore::RootInlineBox::nodeAtPoint):
1906         * rendering/RootInlineBox.h:
1907         * rendering/svg/SVGInlineTextBox.cpp:
1908         (WebCore::SVGInlineTextBox::nodeAtPoint):
1909         * rendering/svg/SVGInlineTextBox.h:
1910         More patching to pass the HitTestAction into nodeAtPoint.
1911
1912 2015-04-02  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1913
1914         WebRTC: Add support for Promise-based MediaDevices.getUserMedia()
1915         https://bugs.webkit.org/show_bug.cgi?id=143255
1916
1917         Reviewed by Eric Carlson.
1918
1919         The MediaDevices object collects functionality related to local media
1920         devices. This patch adds the Promise-based version of getUserMedia()
1921         (unprefixed). Other functionality, like enumerateDevices(), will be
1922         added in later patches.
1923
1924         The old callback-based webkitGetUserMedia() (on Navigator) is kept for
1925         legacy purposes (according to the Media Capture and Streams API spec [1]).
1926         Both versions of getUserMedia are backed up by UserMediaRequest where
1927         the callbacks from the callback-based version are wrapped inside c++
1928         lambda functions. The new Promise-based getUserMedia() uses the lambda
1929         functions directly as created by the Promise bindings.
1930
1931         [1] http://w3c.github.io/mediacapture-main/archives/20150324/getusermedia.html#navigatorusermedia-interface-extensions
1932
1933         Test: fast/mediastream/MediaDevices-getUserMedia.html
1934
1935         * CMakeLists.txt:
1936         * DerivedSources.make:
1937         * Modules/mediastream/MediaDevices.cpp: Added.
1938         (WebCore::MediaDevices::create):
1939         (WebCore::MediaDevices::MediaDevices):
1940         (WebCore::MediaDevices::~MediaDevices):
1941         (WebCore::MediaDevices::document):
1942         (WebCore::MediaDevices::getUserMedia):
1943         * Modules/mediastream/MediaDevices.h: Added.
1944         * Modules/mediastream/MediaDevices.idl: Added.
1945         * Modules/mediastream/NavigatorMediaDevices.cpp: Added.
1946         (WebCore::NavigatorMediaDevices::NavigatorMediaDevices):
1947         (WebCore::NavigatorMediaDevices::~NavigatorMediaDevices):
1948         (WebCore::NavigatorMediaDevices::from):
1949         (WebCore::NavigatorMediaDevices::mediaDevices):
1950         (WebCore::NavigatorMediaDevices::supplementName):
1951         * Modules/mediastream/NavigatorMediaDevices.h: Added.
1952         * Modules/mediastream/NavigatorMediaDevices.idl: Added.
1953         * Modules/mediastream/UserMediaRequest.cpp:
1954         (WebCore::UserMediaRequest::create):
1955         (WebCore::UserMediaRequest::UserMediaRequest):
1956         (WebCore::UserMediaRequest::didCreateStream):
1957         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError):
1958         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError):
1959         * Modules/mediastream/UserMediaRequest.h:
1960         * PlatformGTK.cmake:
1961         * WebCore.xcodeproj/project.pbxproj:
1962         * bindings/js/JSMediaDevicesCustom.cpp: Added.
1963         (WebCore::JSMediaDevices::getUserMedia):
1964
1965 2015-04-02  Eric Carlson  <eric.carlson@apple.com>
1966
1967         [iOS] Fix AirPlay problem caused by r182240
1968         https://bugs.webkit.org/show_bug.cgi?id=143337
1969
1970         Reviewed by Jer Noble.
1971
1972         * html/HTMLMediaSession.cpp:
1973         (WebCore::HTMLMediaSession::wirelessVideoPlaybackDisabled): Return false if the legacy attribute
1974             "x-webkit-airplay" has the value "allow".
1975         * html/HTMLVideoElement.cpp:
1976         (WebCore::HTMLVideoElement::parseAttribute): Don't call webkitWirelessVideoPlaybackDisabled when
1977             processing "x-webkit-airplay" and "x-webkit-wirelessvideoplaybackdisabled", just consider
1978             the attribute/value.
1979
1980 2015-04-02  Commit Queue  <commit-queue@webkit.org>
1981
1982         Unreviewed, rolling out r182265.
1983         https://bugs.webkit.org/show_bug.cgi?id=143338
1984
1985         Caused an assertion on
1986         http/tests/contentextensions/whitelist.html (Requested by ap
1987         on #webkit).
1988
1989         Reverted changeset:
1990
1991         "[Content Extensions] Only add unique universal action
1992         locations."
1993         https://bugs.webkit.org/show_bug.cgi?id=143325
1994         http://trac.webkit.org/changeset/182265
1995
1996 2015-04-01  Antti Koivisto  <antti@apple.com>
1997
1998         Use std::chrono types to represent time in response and cache classes
1999         https://bugs.webkit.org/show_bug.cgi?id=143316
2000
2001         Reviewed by Andreas Kling.
2002
2003         Use std::chrono::system_clock::time_point to represent clock times and std::chrono::microseconds to
2004         represent durations. Also use WTF::Optional for optional values (instead of coding them as NaNs).
2005
2006         * dom/Document.cpp:
2007         (WebCore::Document::lastModified):
2008         * loader/cache/CachedResource.cpp:
2009         (WebCore::CachedResource::CachedResource):
2010         (WebCore::CachedResource::freshnessLifetime):
2011         (WebCore::CachedResource::responseReceived):
2012         (WebCore::CachedResource::updateResponseAfterRevalidation):
2013         * loader/cache/CachedResource.h:
2014         * platform/network/CacheValidation.cpp:
2015         (WebCore::computeCurrentAge):
2016         (WebCore::computeFreshnessLifetimeForHTTPFamily):
2017         (WebCore::updateRedirectChainStatus):
2018         (WebCore::redirectChainAllowsReuse):
2019         (WebCore::parseCacheControlDirectives):
2020         * platform/network/CacheValidation.h:
2021         (WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
2022         * platform/network/HTTPParsers.cpp:
2023         (WebCore::parseHTTPDate):
2024         (WebCore::parseDate): Deleted.
2025         * platform/network/HTTPParsers.h:
2026         * platform/network/ResourceResponseBase.cpp:
2027         (WebCore::ResourceResponseBase::ResourceResponseBase):
2028         (WebCore::ResourceResponseBase::cacheControlMaxAge):
2029         (WebCore::parseDateValueInHeader):
2030         (WebCore::ResourceResponseBase::date):
2031         (WebCore::ResourceResponseBase::age):
2032         (WebCore::ResourceResponseBase::expires):
2033         (WebCore::ResourceResponseBase::lastModified):
2034         * platform/network/ResourceResponseBase.h:
2035
2036 2015-04-02  Joonghun Park  <jh718.park@samsung.com>
2037
2038         [CSS MultiColumn] Parse "columns: auto <length>" shorthand property value properly
2039         https://bugs.webkit.org/show_bug.cgi?id=143248
2040
2041         Reviewed by Darin Adler.
2042
2043         Test: fast/multicol/columns-shorthand-parsing-2.html
2044
2045         The two longhands for the 'columns' property ('column-count' and
2046         'column-width') may both take 'auto' as a value. When we encounter
2047         'auto' during parsing the value list of a declaration, we cannot just
2048         make a guess at which property/properties that's meant for. Instead,
2049         don't assign anything to 'auto' right away, but wait until all values
2050         have been processed and at that point set the still unassigned
2051         properties to 'auto'. If 'auto' isn't in the value list at all, set
2052         unassigned properties to 'initial' for the 'columns' property, just
2053         like we do for any other property.
2054
2055         * css/CSSParser.cpp:
2056         (WebCore::CSSParser::parseValue):
2057         (WebCore::CSSParser::parseColumnWidth):
2058         (WebCore::CSSParser::parseColumnCount):
2059         (WebCore::CSSParser::parseColumnsShorthand):
2060         * css/CSSParser.h:
2061
2062 2015-04-01  Commit Queue  <commit-queue@webkit.org>
2063
2064         Unreviewed, rolling out r182247.
2065         https://bugs.webkit.org/show_bug.cgi?id=143326
2066
2067         unfortunately broke some tests (Requested by dino on #webkit).
2068
2069         Reverted changeset:
2070
2071         "Async loading of image resources"
2072         https://bugs.webkit.org/show_bug.cgi?id=134488
2073         http://trac.webkit.org/changeset/182247
2074
2075 2015-04-01  Alex Christensen  <achristensen@webkit.org>
2076
2077         [Content Extensions] Only add unique universal action locations.
2078         https://bugs.webkit.org/show_bug.cgi?id=143325
2079
2080         Reviewed by Benjamin Poulain.
2081
2082         * contentextensions/ContentExtensionCompiler.cpp:
2083         (WebCore::ContentExtensions::compileRuleList):
2084         Use a HashSet instead of a Vector for the universal action locations to remove duplicates.
2085
2086 2015-04-01  Roger Fong  <roger_fong@apple.com>
2087
2088         Fixes to material of inline media controls on OSX.
2089         https://bugs.webkit.org/show_bug.cgi?id=143317
2090         <rdar://problem/20357847>
2091
2092         Reviewed by Dean Jackson.
2093
2094         There are many existing tests for the media controls appearance.
2095         They are currently skipped while we are still updating the controls.
2096
2097         Expand backgrounds of control panel and volume box.
2098         Clip the darker edges away.
2099         * Modules/mediacontrols/mediaControlsApple.css:
2100         (audio::-webkit-media-controls-panel):
2101         (audio::-webkit-media-controls-panel-background-container):
2102         (audio::-webkit-media-controls-panel-tint):
2103         (audio::-webkit-media-controls-panel-background):
2104         (audio::-webkit-media-controls-panel .volume-box):
2105         (audio::-webkit-media-controls-volume-slider-container-background):
2106         (audio::-webkit-media-controls-volume-slider-container-tint):
2107         (audio::-webkit-media-controls-panel .volume-box:active):
2108         (video::-webkit-media-controls-volume-slider): 
2109         This needs to be above the background so it can be interacted with.
2110         (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
2111         * Modules/mediacontrols/mediaControlsApple.js:
2112         (Controller.prototype.createControls): Create a new div for the control material.
2113         We need to clip the material and not the controls themselves.
2114         (Controller.prototype.configureInlineControls): Use new div.
2115         Remove some unnecessary logic involving hiding materials here.
2116         It just causes the materials to turn on and off at the wrong times. 
2117         (Controller.prototype.handlePanelTransitionEnd):
2118         (Controller.prototype.setPlaying):
2119         (Controller.prototype.showControls):
2120         (Controller.prototype.hideControls):
2121
2122 2015-04-01  Eric Carlson  <eric.carlson@apple.com>
2123
2124         Media controls should not always auto-hide
2125         https://bugs.webkit.org/show_bug.cgi?id=143322
2126
2127         Reviewed by Dean Jackson.
2128
2129         * Modules/mediacontrols/mediaControlsApple.js:
2130         (Controller): Intialize new properties.
2131         (Controller.prototype.hideControls): Do nothing if controlsAlwaysVisible() returns true;
2132         (Controller.prototype.controlsAlwaysVisible): New.
2133         (Controller.prototype.controlsAreHidden): Consult controlsAlwaysVisible().
2134         (Controller.prototype.currentPlaybackTargetIsWireless): Use new properties.
2135         (Controller.prototype.updateWirelessTargetAvailable): Cache video.webkitCurrentPlaybackTargetIsWireless
2136             and video.webkitWirelessVideoPlaybackDisabled because we know when they change and
2137             use them frequently.
2138         * Modules/mediacontrols/mediaControlsiOS.js:
2139         (ControllerIOS.prototype.controlsAlwaysVisible): New.
2140         * platform/graphics/MediaPlaybackTarget.h:
2141
2142 2015-04-01  Alexey Proskuryakov  <ap@apple.com>
2143
2144         REGRESSION (r182121): SVG animation macros cause warnings in MSVC
2145         https://bugs.webkit.org/show_bug.cgi?id=143313
2146
2147         Reviewed by Darin Adler.
2148
2149         * svg/SVGExternalResourcesRequired.h: Undo the change that caused a type mismatch.
2150
2151 2015-04-01  Eric Carlson  <eric.carlson@apple.com>
2152
2153         Another attempt to fixi the iOS build after r182240.
2154
2155         Reviewed by Dean Jackson.
2156
2157         * platform/graphics/MediaPlaybackTarget.h:
2158         (WebCore::MediaPlaybackTarget::hasActiveRoute):
2159
2160 2015-04-01  Eric Carlson  <eric.carlson@apple.com>
2161
2162         Fix the iOS build after r182240.
2163
2164         * platform/graphics/MediaPlaybackTarget.h:
2165
2166 2015-04-01  Yoav Weiss  <yoav@yoav.ws>
2167
2168         Async loading of image resources
2169         https://bugs.webkit.org/show_bug.cgi?id=134488
2170
2171         Reviewed by Dean Jackson.
2172
2173         This patch changes image loading to be asynchronous (per spec), in order
2174         for it to be agnostic to property setting order when it comes to src, srcset and crossorigin,
2175         as well as to enable future hooking of the <picture>-based selection logic on top of it.
2176
2177         Tests: fast/dom/HTMLImageElement/image-load-post-onload.html
2178         fast/dom/HTMLImageElement/sizes/image-sizes-js-change-reverse.html
2179
2180         * WebCore.xcodeproj/project.pbxproj: Change MicroTask.h to be private.
2181         * bindings/js/JSEventListener.cpp:
2182         (WebCore::JSEventListener::handleEvent): Add a microtask checkpoint after event handling.
2183         * bindings/js/ScheduledAction.cpp:
2184         (WebCore::ScheduledAction::execute): Add a microtask checkpoint after running of a scheduled action.
2185         * html/HTMLImageElement.cpp:
2186         (WebCore::HTMLImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2187         * html/HTMLImageLoader.cpp:
2188         (WebCore::HTMLImageLoader::notifyFinished): Avoid a crash when notifyFinished is called and there's no CachedImage.
2189         * html/HTMLInputElement.cpp:
2190         (WebCore::HTMLInputElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2191         * html/HTMLPlugInImageElement.cpp:
2192         (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2193         * html/HTMLVideoElement.cpp:
2194         (WebCore::HTMLVideoElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2195         * html/parser/HTMLDocumentParser.cpp:
2196         (WebCore::HTMLDocumentParser::attemptToRunDeferredScriptsAndEnd): Add a microtask checkpoint.
2197         * loader/ImageLoader.cpp: Move image resource loading to be asynchronous.
2198         (WebCore::ImageLoader::ImageLoaderTask::create):
2199         (WebCore::ImageLoader::ImageLoaderTask::run): Run the image loading microtask and called doUpdateFromElement.
2200         (WebCore::ImageLoader::ImageLoaderTask::ImageLoaderTask):
2201         (WebCore::ImageLoader::ImageLoader):
2202         (WebCore::ImageLoader::doUpdateFromElement): This is split from the previous updateFromElement, and performs the actual resource loading.
2203         (WebCore::ImageLoader::updateFromElement): Now only prepares the stage for the actual image resource loading.
2204         (WebCore::ImageLoader::shouldLoadImmediately): If this returns true, the image resource is loaded immediately, without queueing a microtask.
2205         (WebCore::ImageLoader::notifyFinished): Add asserts.
2206         (WebCore::ImageLoader::elementDidMoveToNewDocument): Handle document load event counters decrementing and incrementing.
2207         * loader/ImageLoader.h:
2208         (WebCore::ImageLoader::imageComplete): Make sure that the image is complete only if there aren't any pending tasks.
2209         (WebCore::ImageLoader::hasPendingActivity): Make sure that pending activity takes pending tasks into account.
2210         (WebCore::ImageLoader::hasPendingTask): Getter to know if an ImageLoader has a pending task. (Used by the image loading microtask)
2211         (WebCore::ImageLoader::createWeakPtr): Create a weakPtr to be used by the microtask, so it can called back the loader if it's still alive.
2212         * loader/cache/CachedResourceLoader.cpp:
2213         (WebCore::CachedResourceLoader::canRequest): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag and act upon it.
2214         (WebCore::CachedResourceLoader::requestImage): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2215         (WebCore::CachedResourceLoader::requestResource): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2216         * loader/cache/CachedResourceLoader.h:
2217         (WebCore::CachedResourceLoader::canRequest): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag and act upon it.
2218         (WebCore::CachedResourceLoader::requestImage): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2219         (WebCore::CachedResourceLoader::requestResource): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2220         * svg/SVGImageElement.cpp:
2221         (WebCore::SVGImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2222         * xml/parser/XMLDocumentParser.cpp:
2223         (WebCore::XMLDocumentParser::end): Add a microtask checkpoint after XML finishes parsing.
2224
2225 2015-04-01  Alex Christensen  <achristensen@webkit.org>
2226
2227         Unreviewed build fix when using content extensions performance reporting.
2228
2229         * contentextensions/ContentExtensionCompiler.cpp:
2230         (WebCore::ContentExtensions::compileRuleList):
2231         Time how long it takes to build the DFAs.
2232
2233 2015-04-01  Alex Christensen  <achristensen@webkit.org>
2234
2235         Progress towards CMake on Windows and Mac.
2236         https://bugs.webkit.org/show_bug.cgi?id=143293
2237
2238         Reviewed by Filip Pizlo.
2239
2240         * PlatformMac.cmake:
2241         Tell open source builders where to find unicode headers.
2242         * PlatformWin.cmake:
2243         Include PlatformWinCairo.cmake.
2244         * PlatformWinCairo.cmake:
2245         Added from bug 115944 by Patrick Gansterer.
2246         * bindings/js/JSDOMStringListCustom.cpp:
2247         * bindings/js/JSDOMWrapper.cpp:
2248         * bindings/js/JSMessageChannelCustom.cpp:
2249         * bindings/js/JSPopStateEventCustom.cpp:
2250         * bindings/js/JSReadableStreamCustom.cpp:
2251         * bindings/js/ReadableStreamJSSource.cpp:
2252         * bindings/js/ScriptController.cpp:
2253         * css/CSSComputedStyleDeclaration.cpp:
2254         * dom/Attr.cpp:
2255         * dom/CollectionIndexCache.cpp:
2256         * platform/graphics/ANGLEWebKitBridge.h:
2257         Fixed include quirks.
2258
2259 2015-03-31  Simon Fraser  <simon.fraser@apple.com>
2260
2261         Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers
2262         https://bugs.webkit.org/show_bug.cgi?id=143288
2263         rdar://problem/16049624
2264
2265         Reviewed by Beth Dakin.
2266
2267         Remove the wheel event counting that Document does, and passes into the scrolling tree.
2268         The ScrollingTree now just uses the non-fast scrollable region to determine when to
2269         fast scroll on pages with wheel event handlers.
2270         
2271         If a handler includes position:fixed renderers, we just cover the whole document
2272         with the slow-scrolling region currently. This could be improved.
2273         
2274         * dom/Document.cpp:
2275         (WebCore::Document::Document):
2276         (WebCore::Document::didBecomeCurrentDocumentInFrame):
2277         (WebCore::Document::wheelEventHandlersChanged):
2278         (WebCore::Document::didAddWheelEventHandler):
2279         (WebCore::Document::didRemoveWheelEventHandler):
2280         (WebCore::Document::wheelEventHandlerCount):
2281         (WebCore::Document::touchEventHandlerCount):
2282         (WebCore::Document::absoluteRegionForEventTargets): Changed to return a pair<Region, bool>
2283         where the bool indicates whether any handler includes position:fixed content.
2284         (WebCore::pageWheelEventHandlerCountChanged): Deleted.
2285         (WebCore::wheelEventHandlerCountChanged): Deleted.
2286         * dom/Document.h:
2287         (WebCore::Document::wheelEventHandlerCount): Deleted.
2288         * loader/EmptyClients.h:
2289         * page/ChromeClient.h:
2290         * page/DebugPageOverlays.cpp:
2291         (WebCore::MouseWheelRegionOverlay::updateRegion):
2292         * page/scrolling/AsyncScrollingCoordinator.cpp:
2293         (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
2294         (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): Deleted.
2295         * page/scrolling/AsyncScrollingCoordinator.h:
2296         * page/scrolling/ScrollingCoordinator.cpp:
2297         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
2298         (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
2299         (WebCore::ScrollingCoordinator::computeCurrentWheelEventHandlerCount): Deleted.
2300         (WebCore::ScrollingCoordinator::frameViewWheelEventHandlerCountChanged): Deleted.
2301         * page/scrolling/ScrollingCoordinator.h:
2302         (WebCore::ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): Deleted.
2303         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2304         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2305         (WebCore::ScrollingStateFrameScrollingNode::setWheelEventHandlerCount): Deleted.
2306         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2307         * page/scrolling/ScrollingTree.cpp:
2308         (WebCore::ScrollingTree::ScrollingTree):
2309         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
2310         (WebCore::ScrollingTree::commitNewTreeState):
2311         * page/scrolling/ScrollingTree.h:
2312         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2313         (WebCore::ScrollingCoordinatorMac::updateTiledScrollingIndicator):
2314         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2315         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
2316         (WebCore::logWheelEventHandlerCountChanged): Deleted.
2317         * testing/Internals.cpp:
2318         (WebCore::Internals::touchEventHandlerCount):
2319
2320 2015-04-01  David Hyatt  <hyatt@apple.com>
2321
2322         [New Block-Inside-Inline Model] Floats need to be allowed to intrude into anonymous inline-blocks.
2323         https://bugs.webkit.org/show_bug.cgi?id=143307
2324
2325         Reviewed by Dean Jackson.
2326
2327         Added fast/block/inside-inlines/basic-float-intrusion.html
2328
2329         * rendering/InlineFlowBox.cpp:
2330         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
2331         Make sure to exclude the margins of an anonymous inline-block when considering the height of the line.
2332
2333         * rendering/RenderBlock.cpp:
2334         (WebCore::RenderBlock::lineHeight):
2335         (WebCore::RenderBlock::baselinePosition):
2336         Anonymous inline-block lines ignore line-height and just return the height of the block. For baseline position, the baseline
2337         is considered to be at the bottom border edge of the anonymous inline-block.
2338
2339         * rendering/RenderBlockFlow.cpp:
2340         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
2341         (WebCore::RenderBlockFlow::addIntrudingFloats):
2342         * rendering/RenderBlockFlow.h:
2343         Patch float intrusion to handle the case of anonymous inline-blocks. Instead of collecting the floats from our parent(), we
2344         collect them from the containingBlock() in the anonymous inline-block case. Patch addIntrudingFloats to pass in the container
2345         that acts as the "parent", since it is not the parent() in the anonymous inline-block case.
2346
2347         * rendering/RenderBlockLineLayout.cpp:
2348         (WebCore::updateLogicalInlinePositions):
2349         Make sure to use the full available width for content always in the anonymous inline-block case, since we don't avoid the
2350         floats, but instead let them intrude into the inline-block.
2351
2352         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
2353         Patch callers of updateLogicalInlinePositions to pass in the root line box that we're checking for.
2354
2355         (WebCore::RenderBlockFlow::layoutLineBoxes):
2356         Defer the layout of anonymous inline-blocks, since they need to only lay out once the vertical position to lay them out
2357         at is known.
2358
2359         * rendering/RenderBox.cpp:
2360         (WebCore::RenderBox::createsNewFormattingContext):
2361         (WebCore::RenderBox::avoidsFloats):
2362         Anonymous inline-blocks do not establish a new block formatting context, nor do they avoid floats.
2363
2364         * rendering/line/BreakingContext.h:
2365         (WebCore::BreakingContext::handleReplaced):
2366         Add code to do a just-in-time layout of the anonymous inline-block at the time it is being examined (after the break before
2367         it was handled).
2368
2369 2015-04-01  Eric Carlson  <eric.carlson@apple.com>
2370
2371         [Mac] Do not include route button if element does not support target playback
2372         https://bugs.webkit.org/show_bug.cgi?id=143251
2373
2374         Reviewed by Jer Noble.
2375
2376         * Modules/mediacontrols/mediaControlsApple.js:
2377         (Controller.prototype.currentPlaybackTargetIsWireless): Return false if target playback is disabled.
2378         (Controller.prototype.updateWirelessTargetAvailable): Do not show the picker if target 
2379             playback is disabled.
2380         (Controller.prototype.handleWirelessPlaybackChange): Call updateWirelessTargetAvailable.
2381
2382         * dom/Document.cpp:
2383         (WebCore::Document::showPlaybackTargetPicker): Update for Page::showPlaybackTargetPicker change.
2384         (WebCore::Document::didChoosePlaybackTarget): Notify clients in vector-order, lower level code
2385             now tracks which one requested the picker.
2386
2387         * html/HTMLMediaElement.cpp:
2388         (WebCore::HTMLMediaElement::loadResource): Don't call applyMediaPlayerRestrictions, it is done
2389             in mediaPlayerEngineFailedToLoad.
2390         (WebCore::HTMLMediaElement::setReadyState): Enqueue a target availability event if there are
2391             listeners readyState reaches HAVE_METADATA so controls are setup correctly.
2392         (WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad): Call applyMediaPlayerRestrictions.
2393         (WebCore::HTMLMediaElement::clearMediaPlayer): Enqueue a target availability event in so controls
2394             have a chance to hide the picker.
2395         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsSupported): New, passthrough to the
2396             media engine.
2397         (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget): Ditto.
2398         (WebCore::HTMLMediaElement::startPlayingToPlaybackTarget): Ditto.
2399         (WebCore::HTMLMediaElement::stopPlayingToPlaybackTarget): Ditto.
2400         * html/HTMLMediaElement.h:
2401         * html/HTMLMediaElement.idl:
2402
2403         * html/HTMLMediaSession.cpp:
2404         (WebCore::HTMLMediaSession::HTMLMediaSession): Initialize m_playbackTarget.
2405         (WebCore::HTMLMediaSession::currentPlaybackTargetIsSupported): New.
2406         (WebCore::HTMLMediaSession::showPlaybackTargetPicker): Pull logic from showingPlaybackTargetPickerPermitted 
2407             inline. Don't refuse to show a picker if the element doesn't support target playback, it is up
2408             to script to decide which elements can display a picker.
2409         (WebCore::HTMLMediaSession::wirelessVideoPlaybackDisabled): Return true if there is no player.
2410         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Call startPlayingToPlaybackTarget or 
2411             stopPlayingToPlaybackTarget because setWirelessPlaybackTarget doesn't apply the target.
2412         (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange): Add logging.
2413         (WebCore::HTMLMediaSession::showingPlaybackTargetPickerPermitted): Deleted.
2414         * html/HTMLMediaSession.h:
2415
2416         * page/Page.cpp:
2417         (WebCore::Page::Page): Initialize m_playbackTarget.
2418         (WebCore::Page::showPlaybackTargetPicker): Don't set m_documentRequestingPlaybackTargetPicker.
2419         (WebCore::Page::didChoosePlaybackTarget): Notify Pages in vector-order, lower level code
2420             now tracks which one requested the picker.
2421         (WebCore::Page::configurePlaybackTargetMonitoring): Don't track m_requiresPlaybackTargetMonitoring, it
2422             is too easy for it to get out of sync with the UI process state.
2423         * page/Page.h:
2424
2425         * platform/audio/MediaSession.cpp:
2426         (WebCore::MediaSession::canPlayToWirelessPlaybackTarget): New, client passthrough.
2427         (WebCore::MediaSession::startPlayingToPlaybackTarget): Ditto.
2428         (WebCore::MediaSession::stopPlayingToPlaybackTarget): Ditto.
2429         * platform/audio/MediaSession.h:
2430         (WebCore::MediaSessionClient::canPlayToWirelessPlaybackTarget):
2431         (WebCore::MediaSessionClient::startPlayingToPlaybackTarget):
2432         (WebCore::MediaSessionClient::stopPlayingToPlaybackTarget):
2433
2434         * platform/audio/MediaSessionManager.cpp:
2435         (WebCore::MediaSessionManager::sessionWillBeginPlayback): Call startPlayingToPlaybackTarget &
2436             stopPlayingToPlaybackTarget as necessary.
2437         * platform/audio/MediaSessionManager.h:
2438
2439         * platform/graphics/MediaPlaybackTarget.h:
2440         (WebCore::MediaPlaybackTarget::hasActiveRoute): New.
2441         * platform/graphics/MediaPlaybackTargetPickerClient.h:
2442         * platform/graphics/MediaPlayer.cpp:
2443         (WebCore::MediaPlayer::isCurrentPlaybackTargetSupported): New, engine passthrough.
2444         (WebCore::MediaPlayer::canPlayToWirelessPlaybackTarget): Ditto.
2445         (WebCore::MediaPlayer::startPlayingToPlaybackTarget): Ditto.
2446         (WebCore::MediaPlayer::stopPlayingToPlaybackTarget): Ditto.
2447         * platform/graphics/MediaPlayer.h:
2448         * platform/graphics/MediaPlayerPrivate.h:
2449         (WebCore::MediaPlayerPrivateInterface::isCurrentPlaybackTargetSupported):
2450         (WebCore::MediaPlayerPrivateInterface::wirelessVideoPlaybackDisabled):
2451         (WebCore::MediaPlayerPrivateInterface::canPlayToWirelessPlaybackTarget):
2452         (WebCore::MediaPlayerPrivateInterface::startPlayingToPlaybackTarget):
2453         (WebCore::MediaPlayerPrivateInterface::stopPlayingToPlaybackTarget):
2454
2455         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
2456         (WebCore::MediaPlaybackTarget::hasActiveRoute): New.
2457
2458         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2459         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget):
2460         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2461         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Use playerKVOProperties. Drive-by
2462             code cleanup.
2463         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Use playerKVOProperties.
2464         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName): Implement for Mac.
2465         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled): Delay callbacks
2466             while setting AVPlayer property.
2467         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Add logging. Don't set
2468             the AVPlayer outputContext immediately.
2469         (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): New.
2470         (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): New.
2471         (WebCore::playerKVOProperties): New.
2472         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): Notify when
2473             allowsExternalPlayback changes.
2474
2475         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2476         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2477         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetSupported): New.
2478         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setWirelessPlaybackTarget): Ditto.
2479         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::togglePlayingToPlaybackTarget): Ditto.
2480         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startPlayingToPlaybackTarget): Ditto.
2481         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::stopPlayingToPlaybackTarget): Ditto.
2482
2483         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2484         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2485         (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetSupported): Ditto.
2486         (WebCore::MediaPlayerPrivateQTKit::setWirelessPlaybackTarget): Ditto.
2487         (WebCore::MediaPlayerPrivateQTKit::togglePlayingToPlaybackTarget): Ditto.
2488         (WebCore::MediaPlayerPrivateQTKit::startPlayingToPlaybackTarget): Ditto.
2489         (WebCore::MediaPlayerPrivateQTKit::stopPlayingToPlaybackTarget): Ditto.
2490
2491 2015-04-01  Alex Christensen  <achristensen@webkit.org>
2492
2493         [Content Extensions] Properly handle regexes that match everything.
2494         https://bugs.webkit.org/show_bug.cgi?id=143281
2495
2496         Reviewed by Benjamin Poulain.
2497
2498         * contentextensions/ContentExtensionCompiler.cpp:
2499         (WebCore::ContentExtensions::compileRuleList):
2500         Make sure we always have at least one NFA for rule lists with triggers that all match everything.
2501         * contentextensions/DFABytecodeInterpreter.cpp:
2502         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
2503         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
2504         Add helper functions to reduce duplicate code.
2505         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
2506         Get all actions without flags from the DFA root.
2507         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2508         Remove branches when interpreting.
2509         * contentextensions/DFABytecodeInterpreter.h:
2510         Add helper functions to reduce duplicate code.
2511
2512 2015-04-01  Myles C. Maxfield  <mmaxfield@apple.com>
2513
2514         Addressing post-review comments.
2515         https://bugs.webkit.org/show_bug.cgi?id=143292
2516
2517         Unreviewed.
2518
2519         * platform/graphics/FontCascade.cpp:
2520         (WebCore::FontCascade::leadingExpansionOpportunity):
2521         (WebCore::FontCascade::trailingExpansionOpportunity):
2522
2523 2015-04-01  Per Arne Vollan  <peavo@outlook.com>
2524
2525         [WinCairo] Link errors, unresolved texture mapper methods.
2526         https://bugs.webkit.org/show_bug.cgi?id=143308
2527
2528         Reviewed by Alex Christensen.
2529
2530         New texture mapper files should be included in the project.
2531
2532         * WebCore.vcxproj/WebCore.vcxproj:
2533         * WebCore.vcxproj/WebCore.vcxproj.filters:
2534
2535 2015-04-01  Myles C. Maxfield  <mmaxfield@apple.com>
2536
2537         Support forcing expansion opportunities at the beginning and ending of a run
2538         https://bugs.webkit.org/show_bug.cgi?id=143292
2539
2540         Reviewed by David Hyatt.
2541
2542         Migrate ExpansionBehavior to an enum comprised of two values: one for leading behavior
2543         and one for trailing behavior. Each of these two values can take on a value of
2544         "force," "forbid," and neither. All calls that interact with justification are
2545         migrated to use this new structure.
2546
2547         Note that in this terminology, "leading" and "trailing" are with respect to the order
2548         that elements get laid out in a line. Therefore, leading is always on the left, since
2549         lines get laid out that way regardless of their bidi attributes.
2550
2551         This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
2552
2553         No new tests because there is no behavior change.
2554
2555         * platform/graphics/FontCascade.cpp:
2556         (WebCore::FontCascade::expansionOpportunityCountInternal): Migrate to these new
2557         values.
2558         (WebCore::FontCascade::expansionOpportunityCount): Ditto.
2559         (WebCore::FontCascade::leadingExpansionOpportunity): Returns whether one is present
2560         or not.
2561         (WebCore::FontCascade::trailingExpansionOpportunity): Ditto.
2562         * platform/graphics/FontCascade.h:
2563         * platform/graphics/GlyphBuffer.h: New leading expansion field.
2564         (WebCore::GlyphBuffer::setLeadingExpansion):
2565         (WebCore::GlyphBuffer::leadingExpansion):
2566         * platform/graphics/TextRun.h: m_expansionBehavior needs more bits.
2567         (WebCore::TextRun::expansionBehavior):
2568         (WebCore::TextRun::allowsLeadingExpansion): Deleted.
2569         (WebCore::TextRun::allowsTrailingExpansion): Deleted.
2570         * platform/graphics/WidthIterator.cpp: Update to support new type.
2571         (WebCore::WidthIterator::WidthIterator):
2572         (WebCore::expansionLocation): Where should we insert expansions?
2573         (WebCore::WidthIterator::advanceInternal): Use expansionLocation()
2574         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2575         (WebCore::FontCascade::adjustSelectionRectForComplexText):
2576         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
2577         * platform/graphics/mac/ComplexTextController.cpp: Same as WidthIterator
2578         (WebCore::ComplexTextController::ComplexTextController):
2579         (WebCore::ComplexTextController::advance):
2580         (WebCore::expansionLocation):
2581         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2582         * platform/graphics/mac/ComplexTextController.h:
2583         (WebCore::ComplexTextController::leadingExpansion):
2584         * platform/text/TextFlags.h: Add new enum values
2585         * rendering/InlineBox.h: Update to include new values.
2586         (WebCore::InlineBox::InlineBoxBitfields::InlineBoxBitfields):
2587         (WebCore::InlineBox::canHaveTrailingExpansion):
2588         (WebCore::InlineBox::setCanHaveTrailingExpansion):
2589         (WebCore::InlineBox::setForceTrailingExpansion):
2590         (WebCore::InlineBox::forceTrailingExpansion):
2591         (WebCore::InlineBox::setForceLeadingExpansion):
2592         (WebCore::InlineBox::forceLeadingExpansion):
2593         * rendering/InlineTextBox.h:
2594         * rendering/RenderBlockLineLayout.cpp: Update to use new FontCascade signatures.
2595         (WebCore::expansionBehaviorForInlineTextBox):
2596         (WebCore::applyExpansionBehavior):
2597         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
2598
2599 2015-04-01  Zalan Bujtas  <zalan@apple.com>
2600
2601         Lots of time spent querying table cell borders, when there are none.
2602         https://bugs.webkit.org/show_bug.cgi?id=143277
2603
2604         Reviewed by Simon Fraser.
2605
2606         This patch speeds up collapsed border queries by using existing collapsed border
2607         cache to calculate repaint rects and by introducing a fast path for zero width collapsed borders.
2608
2609         It reduces the number of calls to recompute collapsed borders from 36 000 to 1 600, while loading a page with a table of 400 rows (1 cell per row).
2610         When scrolling the same page all the way down to the bottom, the number of calls to recompute collapsed borders falls from 290 000 to 0.
2611
2612         Covered by existing tests.
2613
2614         * rendering/RenderTable.cpp:
2615         (WebCore::RenderTable::styleDidChange): This moves invalidation time from RenderTable::layout() to styleDidChange(). 
2616         (WebCore::RenderTable::invalidateCollapsedBorders):
2617         (WebCore::RenderTable::recalcCollapsedBorders):
2618         * rendering/RenderTable.h:
2619         (WebCore::RenderTable::collapsedBordersAreValid):
2620         (WebCore::RenderTable::invalidateCollapsedBorders): Deleted.
2621         * rendering/RenderTableCell.cpp:
2622         (WebCore::RenderTableCell::RenderTableCell):
2623         (WebCore::RenderTableCell::willBeRemovedFromTree): Invalidate caches so that when repaint rect is calculated, we don't end up using stale values.
2624         (WebCore::RenderTableCell::styleDidChange): Same as willBeRemovedFromTree.
2625         (WebCore::RenderTableCell::collapsedStartBorder): Check if collapsed border is zero -also query cache. 
2626         (WebCore::RenderTableCell::collapsedEndBorder):
2627         (WebCore::RenderTableCell::collapsedBeforeBorder):
2628         (WebCore::RenderTableCell::collapsedAfterBorder):
2629         (WebCore::RenderTableCell::cachedCollapsedLeftBorder):
2630         (WebCore::RenderTableCell::cachedCollapsedRightBorder):
2631         (WebCore::RenderTableCell::cachedCollapsedTopBorder):
2632         (WebCore::RenderTableCell::cachedCollapsedBottomBorder):
2633         (WebCore::RenderTableCell::paintCollapsedBorders):
2634         (WebCore::RenderTableCell::cellAtLeft): Deleted.
2635         (WebCore::RenderTableCell::cellAtRight): Deleted.
2636         (WebCore::RenderTableCell::cellAtTop): Deleted.
2637         (WebCore::RenderTableCell::cellAtBottom): Deleted.
2638         * rendering/RenderTableCell.h:
2639         (WebCore::RenderTableCell::invalidateHasEmptyCollapsedBorders):
2640         * rendering/RenderTableCol.cpp:
2641         (WebCore::RenderTableCol::styleDidChange):
2642         * rendering/RenderTableRow.cpp:
2643         (WebCore::RenderTableRow::styleDidChange):
2644         (WebCore::RenderTableRow::addChild):
2645         * rendering/RenderTableSection.cpp:
2646         (WebCore::RenderTableSection::styleDidChange):
2647         (WebCore::RenderTableSection::clearCachedCollapsedBorders): This is just an extra safety to invalidate collapsed border cache. This is always
2648         called together with RenderTable::invalidateCollapsedBorders() -and that should prevent the RenderCells to use the cache.  
2649         (WebCore::RenderTableSection::removeCachedCollapsedBorders):
2650         (WebCore::RenderTableSection::setCachedCollapsedBorder):
2651         (WebCore::RenderTableSection::cachedCollapsedBorder):
2652         * rendering/RenderTableSection.h:
2653
2654 2015-04-01  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2655
2656         [CMake][GTK] Use the right variable to include the Wayland headers.
2657         https://bugs.webkit.org/show_bug.cgi?id=143304
2658
2659         Reviewed by Carlos Garcia Campos.
2660
2661         No new tests, no behavior changes.
2662
2663         * PlatformGTK.cmake: Use the right variable WAYLAND_INCLUDE_DIRS.
2664
2665 2015-03-30  Philippe Normand  <pnormand@igalia.com>
2666
2667         [GStreamer] Move synchronous message handler to MediaPlayerPrivateGStreamerBase
2668         https://bugs.webkit.org/show_bug.cgi?id=143218
2669
2670         Reviewed by Carlos Garcia Campos.
2671
2672         Moved the pipeline pointer to the base class, sub-classes should
2673         now invoke setPipeline() when loading a resource. The base class
2674         now takes care of configuring the GL shared context, this is more
2675         logical because video rendering is also managed by this class.
2676
2677         No new tests, this is only a code refactoring.
2678
2679         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2680         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
2681         (WebCore::MediaPlayerPrivateGStreamer::load):
2682         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
2683         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
2684         (WebCore::MediaPlayerPrivateGStreamer::pause):
2685         (WebCore::MediaPlayerPrivateGStreamer::duration):
2686         (WebCore::MediaPlayerPrivateGStreamer::currentTime):
2687         (WebCore::MediaPlayerPrivateGStreamer::seek):
2688         (WebCore::MediaPlayerPrivateGStreamer::doSeek):
2689         (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
2690         (WebCore::MediaPlayerPrivateGStreamer::paused):
2691         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
2692         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
2693         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
2694         (WebCore::MediaPlayerPrivateGStreamer::setRate):
2695         (WebCore::MediaPlayerPrivateGStreamer::buffered):
2696         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2697         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
2698         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress):
2699         (WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
2700         (WebCore::MediaPlayerPrivateGStreamer::cancelLoad):
2701         (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
2702         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
2703         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
2704         (WebCore::MediaPlayerPrivateGStreamer::cacheDuration):
2705         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
2706         (WebCore::MediaPlayerPrivateGStreamer::audioSink):
2707         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2708         (WebCore::MediaPlayerPrivateGStreamer::simulateAudioInterruption):
2709         (WebCore::mediaPlayerPrivateSyncMessageCallback): Deleted.
2710         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Deleted.
2711         (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): Deleted.
2712         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2713         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2714         (WebCore::mediaPlayerPrivateNeedContextMessageCallback):
2715         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2716         (WebCore::MediaPlayerPrivateGStreamerBase::setPipeline):
2717         (WebCore::MediaPlayerPrivateGStreamerBase::handleNeedContextMessage):
2718         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2719         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2720
2721 2015-03-24  Philippe Normand  <philn@igalia.com>
2722
2723         [GStreamer] GstGL support in the video sink
2724         https://bugs.webkit.org/show_bug.cgi?id=138562
2725
2726         Use GStreamer's glimagesink for video rendering instead of our
2727         custom video sink if a recent-enough version of GstGL is found
2728         during the build. When glimagesink is used it passes a texture to
2729         the media player which then wraps it inside a TextureMapper
2730         texture later used for actual rendering.
2731
2732         Using this new code path will allow us to remove our custom sink
2733         entirely in the long term.
2734
2735         Reviewed by Carlos Garcia Campos.
2736
2737         No new test, existing media tests cover video rendering already.
2738
2739         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2740         (WebCore::mediaPlayerPrivateDrawCallback): client-draw signal callback.
2741         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
2742         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2743         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize): Better
2744         check for sample validity.
2745         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Ditto.
2746         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): Trigger a
2747         repaint and wait its completion.
2748         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
2749         Extract texture ID and video dimensions from the sample and do actual paint.
2750         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): Use
2751         glimagesink if GstGL is available.
2752         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2753
2754 2015-04-01  Joonghun Park  <jh718.park@samsung.com>
2755
2756         nullptr cleanup in StyleResolver
2757         https://bugs.webkit.org/show_bug.cgi?id=143260
2758
2759         Reviewed by Ryosuke Niwa.
2760
2761         No new tests, no behavior changes
2762
2763         * css/StyleResolver.cpp:
2764         (WebCore::StyleResolver::State::initForStyleResolve):
2765         (WebCore::StyleResolver::locateCousinList):
2766         (WebCore::StyleResolver::locateSharedStyle):
2767         (WebCore::StyleResolver::keyframeStylesForAnimation):
2768         (WebCore::StyleResolver::pseudoStyleForElement):
2769         (WebCore::StyleResolver::pseudoStyleRulesForElement):
2770         (WebCore::StyleResolver::findFromMatchedPropertiesCache):
2771         (WebCore::StyleResolver::applyMatchedProperties):
2772         (WebCore::StyleResolver::applyPropertyToStyle):
2773         (WebCore::StyleResolver::MatchedProperties::MatchedProperties):
2774         * css/StyleResolver.h:
2775         (WebCore::PseudoStyleRequest::PseudoStyleRequest):
2776         (WebCore::StyleResolverParentPusher::StyleResolverParentPusher):
2777
2778 2015-03-31  Simon Fraser  <simon.fraser@apple.com>
2779
2780         Make it possible to compute a region for elements on the page that have wheel event handlers
2781         https://bugs.webkit.org/show_bug.cgi?id=142807
2782
2783         Reviewed by David Hyatt.
2784         
2785         Make it possible to compute a region that covers the elements on the page that have
2786         a wheel event handler. This region may overestimate, but must not underestimate the area.
2787         
2788         Elements with wheel handlers are registered on the document, and when a document gains
2789         its first wheel handler, it registers the ownerElement in the parent document. Thus, on 
2790         the main frame, the region encompasses elements with handlers, and iframes whose subdocuments
2791         have handlers.
2792         
2793         Element gains some functions that allow it to return a rect which is the bounds of the element's
2794         renderer, and renders for its descendant elements, which is the size or larger than the event
2795         handling region for that element. Some configurations (e.g. position:fixed) require special
2796         treatment.
2797         
2798         Document::absoluteRegionForEventTargets() can then iterate over all elements in the given set,
2799         and build a Region for those (short-circuiting if the document itself has a handler).
2800         
2801         The new code is exercised for the debug MouseWheelRegionOverlay, and also added to the
2802         non-fast scrollable region, used by threaded scrolling.
2803
2804         Tests: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/handlers-in-iframes.html
2805                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child.html
2806                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-in-columns.html
2807                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-in-region.html
2808                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed.html
2809                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-document.html
2810                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed.html
2811                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-region-basic.html
2812
2813         * dom/ContainerNode.h:
2814         (WebCore::ContainerNode::absoluteEventHandlerBounds): Base class implementation; returns empty rect.
2815         * dom/Document.cpp:
2816         (WebCore::Document::prepareForDestruction): Unregister from the parent document.
2817         (WebCore::Document::didAddWheelEventHandler): Add to the wheel handler set. Tell the parent
2818         document if we are adding wheel handlers for the first time. Eventually the wheelEventHandlerCountChanged()
2819         code will be removed, now we have the set. Tell debug overlays that we changed.
2820         (WebCore::Document::didRemoveWheelEventHandler): Remove from the set, and unregister with the parent
2821         document if necessary. Tell debug overlays that we changed.
2822         (WebCore::Document::didAddTouchEventHandler): Minor cleanup.
2823         (WebCore::Document::didRemoveTouchEventHandler): Ditto.
2824         (WebCore::Document::didRemoveEventTargetNode): Remove from wheel targets.
2825         (WebCore::Document::absoluteEventHandlerBounds): Implementation of the ContainerNode
2826         function, just return the document bounds.
2827         (WebCore::Document::absoluteRegionForEventTargets): Iterate over the given event targets,
2828         and call absoluteEventHandlerBounds() on each.
2829         * dom/Document.h:
2830         (WebCore::Document::wheelEventTargets):
2831         * dom/Element.cpp:
2832         (WebCore::layoutOverflowRectContainsAllDescendants): Return true if we can determine that the
2833         layoutOverflow bounds of the given renderer contains the renderers of all descendant elements.
2834         (WebCore::Element::eventBounds): Get the "event handling" bounds of this element (excluding
2835         descendants), and while doing so, compute whether any descendants are position:fixed, and whether
2836         these bounds are known to include descendants.
2837         (WebCore::Element::eventBoundsOfElementAndDescendants): Recursive function that short-circuits
2838         if it can determine that descendants are enclosed by the bounds.
2839         (WebCore::Element::absoluteEventHandlerBounds):
2840         * dom/Element.h:
2841         * page/DebugPageOverlays.cpp:
2842         (WebCore::MouseWheelRegionOverlay::updateRegion): Ask the document for the region of wheel
2843         event handlers.
2844         * page/scrolling/ScrollingCoordinator.cpp:
2845         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): Add the wheel handler region
2846         to the non-fast scrollable region.
2847         * rendering/RenderLayer.cpp:
2848         (WebCore::RenderLayer::scrollTo): Overflow scrolling needs to dirty event regions.
2849         * rendering/RenderObject.cpp:
2850         (WebCore::RenderObject::absoluteBoundingBoxRect): Need to pass the "wasFixed" flag out
2851         of this function.
2852         (WebCore::RenderObject::localToAbsolute): Ditto.
2853         * rendering/RenderObject.h:
2854
2855 2015-03-31  Alexey Proskuryakov  <ap@apple.com>
2856
2857         Fix bindings tests results after <http://trac.webkit.org/changeset/182205>.
2858
2859         * bindings/scripts/test/JS/JSTestObj.cpp:
2860         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
2861         (WebCore::setJSTestObjConditionalAttr4Constructor):
2862         (WebCore::setJSTestObjConditionalAttr5Constructor):
2863         (WebCore::setJSTestObjConditionalAttr6Constructor):
2864         (WebCore::setJSTestObjReplaceableAttribute):
2865
2866 2015-03-31  Benjamin Poulain  <bpoulain@apple.com>
2867
2868         Content Extensions: split the state machines to minimize prefix states
2869         https://bugs.webkit.org/show_bug.cgi?id=143253
2870
2871         Reviewed by Alex Christensen.
2872
2873         With this patch, we refine how the URLs are partitioned to make
2874         multiple small machines instead of a big one.
2875
2876         Here, considering each pattern as a language, I took the simplest
2877         partitioning: take the union minimizing the states
2878         that differentiate languages.
2879
2880         The idea is the following: every time a subgraph can be skipped
2881         or repeated, it is an opportunity for a merged language to start
2882         with a distinguishable state.
2883         To avoid accumulating those differences, we only merge languages
2884         that share the exact same "variable" subgraph as a prefix.
2885
2886         A side effect is that we could create as many machines as we have patterns.
2887         We'll have to address that in a follow-up by merging small machines
2888         until they reach a certain size.
2889         In the common cases, patterns look very much alike so that is not a problem
2890         at the moment.
2891
2892         * WebCore.xcodeproj/project.pbxproj:
2893         * contentextensions/CombinedURLFilters.cpp: Added.
2894         I moved the prefix tree and graph construction out of URLFilterParser for clarity.
2895
2896         CombinedURLFilters maintain the term prefix tree. Instead of generating on the fly
2897         as we build the prefix tree, we first generate the entire tree of terms, then generate
2898         NFAs for each branch without a variable prefix.
2899
2900         (WebCore::ContentExtensions::CombinedURLFilters::CombinedURLFilters):
2901         (WebCore::ContentExtensions::CombinedURLFilters::~CombinedURLFilters):
2902
2903         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
2904         Note here that we keep track of which subtree contains a any variable length term.
2905         Instead of anotating the edges, the destination vertex is anotated with the information
2906         from the edge.
2907
2908         The flag "inVariableLengthPrefix" is there to simplify traversal.
2909
2910         (WebCore::ContentExtensions::generateNFAForSubtree):
2911         (WebCore::ContentExtensions::CombinedURLFilters::createNFAs):
2912         Since we are traversing a tree generated by string, using the stack for recursion
2913         is out of the question.
2914
2915         Fortunately, the entire state is very simple when going depth first: we only need
2916         the active vertex and edge, and traverse the edges in order.
2917
2918         To do keep track of the edges, I used the HashTable iterator on the current term.
2919         Since no vertex is modified for generation, storing the iterators is safe.
2920
2921         * contentextensions/CombinedURLFilters.h:
2922         * contentextensions/ContentExtensionCompiler.cpp:
2923         (WebCore::ContentExtensions::compileRuleList):
2924         * contentextensions/NFA.cpp:
2925         (WebCore::ContentExtensions::NFA::setActions):
2926         (WebCore::ContentExtensions::NFA::debugPrintDot):
2927         (WebCore::ContentExtensions::NFA::setFinal): Deleted.
2928         (WebCore::ContentExtensions::NFA::addRuleId): Deleted.
2929         * contentextensions/NFA.h:
2930         * contentextensions/NFAGraphBuilder.cpp: Added.
2931         * contentextensions/NFAGraphBuilder.h: Added.
2932         * contentextensions/NFANode.h:
2933         * contentextensions/Term.h: Added.
2934         Move the Term to its own file since it is now shared between the parser
2935         and the CombinedURLFilters.
2936
2937         (WebCore::ContentExtensions::Term::CharacterSet::operator==):
2938         (WebCore::ContentExtensions::Term::CharacterSet::hash):
2939         (WebCore::ContentExtensions::Term::Group::operator==):
2940         (WebCore::ContentExtensions::Term::Group::hash):
2941         (WebCore::ContentExtensions::TermHash::hash):
2942         (WebCore::ContentExtensions::TermHash::equal):
2943         (WebCore::ContentExtensions::Term::Term):
2944         (WebCore::ContentExtensions::Term::~Term):
2945         (WebCore::ContentExtensions::Term::isValid):
2946         (WebCore::ContentExtensions::Term::addCharacter):
2947         (WebCore::ContentExtensions::Term::extendGroupSubpattern):
2948         (WebCore::ContentExtensions::Term::quantify):
2949         (WebCore::ContentExtensions::Term::Term::generateGraph):
2950         (WebCore::ContentExtensions::Term::isEndOfLineAssertion):
2951         (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter):
2952         (WebCore::ContentExtensions::Term::isKnownToMatchAnyString):
2953         (WebCore::ContentExtensions::Term::hasFixedLength):
2954         (WebCore::ContentExtensions::Term::operator=):
2955         (WebCore::ContentExtensions::Term::operator==):
2956         (WebCore::ContentExtensions::Term::hash):
2957         (WebCore::ContentExtensions::Term::isEmptyValue):
2958         (WebCore::ContentExtensions::Term::isDeletedValue):
2959         (WebCore::ContentExtensions::Term::isUniversalTransition):
2960         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
2961         (WebCore::ContentExtensions::Term::destroy):
2962         * contentextensions/URLFilterParser.cpp:
2963         (WebCore::ContentExtensions::PatternParser::PatternParser):
2964         (WebCore::ContentExtensions::PatternParser::finalize):
2965         (WebCore::ContentExtensions::PatternParser::assertionBOL):
2966         (WebCore::ContentExtensions::URLFilterParser::URLFilterParser):
2967         (WebCore::ContentExtensions::URLFilterParser::addPattern):
2968         (WebCore::ContentExtensions::Term::Term): Deleted.
2969         (WebCore::ContentExtensions::Term::~Term): Deleted.
2970         (WebCore::ContentExtensions::Term::isValid): Deleted.
2971         (WebCore::ContentExtensions::Term::addCharacter): Deleted.
2972         (WebCore::ContentExtensions::Term::extendGroupSubpattern): Deleted.
2973         (WebCore::ContentExtensions::Term::quantify): Deleted.
2974         (WebCore::ContentExtensions::Term::generateGraph): Deleted.
2975         (WebCore::ContentExtensions::Term::isEndOfLineAssertion): Deleted.
2976         (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter): Deleted.
2977         (WebCore::ContentExtensions::Term::isKnownToMatchAnyString): Deleted.
2978         (WebCore::ContentExtensions::Term::operator=): Deleted.
2979         (WebCore::ContentExtensions::Term::operator==): Deleted.
2980         (WebCore::ContentExtensions::Term::hash): Deleted.
2981         (WebCore::ContentExtensions::Term::isEmptyValue): Deleted.
2982         (WebCore::ContentExtensions::Term::isDeletedValue): Deleted.
2983         (WebCore::ContentExtensions::Term::isUniversalTransition): Deleted.
2984         (WebCore::ContentExtensions::Term::generateSubgraphForAtom): Deleted.
2985         (WebCore::ContentExtensions::Term::destroy): Deleted.
2986         (WebCore::ContentExtensions::Term::CharacterSet::operator==): Deleted.
2987         (WebCore::ContentExtensions::Term::CharacterSet::hash): Deleted.
2988         (WebCore::ContentExtensions::Term::Group::operator==): Deleted.
2989         (WebCore::ContentExtensions::Term::Group::hash): Deleted.
2990         (WebCore::ContentExtensions::TermHash::hash): Deleted.
2991         (WebCore::ContentExtensions::TermHash::equal): Deleted.
2992         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder): Deleted.
2993         (WebCore::ContentExtensions::GraphBuilder::finalize): Deleted.
2994         (WebCore::ContentExtensions::GraphBuilder::assertionBOL): Deleted.
2995         * contentextensions/URLFilterParser.h:
2996
2997 2015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
2998
2999         Move ExpansionBehaviorFlags and TextDirection to their own file
3000         https://bugs.webkit.org/show_bug.cgi?id=143273
3001
3002         Reviewed by Simon Fraser.
3003
3004         This is a mechanical change. It just moves code around.
3005
3006         This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
3007
3008         No new tests because there is no behavior change.
3009
3010         * Modules/notifications/Notification.h:
3011         * WebCore.vcxproj/WebCore.vcxproj:
3012         * WebCore.vcxproj/WebCore.vcxproj.filters:
3013         * WebCore.xcodeproj/project.pbxproj:
3014         * css/CSSPrimitiveValueMappings.h:
3015         * css/CSSProperty.h:
3016         * dom/Position.h:
3017         * editing/VisiblePosition.h:
3018         * editing/VisibleUnits.h:
3019         * editing/htmlediting.h:
3020         * html/canvas/CanvasRenderingContext2D.cpp:
3021         (WebCore::CanvasRenderingContext2D::drawTextInternal):
3022         * html/canvas/CanvasRenderingContext2D.h:
3023         * platform/LengthBox.h:
3024         * platform/PopupMenuStyle.h:
3025         * platform/graphics/FontCascade.h:
3026         * platform/graphics/LayoutBoxExtent.h:
3027         * platform/graphics/TextRun.h:
3028         * platform/ios/SelectionRect.h:
3029         * platform/text/BidiResolver.h:
3030         * platform/text/StringWithDirection.h:
3031         * platform/text/TextHelpers.h: Renamed from Source/WebCore/platform/text/TextDirection.h.
3032         (WebCore::isLeftToRightDirection):
3033         * platform/win/PopupMenuWin.cpp:
3034         (WebCore::PopupMenuWin::paint):
3035         * rendering/EllipsisBox.cpp:
3036         (WebCore::EllipsisBox::paint):
3037         (WebCore::EllipsisBox::selectionRect):
3038         (WebCore::EllipsisBox::paintSelection):
3039         * rendering/HitTestLocation.h:
3040         * rendering/HitTestResult.h:
3041         * rendering/InlineBox.h:
3042         * rendering/InlineTextBox.h:
3043         (WebCore::InlineTextBox::expansionBehavior):
3044         * rendering/RenderBlock.cpp:
3045         (WebCore::constructTextRunInternal):
3046         (WebCore::RenderBlock::constructTextRun):
3047         * rendering/RenderBlock.h:
3048         * rendering/RenderFileUploadControl.cpp:
3049         (WebCore::RenderFileUploadControl::paintObject):
3050         (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
3051         * rendering/RenderListBox.cpp:
3052         (WebCore::RenderListBox::updateFromElement):
3053         (WebCore::RenderListBox::paintItemForeground):
3054         * rendering/RenderListMarker.cpp:
3055         (WebCore::RenderListMarker::computePreferredLogicalWidths):
3056         (WebCore::RenderListMarker::getRelativeMarkerRect):
3057         * rendering/RenderMenuList.cpp:
3058         (RenderMenuList::updateOptionsWidth):
3059         * rendering/RenderTextControl.cpp:
3060         (WebCore::RenderTextControl::getAverageCharWidth):
3061         * rendering/RenderThemeIOS.mm:
3062         * rendering/style/RenderStyle.h:
3063         * rendering/svg/SVGInlineTextBox.cpp:
3064         (WebCore::SVGInlineTextBox::constructTextRun):
3065         * rendering/svg/SVGTextMetrics.cpp:
3066         (WebCore::SVGTextMetrics::constructTextRun):
3067
3068 2015-03-31  Yusuke Suzuki  <utatane.tea@gmail.com>
3069
3070         Clean up Identifier factories to clarify the meaning of StringImpl*
3071         https://bugs.webkit.org/show_bug.cgi?id=143146
3072
3073         Reviewed by Filip Pizlo.
3074
3075         Just change Identifier creations.
3076
3077         1. If the code creates Identifier from StringImpl*
3078         which is treated as symbol or string(unique id), use Identifier::fromUid.
3079         2. If the code creates Identifier from string, use Identifier::fromString.
3080
3081         * Modules/plugins/QuickTimePluginReplacement.mm:
3082         (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
3083         (WebCore::QuickTimePluginReplacement::installReplacement):
3084         * bindings/js/IDBBindingUtilities.cpp:
3085         (WebCore::get):
3086         (WebCore::set):
3087         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3088         (WebCore::JSCSSStyleDeclaration::getOwnPropertyNames):
3089         * bindings/js/JSCallbackData.cpp:
3090         (WebCore::JSCallbackData::invokeCallback):
3091         * bindings/js/JSCommandLineAPIHostCustom.cpp:
3092         (WebCore::getJSListenerFunctions):
3093         (WebCore::JSCommandLineAPIHost::getEventListeners):
3094         * bindings/js/JSCryptoAlgorithmBuilder.cpp:
3095         (WebCore::JSCryptoAlgorithmBuilder::add):
3096         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3097         (WebCore::getProperty):
3098         (WebCore::getHashAlgorithm):
3099         * bindings/js/JSCryptoKeySerializationJWK.cpp:
3100         (WebCore::getJSArrayFromJSON):
3101         (WebCore::getStringFromJSON):
3102         (WebCore::getBooleanFromJSON):
3103         (WebCore::addToJSON):
3104         (WebCore::buildJSONForRSAComponents):
3105         (WebCore::addBoolToJSON):
3106         (WebCore::addUsagesToJSON):
3107         * bindings/js/JSCustomXPathNSResolver.cpp:
3108         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
3109         * bindings/js/JSDOMStringMapCustom.cpp:
3110         (WebCore::JSDOMStringMap::getOwnPropertyNames):
3111         * bindings/js/JSDOMWindowCustom.cpp:
3112         (WebCore::JSDOMWindow::defineOwnProperty):
3113         (WebCore::JSDOMWindow::setLocation):
3114         (WebCore::DialogHandler::dialogCreated):
3115         (WebCore::DialogHandler::returnValue):
3116         * bindings/js/JSDeviceMotionEventCustom.cpp:
3117         (WebCore::readAccelerationArgument):
3118         (WebCore::readRotationRateArgument):
3119         (WebCore::createAccelerationObject):
3120         (WebCore::createRotationRateObject):
3121         * bindings/js/JSDictionary.cpp:
3122         (WebCore::JSDictionary::tryGetProperty):
3123         * bindings/js/JSEventListener.cpp:
3124         (WebCore::JSEventListener::handleEvent):
3125         * bindings/js/JSHTMLAllCollectionCustom.cpp:
3126         (WebCore::callHTMLAllCollection):
3127         (WebCore::JSHTMLAllCollection::item):
3128         (WebCore::JSHTMLAllCollection::namedItem):
3129         * bindings/js/JSHTMLDocumentCustom.cpp:
3130         (WebCore::JSHTMLDocument::all):
3131         (WebCore::JSHTMLDocument::setAll):
3132         (WebCore::JSHTMLDocument::open):
3133         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
3134         (WebCore::JSHTMLFormControlsCollection::namedItem):
3135         * bindings/js/JSIDBDatabaseCustom.cpp:
3136         (WebCore::JSIDBDatabase::createObjectStore):
3137         * bindings/js/JSIDBObjectStoreCustom.cpp:
3138         (WebCore::JSIDBObjectStore::createIndex):
3139         * bindings/js/JSImageDataCustom.cpp:
3140         (WebCore::toJS):
3141         * bindings/js/JSInspectorFrontendHostCustom.cpp:
3142         (WebCore::populateContextMenuItems):
3143         * bindings/js/JSLazyEventListener.cpp:
3144         (WebCore::JSLazyEventListener::initializeJSFunction):
3145         * bindings/js/JSNodeFilterCondition.cpp:
3146         (WebCore::JSNodeFilterCondition::acceptNode):
3147         * bindings/js/JSSQLResultSetRowListCustom.cpp:
3148         (WebCore::JSSQLResultSetRowList::item):
3149         * bindings/js/JSStorageCustom.cpp:
3150         (WebCore::JSStorage::getOwnPropertyNames):
3151         * bindings/js/ReadableStreamJSSource.cpp:
3152         (WebCore::setInternalSlotToObject):
3153         (WebCore::getInternalSlotFromObject):
3154         * bindings/js/ScriptGlobalObject.cpp:
3155         (WebCore::ScriptGlobalObject::set):
3156         (WebCore::ScriptGlobalObject::get):
3157         (WebCore::ScriptGlobalObject::remove):
3158         * bindings/js/SerializedScriptValue.cpp:
3159         (WebCore::CloneSerializer::CloneSerializer):
3160         (WebCore::CloneSerializer::write):
3161         (WebCore::CloneDeserializer::deserialize):
3162         * bindings/objc/WebScriptObject.mm:
3163         (-[WebScriptObject callWebScriptMethod:withArguments:]):
3164         (-[WebScriptObject setValue:forKey:]):
3165         (-[WebScriptObject valueForKey:]):
3166         (-[WebScriptObject removeWebScriptKey:]):
3167         (-[WebScriptObject hasWebScriptKey:]):
3168         * bindings/scripts/CodeGeneratorJS.pm:
3169         (GenerateImplementation):
3170         * bindings/scripts/test/JS/JSFloat64Array.cpp:
3171         (WebCore::JSFloat64Array::getOwnPropertyNames):
3172         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3173         (WebCore::JSTestEventTarget::getOwnPropertyNames):
3174         * bindings/scripts/test/JS/JSTestObj.cpp:
3175         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
3176         (WebCore::setJSTestObjConditionalAttr4Constructor):
3177         (WebCore::setJSTestObjConditionalAttr5Constructor):
3178         (WebCore::setJSTestObjConditionalAttr6Constructor):
3179         (WebCore::setJSTestObjReplaceableAttribute):
3180         * bridge/c/c_utility.cpp:
3181         (JSC::Bindings::identifierFromNPIdentifier):
3182         * bridge/objc/objc_runtime.mm:
3183         (JSC::Bindings::ObjcFallbackObjectImp::defaultValue):
3184         * bridge/testbindings.cpp:
3185         (main):
3186         * bridge/testbindings.mm:
3187         (main):
3188         * contentextensions/ContentExtensionParser.cpp:
3189         (WebCore::ContentExtensions::loadTrigger):
3190         (WebCore::ContentExtensions::loadAction):
3191         * html/HTMLMediaElement.cpp:
3192         (WebCore::HTMLMediaElement::parseAttribute):
3193         * html/HTMLPlugInImageElement.cpp:
3194         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
3195         * testing/js/WebCoreTestSupport.cpp:
3196         (WebCoreTestSupport::injectInternalsObject):
3197
3198 2015-03-31  Jer Noble  <jer.noble@apple.com>
3199
3200         [Mac] Songza.com fails to play; QTKit path reports it is always "seeking".
3201         https://bugs.webkit.org/show_bug.cgi?id=143274
3202
3203         Rubber-stamped by Eric Carlson.
3204
3205         MediaTime::invalidTime() is always greater than any valid time. So when
3206         checking to see if MediaPlayerPrivateQTKit is seeking, first check if the
3207         m_seekTo time is valid before checking whether it's > 0.
3208
3209         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3210         (WebCore::MediaPlayerPrivateQTKit::seeking):
3211
3212 2015-03-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
3213
3214         border-image with 'fill' keyword does not fill the middle area unless the border width is greater than zero.
3215         https://bugs.webkit.org/show_bug.cgi?id=142650.
3216
3217         Reviewed by Simon Fraser.
3218
3219         The decoration of a RenderBox, a RenderTable or an InlineFlowBox should be
3220         drawn if its RenderStyle has a non-zero width border or the border-image
3221         has the keyword fill.
3222
3223         Tests: fast/borders/border-image-fill-inline-no-border.html
3224                fast/borders/border-image-fill-no-border.html
3225
3226         * rendering/InlineFlowBox.cpp:
3227         (WebCore::InlineFlowBox::paintBoxDecorations):
3228         * rendering/RenderBox.cpp:
3229         (WebCore::RenderBox::paintBoxDecorations):
3230         * rendering/RenderBoxModelObject.cpp:
3231         (WebCore::RenderBoxModelObject::hasBoxDecorationStyle):
3232         * rendering/RenderTable.cpp:
3233         (WebCore::RenderTable::paintBoxDecorations):
3234         * rendering/style/BorderData.h:
3235         (WebCore::BorderData::hasFill):
3236         * rendering/style/RenderStyle.h:
3237
3238 2015-03-31  Alex Christensen  <achristensen@webkit.org>
3239
3240         [Win] Unreviewed build fix.
3241
3242         * WebCore.vcxproj/WebCore.vcxproj:
3243         Don't include inspector files twice in debug builds.
3244         InspectorAllInOne.cpp is now used on debug builds.
3245
3246 2015-03-31  David Hyatt  <hyatt@apple.com>
3247
3248         [New Block-Inside-Inline Model] Anonymous inline-blocks should size as though they are block-level.
3249         https://bugs.webkit.org/show_bug.cgi?id=143271
3250
3251         Reviewed by Dean Jackson.
3252
3253         Added fast/block/inside-inlines/block-width-check.html.
3254
3255         * rendering/RenderBox.cpp:
3256         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
3257         Return false when an anonymous inline-block is encountered, since we want to treat it like a regular
3258         block instead.
3259
3260 2015-03-31  Commit Queue  <commit-queue@webkit.org>
3261
3262         Unreviewed, rolling out r182186.
3263         https://bugs.webkit.org/show_bug.cgi?id=143270
3264
3265         it crashes all the WebGL tests on the Debug bots (Requested by
3266         dino on #webkit).
3267
3268         Reverted changeset:
3269
3270         "Web Inspector: add 2D/WebGL canvas instrumentation
3271         infrastructure"
3272         https://bugs.webkit.org/show_bug.cgi?id=137278
3273         http://trac.webkit.org/changeset/182186
3274
3275 2015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
3276
3277         Crash in CGContextShowGlyphsWithAdvances when passing kCGFontIndexInvalid
3278         https://bugs.webkit.org/show_bug.cgi?id=143114
3279
3280         This is a workaround for <rdar://problem/20230073>. Please remove when it is no longer necessary.
3281
3282         Reviewed by Alexey Proskuryakov.
3283
3284         Covered by:
3285         compositing/regions/floated-region-with-transformed-child.html
3286         compositing/regions/floated-region-with-transformed-child-expected.html
3287         fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005.html
3288         fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005-expected.html
3289         fast/regions/overflow/overflow-content-transform-rotate.html
3290         fast/regions/overflow/overflow-content-transform-rotate-expected.html
3291
3292         * platform/graphics/GlyphBuffer.h:
3293         (WebCore::GlyphBuffer::shrink): Performing shaping may remove glyphs, so we need to shrink the GlyphBuffer.
3294         * platform/graphics/WidthIterator.cpp:
3295         (WebCore::applyFontTransforms): Filter out kCGFontIndexInvalid.
3296         (WebCore::WidthIterator::advanceInternal): Moved code into applyFontTransforms, and trigger the
3297         shrink of the GlyphBuffer.
3298
3299 2015-03-31  Beth Dakin  <bdakin@apple.com>
3300
3301         REGRESSION (r173484): Reducing content of scrollable region does not reset scroll 
3302         position
3303         https://bugs.webkit.org/show_bug.cgi?id=138525
3304         -and corresponding-
3305         rdar://problem/18166043
3306
3307         Reviewed by Simon Fraser.
3308
3309         The change that caused this regression was correct. That change does not allow 
3310         RenderLayer to update scroll position after a layout if a rubber-band is currently 
3311         happening. The change caused this regression because all of the member variables 
3312         in ScrollController that attempt to keep track of the current state of the scroll 
3313         gesture (m_inScrollGesture, m_momentumScrollInProgress, and 
3314         m_snapRubberbandTimerIsActive) all indicated that a momentum scroll gesture was 
3315         still in action for this div even though it very much is not when the bug happens. 
3316         Those variables were never properly re-set because the 
3317         PlatformWheelEventPhaseEnded events never got dispatched to the ScrollController, 
3318         which brought the investigation back to Element.
3319
3320         We must still dispatch events that have zero delta so that the default event 
3321         handlers can handle them, but we should stopPropagation() so that these events are 
3322         not sent to the DOM. Websites will break if they get wheel events with no delta.
3323         * dom/Element.cpp:
3324         (WebCore::Element::dispatchWheelEvent):
3325
3326 2015-03-31  Alex Christensen  <achristensen@webkit.org>
3327
3328         [Win] Unreviewed debug build fix after r182186.
3329
3330         * WebCore.vcxproj/WebCore.vcxproj:
3331         Include InspectorAllInOne.cpp in debug builds.
3332
3333 2015-03-30  David Hyatt  <hyatt@apple.com>
3334