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