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