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