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