c208265eaea0b0527edfdf4bb57effa572022de4
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-06-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         [GTK] Empty gtk-font-name setting causes WebProcess crash rendering pages
4         https://bugs.webkit.org/show_bug.cgi?id=146246
5
6         Reviewed by Sergio Villar Senin.
7
8         Return early if system font is empty.
9
10         * rendering/RenderThemeGtk.cpp:
11         (WebCore::RenderThemeGtk::updateCachedSystemFontDescription):
12
13 2015-06-24  Chris Dumez  <cdumez@apple.com>
14
15         Unreviewed, EFL build fix after r185940.
16
17         Members were initialized in wrong order.
18
19         * Modules/mediastream/MediaDeviceInfo.cpp:
20         (WebCore::MediaDeviceInfo::MediaDeviceInfo):
21
22 2015-06-24  Chris Dumez  <cdumez@apple.com>
23
24         Unreviewed, Build fix after r185940.
25
26         Move implementation inside WebCore namespace.
27
28         * Modules/mediastream/MediaDeviceInfo.cpp:
29
30 2015-06-24  Chris Dumez  <cdumez@apple.com>
31
32         Unreviewed, speculative GTK build fix after 185940.
33
34         Add new cpp file to CMakeLists.txt.
35
36         * CMakeLists.txt:
37
38 2015-06-24  Matt Daiter  <mdaiter@apple.com>
39
40         Building MediaDeviceInfo for enumerateDevices
41         https://bugs.webkit.org/show_bug.cgi?id=146257
42         <rdar://problem/21513462>
43
44         Reviewed by Eric Carlson.
45
46         MediaDeviceInfo necessary for enumerateDevices
47
48         * CMakeLists.txt: Added MediaDevicesInfo.idl
49         * DerivedSources.make: Added MediaDevicesInfo.idl
50         * Modules/mediastream/MediaDeviceInfo.h: Created class for MediaDevicesInfo
51         (WebCore::MediaDeviceInfo::create): Allocates class
52         (WebCore::MediaDeviceInfo::MediaDeviceInfo): Creates class for public
53         (WebCore::MediaDeviceInfo::~MediaDeviceInfo): 
54         (WebCore::MediaDeviceInfo::label):
55         (WebCore::MediaDeviceInfo::deviceId):
56         (WebCore::MediaDeviceInfo::groupId):
57         (WebCore::MediaDeviceInfo::kind):
58         * Modules/mediastream/MediaDeviceInfo.idl:
59         * WebCore.xcodeproj/project.pbxproj:
60
61 2015-06-24  Anders Carlsson  <andersca@apple.com>
62
63         Detect view services by using the "com.apple.UIKit.vends-view-services" entitlement
64         https://bugs.webkit.org/show_bug.cgi?id=146301
65
66         Reviewed by Tim Horton.
67
68         * WebCore.xcodeproj/project.pbxproj:
69         * platform/spi/cocoa/SecuritySPI.h:
70
71 2015-06-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
72
73         Add a new color -apple-wireless-playback-target-active
74         https://bugs.webkit.org/show_bug.cgi?id=146269
75         <rdar://problem/21465189>
76
77         Reviewed by Dean Jackson.
78
79         At the moment we use -apple-system-blue to indicate an Airplay route is
80         active. This might not always be blue, so we need to add another system
81         color with a name that will allow us to change the underlying color.
82         Initially -apple-wireless-playback-target-active will be an alias to
83         -apple-system-blue.
84
85         Existing tests are modified to include the new color value.
86
87         * Modules/mediacontrols/mediaControlsApple.js:
88         (Controller.prototype.updateWirelessTargetPickerButton):
89         * Modules/mediacontrols/mediaControlsiOS.css:
90         (video::-webkit-media-controls-wireless-playback-picker-button.playing):
91         Use the new color value in the media controls.
92         
93         * css/CSSParser.cpp:
94         (WebCore::isAppleLegacyCssValueKeyword): Returns true if the value keyword
95         has an '-apple' prefix which has to be replaced by '-webkit'
96         
97         (WebCore::cssValueKeywordID): Call a new function which handles all the
98         '-apple' legacy keywords.
99         
100         * css/CSSValueKeywords.in: Define the new color keyword.
101         
102         * rendering/RenderThemeIOS.mm:
103         (WebCore::RenderThemeIOS::systemColor):
104         * rendering/RenderThemeMac.mm:
105         (WebCore::RenderThemeMac::systemColor):
106         Define the value of the new color keyword to be an alias of systemBlueColor.
107
108 2015-06-24  Matt Rajca  <mrajca@apple.com>
109
110         MediaSession: propagate MediaSessionMetadata to WebPageProxy
111         https://bugs.webkit.org/show_bug.cgi?id=146282
112
113         Reviewed by Darin Adler and Tim Horton.
114
115         * Modules/mediasession/MediaSession.cpp:
116         (WebCore::MediaSession::setMetadata):
117
118 2015-06-24  Chris Dumez  <cdumez@apple.com>
119
120         Null dereference in DocumentLoader::areAllLoadersPageCacheAcceptable()
121         https://bugs.webkit.org/show_bug.cgi?id=146286
122         <rdar://problem/21523788>
123
124         Reviewed by Sam Weinig.
125
126         Add null check for the Page in areAllLoadersPageCacheAcceptable()
127         to fix this top crasher until I can investigate how this can happen.
128
129         * loader/DocumentLoader.cpp:
130         (WebCore::areAllLoadersPageCacheAcceptable):
131
132 2015-06-24  Anders Carlsson  <andersca@apple.com>
133
134         Move PluginMainThreadScheduler to WebKit/win
135         https://bugs.webkit.org/show_bug.cgi?id=146289
136
137         Reviewed by Tim Horton.
138
139         * CMakeLists.txt:
140         * Configurations/WebCore.xcconfig:
141         * WebCore.vcxproj/WebCore.vcxproj:
142         * WebCore.vcxproj/WebCore.vcxproj.filters:
143         * WebCore.xcodeproj/project.pbxproj:
144         * plugins/PluginMainThreadScheduler.cpp:
145         (WebCore::PluginMainThreadScheduler::scheduler): Deleted.
146         (WebCore::PluginMainThreadScheduler::PluginMainThreadScheduler): Deleted.
147         (WebCore::PluginMainThreadScheduler::scheduleCall): Deleted.
148         (WebCore::PluginMainThreadScheduler::registerPlugin): Deleted.
149         (WebCore::PluginMainThreadScheduler::unregisterPlugin): Deleted.
150         (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin): Deleted.
151         (WebCore::PluginMainThreadScheduler::dispatchCalls): Deleted.
152         (WebCore::PluginMainThreadScheduler::mainThreadCallback): Deleted.
153         * plugins/PluginMainThreadScheduler.h:
154         (WebCore::PluginMainThreadScheduler::Call::Call): Deleted.
155         (WebCore::PluginMainThreadScheduler::Call::performCall): Deleted.
156
157 2015-06-24  Dean Jackson  <dino@apple.com>
158
159         Better fix for Element with blur backdrop-filter shows edge duplication and dark edges
160         https://bugs.webkit.org/show_bug.cgi?id=146287
161         <rdar://problem/21530437>
162
163         Reviewed by Simon Fraser.
164
165         There is no need to carry around a bit in FilterOperations indicating what
166         type of source property the object came from. Whether or not to clip to the
167         bounds of the filter region is purely a property of the type of CALayer
168         we are applying the filter to.
169
170         This basically reverts r185846.
171
172         Covered by the test for the previous commit.
173
174         * css/CSSPropertyNames.in:
175         * css/StyleBuilderConverter.h:
176         (WebCore::StyleBuilderConverter::convertBackdropFilterOperations): Deleted.
177         * page/animation/CSSPropertyAnimation.cpp:
178         (WebCore::blendFilterOperations): Deleted.
179         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Set the normalized
180         edges property if we are a CABackdropLayer.
181         * platform/graphics/filters/FilterOperations.cpp:
182         (WebCore::FilterOperations::operator==):
183         (WebCore::FilterOperations::operationsMatch):
184         (WebCore::FilterOperations::operator=): Deleted.
185         * platform/graphics/filters/FilterOperations.h:
186         (WebCore::FilterOperations::isUsedForBackdropFilters): Deleted.
187         (WebCore::FilterOperations::setUsedForBackdropFilters): Deleted.
188
189 2015-06-24  Doug Russell  <d_russell@apple.com>
190
191         Bug 146177 - AX: AXObjectCache should try to use an unignored accessibilityObject 
192         when posting a selection notification when on the border between two accessibilityObjects
193         https://bugs.webkit.org/show_bug.cgi?id=146177
194
195         Reviewed by Darin Adler.
196
197         Add support for position to be passed for selection changes to allow checking.
198         for boundaries in the case of ignored elements.
199         Add support for searching for unignored siblings of AccessibilityObjects.
200         Include AccessibilityObject wrappers in notifications for tests.
201
202         Test: platform/mac/accessibility/selection-element-tabbing-to-link.html
203
204         * accessibility/AXObjectCache.cpp:
205         (WebCore::AXObjectCache::postTextStateChangeNotification):
206         * accessibility/AXObjectCache.h:
207         * accessibility/AccessibilityObject.cpp:
208         (WebCore::AccessibilityObject::previousSiblingUnignored):
209         (WebCore::AccessibilityObject::nextSiblingUnignored):
210         * accessibility/AccessibilityObject.h:
211         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
212         (isValueTypeSupported):
213         (arrayRemovingNonSupportedTypes):
214         (dictionaryRemovingNonSupportedTypes):
215         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:userInfo:]):
216         * editing/mac/FrameSelectionMac.mm:
217         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
218
219 2015-06-24  Anders Carlsson  <andersca@apple.com>
220
221         Enable -Winconsistent-missing-override when building with Xcode
222         https://bugs.webkit.org/show_bug.cgi?id=146288
223
224         Reviewed by Sam Weinig.
225
226         * Configurations/Base.xcconfig:
227         * Modules/encryptedmedia/MediaKeySession.h:
228         * Modules/webdatabase/DatabaseTask.h:
229         * html/DateTimeLocalInputType.h:
230         * page/scrolling/ios/ScrollingCoordinatorIOS.h:
231         * page/scrolling/mac/ScrollingCoordinatorMac.h:
232         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
233         (WebCore::MediaPlayerPrivateAVFoundation::platformLayer): Deleted.
234         (WebCore::MediaPlayerPrivateAVFoundation::supportsScanning): Deleted.
235         (WebCore::MediaPlayerPrivateAVFoundation::fileSize): Deleted.
236         (WebCore::MediaPlayerPrivateAVFoundation::engineDescription): Deleted.
237         (WebCore::MediaPlayerPrivateAVFoundation::platformErrorCode): Deleted.
238         (WebCore::MediaPlayerPrivateAVFoundation::notifyTrackModeChanged): Deleted.
239         * platform/graphics/avfoundation/VideoTrackPrivateAVF.h:
240         (WebCore::VideoTrackPrivateAVF::trackIndex): Deleted.
241         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
242         (WebCore::CDMSessionAVFoundationObjC::type): Deleted.
243         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
244         (WebCore::CDMSessionMediaSourceAVFObjC::type): Deleted.
245         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
246         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsAcceleratedRendering): Deleted.
247         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget): Deleted.
248         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
249         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCredential): Deleted.
250         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToContinueWithoutCredential): Deleted.
251         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCancellation): Deleted.
252         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToPerformDefaultHandling): Deleted.
253         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedChallengeRejection): Deleted.
254         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
255         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsFullscreen): Deleted.
256         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
257         (WebCore::MediaPlayerPrivateQTKit::supportsScanning): Deleted.
258         (WebCore::MediaPlayerPrivateQTKit::networkState): Deleted.
259         (WebCore::MediaPlayerPrivateQTKit::readyState): Deleted.
260         (WebCore::MediaPlayerPrivateQTKit::maximumDurationToCacheMediaTime): Deleted.
261         (WebCore::MediaPlayerPrivateQTKit::engineDescription): Deleted.
262         * platform/mac/ScrollAnimatorMac.h:
263         * platform/mac/SerializedPlatformRepresentationMac.h:
264         (WebCore::SerializedPlatformRepresentationMac::platformType): Deleted.
265         * platform/mac/ThemeMac.h:
266         (WebCore::ThemeMac::controlRequiresPreWhiteSpace): Deleted.
267         * testing/MockCDM.cpp:
268         (WebCore::MockCDMSession::setClient): Deleted.
269
270 2015-06-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
271
272         Improve JSDOMPromise callPromiseFunction naming
273         https://bugs.webkit.org/show_bug.cgi?id=146280
274
275         Unreviewed.
276
277         No change in behavior.
278
279         * bindings/js/JSDOMPromise.h:
280         (WebCore::callPromiseFunction):
281
282 2015-06-24  Tim Horton  <timothy_horton@apple.com>
283
284         REGRESSION (r185804): Crash selecting time in the form on https://backup.brighthorizons.com/BackupCareRequest.aspx
285         <rdar://problem/21525376>
286
287         Reviewed by Sam Weinig.
288
289         * page/TextIndicator.cpp:
290         (WebCore::TextIndicator::createWithRange):
291         Null check.
292
293 2015-06-24  Zalan Bujtas  <zalan@apple.com>
294
295         Subpixel rendering: roundToDevicePixel() snaps to wrong value.
296         https://bugs.webkit.org/show_bug.cgi?id=146273
297         rdar://problem/18509840
298
299         Reviewed by Simon Fraser.
300
301         Due to the floating point approximate representation, we can't always produce
302         the correct snap value. This patch addresses the issue by removing redundant kFixedPointDenominator multiplication
303         and by changing the rounding in roundToDevicePixel() from float to double.
304
305         API test is added.
306
307         * platform/LayoutUnit.h:
308         (WebCore::roundToDevicePixel):
309
310 2015-06-23  Matt Rajca  <mrajca@apple.com>
311
312         MediaSession: Support setting of metadata
313         https://bugs.webkit.org/show_bug.cgi?id=146253
314
315         Reviewed by Eric Carlson.
316
317         * Modules/mediasession/MediaSession.cpp:
318         (WebCore::MediaSession::MediaSession): Store a reference to the document so we can use it in setMetadata.
319         (WebCore::MediaSession::setMetadata): Implemented as described in the Media Session spec.
320         * Modules/mediasession/MediaSession.h:
321         * Modules/mediasession/MediaSession.idl: Added the setMetadata method.
322         * Modules/mediasession/MediaSessionMetadata.h:
323         (WebCore::MediaSessionMetadata::MediaSessionMetadata): Added to keep track of media session metadata.
324         (WebCore::MediaSessionMetadata::title):
325         (WebCore::MediaSessionMetadata::artist):
326         (WebCore::MediaSessionMetadata::album):
327         (WebCore::MediaSessionMetadata::artworkURL):
328         * WebCore.xcodeproj/project.pbxproj: Added MediaSessionMetadata.h.
329
330 2015-06-24  Daniel Bates  <dabates@apple.com>
331
332         Content Security Policy error message when frame load is blocked does not read well
333         https://bugs.webkit.org/show_bug.cgi?id=146279
334
335         Reviewed by Csaba Osztrogonác.
336
337         Substitute "Refused to load frame" for "Refused to frame" as the prefix of the error message
338         emitted when the Content Security Policy of the page blocks a frame load.
339
340         * page/ContentSecurityPolicy.cpp:
341         (WebCore::CSPDirectiveList::checkSourceAndReportViolation):
342
343 2015-06-11  Sergio Villar Senin  <svillar@igalia.com>
344
345         intrinsic size keywords don't work for heights
346         https://bugs.webkit.org/show_bug.cgi?id=113610
347
348         Reviewed by Darin Adler.
349
350         Based on Blink's r148314 & r150355 by <cbiesinger@chromium.org>.
351
352         Adds intrinsic values support to heigh & min/max-height. This involves the
353         following changes:
354         - RenderBox needs to pass the content height through to computeLogicalHeight and
355         related functions, which needs it to resolve max-content, et. al.
356         - Make the callers pass the content height to this function. Some callers pass
357         logicalHeight() (adjusted for border/padding) which works because if
358         logicalHeight is not the content height, then it is the height we ended up using,
359         so the constrain* functions will just constrain to that value again.
360         - Parsing code needs to be adjusted to support intrinsic values for heights.
361
362         Tests: fast/css-intrinsic-dimensions/height-css-tables-collapsed.html
363                fast/css-intrinsic-dimensions/height-css-tables.html
364                fast/css-intrinsic-dimensions/height-flexbox.html
365                fast/css-intrinsic-dimensions/height-positioned-replaced.html
366                fast/css-intrinsic-dimensions/height-positioned.html
367                fast/css-intrinsic-dimensions/height-replaced.html
368                fast/css-intrinsic-dimensions/height-tables-collapsed.html
369                fast/css-intrinsic-dimensions/height-tables.html
370                fast/css-intrinsic-dimensions/height.html
371
372         * css/CSSParser.cpp:
373         (WebCore::CSSParser::isValidSize): Refactored from validateWidth and
374         validateHeight.
375         (WebCore::CSSParser::parseValue):
376         (WebCore::CSSParser::validateWidth): Deleted.
377         (WebCore::CSSParser::validateHeight): Deleted.
378         * css/CSSParser.h:
379         * platform/Length.h:
380         (WebCore::Length::isFillAvailable):
381         (WebCore::Length::isFitContent):
382         * rendering/RenderBox.cpp:
383         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
384         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
385         (WebCore::RenderBox::computeLogicalHeight):
386         (WebCore::RenderBox::computeLogicalHeightUsing):
387         (WebCore::RenderBox::computeContentLogicalHeight):
388         (WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing):
389         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
390         (WebCore::RenderBox::computePercentageLogicalHeight):
391         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
392         (WebCore::RenderBox::availableLogicalHeight):
393         (WebCore::RenderBox::availableLogicalHeightUsing):
394         (WebCore::RenderBox::computePositionedLogicalHeight):
395         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
396         * rendering/RenderBox.h:
397         * rendering/RenderFlexibleBox.cpp:
398         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
399         (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
400         * rendering/RenderFlowThread.cpp:
401         (WebCore::RenderFlowThread::addForcedRegionBreak):
402         * rendering/RenderGrid.cpp:
403         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
404         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
405         * rendering/RenderMultiColumnSet.cpp:
406         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
407         * rendering/RenderReplaced.cpp:
408         (WebCore::RenderReplaced::hasReplacedLogicalHeight):
409         * rendering/RenderTable.cpp:
410         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
411         (WebCore::RenderTable::layout):
412
413 2015-06-24  Commit Queue  <commit-queue@webkit.org>
414
415         Unreviewed, rolling out r185906.
416         https://bugs.webkit.org/show_bug.cgi?id=146276
417
418         MSVC doesn't yet provide a const-qualified std::array<T,
419         N>::size(), failing to compile the static_assert (Requested by
420         zdobersek on #webkit).
421
422         Reverted changeset:
423
424         "Improve the source code generated by make_names.pl"
425         https://bugs.webkit.org/show_bug.cgi?id=146208
426         http://trac.webkit.org/changeset/185906
427
428 2015-06-24  Zan Dobersek  <zdobersek@igalia.com>
429
430         Improve the source code generated by make_names.pl
431         https://bugs.webkit.org/show_bug.cgi?id=146208
432
433         Reviewed by Darin Adler.
434
435         Clean up and optimize the output that's generated by the make_names.pl script
436         when generating large sets of DOM names for attributes and tags.
437
438         The GenerateStrings() function in the StaticString.pm module is split into
439         GenerateStringData() and GenerateASCIILiteral() so that the two new functions
440         can be used independently, with the original function still being called when
441         generating font names.
442
443         Tags and attributes have the corresponding static QualifiedName globals defined
444         as before. After that, two static const std::array<> objects are defined for
445         both types -- the first is an ordered array of addresses of the QualifiedName
446         objects (corresponding to the C array that was defined in getHTMLTags(),
447         getSVGAttrs() etc.), and the second is an ordered array of StringImpl::StaticASCIILiteral
448         objects that replaces separately defined StringImpl::StaticASCIILiteral objects
449         and the additional tables that contained pairs of QualifiedName object addresses
450         and the corresponding StaticASCIILiteral object references in the init() function.
451         This is all generated by the printStaticData() function in make_names.pl.
452
453         The printQualifiedNameCreation() function generates a static_assert() that ensures
454         that the corresponding std::array<QualifiedName*> and std::array<StaticASCIILiteral>
455         objects have the same amount of items, and then sets up a loop that walks through
456         the two arrays and properly constructs the QualifiedName objects from the static
457         literal data.
458
459         On the GTK port, this shaves off ~54kB from the final stripped shared library
460         on a 64-bit build, and ~21kB on a 32-bit build.
461
462         * bindings/scripts/StaticString.pm:
463         (GenerateStringData):
464         (GenerateASCIILiteral):
465         (GenerateStrings):
466         * dom/make_names.pl:
467         (printCppHead):
468         (printNamesCppFile):
469         (printStaticData):
470         (printQualifiedNameCreation):
471         (printInit): Deleted.
472         (printDefinitions): Deleted.
473
474 2015-06-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
475
476         Refactor UserMediaRequest to share more codes between MediaDevices.getUserMedia and legacy webkitGetUserMedia
477         https://bugs.webkit.org/show_bug.cgi?id=146237
478
479         Reviewed by Darin Adler.
480
481         Covered by existing tests, no change in behavior.
482
483         * Modules/mediastream/MediaConstraintsImpl.cpp:
484         (WebCore::MediaConstraintsImpl::create): Simplified error handling by removing exception code parameter.
485         * Modules/mediastream/MediaConstraintsImpl.h: Ditto.
486         * Modules/mediastream/MediaDevices.cpp:
487         (WebCore::MediaDevices::getUserMedia): Removed code now in UserMediaRequest::start.
488         * Modules/mediastream/NavigatorUserMedia.cpp:
489         (WebCore::NavigatorUserMedia::webkitGetUserMedia): Ditto.
490         * Modules/mediastream/UserMediaRequest.cpp:
491         (WebCore::parseOptions): Simplified error handling by removing exception code parameter.
492         (WebCore::UserMediaRequest::start): Renamed create in start and added common code.
493         * Modules/mediastream/UserMediaRequest.h:
494
495 2015-06-23  Andreas Kling  <akling@apple.com>
496
497         Should reduce tile coverage for the first paint after a tab switch.
498         <https://webkit.org/b/146252>
499         <rdar://problem/19821583>
500
501         Reviewed by Darin Adler.
502
503         Reduce the number of tiles we need to paint after switching tabs,
504         to shorten the time it takes before we can flush pixels to screen.
505
506         We accomplish this by piggybacking on the "speculative tiling enabled"
507         mode of FrameView, which was previously only used to throttle painting
508         and layer flushes during page load.
509
510         When a FrameView becomes visible, which is what happens when you
511         switch to its tab, we revert the speculative tiling optimization to
512         its initial state, and reset the "scrolled by user" flag.
513
514         In practice this means that after switching tabs, we only generate
515         enough tiles to fill the viewport. Then, after 500ms has passed
516         or the user scrolls the page, we go back to the usual speculative
517         tiling mode.
518
519         * page/FrameView.cpp:
520         (WebCore::FrameView::show):
521
522 2015-06-23  Anders Carlsson  <andersca@apple.com>
523
524         Remove windowResizerRect code, nobody is using it anymore
525         https://bugs.webkit.org/show_bug.cgi?id=146265
526
527         Reviewed by Beth Dakin.
528
529         * loader/EmptyClients.h:
530         * page/Chrome.cpp:
531         (WebCore::Chrome::windowResizerRect): Deleted.
532         * page/Chrome.h:
533         * page/ChromeClient.h:
534         * page/FrameView.cpp:
535         (WebCore::FrameView::windowResizerRect): Deleted.
536         * page/FrameView.h:
537         * platform/ScrollView.cpp:
538         (WebCore::ScrollView::ScrollView): Deleted.
539         (WebCore::ScrollView::windowResizerRectChanged): Deleted.
540         (WebCore::ScrollView::containsScrollbarsAvoidingResizer): Deleted.
541         (WebCore::ScrollView::adjustScrollbarsAvoidingResizerCount): Deleted.
542         (WebCore::ScrollView::setParent): Deleted.
543         * platform/ScrollView.h:
544         (WebCore::ScrollView::windowResizerRect): Deleted.
545         * platform/Scrollbar.cpp:
546         (WebCore::Scrollbar::Scrollbar): Deleted.
547         (WebCore::Scrollbar::setFrameRect): Deleted.
548         (WebCore::Scrollbar::setParent): Deleted.
549         * platform/Scrollbar.h:
550
551 2015-06-23  Dean Jackson  <dino@apple.com>
552
553         Media controls are missing the white backdrop in UIWebViews
554         https://bugs.webkit.org/show_bug.cgi?id=146251
555         <rdar://problem/20181345>
556
557         Reviewed by Simon Fraser.
558
559         Implement two new CALayer subclasses that explicitly set
560         something that resembles the system appearance for
561         media-controls-dark-bar-background and media-controls-light-bar-background.
562         This way, WebKit1 clients get a visible result.
563
564         Creating the actual system recipes is tracked by:
565         https://bugs.webkit.org/show_bug.cgi?id=146250
566
567         * WebCore.xcodeproj/project.pbxproj: Add new files.
568         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
569         (PlatformCALayerCocoa::PlatformCALayerCocoa): Use the new CALayer subclasses for
570         the appropriate layer types.
571         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.h: Added.
572         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.mm: Added.
573         (-[WebLightSystemBackdropLayer init]):
574         (-[WebLightSystemBackdropLayer setBackgroundColor:]): Only set to a light grey.
575         (-[WebDarkSystemBackdropLayer init]):
576         (-[WebDarkSystemBackdropLayer setBackgroundColor:]): Only set to a dark grey.
577
578 2015-06-18  Matt Rajca  <mrajca@apple.com>
579
580         Support releasing media sessions
581         https://bugs.webkit.org/show_bug.cgi?id=146132
582
583         Reviewed by Darin Adler.
584
585         * Modules/mediasession/MediaSession.cpp: Implemented as described in the Media Session spec.
586         (WebCore::MediaSession::releaseSession):
587         (WebCore::MediaSession::releaseInternal):
588         * Modules/mediasession/MediaSession.h:
589
590 2015-06-23  Chris Fleizach  <cfleizach@apple.com>
591
592         AX: iOS: VoiceOver and ARIA: has popup property not announced
593         https://bugs.webkit.org/show_bug.cgi?id=146188
594
595         Reviewed by Darin Adler.
596
597         Expose the existing "has popup" property to the iOS Accessibility API.
598
599         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
600         (-[WebAccessibilityObjectWrapper accessibilityHasPopup]):
601
602 2015-06-23  Javier Fernandez  <jfernandez@igalia.com>
603
604         [CSS Grid Layout] Performance optimization: avoid computing overflow alignment if not needed
605         https://bugs.webkit.org/show_bug.cgi?id=146231
606
607         Reviewed by Sergio Villar Senin.
608
609         We don't need to apply any overflow handling if alignment value don't have a potential
610         risk of data loss, as it's the case of 'start' value.
611
612         This patch avoid computing the overflow in all the cases, since it adds an unneeded
613         overhead which affects performance.
614
615         New code improves performance around 3%-8%, depending on the grid tests.
616
617         No new tests, no new funcitonality.
618
619         * rendering/RenderGrid.cpp:
620         (WebCore::RenderGrid::rowPositionForChild):
621         (WebCore::RenderGrid::columnPositionForChild):
622
623 2015-06-23  Youenn Fablet  <youenn.fablet@crf.canon.fr>
624
625         MediaDevices.getUserMedia should migrate from callbacks to DOMPromise
626         https://bugs.webkit.org/show_bug.cgi?id=146200
627
628         Reviewed by Darin Adler.
629
630         Introduced DOMPromiseWithCallback to resolve/reject promises while allowing promise clients to use a typed callback approach.
631         Migrated MediaDevices.getUserMedia from callbacks to DOMPromiseWithCallback.
632         Removed MediaDevices.getUserMedia custom binding.
633
634         Covered by existing tests.
635
636         * CMakeLists.txt: Removing custom binding.
637         * Modules/mediastream/MediaDevices.cpp:
638         (WebCore::MediaDevices::getUserMedia): Moving from callback to promise.
639         * Modules/mediastream/MediaDevices.h: Ditto.
640         * Modules/mediastream/MediaDevices.idl: Removing custom binding.
641         * Modules/mediastream/NavigatorUserMedia.cpp:
642         (WebCore::NavigatorUserMedia::webkitGetUserMedia): Converting from promise callback to API callbacks.
643         * Modules/mediastream/UserMediaRequest.cpp:
644         (WebCore::UserMediaRequest::create): Moving from callback to promise.
645         (WebCore::UserMediaRequest::UserMediaRequest): Ditto.
646         (WebCore::UserMediaRequest::didCreateStream): Ditto.
647         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError): Ditto.
648         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError): Ditto.
649         * Modules/mediastream/UserMediaRequest.h: Ditto.
650         * bindings/js/JSDOMPromise.h: Introducing DOMPromiseWithCallback and removing crypto specific header.
651         (WebCore::DOMPromiseWithCallback::DOMPromiseWithCallback):
652         (WebCore::Error>::resolve):
653         (WebCore::Error>::reject):
654         * bindings/js/JSMediaDevicesCustom.cpp: Removed.
655         * bindings/js/JSSubtleCryptoCustom.cpp: Updating headers.
656
657 2015-06-23  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
658
659         [Streams API] Implement ReadableStream js source "'cancel" callback
660         https://bugs.webkit.org/show_bug.cgi?id=146204
661
662         Reviewed by Darin Adler.
663
664         Calling "cancel" JS function when web app is cancelling a JS readable stream.
665         Handling of promise returned value in case of async cancel.
666
667         Covered by rebased tests.
668
669         * bindings/js/ReadableJSStream.cpp:
670         (WebCore::ReadableJSStream::invoke): Refactoring to pass cancel reason or controller to the JS function.
671         (WebCore::ReadableJSStream::doStart): Ditto.
672         (WebCore::startReadableStreamAsync): Renaming readableStream as protectedStream.
673         (WebCore::createPullResultFulfilledFunction): Ditto.
674         (WebCore::ReadableJSStream::doPull): Refactoring to pass cancel reason or controller to the JS function.
675         (WebCore::createCancelResultFulfilledFunction): Cancel promise fullfil callback.
676         (WebCore::createCancelResultRejectedFunction): Cancel promise reject callback.
677         (WebCore::ReadableJSStream::doCancel): Calling cancel JS callback and handling promise returned value.
678         * bindings/js/ReadableJSStream.h: Refactoring to pass cancel reason or controller to the JS function.
679
680 2015-06-22  Ryuan Choi  <ryuan.choi@navercorp.com>
681
682         [EFL] Hyphenation is not supported
683         https://bugs.webkit.org/show_bug.cgi?id=89830
684
685         Reviewed by Gyuyoung Kim.
686
687         Share libHyphen backend of GTK port.
688
689         Rebased fast/text/hyphenate-*.html
690
691         * PlatformEfl.cmake:
692         * PlatformGTK.cmake:
693         * platform/efl/FileSystemEfl.cpp:
694         (WebCore::listDirectory): Deleted because of lack of functionality.
695         eina_file_ls returns full directory path so fnmatch fails to check dict file.
696         This patch reuse Posix implementation instead of EFL port specific function.
697         * platform/posix/FileSystemPOSIX.cpp: Ditto.
698         * platform/text/gtk/HyphenationLibHyphen.cpp: Moved to platform/text/hyphen
699         * platform/text/hyphen/HyphenationLibHyphen.cpp:
700         Renamed from Source/WebCore/platform/text/gtk/HyphenationLibHyphen.cpp.
701         (WebCore::scanTestDictionariesDirectoryIfNecessary):
702         Added PLATFORM guard and EFL implementation for the test directory
703
704 2015-06-22  Chris Dumez  <cdumez@apple.com>
705
706         [WK1] WebAllowDenyPolicyListener.denyOnlyThisRequest() should not start a new permission request
707         https://bugs.webkit.org/show_bug.cgi?id=146228
708         <rdar://problem/15179262>
709
710         Reviewed by Daniel Bates.
711
712         Add Geolocation::resetIsAllowed() API that merely resets
713         m_allowGeolocation to Unknown, so that we will request the permission
714         again the next time a position is requested.
715
716         * Modules/geolocation/Geolocation.h:
717         (WebCore::Geolocation::resetIsAllowed):
718
719 2015-06-22  Simon Fraser  <simon.fraser@apple.com>
720
721         ASSERT(!m_zOrderListsDirty) when mousing over web view with incremental rendering suppressed
722         https://bugs.webkit.org/show_bug.cgi?id=146225
723
724         Reviewed by Zalan Bujtas.
725
726         Update RenderLayer's z-order lists when hit testing. There's no guarantee that they've
727         been updated; this happens to work most of the time because painting updates them,
728         but if incremental rendering is suppressed, we may not have painted yet.
729         
730         Easy to hit on webkit.org in MiniBrowser, but I wasn't able to make a reduced testcase.
731
732         * rendering/RenderLayer.cpp:
733         (WebCore::RenderLayer::hitTest):
734         (WebCore::RenderLayer::updateLayerListsIfNeeded): Flip the order of the tests, since checking
735         dirty bits is cheaper than calling isStackingContext().
736
737 2015-06-22  Dean Jackson  <dino@apple.com>
738
739         Rename PlatformCA*Mac to PlatformCA*Cocoa
740         https://bugs.webkit.org/show_bug.cgi?id=146224
741         <rdar://problem/21497182>
742
743         Reviewed by Simon Fraser.
744
745         Rename PlatformCALayerMac and related files in platform/graphics/ca/mac
746         to the more accurate Cocoa suffix.
747
748         * WebCore.xcodeproj/project.pbxproj:
749         * page/mac/ServicesOverlayController.mm:
750         * platform/graphics/ca/GraphicsLayerCA.cpp:
751         * platform/graphics/ca/PlatformCAAnimation.h:
752         * platform/graphics/ca/PlatformCALayer.h:
753         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Renamed from Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp.
754         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h.
755         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm.
756         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm.
757         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h.
758         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm.
759         * platform/graphics/ca/cocoa/WebTiledBackingLayer.h: Renamed from Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h.
760         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm.
761         * platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp:
762         * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
763         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
764         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
765         * platform/graphics/ca/mac/WebTiledBackingLayer.mm:
766
767 2015-06-22  Alex Christensen  <achristensen@webkit.org>
768
769         [cssjit] Disable compiling scrollbar pseudoclass selectors
770         https://bugs.webkit.org/show_bug.cgi?id=146220
771
772         Reviewed by Benjamin Poulain.
773
774         * cssjit/SelectorCompiler.cpp:
775         (WebCore::SelectorCompiler::addScrollbarPseudoClassType):
776         Don't compile selectors with scrollbar pseudoclasses.
777
778 2015-06-22  Simon Fraser  <simon.fraser@apple.com>
779
780         -webkit-clip-path clips incorrectly if the element bounds go beyond the top edge of the page
781         https://bugs.webkit.org/show_bug.cgi?id=146218
782         rdar://problem/21127840
783
784         Reviewed by Zalan Bujtas.
785
786         The clip path is computed using the RenderLayer's bounding box, so needs to be offset
787         by the offsetFromRenderer when set on the mask layer.
788
789         Test: compositing/masks/compositing-clip-path-origin.html
790
791         * rendering/RenderLayerBacking.cpp:
792         (WebCore::RenderLayerBacking::updateMaskingLayerGeometry):
793
794 2015-06-22  Michael Catanzaro  <mcatanzaro@igalia.com>
795
796         Web sockets should be treated as active mixed content
797         https://bugs.webkit.org/show_bug.cgi?id=140624
798
799         Reviewed by Sam Weinig.
800
801         Tests: http/tests/security/mixedContent/websocket/insecure-websocket-in-iframe.html
802                http/tests/security/mixedContent/websocket/insecure-websocket-in-main-frame.html
803
804         * Modules/websockets/WebSocket.cpp:
805         (WebCore::WebSocket::connect): Block ws:// WebSocket connections from https:// pages, and
806         emit the onerror event after doing so.
807         * platform/SchemeRegistry.cpp:
808         (WebCore::secureSchemes): Add wss:// to the list of secure schemes.
809
810 2015-06-22  Dean Jackson  <dino@apple.com>
811
812         Element with blur backdrop-filter shows edge duplication and dark edges
813         https://bugs.webkit.org/show_bug.cgi?id=146215
814         <rdar://problem/20367695>
815
816         Reviewed by Tim Horton.
817
818         The input images to backdrop filters should duplicate their edge pixels
819         outwards, rather than using transparent pixels. This is a flag we
820         set on the Gaussian blur, but means we have to remember if the
821         FilterOperations list came from a regular filter or a backdrop filter.
822
823         Test: css3/filters/backdrop/blur-input-bounds.html
824
825         * css/CSSPropertyNames.in: New custom convertor for backdrop-filter.
826         * css/StyleBuilderConverter.h:
827         (WebCore::StyleBuilderConverter::convertBackdropFilterOperations): New convertor
828         that sets the backdrop flag, but is otherwise the same as a normal filter
829         convertor.
830         * page/animation/CSSPropertyAnimation.cpp:
831         (WebCore::blendFilterOperations): Inherit the backdrop flag if either of our
832         inputs has it.
833         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm: Set the inputNormalizeEdges
834         key on the CAFilter if necessary.
835         * platform/graphics/filters/FilterOperations.cpp: Add a new flag indicating if
836         these operations are intended for backdrops.
837         (WebCore::FilterOperations::operator=):
838         (WebCore::FilterOperations::operator==):
839         * platform/graphics/filters/FilterOperations.h:
840         (WebCore::FilterOperations::isUsedForBackdropFilters):
841         (WebCore::FilterOperations::setUsedForBackdropFilters):
842
843 2015-06-22  Tim Horton  <timothy_horton@apple.com>
844
845         [TextIndicator] Text shifts one pixel to the left when I force click to bring up Lookup in Mail messages
846         https://bugs.webkit.org/show_bug.cgi?id=146214
847         <rdar://problem/20782970>
848
849         Reviewed by Dean Jackson.
850
851         * page/mac/TextIndicatorWindow.mm:
852         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
853         (WebCore::TextIndicatorWindow::setTextIndicator):
854         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]): Deleted.
855         When the WebView is at a nonintegral position, we can end up needing a TextIndicator
856         with a nonintegral position. We need to round the window position, so we need to apply
857         the fractional part to the indicator layers inside, not to the window.
858
859 2015-06-22  Myles C. Maxfield  <mmaxfield@apple.com>
860
861         [iOS] Arabic text styled with Georgia is rendered as boxes
862         https://bugs.webkit.org/show_bug.cgi?id=145681
863         <rdar://problem/21169844>
864
865         Reviewed by Darin Adler.
866
867         Georgia doesn't support Arabic, so we ask CoreText what font does support Arabic. It returns
868         TimesNewRomanPSMT. However, WebKit explicitly disallows this font on iOS. Therefore, instead
869         of using TimesNewRomanPSMT, we will simply just use GeezaPro.
870
871         Test: fast/text/arabic-times-new-roman.html
872
873         * platform/graphics/ios/FontCacheIOS.mm:
874         (WebCore::FontCache::systemFallbackForCharacters):
875         * platform/graphics/Font.h: Let FontCacheIOS call fontFamilyShouldNotBeUsedForArabic()
876         * platform/graphics/cocoa/FontCocoa.mm:
877         (WebCore::fontFamilyShouldNotBeUsedForArabic):
878
879 2015-06-22  Alex Christensen  <achristensen@webkit.org>
880
881         Unreviewed non-mac debug build fix after r185840.
882
883         * loader/ResourceLoader.cpp:
884         (WebCore::ResourceLoader::willSendRequest):
885         Added enable flag around assertion.
886
887 2015-06-20  Alex Christensen  <achristensen@webkit.org>
888
889         [Content Extensions] Add SPI to reload without content blocking.
890         https://bugs.webkit.org/show_bug.cgi?id=146128
891         rdar://problem/20351903
892
893         Reviewed by Sam Weinig.
894
895         * html/HTMLMediaElement.cpp:
896         (WebCore::HTMLMediaElement::loadResource):
897         * loader/ResourceLoader.cpp:
898         (WebCore::ResourceLoader::willSendRequest):
899         * loader/cache/CachedResourceLoader.cpp:
900         (WebCore::CachedResourceLoader::requestResource):
901         * page/DOMWindow.cpp:
902         (WebCore::DOMWindow::open):
903         * page/Page.h:
904         (WebCore::Page::userContentController):
905         (WebCore::Page::userContentExtensionsEnabled):
906         (WebCore::Page::setUserContentExtensionsEnabled):
907         (WebCore::Page::group):
908         * page/UserContentController.cpp:
909         (WebCore::UserContentController::removeAllUserContentExtensions):
910         (WebCore::UserContentController::processContentExtensionRulesForLoad):
911         (WebCore::UserContentController::actionsForResourceLoad):
912         * page/UserContentController.h:
913
914 2015-06-22  Zalan Bujtas  <zalan@apple.com>
915
916         REGRESSION(r169105) Dangling renderer pointer in SelectionSubtreeRoot::SelectionSubtreeData.
917         https://bugs.webkit.org/show_bug.cgi?id=146116
918         rdar://problem/20959369
919
920         Reviewed by Brent Fulgham.
921
922         This patch ensures that we don't adjust the selection unless the visual selection still matches this subtree root.
923
924         When multiple selection roots are present we need to ensure that a RenderObject
925         only shows up in one of them.
926         RenderView::splitSelectionBetweenSubtrees(), as the name implies, splits the
927         selection and sets the selection range (start/end) on each selection root.
928         However, SelectionSubtreeRoot::adjustForVisibleSelection() later recomputes the range
929         based on visible selection and that could end up collecting renderers as selection start/end
930         from another selection subtree.
931         RenderObject's holds the last selection state (RenderObject::setSelectionState).
932         If we set a renderer first as "on selection border" and later "inside" using multiple selection roots,
933         we can't clean up selections properly when this object gets destroyed.
934         One of the roots ends up with a dangling RenderObject pointer.
935
936         Test: fast/regions/crash-when-renderer-is-in-multiple-selection-subtrees.html
937
938         * rendering/SelectionSubtreeRoot.cpp:
939         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
940
941 2015-06-22  Jeremy Jones  <jeremyj@apple.com>
942
943         Do not exit fullscreen when starting PiP since this is done automatically.
944         https://bugs.webkit.org/show_bug.cgi?id=144871
945
946         Reviewed by Darin Adler.
947
948         Since we don't explicitly exit fullscreen, update state in shouldExitFullscreenWithReason()
949
950         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Declare shouldExitFullscreenWithReason().
951         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
952         (-[WebAVPlayerController playerViewController:shouldExitFullScreenWithReason:]): Forward to WebVideoFullscreenInterfaceAVKit.
953         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Added.
954         (WebVideoFullscreenInterfaceAVKit::willStartPictureInPicture): Remove enter fullscreen code.
955         * platform/spi/cocoa/AVKitSPI.h: Add missing enums.
956
957 2015-06-22  Daniel Bates  <dabates@apple.com>
958
959         AX: UI Automation cannot find AutoFill or search cancel buttons
960         https://bugs.webkit.org/show_bug.cgi?id=145241
961         <rdar://problem/21051411>
962
963         Reviewed by Chris Fleizach.
964
965         Add support for hit testing the search cancel button and AutoFill button so that
966         they can be accessed by UI Automation.
967
968         Currently the accessibility hit test machinery ignores nodes in a shadow tree.
969         So, it neither finds the <input type="search"> cancel button nor the AutoFill button
970         when it performs a hit test. Therefore these buttons cannot be accessed using
971         UI Automation.
972
973         Tests: accessibility/hit-test-input-auto-fill-button.html
974                accessibility/hit-test-input-search-cancel-button.html
975                accessibility/input-search-cancel-button.html
976
977         * accessibility/AccessibilityRenderObject.cpp:
978         (WebCore::AccessibilityRenderObject::accessibilityTextFieldDecorationHitTest): Added; returns
979         the AccessibilityObject for the search cancel button or AutoFill text field decoration as applicable.
980         (WebCore::AccessibilityRenderObject::accessibilityHitTest): Check whether the hit node
981         is a text field decoration.
982
983 2015-06-22  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
984
985         [Streams API] Implement ReadableStream cancel (abstract part)
986         https://bugs.webkit.org/show_bug.cgi?id=146111
987
988         Reviewed by Darin Adler.
989
990         This patch implements ReadableStream and ReadableStreamReader cancel.
991         The reader delegates cancellation to its stream.
992
993         This patch also ensures that controller.close() will not throw in case cancellation is on-going.
994
995         A follow-up patch will implement the calling of 'cancel' JS callback for JS sources.
996
997         Covered by rebased tests.
998
999         * Modules/streams/ReadableStream.cpp:
1000         (WebCore::ReadableStream::cancel): Checks whether locked or not before cancelling.
1001         (WebCore::ReadableStream::cancelNoCheck): Cancel without lock check.
1002         (WebCore::ReadableStream::notifyCancelSucceeded): Async cancel callback.
1003         (WebCore::ReadableStream::notifyCancelFailed): Ditto.
1004         * Modules/streams/ReadableStream.h:
1005         * Modules/streams/ReadableStream.idl: Cleaned up IDL.
1006         * Modules/streams/ReadableStreamReader.cpp:
1007         (WebCore::ReadableStreamReader::cancel):
1008         * Modules/streams/ReadableStreamReader.h:
1009         * Modules/streams/ReadableStreamReader.idl: Cleaned up IDL
1010         * bindings/js/JSReadableStreamControllerCustom.cpp:
1011         (WebCore::JSReadableStreamController::close):
1012         * bindings/js/JSReadableStreamCustom.cpp:
1013         (WebCore::JSReadableStream::cancel):
1014         * bindings/js/JSReadableStreamReaderCustom.cpp:
1015         (WebCore::JSReadableStreamReader::cancel):
1016         * bindings/js/ReadableJSStream.cpp:
1017         (WebCore::ReadableJSStream::doCancel):
1018         * bindings/js/ReadableJSStream.h:
1019
1020 2015-06-22  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1021
1022         WebRTC: Navigator.webkitGetUserMedia() requires three arguments
1023         https://bugs.webkit.org/show_bug.cgi?id=146022
1024
1025         Reviewed by Eric Carlson.
1026
1027         Updated custom binding to make the third error callback argument
1028         mandatory. Updated and unskipped three tests (for the GTK+ port).
1029
1030         * bindings/js/JSNavigatorCustom.cpp:
1031         (WebCore::JSNavigator::webkitGetUserMedia):
1032
1033 2015-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1034
1035         Unreviewed. Fix GTK+ build after r185818.
1036
1037         Actually rollout r185320.
1038
1039         * platform/network/soup/DNSSoup.cpp:
1040         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences):
1041         (WebCore::DNSResolveQueue::platformResolve):
1042         (WebCore::gotProxySettingsCallback): Deleted.
1043         (WebCore::DNSResolveQueue::platformMaybeResolveHost): Deleted.
1044
1045 2015-06-16  Gavin Barraclough  <barraclough@apple.com>
1046
1047         Page load performance regression due to bugs.webkit.org/show_bug.cgi?id=145542
1048         https://bugs.webkit.org/show_bug.cgi?id=146198
1049
1050         Unreviewed rollout.
1051
1052         * platform/network/DNSResolveQueue.cpp:
1053         (WebCore::DNSResolveQueue::DNSResolveQueue):
1054         (WebCore::DNSResolveQueue::isUsingProxy):
1055         (WebCore::DNSResolveQueue::add):
1056         (WebCore::DNSResolveQueue::timerFired):
1057         * platform/network/DNSResolveQueue.h:
1058         * platform/network/cf/DNSCFNet.cpp:
1059         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences):
1060         (WebCore::clientCallback):
1061         (WebCore::DNSResolveQueue::platformResolve):
1062         (WebCore::proxyIsEnabledInSystemPreferences): Deleted.
1063         (WebCore::isUsingProxy): Deleted.
1064         (WebCore::DNSResolveQueue::platformMaybeResolveHost): Deleted.
1065         * platform/network/soup/DNSSoup.cpp:
1066
1067 2015-06-21  Alexey Proskuryakov  <ap@apple.com>
1068
1069         REGRESSION (r172975): navigator.language unable to tell region for Traditional Chinese users
1070         https://bugs.webkit.org/show_bug.cgi?id=146121
1071         rdar://problem/21395180
1072
1073         Reviewed by Darin Adler.
1074
1075         Revert to previous behavior, which is wrong in many ways, but not as wrong as the new one.
1076
1077         * platform/mac/Language.mm:
1078         (WebCore::httpStyleLanguageCode):
1079         (WebCore::platformUserPreferredLanguages):
1080         * platform/spi/cf/CFBundleSPI.h:
1081
1082 2015-06-19  Andy Estes  <aestes@apple.com>
1083
1084         Give Node::didNotifySubtreeInsertions() a better name
1085         https://bugs.webkit.org/show_bug.cgi?id=146170
1086
1087         Reviewed by Darin Adler.
1088
1089         didNotifySubtreeInsertions() is not a good name. It sounds like we are notifying the subtree insertions, which doesn't make sense.
1090
1091         This function is really about notifying the Node that the subtree it's a part of has finished being inserted into the DOM
1092         (i.e. all nodes have received their call to insertedInto()). Change the name to finishedInsertingSubtree() to better reflect this.
1093
1094         * dom/ContainerNode.cpp:
1095         (WebCore::ContainerNode::notifyChildInserted):
1096         * dom/ContainerNodeAlgorithms.h:
1097         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
1098         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree):
1099         * dom/Element.cpp:
1100         (WebCore::Element::addShadowRoot):
1101         * dom/Node.h:
1102         (WebCore::Node::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
1103         (WebCore::Node::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
1104         * dom/ScriptElement.cpp:
1105         (WebCore::ScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
1106         (WebCore::ScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
1107         * dom/ScriptElement.h:
1108         * html/HTMLFrameElementBase.cpp:
1109         (WebCore::HTMLFrameElementBase::insertedInto):
1110         (WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
1111         (WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
1112         * html/HTMLFrameElementBase.h:
1113         * html/HTMLScriptElement.cpp:
1114         (WebCore::HTMLScriptElement::insertedInto):
1115         (WebCore::HTMLScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
1116         (WebCore::HTMLScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
1117         * html/HTMLScriptElement.h:
1118         * svg/SVGFEImageElement.cpp:
1119         (WebCore::SVGFEImageElement::insertedInto):
1120         (WebCore::SVGFEImageElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
1121         (WebCore::SVGFEImageElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
1122         * svg/SVGFEImageElement.h:
1123         * svg/SVGMPathElement.cpp:
1124         (WebCore::SVGMPathElement::insertedInto):
1125         (WebCore::SVGMPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
1126         (WebCore::SVGMPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
1127         * svg/SVGMPathElement.h:
1128         * svg/SVGScriptElement.cpp:
1129         (WebCore::SVGScriptElement::insertedInto):
1130         (WebCore::SVGScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
1131         (WebCore::SVGScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
1132         * svg/SVGScriptElement.h:
1133         * svg/SVGTRefElement.cpp:
1134         (WebCore::SVGTRefElement::insertedInto):
1135         (WebCore::SVGTRefElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
1136         (WebCore::SVGTRefElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
1137         * svg/SVGTRefElement.h:
1138         * svg/SVGTextPathElement.cpp:
1139         (WebCore::SVGTextPathElement::insertedInto):
1140         (WebCore::SVGTextPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
1141         (WebCore::SVGTextPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
1142         * svg/SVGTextPathElement.h:
1143         * svg/animation/SVGSMILElement.cpp:
1144         (WebCore::SVGSMILElement::insertedInto):
1145         (WebCore::SVGSMILElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
1146         (WebCore::SVGSMILElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
1147         * svg/animation/SVGSMILElement.h:
1148
1149 2015-06-21  Philip Chimento  <philip.chimento@gmail.com>
1150
1151         libwebkit2gtk fails to link without opengl
1152         https://bugs.webkit.org/show_bug.cgi?id=138332
1153
1154         Reviewed by Carlos Garcia Campos.
1155
1156         * CMakeLists.txt: The third-party ANGLE directories need to be
1157         included even if ENABLE(GRAPHICS_CONTEXT_3D) is false. They must
1158         be included after the OpenGL headers as the comment says.
1159         * platform/graphics/texmap/BitmapTexturePool.cpp: Remove
1160         reference to no longer existent header file.
1161
1162 2015-06-20  Tim Horton  <timothy_horton@apple.com>
1163
1164         Deselection of text causes a noticeable jump on force touch machines
1165         https://bugs.webkit.org/show_bug.cgi?id=146173
1166         <rdar://problem/20992842>
1167
1168         Reviewed by Sam Weinig.
1169
1170         When we have a TextIndicator of type Crossfade, we end up putting
1171         a layer with the blue highlight + text painted into it on top of the
1172         content, and cross-fading that layer to the yellow-highlighted text.
1173
1174         This is necessary for BounceAndCrossfade TextIndicators, because the
1175         blue highlight has to bounce, but is not necessary for Crossfade-only
1176         ones; we can just fade in the yellow highlight on top of the
1177         existing blue page highlight, and all is well.
1178
1179         So, get rid of the Crossfade TextIndicator type and use FadeIn, separately
1180         keeping track of whether or not we can add a margin (we still can't
1181         add a margin to TextIndicators that indicate the page's current selection,
1182         because the blue highlight cannot have the margin applied to it, and we
1183         want the bounds to match exactly).
1184
1185         * page/TextIndicator.cpp:
1186         (WebCore::TextIndicator::createWithRange):
1187         If the range is the same as the selection, turn off the margin.
1188         We were previously doing this based on the presentation transition, but now
1189         there's no difference in presentation transition in this case.
1190
1191         (WebCore::TextIndicator::createWithSelectionInFrame):
1192         (WebCore::TextIndicator::wantsBounce):
1193         (WebCore::TextIndicator::wantsContentCrossfade):
1194         (WebCore::TextIndicator::wantsFadeIn):
1195         (WebCore::TextIndicator::wantsManualAnimation):
1196         * page/TextIndicator.h:
1197         Get rid of TextIndicatorPresentationTransition::Crossfade.
1198
1199         (WebCore::TextIndicator::setWantsMargin):
1200         (WebCore::TextIndicator::wantsMargin):
1201         Keep track of whether we want a margin.
1202
1203         * page/mac/TextIndicatorWindow.mm:
1204         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
1205         Determine if we should use a margin based on wantsMargin instead of the
1206         presentation transition.
1207
1208 2015-06-20  Ryuan Choi  <ryuan.choi@navercorp.com>
1209
1210         [EFL] Do not consider test directories when DEVELOPER_MODE is OFF
1211         https://bugs.webkit.org/show_bug.cgi?id=146171
1212
1213         Reviewed by Gyuyoung Kim.
1214
1215         * platform/efl/EflInspectorUtilities.cpp:
1216         (WebCore::inspectorResourcePath): Only used WEB_INSPECTOR_DIR which CMake decides properly.
1217
1218 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
1219
1220         Fix absolute value warning in LocalizedStringsGtk.cpp
1221         https://bugs.webkit.org/show_bug.cgi?id=145919
1222
1223         Reviewed by Martin Robinson.
1224
1225         Use abs(static_cast<int>(time)) rather than static_cast<int>(abs(time)) to avoid clang's
1226         warnings about passing a float to abs() instead of std::abs(). Also, because casting an int
1227         to an int is silly.
1228
1229         * platform/gtk/LocalizedStringsGtk.cpp:
1230         (WebCore::localizedMediaTimeDescription):
1231
1232 2015-06-19  Devin Rousso  <drousso@apple.com>
1233
1234         Web Inspector: Highlight currently edited CSS selector
1235         https://bugs.webkit.org/show_bug.cgi?id=145658
1236
1237         Reviewed by Joseph Pecoraro.
1238
1239         Test: inspector/dom/highlight-multiple-shapes.html
1240
1241         * inspector/InspectorController.cpp:
1242         (WebCore::InspectorController::buildObjectForHighlightedNode):
1243         * inspector/InspectorController.h:
1244         * inspector/InspectorDOMAgent.cpp:
1245         (WebCore::InspectorDOMAgent::highlightSelector): Gets a list of all nodes matching a given selector string and highlights each of them.
1246         * inspector/InspectorDOMAgent.h:
1247         * inspector/InspectorOverlay.cpp:
1248         (WebCore::InspectorOverlay::hideHighlight):
1249         (WebCore::InspectorOverlay::highlightNodeList): Loops through a given NodeList to create highlightObjects for each of them.
1250         (WebCore::InspectorOverlay::shouldShowOverlay):
1251         (WebCore::buildObjectForElementData): Don't show flow fragments when highlighting multiple nodes.
1252         (WebCore::InspectorOverlay::buildHighlightObjectForNode):
1253         (WebCore::InspectorOverlay::buildObjectForHighlightedNode): Now returns an array containing the highlightObject for each highligthed node.
1254         (WebCore::InspectorOverlay::drawNodeHighlight): Now sends an array to the InspectorOverlayPage.js to provide support for highlighting multiple nodes.
1255         * inspector/InspectorOverlay.h:
1256         * inspector/InspectorOverlayPage.js: Now expects an array as its parameter and loops through it to highlight each node given.
1257         If the parameter array contains more than one element, do not draw the textbox containing info on that node.
1258         (drawNodeHighlight):
1259
1260 2015-06-19  Joseph Pecoraro  <pecoraro@apple.com>
1261
1262         Crash under WebCore::PageConsoleClient::addMessage attempting to log insecure content message in ImageDocument
1263         https://bugs.webkit.org/show_bug.cgi?id=146096
1264
1265         Reviewed by Timothy Hatcher.
1266
1267         Was able to reproduce this using a user stylesheet with an http css font
1268         on a pdf (ImageDocument) main document loaded over https. Was unable to
1269         create a reliable test for this scenario.
1270
1271         * page/PageConsoleClient.cpp:
1272         (WebCore::getParserLocationForConsoleMessage):
1273         The scriptableDocumentParser could be null, such as in an ImageDocument.
1274
1275 2015-06-19  Dean Jackson  <dino@apple.com>
1276
1277         Extremely large canvas crashes on pre-El Capitan machines
1278         https://bugs.webkit.org/show_bug.cgi?id=146169
1279         <rdar://problem/21410046>
1280
1281         Reviewed by Tim Horton.
1282
1283         On machines before El Capitan, make the maximum canvas size
1284         8k by 8k.
1285
1286         Covered by existing tests.
1287
1288         * html/HTMLCanvasElement.cpp:
1289
1290 2015-06-19  Tim Horton  <timothy_horton@apple.com>
1291
1292         Selection services cannot be invoked when force click is enabled
1293         https://bugs.webkit.org/show_bug.cgi?id=146166
1294         <rdar://problem/21468362>
1295
1296         Reviewed by Darin Adler.
1297
1298         * page/mac/ServicesOverlayController.h:
1299         Turn Highlight::Type into something we can use for dirty flags.
1300
1301         * page/mac/ServicesOverlayController.mm:
1302         (WebCore::ServicesOverlayController::Highlight::createForSelection):
1303         (WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber):
1304         (WebCore::ServicesOverlayController::ServicesOverlayController):
1305         (WebCore::ServicesOverlayController::selectionRectsDidChange):
1306         (WebCore::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
1307         (WebCore::ServicesOverlayController::invalidateHighlightsOfType):
1308         (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded):
1309         (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
1310         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
1311         (WebCore::ServicesOverlayController::buildSelectionHighlight):
1312         (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
1313         (WebCore::ServicesOverlayController::determineActiveHighlight):
1314         (WebCore::ServicesOverlayController::didScrollFrame):
1315         (WebCore::ServicesOverlayController::handleClick):
1316         Coalesce highlight rebuilding so that things (like TextIndicator creation)
1317         that change the selection and then reset it immediately don't cause us
1318         to lose the active highlight.
1319
1320         This also means that if the selection changes multiple times in a runloop
1321         (easily possible from script), we won't waste a lot of time rebuilding highlights.
1322
1323         (WebCore::ServicesOverlayController::didRebuildPotentialHighlights):
1324         Merged into buildPotentialHighlightsIfNeeded.
1325
1326 2015-06-19  Matt Baker  <mattbaker@apple.com>
1327
1328         Web Inspector: TimelineAgent needs to handle nested runloops
1329         https://bugs.webkit.org/show_bug.cgi?id=145090
1330
1331         Reviewed by Joseph Pecoraro.
1332
1333         Previously nested run loops caused InspectorTimelineAgent to prematurely pop the current run loop record. This
1334         patch adds a counter to track the run loop nesting level, and rendering frame records are only pushed/popped
1335         when the nesting level is zero. Run loop entry/exit notifications received while the debugger is paused do not
1336         affect the nesting level.
1337
1338         * inspector/InspectorTimelineAgent.cpp:
1339         (WebCore::InspectorTimelineAgent::internalStart):
1340         (WebCore::InspectorTimelineAgent::internalStop):
1341         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
1342         * inspector/InspectorTimelineAgent.h:
1343
1344 2015-06-19  Brent Fulgham  <bfulgham@apple.com>
1345
1346         Follow-up fix to r185766.
1347         https://bugs.webkit.org/show_bug.cgi?id=22132
1348
1349         Reviewed by Zalan Bujtas.
1350
1351         Suggested by Darin Adler in the bug.
1352
1353         * platform/graphics/filters/FETile.cpp:
1354         (WebCore::FETile::platformApplySoftware): Use WTF::move when passing
1355         the new tileImageCopy RefPtr.
1356
1357 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
1358
1359         [SOUP] Fix return-type-c-linkage warning after r185553
1360         https://bugs.webkit.org/show_bug.cgi?id=146014
1361
1362         Reviewed by Martin Robinson.
1363
1364         * platform/network/soup/WebKitSoupRequestGeneric.cpp:
1365         (webkitSoupRequestGenericGetRequest): Return a pointer rather than a reference.
1366         * platform/network/soup/WebKitSoupRequestGeneric.h: webkitSoupRequestGenericGetRequest now
1367         returns a pointer rather than a reference.
1368
1369 2015-06-19  Dean Jackson  <dino@apple.com>
1370
1371         Played <audio> looks invisible against the gray background
1372         https://bugs.webkit.org/show_bug.cgi?id=146164
1373         <rdar://problem/21014284>
1374
1375         Reviewed by Brent Fulgham.
1376
1377         The plus-darker blend mode was not allowing any white to
1378         show through in the rendering. We don't need this for
1379         audio controls, where we draw on an opaque grey background.
1380
1381         * Modules/mediacontrols/mediaControlsiOS.css:
1382         (audio::-webkit-media-controls-panel): Darken the color of the controls a
1383         little to make white stand out more.
1384         (audio::-webkit-media-controls-timeline): Remove the plus-darker blending.
1385         (video::-webkit-media-controls-timeline): Apply blending only to video.
1386
1387 2015-06-19  Andy Estes  <aestes@apple.com>
1388
1389         Various assertion failures occur when executing script in the midst of DOM insertion
1390         https://bugs.webkit.org/show_bug.cgi?id=132482
1391
1392         Reviewed by Darin Adler.
1393
1394         Prior to this change, when an element containing a <script> child was inserted into a document, the script was
1395         executed in ScriptElement::insertedInto(). That script can access nodes that follow it in the newly-inserted
1396         hierarchy but are not yet fully inserted, leading to at least the following problems:
1397
1398             - The script could remove a node that is not yet marked as in the document.
1399             - The script could remove a named <map> that has yet to be added to TreeScope::m_imageMapsByName.
1400             - The script could remove a form control that has yet to be added to FormController::m_formElementsWithState.
1401
1402         These scenarios all result in assertion failures. This change ensures that each node in the newly-inserted
1403         hierarchy is fully inserted before executing any scripts.
1404
1405         Tests: fast/dom/element-removed-while-inserting-parent-crash.html
1406                fast/dom/named-map-removed-while-inserting-parent-crash.html
1407                fast/forms/form-control-removed-while-inserting-parent-crash.html
1408                svg/dom/element-removed-while-inserting-parent-crash.html
1409
1410         * dom/ScriptElement.cpp:
1411         (WebCore::ScriptElement::shouldNotifySubtreeInsertions): Renamed from insertedInto().
1412         Returned true in the case where insertedInto() would've called prepareScript().
1413         (WebCore::ScriptElement::didNotifySubtreeInsertions): Called prepareScript().
1414         (WebCore::ScriptElement::insertedInto): Renamed to shouldNotifySubtreeInsertions().
1415         * dom/ScriptElement.h:
1416         * html/HTMLScriptElement.cpp:
1417         (WebCore::HTMLScriptElement::insertedInto): If shouldNotifySubtreeInsertions() is true, returned InsertionShouldCallDidNotifySubtreeInsertions.
1418         Otherwise, returned InsertionDone.
1419         (WebCore::HTMLScriptElement::didNotifySubtreeInsertions): Called ScriptElement::didNotifySubtreeInsertions().
1420         * html/HTMLScriptElement.h:
1421         * svg/SVGScriptElement.cpp:
1422         (WebCore::SVGScriptElement::insertedInto): Did the same as HTMLScriptElement::insertedInto().
1423         (WebCore::SVGScriptElement::didNotifySubtreeInsertions): Called ScriptElement::didNotifySubtreeInsertions().
1424         * svg/SVGScriptElement.h:
1425
1426 2015-06-19  Brent Fulgham  <bfulgham@apple.com>
1427
1428         All calls of ImageBuffer::create should null check the return value
1429         https://bugs.webkit.org/show_bug.cgi?id=22132
1430
1431         Reviewed by Zalan Bujtas.
1432
1433         ImageBuffer::create returns nullptr for a number of reasons, and should be
1434         expected to do so. We missed this check in a few places, resulting in
1435         crashes on some systems. Likewise, ImageBuffer::copyImage may return nullptr
1436         in normal use and should be checked.
1437
1438         * platform/graphics/BitmapImage.cpp:
1439         (WebCore::BitmapImage::drawPattern): Add nullptr check for create and copyImage. Remove
1440         extra call to 'setImageObserver'.
1441         * platform/graphics/cairo/ImageBufferCairo.cpp:
1442         (WebCore::ImageBuffer::drawPattern): Add nullptr check for copyImage.
1443         * platform/graphics/cg/ImageBufferCG.cpp:
1444         (WebCore::ImageBuffer::drawPattern): Add nullptr checks for copyImage.
1445         * platform/graphics/filters/FETile.cpp:
1446         (WebCore::FETile::platformApplySoftware): Add nullptr check for copyImage.
1447         * platform/graphics/filters/FilterEffect.cpp:
1448         (WebCore::FilterEffect::asImageBuffer): Add nullptr check for create.
1449         (WebCore::FilterEffect::openCLImageToImageBuffer): Ditto.
1450         * platform/graphics/texmap/BitmapTexture.cpp:
1451         (WebCore::BitmapTexture::updateContents): Add nullptr checks for create and copyImage.
1452         * svg/graphics/SVGImage.cpp:
1453         (WebCore::SVGImage::drawPatternForContainer): Add nullptr check for copyImage.
1454
1455 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
1456
1457         Get CAContext directly for CALayer instead of walking the layer tree.
1458         https://bugs.webkit.org/show_bug.cgi?id=146138
1459         <rdar://problem/21455974>
1460
1461         Reviewed by Darin Adler.
1462
1463         This will get the context directly from the CALayer instead of getting all CAContexts, walking the layer tree 
1464         to the root and comparing that against each CAContext's root layer.
1465
1466         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1467         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
1468
1469 2015-06-18  Brent Fulgham  <bfulgham@apple.com>
1470
1471         [iOS] scrollIntoViewIfNeeded is not working with scroll-snap points
1472         https://bugs.webkit.org/show_bug.cgi?id=145318
1473         <rdar://problem/21081501>
1474
1475         Reviewed by Simon Fraser.
1476
1477         Use the ScrollController in iOS to track the scroll snap point state.
1478         We do not need the animation implementation or timers since the actual
1479         animation is handled by UIKit.
1480
1481         This change lets us communicate the current offset into the scroll snap
1482         offset vector between the WebProcess and RemoteScrollingTree so that
1483         both sides stay in sync regardless of whether user gestures or style
1484         updates have caused us to shift to a different snap point.
1485
1486         * page/scrolling/AsyncScrollingCoordinator.cpp:
1487         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Set the
1488         current horizontal and vertical scroll snap offset indices.
1489         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Ditto.
1490         * page/scrolling/AsyncScrollingCoordinator.h: Mark the setActiveScrollSnapIndices
1491         for export so that it can be reached by the UIProcess.
1492         * page/scrolling/ScrollingCoordinator.h: Keep track of horizontal and
1493         vertical scroll snap offset indices.
1494         * page/scrolling/ScrollingStateScrollingNode.cpp:
1495         (WebCore::ScrollingStateScrollingNode::setCurrentHorizontalSnapPointIndex): Added.
1496         (WebCore::ScrollingStateScrollingNode::setCurrentVerticalSnapPointIndex): Added.
1497         * page/scrolling/ScrollingStateScrollingNode.h:
1498         (WebCore::ScrollingStateScrollingNode::currentHorizontalSnapPointIndex): Added.
1499         (WebCore::ScrollingStateScrollingNode::currentVerticalSnapPointIndex): Added.
1500         * page/scrolling/ScrollingTree.h:
1501         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1502         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren): Update the scroll snap
1503         point offset indices if either has changed.
1504         * page/scrolling/ScrollingTreeScrollingNode.h:
1505         (WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex): Added.
1506         (WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex): Added.
1507         (WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Added.
1508         (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Added.
1509         * page/scrolling/ThreadedScrollingTree.cpp:
1510         (WebCore::ThreadedScrollingTree::currentSnapPointIndicesDidChange): New method
1511         to handle notifications about scroll snap index changes from the UIProcess.
1512         * page/scrolling/ThreadedScrollingTree.h:
1513         * page/scrolling/ios/ScrollingTreeIOS.cpp:
1514         (WebCore::ScrollingTreeIOS::currentSnapPointIndicesDidChange): New method
1515         to handle notifications about scroll snap index changes from the UIProcess.
1516         * page/scrolling/ios/ScrollingTreeIOS.h:
1517         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1518         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Update scroll
1519         snap point current offset indices if they have changed.
1520         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Remove unneeded
1521         PLATFORM(MAC) macro.
1522         * platform/ScrollAnimator.cpp:
1523         (WebCore::ScrollAnimator::ScrollAnimator): We have a ScrollController if we are
1524         supporting scroll snap points or rubber banding.
1525         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): This method is not needed
1526         for iOS builds.
1527         (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset): Enable this on iOS.
1528         (WebCore::ScrollAnimator::updateScrollSnapState): Renamed from 'updateScrollAnimatorsAndTimers'
1529         and enabled on iOS.
1530         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Deleted.
1531         * platform/ScrollAnimator.h: Enable some scroll snap methods on iOS.
1532         * platform/ScrollableArea.cpp:
1533         (WebCore::ScrollableArea::handleWheelEvent): Enable scroll snap index bookkeeping on iOS, too.
1534         (WebCore::ScrollableArea::updateScrollSnapState): Revise to call 'updateScrollSnapState' instead
1535         of 'updateScrollAnimatorsAndTimers'.
1536         * platform/cocoa/ScrollController.h: Enable some methods on iOS. Reorder methods to
1537         reduce the number of macros needed to do so.
1538         * platform/cocoa/ScrollController.mm:
1539         (systemUptime): Only build for Mac.
1540         (WebCore::ScrollController::ScrollController): Disable rubber band-specific members on iOS.
1541         (WebCore::ScrollController::handleWheelEvent): Only build this on Mac.
1542         (WebCore::ScrollController::isRubberBandInProgress): Always return 'false' on iOS.
1543         (WebCore::ScrollController::startSnapRubberbandTimer): Only build this on Mac.
1544         (WebCore::ScrollController::shouldRubberBandInHorizontalDirection): Ditto.
1545         (WebCore::ScrollController::scrollSnapPointState): Enable on iOS.
1546         (WebCore::ScrollController::hasActiveScrollSnapTimerForAxis): Only build on Mac.
1547         (WebCore::ScrollController::updateScrollSnapState): renamed from 'updateScrollAnimatorsAndTimers'
1548         (WebCore::ScrollController::startScrollSnapTimer): Only build on Mac.
1549         (WebCore::ScrollController::initializeGlideParameters): Ditto.
1550         (WebCore::ScrollController::activeScrollSnapIndexForAxis): Enable on iOS.
1551         (WebCore::ScrollController::setActiveScrollSnapIndicesForOffset): Ditto.
1552         (WebCore::ScrollController::beginScrollSnapAnimation): Only build on Mac.
1553         (WebCore::ScrollController::computeGlideDelta): Ditto.
1554         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Deleted.
1555         * rendering/RenderLayerCompositor.cpp:
1556         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Capture any changes in scroll
1557         snap offset indices.
1558
1559 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
1560
1561         Fullscreen view should not update bounds of video when in PiP.
1562         https://bugs.webkit.org/show_bug.cgi?id=146134
1563
1564         Reviewed by Darin Adler.
1565
1566         Don't update bounds on video layer when it is not a child.
1567
1568         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1569         (-[WebAVVideoLayer setBounds:]):
1570
1571 2015-06-19  Zalan Bujtas  <zalan@apple.com>
1572
1573         RenderRubyText requires RenderRubyRun parent.
1574         https://bugs.webkit.org/show_bug.cgi?id=146148
1575         rdar://problem/21423319
1576
1577         Reviewed by Simon Fraser.
1578
1579         RenderRubyText expects its parent to be RenderRubyRun and since a
1580         a non-block <rt> requires anonymous wrapper, we should check whether
1581         the display type is actually block.
1582
1583         Test: fast/ruby/crash-when-ruby-rt-is-non-block.html
1584
1585         * html/RubyTextElement.cpp:
1586         (WebCore::RubyTextElement::createElementRenderer):
1587
1588 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
1589
1590         cancelPreviousPerformRequestsWithTarget for -resolveBounds in wrong class.
1591         https://bugs.webkit.org/show_bug.cgi?id=146140
1592
1593         Reviewed by Eric Carlson.
1594
1595         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1596         (-[WebCALayerHostWrapper dealloc]): Added.
1597         (-[WebAVVideoLayer dealloc]): Deleted.
1598
1599 2015-06-19  Per Arne Vollan  <peavo@outlook.com>
1600
1601         [WinCairo] Null pointer crash in BitmapTexture::updateContents.
1602         https://bugs.webkit.org/show_bug.cgi?id=146147
1603
1604         Reviewed by Brent Fulgham.
1605
1606         Added null pointer check.
1607
1608         * platform/graphics/texmap/BitmapTexture.cpp:
1609         (WebCore::BitmapTexture::updateContents):
1610
1611 2015-06-19  Anders Carlsson  <andersca@apple.com>
1612
1613         Spintracer treats the web process as hung when it's showing JavaScript dialogs in the UI process
1614         https://bugs.webkit.org/show_bug.cgi?id=146124
1615         rdar://problem/21449395
1616
1617         Reviewed by Geoffrey Garen.
1618
1619         * platform/spi/cg/CoreGraphicsSPI.h:
1620
1621 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
1622
1623         Remove unnecessary svn:executable flags
1624         https://bugs.webkit.org/show_bug.cgi?id=146107
1625
1626         Reviewed by Alexey Proskuryakov.
1627
1628         * html/canvas/CanvasRenderingContext2D.cpp: Removed property svn:executable.
1629         * mathml/MathMLMencloseElement.cpp: Removed property svn:executable.
1630         * mathml/MathMLMencloseElement.h: Removed property svn:executable.
1631         * platform/efl/RenderThemeEfl.cpp: Removed property svn:executable.
1632         * rendering/mathml/RenderMathMLMenclose.cpp: Removed property svn:executable.
1633         * rendering/mathml/RenderMathMLMenclose.h: Removed property svn:executable.
1634
1635 2015-06-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1636
1637         Bindings generator should generate code to catch exception and reject promises for Promise-based APIs
1638         https://bugs.webkit.org/show_bug.cgi?id=146060
1639
1640         Reviewed by Darin Adler.
1641
1642         The binding generator splits the function that binds JS to the DOM class implementation in two for functions returning promise.
1643         The first function, called from JS, is responsible of casting this to the expected JSXXX class.
1644         If casting fails, an exception is raised. Otherwise, it calls the second function.
1645         After calling the second function, it checks whether an exception is raised, in which case it returns a rejected promise.
1646         The second function is responsible of argument conversion and calling the DOM class function.
1647
1648         Covered by expectations and AudioContext promise still working.
1649         A test case is added for a promise returning function taking a typed argument as input (if argument value cannot be typed, the promise is rejected).
1650         A second test case is a promise-returning function that can raise an exception. In that case the DOMException is used as rejection value.
1651
1652         As can be seen from generated code, this generalized code adds a mandatory check (is there an exception?) at the end of the function.
1653         This check is done even in cases we know there will be no exception.
1654         This may be covered by another patch if this optimization is thought useful enough.
1655
1656         * bindings/js/JSDOMPromise.cpp:
1657         (WebCore::rejectPromiseWithExceptionIfAny): Utility method for the binding code.
1658         (WebCore::callPromiseFunction): Ditto.
1659         * bindings/js/JSDOMPromise.h:
1660         * bindings/scripts/CodeGeneratorJS.pm:
1661         (GenerateImplementation):
1662         (GenerateFunctionCastedThis): Extracted from GenerateImplementationFunctionCall to reuse it in case of promise-returning functions.
1663         (GenerateImplementationFunctionCall):
1664         (GenerateCallbackImplementation): Deleted.
1665         * bindings/scripts/test/JS/JSTestObj.cpp:
1666         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
1667         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
1668         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
1669         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
1670         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
1671         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
1672         * bindings/scripts/test/TestObj.idl:
1673
1674 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
1675
1676         Disable UIWindow for fullscreen video for selected clients.
1677         https://bugs.webkit.org/show_bug.cgi?id=145852
1678
1679         Reviewed by Simon Fraser.
1680
1681         Disable UIWindow for fullscreen video doesn't work everywhere (rdar://problem/21315993), so just disable it when creating a UIWindow won't work.
1682         Fix some interface hiding and layout problems that showed up in the non UIWindow code path.
1683
1684         * platform/RuntimeApplicationChecksIOS.h:
1685         * platform/RuntimeApplicationChecksIOS.mm: Remove iAD bundle identifier.
1686         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1687         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Opt out of UIWindow when hosted in another process. And fix view parenting for non-window case.
1688         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Fix for AVKit exit fullscreen complaining about -needsLayout.
1689
1690         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
1691         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
1692         (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen):
1693         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen):
1694         (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen):
1695         (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen):
1696         These hide and show the view controller where we hide and show the window.
1697
1698 2015-06-18  Dean Jackson  <dino@apple.com>
1699
1700         Provide a way for web developers to draw a Theme-specific Wireless Playback icon
1701         https://bugs.webkit.org/show_bug.cgi?id=146123
1702         <rdar://problem/21119287>
1703
1704         Reviewed by Simon Fraser.
1705
1706         Implement a -webkit-named-image() CSS <image> generator that allows a site to
1707         request artwork by name and get the platform variant. At the moment
1708         we only support "wireless-playback" which returns a generic image everywhere
1709         but Cocoa platforms, where we render the AirPlay icon.
1710
1711         In order to do this I added a ThemeCocoa to share any Theme code between
1712         Mac and iOS.
1713
1714         Test: fast/css/named-icons.html
1715
1716         * WebCore.xcodeproj/project.pbxproj: Add new files CSSNamedImageValue, NamedImageGeneratedImage and ThemeCocoa.
1717
1718         * css/CSSImageGeneratorValue.cpp: Handle the new NamedImageClass in the switch statements for downcasting.
1719         (WebCore::CSSImageGeneratorValue::image):
1720         (WebCore::CSSImageGeneratorValue::isFixedSize):
1721         (WebCore::CSSImageGeneratorValue::isPending):
1722         (WebCore::CSSImageGeneratorValue::knownToBeOpaque):
1723
1724         * css/CSSNamedImageValue.cpp: New class. Just holds a name String.
1725         (WebCore::CSSNamedImageValue::customCSSText):
1726         (WebCore::CSSNamedImageValue::image):
1727         (WebCore::CSSNamedImageValue::equals):
1728         * css/CSSNamedImageValue.h:
1729         (WebCore::CSSNamedImageValue::create):
1730         (WebCore::CSSNamedImageValue::isFixedSize):
1731         (WebCore::CSSNamedImageValue::isPending):
1732         (WebCore::CSSNamedImageValue::CSSNamedImageValue):
1733
1734         * css/CSSParser.cpp:
1735         (WebCore::CSSParser::isGeneratedImageValue): Allow "-webkit-named-image(".
1736         (WebCore::CSSParser::parseGeneratedImage): Call parseNamedImage if we hit named-icon.
1737         (WebCore::CSSParser::parseNamedImage): Parse the function looking for a CSS ident.
1738         * css/CSSParser.h:
1739
1740         * css/CSSValue.cpp: Handle NamedImageClass in the various switch statements.
1741         (WebCore::CSSValue::equals):
1742         (WebCore::CSSValue::cssText):
1743         (WebCore::CSSValue::destroy):
1744         * css/CSSValue.h:
1745         (WebCore::CSSValue::isNamedImageValue): Helper to detect the correct CSSValue subclass.
1746
1747         * platform/Theme.cpp:
1748         (WebCore::Theme::drawNamedImage): Draw a generic wireless playback icon.
1749         * platform/Theme.h: Add drawNamedImage.
1750
1751         * platform/cocoa/ThemeCocoa.cpp: New shared base class for ThemeMac and ThemeIOS.
1752         (WebCore::fitContextToBox):
1753         (WebCore::ThemeCocoa::drawNamedImage): Draw an AirPlay icon for wireless playback.
1754         * platform/cocoa/ThemeCocoa.h:
1755
1756         * platform/graphics/CrossfadeGeneratedImage.h: Drive-by removal of unnecessary forward class definition.
1757
1758         * platform/graphics/ImageBuffer.h: Add NamedImageGeneratedImage as a friend class.
1759
1760         * platform/graphics/NamedImageGeneratedImage.cpp: New class. Calls into the Theme to render the artwork.
1761         (WebCore::NamedImageGeneratedImage::NamedImageGeneratedImage):
1762         (WebCore::NamedImageGeneratedImage::draw):
1763         (WebCore::NamedImageGeneratedImage::drawPattern):
1764         * platform/graphics/NamedImageGeneratedImage.h:
1765
1766         * platform/ios/ThemeIOS.h: Inherit from ThemeCocoa.
1767         * platform/mac/ThemeMac.h: Ditto.
1768
1769 2015-06-18  KyungTae Kim  <ktf.kim@samsung.com> and Myles C. Maxfield  <mmaxfield@apple.com>
1770
1771         [CSS3] Add support for the word-break:keep-all CSS property
1772         https://bugs.webkit.org/show_bug.cgi?id=123782
1773
1774         Reviewed by Darin Adler.
1775
1776         Add support for word-break:keep-all CSS property by CSS3 spec:
1777         http://www.w3.org/TR/2013/WD-css-text-3-20131010/#word-break-property
1778
1779         Test: fast/text/word-break-keep-all.html
1780
1781         * css/CSSParser.cpp:
1782         (WebCore::isValidKeywordPropertyAndValue):
1783         * css/CSSPrimitiveValueMappings.h:
1784         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1785         (WebCore::CSSPrimitiveValue::operator EWordBreak):
1786         * css/CSSValueKeywords.in:
1787         * rendering/RenderText.cpp:
1788         (WebCore::RenderText::computePreferredLogicalWidths):
1789         * rendering/break_lines.h:
1790         (WebCore::nextBreakablePositionKeepingAllWords):
1791         (WebCore::nextBreakablePositionKeepingAllWordsIgnoringNBSP):
1792         (WebCore::isBreakable):
1793         * rendering/line/BreakingContext.h:
1794         (WebCore::BreakingContext::handleText):
1795         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
1796         * rendering/style/RenderStyleConstants.h:
1797
1798 2015-06-18  Jon Lee  <jonlee@apple.com>
1799
1800         Update AVKit usage of pip
1801         https://bugs.webkit.org/show_bug.cgi?id=146095
1802         <rdar://problem/21386853>
1803
1804         Reviewed by Eric Carlson.
1805
1806         - Rename enum VideoFullscreenModeOptimized to VideoFullscreenModePictureInPicture
1807         - Rename MediaElementSession::allowsAlternateFullscreen to allowsPictureInPicture
1808         - Rename Settings::allowsAlternateFullscreen to allowsPictureInPictureMediaPlayback
1809         - Update AVKit calls and AVKitSPI.h
1810         - Rename WebVideoFullscreenInterfaceAVKit delegate functions and member variables
1811
1812         * html/HTMLMediaElement.cpp:
1813         * html/HTMLVideoElement.cpp:
1814         * html/MediaElementSession.cpp:
1815         (WebCore::MediaElementSession::allowsPictureInPicture): Renamed.
1816         (WebCore::MediaElementSession::allowsAlternateFullscreen): Deleted.
1817         * html/MediaElementSession.h:
1818         * page/Settings.cpp:
1819         * page/Settings.in:
1820         * platform/graphics/MediaPlayerEnums.h:
1821         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1822         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1823         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Remove unused setIsOptimized.
1824         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1825         * platform/spi/cocoa/AVKitSPI.h: Remove unused typedef.
1826         * platform/spi/mac/AVFoundationSPI.h:
1827
1828 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
1829
1830         Fix crash when entering fullscreen during exit fullscreen animation.
1831         https://bugs.webkit.org/show_bug.cgi?id=146117
1832
1833         Reviewed by Simon Fraser.
1834
1835         Because enterFullscreen can be called during exitFullscreen animation, the exit fullscreen teardown
1836         should not imply a fullscreen state change on video element.
1837
1838         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1839         (WebVideoFullscreenControllerContext::exitFullscreen): May be called from mainThread
1840         (-[WebVideoFullscreenController exitFullscreen]): May be called from mainThread
1841         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
1842         (WebVideoFullscreenModelVideoElement::setVideoElement): 
1843         Changing associated video element does not imply fullscreen mode change.
1844
1845 2015-06-18  Brian J. Burg  <burg@cs.washington.edu>
1846
1847         Web Inspector: improve generated types for objects passed to backend commands
1848         https://bugs.webkit.org/show_bug.cgi?id=146091
1849
1850         Reviewed by Joseph Pecoraro.
1851
1852         Update type signatures for backend command implementations. In a few cases, clean
1853         up relevant helper function signatures and copy data out of parameter objects where
1854         the code previously held onto a reference.
1855
1856         No new tests, no behavior changed.
1857
1858         * inspector/InspectorCSSAgent.cpp:
1859         (WebCore::computePseudoClassMask):
1860         (WebCore::InspectorCSSAgent::setStyleText):
1861         (WebCore::InspectorCSSAgent::setRuleSelector):
1862         (WebCore::InspectorCSSAgent::forcePseudoState):
1863         * inspector/InspectorCSSAgent.h:
1864         * inspector/InspectorDOMAgent.cpp:
1865         (WebCore::parseColor):
1866         (WebCore::parseConfigColor):
1867         (WebCore::parseQuad):
1868         (WebCore::InspectorDOMAgent::performSearch):
1869         (WebCore::InspectorDOMAgent::setSearchingForNode):
1870         (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
1871         (WebCore::InspectorDOMAgent::setInspectModeEnabled):
1872         (WebCore::InspectorDOMAgent::highlightRect):
1873         (WebCore::InspectorDOMAgent::highlightQuad):
1874         (WebCore::InspectorDOMAgent::innerHighlightQuad):
1875         (WebCore::InspectorDOMAgent::highlightNode):
1876         (WebCore::InspectorDOMAgent::highlightFrame):
1877         * inspector/InspectorDOMAgent.h:
1878         * inspector/InspectorDOMStorageAgent.cpp:
1879         (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
1880         (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
1881         (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
1882         (WebCore::InspectorDOMStorageAgent::findStorageArea):
1883         * inspector/InspectorDOMStorageAgent.h:
1884         * inspector/InspectorIndexedDBAgent.cpp:
1885         (WebCore::InspectorIndexedDBAgent::requestData):
1886         * inspector/InspectorIndexedDBAgent.h:
1887         * inspector/InspectorReplayAgent.cpp:
1888         (WebCore::InspectorReplayAgent::replayToPosition):
1889         * inspector/InspectorReplayAgent.h:
1890         * inspector/InspectorResourceAgent.cpp:
1891         (WebCore::InspectorResourceAgent::willSendRequest):
1892         (WebCore::InspectorResourceAgent::setExtraHTTPHeaders):
1893         Clean up extraHTTPHeaders to copy header key/values out of the InspectorObject, rather
1894         than retaining the protocol object indefinitely. This matches the ownership scheme used
1895         everywhere else.
1896
1897         * inspector/InspectorResourceAgent.h:
1898         * inspector/InspectorStyleSheet.h:
1899         (WebCore::InspectorCSSId::InspectorCSSId):
1900         * inspector/InspectorWorkerAgent.cpp:
1901         (WebCore::InspectorWorkerAgent::sendMessageToWorker):
1902         * inspector/InspectorWorkerAgent.h:
1903
1904 2015-06-18  Anders Carlsson  <andersca@apple.com>
1905
1906         Remove shouldInterruptJavaScript
1907         https://bugs.webkit.org/show_bug.cgi?id=146118
1908
1909         Reviewed by Antti Koivisto.
1910
1911         The WebKit SPI methods for deciding whether JavaScript execution should be interrupted hasn't been used
1912         for many releases. Furthermore, they don't make sense in the multi-process architecture since it's still possible
1913         to interrupt execution (by closing the browser tab or window) from the UI process.
1914
1915         * bindings/js/JSDOMWindowBase.cpp:
1916         (WebCore::JSDOMWindowBase::shouldInterruptScript):
1917         * loader/EmptyClients.h:
1918         * page/Chrome.cpp:
1919         (WebCore::Chrome::shouldInterruptJavaScript): Deleted.
1920         * page/Chrome.h:
1921         * page/ChromeClient.h:
1922
1923 2015-06-18  Benjamin Poulain  <bpoulain@apple.com>
1924
1925         [CSS JIT][ARMv7] The pseudo element early exit trashes r6
1926         https://bugs.webkit.org/show_bug.cgi?id=146078
1927
1928         Reviewed by Alex Christensen.
1929
1930         The pseudo element early failure runs before we generate the prologue.
1931         The reason is that we can often exit immediately on function entry, before
1932         we even touch any memory.
1933
1934         On ARMv7, we don't have many spare registers so the MacroAssembler
1935         uses r6 as a scratch register and the client code is expected to save
1936         it.
1937
1938         In the early failure case, we were not pushing r6 before using the MacroAssembler
1939         and its value could be trashed.
1940
1941         This patch push the macro assembler registers separately from the prologue.
1942
1943         For restoring the registers, a new function generateFunctionEnding() encapsulate
1944         the pop() and ret().
1945
1946         * cssjit/SelectorCompiler.cpp:
1947         (WebCore::SelectorCompiler::SelectorCodeGenerator::pushMacroAssemblerRegisters):
1948         (WebCore::SelectorCompiler::SelectorCodeGenerator::popMacroAssemblerRegisters):
1949         (WebCore::SelectorCompiler::SelectorCodeGenerator::generatePrologue):
1950         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateEpilogue):
1951         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
1952
1953         * cssjit/StackAllocator.h:
1954         (WebCore::StackAllocator::operator=):
1955         We have a new case for the stack allocator: some stack changes are conditional
1956         at compile time instead of runtime. This is easy to deal with by overriding
1957         the stack if a path is not taken at compile time.
1958
1959 2015-06-17  Conrad Shultz  <conrad_shultz@apple.com>
1960
1961         REGRESSION: js/dom/navigator-plugins-crash.html asserts a lot
1962         https://bugs.webkit.org/show_bug.cgi?id=144399
1963
1964         Reviewed by Darin Adler.
1965
1966         Earlier work made the array of web-visible plug-ins dynamic, but allowed DOMPlugin (and, indirectly by extension,
1967         DOMMimeType) to continue keeping a reference to a plug-in in terms of an index into that array. This superficially
1968         appeared correct since DOMPlugin immutably holds onto a PluginData instance, which in turn immutably holds onto a
1969         Page instance. PluginStrategy::getWebVisiblePluginInfo() is passed this Page, which is used to determine the contents
1970         of the plugin array. The expectation was that keeping an index would still be safe since the Page is not changing,
1971         but this is not strictly correct since relevant attributes of the Page and/or the available plugins may still change.
1972
1973         It's not entirely clear why the test failures are intermittent and occur only on certain configurations, but address
1974         them by eliminating the incorrect storage of indexes in favor of keeping copies of the relevant plugin info itself.
1975
1976         * plugins/DOMMimeType.cpp:
1977         (WebCore::DOMMimeType::DOMMimeType):
1978         Instead of storing the MIME type index, retrieve and store the MIME class info and plugin info.
1979         (WebCore::DOMMimeType::type):
1980         Directly access the m_mimeClassInfo member.
1981         (WebCore::DOMMimeType::suffixes):
1982         Ditto.
1983         (WebCore::DOMMimeType::description):
1984         Ditto.
1985         (WebCore::DOMMimeType::enabledPlugin):
1986         Directly access the m_pluginInfo member.
1987         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
1988
1989         * plugins/DOMMimeType.h:
1990         Update member variables.
1991
1992         * plugins/DOMPlugin.cpp:
1993         (WebCore::DOMPlugin::DOMPlugin):
1994         Instead of storing the plugin index, store the plugin info directly.
1995         (WebCore::DOMPlugin::name):
1996         Directly access m_pluginInfo.
1997         (WebCore::DOMPlugin::filename):
1998         Ditto.
1999         (WebCore::DOMPlugin::description):
2000         Ditto.
2001         (WebCore::DOMPlugin::length):
2002         Ditto.
2003         (WebCore::DOMPlugin::item):
2004         Access m_pluginInfo directly; find the matching plug-in based on matching PluginInfo (for which an overloaded
2005         comparator is supplied below).
2006         (WebCore::DOMPlugin::pluginInfo): Deleted.
2007
2008         * plugins/DOMPlugin.h:
2009         Update member variables.
2010         (WebCore::DOMPlugin::create):
2011         Accept a PluginInfo instead of a plugin index.
2012
2013         * plugins/DOMPluginArray.cpp:
2014         (WebCore::DOMPluginArray::item):
2015         (WebCore::DOMPluginArray::namedItem):
2016
2017         * plugins/PluginData.h:
2018         (WebCore::operator==):
2019         Added; compare PluginInfo structs on the basis of member equality.
2020
2021 2015-06-17  Alex Christensen  <achristensen@webkit.org>
2022
2023         [Content Extensions] Log blocked loads to the WebInspector console
2024         https://bugs.webkit.org/show_bug.cgi?id=146089
2025
2026         Reviewed by Joseph Pecoraro.
2027
2028         * contentextensions/ContentExtensionsBackend.cpp:
2029         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
2030         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
2031         Log which URLs are blocked and the URL of the page they are blocked from.
2032
2033 2015-06-18  Joseph Pecoraro  <pecoraro@apple.com>
2034
2035         Crash under WebCore::DOMWindow::dispatchMessageEventWithOriginCheck attempting to log console message
2036         https://bugs.webkit.org/show_bug.cgi?id=146093
2037
2038         Reviewed by Timothy Hatcher.
2039
2040         * page/DOMWindow.cpp:
2041         (WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):
2042         The console could be null so null check its use.
2043
2044 2015-06-18  Csaba Osztrogonác  <ossy@webkit.org>
2045
2046         Suppress null-conversion warnings in ANGLE
2047         https://bugs.webkit.org/show_bug.cgi?id=145125
2048
2049         Reviewed by Alex Christensen.
2050
2051         * CMakeLists.txt:
2052
2053 2015-06-18  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
2054
2055         [Streams API] Implement ReadableStreamReader.releaseLock
2056         https://bugs.webkit.org/show_bug.cgi?id=145299
2057
2058         Reviewed by Darin Adler.
2059
2060         Covered by rebased tests.
2061
2062         * Modules/streams/ReadableStream.cpp:
2063         (WebCore::ReadableStream::close): Moving some close code to newly added releaseReader.
2064         (WebCore::ReadableStream::releaseReader): Implements reader release and callbacks finalization.
2065         (WebCore::ReadableStream::changeStateToErrored): Calls releaseReader.
2066         * Modules/streams/ReadableStream.h:
2067         (WebCore::ReadableStream::hasReadPendingRequests): Added to enable reader.releaseLock throwing if read requests are pending.
2068         * Modules/streams/ReadableStreamReader.cpp:
2069         (WebCore::ReadableStreamReader::releaseLock): Implementation of releaseLock
2070         * Modules/streams/ReadableStreamReader.h:
2071         * Modules/streams/ReadableStreamReader.idl:
2072         (WebCore::releaseLock): Deleted.
2073
2074 2015-06-18  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2075
2076         GObject and ObjC bindings generator should not generate code for promise-based APIs
2077         https://bugs.webkit.org/show_bug.cgi?id=146059
2078
2079         Reviewed by Darin Adler.
2080
2081         Covered by rebased expectations.
2082
2083         * bindings/scripts/CodeGeneratorGObject.pm:
2084         (SkipFunction): Disabling GObject DOM binding for functions returning promises.
2085         * bindings/scripts/CodeGeneratorObjC.pm:
2086         (SkipFunction): Disabling ObjC DOM binding for functions returning promises.
2087         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Rebasing expectation.
2088         (webkit_dom_test_obj_get_read_only_long_attr): Deleted.
2089         (webkit_dom_test_obj_get_read_only_string_attr): Deleted.
2090         * bindings/scripts/test/GObject/WebKitDOMTestObj.h: Rebasing expectation.
2091         * bindings/scripts/test/ObjC/DOMTestObj.h: Ditto.
2092         * bindings/scripts/test/ObjC/DOMTestObj.mm: Ditto.
2093         (core): Deleted.
2094
2095 2015-06-17  Ryuan Choi  <ryuan.choi@navercorp.com>
2096
2097         [EFL] test_ewk2_context_url_scheme_register has been crashed since r185553
2098         https://bugs.webkit.org/show_bug.cgi?id=146075
2099
2100         Reviewed by Carlos Garcia Campos.
2101
2102         Since r185553, CustomProtocolManager sends StartLoading message to UIProcess
2103         with request of SoupGenericRequest instead of request itself.
2104         But, request of SoupGenericRequest is nullptr in EFL port because EFL port
2105         does not use m_initiatingPageID.
2106
2107         This patch updates request of SoupGenericRequest although m_initiatingPageID is null.
2108
2109         * platform/network/soup/ResourceRequestSoup.cpp: 
2110         (WebCore::ResourceRequest::updateSoupRequest):
2111
2112 2015-06-17  Daniel Bates  <dabates@apple.com>
2113
2114         Client may receive began editing callback for already focused text field
2115         https://bugs.webkit.org/show_bug.cgi?id=146074
2116         <rdar://problem/21293562>
2117
2118         Reviewed by Darin Adler.
2119
2120         Fixes an issue where the client would be notified that began editing in a text field
2121         for each programmatic DOM focus event dispatched at the text field regardless of
2122         whether the field was focused. The client should only be notified that began editing
2123         exactly once when a text field becomes focused (either programmatically or by user interaction).
2124
2125         * html/TextFieldInputType.cpp:
2126         (WebCore::TextFieldInputType::forwardEvent): Move logic to dispatch editing began callback from here...
2127         (WebCore::TextFieldInputType::handleFocusEvent): to here. This function is called when the
2128         text field becomes newly focused.
2129         * html/TextFieldInputType.h:
2130
2131 2015-06-17  Alex Christensen  <achristensen@webkit.org>
2132
2133         [Content Extensions] Fail to parse invalid arrays
2134         https://bugs.webkit.org/show_bug.cgi?id=146079
2135         rdar://problem/21422649
2136
2137         Reviewed by Benjamin Poulain.
2138
2139         Covered by new and corrected API tests.
2140
2141         * contentextensions/ContentExtensionParser.cpp:
2142         (WebCore::ContentExtensions::loadTrigger):
2143         Fail to parse invalid arrays for if-domain, unless-domain, resource-type, and load-type arrays.
2144
2145 2015-06-16  Jon Honeycutt  <jhoneycutt@apple.com>
2146
2147         Position::findParent() should take a reference
2148         https://bugs.webkit.org/show_bug.cgi?id=146038
2149
2150         Reviewed by Darin Adler.
2151
2152         * dom/Position.cpp:
2153         (WebCore::Position::containerNode):
2154         (WebCore::Position::parentAnchoredEquivalent):
2155         Pass a reference; there is already a null check.
2156         (WebCore::Position::previous):
2157         Add a missing null check. Code below this expects that node is non-null.
2158         (WebCore::Position::next):
2159         Ditto.
2160         (WebCore::Position::atStartOfTree):
2161         (WebCore::Position::atEndOfTree):
2162         Pass a reference.
2163         (WebCore::Position::findParent):
2164         Changed to take a reference.
2165
2166         * dom/Position.h:
2167         Ditto.
2168
2169 2015-06-17  Brent Fulgham  <bfulgham@apple.com>
2170
2171         Overflow regions with scroll snap points are not reliably rubber banding
2172         https://bugs.webkit.org/show_bug.cgi?id=142522
2173         <rdar://problem/20100726>
2174
2175         Reviewed by Darin Adler.
2176
2177         When computing the target scroll destination, update the nearest snap point index
2178         and other bookkeeping, but keep the original gesture target if it would have taken
2179         us beyond either limit of the scroll container.
2180
2181         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2182         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2183         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollExtents): Add new method
2184         to support client API.
2185         * platform/ScrollAnimator.cpp:
2186         (WebCore::ScrollAnimator::scrollExtents): Add new method to support client API.
2187         * platform/ScrollAnimator.h:
2188         * platform/cocoa/ScrollController.h:
2189         (WebCore::ScrollControllerClient::scrollExtents): Added new pure virtual method to API.
2190         * platform/cocoa/ScrollController.mm:
2191         (WebCore::ScrollController::beginScrollSnapAnimation): Hold onto original user gesture
2192         target, and use that instead of our nearest snap point if the gesture takes us past
2193         either extreme of the scroll container.
2194
2195 2015-06-17  Tim Horton  <timothy_horton@apple.com>
2196
2197         Swipe gesture can get stuck, preventing scrolling and other gestures
2198         https://bugs.webkit.org/show_bug.cgi?id=146088
2199         <rdar://problem/16056087>
2200
2201         Reviewed by Darin Adler.
2202
2203         * WebCore.xcodeproj/project.pbxproj:
2204         * platform/spi/mac/NSEventSPI.h: Added.
2205         Add an SPI header.
2206
2207 2015-06-16  Matt Rajca  <mrajca@apple.com>
2208
2209         MediaSession: handle MediaEventTrackNext and MediaEventTrackPrevious events
2210         https://bugs.webkit.org/show_bug.cgi?id=146028
2211
2212         Reviewed by Darin Adler.
2213
2214         * Modules/mediasession/MediaRemoteControls.idl: Added nexttrack/previoustrack event handlers.
2215         * Modules/mediasession/MediaSession.cpp: Dispatch the nexttrack/previoustrack events.
2216         (WebCore::MediaSession::skipToNextTrack):
2217         (WebCore::MediaSession::skipToPreviousTrack):
2218         * Modules/mediasession/MediaSession.h:
2219         * Modules/mediasession/MediaSessionManager.cpp: Skip to the next/previous track as described in the media session spec.
2220         (WebCore::MediaSessionManager::skipToNextTrack):
2221         (WebCore::MediaSessionManager::skipToPreviousTrack):
2222         * Modules/mediasession/MediaSessionManager.h:
2223         * dom/EventNames.h: Added the nexttrack/previoustrack event names.
2224         * page/Page.cpp: Tell MediaSessionManager to handle the new track-skipping events.
2225         (WebCore::Page::handleMediaEvent):
2226
2227 2015-06-17  Chris Fleizach  <cfleizach@apple.com>
2228
2229         AX: VoiceOver in iOS not announcing generic WAI-ARIA region, even if labelled properly
2230         https://bugs.webkit.org/show_bug.cgi?id=146066
2231
2232         Reviewed by Darin Adler.
2233
2234         Allow the region role to identify as a landmark type.
2235
2236         Updated test: platform/ios-simulator/accessibility/landmark-types.html
2237
2238         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2239         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
2240
2241 2015-06-17  Simon Fraser  <simon.fraser@apple.com>
2242
2243         REGRESSION (r173283-r173296): Amazon.com front page has no caret in the search field
2244         https://bugs.webkit.org/show_bug.cgi?id=146073
2245         rdar://problem/21022203
2246
2247         Reviewed by Tim Horton.
2248
2249         Text controls (text inputs and textareas) need backing store even when empty, because
2250         they need to be able to paint a caret.
2251
2252         Test: compositing/backing/form-controls-backing.html
2253
2254         * rendering/RenderLayerBacking.cpp:
2255         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
2256
2257 2015-06-17  Zalan Bujtas  <zalan@apple.com>
2258
2259         Selection cache produces invalid result when ancestor has float element.
2260         https://bugs.webkit.org/show_bug.cgi?id=146042
2261         rdar://problem/20604592
2262
2263         Reviewed by Ryosuke Niwa.
2264
2265         Selection cache already takes floats into account, however it's not enough to check current
2266         block against floats. Any of the ancestor's float starting from the selection root block
2267         can impact the selection offsets.
2268
2269         Test: fast/block/selection-cache-is-incorrect-when-non-direct-parent-has-float.html
2270
2271         * rendering/LogicalSelectionOffsetCaches.h:
2272         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::ContainingBlockInfo):
2273         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock):
2274         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::block):
2275         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::cache):
2276         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::hasFloatsOrFlowThreads):
2277         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
2278
2279 2015-06-17  Joanmarie Diggs  <jdiggs@igalia.com>
2280
2281         AX: [ATK] Expose element tag name as an object attribute
2282         https://bugs.webkit.org/show_bug.cgi?id=146062
2283
2284         Reviewed by Mario Sanchez Prada.
2285
2286         Expose the element tag name as an object attribute with name "tag" and
2287         value being the lowercase tag name, both being what Gecko does for ATK.
2288
2289         No new tests. We already have sufficient coverage for AtkObject attributes.
2290         These tests have been updated to reflect the addition of the new attribute.
2291
2292         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2293         (webkitAccessibleGetAttributes):
2294
2295 2015-06-17  Antti Koivisto  <antti@apple.com>
2296
2297         iOS WebKit1: [LegacyTileLayer drawInContext:] should ensure it has web lock
2298         https://bugs.webkit.org/show_bug.cgi?id=146072
2299         rdar://problem/21149759
2300
2301         Reviewed by Simon Fraser
2302
2303         There are some scenarios where we end up drawing without web lock due to client or system issues.
2304         This can cause crashes.
2305
2306         * platform/ios/LegacyTileLayer.mm:
2307         (-[LegacyTileLayer setNeedsDisplayInRect:]):
2308         (-[LegacyTileLayer drawInContext:]):
2309
2310             Ensure we have the web lock when called in main thread (even though we should have it already).
2311
2312 2015-06-17  Brent Fulgham  <bfulgham@apple.com>
2313
2314         CSS scroll snap: defining snap points on axis that does not scroll does not work properly
2315         https://bugs.webkit.org/show_bug.cgi?id=146043
2316         <rdar://problem/20125511>
2317
2318         Reviewed by Simon Fraser.
2319
2320         Tested by css3/scroll-snap/scroll-snap-mismatch.html
2321
2322         We always seed the set of scroll snap points with the start and end of the scroll container. This is not
2323         the right behavior if there are no scroll points defined, because we end up creating a snap for the start
2324         and end of the container, and any scroll gesture just takes us across the entire element.
2325         
2326         Instead, when we do not find any scroll snap points, we should clear the snap point state for the container.
2327
2328         * page/scrolling/AxisScrollSnapOffsets.cpp:
2329         (WebCore::updateFromStyle): If we did not find any snap points (i.e., the snapOffsets container
2330         only holds '0', return an empty Vector. 
2331         (WebCore::updateSnapOffsetsForScrollableArea): If the set of snap points produced by 'updateFromStyle' is empty,
2332         clear the horizontal (or vertical) snap offsets for the scroll area.
2333         
2334
2335 2015-06-17  Chris Fleizach  <cfleizach@apple.com>
2336
2337         AX: input role="spinbutton" gets skipped in voiceover
2338         https://bugs.webkit.org/show_bug.cgi?id=145514
2339
2340         Reviewed by Mario Sanchez Prada.
2341
2342         SpinButton role was added, but left out of iOS.
2343         To prevent this from happening again, explicitly list every role in the switch statement that
2344         determines accessible visibility.
2345
2346         Test: platform/ios-simulator/accessibility/spinbutton.html
2347
2348         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2349         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2350         (-[WebAccessibilityObjectWrapper isAccessibilityElement]):
2351
2352 2015-06-17  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2353
2354         [Streams API] ReadableJSStream should handle promises returned by JS source pull callback
2355         https://bugs.webkit.org/show_bug.cgi?id=145965
2356
2357         Reviewed by Darin Adler.
2358
2359         Implemented asynchronous pulling.
2360         In particular, ensuring that doPull is not called as long as previous call to doPull is finished.
2361         Storing whether to pull automatically when the current pull is finished. 
2362
2363         Covered by rebased tests.
2364
2365         * Modules/streams/ReadableStream.cpp:
2366         (WebCore::ReadableStream::pull): stores whether to pull again.
2367         (WebCore::ReadableStream::finishPulling): called when pulling finishes.
2368         * Modules/streams/ReadableStream.h:
2369         * bindings/js/ReadableJSStream.cpp:
2370         (WebCore::createPullResultFulfilledFunction): The promise resolve callback.
2371         (WebCore::ReadableJSStream::doPull): Handling of promise.
2372         * bindings/js/ReadableJSStream.h:
2373
2374 2015-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2375
2376         WebProcess crashes after too many redirect error when there's an active NPAPI plugin
2377         https://bugs.webkit.org/show_bug.cgi?id=146019
2378
2379         Reviewed by Darin Adler.
2380
2381         This happens with the GTK+ port after a navigation action ends up
2382         in an infinite redirection and the ResourceHandle fails with too
2383         many redirections error. I should actually happen after any error
2384         is reported by the ResourceHnalder before the load is
2385         committed. But tt only happens if there's an active NPAPI
2386         plugin. The problem is that FrameLoader::receivedMainResourceError()
2387         is called recursively because DocumentLoader::stopLoading() ends up
2388         calling mainReceivedError() that calls FrameLoader::receivedMainResourceError()
2389         again. DocumentLoader::stopLoading() checks if the document is
2390         still loading, which can happen if the main resource is loading,
2391         if there's any subresource loading or if there's a plugin
2392         loading. So, in case of being loading, those cases are handled
2393         individually to cancel the main resource, or set an error in the
2394         document loader and cancel subresources and plugins, except for
2395         this case of plugins, that mainReceivedError is called instead of
2396         setting cancelled error on the document loader.
2397
2398         * loader/DocumentLoader.cpp:
2399         (WebCore::DocumentLoader::stopLoading): If the document is still
2400         loading because there are active plugins, set the cancelled error
2401         on the document instead of calling mainReceivedError again.
2402
2403 2015-06-16  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
2404
2405         [Streams API] Implement ReadableStream locked property
2406         https://bugs.webkit.org/show_bug.cgi?id=146023
2407
2408         Reviewed by Darin Adler.
2409
2410         Covered by rebased tests.
2411
2412         * Modules/streams/ReadableStream.h:
2413         (WebCore::ReadableStream::locked): Renamed isLocked by locked.
2414         * Modules/streams/ReadableStream.idl: Adding locked.
2415         * bindings/js/JSReadableStreamCustom.cpp:
2416         (WebCore::JSReadableStream::getReader): Using isLocked.
2417         * bindings/js/JSReadableStreamReaderCustom.cpp:
2418         (WebCore::constructJSReadableStreamReader): Using isLocked.
2419
2420 2015-06-16  Myles C. Maxfield  <mmaxfield@apple.com>
2421
2422         REGRESSION(r184899): [Cocoa] font-variant: small-caps is not honored with web fonts
2423         https://bugs.webkit.org/show_bug.cgi?id=145873
2424         <rdar://problem/21314282>
2425
2426         Reviewed by Dean Jackson.
2427
2428         When font-variant: small-caps is applied, we create a smaller version of the original font
2429         and draw capital characters in that smaller font. CGFontRefs do not have an intrinsic size,
2430         and web fonts historically only had a CGFontRef, which means that there was no need to
2431         convert the CGFontRef to be smaller (as opposed to regular fonts, which had a CTFontRef and
2432         therefore needed the conversion). Instead, we just changed m_size, which represents
2433         the size that the text should be drawn in.
2434
2435         However, r184899 gave CTFontRefs to web fonts. This means that now the FontPlatformData's
2436         m_size variable disagreed with the CTFontRef member. The solution here is to unify the web
2437         font and regular font codepaths, and treat them the same throughout.
2438
2439         Note that this patch removes the last use of the m_isCustomFont variable. As soon as we
2440         entirely migrate to CORETEXT_WEB_FONTS, we should delete this variable.
2441
2442         Test: fast/text/small-caps-web-font.html
2443
2444         * platform/graphics/cocoa/FontCocoa.mm:
2445         (WebCore::Font::platformCreateScaledFont): Treat web fonts the same as regular fonts.
2446         * platform/text/TextFlags.h: Add a comment regarding teh deletion of m_isCustomFont.
2447
2448 2015-06-16  Alex Christensen  <achristensen@webkit.org>
2449
2450         [Content Extensions] Implement branch compaction for DFA bytecode.
2451         https://bugs.webkit.org/show_bug.cgi?id=145619
2452
2453         Reviewed by Benjamin Poulain.
2454
2455         This patch adds another pass to the DFABytecodeCompiler which finds where the bytecode from each node
2456         would be if it were compiled with no branch compaction, then uses that as a worst-case value to determine
2457         how many bytes are needed to store the relative jump distance.  Then when linking, it will fill in the 
2458         value as it already did, but with a variable size jump.  The jumps are also now signed distances relative to
2459         where the jump is stored.
2460
2461         This patch is covered by existing tests, which have many jumps that are near the -128/127 byte boundary,
2462         and the switch from 16-bit jumps to 32-bit jumps near the -65536/65535 byte boundary is analogous.
2463
2464         * contentextensions/ContentExtensionCompiler.cpp:
2465         (WebCore::ContentExtensions::compileRuleList):
2466         * contentextensions/DFABytecode.h:
2467         (WebCore::ContentExtensions::smallestPossibleJumpSize):
2468         (WebCore::ContentExtensions::instructionSizeWithArguments):
2469         * contentextensions/DFABytecodeCompiler.cpp:
2470         (WebCore::ContentExtensions::append):
2471         (WebCore::ContentExtensions::appendZeroes):
2472         (WebCore::ContentExtensions::setBits):
2473         (WebCore::ContentExtensions::appendActionBytecodeSize):
2474         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
2475         (WebCore::ContentExtensions::DFABytecodeCompiler::longestPossibleJump):
2476         (WebCore::ContentExtensions::DFABytecodeCompiler::emitJump):
2477         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
2478         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
2479         (WebCore::ContentExtensions::DFABytecodeCompiler::emitTerminate):
2480         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
2481         (WebCore::ContentExtensions::DFABytecodeCompiler::compiledNodeMaxBytecodeSize):
2482         (WebCore::ContentExtensions::DFABytecodeCompiler::ranges):
2483         (WebCore::ContentExtensions::DFABytecodeCompiler::checkForRangeMaxBytecodeSize):
2484         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
2485         (WebCore::ContentExtensions::DFABytecodeCompiler::nodeTransitionsMaxBytecodeSize):
2486         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
2487         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
2488         (WebCore::ContentExtensions::set32Bits): Deleted.
2489         * contentextensions/DFABytecodeCompiler.h:
2490         * contentextensions/DFABytecodeInterpreter.cpp:
2491         (WebCore::ContentExtensions::getBits):
2492         (WebCore::ContentExtensions::getInstruction):
2493         (WebCore::ContentExtensions::jumpSizeInBytes):
2494         (WebCore::ContentExtensions::getJumpSize):
2495         (WebCore::ContentExtensions::getJumpDistance):
2496         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
2497         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
2498         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot):
2499         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2500         * loader/ResourceLoadInfo.h:
2501
2502 2015-06-16  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2503
2504         [GTK] [Wayland] Should be possible to build with support for both X11 and Wayland.
2505         https://bugs.webkit.org/show_bug.cgi?id=145701
2506
2507         Reviewed by Darin Adler.
2508
2509         No new tests, no behavior changes.
2510
2511         When building both targets, we have to include the wayland-egl
2512         headers in order to build the Wayland target. This causes that
2513         EGLNativePixmapType and EGLNativeWindowType get defined as
2514         different types than when building only the X11 target.
2515
2516         By type casting them to the ones that are expected, we are able
2517         to build both targets at the same time.
2518
2519         I have done tests (building each target alone as also both targets
2520         at the same time), and everything seems to works as expected.
2521
2522         Once built for both targets, if you try to launch the MiniBrowser
2523         from inside a Wayland compositor (Weston on top of X for example),
2524         it will trigger the X11 target if the DISPLAY environment variable
2525         is set and the environment variable GDK_BACKEND is not set to wayland,
2526         otherwise it will trigger the Wayland target.
2527
2528         * platform/graphics/GLContext.cpp:
2529         (WebCore::GLContext::createContextForWindow): Add type casts. We have
2530         to consider here two different type casts depending on the type of
2531         GLNativeWindowType to avoid a build failure on 32-bits platforms.
2532         The static_cast one was already beeing done as an implicit cast
2533         (from uint64_t to XID), the reinterpret_cast is the new one that
2534         we need to do only when building on both platforms.
2535         * platform/graphics/egl/GLContextEGL.cpp: Add missing include when
2536         building both targets that is required for defining DefaultRootWindow().
2537         (WebCore::GLContextEGL::createPixmapContext): Add type cast.
2538
2539 2015-06-15  Jon Honeycutt  <jhoneycutt@apple.com>
2540
2541         [iOS] Crash long pressing on <input type=file>
2542         https://bugs.webkit.org/show_bug.cgi?id=146009
2543         <rdar://problem/21234453>
2544
2545         Reviewed by Ryosuke Niwa.
2546
2547         * dom/Position.cpp:
2548         (WebCore::Position::atStartOfTree):
2549         (WebCore::Position::atEndOfTree):
2550         Null check the container node before passing it to findParent().
2551
2552 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
2553
2554         AX:  iOS accessibility tests are not running because we need WKTR support
2555         https://bugs.webkit.org/show_bug.cgi?id=145991
2556
2557         Reviewed by Daniel Bates.
2558
2559         Make some minor modifications to support notification handling in WKTR.
2560
2561         * accessibility/ios/AXObjectCacheIOS.mm:
2562         (WebCore::AXObjectCache::postPlatformNotification):
2563         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2564         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2565         (-[WebAccessibilityObjectWrapper accessibilityClickPoint]):
2566         (-[WebAccessibilityObjectWrapper description]):
2567         (-[WebAccessibilityObjectWrapper accessibilitySetPostedNotificationCallback:withContext:]): Deleted.
2568         (-[WebAccessibilityObjectWrapper accessibilityPostedNotification:]): Deleted.
2569
2570 2015-06-16  Mark Lam  <mark.lam@apple.com>
2571
2572         Use NakedPtr<Exception>& to return exception results.
2573         https://bugs.webkit.org/show_bug.cgi?id=145870
2574
2575         Reviewed by Anders Carlsson and Filip Pizlo.
2576
2577         No new WebCore tests because this functionality is already covered by existing tests.
2578         API tests added for WTF::NakedPtr.
2579
2580         * bindings/js/JSCallbackData.cpp:
2581         (WebCore::JSCallbackData::invokeCallback):
2582         * bindings/js/JSCustomXPathNSResolver.cpp:
2583         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
2584         * bindings/js/JSErrorHandler.cpp:
2585         (WebCore::JSErrorHandler::handleEvent):
2586         * bindings/js/JSEventListener.cpp:
2587         (WebCore::JSEventListener::handleEvent):
2588         * bindings/js/JSMainThreadExecState.cpp:
2589         (WebCore::JSMainThreadExecState::didLeaveScriptContext):
2590         (WebCore::functionCallHandlerFromAnyThread):
2591         (WebCore::evaluateHandlerFromAnyThread):
2592         * bindings/js/JSMainThreadExecState.h:
2593         (WebCore::JSMainThreadExecState::currentState):
2594         (WebCore::JSMainThreadExecState::call):
2595         (WebCore::JSMainThreadExecState::evaluate):
2596         * bindings/js/JSMutationCallback.cpp:
2597         (WebCore::JSMutationCallback::call):
2598         * bindings/js/ScheduledAction.cpp:
2599         (WebCore::ScheduledAction::executeFunctionInContext):
2600         * bindings/js/ScriptController.cpp:
2601         (WebCore::ScriptController::evaluateInWorld):
2602         * bindings/js/WorkerScriptController.cpp:
2603         (WebCore::WorkerScriptController::evaluate):
2604         (WebCore::WorkerScriptController::setException):
2605         * bindings/js/WorkerScriptController.h:
2606         (WebCore::WorkerScriptController::workerGlobalScopeWrapper):
2607         * bindings/objc/WebScriptObject.mm:
2608         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2609         * workers/WorkerGlobalScope.cpp:
2610         (WebCore::WorkerGlobalScope::importScripts):
2611
2612 2015-06-16  Brent Fulgham  <bfulgham@apple.com>
2613
2614         CSS Scroll Snap - support snapping to nested elements
2615         https://bugs.webkit.org/show_bug.cgi?id=145843
2616         <rdar://problem/21339581>
2617
2618         Reviewed by Darin Adler.
2619
2620         Tested by css3/scroll-snap/nested-elements.html
2621
2622         The Scroll Snap Point implementation was not properly handling nested elements.
2623         This could be resolved by recursively calling 'appendChildSnapOffsets', but this
2624         seemed like an inefficient approach, especially considering how often this method
2625         is called during various scaling and other operations.
2626         
2627         Instead, do the following:
2628         (1) Add a new HashSet to RenderView that holds a collection of RenderElements that
2629             have scroll-snap-coordinates.
2630         (2) During RenderElement::styleWillChange, register all elements that have the
2631             scroll-snap-coordinates style with the RenderView.
2632         (3) When performing 'appendChildSnapOffsets', refer to the HashSet of elements, select the
2633             subset of these entries relevant to the current scrolling container, and build up the
2634             set of scroll-snap-coordinates needed for the current scrolling container.
2635
2636         * page/scrolling/AxisScrollSnapOffsets.cpp:
2637         (WebCore::appendChildSnapOffsets): Check the scroll-snap-coordinate RenderElement HashSet
2638         for the RenderView to find all elements that are children of the current scrolling container.
2639         Add the scroll-snap-coordinates for these RenderElements to the current set of snap points.
2640         * rendering/RenderElement.cpp:
2641         (WebCore::findEnclosingScrollableContainer): New helper function.
2642         (WebCore::RenderElement::styleWillChange): If the current element has scroll-snap-coordinate
2643         defined, remember it for later so we can use it with the relevant scrolling container
2644         after layout completes.
2645         (WebCore::RenderElement::willBeRemovedFromTree): Unregister the current element from the
2646         RenderView.
2647         (WebCore::RenderElement::findEnclosingScrollableContainer): Added. Locate the relevant
2648         scrolling container for the current object.
2649         * rendering/RenderElement.h:
2650         * rendering/RenderView.cpp:
2651         (WebCore::Document::registerRenderElementWithScrollSnapCoordinates): Added.
2652         (WebCore::Document::unregisterRenderElementWithScrollSnapCoordinates): Added.
2653         * rendering/RenderView.h:
2654
2655 2015-06-16  Brady Eidson  <beidson@apple.com>
2656
2657         [IndexedDB] array index keys are concatenated across cursor lifetime
2658         <rdar://problem/19684902> and https://bugs.webkit.org/show_bug.cgi?id=138504
2659
2660         Reviewed by Brady Eidson, patch by Mark Dixon <mark@lowla.io>
2661
2662         Tested by:
2663         storage/indexeddb/keypath-arrays.html
2664
2665         IDBKeyData and IDBKeyPath need to clear any existing array values before calling
2666         decodeObjects to update the value of an existing object.
2667         
2668         * Modules/indexeddb/IDBKeyData.cpp:
2669         (WebCore::IDBKeyData::decode):
2670         * Modules/indexeddb/IDBKeyPath.cpp:
2671         (WebCore::IDBKeyPath::decode):
2672
2673 2015-06-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2674
2675         Canvas dimensions should be limited to 4096x4096 pixels on iOS devices.
2676         https://bugs.webkit.org/show_bug.cgi?id=145998
2677
2678         Reviewed by Darin Adler.
2679
2680         The value of MaxCanvasArea should depend on the platform. If the platform
2681         is iOS, the limit should be 64M. Otherwise the limit should be 1G.
2682
2683         Test: fast/canvas/pattern-too-large-to-create-2.html
2684
2685         * html/HTMLCanvasElement.cpp: Change MaxCanvasArea value based on the platform. 
2686         
2687         * rendering/svg/RenderSVGShape.h:
2688         (WebCore::RenderSVGShape::graphicsElement): Remove un-implemented constructor.
2689
2690 2015-06-16  Chris Dumez  <cdumez@apple.com>
2691
2692         REGRESSION(r185012): chat frame in Gmail now says "Something's not right"
2693         https://bugs.webkit.org/show_bug.cgi?id=146025
2694         <rdar://problem/21391412>
2695
2696         Reviewed by Darin Adler.
2697
2698         Only throttle timers in non-visible iframes once they've reached the
2699         max nesting level to avoid throttling critical one-shot timers. This is
2700         consistent with the default DOMTimer throttling behavior that is
2701         defined in the specification.
2702
2703         Power-wise, we are mostly interested in DOMTimers that fire frequently
2704         and cause high CPU usage over an extended period of time anyway.
2705
2706         * dom/Document.cpp:
2707         (WebCore::Document::setTimerThrottlingEnabled):
2708         (WebCore::Document::timerAlignmentInterval):
2709         * dom/Document.h:
2710         * dom/ScriptExecutionContext.cpp:
2711         (WebCore::ScriptExecutionContext::timerAlignmentInterval):
2712         * dom/ScriptExecutionContext.h:
2713         * page/DOMTimer.cpp:
2714         (WebCore::DOMTimer::alignedFireTime):
2715
2716 2015-06-16  sylvain-galineau  <galineau@adobe.com>
2717
2718         Incorrect order of arguments in initial-letter property
2719         https://bugs.webkit.org/show_bug.cgi?id=139667
2720
2721         Reviewed by Sam Weinig.
2722
2723         The CSS specification swapped the order of the initial-letters numeric values.
2724         The drop cap's height now comes first, followed by its optional vertical position.
2725         See http://www.w3.org/TR/css-inline/#sizing-drop-initials.
2726          
2727         No new tests. Existing tests updated.
2728
2729         * css/CSSParser.cpp:
2730         (WebCore::CSSParser::parseValue): swap arguments to reflect new spec order.
2731
2732 2015-06-16  Alex Christensen  <achristensen@webkit.org>
2733
2734         Remove some unused values.
2735         https://bugs.webkit.org/show_bug.cgi?id=145997
2736
2737         Reviewed by Gyuyoung Kim.
2738
2739         This patch should have no change in behavior.
2740
2741         * accessibility/AccessibilityObject.cpp:
2742         (WebCore::computeBestScrollOffset):
2743         (WebCore::AccessibilityObject::scrollToMakeVisibleWithSubFocus):
2744         (WebCore::AccessibilityObject::scrollToGlobalPoint):
2745         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2746         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2747         * html/canvas/WebGL2RenderingContext.cpp:
2748         (WebCore::WebGL2RenderingContext::validateTexFuncData):
2749         * html/canvas/WebGLRenderingContext.cpp:
2750         (WebCore::WebGLRenderingContext::validateTexFuncData):
2751         * platform/graphics/StringTruncator.cpp:
2752         (WebCore::leftTruncateToBuffer):
2753         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2754         (WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
2755         * rendering/InlineTextBox.cpp:
2756         (WebCore::InlineTextBox::localSelectionRect):
2757         * rendering/RenderElement.cpp:
2758         (WebCore::RenderElement::anchorRect):
2759         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2760         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
2761         * rendering/svg/SVGTextQuery.cpp:
2762         (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures):
2763         Remove unused values.
2764
2765 2015-06-16  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
2766
2767         [Streams API] Calling controller.error() should trigger storing an undefined error
2768         https://bugs.webkit.org/show_bug.cgi?id=145976
2769
2770         Reviewed by Darin Adler.
2771
2772         Covered by rebased test.
2773
2774         * bindings/js/JSReadableStreamControllerCustom.cpp:
2775         (WebCore::JSReadableStreamController::error): Storing undefined if no error value passed.
2776         * bindings/js/ReadableJSStream.cpp: Removed storeError(ExecState*).
2777         (WebCore::ReadableJSStream::ReadableJSStream):
2778
2779 2015-06-16  Chris Dumez  <cdumez@apple.com>
2780
2781         Purge StyledElement's presentation attribute cache on memory pressure
2782         https://bugs.webkit.org/show_bug.cgi?id=145999
2783         <rdar://problem/21359252>
2784
2785         Reviewed by Andreas Kling.
2786
2787         Purge StyledElement's presentation attribute cache on memory pressure.
2788
2789         * dom/StyledElement.cpp:
2790         (WebCore::presentationAttributeCache):
2791         (WebCore::presentationAttributeCacheCleaner):
2792         (WebCore::StyledElement::clearPresentationAttributeCache):
2793         * dom/StyledElement.h:
2794         * platform/MemoryPressureHandler.cpp:
2795         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
2796
2797 2015-06-15  Brent Fulgham  <bfulgham@apple.com>
2798
2799         REGRESSION(r175251, Mavericks Only): Playback may stall
2800         https://bugs.webkit.org/show_bug.cgi?id=145989
2801         <rdar://problem/21271919>
2802
2803         Unreviewed post-review correction.
2804
2805         Dave Kilzer pointed out that the macro around the waitForVideoOutputMediaDataWillChange
2806         call was incorrect. This patch corrects this error.
2807
2808         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2809         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Correct the
2810         macro definition.
2811
2812 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
2813
2814         AX: Changing state of radio buttons causes VoiceOver to go busy for a short time.
2815         https://bugs.webkit.org/show_bug.cgi?id=145933
2816
2817         Reviewed by Dean Jackson.
2818
2819         When radio buttons animate the new focus selection state, the thread activity looks a lot like short burst of
2820         activity to draw, then wait on CoreAnimation to apply those changes.
2821
2822         Since those periods of activity during animation are so short, VoiceOver is not able to query for all the
2823         attributes it needs, and gets stuck in the queue behind rendering.
2824
2825         The fix here is to turn off button state animations while VoiceOver is running.
2826
2827         * platform/mac/ThemeMac.mm:
2828         (WebCore::updateStates):
2829
2830 2015-06-15  Zalan Bujtas  <zalan@apple.com>
2831
2832         RootInlineBox::m_lineBreakObj becomes invalid when a child renderer is removed and the line does not get marked dirty.
2833         https://bugs.webkit.org/show_bug.cgi?id=145988
2834         rdar://problem/20959137
2835
2836         Reviewed by David Hyatt.
2837
2838         This patch ensures that we find the right first inline box so that we can dirty the
2839         the appropriate line boxes.
2840         With marking the right line boxes dirty, now we can update RootInlineBox::m_lineBreakObj at the next layout.
2841
2842         Test: fast/inline/crash-when-child-renderer-is-removed-and-line-stays-clean.html
2843
2844         * rendering/RenderInline.cpp:
2845         (WebCore::RenderInline::culledInlineFirstLineBox):
2846         (WebCore::RenderInline::culledInlineLastLineBox):
2847         * rendering/RootInlineBox.cpp:
2848         (WebCore::RootInlineBox::setLineBreakInfo): Deleted. Remove misleading assert and comment.
2849
2850 2015-06-15  Matt Rajca  <mrajca@apple.com>
2851
2852         Media Session: Improve the safety of playback toggling
2853         https://bugs.webkit.org/show_bug.cgi?id=145986
2854
2855         Reviewed by Darin Adler.
2856
2857         * Modules/mediasession/MediaSession.cpp:
2858         (WebCore::MediaSession::togglePlayback): Improved the safety of the loop so that we don't re-visit elements that
2859           may have been deleted underneath us.
2860         * Modules/mediasession/MediaSession.h: Added a pointer to the set of iterated active participating elements so
2861           we can remove any elements that are deleted from the underlying "real" set.
2862
2863 2015-06-15  Brent Fulgham  <bfulgham@apple.com>
2864
2865         REGRESSION(r175251, Mavericks Only): Playback may stall
2866         https://bugs.webkit.org/show_bug.cgi?id=145989
2867         <rdar://problem/21271919>
2868
2869         Reviewed by Dean Jackson.
2870
2871         Revert r175251 for Mavericks build targets.
2872
2873         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2874         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
2875         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
2876         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
2877
2878 2015-06-15  Darin Adler  <darin@apple.com>
2879
2880         REGRESSION (r182215): Reproducible crash at drawsvg.org due to reentrant layout
2881         https://bugs.webkit.org/show_bug.cgi?id=145964
2882
2883         Reviewed by Simon Fraser.
2884
2885         Test: svg/as-object/mutate-on-load.html
2886
2887         * page/FrameView.cpp:
2888         (WebCore::FrameView::forceLayoutParentViewIfNeeded): Don't do a synchronous layout here,
2889         because it can lead indirectly to unwanted layout reentrancy. Instead schedule a layout.
2890
2891 2015-06-15  Matt Rajca  <mrajca@apple.com>
2892
2893         Media Session: Active participating elements can change while being iterated 
2894         https://bugs.webkit.org/show_bug.cgi?id=145978
2895
2896         Reviewed by Alex Christensen.
2897
2898         * Modules/mediasession/MediaSession.cpp:
2899         (WebCore::MediaSession::togglePlayback): Iterate through a copy of m_activeParticipatingElements since its contents
2900           can be modified in the loop.
2901
2902 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
2903
2904         AX: no accessibility support for details element
2905         https://bugs.webkit.org/show_bug.cgi?id=131111
2906
2907         Reviewed by Darin Adler.
2908
2909         Add accessibility support for Mac for details element by:
2910            1) Returning new subroles for <details> and <summary>
2911            2) Exposing isExpanded property for <details> element.
2912
2913         Test: platform/mac/accessibility/details-summary.html
2914
2915         * accessibility/AccessibilityObject.cpp:
2916         (WebCore::AccessibilityObject::supportsARIAPressed):
2917         (WebCore::AccessibilityObject::supportsExpanded):
2918         (WebCore::AccessibilityObject::isExpanded):
2919         (WebCore::AccessibilityObject::supportsARIAExpanded): Deleted.
2920         * accessibility/AccessibilityObject.h:
2921         (WebCore::AccessibilityObject::canvasHasFallbackContent):
2922         * accessibility/AccessibilityRenderObject.cpp:
2923         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
2924         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2925         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2926         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
2927         (-[WebAccessibilityObjectWrapper accessibilityIsExpanded]):
2928         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2929         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
2930         (createAccessibilityRoleMap):
2931         (-[WebAccessibilityObjectWrapper subrole]):
2932         * html/HTMLDetailsElement.h:
2933         * inspector/InspectorDOMAgent.cpp:
2934         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2935
2936 2015-06-15  Alex Christensen  <achristensen@webkit.org>
2937
2938         [Content Extensions] Limit number of rules.
2939         https://bugs.webkit.org/show_bug.cgi?id=145663
2940
2941         Reviewed by Benjamin Poulain.
2942
2943         Added an API test to make sure that parsing fails when there are too many rules.
2944
2945         * contentextensions/ContentExtensionError.cpp:
2946         (WebCore::ContentExtensions::contentExtensionErrorCategory):
2947         * contentextensions/ContentExtensionError.h:
2948         * contentextensions/ContentExtensionParser.cpp:
2949         (WebCore::ContentExtensions::loadEncodedRules):
2950         Fail to parse a content extension with more than 50000 rules.
2951
2952 2015-06-12  Alexey Proskuryakov  <ap@apple.com>
2953
2954         -[WKWebView evaluateJavaScript] provides a misleading error when the return cannot be serialized
2955         https://bugs.webkit.org/show_bug.cgi?id=145900
2956
2957         Reviewed by Sam Weinig.
2958
2959         * English.lproj/Localizable.strings:
2960
2961 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2962
2963         [SOUP] Custom URI schemes don't work for requests containing a fragment identifier
2964         https://bugs.webkit.org/show_bug.cgi?id=145969
2965
2966         Reviewed by Sergio Villar Senin.
2967
2968         For URIs like foo:bar#baz, what the custom protocol manager
2969         receives in the UI process is foo:bar, so the user can't handle fragments.
2970
2971         * platform/network/soup/ResourceRequestSoup.cpp:
2972         (WebCore::ResourceRequest::updateSoupRequest): If the SoupRequest
2973         is a WebKitSoupRequestGeneric, call
2974         webkitSoupRequestGenericSetRequest with the ResourceRequest.
2975         * platform/network/soup/WebKitSoupRequestGeneric.cpp:
2976         (webkitSoupRequestGenericSetRequest):
2977         (webkitSoupRequestGenericGetRequest):
2978         * platform/network/soup/WebKitSoupRequestGeneric.h:
2979
2980 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2981
2982         [SOUP] Move WebKitSoupRequestGeneric to platform layer
2983         https://bugs.webkit.org/show_bug.cgi?id=145968
2984
2985         Reviewed by Sergio Villar Senin.
2986
2987         * PlatformEfl.cmake:
2988         * PlatformGTK.cmake:
2989         * platform/network/soup/WebKitSoupRequestGeneric.cpp: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp.
2990         (webkitSoupRequestGenericFinalize):
2991         (webkit_soup_request_generic_init):
2992         (webkitSoupRequestGenericSendAsync):
2993         (webkitSoupRequestGenericSendFinish):
2994         (webkitSoupRequestGenericGetContentLength):
2995         (webkitSoupRequestGenericGetContentType):
2996         (webkit_soup_request_generic_class_init):
2997         (webkitSoupRequestGenericSetContentLength):
2998         (webkitSoupRequestGenericSetContentType):
2999         * platform/network/soup/WebKitSoupRequestGeneric.h: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.h.
3000         * platform/network/soup/WebKitSoupRequestGenericClient.h: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGenericClient.h.
3001
3002 2015-06-13  Chris Dumez  <cdumez@apple.com>
3003
3004         [WK2] API::Navigation objects are leaked on history navigation to HistoryItems in PageCache
3005         https://bugs.webkit.org/show_bug.cgi?id=145948
3006
3007         Reviewed by Darin Adler.
3008
3009         API::Navigation objects were leaked on history navigation to
3010         HistoryItems in PageCache. In such case, we would create 2 Navigation
3011         objects instead of 1 and the first one would be leaked. The reason
3012         we create the second one is because we fail to pass along the
3013         navigationID from the UIProcess to the WebProcess and then back to the
3014         UIProcess. On the IPC back to the UIProcess, the navigationID ends up
3015         being 0 so the UIProcess creates a new Navigation object, thinking that
3016         the load was triggered by the WebContent process.
3017
3018         We now pass along the navigationID, even if the HistoryItem is in the
3019         PageCache and we end up reusing the cached DocumentLoader, instead of
3020         creating a new one. A new updateCachedDocumentLoader() delegate is
3021         added to the FrameLoaderClient, similarly to the pre-existing
3022         createDocumentLoader() but for the case where the DocumentLoader gets
3023         reused.
3024
3025         * loader/EmptyClients.h:
3026         * loader/FrameLoader.cpp:
3027         (WebCore::FrameLoader::loadDifferentDocumentItem):
3028         * loader/FrameLoaderClient.h:
3029
3030 2015-06-13  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3031
3032         [Streams API] ReadableJSStream should handle promises returned by JS source start callback
3033         https://bugs.webkit.org/show_bug.cgi?id=145792
3034
3035         Reviewed by Darin Adler.
3036
3037         Covered by rebased tests.
3038
3039         When calling start callback, the returned value is checked.
3040         If it is not a promise, we do as if it is a resolved promise.
3041         If it is a promise, we call its then() method with two resolve/reject JS functions.
3042
3043         * Modules/streams/ReadableStream.cpp:
3044         * bindings/js/ReadableJSStream.cpp:
3045         (WebCore::ReadableJSStream::invoke): Returns a JSPromise* if any is returned by the JS source callback.
3046         (WebCore::thenPromise): Utility method to call the promise.
3047         (WebCore::createStartResultFulfilledFunction): The promise resolve callback.
3048         (WebCore::ReadableJSStream::doStart): Calls thenPromise if a JSPromise* is returned by invoke.
3049         (WebCore::ReadableJSStream::ReadableJSStream):
3050         * bindings/js/ReadableJSStream.h:
3051
3052 2015-06-13  Andres Gonzalez  <agonzalez334@nc.rr.com>
3053
3054         AX: WebKit exposes all Ruby Text as Unknown (Japanese EPUB accessibility blocker)
3055         https://bugs.webkit.org/show_bug.cgi?id=141303
3056
3057         Reviewed by Chris Fleizach.
3058
3059         Test: accessibility/ruby-hierarchy-roles.html
3060
3061         * accessibility/AccessibilityObject.h:
3062         * accessibility/AccessibilityRenderObject.cpp:
3063         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
3064         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3065         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3066         (createAccessibilityRoleMap):
3067         (-[WebAccessibilityObjectWrapper subrole]):
3068
3069 2015-06-12  Chris Fleizach  <cfleizach@apple.com>
3070
3071         AX: iOS: after updating control, VoiceOver speaks aria-expanded states reversed (says "collapsed" when "expanded")
3072         https://bugs.webkit.org/show_bug.cgi?id=145943
3073
3074         Reviewed by Darin Adler.
3075
3076         iOS Accessibility platform needs to be notified of when aria expanded changes.
3077
3078         * accessibility/ios/AXObjectCacheIOS.mm:
3079         (WebCore::AXObjectCache::postPlatformNotification):
3080         * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
3081         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3082         (-[WebAccessibilityObjectWrapper postValueChangedNotification]):
3083         (-[WebAccessibilityObjectWrapper postExpandedChangedNotification]):
3084         (-[WebAccessibilityObjectWrapper postScrollStatusChangeNotification]):
3085
3086 2015-06-12  Chris Fleizach  <cfleizach@apple.com>
3087
3088         AX:ARIA Toggle buttons aren't properly conveyed on iOS using VoiceOver
3089         https://bugs.webkit.org/show_bug.cgi?id=145949
3090
3091         Reviewed by Darin Adler.
3092
3093         Expose pressed state information to the iOS platform AX API.
3094
3095         Test: Updated inspector-protocol/dom/getAccessibilityPropertiesForNode.html 
3096               There was a FIXME for this issue in that test: https://bugs.webkit.org/show_bug.cgi?id=129830
3097
3098         * accessibility/AccessibilityNodeObject.cpp:
3099         (WebCore::AccessibilityNodeObject::isPressed):
3100         * accessibility/AccessibilityObject.cpp:
3101         (WebCore::AccessibilityObject::classList):
3102         (WebCore::AccessibilityObject::supportsARIAPressed):
3103         (WebCore::AccessibilityObject::supportsARIAExpanded):
3104         * accessibility/AccessibilityObject.h:
3105         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3106         (-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionIsAtomic]):
3107         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAPressed]):
3108         (-[WebAccessibilityObjectWrapper accessibilityIsPressed]):
3109         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
3110
3111 2015-06-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3112
3113         Purge PassRefPtr in JavaScriptCore - 2
3114         https://bugs.webkit.org/show_bug.cgi?id=145834
3115
3116         Reviewed by Darin Adler.
3117
3118         Fix call sites depends on changing of JSC.
3119
3120         * html/canvas/WebGL2RenderingContext.cpp:
3121         (WebCore::WebGL2RenderingContext::getParameter):
3122         * html/canvas/WebGLRenderingContext.cpp:
3123         (WebCore::WebGLRenderingContext::getParameter):
3124         * html/canvas/WebGLRenderingContextBase.cpp:
3125         (WebCore::WebGLRenderingContextBase::getUniform):
3126         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
3127         (WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter):
3128         (WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter):
3129
3130 2015-06-12  Zalan Bujtas  <zalan@apple.com>
3131
3132         Be more defensive at renderer type checking when initializing flow segments.
3133         https://bugs.webkit.org/show_bug.cgi?id=145942
3134
3135         Reviewed by Simon Fraser.
3136
3137         FlowContents::initializeSegments should ignore unsupported renderers so that when we miss
3138         a simple line layout path invalidation, we don't downcast the unsupported renderer to RenderText.
3139
3140         I have not reproduced this issue (but related to rdar://problem/21312452)
3141
3142         * rendering/SimpleLineLayoutFlowContents.cpp:
3143         (WebCore::SimpleLineLayout::initializeSegments):
3144
3145 2015-06-12  Anders Carlsson  <andersca@apple.com>
3146
3147         deleteEmptyDirectory should delete .DS_Store files on OS X
3148         https://bugs.webkit.org/show_bug.cgi?id=145944
3149
3150         Reviewed by Dan Bernstein.
3151
3152         deleteEmptyDirectory is often used when clearing website data, so we should
3153         take extra care to delete empty directories so the user won't think that clearing
3154         website data didn't do anything because it would leave directories with .DS_Store 
3155         files behind.
3156
3157         * platform/mac/FileSystemMac.mm:
3158         (WebCore::deleteEmptyDirectory):
3159         * platform/posix/FileSystemPOSIX.cpp:
3160
3161 2015-06-12  Manuel Rego Casasnovas  <rego@igalia.com>
3162
3163         [CSS Grid Layout] Fix grid-template-areas parsing to avoid spaces
3164         https://bugs.webkit.org/show_bug.cgi?id=145860
3165
3166         Reviewed by Sergio Villar Senin.
3167
3168         The spec doesn't require to have spaces between unnamed and named areas
3169         in grid-template-areas syntax. But spaces are currently required in our
3170         code.
3171
3172         This was confirmed in the CSS WG mailing list:
3173         https://lists.w3.org/Archives/Public/www-style/2015May/0239.html
3174
3175         This patch updates grid-template-areas parsing to allow the possibility
3176         of removing spaces between unnamed and named areas.
3177
3178         Added new cases to fast/css-grid-layout/grid-template-areas-get-set.html.
3179
3180         * css/CSSParser.cpp:
3181         (WebCore::parseGridTemplateAreasColumnNames): New helper method to
3182         determine the column names split by white spaces or dots.
3183         (WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
3184         method to get the column names.
3185         (WebCore::containsOnlyDots): Deleted. Not needed anymore as
3186         parseGridTemplateAreasColumnNames() is using a single dot for unnamed
3187         grid areas (despite of being defined with 1 or more dots).
3188
3189 2015-06-12  Eric Carlson  <eric.carlson@apple.com>
3190
3191         [Mac] AirPlay menu button doesn't always show on page load
3192         https://bugs.webkit.org/show_bug.cgi?id=145936
3193
3194         Reviewed by Brent Fulgham.
3195
3196         * Modules/mediasession/WebMediaSessionManager.cpp:
3197         (WebCore::mediaProducerStateString): New, return a string representing MediaStateFlags.
3198         (WebCore::WebMediaSessionManager::clientStateDidChange): Log the states as strings.
3199         (WebCore::WebMediaSessionManager::toString): New, return a string representing ConfigurationTasks.
3200         (WebCore::WebMediaSessionManager::scheduleDelayedTask): Add logging.
3201         (WebCore::WebMediaSessionManager::taskTimerFired): Add logging.
3202         * Modules/mediasession/WebMediaSessionManager.h:
3203
3204         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: Override wirelessVideoPlaybackDisabled
3205           so it is possible to activate route monitoring for a movie loaded with this engine.
3206         * platform/graphics/mac/MediaPlayerPrivateQTKit.h: Ditto.
3207
3208 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
3209
3210         Add the remaining missing override specifiers under Source/WebCore/
3211         https://bugs.webkit.org/show_bug.cgi?id=145907
3212
3213         Reviewed by Darin Adler.
3214
3215         Fix the remaining compiler warnings about missing override specifiers
3216         for overriding method declarations in classes under Source/WebCore/.
3217
3218         Where the addition had to be performed on all virtual methods of the
3219         class, the virtual specifier was removed so now only the override
3220         specifier is in use.
3221
3222         * Modules/indexeddb/IDBOpenDBRequest.h:
3223         * Modules/indexeddb/IDBRequest.h:
3224         * Modules/webdatabase/DatabaseServer.h:
3225         * bindings/js/ReadableJSStream.h:
3226         * editing/InsertTextCommand.h:
3227         * mathml/MathMLInlineContainerElement.h:
3228         * platform/audio/EqualPowerPanner.h:
3229         (WebCore::EqualPowerPanner::reset):
3230         * platform/graphics/MediaPlayer.cpp:
3231         (WebCore::NullMediaPlayerPrivate::load):
3232         (WebCore::NullMediaPlayerPrivate::cancelLoad):
3233         (WebCore::NullMediaPlayerPrivate::prepareToPlay):
3234         (WebCore::NullMediaPlayerPrivate::play):
3235         (WebCore::NullMediaPlayerPrivate::pause):
3236         (WebCore::NullMediaPlayerPrivate::platformMedia):
3237         (WebCore::NullMediaPlayerPrivate::platformLayer):
3238         (WebCore::NullMediaPlayerPrivate::naturalSize):
3239         (WebCore::NullMediaPlayerPrivate::hasVideo):
3240         (WebCore::NullMediaPlayerPrivate::hasAudio):
3241         (WebCore::NullMediaPlayerPrivate::setVisible):
3242         (WebCore::NullMediaPlayerPrivate::durationDouble):
3243         (WebCore::NullMediaPlayerPrivate::currentTimeDouble):
3244         (WebCore::NullMediaPlayerPrivate::seekDouble):
3245         (WebCore::NullMediaPlayerPrivate::seeking):
3246         (WebCore::NullMediaPlayerPrivate::setRateDouble):
3247         (WebCore::NullMediaPlayerPrivate::setPreservesPitch):
3248         (WebCore::NullMediaPlayerPrivate::paused):
3249         (WebCore::NullMediaPlayerPrivate::setVolumeDouble):
3250         (WebCore::NullMediaPlayerPrivate::supportsMuting):
3251         (WebCore::NullMediaPlayerPrivate::setMuted):
3252         (WebCore::NullMediaPlayerPrivate::hasClosedCaptions):
3253         (WebCore::NullMediaPlayerPrivate::setClosedCaptionsVisible):
3254         (WebCore::NullMediaPlayerPrivate::networkState):
3255         (WebCore::NullMediaPlayerPrivate::readyState):
3256         (WebCore::NullMediaPlayerPrivate::maxTimeSeekableDouble):
3257         (WebCore::NullMediaPlayerPrivate::minTimeSeekable):
3258         (WebCore::NullMediaPlayerPrivate::buffered):
3259         (WebCore::NullMediaPlayerPrivate::totalBytes):
3260         (WebCore::NullMediaPlayerPrivate::didLoadingProgress):
3261         (WebCore::NullMediaPlayerPrivate::setSize):
3262         (WebCore::NullMediaPlayerPrivate::canLoadPoster):
3263         (WebCore::NullMediaPlayerPrivate::setPoster):
3264         (WebCore::NullMediaPlayerPrivate::hasSingleSecurityOrigin):
3265         * platform/graphics/filters/DistantLightSource.h:
3266         * platform/graphics/filters/FEComposite.h:
3267         * platform/graphics/filters/FEDisplacementMap.h:
3268         (WebCore::FEDisplacementMap::determineAbsolutePaintRect):
3269         * platform/graphics/filters/FEFlood.h:
3270         (WebCore::FEFlood::determineAbsolutePaintRect):
3271         * platform/graphics/filters/PointLightSource.h:
3272         * platform/graphics/filters/SpotLightSource.h:
3273         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3274         (WebCore::MediaPlayerPrivateGStreamer::hasVideo):
3275         (WebCore::MediaPlayerPrivateGStreamer::hasAudio):
3276         (WebCore::MediaPlayerPrivateGStreamer::audioSourceProvider):
3277         (WebCore::MediaPlayerPrivateGStreamer::engineDescription):
3278         (WebCore::MediaPlayerPrivateGStreamer::isLiveStream):
3279         (WebCore::MediaPlayerPrivateGStreamer::totalVideoFrames):
3280         (WebCore::MediaPlayerPrivateGStreamer::droppedVideoFrames):
3281         (WebCore::MediaPlayerPrivateGStreamer::corruptedVideoFrames):
3282         (WebCore::MediaPlayerPrivateGStreamer::totalFrameDelay):
3283         * platform/graphics/texmap/BitmapTextureGL.h:
3284         (WebCore::BitmapTextureGL::isBackedByOpenGL):
3285         * platform/graphics/transforms/Matrix3DTransformOperation.h:
3286         * platform/graphics/transforms/MatrixTransformOperation.h:
3287         * platform/graphics/transforms/PerspectiveTransformOperation.h:
3288         * platform/graphics/transforms/RotateTransformOperation.h:
3289         * platform/graphics/transforms/ScaleTransformOperation.h:
3290         * platform/graphics/transforms/SkewTransformOperation.h:
3291         * platform/image-decoders/png/PNGImageDecoder.h:
3292         (WebCore::PNGImageDecoder::filenameExtension):
3293         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
3294         * platform/mock/MockRealtimeMediaSourceCenter.h:
3295
3296 2015-06-12  Commit Queue  <commit-queue@webkit.org>
3297
3298         Unreviewed, rolling out r185512.
3299         https://bugs.webkit.org/show_bug.cgi?id=145932
3300
3301         Many asserts on layout tests and on API tests (Requested by
3302         ap_ on #webkit).
3303
3304         Reverted changeset:
3305
3306         "Use modern for-loops in WebCore/rendering - 1"
3307         https://bugs.webkit.org/show_bug.cgi?id=145831
3308         http://trac.webkit.org/changeset/185512
3309
3310 2015-06-12  Simon Fraser  <simon.fraser@apple.com>
3311
3312         OpenGLESSPI.h doesn't need to include UIKit.h
3313         https://bugs.webkit.org/show_bug.cgi?id=145931
3314
3315         Reviewed by Darin Adler.
3316
3317         No need to suck in all of UIKit from OpenGLESSPI.h.
3318
3319         * platform/spi/ios/OpenGLESSPI.h:
3320
3321 2015-06-12  Matt Rajca  <mrajca@apple.com>
3322
3323         Add barebones implementation of media session invocation algorithm.
3324         https://bugs.webkit.org/show_bug.cgi?id=145847
3325
3326         Reviewed by Darin Adler.
3327
3328         * Modules/mediasession/MediaSession.cpp:
3329         (WebCore::MediaSession::invoke): Move the media session to an active state.
3330         * Modules/mediasession/MediaSession.h:
3331         * html/HTMLMediaElement.cpp:
3332         (WebCore::HTMLMediaElement::playInternal): Call the media session invocation algorithm as described in the
3333           Media Session spec.
3334
3335 2015-06-12  Hunseop Jeong  <hs85.jeong@samsung.com>
3336
3337         Use modern for-loops in WebCore/rendering - 1
3338         https://bugs.webkit.org/show_bug.cgi?id=145831
3339
3340         Reviewed by Darin Adler.
3341
3342         No new tests because there is no behavior change.
3343
3344         * rendering/AutoTableLayout.cpp:
3345         (WebCore::AutoTableLayout::computeIntrinsicLogicalWidths):
3346         (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
3347         * rendering/FilterEffectRenderer.cpp:
3348         (WebCore::FilterEffectRenderer::build):
3349         (WebCore::FilterEffectRenderer::clearIntermediateResults):
3350         * rendering/FilterEffectRenderer.h:
3351         * rendering/FloatingObjects.cpp:
3352         (WebCore::FloatingObjects::clearLineBoxTreePointers):
3353         (WebCore::FloatingObjects::moveAllToFloatInfoMap):
3354         (WebCore::FloatingObjects::computePlacedFloatsTree):
3355         * rendering/FlowThreadController.cpp:
3356         (WebCore::FlowThreadController::collectFixedPositionedLayers):
3357         * rendering/HitTestResult.cpp:
3358         (WebCore::HitTestResult::append):
3359         * rendering/ImageQualityController.cpp:
3360         (WebCore::ImageQualityController::highQualityRepaintTimerFired):
3361         * rendering/InlineTextBox.cpp:
3362         (WebCore::InlineTextBox::paint):
3363         * rendering/RenderBlock.cpp:
3364         (WebCore::removeBlockFromDescendantAndContainerMaps):
3365         (WebCore::RenderBlock::addOverflowFromPositionedObjects):
3366         (WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants):
3367         (WebCore::RenderBlock::simplifiedNormalFlowLayout):
3368         (WebCore::RenderBlock::layoutPositionedObjects):
3369         (WebCore::RenderBlock::markPositionedObjectsForLayout):
3370         (WebCore::RenderBlock::paintContinuationOutlines):
3371         (WebCore::clipOutPositionedObjects):
3372         (WebCore::RenderBlock::removeFromTrackedRendererMaps):
3373         (WebCore::RenderBlock::removePositionedObjects):
3374         (WebCore::RenderBlock::checkPositionedObjectsNeedLayout):
3375         * rendering/RenderBlockFlow.cpp:
3376         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
3377         (WebCore::RenderBlockFlow::styleDidChange):
3378         (WebCore::RenderBlockFlow::moveFloatsTo):
3379         (WebCore::RenderBlockFlow::addOverflowFromFloats):
3380         (WebCore::RenderBlockFlow::repaintOverhangingFloats):
3381         (WebCore::RenderBlockFlow::paintFloats):
3382         (WebCore::RenderBlockFlow::clipOutFloatingObjects):
3383         (WebCore::RenderBlockFlow::lowestFloatLogicalBottom):
3384         (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom):
3385         (WebCore::RenderBlockFlow::addOverhangingFloats):
3386         (WebCore::RenderBlockFlow::addIntrudingFloats):
3387         (WebCore::RenderBlockFlow::markSiblingsWithFloatsForLayout):
3388         (WebCore::RenderBlockFlow::adjustForBorderFit):
3389         * rendering/RenderBlockLineLayout.cpp:
3390         (WebCore::setLogicalWidthForTextRun):
3391         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
3392         (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
3393         (WebCore::RenderBlockFlow::repaintDirtyFloats):
3394         (WebCore::RenderBlockFlow::layoutLineBoxes):
3395         (WebCore::RenderBlockFlow::checkFloatsInCleanLine):
3396         (WebCore::RenderBlockFlow::determineStartPosition):
3397         (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
3398         * rendering/RenderCounter.cpp:
3399         (WebCore::RenderCounter::destroyCounterNodes):
3400         (WebCore::updateCounters):
3401         (WebCore::RenderCounter::rendererStyleChanged):
3402         * rendering/RenderFlexibleBox.cpp:
3403         (WebCore::RenderFlexibleBox::autoMarginOffsetInMainAxis):
3404         (WebCore::RenderFlexibleBox::freezeViolations):
3405         (WebCore::RenderFlexibleBox::resolveFlexibleLengths):
3406         (WebCore::RenderFlexibleBox::numberOfInFlowPositionedChildren):
3407         (WebCore::RenderFlexibleBox::layoutColumnReverse):
3408         (WebCore::RenderFlexibleBox::alignFlexLines):
3409         (WebCore::RenderFlexibleBox::alignChildren):
3410         (WebCore::RenderFlexibleBox::flipForWrapReverse):
3411         * rendering/RenderFlowThread.cpp:
3412         (WebCore::RenderFlowThread::updateAllLayerToRegionMappings):
3413         * rendering/RenderInline.cpp:
3414         (WebCore::RenderInline::addAnnotatedRegions):
3415         * rendering/RenderLayer.cpp:
3416         (WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrder):
3417         (WebCore::RenderLayer::updateDescendantDependentFlags):
3418         * rendering/RenderLayerBacking.cpp:
3419         (WebCore::descendantLayerPaintsIntoAncestor):
3420         (WebCore::RenderLayerBacking::startAnimation):
3421         * rendering/RenderLineBoxList.cpp:
3422         (WebCore::RenderLineBoxList::paint):
3423         * rendering/RenderListBox.cpp:
3424         (WebCore::RenderListBox::updateFromElement):
3425         * rendering/RenderMenuList.cpp:
3426         (WebCore::selectedOptionCount):
3427         (RenderMenuList::updateOptionsWidth):
3428         * rendering/RenderMultiColumnSet.cpp:
3429         (WebCore::RenderMultiColumnSet::distributeImplicitBreaks):
3430
3431 2015-06-12  Csaba Osztrogonác  <ossy@webkit.org>
3432
3433         Fix unused private field warning in ResourceHandleSoup.cpp
3434         https://bugs.webkit.org/show_bug.cgi?id=145910
3435
3436         Reviewed by Darin Adler.
3437
3438         * platform/network/soup/ResourceHandleSoup.cpp:
3439
3440 2015-06-12  Joseph Pecoraro  <pecoraro@apple.com>
3441
3442         Web Inspector: CRASH trying to inspect text that was removed/replaced
3443         https://bugs.webkit.org/show_bug.cgi?id=145898
3444
3445         Reviewed by Darin Adler.
3446
3447         * inspector/InspectorDOMAgent.cpp:
3448         (WebCore::InspectorDOMAgent::inspect):
3449         (WebCore::InspectorDOMAgent::focusNode):
3450         Ensure we only cause focusNode with a node to focus. If the original
3451         node that was provided is no longer in the document, then we won't
3452         actually find a node to inspect.
3453
3454 2015-06-12  KwangHyuk Kim  <hyuki.kim@samsung.com>
3455
3456         [EFL] canvas/philip/tests/toDataURL.jpeg.foo tests have been failed since r185417.
3457         https://bugs.webkit.org/show_bug.cgi?id=145878
3458
3459         Reviewed by Gyuyoung Kim.
3460
3461         Fix input buffer alignment issue.
3462
3463         No new tests, canvas/philip/tests/toDataURL.jpeg.foo can be used.
3464
3465         * platform/graphics/efl/ImageBufferEfl.cpp:
3466         (WebCore::encodeImagePNG):
3467         (WebCore::encodeImageJPEG):
3468         (WebCore::ImageBuffer::toDataURL):
3469
3470 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
3471
3472         Add missing override specifiers under Source/WebCore/svg/
3473         https://bugs.webkit.org/show_bug.cgi?id=145841
3474
3475         Reviewed by Darin Adler.
3476
3477         Add missing override specifiers to virtual method overrides for classes
3478         under Source/WebCore/svg/, suppressing a bunch of warnings when compiling
3479         with Clang 3.6.
3480
3481         Add the BEGIN_DECLARE_ANIMATED_PROPERTIES_BASE() macro that doesn't
3482         override the localAttributeToPropertyMap() method declaration, and
3483         have the BEGIN_DECLARE_ANIMATED_PROPERTIES() macro add the override
3484         specifier. The new macro is used in SVGElement.
3485
3486         Change the DECLARE_ANIMATED_PROPERTY() to accept the optional override
3487         specifier as the fifth parameter. Current DECLARE_ANIMATED_*() macros
3488         are modified to just pass an empty argument, not adding any specifier.
3489         DECLARE_ANIMATED_BOOLEAN_OVERRIDE() and DECLARE_ANIMATED_STRING_OVERRIDE()
3490         macros are added to override the methods for the externalResourcesRequired
3491         and href animated properties, where required.
3492
3493         * svg/SVGAElement.h:
3494         * svg/SVGAltGlyphElement.h:
3495         * svg/SVGAnimatedAngle.h:
3496         * svg/SVGAnimatedBoolean.h:
3497         * svg/SVGAnimatedEnumeration.h:
3498         * svg/SVGAnimatedInteger.h:
3499         * svg/SVGAnimatedLength.h:
3500         * svg/SVGAnimatedNumber.h:
3501         * svg/SVGAnimatedPreserveAspectRatio.h:
3502         * svg/SVGAnimatedRect.h:
3503         * svg/SVGAnimatedString.h:
3504         * svg/SVGAnimationElement.h:
3505         * svg/SVGCircleElement.h:
3506         * svg/SVGClipPathElement.h:
3507         * svg/SVGCursorElement.h:
3508         * svg/SVGDefsElement.h:
3509         * svg/SVGElement.h:
3510         * svg/SVGEllipseElement.h:
3511         * svg/SVGFEImageElement.h:
3512         * svg/SVGFilterElement.h:
3513         * svg/SVGFontElement.h:
3514         * svg/SVGForeignObjectElement.h:
3515         * svg/SVGGElement.h:
3516         * svg/SVGGlyphRefElement.h:
3517         * svg/SVGGradientElement.h:
3518         * svg/SVGImageElement.h:
3519         * svg/SVGLineElement.h:
3520         * svg/SVGMPathElement.h:
3521         * svg/SVGMarkerElement.h:
3522         * svg/SVGMaskElement.h:
3523         * svg/SVGPathElement.h:
3524         * svg/SVGPatternElement.h:
3525         * svg/SVGPolyElement.h:
3526         * svg/SVGRectElement.h:
3527         * svg/SVGSVGElement.h:
3528         * svg/SVGScriptElement.h:
3529         * svg/SVGSwitchElement.h:
3530         * svg/SVGSymbolElement.h:
3531         * svg/SVGTRefElement.h:
3532         * svg/SVGTextContentElement.h:
3533         * svg/SVGTextPathElement.h:
3534         * svg/SVGURIReference.h: Add the hrefBaseValue() pure virtual method
3535         so it can be overridden by any class that also overrides the
3536         corresponding setHrefBaseValue() method.
3537         * svg/SVGUseElement.h:
3538         * svg/SVGViewElement.h:
3539         * svg/properties/SVGAnimatedPropertyMacros.h:
3540         * svg/properties/SVGMatrixTearOff.h:
3541         (WebCore::SVGMatrixTearOff::commitChange):
3542
3543 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
3544
3545         [GLib] Move files under Source/WTF/wtf/gobject to Source/WTF/wtf/glib
3546         https://bugs.webkit.org/show_bug.cgi?id=145799
3547
3548         Reviewed by Carlos Garcia Campos.
3549
3550         Update header inclusions for headers that have been moved
3551         to Source/WTF/wtf/glib/.
3552
3553         * accessibility/atk/AXObjectCacheAtk.cpp:
3554         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
3555         * bindings/gobject/DOMObjectCache.cpp:
3556         * bindings/gobject/GObjectEventListener.h:
3557         * bindings/gobject/GObjectNodeFilterCondition.h:
3558         * bindings/gobject/GObjectXPathNSResolver.h:
3559         * bindings/gobject/WebKitDOMEventTarget.cpp:
3560         * platform/Pasteboard.h:
3561         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
3562         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
3563         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
3564         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
3565         * platform/audio/gtk/AudioBusGtk.cpp:
3566         * platform/geoclue/GeolocationProviderGeoclue.h:
3567         * platform/geoclue/GeolocationProviderGeoclue2.cpp:
3568         * platform/glib/BatteryProviderUPower.cpp:
3569         * platform/glib/BatteryProviderUPower.h:
3570         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
3571         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
3572         * platform/graphics/gstreamer/GUniquePtrGStreamer.h:
3573         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
3574         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3575         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3576         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3577         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3578         * platform/graphics/gstreamer/MediaSourceGStreamer.cpp:
3579         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
3580         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
3581         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
3582         * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp:
3583         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3584         * platform/graphics/gtk/ImageBufferGtk.cpp:
3585         * platform/graphics/gtk/ImageGtk.cpp:
3586         * platform/gtk/ContextMenuGtk.cpp:
3587         * platform/gtk/ContextMenuItemGtk.cpp:
3588         * platform/gtk/DataObjectGtk.cpp:
3589         * platform/gtk/DataObjectGtk.h:
3590         * platform/gtk/FileSystemGtk.cpp:
3591         * platform/gtk/GRefPtrGtk.h:
3592         * platform/gtk/GUniquePtrGtk.h:
3593         * platform/gtk/GamepadsGtk.cpp:
3594         * platform/gtk/GtkUtilities.cpp:
3595         * platform/gtk/LanguageGtk.cpp:
3596         * platform/gtk/LocalizedStringsGtk.cpp:
3597         * platform/gtk/PasteboardHelper.cpp:
3598         * platform/gtk/ScrollbarThemeGtk.cpp:
3599         * platform/gtk/SharedBufferGtk.cpp:
3600         * platform/gtk/SharedTimerGtk.cpp:
3601         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
3602         * platform/network/ResourceHandleInternal.h:
3603         * platform/network/gtk/CredentialBackingStore.cpp:
3604         * platform/network/soup/CertificateInfo.h:
3605         * platform/network/soup/CookieJarSoup.cpp:
3606         * platform/network/soup/DNSSoup.cpp:
3607         * platform/network/soup/GRefPtrSoup.h:
3608         * platform/network/soup/GUniquePtrSoup.h:
3609         * platform/network/soup/ResourceError.h:
3610         * platform/network/soup/ResourceErrorSoup.cpp:
3611         * platform/network/soup/ResourceHandleSoup.cpp:
3612         * platform/network/soup/ResourceResponse.h:
3613         * platform/network/soup/SocketStreamHandle.h:
3614         * platform/network/soup/SocketStreamHandleSoup.cpp:
3615         * platform/network/soup/SoupNetworkSession.h:
3616         * platform/text/gtk/HyphenationLibHyphen.cpp:
3617         * rendering/RenderThemeGtk.cpp:
3618
3619 2015-06-12  Yoav Weiss  <yoav@yoav.ws>
3620
3621         Fix the build when the PICTURE_SIZES flag is off
3622         https://bugs.webkit.org/show_bug.cgi?id=145926
3623
3624         Reviewed by Csaba Osztrogonác.
3625
3626         No new tests since there's no functionality change.
3627
3628         * html/parser/HTMLPreloadScanner.cpp: Remove the guard around the definition of m_sizesAttribute.
3629
3630 2015-06-12  Commit Queue  <commit-queue@webkit.org>
3631
3632         Unreviewed, rolling out r185492.
3633         https://bugs.webkit.org/show_bug.cgi?id=145927
3634
3635         Causes crashes on debug (Requested by rego on #webkit).
3636
3637         Reverted changeset:
3638
3639         "[CSS Grid Layout] Fix grid-template-areas parsing to avoid
3640         spaces"
3641         https://bugs.webkit.org/show_bug.cgi?id=145860
3642         http://trac.webkit.org/changeset/185492
3643
3644 2015-06-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3645
3646         Bindings generator should generate code for Promise-based APIs
3647         https://bugs.webkit.org/show_bug.cgi?id=145833
3648
3649         Reviewed by Darin Adler.
3650
3651         Covered by existing tests.
3652
3653         * Modules/webaudio/AudioContext.idl: Removing custom binding for resume, suspend and close.
3654         * bindings/js/JSAudioContextCustom.cpp: Ditto.
3655         * bindings/scripts/CodeGeneratorJS.pm:
3656         (GenerateHeader): Refactoring to use IsReturningPromise.
3657         (GenerateImplementation): Disabling include for return type if it is a promise.
3658         (GenerateParametersCheck): Adding DeferredWrapper() as argument to the DOM method if JS method returns a promise.
3659         (GenerateImplementationFunctionCall): Added support for promise-returning API.
3660         (IsReturningPromise): Checking whether function is returning a promise.
3661         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
3662         (webkit_dom_test_obj_test_promise_function):
3663         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
3664         * bindings/scripts/test/JS/JSTestObj.cpp:
3665         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
3666         * bindings/scripts/test/ObjC/DOMTestObj.h:
3667         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3668         (-[DOMTestObj testPromiseFunction]):
3669         * bindings/scripts/test/TestObj.idl: Adding promise returning function.
3670
3671
3672 2015-06-12  Manuel Rego Casasnovas  <rego@igalia.com>
3673
3674         [CSS Grid Layout] Fix grid-template-areas parsing to avoid spaces
3675         https://bugs.webkit.org/show_bug.cgi?id=145860
3676
3677         Reviewed by Sergio Villar Senin.
3678
3679         The spec doesn't require to have spaces between unnamed and named areas
3680         in grid-template-areas syntax. But spaces are currently required in our
3681         code.
3682
3683         This was confirmed in the CSS WG mailing list:
3684         https://lists.w3.org/Archives/Public/www-style/2015May/0239.html
3685
3686         This patch updates grid-template-areas parsing to allow the possibility
3687         of removing spaces between unnamed and named areas.
3688
3689         Added new cases to fast/css-grid-layout/grid-template-areas-get-set.html.
3690
3691         * css/CSSParser.cpp:
3692         (WebCore::parseGridTemplateAreasColumnNames): New helper method to
3693         determine the column names split by white spaces or dots.
3694         (WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
3695         method to get the column names.
3696         (WebCore::containsOnlyDots): Deleted. Not needed anymore as
3697         parseGridTemplateAreasColumnNames() is using a single dot for unnamed
3698         grid areas (despite of being defined with 1 or more dots).
3699
3700 2015-06-11  Mark Lam  <mark.lam@apple.com>
3701
3702         WebCore::reportException() needs to be able to accept a raw thrown value in addition to Exception objects.
3703         https://bugs.webkit.org/show_bug.cgi?id=145872
3704
3705         Reviewed by Michael Saboff.
3706
3707         API test added: WebKit1.ReportExceptionTest.
3708
3709         * bindings/js/JSDOMBinding.cpp:
3710         (WebCore::reportException):
3711         - Added a version of reportException() that takes a JSValue instead of an Exception
3712           object.  This version will ensure that we have an Exception object before calling
3713           into the original reportException() as follows:
3714
3715           1. If the JSValue is already an Exception object, we're good to go.
3716
3717           2. Else, if VM::lastException() is available, use that as the exception.
3718              This is how the old code use to behave (in terms of where it gets the exception
3719              stack trace).  The assumption is that reportException() will be called in
3720              a timely manner before the exception stack trace has been purged.
3721
3722           3. Else, create an Exception object with no stack trace.  This is the fall back
3723              in case the client did not call reportException() in a timely manner.
3724
3725         - Also clear the last exception after we've reported it.  This is how the old code
3726           before r185259 behave (in terms of the lifecycle of the last exception stack
3727           trace).  We're restoring that behavior here.
3728
3729         * bindings/js/JSDOMBinding.h:
3730
3731 2015-06-11  Zalan Bujtas  <zalan@apple.com>
3732
3733         Do not crash when the descendant frame tree is destroyed during layout.
3734         https://bugs.webkit.org/show_bug.cgi?id=144540
3735         rdar://problem/20793184
3736
3737         Reviewed by Andreas Kling.
3738
3739         Widget::setFrameRect(), through WebHTMLView layout, could trigger a style recalc, which in turn
3740         could initiate an onBeforeLoad callback.
3741         If javascript happens to destroy the current iframe in the onBeforeLoad callback, we lose the descendant
3742         render tree, including the child FrameView (the iframe element's view). However the RenderIFrame
3743         object stays protected until after the layout is done. (see protectRenderWidgetUntilLayoutIsDone())
3744
3745         Climbing back on the callstack, we need to make sure that
3746         1. the root widget of the descendant render tree (FrameView) stays valid as long as it is needed.
3747         2. RenderFrameBase::layoutWithFlattening() can handle the case when the associated widget (child FrameView) is set to nullptr.
3748         (see RenderWidget::willBeDestroyed() -> setWidget(nullptr))
3749
3750         (and later, when layout is finished this (RenderIFrame) object gets destroyed too.)
3751
3752         Covered by fast/frames/flattening/crash-remove-iframe-during-object-beforeload.html.
3753
3754         * page/FrameView.cpp:
3755         (WebCore::FrameView::setFrameRect):
3756         (WebCore::FrameView::updateEmbeddedObject):
3757         (WebCore::FrameView::updateWidgetPositions):
3758         * platform/ScrollView.cpp:
3759         (WebCore::ScrollView::setFrameRect):
3760         * platform/mac/WidgetMac.mm:
3761         (WebCore::Widget::setFrameRect):
3762         * rendering/RenderFrameBase.cpp:
3763         (WebCore::RenderFrameBase::layoutWithFlattening):
3764         (WebCore::RenderFrameBase::childRenderView):
3765         (WebCore::RenderFrameBase::peformLayoutWithFlattening):
3766         * rendering/RenderFrameBase.h:
3767         * rendering/RenderWidget.cpp:
3768         (WebCore::RenderWidget::updateWidgetPosition):
3769         * rendering/RenderWidget.h:
3770
3771 2015-06-11  Commit Queue  <commit-queue@webkit.org>
3772
3773         Unreviewed, rolling out r185470.
3774         https://bugs.webkit.org/show_bug.cgi?id=145902
3775
3776         Caused ASan violations (Requested by ap on #webkit).
3777
3778         Reverted changeset:
3779
3780         "Add an appearance keyword for wireless playback / airplay
3781         icon"
3782         https://bugs.webkit.org/show_bug.cgi?id=145892
3783         http://trac.webkit.org/changeset/185470
3784
3785 2015-06-11  Brady Eidson  <beidson@apple.com>
3786
3787         IndexedDB onupgradeneeded event has incorrect value for oldVersion.
3788         <rdar://problem/18309792> and https://bugs.webkit.org/show_bug.cgi?id=136888
3789
3790         Reviewed by Sam Weinig.
3791
3792         Test: storage/indexeddb/version-change-event-basic.html
3793
3794         "NoIntVersion" is an internal bookkeeping concept that we never should've been passing to Javascript.
3795         
3796         This cleans up things by:
3797         - Adjusting an old version of "NoIntVersion" to "0" before making the version change callback.
3798         - Removing the VersionNullness parameter from almost everywhere.
3799         - Removing the nullability of the newVersion parameter from the IDL.
3800
3801         * Modules/indexeddb/IDBDatabase.cpp:
3802         (WebCore::IDBDatabase::onVersionChange):
3803         * Modules/indexeddb/IDBDatabase.h:
3804         
3805         * Modules/indexeddb/IDBDatabaseBackend.cpp:
3806         (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction):
3807         (WebCore::IDBDatabaseBackend::deleteDatabase):
3808         
3809         * Modules/indexeddb/IDBDatabaseCallbacks.h:
3810         * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
3811         (WebCore::IDBDatabaseCallbacksImpl::onVersionChange):
3812         * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
3813         
3814         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3815         (WebCore::IDBOpenDBRequest::onBlocked):
3816         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
3817         
3818         * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
3819         (WebCore::IDBDatabaseBackend::VersionChangeOperation::perform):
3820         
3821         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
3822         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
3823         * Modules/indexeddb/IDBVersionChangeEvent.h:
3824         (WebCore::IDBVersionChangeEvent::create):
3825         (WebCore::IDBVersionChangeEvent::newVersion):
3826         * Modules/indexeddb/IDBVersionChangeEvent.idl:
3827
3828 2015-06-11  Matt Rajca  <mrajca@apple.com>
3829
3830         Media Session: Add plumbing for media control event delivery.
3831         https://bugs.webkit.org/show_bug.cgi?id=145859
3832
3833         Reviewed by Anders Carlsson.
3834
3835         * Modules/mediasession/MediaEventTypes.h: Added.
3836         * WebCore.xcodeproj/project.pbxproj:
3837         * page/Page.cpp:
3838         (WebCore::Page::handleMediaEvent): Toggle media playback upon receiving the PlayPause event as described in the spec.
3839         * page/Page.h:
3840
3841 2015-06-11  Jon Lee  <jonlee@apple.com>
3842
3843         Update media controls JS and CSS to use picture-in-picture
3844         https://bugs.webkit.org/show_bug.cgi?id=145827
3845         <rdar://problem/21311576>
3846
3847         Reviewed by Dean Jackson.
3848
3849         * English.lproj/mediaControlsLocalizedStrings.js: Update localized strings.
3850         Add a string for the placeholder text, and for the aria-label of the
3851         placard.
3852
3853         * Modules/mediacontrols/MediaControlsHost.idl: Remove uncalled functions.
3854         * Modules/mediacontrols/MediaControlsHost.h: Also remove optimizedFullscreenSupported(),
3855         which was never used.
3856         * Modules/mediacontrols/MediaControlsHost.cpp: Remove uncalled functions and media part IDs.
3857         (WebCore::MediaControlsHost::enterFullscreenOptimized): Deleted.
3858         (WebCore::MediaControlsHost::mediaUIImageData): Deleted.
3859
3860         * Modules/mediacontrols/mediaControlsApple.css:
3861         (audio::-webkit-media-controls-picture-in-picture-button): Update pseudo-element name.
3862         (audio::-webkit-media-controls-optimized-fullscreen-button): Deleted.
3863         * Modules/mediacontrols/mediaControlsApple.js: Update global variable name, and classes.
3864         (Controller.prototype.createControls): Update button name. Add aria-label to the placeholder.
3865         (Controller.prototype.updateFullscreenButtons):
3866         (Controller.prototype.updateLayoutForDisplayedWidth):
3867         (Controller.prototype.handlePictureInPictureButtonClicked): Update handler names.
3868         (Controller.prototype.handleOptimizedFullscreenButtonClicked): Deleted.
3869
3870         * Modules/mediacontrols/mediaControlsiOS.css: Rename pseudo-element.
3871         (audio::-webkit-media-controls-picture-in-picture-button): Add mask images.
3872         (audio::-webkit-media-controls-picture-in-picture-button:active):
3873         (video::-webkit-media-controls-picture-in-picture-button):
3874         (video::-webkit-media-controls-picture-in-picture-button.return-from-picture-in-picture):
3875         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
3876         (audio::-webkit-media-controls-wireless-playback-text-top.picture-in-picture):
3877         (audio::-webkit-media-controls-wireless-playback-text-bottom.picture-in-picture):
3878         (audio::-webkit-media-controls-optimized-fullscreen-button): Deleted.
3879         (audio::-webkit-media-controls-optimized-fullscreen-button:active): Deleted.
3880         (video::-webkit-media-controls-optimized-fullscreen-button): Deleted.
3881         (audio::-webkit-media-controls-wireless-playback-status.optimized): Deleted. The placard
3882         pseudo-element should be updated from wireless-playback-status to just playback-status
3883         since it serves both for pip and AirPlay.
3884         (audio::-webkit-media-controls-wireless-playback-text-top.optimized): Deleted.
3885         (audio::-webkit-media-controls-wireless-playback-text-bottom.optimized): Deleted.
3886         * Modules/mediacontrols/mediaControlsiOS.js:
3887         (ControllerIOS.prototype.createControls): Update button names.
3888         (ControllerIOS.prototype.configureInlineControls):
3889         (ControllerIOS.prototype.handlePictureInPictureButtonClicked): Update handler name.
3890         (ControllerIOS.prototype.handlePictureInPictureTouchStart):
3891         (ControllerIOS.prototype.handlePictureInPictureTouchEnd):
3892         (ControllerIOS.prototype.handlePictureInPictureTouchCancel):
3893         (ControllerIOS.prototype.handlePresentationModeChange): Remove changes to the inline bg
3894         image style, and rely on the CSS to fill those in. Use localized strings for the placard.
3895         Move the aria-label to createControls().
3896         (ControllerIOS.prototype.handleOptimizedFullscreenButtonClicked): Deleted.
3897         (ControllerIOS.prototype.handleOptimizedFullscreenTouchStart): Deleted.
3898         (ControllerIOS.prototype.handleOptimizedFullscreenTouchEnd): Deleted.
3899         (ControllerIOS.prototype.handleOptimizedFullscreenTouchCancel): Deleted.
3900
3901         * html/HTMLMediaElement.cpp: Remove enterFullscreenOptimized since it is never called.
3902         (WebCore::HTMLMediaElement::enterFullscreenOptimized): Deleted.
3903         * html/HTMLMediaElement.h:
3904         * platform/ios/WebCoreSystemInterfaceIOS.h: Remove wkGetMediaUIImageData.
3905         * platform/ios/WebCoreSystemInterfaceIOS.mm:
3906         * rendering/RenderThemeIOS.mm:
3907         (WebCore::RenderThemeIOS::mediaControlsStyleSheet): Remove calls to wkGetMediaUIImageData.
3908
3909 2015-06-11  Dean Jackson  <dino@apple.com>
3910
3911         Add an appearance keyword for wireless playback / airplay icon
3912         https://bugs.webkit.org/show_bug.cgi?id=145892
3913         <rdar://problem/21344872>
3914
3915         Reviewed by Simon Fraser.
3916
3917         Add a new "-webkit-appearance" value named "-apple-airplay"
3918         which will be used to render an icon. This change simply
3919         adds support for the value, and puts in hooks for drawing.
3920
3921         At the moment this is only going to be used by Airplay, so
3922         the public-facing name is "-apple-airplay". However, the
3923         implementation in Theme has a more generic name, in case
3924         we hook it up for other ports later.
3925
3926         Test: fast/css/appearance-airplay.html
3927
3928         * css/CSSParser.cpp:
3929         (WebCore::cssValueKeywordID): This new keyword should not get
3930         translated into having a -webkit prefix.
3931         * css/CSSPrimitiveValueMappings.h:
3932         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): New mapping from
3933         the Theme to the CSS value.
3934         * css/CSSValueKeywords.in: Add "-apple-airplay".
3935         * platform/ThemeTypes.h: New ControlPart.
3936         * rendering/RenderTheme.cpp: Stub implementation of the rendering and
3937         style update for the new appearance.
3938         (WebCore::RenderTheme::adjustStyle):
3939         (WebCore::RenderTheme::paint):
3940         (WebCore::RenderTheme::adjustWirelessPlaybackIconStyle):
3941         (WebCore::RenderTheme::paintWirelessPlaybackIcon):
3942         * rendering/RenderTheme.h:
3943         * rendering/RenderThemeMac.h:
3944         * rendering/RenderThemeMac.mm:
3945         (WebCore::RenderThemeMac::adjustWirelessPlaybackIconStyle):
3946         (WebCore::RenderThemeMac::paintWirelessPlaybackIcon):
3947
3948 2015-06-11  Commit Queue  <commit-queue@webkit.org>
3949
3950         Unreviewed, rolling out r185464.
3951         https://bugs.webkit.org/show_bug.cgi?id=145894
3952
3953         "This patch is breaking binding tests" (Requested by youenn on
3954         #webkit).
3955
3956         Reverted changeset:
3957
3958         "Bindings generator should generate code for Promise-based
3959         APIs"
3960         https://bugs.webkit.org/show_bug.cgi?id=145833
3961         http://trac.webkit.org/changeset/185464
3962
3963 2015-06-11  Commit Queue  <commit-queue@webkit.org>
3964
3965         Unreviewed, rolling out r185465.
3966         https://bugs.webkit.org/show_bug.cgi?id=145893
3967
3968         "This patch is breaking 32bit mac build" (Requested by youenn
3969         on #webkit).
3970
3971         Reverted changeset:
3972
3973         "[Streams API] ReadableJSStream should handle promises
3974         returned by JS source start callback"
3975         https://bugs.webkit.org/show_bug.cgi?id=145792
3976         http://trac.webkit.org/changeset/185465
3977
3978 2015-06-11  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3979
3980         [Streams API] ReadableJSStream should handle promises returned by JS source start callback
3981         https://bugs.webkit.org/show_bug.cgi?id=145792
3982
3983         Reviewed by Darin Adler.
3984
3985         Covered by rebased tests.