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