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