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