b4fca8964eb46e5f7a908d46dc28b79ab21e5efb
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-06-19  Per Arne Vollan  <peavo@outlook.com>
2
3         [WinCairo] Null pointer crash in BitmapTexture::updateContents.
4         https://bugs.webkit.org/show_bug.cgi?id=146147
5
6         Reviewed by Brent Fulgham.
7
8         Added null pointer check.
9
10         * platform/graphics/texmap/BitmapTexture.cpp:
11         (WebCore::BitmapTexture::updateContents):
12
13 2015-06-19  Anders Carlsson  <andersca@apple.com>
14
15         Spintracer treats the web process as hung when it's showing JavaScript dialogs in the UI process
16         https://bugs.webkit.org/show_bug.cgi?id=146124
17         rdar://problem/21449395
18
19         Reviewed by Geoffrey Garen.
20
21         * platform/spi/cg/CoreGraphicsSPI.h:
22
23 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
24
25         Remove unnecessary svn:executable flags
26         https://bugs.webkit.org/show_bug.cgi?id=146107
27
28         Reviewed by Alexey Proskuryakov.
29
30         * html/canvas/CanvasRenderingContext2D.cpp: Removed property svn:executable.
31         * mathml/MathMLMencloseElement.cpp: Removed property svn:executable.
32         * mathml/MathMLMencloseElement.h: Removed property svn:executable.
33         * platform/efl/RenderThemeEfl.cpp: Removed property svn:executable.
34         * rendering/mathml/RenderMathMLMenclose.cpp: Removed property svn:executable.
35         * rendering/mathml/RenderMathMLMenclose.h: Removed property svn:executable.
36
37 2015-06-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
38
39         Bindings generator should generate code to catch exception and reject promises for Promise-based APIs
40         https://bugs.webkit.org/show_bug.cgi?id=146060
41
42         Reviewed by Darin Adler.
43
44         The binding generator splits the function that binds JS to the DOM class implementation in two for functions returning promise.
45         The first function, called from JS, is responsible of casting this to the expected JSXXX class.
46         If casting fails, an exception is raised. Otherwise, it calls the second function.
47         After calling the second function, it checks whether an exception is raised, in which case it returns a rejected promise.
48         The second function is responsible of argument conversion and calling the DOM class function.
49
50         Covered by expectations and AudioContext promise still working.
51         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).
52         A second test case is a promise-returning function that can raise an exception. In that case the DOMException is used as rejection value.
53
54         As can be seen from generated code, this generalized code adds a mandatory check (is there an exception?) at the end of the function.
55         This check is done even in cases we know there will be no exception.
56         This may be covered by another patch if this optimization is thought useful enough.
57
58         * bindings/js/JSDOMPromise.cpp:
59         (WebCore::rejectPromiseWithExceptionIfAny): Utility method for the binding code.
60         (WebCore::callPromiseFunction): Ditto.
61         * bindings/js/JSDOMPromise.h:
62         * bindings/scripts/CodeGeneratorJS.pm:
63         (GenerateImplementation):
64         (GenerateFunctionCastedThis): Extracted from GenerateImplementationFunctionCall to reuse it in case of promise-returning functions.
65         (GenerateImplementationFunctionCall):
66         (GenerateCallbackImplementation): Deleted.
67         * bindings/scripts/test/JS/JSTestObj.cpp:
68         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
69         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
70         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
71         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
72         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
73         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
74         * bindings/scripts/test/TestObj.idl:
75
76 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
77
78         Disable UIWindow for fullscreen video for selected clients.
79         https://bugs.webkit.org/show_bug.cgi?id=145852
80
81         Reviewed by Simon Fraser.
82
83         Disable UIWindow for fullscreen video doesn't work everywhere (rdar://problem/21315993), so just disable it when creating a UIWindow won't work.
84         Fix some interface hiding and layout problems that showed up in the non UIWindow code path.
85
86         * platform/RuntimeApplicationChecksIOS.h:
87         * platform/RuntimeApplicationChecksIOS.mm: Remove iAD bundle identifier.
88         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
89         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Opt out of UIWindow when hosted in another process. And fix view parenting for non-window case.
90         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Fix for AVKit exit fullscreen complaining about -needsLayout.
91
92         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
93         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
94         (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen):
95         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen):
96         (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen):
97         (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen):
98         These hide and show the view controller where we hide and show the window.
99
100 2015-06-18  Dean Jackson  <dino@apple.com>
101
102         Provide a way for web developers to draw a Theme-specific Wireless Playback icon
103         https://bugs.webkit.org/show_bug.cgi?id=146123
104         <rdar://problem/21119287>
105
106         Reviewed by Simon Fraser.
107
108         Implement a -webkit-named-image() CSS <image> generator that allows a site to
109         request artwork by name and get the platform variant. At the moment
110         we only support "wireless-playback" which returns a generic image everywhere
111         but Cocoa platforms, where we render the AirPlay icon.
112
113         In order to do this I added a ThemeCocoa to share any Theme code between
114         Mac and iOS.
115
116         Test: fast/css/named-icons.html
117
118         * WebCore.xcodeproj/project.pbxproj: Add new files CSSNamedImageValue, NamedImageGeneratedImage and ThemeCocoa.
119
120         * css/CSSImageGeneratorValue.cpp: Handle the new NamedImageClass in the switch statements for downcasting.
121         (WebCore::CSSImageGeneratorValue::image):
122         (WebCore::CSSImageGeneratorValue::isFixedSize):
123         (WebCore::CSSImageGeneratorValue::isPending):
124         (WebCore::CSSImageGeneratorValue::knownToBeOpaque):
125
126         * css/CSSNamedImageValue.cpp: New class. Just holds a name String.
127         (WebCore::CSSNamedImageValue::customCSSText):
128         (WebCore::CSSNamedImageValue::image):
129         (WebCore::CSSNamedImageValue::equals):
130         * css/CSSNamedImageValue.h:
131         (WebCore::CSSNamedImageValue::create):
132         (WebCore::CSSNamedImageValue::isFixedSize):
133         (WebCore::CSSNamedImageValue::isPending):
134         (WebCore::CSSNamedImageValue::CSSNamedImageValue):
135
136         * css/CSSParser.cpp:
137         (WebCore::CSSParser::isGeneratedImageValue): Allow "-webkit-named-image(".
138         (WebCore::CSSParser::parseGeneratedImage): Call parseNamedImage if we hit named-icon.
139         (WebCore::CSSParser::parseNamedImage): Parse the function looking for a CSS ident.
140         * css/CSSParser.h:
141
142         * css/CSSValue.cpp: Handle NamedImageClass in the various switch statements.
143         (WebCore::CSSValue::equals):
144         (WebCore::CSSValue::cssText):
145         (WebCore::CSSValue::destroy):
146         * css/CSSValue.h:
147         (WebCore::CSSValue::isNamedImageValue): Helper to detect the correct CSSValue subclass.
148
149         * platform/Theme.cpp:
150         (WebCore::Theme::drawNamedImage): Draw a generic wireless playback icon.
151         * platform/Theme.h: Add drawNamedImage.
152
153         * platform/cocoa/ThemeCocoa.cpp: New shared base class for ThemeMac and ThemeIOS.
154         (WebCore::fitContextToBox):
155         (WebCore::ThemeCocoa::drawNamedImage): Draw an AirPlay icon for wireless playback.
156         * platform/cocoa/ThemeCocoa.h:
157
158         * platform/graphics/CrossfadeGeneratedImage.h: Drive-by removal of unnecessary forward class definition.
159
160         * platform/graphics/ImageBuffer.h: Add NamedImageGeneratedImage as a friend class.
161
162         * platform/graphics/NamedImageGeneratedImage.cpp: New class. Calls into the Theme to render the artwork.
163         (WebCore::NamedImageGeneratedImage::NamedImageGeneratedImage):
164         (WebCore::NamedImageGeneratedImage::draw):
165         (WebCore::NamedImageGeneratedImage::drawPattern):
166         * platform/graphics/NamedImageGeneratedImage.h:
167
168         * platform/ios/ThemeIOS.h: Inherit from ThemeCocoa.
169         * platform/mac/ThemeMac.h: Ditto.
170
171 2015-06-18  KyungTae Kim  <ktf.kim@samsung.com> and Myles C. Maxfield  <mmaxfield@apple.com>
172
173         [CSS3] Add support for the word-break:keep-all CSS property
174         https://bugs.webkit.org/show_bug.cgi?id=123782
175
176         Reviewed by Darin Adler.
177
178         Add support for word-break:keep-all CSS property by CSS3 spec:
179         http://www.w3.org/TR/2013/WD-css-text-3-20131010/#word-break-property
180
181         Test: fast/text/word-break-keep-all.html
182
183         * css/CSSParser.cpp:
184         (WebCore::isValidKeywordPropertyAndValue):
185         * css/CSSPrimitiveValueMappings.h:
186         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
187         (WebCore::CSSPrimitiveValue::operator EWordBreak):
188         * css/CSSValueKeywords.in:
189         * rendering/RenderText.cpp:
190         (WebCore::RenderText::computePreferredLogicalWidths):
191         * rendering/break_lines.h:
192         (WebCore::nextBreakablePositionKeepingAllWords):
193         (WebCore::nextBreakablePositionKeepingAllWordsIgnoringNBSP):
194         (WebCore::isBreakable):
195         * rendering/line/BreakingContext.h:
196         (WebCore::BreakingContext::handleText):
197         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
198         * rendering/style/RenderStyleConstants.h:
199
200 2015-06-18  Jon Lee  <jonlee@apple.com>
201
202         Update AVKit usage of pip
203         https://bugs.webkit.org/show_bug.cgi?id=146095
204         <rdar://problem/21386853>
205
206         Reviewed by Eric Carlson.
207
208         - Rename enum VideoFullscreenModeOptimized to VideoFullscreenModePictureInPicture
209         - Rename MediaElementSession::allowsAlternateFullscreen to allowsPictureInPicture
210         - Rename Settings::allowsAlternateFullscreen to allowsPictureInPictureMediaPlayback
211         - Update AVKit calls and AVKitSPI.h
212         - Rename WebVideoFullscreenInterfaceAVKit delegate functions and member variables
213
214         * html/HTMLMediaElement.cpp:
215         * html/HTMLVideoElement.cpp:
216         * html/MediaElementSession.cpp:
217         (WebCore::MediaElementSession::allowsPictureInPicture): Renamed.
218         (WebCore::MediaElementSession::allowsAlternateFullscreen): Deleted.
219         * html/MediaElementSession.h:
220         * page/Settings.cpp:
221         * page/Settings.in:
222         * platform/graphics/MediaPlayerEnums.h:
223         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
224         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
225         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Remove unused setIsOptimized.
226         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
227         * platform/spi/cocoa/AVKitSPI.h: Remove unused typedef.
228         * platform/spi/mac/AVFoundationSPI.h:
229
230 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
231
232         Fix crash when entering fullscreen during exit fullscreen animation.
233         https://bugs.webkit.org/show_bug.cgi?id=146117
234
235         Reviewed by Simon Fraser.
236
237         Because enterFullscreen can be called during exitFullscreen animation, the exit fullscreen teardown
238         should not imply a fullscreen state change on video element.
239
240         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
241         (WebVideoFullscreenControllerContext::exitFullscreen): May be called from mainThread
242         (-[WebVideoFullscreenController exitFullscreen]): May be called from mainThread
243         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
244         (WebVideoFullscreenModelVideoElement::setVideoElement): 
245         Changing associated video element does not imply fullscreen mode change.
246
247 2015-06-18  Brian J. Burg  <burg@cs.washington.edu>
248
249         Web Inspector: improve generated types for objects passed to backend commands
250         https://bugs.webkit.org/show_bug.cgi?id=146091
251
252         Reviewed by Joseph Pecoraro.
253
254         Update type signatures for backend command implementations. In a few cases, clean
255         up relevant helper function signatures and copy data out of parameter objects where
256         the code previously held onto a reference.
257
258         No new tests, no behavior changed.
259
260         * inspector/InspectorCSSAgent.cpp:
261         (WebCore::computePseudoClassMask):
262         (WebCore::InspectorCSSAgent::setStyleText):
263         (WebCore::InspectorCSSAgent::setRuleSelector):
264         (WebCore::InspectorCSSAgent::forcePseudoState):
265         * inspector/InspectorCSSAgent.h:
266         * inspector/InspectorDOMAgent.cpp:
267         (WebCore::parseColor):
268         (WebCore::parseConfigColor):
269         (WebCore::parseQuad):
270         (WebCore::InspectorDOMAgent::performSearch):
271         (WebCore::InspectorDOMAgent::setSearchingForNode):
272         (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
273         (WebCore::InspectorDOMAgent::setInspectModeEnabled):
274         (WebCore::InspectorDOMAgent::highlightRect):
275         (WebCore::InspectorDOMAgent::highlightQuad):
276         (WebCore::InspectorDOMAgent::innerHighlightQuad):
277         (WebCore::InspectorDOMAgent::highlightNode):
278         (WebCore::InspectorDOMAgent::highlightFrame):
279         * inspector/InspectorDOMAgent.h:
280         * inspector/InspectorDOMStorageAgent.cpp:
281         (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
282         (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
283         (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
284         (WebCore::InspectorDOMStorageAgent::findStorageArea):
285         * inspector/InspectorDOMStorageAgent.h:
286         * inspector/InspectorIndexedDBAgent.cpp:
287         (WebCore::InspectorIndexedDBAgent::requestData):
288         * inspector/InspectorIndexedDBAgent.h:
289         * inspector/InspectorReplayAgent.cpp:
290         (WebCore::InspectorReplayAgent::replayToPosition):
291         * inspector/InspectorReplayAgent.h:
292         * inspector/InspectorResourceAgent.cpp:
293         (WebCore::InspectorResourceAgent::willSendRequest):
294         (WebCore::InspectorResourceAgent::setExtraHTTPHeaders):
295         Clean up extraHTTPHeaders to copy header key/values out of the InspectorObject, rather
296         than retaining the protocol object indefinitely. This matches the ownership scheme used
297         everywhere else.
298
299         * inspector/InspectorResourceAgent.h:
300         * inspector/InspectorStyleSheet.h:
301         (WebCore::InspectorCSSId::InspectorCSSId):
302         * inspector/InspectorWorkerAgent.cpp:
303         (WebCore::InspectorWorkerAgent::sendMessageToWorker):
304         * inspector/InspectorWorkerAgent.h:
305
306 2015-06-18  Anders Carlsson  <andersca@apple.com>
307
308         Remove shouldInterruptJavaScript
309         https://bugs.webkit.org/show_bug.cgi?id=146118
310
311         Reviewed by Antti Koivisto.
312
313         The WebKit SPI methods for deciding whether JavaScript execution should be interrupted hasn't been used
314         for many releases. Furthermore, they don't make sense in the multi-process architecture since it's still possible
315         to interrupt execution (by closing the browser tab or window) from the UI process.
316
317         * bindings/js/JSDOMWindowBase.cpp:
318         (WebCore::JSDOMWindowBase::shouldInterruptScript):
319         * loader/EmptyClients.h:
320         * page/Chrome.cpp:
321         (WebCore::Chrome::shouldInterruptJavaScript): Deleted.
322         * page/Chrome.h:
323         * page/ChromeClient.h:
324
325 2015-06-18  Benjamin Poulain  <bpoulain@apple.com>
326
327         [CSS JIT][ARMv7] The pseudo element early exit trashes r6
328         https://bugs.webkit.org/show_bug.cgi?id=146078
329
330         Reviewed by Alex Christensen.
331
332         The pseudo element early failure runs before we generate the prologue.
333         The reason is that we can often exit immediately on function entry, before
334         we even touch any memory.
335
336         On ARMv7, we don't have many spare registers so the MacroAssembler
337         uses r6 as a scratch register and the client code is expected to save
338         it.
339
340         In the early failure case, we were not pushing r6 before using the MacroAssembler
341         and its value could be trashed.
342
343         This patch push the macro assembler registers separately from the prologue.
344
345         For restoring the registers, a new function generateFunctionEnding() encapsulate
346         the pop() and ret().
347
348         * cssjit/SelectorCompiler.cpp:
349         (WebCore::SelectorCompiler::SelectorCodeGenerator::pushMacroAssemblerRegisters):
350         (WebCore::SelectorCompiler::SelectorCodeGenerator::popMacroAssemblerRegisters):
351         (WebCore::SelectorCompiler::SelectorCodeGenerator::generatePrologue):
352         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateEpilogue):
353         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
354
355         * cssjit/StackAllocator.h:
356         (WebCore::StackAllocator::operator=):
357         We have a new case for the stack allocator: some stack changes are conditional
358         at compile time instead of runtime. This is easy to deal with by overriding
359         the stack if a path is not taken at compile time.
360
361 2015-06-17  Conrad Shultz  <conrad_shultz@apple.com>
362
363         REGRESSION: js/dom/navigator-plugins-crash.html asserts a lot
364         https://bugs.webkit.org/show_bug.cgi?id=144399
365
366         Reviewed by Darin Adler.
367
368         Earlier work made the array of web-visible plug-ins dynamic, but allowed DOMPlugin (and, indirectly by extension,
369         DOMMimeType) to continue keeping a reference to a plug-in in terms of an index into that array. This superficially
370         appeared correct since DOMPlugin immutably holds onto a PluginData instance, which in turn immutably holds onto a
371         Page instance. PluginStrategy::getWebVisiblePluginInfo() is passed this Page, which is used to determine the contents
372         of the plugin array. The expectation was that keeping an index would still be safe since the Page is not changing,
373         but this is not strictly correct since relevant attributes of the Page and/or the available plugins may still change.
374
375         It's not entirely clear why the test failures are intermittent and occur only on certain configurations, but address
376         them by eliminating the incorrect storage of indexes in favor of keeping copies of the relevant plugin info itself.
377
378         * plugins/DOMMimeType.cpp:
379         (WebCore::DOMMimeType::DOMMimeType):
380         Instead of storing the MIME type index, retrieve and store the MIME class info and plugin info.
381         (WebCore::DOMMimeType::type):
382         Directly access the m_mimeClassInfo member.
383         (WebCore::DOMMimeType::suffixes):
384         Ditto.
385         (WebCore::DOMMimeType::description):
386         Ditto.
387         (WebCore::DOMMimeType::enabledPlugin):
388         Directly access the m_pluginInfo member.
389         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
390
391         * plugins/DOMMimeType.h:
392         Update member variables.
393
394         * plugins/DOMPlugin.cpp:
395         (WebCore::DOMPlugin::DOMPlugin):
396         Instead of storing the plugin index, store the plugin info directly.
397         (WebCore::DOMPlugin::name):
398         Directly access m_pluginInfo.
399         (WebCore::DOMPlugin::filename):
400         Ditto.
401         (WebCore::DOMPlugin::description):
402         Ditto.
403         (WebCore::DOMPlugin::length):
404         Ditto.
405         (WebCore::DOMPlugin::item):
406         Access m_pluginInfo directly; find the matching plug-in based on matching PluginInfo (for which an overloaded
407         comparator is supplied below).
408         (WebCore::DOMPlugin::pluginInfo): Deleted.
409
410         * plugins/DOMPlugin.h:
411         Update member variables.
412         (WebCore::DOMPlugin::create):
413         Accept a PluginInfo instead of a plugin index.
414
415         * plugins/DOMPluginArray.cpp:
416         (WebCore::DOMPluginArray::item):
417         (WebCore::DOMPluginArray::namedItem):
418
419         * plugins/PluginData.h:
420         (WebCore::operator==):
421         Added; compare PluginInfo structs on the basis of member equality.
422
423 2015-06-17  Alex Christensen  <achristensen@webkit.org>
424
425         [Content Extensions] Log blocked loads to the WebInspector console
426         https://bugs.webkit.org/show_bug.cgi?id=146089
427
428         Reviewed by Joseph Pecoraro.
429
430         * contentextensions/ContentExtensionsBackend.cpp:
431         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
432         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
433         Log which URLs are blocked and the URL of the page they are blocked from.
434
435 2015-06-18  Joseph Pecoraro  <pecoraro@apple.com>
436
437         Crash under WebCore::DOMWindow::dispatchMessageEventWithOriginCheck attempting to log console message
438         https://bugs.webkit.org/show_bug.cgi?id=146093
439
440         Reviewed by Timothy Hatcher.
441
442         * page/DOMWindow.cpp:
443         (WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):
444         The console could be null so null check its use.
445
446 2015-06-18  Csaba Osztrogonác  <ossy@webkit.org>
447
448         Suppress null-conversion warnings in ANGLE
449         https://bugs.webkit.org/show_bug.cgi?id=145125
450
451         Reviewed by Alex Christensen.
452
453         * CMakeLists.txt:
454
455 2015-06-18  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
456
457         [Streams API] Implement ReadableStreamReader.releaseLock
458         https://bugs.webkit.org/show_bug.cgi?id=145299
459
460         Reviewed by Darin Adler.
461
462         Covered by rebased tests.
463
464         * Modules/streams/ReadableStream.cpp:
465         (WebCore::ReadableStream::close): Moving some close code to newly added releaseReader.
466         (WebCore::ReadableStream::releaseReader): Implements reader release and callbacks finalization.
467         (WebCore::ReadableStream::changeStateToErrored): Calls releaseReader.
468         * Modules/streams/ReadableStream.h:
469         (WebCore::ReadableStream::hasReadPendingRequests): Added to enable reader.releaseLock throwing if read requests are pending.
470         * Modules/streams/ReadableStreamReader.cpp:
471         (WebCore::ReadableStreamReader::releaseLock): Implementation of releaseLock
472         * Modules/streams/ReadableStreamReader.h:
473         * Modules/streams/ReadableStreamReader.idl:
474         (WebCore::releaseLock): Deleted.
475
476 2015-06-18  Youenn Fablet  <youenn.fablet@crf.canon.fr>
477
478         GObject and ObjC bindings generator should not generate code for promise-based APIs
479         https://bugs.webkit.org/show_bug.cgi?id=146059
480
481         Reviewed by Darin Adler.
482
483         Covered by rebased expectations.
484
485         * bindings/scripts/CodeGeneratorGObject.pm:
486         (SkipFunction): Disabling GObject DOM binding for functions returning promises.
487         * bindings/scripts/CodeGeneratorObjC.pm:
488         (SkipFunction): Disabling ObjC DOM binding for functions returning promises.
489         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Rebasing expectation.
490         (webkit_dom_test_obj_get_read_only_long_attr): Deleted.
491         (webkit_dom_test_obj_get_read_only_string_attr): Deleted.
492         * bindings/scripts/test/GObject/WebKitDOMTestObj.h: Rebasing expectation.
493         * bindings/scripts/test/ObjC/DOMTestObj.h: Ditto.
494         * bindings/scripts/test/ObjC/DOMTestObj.mm: Ditto.
495         (core): Deleted.
496
497 2015-06-17  Ryuan Choi  <ryuan.choi@navercorp.com>
498
499         [EFL] test_ewk2_context_url_scheme_register has been crashed since r185553
500         https://bugs.webkit.org/show_bug.cgi?id=146075
501
502         Reviewed by Carlos Garcia Campos.
503
504         Since r185553, CustomProtocolManager sends StartLoading message to UIProcess
505         with request of SoupGenericRequest instead of request itself.
506         But, request of SoupGenericRequest is nullptr in EFL port because EFL port
507         does not use m_initiatingPageID.
508
509         This patch updates request of SoupGenericRequest although m_initiatingPageID is null.
510
511         * platform/network/soup/ResourceRequestSoup.cpp: 
512         (WebCore::ResourceRequest::updateSoupRequest):
513
514 2015-06-17  Daniel Bates  <dabates@apple.com>
515
516         Client may receive began editing callback for already focused text field
517         https://bugs.webkit.org/show_bug.cgi?id=146074
518         <rdar://problem/21293562>
519
520         Reviewed by Darin Adler.
521
522         Fixes an issue where the client would be notified that began editing in a text field
523         for each programmatic DOM focus event dispatched at the text field regardless of
524         whether the field was focused. The client should only be notified that began editing
525         exactly once when a text field becomes focused (either programmatically or by user interaction).
526
527         * html/TextFieldInputType.cpp:
528         (WebCore::TextFieldInputType::forwardEvent): Move logic to dispatch editing began callback from here...
529         (WebCore::TextFieldInputType::handleFocusEvent): to here. This function is called when the
530         text field becomes newly focused.
531         * html/TextFieldInputType.h:
532
533 2015-06-17  Alex Christensen  <achristensen@webkit.org>
534
535         [Content Extensions] Fail to parse invalid arrays
536         https://bugs.webkit.org/show_bug.cgi?id=146079
537         rdar://problem/21422649
538
539         Reviewed by Benjamin Poulain.
540
541         Covered by new and corrected API tests.
542
543         * contentextensions/ContentExtensionParser.cpp:
544         (WebCore::ContentExtensions::loadTrigger):
545         Fail to parse invalid arrays for if-domain, unless-domain, resource-type, and load-type arrays.
546
547 2015-06-16  Jon Honeycutt  <jhoneycutt@apple.com>
548
549         Position::findParent() should take a reference
550         https://bugs.webkit.org/show_bug.cgi?id=146038
551
552         Reviewed by Darin Adler.
553
554         * dom/Position.cpp:
555         (WebCore::Position::containerNode):
556         (WebCore::Position::parentAnchoredEquivalent):
557         Pass a reference; there is already a null check.
558         (WebCore::Position::previous):
559         Add a missing null check. Code below this expects that node is non-null.
560         (WebCore::Position::next):
561         Ditto.
562         (WebCore::Position::atStartOfTree):
563         (WebCore::Position::atEndOfTree):
564         Pass a reference.
565         (WebCore::Position::findParent):
566         Changed to take a reference.
567
568         * dom/Position.h:
569         Ditto.
570
571 2015-06-17  Brent Fulgham  <bfulgham@apple.com>
572
573         Overflow regions with scroll snap points are not reliably rubber banding
574         https://bugs.webkit.org/show_bug.cgi?id=142522
575         <rdar://problem/20100726>
576
577         Reviewed by Darin Adler.
578
579         When computing the target scroll destination, update the nearest snap point index
580         and other bookkeeping, but keep the original gesture target if it would have taken
581         us beyond either limit of the scroll container.
582
583         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
584         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
585         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollExtents): Add new method
586         to support client API.
587         * platform/ScrollAnimator.cpp:
588         (WebCore::ScrollAnimator::scrollExtents): Add new method to support client API.
589         * platform/ScrollAnimator.h:
590         * platform/cocoa/ScrollController.h:
591         (WebCore::ScrollControllerClient::scrollExtents): Added new pure virtual method to API.
592         * platform/cocoa/ScrollController.mm:
593         (WebCore::ScrollController::beginScrollSnapAnimation): Hold onto original user gesture
594         target, and use that instead of our nearest snap point if the gesture takes us past
595         either extreme of the scroll container.
596
597 2015-06-17  Tim Horton  <timothy_horton@apple.com>
598
599         Swipe gesture can get stuck, preventing scrolling and other gestures
600         https://bugs.webkit.org/show_bug.cgi?id=146088
601         <rdar://problem/16056087>
602
603         Reviewed by Darin Adler.
604
605         * WebCore.xcodeproj/project.pbxproj:
606         * platform/spi/mac/NSEventSPI.h: Added.
607         Add an SPI header.
608
609 2015-06-16  Matt Rajca  <mrajca@apple.com>
610
611         MediaSession: handle MediaEventTrackNext and MediaEventTrackPrevious events
612         https://bugs.webkit.org/show_bug.cgi?id=146028
613
614         Reviewed by Darin Adler.
615
616         * Modules/mediasession/MediaRemoteControls.idl: Added nexttrack/previoustrack event handlers.
617         * Modules/mediasession/MediaSession.cpp: Dispatch the nexttrack/previoustrack events.
618         (WebCore::MediaSession::skipToNextTrack):
619         (WebCore::MediaSession::skipToPreviousTrack):
620         * Modules/mediasession/MediaSession.h:
621         * Modules/mediasession/MediaSessionManager.cpp: Skip to the next/previous track as described in the media session spec.
622         (WebCore::MediaSessionManager::skipToNextTrack):
623         (WebCore::MediaSessionManager::skipToPreviousTrack):
624         * Modules/mediasession/MediaSessionManager.h:
625         * dom/EventNames.h: Added the nexttrack/previoustrack event names.
626         * page/Page.cpp: Tell MediaSessionManager to handle the new track-skipping events.
627         (WebCore::Page::handleMediaEvent):
628
629 2015-06-17  Chris Fleizach  <cfleizach@apple.com>
630
631         AX: VoiceOver in iOS not announcing generic WAI-ARIA region, even if labelled properly
632         https://bugs.webkit.org/show_bug.cgi?id=146066
633
634         Reviewed by Darin Adler.
635
636         Allow the region role to identify as a landmark type.
637
638         Updated test: platform/ios-simulator/accessibility/landmark-types.html
639
640         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
641         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
642
643 2015-06-17  Simon Fraser  <simon.fraser@apple.com>
644
645         REGRESSION (r173283-r173296): Amazon.com front page has no caret in the search field
646         https://bugs.webkit.org/show_bug.cgi?id=146073
647         rdar://problem/21022203
648
649         Reviewed by Tim Horton.
650
651         Text controls (text inputs and textareas) need backing store even when empty, because
652         they need to be able to paint a caret.
653
654         Test: compositing/backing/form-controls-backing.html
655
656         * rendering/RenderLayerBacking.cpp:
657         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
658
659 2015-06-17  Zalan Bujtas  <zalan@apple.com>
660
661         Selection cache produces invalid result when ancestor has float element.
662         https://bugs.webkit.org/show_bug.cgi?id=146042
663         rdar://problem/20604592
664
665         Reviewed by Ryosuke Niwa.
666
667         Selection cache already takes floats into account, however it's not enough to check current
668         block against floats. Any of the ancestor's float starting from the selection root block
669         can impact the selection offsets.
670
671         Test: fast/block/selection-cache-is-incorrect-when-non-direct-parent-has-float.html
672
673         * rendering/LogicalSelectionOffsetCaches.h:
674         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::ContainingBlockInfo):
675         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock):
676         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::block):
677         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::cache):
678         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::hasFloatsOrFlowThreads):
679         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
680
681 2015-06-17  Joanmarie Diggs  <jdiggs@igalia.com>
682
683         AX: [ATK] Expose element tag name as an object attribute
684         https://bugs.webkit.org/show_bug.cgi?id=146062
685
686         Reviewed by Mario Sanchez Prada.
687
688         Expose the element tag name as an object attribute with name "tag" and
689         value being the lowercase tag name, both being what Gecko does for ATK.
690
691         No new tests. We already have sufficient coverage for AtkObject attributes.
692         These tests have been updated to reflect the addition of the new attribute.
693
694         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
695         (webkitAccessibleGetAttributes):
696
697 2015-06-17  Antti Koivisto  <antti@apple.com>
698
699         iOS WebKit1: [LegacyTileLayer drawInContext:] should ensure it has web lock
700         https://bugs.webkit.org/show_bug.cgi?id=146072
701         rdar://problem/21149759
702
703         Reviewed by Simon Fraser
704
705         There are some scenarios where we end up drawing without web lock due to client or system issues.
706         This can cause crashes.
707
708         * platform/ios/LegacyTileLayer.mm:
709         (-[LegacyTileLayer setNeedsDisplayInRect:]):
710         (-[LegacyTileLayer drawInContext:]):
711
712             Ensure we have the web lock when called in main thread (even though we should have it already).
713
714 2015-06-17  Brent Fulgham  <bfulgham@apple.com>
715
716         CSS scroll snap: defining snap points on axis that does not scroll does not work properly
717         https://bugs.webkit.org/show_bug.cgi?id=146043
718         <rdar://problem/20125511>
719
720         Reviewed by Simon Fraser.
721
722         Tested by css3/scroll-snap/scroll-snap-mismatch.html
723
724         We always seed the set of scroll snap points with the start and end of the scroll container. This is not
725         the right behavior if there are no scroll points defined, because we end up creating a snap for the start
726         and end of the container, and any scroll gesture just takes us across the entire element.
727         
728         Instead, when we do not find any scroll snap points, we should clear the snap point state for the container.
729
730         * page/scrolling/AxisScrollSnapOffsets.cpp:
731         (WebCore::updateFromStyle): If we did not find any snap points (i.e., the snapOffsets container
732         only holds '0', return an empty Vector. 
733         (WebCore::updateSnapOffsetsForScrollableArea): If the set of snap points produced by 'updateFromStyle' is empty,
734         clear the horizontal (or vertical) snap offsets for the scroll area.
735         
736
737 2015-06-17  Chris Fleizach  <cfleizach@apple.com>
738
739         AX: input role="spinbutton" gets skipped in voiceover
740         https://bugs.webkit.org/show_bug.cgi?id=145514
741
742         Reviewed by Mario Sanchez Prada.
743
744         SpinButton role was added, but left out of iOS.
745         To prevent this from happening again, explicitly list every role in the switch statement that
746         determines accessible visibility.
747
748         Test: platform/ios-simulator/accessibility/spinbutton.html
749
750         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
751         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
752         (-[WebAccessibilityObjectWrapper isAccessibilityElement]):
753
754 2015-06-17  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
755
756         [Streams API] ReadableJSStream should handle promises returned by JS source pull callback
757         https://bugs.webkit.org/show_bug.cgi?id=145965
758
759         Reviewed by Darin Adler.
760
761         Implemented asynchronous pulling.
762         In particular, ensuring that doPull is not called as long as previous call to doPull is finished.
763         Storing whether to pull automatically when the current pull is finished. 
764
765         Covered by rebased tests.
766
767         * Modules/streams/ReadableStream.cpp:
768         (WebCore::ReadableStream::pull): stores whether to pull again.
769         (WebCore::ReadableStream::finishPulling): called when pulling finishes.
770         * Modules/streams/ReadableStream.h:
771         * bindings/js/ReadableJSStream.cpp:
772         (WebCore::createPullResultFulfilledFunction): The promise resolve callback.
773         (WebCore::ReadableJSStream::doPull): Handling of promise.
774         * bindings/js/ReadableJSStream.h:
775
776 2015-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
777
778         WebProcess crashes after too many redirect error when there's an active NPAPI plugin
779         https://bugs.webkit.org/show_bug.cgi?id=146019
780
781         Reviewed by Darin Adler.
782
783         This happens with the GTK+ port after a navigation action ends up
784         in an infinite redirection and the ResourceHandle fails with too
785         many redirections error. I should actually happen after any error
786         is reported by the ResourceHnalder before the load is
787         committed. But tt only happens if there's an active NPAPI
788         plugin. The problem is that FrameLoader::receivedMainResourceError()
789         is called recursively because DocumentLoader::stopLoading() ends up
790         calling mainReceivedError() that calls FrameLoader::receivedMainResourceError()
791         again. DocumentLoader::stopLoading() checks if the document is
792         still loading, which can happen if the main resource is loading,
793         if there's any subresource loading or if there's a plugin
794         loading. So, in case of being loading, those cases are handled
795         individually to cancel the main resource, or set an error in the
796         document loader and cancel subresources and plugins, except for
797         this case of plugins, that mainReceivedError is called instead of
798         setting cancelled error on the document loader.
799
800         * loader/DocumentLoader.cpp:
801         (WebCore::DocumentLoader::stopLoading): If the document is still
802         loading because there are active plugins, set the cancelled error
803         on the document instead of calling mainReceivedError again.
804
805 2015-06-16  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
806
807         [Streams API] Implement ReadableStream locked property
808         https://bugs.webkit.org/show_bug.cgi?id=146023
809
810         Reviewed by Darin Adler.
811
812         Covered by rebased tests.
813
814         * Modules/streams/ReadableStream.h:
815         (WebCore::ReadableStream::locked): Renamed isLocked by locked.
816         * Modules/streams/ReadableStream.idl: Adding locked.
817         * bindings/js/JSReadableStreamCustom.cpp:
818         (WebCore::JSReadableStream::getReader): Using isLocked.
819         * bindings/js/JSReadableStreamReaderCustom.cpp:
820         (WebCore::constructJSReadableStreamReader): Using isLocked.
821
822 2015-06-16  Myles C. Maxfield  <mmaxfield@apple.com>
823
824         REGRESSION(r184899): [Cocoa] font-variant: small-caps is not honored with web fonts
825         https://bugs.webkit.org/show_bug.cgi?id=145873
826         <rdar://problem/21314282>
827
828         Reviewed by Dean Jackson.
829
830         When font-variant: small-caps is applied, we create a smaller version of the original font
831         and draw capital characters in that smaller font. CGFontRefs do not have an intrinsic size,
832         and web fonts historically only had a CGFontRef, which means that there was no need to
833         convert the CGFontRef to be smaller (as opposed to regular fonts, which had a CTFontRef and
834         therefore needed the conversion). Instead, we just changed m_size, which represents
835         the size that the text should be drawn in.
836
837         However, r184899 gave CTFontRefs to web fonts. This means that now the FontPlatformData's
838         m_size variable disagreed with the CTFontRef member. The solution here is to unify the web
839         font and regular font codepaths, and treat them the same throughout.
840
841         Note that this patch removes the last use of the m_isCustomFont variable. As soon as we
842         entirely migrate to CORETEXT_WEB_FONTS, we should delete this variable.
843
844         Test: fast/text/small-caps-web-font.html
845
846         * platform/graphics/cocoa/FontCocoa.mm:
847         (WebCore::Font::platformCreateScaledFont): Treat web fonts the same as regular fonts.
848         * platform/text/TextFlags.h: Add a comment regarding teh deletion of m_isCustomFont.
849
850 2015-06-16  Alex Christensen  <achristensen@webkit.org>
851
852         [Content Extensions] Implement branch compaction for DFA bytecode.
853         https://bugs.webkit.org/show_bug.cgi?id=145619
854
855         Reviewed by Benjamin Poulain.
856
857         This patch adds another pass to the DFABytecodeCompiler which finds where the bytecode from each node
858         would be if it were compiled with no branch compaction, then uses that as a worst-case value to determine
859         how many bytes are needed to store the relative jump distance.  Then when linking, it will fill in the 
860         value as it already did, but with a variable size jump.  The jumps are also now signed distances relative to
861         where the jump is stored.
862
863         This patch is covered by existing tests, which have many jumps that are near the -128/127 byte boundary,
864         and the switch from 16-bit jumps to 32-bit jumps near the -65536/65535 byte boundary is analogous.
865
866         * contentextensions/ContentExtensionCompiler.cpp:
867         (WebCore::ContentExtensions::compileRuleList):
868         * contentextensions/DFABytecode.h:
869         (WebCore::ContentExtensions::smallestPossibleJumpSize):
870         (WebCore::ContentExtensions::instructionSizeWithArguments):
871         * contentextensions/DFABytecodeCompiler.cpp:
872         (WebCore::ContentExtensions::append):
873         (WebCore::ContentExtensions::appendZeroes):
874         (WebCore::ContentExtensions::setBits):
875         (WebCore::ContentExtensions::appendActionBytecodeSize):
876         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
877         (WebCore::ContentExtensions::DFABytecodeCompiler::longestPossibleJump):
878         (WebCore::ContentExtensions::DFABytecodeCompiler::emitJump):
879         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
880         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
881         (WebCore::ContentExtensions::DFABytecodeCompiler::emitTerminate):
882         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
883         (WebCore::ContentExtensions::DFABytecodeCompiler::compiledNodeMaxBytecodeSize):
884         (WebCore::ContentExtensions::DFABytecodeCompiler::ranges):
885         (WebCore::ContentExtensions::DFABytecodeCompiler::checkForRangeMaxBytecodeSize):
886         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
887         (WebCore::ContentExtensions::DFABytecodeCompiler::nodeTransitionsMaxBytecodeSize):
888         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
889         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
890         (WebCore::ContentExtensions::set32Bits): Deleted.
891         * contentextensions/DFABytecodeCompiler.h:
892         * contentextensions/DFABytecodeInterpreter.cpp:
893         (WebCore::ContentExtensions::getBits):
894         (WebCore::ContentExtensions::getInstruction):
895         (WebCore::ContentExtensions::jumpSizeInBytes):
896         (WebCore::ContentExtensions::getJumpSize):
897         (WebCore::ContentExtensions::getJumpDistance):
898         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
899         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
900         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot):
901         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
902         * loader/ResourceLoadInfo.h:
903
904 2015-06-16  Carlos Alberto Lopez Perez  <clopez@igalia.com>
905
906         [GTK] [Wayland] Should be possible to build with support for both X11 and Wayland.
907         https://bugs.webkit.org/show_bug.cgi?id=145701
908
909         Reviewed by Darin Adler.
910
911         No new tests, no behavior changes.
912
913         When building both targets, we have to include the wayland-egl
914         headers in order to build the Wayland target. This causes that
915         EGLNativePixmapType and EGLNativeWindowType get defined as
916         different types than when building only the X11 target.
917
918         By type casting them to the ones that are expected, we are able
919         to build both targets at the same time.
920
921         I have done tests (building each target alone as also both targets
922         at the same time), and everything seems to works as expected.
923
924         Once built for both targets, if you try to launch the MiniBrowser
925         from inside a Wayland compositor (Weston on top of X for example),
926         it will trigger the X11 target if the DISPLAY environment variable
927         is set and the environment variable GDK_BACKEND is not set to wayland,
928         otherwise it will trigger the Wayland target.
929
930         * platform/graphics/GLContext.cpp:
931         (WebCore::GLContext::createContextForWindow): Add type casts. We have
932         to consider here two different type casts depending on the type of
933         GLNativeWindowType to avoid a build failure on 32-bits platforms.
934         The static_cast one was already beeing done as an implicit cast
935         (from uint64_t to XID), the reinterpret_cast is the new one that
936         we need to do only when building on both platforms.
937         * platform/graphics/egl/GLContextEGL.cpp: Add missing include when
938         building both targets that is required for defining DefaultRootWindow().
939         (WebCore::GLContextEGL::createPixmapContext): Add type cast.
940
941 2015-06-15  Jon Honeycutt  <jhoneycutt@apple.com>
942
943         [iOS] Crash long pressing on <input type=file>
944         https://bugs.webkit.org/show_bug.cgi?id=146009
945         <rdar://problem/21234453>
946
947         Reviewed by Ryosuke Niwa.
948
949         * dom/Position.cpp:
950         (WebCore::Position::atStartOfTree):
951         (WebCore::Position::atEndOfTree):
952         Null check the container node before passing it to findParent().
953
954 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
955
956         AX:  iOS accessibility tests are not running because we need WKTR support
957         https://bugs.webkit.org/show_bug.cgi?id=145991
958
959         Reviewed by Daniel Bates.
960
961         Make some minor modifications to support notification handling in WKTR.
962
963         * accessibility/ios/AXObjectCacheIOS.mm:
964         (WebCore::AXObjectCache::postPlatformNotification):
965         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
966         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
967         (-[WebAccessibilityObjectWrapper accessibilityClickPoint]):
968         (-[WebAccessibilityObjectWrapper description]):
969         (-[WebAccessibilityObjectWrapper accessibilitySetPostedNotificationCallback:withContext:]): Deleted.
970         (-[WebAccessibilityObjectWrapper accessibilityPostedNotification:]): Deleted.
971
972 2015-06-16  Mark Lam  <mark.lam@apple.com>
973
974         Use NakedPtr<Exception>& to return exception results.
975         https://bugs.webkit.org/show_bug.cgi?id=145870
976
977         Reviewed by Anders Carlsson and Filip Pizlo.
978
979         No new WebCore tests because this functionality is already covered by existing tests.
980         API tests added for WTF::NakedPtr.
981
982         * bindings/js/JSCallbackData.cpp:
983         (WebCore::JSCallbackData::invokeCallback):
984         * bindings/js/JSCustomXPathNSResolver.cpp:
985         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
986         * bindings/js/JSErrorHandler.cpp:
987         (WebCore::JSErrorHandler::handleEvent):
988         * bindings/js/JSEventListener.cpp:
989         (WebCore::JSEventListener::handleEvent):
990         * bindings/js/JSMainThreadExecState.cpp:
991         (WebCore::JSMainThreadExecState::didLeaveScriptContext):
992         (WebCore::functionCallHandlerFromAnyThread):
993         (WebCore::evaluateHandlerFromAnyThread):
994         * bindings/js/JSMainThreadExecState.h:
995         (WebCore::JSMainThreadExecState::currentState):
996         (WebCore::JSMainThreadExecState::call):
997         (WebCore::JSMainThreadExecState::evaluate):
998         * bindings/js/JSMutationCallback.cpp:
999         (WebCore::JSMutationCallback::call):
1000         * bindings/js/ScheduledAction.cpp:
1001         (WebCore::ScheduledAction::executeFunctionInContext):
1002         * bindings/js/ScriptController.cpp:
1003         (WebCore::ScriptController::evaluateInWorld):
1004         * bindings/js/WorkerScriptController.cpp:
1005         (WebCore::WorkerScriptController::evaluate):
1006         (WebCore::WorkerScriptController::setException):
1007         * bindings/js/WorkerScriptController.h:
1008         (WebCore::WorkerScriptController::workerGlobalScopeWrapper):
1009         * bindings/objc/WebScriptObject.mm:
1010         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1011         * workers/WorkerGlobalScope.cpp:
1012         (WebCore::WorkerGlobalScope::importScripts):
1013
1014 2015-06-16  Brent Fulgham  <bfulgham@apple.com>
1015
1016         CSS Scroll Snap - support snapping to nested elements
1017         https://bugs.webkit.org/show_bug.cgi?id=145843
1018         <rdar://problem/21339581>
1019
1020         Reviewed by Darin Adler.
1021
1022         Tested by css3/scroll-snap/nested-elements.html
1023
1024         The Scroll Snap Point implementation was not properly handling nested elements.
1025         This could be resolved by recursively calling 'appendChildSnapOffsets', but this
1026         seemed like an inefficient approach, especially considering how often this method
1027         is called during various scaling and other operations.
1028         
1029         Instead, do the following:
1030         (1) Add a new HashSet to RenderView that holds a collection of RenderElements that
1031             have scroll-snap-coordinates.
1032         (2) During RenderElement::styleWillChange, register all elements that have the
1033             scroll-snap-coordinates style with the RenderView.
1034         (3) When performing 'appendChildSnapOffsets', refer to the HashSet of elements, select the
1035             subset of these entries relevant to the current scrolling container, and build up the
1036             set of scroll-snap-coordinates needed for the current scrolling container.
1037
1038         * page/scrolling/AxisScrollSnapOffsets.cpp:
1039         (WebCore::appendChildSnapOffsets): Check the scroll-snap-coordinate RenderElement HashSet
1040         for the RenderView to find all elements that are children of the current scrolling container.
1041         Add the scroll-snap-coordinates for these RenderElements to the current set of snap points.
1042         * rendering/RenderElement.cpp:
1043         (WebCore::findEnclosingScrollableContainer): New helper function.
1044         (WebCore::RenderElement::styleWillChange): If the current element has scroll-snap-coordinate
1045         defined, remember it for later so we can use it with the relevant scrolling container
1046         after layout completes.
1047         (WebCore::RenderElement::willBeRemovedFromTree): Unregister the current element from the
1048         RenderView.
1049         (WebCore::RenderElement::findEnclosingScrollableContainer): Added. Locate the relevant
1050         scrolling container for the current object.
1051         * rendering/RenderElement.h:
1052         * rendering/RenderView.cpp:
1053         (WebCore::Document::registerRenderElementWithScrollSnapCoordinates): Added.
1054         (WebCore::Document::unregisterRenderElementWithScrollSnapCoordinates): Added.
1055         * rendering/RenderView.h:
1056
1057 2015-06-16  Brady Eidson  <beidson@apple.com>
1058
1059         [IndexedDB] array index keys are concatenated across cursor lifetime
1060         <rdar://problem/19684902> and https://bugs.webkit.org/show_bug.cgi?id=138504
1061
1062         Reviewed by Brady Eidson, patch by Mark Dixon <mark@lowla.io>
1063
1064         Tested by:
1065         storage/indexeddb/keypath-arrays.html
1066
1067         IDBKeyData and IDBKeyPath need to clear any existing array values before calling
1068         decodeObjects to update the value of an existing object.
1069         
1070         * Modules/indexeddb/IDBKeyData.cpp:
1071         (WebCore::IDBKeyData::decode):
1072         * Modules/indexeddb/IDBKeyPath.cpp:
1073         (WebCore::IDBKeyPath::decode):
1074
1075 2015-06-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
1076
1077         Canvas dimensions should be limited to 4096x4096 pixels on iOS devices.
1078         https://bugs.webkit.org/show_bug.cgi?id=145998
1079
1080         Reviewed by Darin Adler.
1081
1082         The value of MaxCanvasArea should depend on the platform. If the platform
1083         is iOS, the limit should be 64M. Otherwise the limit should be 1G.
1084
1085         Test: fast/canvas/pattern-too-large-to-create-2.html
1086
1087         * html/HTMLCanvasElement.cpp: Change MaxCanvasArea value based on the platform. 
1088         
1089         * rendering/svg/RenderSVGShape.h:
1090         (WebCore::RenderSVGShape::graphicsElement): Remove un-implemented constructor.
1091
1092 2015-06-16  Chris Dumez  <cdumez@apple.com>
1093
1094         REGRESSION(r185012): chat frame in Gmail now says "Something's not right"
1095         https://bugs.webkit.org/show_bug.cgi?id=146025
1096         <rdar://problem/21391412>
1097
1098         Reviewed by Darin Adler.
1099
1100         Only throttle timers in non-visible iframes once they've reached the
1101         max nesting level to avoid throttling critical one-shot timers. This is
1102         consistent with the default DOMTimer throttling behavior that is
1103         defined in the specification.
1104
1105         Power-wise, we are mostly interested in DOMTimers that fire frequently
1106         and cause high CPU usage over an extended period of time anyway.
1107
1108         * dom/Document.cpp:
1109         (WebCore::Document::setTimerThrottlingEnabled):
1110         (WebCore::Document::timerAlignmentInterval):
1111         * dom/Document.h:
1112         * dom/ScriptExecutionContext.cpp:
1113         (WebCore::ScriptExecutionContext::timerAlignmentInterval):
1114         * dom/ScriptExecutionContext.h:
1115         * page/DOMTimer.cpp:
1116         (WebCore::DOMTimer::alignedFireTime):
1117
1118 2015-06-16  sylvain-galineau  <galineau@adobe.com>
1119
1120         Incorrect order of arguments in initial-letter property
1121         https://bugs.webkit.org/show_bug.cgi?id=139667
1122
1123         Reviewed by Sam Weinig.
1124
1125         The CSS specification swapped the order of the initial-letters numeric values.
1126         The drop cap's height now comes first, followed by its optional vertical position.
1127         See http://www.w3.org/TR/css-inline/#sizing-drop-initials.
1128          
1129         No new tests. Existing tests updated.
1130
1131         * css/CSSParser.cpp:
1132         (WebCore::CSSParser::parseValue): swap arguments to reflect new spec order.
1133
1134 2015-06-16  Alex Christensen  <achristensen@webkit.org>
1135
1136         Remove some unused values.
1137         https://bugs.webkit.org/show_bug.cgi?id=145997
1138
1139         Reviewed by Gyuyoung Kim.
1140
1141         This patch should have no change in behavior.
1142
1143         * accessibility/AccessibilityObject.cpp:
1144         (WebCore::computeBestScrollOffset):
1145         (WebCore::AccessibilityObject::scrollToMakeVisibleWithSubFocus):
1146         (WebCore::AccessibilityObject::scrollToGlobalPoint):
1147         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1148         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1149         * html/canvas/WebGL2RenderingContext.cpp:
1150         (WebCore::WebGL2RenderingContext::validateTexFuncData):
1151         * html/canvas/WebGLRenderingContext.cpp:
1152         (WebCore::WebGLRenderingContext::validateTexFuncData):
1153         * platform/graphics/StringTruncator.cpp:
1154         (WebCore::leftTruncateToBuffer):
1155         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1156         (WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
1157         * rendering/InlineTextBox.cpp:
1158         (WebCore::InlineTextBox::localSelectionRect):
1159         * rendering/RenderElement.cpp:
1160         (WebCore::RenderElement::anchorRect):
1161         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1162         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
1163         * rendering/svg/SVGTextQuery.cpp:
1164         (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures):
1165         Remove unused values.
1166
1167 2015-06-16  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
1168
1169         [Streams API] Calling controller.error() should trigger storing an undefined error
1170         https://bugs.webkit.org/show_bug.cgi?id=145976
1171
1172         Reviewed by Darin Adler.
1173
1174         Covered by rebased test.
1175
1176         * bindings/js/JSReadableStreamControllerCustom.cpp:
1177         (WebCore::JSReadableStreamController::error): Storing undefined if no error value passed.
1178         * bindings/js/ReadableJSStream.cpp: Removed storeError(ExecState*).
1179         (WebCore::ReadableJSStream::ReadableJSStream):
1180
1181 2015-06-16  Chris Dumez  <cdumez@apple.com>
1182
1183         Purge StyledElement's presentation attribute cache on memory pressure
1184         https://bugs.webkit.org/show_bug.cgi?id=145999
1185         <rdar://problem/21359252>
1186
1187         Reviewed by Andreas Kling.
1188
1189         Purge StyledElement's presentation attribute cache on memory pressure.
1190
1191         * dom/StyledElement.cpp:
1192         (WebCore::presentationAttributeCache):
1193         (WebCore::presentationAttributeCacheCleaner):
1194         (WebCore::StyledElement::clearPresentationAttributeCache):
1195         * dom/StyledElement.h:
1196         * platform/MemoryPressureHandler.cpp:
1197         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
1198
1199 2015-06-15  Brent Fulgham  <bfulgham@apple.com>
1200
1201         REGRESSION(r175251, Mavericks Only): Playback may stall
1202         https://bugs.webkit.org/show_bug.cgi?id=145989
1203         <rdar://problem/21271919>
1204
1205         Unreviewed post-review correction.
1206
1207         Dave Kilzer pointed out that the macro around the waitForVideoOutputMediaDataWillChange
1208         call was incorrect. This patch corrects this error.
1209
1210         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1211         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Correct the
1212         macro definition.
1213
1214 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
1215
1216         AX: Changing state of radio buttons causes VoiceOver to go busy for a short time.
1217         https://bugs.webkit.org/show_bug.cgi?id=145933
1218
1219         Reviewed by Dean Jackson.
1220
1221         When radio buttons animate the new focus selection state, the thread activity looks a lot like short burst of
1222         activity to draw, then wait on CoreAnimation to apply those changes.
1223
1224         Since those periods of activity during animation are so short, VoiceOver is not able to query for all the
1225         attributes it needs, and gets stuck in the queue behind rendering.
1226
1227         The fix here is to turn off button state animations while VoiceOver is running.
1228
1229         * platform/mac/ThemeMac.mm:
1230         (WebCore::updateStates):
1231
1232 2015-06-15  Zalan Bujtas  <zalan@apple.com>
1233
1234         RootInlineBox::m_lineBreakObj becomes invalid when a child renderer is removed and the line does not get marked dirty.
1235         https://bugs.webkit.org/show_bug.cgi?id=145988
1236         rdar://problem/20959137
1237
1238         Reviewed by David Hyatt.
1239
1240         This patch ensures that we find the right first inline box so that we can dirty the
1241         the appropriate line boxes.
1242         With marking the right line boxes dirty, now we can update RootInlineBox::m_lineBreakObj at the next layout.
1243
1244         Test: fast/inline/crash-when-child-renderer-is-removed-and-line-stays-clean.html
1245
1246         * rendering/RenderInline.cpp:
1247         (WebCore::RenderInline::culledInlineFirstLineBox):
1248         (WebCore::RenderInline::culledInlineLastLineBox):
1249         * rendering/RootInlineBox.cpp:
1250         (WebCore::RootInlineBox::setLineBreakInfo): Deleted. Remove misleading assert and comment.
1251
1252 2015-06-15  Matt Rajca  <mrajca@apple.com>
1253
1254         Media Session: Improve the safety of playback toggling
1255         https://bugs.webkit.org/show_bug.cgi?id=145986
1256
1257         Reviewed by Darin Adler.
1258
1259         * Modules/mediasession/MediaSession.cpp:
1260         (WebCore::MediaSession::togglePlayback): Improved the safety of the loop so that we don't re-visit elements that
1261           may have been deleted underneath us.
1262         * Modules/mediasession/MediaSession.h: Added a pointer to the set of iterated active participating elements so
1263           we can remove any elements that are deleted from the underlying "real" set.
1264
1265 2015-06-15  Brent Fulgham  <bfulgham@apple.com>
1266
1267         REGRESSION(r175251, Mavericks Only): Playback may stall
1268         https://bugs.webkit.org/show_bug.cgi?id=145989
1269         <rdar://problem/21271919>
1270
1271         Reviewed by Dean Jackson.
1272
1273         Revert r175251 for Mavericks build targets.
1274
1275         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1276         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
1277         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
1278         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
1279
1280 2015-06-15  Darin Adler  <darin@apple.com>
1281
1282         REGRESSION (r182215): Reproducible crash at drawsvg.org due to reentrant layout
1283         https://bugs.webkit.org/show_bug.cgi?id=145964
1284
1285         Reviewed by Simon Fraser.
1286
1287         Test: svg/as-object/mutate-on-load.html
1288
1289         * page/FrameView.cpp:
1290         (WebCore::FrameView::forceLayoutParentViewIfNeeded): Don't do a synchronous layout here,
1291         because it can lead indirectly to unwanted layout reentrancy. Instead schedule a layout.
1292
1293 2015-06-15  Matt Rajca  <mrajca@apple.com>
1294
1295         Media Session: Active participating elements can change while being iterated 
1296         https://bugs.webkit.org/show_bug.cgi?id=145978
1297
1298         Reviewed by Alex Christensen.
1299
1300         * Modules/mediasession/MediaSession.cpp:
1301         (WebCore::MediaSession::togglePlayback): Iterate through a copy of m_activeParticipatingElements since its contents
1302           can be modified in the loop.
1303
1304 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
1305
1306         AX: no accessibility support for details element
1307         https://bugs.webkit.org/show_bug.cgi?id=131111
1308
1309         Reviewed by Darin Adler.
1310
1311         Add accessibility support for Mac for details element by:
1312            1) Returning new subroles for <details> and <summary>
1313            2) Exposing isExpanded property for <details> element.
1314
1315         Test: platform/mac/accessibility/details-summary.html
1316
1317         * accessibility/AccessibilityObject.cpp:
1318         (WebCore::AccessibilityObject::supportsARIAPressed):
1319         (WebCore::AccessibilityObject::supportsExpanded):
1320         (WebCore::AccessibilityObject::isExpanded):
1321         (WebCore::AccessibilityObject::supportsARIAExpanded): Deleted.
1322         * accessibility/AccessibilityObject.h:
1323         (WebCore::AccessibilityObject::canvasHasFallbackContent):
1324         * accessibility/AccessibilityRenderObject.cpp:
1325         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1326         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1327         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1328         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
1329         (-[WebAccessibilityObjectWrapper accessibilityIsExpanded]):
1330         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1331         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1332         (createAccessibilityRoleMap):
1333         (-[WebAccessibilityObjectWrapper subrole]):
1334         * html/HTMLDetailsElement.h:
1335         * inspector/InspectorDOMAgent.cpp:
1336         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1337
1338 2015-06-15  Alex Christensen  <achristensen@webkit.org>
1339
1340         [Content Extensions] Limit number of rules.
1341         https://bugs.webkit.org/show_bug.cgi?id=145663
1342
1343         Reviewed by Benjamin Poulain.
1344
1345         Added an API test to make sure that parsing fails when there are too many rules.
1346
1347         * contentextensions/ContentExtensionError.cpp:
1348         (WebCore::ContentExtensions::contentExtensionErrorCategory):
1349         * contentextensions/ContentExtensionError.h:
1350         * contentextensions/ContentExtensionParser.cpp:
1351         (WebCore::ContentExtensions::loadEncodedRules):
1352         Fail to parse a content extension with more than 50000 rules.
1353
1354 2015-06-12  Alexey Proskuryakov  <ap@apple.com>
1355
1356         -[WKWebView evaluateJavaScript] provides a misleading error when the return cannot be serialized
1357         https://bugs.webkit.org/show_bug.cgi?id=145900
1358
1359         Reviewed by Sam Weinig.
1360
1361         * English.lproj/Localizable.strings:
1362
1363 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1364
1365         [SOUP] Custom URI schemes don't work for requests containing a fragment identifier
1366         https://bugs.webkit.org/show_bug.cgi?id=145969
1367
1368         Reviewed by Sergio Villar Senin.
1369
1370         For URIs like foo:bar#baz, what the custom protocol manager
1371         receives in the UI process is foo:bar, so the user can't handle fragments.
1372
1373         * platform/network/soup/ResourceRequestSoup.cpp:
1374         (WebCore::ResourceRequest::updateSoupRequest): If the SoupRequest
1375         is a WebKitSoupRequestGeneric, call
1376         webkitSoupRequestGenericSetRequest with the ResourceRequest.
1377         * platform/network/soup/WebKitSoupRequestGeneric.cpp:
1378         (webkitSoupRequestGenericSetRequest):
1379         (webkitSoupRequestGenericGetRequest):
1380         * platform/network/soup/WebKitSoupRequestGeneric.h:
1381
1382 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1383
1384         [SOUP] Move WebKitSoupRequestGeneric to platform layer
1385         https://bugs.webkit.org/show_bug.cgi?id=145968
1386
1387         Reviewed by Sergio Villar Senin.
1388
1389         * PlatformEfl.cmake:
1390         * PlatformGTK.cmake:
1391         * platform/network/soup/WebKitSoupRequestGeneric.cpp: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp.
1392         (webkitSoupRequestGenericFinalize):
1393         (webkit_soup_request_generic_init):
1394         (webkitSoupRequestGenericSendAsync):
1395         (webkitSoupRequestGenericSendFinish):
1396         (webkitSoupRequestGenericGetContentLength):
1397         (webkitSoupRequestGenericGetContentType):
1398         (webkit_soup_request_generic_class_init):
1399         (webkitSoupRequestGenericSetContentLength):
1400         (webkitSoupRequestGenericSetContentType):
1401         * platform/network/soup/WebKitSoupRequestGeneric.h: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.h.
1402         * platform/network/soup/WebKitSoupRequestGenericClient.h: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGenericClient.h.
1403
1404 2015-06-13  Chris Dumez  <cdumez@apple.com>
1405
1406         [WK2] API::Navigation objects are leaked on history navigation to HistoryItems in PageCache
1407         https://bugs.webkit.org/show_bug.cgi?id=145948
1408
1409         Reviewed by Darin Adler.
1410
1411         API::Navigation objects were leaked on history navigation to
1412         HistoryItems in PageCache. In such case, we would create 2 Navigation
1413         objects instead of 1 and the first one would be leaked. The reason
1414         we create the second one is because we fail to pass along the
1415         navigationID from the UIProcess to the WebProcess and then back to the
1416         UIProcess. On the IPC back to the UIProcess, the navigationID ends up
1417         being 0 so the UIProcess creates a new Navigation object, thinking that
1418         the load was triggered by the WebContent process.
1419
1420         We now pass along the navigationID, even if the HistoryItem is in the
1421         PageCache and we end up reusing the cached DocumentLoader, instead of
1422         creating a new one. A new updateCachedDocumentLoader() delegate is
1423         added to the FrameLoaderClient, similarly to the pre-existing
1424         createDocumentLoader() but for the case where the DocumentLoader gets
1425         reused.
1426
1427         * loader/EmptyClients.h:
1428         * loader/FrameLoader.cpp:
1429         (WebCore::FrameLoader::loadDifferentDocumentItem):
1430         * loader/FrameLoaderClient.h:
1431
1432 2015-06-13  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1433
1434         [Streams API] ReadableJSStream should handle promises returned by JS source start callback
1435         https://bugs.webkit.org/show_bug.cgi?id=145792
1436
1437         Reviewed by Darin Adler.
1438
1439         Covered by rebased tests.
1440
1441         When calling start callback, the returned value is checked.
1442         If it is not a promise, we do as if it is a resolved promise.
1443         If it is a promise, we call its then() method with two resolve/reject JS functions.
1444
1445         * Modules/streams/ReadableStream.cpp:
1446         * bindings/js/ReadableJSStream.cpp:
1447         (WebCore::ReadableJSStream::invoke): Returns a JSPromise* if any is returned by the JS source callback.
1448         (WebCore::thenPromise): Utility method to call the promise.
1449         (WebCore::createStartResultFulfilledFunction): The promise resolve callback.
1450         (WebCore::ReadableJSStream::doStart): Calls thenPromise if a JSPromise* is returned by invoke.
1451         (WebCore::ReadableJSStream::ReadableJSStream):
1452         * bindings/js/ReadableJSStream.h:
1453
1454 2015-06-13  Andres Gonzalez  <agonzalez334@nc.rr.com>
1455
1456         AX: WebKit exposes all Ruby Text as Unknown (Japanese EPUB accessibility blocker)
1457         https://bugs.webkit.org/show_bug.cgi?id=141303
1458
1459         Reviewed by Chris Fleizach.
1460
1461         Test: accessibility/ruby-hierarchy-roles.html
1462
1463         * accessibility/AccessibilityObject.h:
1464         * accessibility/AccessibilityRenderObject.cpp:
1465         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1466         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1467         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1468         (createAccessibilityRoleMap):
1469         (-[WebAccessibilityObjectWrapper subrole]):
1470
1471 2015-06-12  Chris Fleizach  <cfleizach@apple.com>
1472
1473         AX: iOS: after updating control, VoiceOver speaks aria-expanded states reversed (says "collapsed" when "expanded")
1474         https://bugs.webkit.org/show_bug.cgi?id=145943
1475
1476         Reviewed by Darin Adler.
1477
1478         iOS Accessibility platform needs to be notified of when aria expanded changes.
1479
1480         * accessibility/ios/AXObjectCacheIOS.mm:
1481         (WebCore::AXObjectCache::postPlatformNotification):
1482         * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
1483         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1484         (-[WebAccessibilityObjectWrapper postValueChangedNotification]):
1485         (-[WebAccessibilityObjectWrapper postExpandedChangedNotification]):
1486         (-[WebAccessibilityObjectWrapper postScrollStatusChangeNotification]):
1487
1488 2015-06-12  Chris Fleizach  <cfleizach@apple.com>
1489
1490         AX:ARIA Toggle buttons aren't properly conveyed on iOS using VoiceOver
1491         https://bugs.webkit.org/show_bug.cgi?id=145949
1492
1493         Reviewed by Darin Adler.
1494
1495         Expose pressed state information to the iOS platform AX API.
1496
1497         Test: Updated inspector-protocol/dom/getAccessibilityPropertiesForNode.html 
1498               There was a FIXME for this issue in that test: https://bugs.webkit.org/show_bug.cgi?id=129830
1499
1500         * accessibility/AccessibilityNodeObject.cpp:
1501         (WebCore::AccessibilityNodeObject::isPressed):
1502         * accessibility/AccessibilityObject.cpp:
1503         (WebCore::AccessibilityObject::classList):
1504         (WebCore::AccessibilityObject::supportsARIAPressed):
1505         (WebCore::AccessibilityObject::supportsARIAExpanded):
1506         * accessibility/AccessibilityObject.h:
1507         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1508         (-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionIsAtomic]):
1509         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAPressed]):
1510         (-[WebAccessibilityObjectWrapper accessibilityIsPressed]):
1511         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
1512
1513 2015-06-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1514
1515         Purge PassRefPtr in JavaScriptCore - 2
1516         https://bugs.webkit.org/show_bug.cgi?id=145834
1517
1518         Reviewed by Darin Adler.
1519
1520         Fix call sites depends on changing of JSC.
1521
1522         * html/canvas/WebGL2RenderingContext.cpp:
1523         (WebCore::WebGL2RenderingContext::getParameter):
1524         * html/canvas/WebGLRenderingContext.cpp:
1525         (WebCore::WebGLRenderingContext::getParameter):
1526         * html/canvas/WebGLRenderingContextBase.cpp:
1527         (WebCore::WebGLRenderingContextBase::getUniform):
1528         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
1529         (WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter):
1530         (WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter):
1531
1532 2015-06-12  Zalan Bujtas  <zalan@apple.com>
1533
1534         Be more defensive at renderer type checking when initializing flow segments.
1535         https://bugs.webkit.org/show_bug.cgi?id=145942
1536
1537         Reviewed by Simon Fraser.
1538
1539         FlowContents::initializeSegments should ignore unsupported renderers so that when we miss
1540         a simple line layout path invalidation, we don't downcast the unsupported renderer to RenderText.
1541
1542         I have not reproduced this issue (but related to rdar://problem/21312452)
1543
1544         * rendering/SimpleLineLayoutFlowContents.cpp:
1545         (WebCore::SimpleLineLayout::initializeSegments):
1546
1547 2015-06-12  Anders Carlsson  <andersca@apple.com>
1548
1549         deleteEmptyDirectory should delete .DS_Store files on OS X
1550         https://bugs.webkit.org/show_bug.cgi?id=145944
1551
1552         Reviewed by Dan Bernstein.
1553
1554         deleteEmptyDirectory is often used when clearing website data, so we should
1555         take extra care to delete empty directories so the user won't think that clearing
1556         website data didn't do anything because it would leave directories with .DS_Store 
1557         files behind.
1558
1559         * platform/mac/FileSystemMac.mm:
1560         (WebCore::deleteEmptyDirectory):
1561         * platform/posix/FileSystemPOSIX.cpp:
1562
1563 2015-06-12  Manuel Rego Casasnovas  <rego@igalia.com>
1564
1565         [CSS Grid Layout] Fix grid-template-areas parsing to avoid spaces
1566         https://bugs.webkit.org/show_bug.cgi?id=145860
1567
1568         Reviewed by Sergio Villar Senin.
1569
1570         The spec doesn't require to have spaces between unnamed and named areas
1571         in grid-template-areas syntax. But spaces are currently required in our
1572         code.
1573
1574         This was confirmed in the CSS WG mailing list:
1575         https://lists.w3.org/Archives/Public/www-style/2015May/0239.html
1576
1577         This patch updates grid-template-areas parsing to allow the possibility
1578         of removing spaces between unnamed and named areas.
1579
1580         Added new cases to fast/css-grid-layout/grid-template-areas-get-set.html.
1581
1582         * css/CSSParser.cpp:
1583         (WebCore::parseGridTemplateAreasColumnNames): New helper method to
1584         determine the column names split by white spaces or dots.
1585         (WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
1586         method to get the column names.
1587         (WebCore::containsOnlyDots): Deleted. Not needed anymore as
1588         parseGridTemplateAreasColumnNames() is using a single dot for unnamed
1589         grid areas (despite of being defined with 1 or more dots).
1590
1591 2015-06-12  Eric Carlson  <eric.carlson@apple.com>
1592
1593         [Mac] AirPlay menu button doesn't always show on page load
1594         https://bugs.webkit.org/show_bug.cgi?id=145936
1595
1596         Reviewed by Brent Fulgham.
1597
1598         * Modules/mediasession/WebMediaSessionManager.cpp:
1599         (WebCore::mediaProducerStateString): New, return a string representing MediaStateFlags.
1600         (WebCore::WebMediaSessionManager::clientStateDidChange): Log the states as strings.
1601         (WebCore::WebMediaSessionManager::toString): New, return a string representing ConfigurationTasks.
1602         (WebCore::WebMediaSessionManager::scheduleDelayedTask): Add logging.
1603         (WebCore::WebMediaSessionManager::taskTimerFired): Add logging.
1604         * Modules/mediasession/WebMediaSessionManager.h:
1605
1606         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: Override wirelessVideoPlaybackDisabled
1607           so it is possible to activate route monitoring for a movie loaded with this engine.
1608         * platform/graphics/mac/MediaPlayerPrivateQTKit.h: Ditto.
1609
1610 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
1611
1612         Add the remaining missing override specifiers under Source/WebCore/
1613         https://bugs.webkit.org/show_bug.cgi?id=145907
1614
1615         Reviewed by Darin Adler.
1616
1617         Fix the remaining compiler warnings about missing override specifiers
1618         for overriding method declarations in classes under Source/WebCore/.
1619
1620         Where the addition had to be performed on all virtual methods of the
1621         class, the virtual specifier was removed so now only the override
1622         specifier is in use.
1623
1624         * Modules/indexeddb/IDBOpenDBRequest.h:
1625         * Modules/indexeddb/IDBRequest.h:
1626         * Modules/webdatabase/DatabaseServer.h:
1627         * bindings/js/ReadableJSStream.h:
1628         * editing/InsertTextCommand.h:
1629         * mathml/MathMLInlineContainerElement.h:
1630         * platform/audio/EqualPowerPanner.h:
1631         (WebCore::EqualPowerPanner::reset):
1632         * platform/graphics/MediaPlayer.cpp:
1633         (WebCore::NullMediaPlayerPrivate::load):
1634         (WebCore::NullMediaPlayerPrivate::cancelLoad):
1635         (WebCore::NullMediaPlayerPrivate::prepareToPlay):
1636         (WebCore::NullMediaPlayerPrivate::play):
1637         (WebCore::NullMediaPlayerPrivate::pause):
1638         (WebCore::NullMediaPlayerPrivate::platformMedia):
1639         (WebCore::NullMediaPlayerPrivate::platformLayer):
1640         (WebCore::NullMediaPlayerPrivate::naturalSize):
1641         (WebCore::NullMediaPlayerPrivate::hasVideo):
1642         (WebCore::NullMediaPlayerPrivate::hasAudio):
1643         (WebCore::NullMediaPlayerPrivate::setVisible):
1644         (WebCore::NullMediaPlayerPrivate::durationDouble):
1645         (WebCore::NullMediaPlayerPrivate::currentTimeDouble):
1646         (WebCore::NullMediaPlayerPrivate::seekDouble):
1647         (WebCore::NullMediaPlayerPrivate::seeking):
1648         (WebCore::NullMediaPlayerPrivate::setRateDouble):
1649         (WebCore::NullMediaPlayerPrivate::setPreservesPitch):
1650         (WebCore::NullMediaPlayerPrivate::paused):
1651         (WebCore::NullMediaPlayerPrivate::setVolumeDouble):
1652         (WebCore::NullMediaPlayerPrivate::supportsMuting):
1653         (WebCore::NullMediaPlayerPrivate::setMuted):
1654         (WebCore::NullMediaPlayerPrivate::hasClosedCaptions):
1655         (WebCore::NullMediaPlayerPrivate::setClosedCaptionsVisible):
1656         (WebCore::NullMediaPlayerPrivate::networkState):
1657         (WebCore::NullMediaPlayerPrivate::readyState):
1658         (WebCore::NullMediaPlayerPrivate::maxTimeSeekableDouble):
1659         (WebCore::NullMediaPlayerPrivate::minTimeSeekable):
1660         (WebCore::NullMediaPlayerPrivate::buffered):
1661         (WebCore::NullMediaPlayerPrivate::totalBytes):
1662         (WebCore::NullMediaPlayerPrivate::didLoadingProgress):
1663         (WebCore::NullMediaPlayerPrivate::setSize):
1664         (WebCore::NullMediaPlayerPrivate::canLoadPoster):
1665         (WebCore::NullMediaPlayerPrivate::setPoster):
1666         (WebCore::NullMediaPlayerPrivate::hasSingleSecurityOrigin):
1667         * platform/graphics/filters/DistantLightSource.h:
1668         * platform/graphics/filters/FEComposite.h:
1669         * platform/graphics/filters/FEDisplacementMap.h:
1670         (WebCore::FEDisplacementMap::determineAbsolutePaintRect):
1671         * platform/graphics/filters/FEFlood.h:
1672         (WebCore::FEFlood::determineAbsolutePaintRect):
1673         * platform/graphics/filters/PointLightSource.h:
1674         * platform/graphics/filters/SpotLightSource.h:
1675         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1676         (WebCore::MediaPlayerPrivateGStreamer::hasVideo):
1677         (WebCore::MediaPlayerPrivateGStreamer::hasAudio):
1678         (WebCore::MediaPlayerPrivateGStreamer::audioSourceProvider):
1679         (WebCore::MediaPlayerPrivateGStreamer::engineDescription):
1680         (WebCore::MediaPlayerPrivateGStreamer::isLiveStream):
1681         (WebCore::MediaPlayerPrivateGStreamer::totalVideoFrames):
1682         (WebCore::MediaPlayerPrivateGStreamer::droppedVideoFrames):
1683         (WebCore::MediaPlayerPrivateGStreamer::corruptedVideoFrames):
1684         (WebCore::MediaPlayerPrivateGStreamer::totalFrameDelay):
1685         * platform/graphics/texmap/BitmapTextureGL.h:
1686         (WebCore::BitmapTextureGL::isBackedByOpenGL):
1687         * platform/graphics/transforms/Matrix3DTransformOperation.h:
1688         * platform/graphics/transforms/MatrixTransformOperation.h:
1689         * platform/graphics/transforms/PerspectiveTransformOperation.h:
1690         * platform/graphics/transforms/RotateTransformOperation.h:
1691         * platform/graphics/transforms/ScaleTransformOperation.h:
1692         * platform/graphics/transforms/SkewTransformOperation.h:
1693         * platform/image-decoders/png/PNGImageDecoder.h:
1694         (WebCore::PNGImageDecoder::filenameExtension):
1695         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
1696         * platform/mock/MockRealtimeMediaSourceCenter.h:
1697
1698 2015-06-12  Commit Queue  <commit-queue@webkit.org>
1699
1700         Unreviewed, rolling out r185512.
1701         https://bugs.webkit.org/show_bug.cgi?id=145932
1702
1703         Many asserts on layout tests and on API tests (Requested by
1704         ap_ on #webkit).
1705
1706         Reverted changeset:
1707
1708         "Use modern for-loops in WebCore/rendering - 1"
1709         https://bugs.webkit.org/show_bug.cgi?id=145831
1710         http://trac.webkit.org/changeset/185512
1711
1712 2015-06-12  Simon Fraser  <simon.fraser@apple.com>
1713
1714         OpenGLESSPI.h doesn't need to include UIKit.h
1715         https://bugs.webkit.org/show_bug.cgi?id=145931
1716
1717         Reviewed by Darin Adler.
1718
1719         No need to suck in all of UIKit from OpenGLESSPI.h.
1720
1721         * platform/spi/ios/OpenGLESSPI.h:
1722
1723 2015-06-12  Matt Rajca  <mrajca@apple.com>
1724
1725         Add barebones implementation of media session invocation algorithm.
1726         https://bugs.webkit.org/show_bug.cgi?id=145847
1727
1728         Reviewed by Darin Adler.
1729
1730         * Modules/mediasession/MediaSession.cpp:
1731         (WebCore::MediaSession::invoke): Move the media session to an active state.
1732         * Modules/mediasession/MediaSession.h:
1733         * html/HTMLMediaElement.cpp:
1734         (WebCore::HTMLMediaElement::playInternal): Call the media session invocation algorithm as described in the
1735           Media Session spec.
1736
1737 2015-06-12  Hunseop Jeong  <hs85.jeong@samsung.com>
1738
1739         Use modern for-loops in WebCore/rendering - 1
1740         https://bugs.webkit.org/show_bug.cgi?id=145831
1741
1742         Reviewed by Darin Adler.
1743
1744         No new tests because there is no behavior change.
1745
1746         * rendering/AutoTableLayout.cpp:
1747         (WebCore::AutoTableLayout::computeIntrinsicLogicalWidths):
1748         (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
1749         * rendering/FilterEffectRenderer.cpp:
1750         (WebCore::FilterEffectRenderer::build):
1751         (WebCore::FilterEffectRenderer::clearIntermediateResults):
1752         * rendering/FilterEffectRenderer.h:
1753         * rendering/FloatingObjects.cpp:
1754         (WebCore::FloatingObjects::clearLineBoxTreePointers):
1755         (WebCore::FloatingObjects::moveAllToFloatInfoMap):
1756         (WebCore::FloatingObjects::computePlacedFloatsTree):
1757         * rendering/FlowThreadController.cpp:
1758         (WebCore::FlowThreadController::collectFixedPositionedLayers):
1759         * rendering/HitTestResult.cpp:
1760         (WebCore::HitTestResult::append):
1761         * rendering/ImageQualityController.cpp:
1762         (WebCore::ImageQualityController::highQualityRepaintTimerFired):
1763         * rendering/InlineTextBox.cpp:
1764         (WebCore::InlineTextBox::paint):
1765         * rendering/RenderBlock.cpp:
1766         (WebCore::removeBlockFromDescendantAndContainerMaps):
1767         (WebCore::RenderBlock::addOverflowFromPositionedObjects):
1768         (WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants):
1769         (WebCore::RenderBlock::simplifiedNormalFlowLayout):
1770         (WebCore::RenderBlock::layoutPositionedObjects):
1771         (WebCore::RenderBlock::markPositionedObjectsForLayout):
1772         (WebCore::RenderBlock::paintContinuationOutlines):
1773         (WebCore::clipOutPositionedObjects):
1774         (WebCore::RenderBlock::removeFromTrackedRendererMaps):
1775         (WebCore::RenderBlock::removePositionedObjects):
1776         (WebCore::RenderBlock::checkPositionedObjectsNeedLayout):
1777         * rendering/RenderBlockFlow.cpp:
1778         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
1779         (WebCore::RenderBlockFlow::styleDidChange):
1780         (WebCore::RenderBlockFlow::moveFloatsTo):
1781         (WebCore::RenderBlockFlow::addOverflowFromFloats):
1782         (WebCore::RenderBlockFlow::repaintOverhangingFloats):
1783         (WebCore::RenderBlockFlow::paintFloats):
1784         (WebCore::RenderBlockFlow::clipOutFloatingObjects):
1785         (WebCore::RenderBlockFlow::lowestFloatLogicalBottom):
1786         (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom):
1787         (WebCore::RenderBlockFlow::addOverhangingFloats):
1788         (WebCore::RenderBlockFlow::addIntrudingFloats):
1789         (WebCore::RenderBlockFlow::markSiblingsWithFloatsForLayout):
1790         (WebCore::RenderBlockFlow::adjustForBorderFit):
1791         * rendering/RenderBlockLineLayout.cpp:
1792         (WebCore::setLogicalWidthForTextRun):
1793         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1794         (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
1795         (WebCore::RenderBlockFlow::repaintDirtyFloats):
1796         (WebCore::RenderBlockFlow::layoutLineBoxes):
1797         (WebCore::RenderBlockFlow::checkFloatsInCleanLine):
1798         (WebCore::RenderBlockFlow::determineStartPosition):
1799         (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
1800         * rendering/RenderCounter.cpp:
1801         (WebCore::RenderCounter::destroyCounterNodes):
1802         (WebCore::updateCounters):
1803         (WebCore::RenderCounter::rendererStyleChanged):
1804         * rendering/RenderFlexibleBox.cpp:
1805         (WebCore::RenderFlexibleBox::autoMarginOffsetInMainAxis):
1806         (WebCore::RenderFlexibleBox::freezeViolations):
1807         (WebCore::RenderFlexibleBox::resolveFlexibleLengths):
1808         (WebCore::RenderFlexibleBox::numberOfInFlowPositionedChildren):
1809         (WebCore::RenderFlexibleBox::layoutColumnReverse):
1810         (WebCore::RenderFlexibleBox::alignFlexLines):
1811         (WebCore::RenderFlexibleBox::alignChildren):
1812         (WebCore::RenderFlexibleBox::flipForWrapReverse):
1813         * rendering/RenderFlowThread.cpp:
1814         (WebCore::RenderFlowThread::updateAllLayerToRegionMappings):
1815         * rendering/RenderInline.cpp:
1816         (WebCore::RenderInline::addAnnotatedRegions):
1817         * rendering/RenderLayer.cpp:
1818         (WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrder):
1819         (WebCore::RenderLayer::updateDescendantDependentFlags):
1820         * rendering/RenderLayerBacking.cpp:
1821         (WebCore::descendantLayerPaintsIntoAncestor):
1822         (WebCore::RenderLayerBacking::startAnimation):
1823         * rendering/RenderLineBoxList.cpp:
1824         (WebCore::RenderLineBoxList::paint):
1825         * rendering/RenderListBox.cpp:
1826         (WebCore::RenderListBox::updateFromElement):
1827         * rendering/RenderMenuList.cpp:
1828         (WebCore::selectedOptionCount):
1829         (RenderMenuList::updateOptionsWidth):
1830         * rendering/RenderMultiColumnSet.cpp:
1831         (WebCore::RenderMultiColumnSet::distributeImplicitBreaks):
1832
1833 2015-06-12  Csaba Osztrogonác  <ossy@webkit.org>
1834
1835         Fix unused private field warning in ResourceHandleSoup.cpp
1836         https://bugs.webkit.org/show_bug.cgi?id=145910
1837
1838         Reviewed by Darin Adler.
1839
1840         * platform/network/soup/ResourceHandleSoup.cpp:
1841
1842 2015-06-12  Joseph Pecoraro  <pecoraro@apple.com>
1843
1844         Web Inspector: CRASH trying to inspect text that was removed/replaced
1845         https://bugs.webkit.org/show_bug.cgi?id=145898
1846
1847         Reviewed by Darin Adler.
1848
1849         * inspector/InspectorDOMAgent.cpp:
1850         (WebCore::InspectorDOMAgent::inspect):
1851         (WebCore::InspectorDOMAgent::focusNode):
1852         Ensure we only cause focusNode with a node to focus. If the original
1853         node that was provided is no longer in the document, then we won't
1854         actually find a node to inspect.
1855
1856 2015-06-12  KwangHyuk Kim  <hyuki.kim@samsung.com>
1857
1858         [EFL] canvas/philip/tests/toDataURL.jpeg.foo tests have been failed since r185417.
1859         https://bugs.webkit.org/show_bug.cgi?id=145878
1860
1861         Reviewed by Gyuyoung Kim.
1862
1863         Fix input buffer alignment issue.
1864
1865         No new tests, canvas/philip/tests/toDataURL.jpeg.foo can be used.
1866
1867         * platform/graphics/efl/ImageBufferEfl.cpp:
1868         (WebCore::encodeImagePNG):
1869         (WebCore::encodeImageJPEG):
1870         (WebCore::ImageBuffer::toDataURL):
1871
1872 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
1873
1874         Add missing override specifiers under Source/WebCore/svg/
1875         https://bugs.webkit.org/show_bug.cgi?id=145841
1876
1877         Reviewed by Darin Adler.
1878
1879         Add missing override specifiers to virtual method overrides for classes
1880         under Source/WebCore/svg/, suppressing a bunch of warnings when compiling
1881         with Clang 3.6.
1882
1883         Add the BEGIN_DECLARE_ANIMATED_PROPERTIES_BASE() macro that doesn't
1884         override the localAttributeToPropertyMap() method declaration, and
1885         have the BEGIN_DECLARE_ANIMATED_PROPERTIES() macro add the override
1886         specifier. The new macro is used in SVGElement.
1887
1888         Change the DECLARE_ANIMATED_PROPERTY() to accept the optional override
1889         specifier as the fifth parameter. Current DECLARE_ANIMATED_*() macros
1890         are modified to just pass an empty argument, not adding any specifier.
1891         DECLARE_ANIMATED_BOOLEAN_OVERRIDE() and DECLARE_ANIMATED_STRING_OVERRIDE()
1892         macros are added to override the methods for the externalResourcesRequired
1893         and href animated properties, where required.
1894
1895         * svg/SVGAElement.h:
1896         * svg/SVGAltGlyphElement.h:
1897         * svg/SVGAnimatedAngle.h:
1898         * svg/SVGAnimatedBoolean.h:
1899         * svg/SVGAnimatedEnumeration.h:
1900         * svg/SVGAnimatedInteger.h:
1901         * svg/SVGAnimatedLength.h:
1902         * svg/SVGAnimatedNumber.h:
1903         * svg/SVGAnimatedPreserveAspectRatio.h:
1904         * svg/SVGAnimatedRect.h:
1905         * svg/SVGAnimatedString.h:
1906         * svg/SVGAnimationElement.h:
1907         * svg/SVGCircleElement.h:
1908         * svg/SVGClipPathElement.h:
1909         * svg/SVGCursorElement.h:
1910         * svg/SVGDefsElement.h:
1911         * svg/SVGElement.h:
1912         * svg/SVGEllipseElement.h:
1913         * svg/SVGFEImageElement.h:
1914         * svg/SVGFilterElement.h:
1915         * svg/SVGFontElement.h:
1916         * svg/SVGForeignObjectElement.h:
1917         * svg/SVGGElement.h:
1918         * svg/SVGGlyphRefElement.h:
1919         * svg/SVGGradientElement.h:
1920         * svg/SVGImageElement.h:
1921         * svg/SVGLineElement.h:
1922         * svg/SVGMPathElement.h:
1923         * svg/SVGMarkerElement.h:
1924         * svg/SVGMaskElement.h:
1925         * svg/SVGPathElement.h:
1926         * svg/SVGPatternElement.h:
1927         * svg/SVGPolyElement.h:
1928         * svg/SVGRectElement.h:
1929         * svg/SVGSVGElement.h:
1930         * svg/SVGScriptElement.h:
1931         * svg/SVGSwitchElement.h:
1932         * svg/SVGSymbolElement.h:
1933         * svg/SVGTRefElement.h:
1934         * svg/SVGTextContentElement.h:
1935         * svg/SVGTextPathElement.h:
1936         * svg/SVGURIReference.h: Add the hrefBaseValue() pure virtual method
1937         so it can be overridden by any class that also overrides the
1938         corresponding setHrefBaseValue() method.
1939         * svg/SVGUseElement.h:
1940         * svg/SVGViewElement.h:
1941         * svg/properties/SVGAnimatedPropertyMacros.h:
1942         * svg/properties/SVGMatrixTearOff.h:
1943         (WebCore::SVGMatrixTearOff::commitChange):
1944
1945 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
1946
1947         [GLib] Move files under Source/WTF/wtf/gobject to Source/WTF/wtf/glib
1948         https://bugs.webkit.org/show_bug.cgi?id=145799
1949
1950         Reviewed by Carlos Garcia Campos.
1951
1952         Update header inclusions for headers that have been moved
1953         to Source/WTF/wtf/glib/.
1954
1955         * accessibility/atk/AXObjectCacheAtk.cpp:
1956         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1957         * bindings/gobject/DOMObjectCache.cpp:
1958         * bindings/gobject/GObjectEventListener.h:
1959         * bindings/gobject/GObjectNodeFilterCondition.h:
1960         * bindings/gobject/GObjectXPathNSResolver.h:
1961         * bindings/gobject/WebKitDOMEventTarget.cpp:
1962         * platform/Pasteboard.h:
1963         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
1964         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
1965         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
1966         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
1967         * platform/audio/gtk/AudioBusGtk.cpp:
1968         * platform/geoclue/GeolocationProviderGeoclue.h:
1969         * platform/geoclue/GeolocationProviderGeoclue2.cpp:
1970         * platform/glib/BatteryProviderUPower.cpp:
1971         * platform/glib/BatteryProviderUPower.h:
1972         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
1973         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
1974         * platform/graphics/gstreamer/GUniquePtrGStreamer.h:
1975         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
1976         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1977         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1978         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1979         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1980         * platform/graphics/gstreamer/MediaSourceGStreamer.cpp:
1981         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
1982         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
1983         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1984         * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp:
1985         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1986         * platform/graphics/gtk/ImageBufferGtk.cpp:
1987         * platform/graphics/gtk/ImageGtk.cpp:
1988         * platform/gtk/ContextMenuGtk.cpp:
1989         * platform/gtk/ContextMenuItemGtk.cpp:
1990         * platform/gtk/DataObjectGtk.cpp:
1991         * platform/gtk/DataObjectGtk.h:
1992         * platform/gtk/FileSystemGtk.cpp:
1993         * platform/gtk/GRefPtrGtk.h:
1994         * platform/gtk/GUniquePtrGtk.h:
1995         * platform/gtk/GamepadsGtk.cpp:
1996         * platform/gtk/GtkUtilities.cpp:
1997         * platform/gtk/LanguageGtk.cpp:
1998         * platform/gtk/LocalizedStringsGtk.cpp:
1999         * platform/gtk/PasteboardHelper.cpp:
2000         * platform/gtk/ScrollbarThemeGtk.cpp:
2001         * platform/gtk/SharedBufferGtk.cpp:
2002         * platform/gtk/SharedTimerGtk.cpp:
2003         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
2004         * platform/network/ResourceHandleInternal.h:
2005         * platform/network/gtk/CredentialBackingStore.cpp:
2006         * platform/network/soup/CertificateInfo.h:
2007         * platform/network/soup/CookieJarSoup.cpp:
2008         * platform/network/soup/DNSSoup.cpp:
2009         * platform/network/soup/GRefPtrSoup.h:
2010         * platform/network/soup/GUniquePtrSoup.h:
2011         * platform/network/soup/ResourceError.h:
2012         * platform/network/soup/ResourceErrorSoup.cpp:
2013         * platform/network/soup/ResourceHandleSoup.cpp:
2014         * platform/network/soup/ResourceResponse.h:
2015         * platform/network/soup/SocketStreamHandle.h:
2016         * platform/network/soup/SocketStreamHandleSoup.cpp:
2017         * platform/network/soup/SoupNetworkSession.h:
2018         * platform/text/gtk/HyphenationLibHyphen.cpp:
2019         * rendering/RenderThemeGtk.cpp:
2020
2021 2015-06-12  Yoav Weiss  <yoav@yoav.ws>
2022
2023         Fix the build when the PICTURE_SIZES flag is off
2024         https://bugs.webkit.org/show_bug.cgi?id=145926
2025
2026         Reviewed by Csaba Osztrogonác.
2027
2028         No new tests since there's no functionality change.
2029
2030         * html/parser/HTMLPreloadScanner.cpp: Remove the guard around the definition of m_sizesAttribute.
2031
2032 2015-06-12  Commit Queue  <commit-queue@webkit.org>
2033
2034         Unreviewed, rolling out r185492.
2035         https://bugs.webkit.org/show_bug.cgi?id=145927
2036
2037         Causes crashes on debug (Requested by rego on #webkit).
2038
2039         Reverted changeset:
2040
2041         "[CSS Grid Layout] Fix grid-template-areas parsing to avoid
2042         spaces"
2043         https://bugs.webkit.org/show_bug.cgi?id=145860
2044         http://trac.webkit.org/changeset/185492
2045
2046 2015-06-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2047
2048         Bindings generator should generate code for Promise-based APIs
2049         https://bugs.webkit.org/show_bug.cgi?id=145833
2050
2051         Reviewed by Darin Adler.
2052
2053         Covered by existing tests.
2054
2055         * Modules/webaudio/AudioContext.idl: Removing custom binding for resume, suspend and close.
2056         * bindings/js/JSAudioContextCustom.cpp: Ditto.
2057         * bindings/scripts/CodeGeneratorJS.pm:
2058         (GenerateHeader): Refactoring to use IsReturningPromise.
2059         (GenerateImplementation): Disabling include for return type if it is a promise.
2060         (GenerateParametersCheck): Adding DeferredWrapper() as argument to the DOM method if JS method returns a promise.
2061         (GenerateImplementationFunctionCall): Added support for promise-returning API.
2062         (IsReturningPromise): Checking whether function is returning a promise.
2063         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2064         (webkit_dom_test_obj_test_promise_function):
2065         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2066         * bindings/scripts/test/JS/JSTestObj.cpp:
2067         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
2068         * bindings/scripts/test/ObjC/DOMTestObj.h:
2069         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2070         (-[DOMTestObj testPromiseFunction]):
2071         * bindings/scripts/test/TestObj.idl: Adding promise returning function.
2072
2073
2074 2015-06-12  Manuel Rego Casasnovas  <rego@igalia.com>
2075
2076         [CSS Grid Layout] Fix grid-template-areas parsing to avoid spaces
2077         https://bugs.webkit.org/show_bug.cgi?id=145860
2078
2079         Reviewed by Sergio Villar Senin.
2080
2081         The spec doesn't require to have spaces between unnamed and named areas
2082         in grid-template-areas syntax. But spaces are currently required in our
2083         code.
2084
2085         This was confirmed in the CSS WG mailing list:
2086         https://lists.w3.org/Archives/Public/www-style/2015May/0239.html
2087
2088         This patch updates grid-template-areas parsing to allow the possibility
2089         of removing spaces between unnamed and named areas.
2090
2091         Added new cases to fast/css-grid-layout/grid-template-areas-get-set.html.
2092
2093         * css/CSSParser.cpp:
2094         (WebCore::parseGridTemplateAreasColumnNames): New helper method to
2095         determine the column names split by white spaces or dots.
2096         (WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
2097         method to get the column names.
2098         (WebCore::containsOnlyDots): Deleted. Not needed anymore as
2099         parseGridTemplateAreasColumnNames() is using a single dot for unnamed
2100         grid areas (despite of being defined with 1 or more dots).
2101
2102 2015-06-11  Mark Lam  <mark.lam@apple.com>
2103
2104         WebCore::reportException() needs to be able to accept a raw thrown value in addition to Exception objects.
2105         https://bugs.webkit.org/show_bug.cgi?id=145872
2106
2107         Reviewed by Michael Saboff.
2108
2109         API test added: WebKit1.ReportExceptionTest.
2110
2111         * bindings/js/JSDOMBinding.cpp:
2112         (WebCore::reportException):
2113         - Added a version of reportException() that takes a JSValue instead of an Exception
2114           object.  This version will ensure that we have an Exception object before calling
2115           into the original reportException() as follows:
2116
2117           1. If the JSValue is already an Exception object, we're good to go.
2118
2119           2. Else, if VM::lastException() is available, use that as the exception.
2120              This is how the old code use to behave (in terms of where it gets the exception
2121              stack trace).  The assumption is that reportException() will be called in
2122              a timely manner before the exception stack trace has been purged.
2123
2124           3. Else, create an Exception object with no stack trace.  This is the fall back
2125              in case the client did not call reportException() in a timely manner.
2126
2127         - Also clear the last exception after we've reported it.  This is how the old code
2128           before r185259 behave (in terms of the lifecycle of the last exception stack
2129           trace).  We're restoring that behavior here.
2130
2131         * bindings/js/JSDOMBinding.h:
2132
2133 2015-06-11  Zalan Bujtas  <zalan@apple.com>
2134
2135         Do not crash when the descendant frame tree is destroyed during layout.
2136         https://bugs.webkit.org/show_bug.cgi?id=144540
2137         rdar://problem/20793184
2138
2139         Reviewed by Andreas Kling.
2140
2141         Widget::setFrameRect(), through WebHTMLView layout, could trigger a style recalc, which in turn
2142         could initiate an onBeforeLoad callback.
2143         If javascript happens to destroy the current iframe in the onBeforeLoad callback, we lose the descendant
2144         render tree, including the child FrameView (the iframe element's view). However the RenderIFrame
2145         object stays protected until after the layout is done. (see protectRenderWidgetUntilLayoutIsDone())
2146
2147         Climbing back on the callstack, we need to make sure that
2148         1. the root widget of the descendant render tree (FrameView) stays valid as long as it is needed.
2149         2. RenderFrameBase::layoutWithFlattening() can handle the case when the associated widget (child FrameView) is set to nullptr.
2150         (see RenderWidget::willBeDestroyed() -> setWidget(nullptr))
2151
2152         (and later, when layout is finished this (RenderIFrame) object gets destroyed too.)
2153
2154         Covered by fast/frames/flattening/crash-remove-iframe-during-object-beforeload.html.
2155
2156         * page/FrameView.cpp:
2157         (WebCore::FrameView::setFrameRect):
2158         (WebCore::FrameView::updateEmbeddedObject):
2159         (WebCore::FrameView::updateWidgetPositions):
2160         * platform/ScrollView.cpp:
2161         (WebCore::ScrollView::setFrameRect):
2162         * platform/mac/WidgetMac.mm:
2163         (WebCore::Widget::setFrameRect):
2164         * rendering/RenderFrameBase.cpp:
2165         (WebCore::RenderFrameBase::layoutWithFlattening):
2166         (WebCore::RenderFrameBase::childRenderView):
2167         (WebCore::RenderFrameBase::peformLayoutWithFlattening):
2168         * rendering/RenderFrameBase.h:
2169         * rendering/RenderWidget.cpp:
2170         (WebCore::RenderWidget::updateWidgetPosition):
2171         * rendering/RenderWidget.h:
2172
2173 2015-06-11  Commit Queue  <commit-queue@webkit.org>
2174
2175         Unreviewed, rolling out r185470.
2176         https://bugs.webkit.org/show_bug.cgi?id=145902
2177
2178         Caused ASan violations (Requested by ap on #webkit).
2179
2180         Reverted changeset:
2181
2182         "Add an appearance keyword for wireless playback / airplay
2183         icon"
2184         https://bugs.webkit.org/show_bug.cgi?id=145892
2185         http://trac.webkit.org/changeset/185470
2186
2187 2015-06-11  Brady Eidson  <beidson@apple.com>
2188
2189         IndexedDB onupgradeneeded event has incorrect value for oldVersion.
2190         <rdar://problem/18309792> and https://bugs.webkit.org/show_bug.cgi?id=136888
2191
2192         Reviewed by Sam Weinig.
2193
2194         Test: storage/indexeddb/version-change-event-basic.html
2195
2196         "NoIntVersion" is an internal bookkeeping concept that we never should've been passing to Javascript.
2197         
2198         This cleans up things by:
2199         - Adjusting an old version of "NoIntVersion" to "0" before making the version change callback.
2200         - Removing the VersionNullness parameter from almost everywhere.
2201         - Removing the nullability of the newVersion parameter from the IDL.
2202
2203         * Modules/indexeddb/IDBDatabase.cpp:
2204         (WebCore::IDBDatabase::onVersionChange):
2205         * Modules/indexeddb/IDBDatabase.h:
2206         
2207         * Modules/indexeddb/IDBDatabaseBackend.cpp:
2208         (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction):
2209         (WebCore::IDBDatabaseBackend::deleteDatabase):
2210         
2211         * Modules/indexeddb/IDBDatabaseCallbacks.h:
2212         * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
2213         (WebCore::IDBDatabaseCallbacksImpl::onVersionChange):
2214         * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
2215         
2216         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2217         (WebCore::IDBOpenDBRequest::onBlocked):
2218         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
2219         
2220         * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
2221         (WebCore::IDBDatabaseBackend::VersionChangeOperation::perform):
2222         
2223         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
2224         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
2225         * Modules/indexeddb/IDBVersionChangeEvent.h:
2226         (WebCore::IDBVersionChangeEvent::create):
2227         (WebCore::IDBVersionChangeEvent::newVersion):
2228         * Modules/indexeddb/IDBVersionChangeEvent.idl:
2229
2230 2015-06-11  Matt Rajca  <mrajca@apple.com>
2231
2232         Media Session: Add plumbing for media control event delivery.
2233         https://bugs.webkit.org/show_bug.cgi?id=145859
2234
2235         Reviewed by Anders Carlsson.
2236
2237         * Modules/mediasession/MediaEventTypes.h: Added.
2238         * WebCore.xcodeproj/project.pbxproj:
2239         * page/Page.cpp:
2240         (WebCore::Page::handleMediaEvent): Toggle media playback upon receiving the PlayPause event as described in the spec.
2241         * page/Page.h:
2242
2243 2015-06-11  Jon Lee  <jonlee@apple.com>
2244
2245         Update media controls JS and CSS to use picture-in-picture
2246         https://bugs.webkit.org/show_bug.cgi?id=145827
2247         <rdar://problem/21311576>
2248
2249         Reviewed by Dean Jackson.
2250
2251         * English.lproj/mediaControlsLocalizedStrings.js: Update localized strings.
2252         Add a string for the placeholder text, and for the aria-label of the
2253         placard.
2254
2255         * Modules/mediacontrols/MediaControlsHost.idl: Remove uncalled functions.
2256         * Modules/mediacontrols/MediaControlsHost.h: Also remove optimizedFullscreenSupported(),
2257         which was never used.
2258         * Modules/mediacontrols/MediaControlsHost.cpp: Remove uncalled functions and media part IDs.
2259         (WebCore::MediaControlsHost::enterFullscreenOptimized): Deleted.
2260         (WebCore::MediaControlsHost::mediaUIImageData): Deleted.
2261
2262         * Modules/mediacontrols/mediaControlsApple.css:
2263         (audio::-webkit-media-controls-picture-in-picture-button): Update pseudo-element name.
2264         (audio::-webkit-media-controls-optimized-fullscreen-button): Deleted.
2265         * Modules/mediacontrols/mediaControlsApple.js: Update global variable name, and classes.
2266         (Controller.prototype.createControls): Update button name. Add aria-label to the placeholder.
2267         (Controller.prototype.updateFullscreenButtons):
2268         (Controller.prototype.updateLayoutForDisplayedWidth):
2269         (Controller.prototype.handlePictureInPictureButtonClicked): Update handler names.
2270         (Controller.prototype.handleOptimizedFullscreenButtonClicked): Deleted.
2271
2272         * Modules/mediacontrols/mediaControlsiOS.css: Rename pseudo-element.
2273         (audio::-webkit-media-controls-picture-in-picture-button): Add mask images.
2274         (audio::-webkit-media-controls-picture-in-picture-button:active):
2275         (video::-webkit-media-controls-picture-in-picture-button):
2276         (video::-webkit-media-controls-picture-in-picture-button.return-from-picture-in-picture):
2277         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
2278         (audio::-webkit-media-controls-wireless-playback-text-top.picture-in-picture):
2279         (audio::-webkit-media-controls-wireless-playback-text-bottom.picture-in-picture):
2280         (audio::-webkit-media-controls-optimized-fullscreen-button): Deleted.
2281         (audio::-webkit-media-controls-optimized-fullscreen-button:active): Deleted.
2282         (video::-webkit-media-controls-optimized-fullscreen-button): Deleted.
2283         (audio::-webkit-media-controls-wireless-playback-status.optimized): Deleted. The placard
2284         pseudo-element should be updated from wireless-playback-status to just playback-status
2285         since it serves both for pip and AirPlay.
2286         (audio::-webkit-media-controls-wireless-playback-text-top.optimized): Deleted.
2287         (audio::-webkit-media-controls-wireless-playback-text-bottom.optimized): Deleted.
2288         * Modules/mediacontrols/mediaControlsiOS.js:
2289         (ControllerIOS.prototype.createControls): Update button names.
2290         (ControllerIOS.prototype.configureInlineControls):
2291         (ControllerIOS.prototype.handlePictureInPictureButtonClicked): Update handler name.
2292         (ControllerIOS.prototype.handlePictureInPictureTouchStart):
2293         (ControllerIOS.prototype.handlePictureInPictureTouchEnd):
2294         (ControllerIOS.prototype.handlePictureInPictureTouchCancel):
2295         (ControllerIOS.prototype.handlePresentationModeChange): Remove changes to the inline bg
2296         image style, and rely on the CSS to fill those in. Use localized strings for the placard.
2297         Move the aria-label to createControls().
2298         (ControllerIOS.prototype.handleOptimizedFullscreenButtonClicked): Deleted.
2299         (ControllerIOS.prototype.handleOptimizedFullscreenTouchStart): Deleted.
2300         (ControllerIOS.prototype.handleOptimizedFullscreenTouchEnd): Deleted.
2301         (ControllerIOS.prototype.handleOptimizedFullscreenTouchCancel): Deleted.
2302
2303         * html/HTMLMediaElement.cpp: Remove enterFullscreenOptimized since it is never called.
2304         (WebCore::HTMLMediaElement::enterFullscreenOptimized): Deleted.
2305         * html/HTMLMediaElement.h:
2306         * platform/ios/WebCoreSystemInterfaceIOS.h: Remove wkGetMediaUIImageData.
2307         * platform/ios/WebCoreSystemInterfaceIOS.mm:
2308         * rendering/RenderThemeIOS.mm:
2309         (WebCore::RenderThemeIOS::mediaControlsStyleSheet): Remove calls to wkGetMediaUIImageData.
2310
2311 2015-06-11  Dean Jackson  <dino@apple.com>
2312
2313         Add an appearance keyword for wireless playback / airplay icon
2314         https://bugs.webkit.org/show_bug.cgi?id=145892
2315         <rdar://problem/21344872>
2316
2317         Reviewed by Simon Fraser.
2318
2319         Add a new "-webkit-appearance" value named "-apple-airplay"
2320         which will be used to render an icon. This change simply
2321         adds support for the value, and puts in hooks for drawing.
2322
2323         At the moment this is only going to be used by Airplay, so
2324         the public-facing name is "-apple-airplay". However, the
2325         implementation in Theme has a more generic name, in case
2326         we hook it up for other ports later.
2327
2328         Test: fast/css/appearance-airplay.html
2329
2330         * css/CSSParser.cpp:
2331         (WebCore::cssValueKeywordID): This new keyword should not get
2332         translated into having a -webkit prefix.
2333         * css/CSSPrimitiveValueMappings.h:
2334         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): New mapping from
2335         the Theme to the CSS value.
2336         * css/CSSValueKeywords.in: Add "-apple-airplay".
2337         * platform/ThemeTypes.h: New ControlPart.
2338         * rendering/RenderTheme.cpp: Stub implementation of the rendering and
2339         style update for the new appearance.
2340         (WebCore::RenderTheme::adjustStyle):
2341         (WebCore::RenderTheme::paint):
2342         (WebCore::RenderTheme::adjustWirelessPlaybackIconStyle):
2343         (WebCore::RenderTheme::paintWirelessPlaybackIcon):
2344         * rendering/RenderTheme.h:
2345         * rendering/RenderThemeMac.h:
2346         * rendering/RenderThemeMac.mm:
2347         (WebCore::RenderThemeMac::adjustWirelessPlaybackIconStyle):
2348         (WebCore::RenderThemeMac::paintWirelessPlaybackIcon):
2349
2350 2015-06-11  Commit Queue  <commit-queue@webkit.org>
2351
2352         Unreviewed, rolling out r185464.
2353         https://bugs.webkit.org/show_bug.cgi?id=145894
2354
2355         "This patch is breaking binding tests" (Requested by youenn on
2356         #webkit).
2357
2358         Reverted changeset:
2359
2360         "Bindings generator should generate code for Promise-based
2361         APIs"
2362         https://bugs.webkit.org/show_bug.cgi?id=145833
2363         http://trac.webkit.org/changeset/185464
2364
2365 2015-06-11  Commit Queue  <commit-queue@webkit.org>
2366
2367         Unreviewed, rolling out r185465.
2368         https://bugs.webkit.org/show_bug.cgi?id=145893
2369
2370         "This patch is breaking 32bit mac build" (Requested by youenn
2371         on #webkit).
2372
2373         Reverted changeset:
2374
2375         "[Streams API] ReadableJSStream should handle promises
2376         returned by JS source start callback"
2377         https://bugs.webkit.org/show_bug.cgi?id=145792
2378         http://trac.webkit.org/changeset/185465
2379
2380 2015-06-11  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2381
2382         [Streams API] ReadableJSStream should handle promises returned by JS source start callback
2383         https://bugs.webkit.org/show_bug.cgi?id=145792
2384
2385         Reviewed by Darin Adler.
2386
2387         Covered by rebased tests.
2388
2389         When calling start callback, the returned value is checked.
2390         If it is not a promise, we do as if it is a resolved promise.
2391         If it is a promise, we call its then() method with two resolve/reject JS functions.
2392
2393         * Modules/streams/ReadableStream.cpp:
2394         * bindings/js/ReadableJSStream.cpp:
2395         (WebCore::ReadableJSStream::invoke): Returns a JSPromise* if any is returned by the JS source callback.
2396         (WebCore::thenPromise): Utility method to call the promise.
2397         (WebCore::createStartResultFulfilledFunction): The promise resolve callback.
2398         (WebCore::ReadableJSStream::doStart): Calls thenPromise if a JSPromise* is returned by invoke.
2399         (WebCore::ReadableJSStream::ReadableJSStream):
2400         * bindings/js/ReadableJSStream.h:
2401
2402 2015-06-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2403
2404         Bindings generator should generate code for Promise-based APIs
2405         https://bugs.webkit.org/show_bug.cgi?id=145833
2406
2407         Reviewed by Darin Adler.
2408
2409         Covered by existing tests.
2410
2411         * Modules/webaudio/AudioContext.idl: Removing custom binding for resume, suspend and close.
2412         * bindings/js/JSAudioContextCustom.cpp: Ditto.
2413         * bindings/scripts/CodeGeneratorJS.pm:
2414         (GenerateHeader): Refactoring to use IsReturningPromise.
2415         (GenerateImplementation): Disabling include for return type if it is a promise.
2416         (GenerateParametersCheck): Adding DeferredWrapper() as argument to the DOM method if JS method returns a promise.
2417         (GenerateImplementationFunctionCall): Added support for promise-returning API.
2418         (IsReturningPromise): Checking whether function is returning a promise.
2419         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2420         (webkit_dom_test_obj_test_promise_function):
2421         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2422         * bindings/scripts/test/JS/JSTestObj.cpp:
2423         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
2424         * bindings/scripts/test/ObjC/DOMTestObj.h:
2425         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2426         (-[DOMTestObj testPromiseFunction]):
2427         * bindings/scripts/test/TestObj.idl: Adding promise returning function.
2428
2429
2430 2015-06-08  Simon Fraser  <simon.fraser@apple.com>
2431
2432         Missing content in UIWebView snapshots sometimes
2433         https://bugs.webkit.org/show_bug.cgi?id=145779
2434         rdar://problem/20744708
2435
2436         Reviewed by Darin Adler.
2437         
2438         When expanding collapsed parts of quoted text on iOS, sometimes the "concertina"
2439         images would be blank. This happened because we'd fail to create tiles for regions
2440         outside the LegacyTileCache's visibleRect.
2441         
2442         Fix by giving LegacyTileCache an optional override visibleRect, which is set
2443         and cleared during -renderInContext: using the context clip rect.
2444
2445         * platform/ios/LegacyTileCache.h:
2446         * platform/ios/LegacyTileCache.mm:
2447         (WebCore::LegacyTileCache::visibleRectInLayer):
2448         (WebCore::LegacyTileCache::setOverrideVisibleRect):
2449         * platform/ios/LegacyTileLayer.mm:
2450         (-[LegacyTileHostLayer renderInContext:]):
2451
2452 2015-06-11  Daniel Bates  <dabates@apple.com>
2453
2454         Simplify event handling logic for search cancel button
2455         https://bugs.webkit.org/show_bug.cgi?id=145780
2456
2457         Reviewed by Darin Adler.
2458
2459         Following the patch for <https://bugs.webkit.org/show_bug.cgi?id=145774> we can take advantage
2460         of the DOM click event to simplify the event handling logic for the search cancel button.
2461         It is sufficient to listen for mousedown and click events instead of listening for mousedown
2462         and mouseup events, capturing all events during drag, and using the hover state of the button
2463         on mouse release together with a instance variable set on mouse press to determine whether
2464         the cancel button was clicked.
2465
2466         As a side effect of removing the requirement that the search cancel button be hovered (a
2467         workaround to ensure that the mouse was pressed and released on the button in absence of
2468         listening for an explicit DOM click event) we can remove the accessibility-specific class,
2469         AccessibilitySearchFieldCancelButton, that was primarily used to fake the hover state of
2470         the button so that the accessibility machinery could simulate a click on it. Instead we
2471         can add use the default accessibility machinery for clicking on an element.
2472
2473         No new tests since no functionality was changed.
2474
2475         * CMakeLists.txt: Remove reference to file AccessibilitySearchFieldButtons.cpp.
2476         * WebCore.vcxproj/WebCore.vcxproj: Remove reference to files AccessibilitySearchFieldButtons.{cpp, h}.
2477         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2478         * WebCore.xcodeproj/project.pbxproj: Ditto.
2479         * accessibility/AXObjectCache.cpp:
2480         (WebCore::createFromRenderer): Remove special-purpose logic that instantiated
2481         AccessibilitySearchFieldCancelButton for the search cancel button. Instead we can make
2482         use of the existing accessibility machinery to handle this button.
2483         * accessibility/AccessibilityAllInOne.cpp: Remove #include of AccessibilitySearchFieldButtons.cpp
2484         since the file is no longer needed.
2485         * accessibility/AccessibilitySearchFieldButtons.cpp: Removed.
2486         * accessibility/AccessibilitySearchFieldButtons.h: Removed.
2487         * dom/Element.h:
2488         (WebCore::Element::isSearchFieldCancelButtonElement): Deleted.
2489         * html/shadow/TextControlInnerElements.cpp:
2490         (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement): Set the ARIA role
2491         and label attributes so that the accessibility system identifies the search cancel button as
2492         a button and shows a description for the button, respectively.
2493         (WebCore::SearchFieldCancelButtonElement::defaultEventHandler): Simplify the event handling logic
2494         such that we clear the field when we receive a DOM click event (i.e. the mouse was pressed
2495         and released on the button). Remove unused variable, oldValue. Substitute emptyString() for the
2496         empty string literal in the call to HTMLInputElement::setValueForUser() to avoid an implicit
2497         conversion to String. Also remove out-of-date comment that repeated what the code does.
2498         (WebCore::SearchFieldCancelButtonElement::willDetachRenderers): Deleted. We no longer need to use
2499         custom style resolve callbacks to reset the state of the EventHandler since we no longer need to
2500         have the EventHandler dispatch all mouse events to us on mouse press.
2501         * html/shadow/TextControlInnerElements.h:
2502
2503 2015-06-11  Commit Queue  <commit-queue@webkit.org>
2504
2505         Unreviewed, rolling out r185453.
2506         https://bugs.webkit.org/show_bug.cgi?id=145881
2507
2508         it broke the 32-bit build (Requested by clopez on #webkit).
2509
2510         Reverted changeset:
2511
2512         "[GTK] [Wayland] Should be possible to build with support for
2513         both X11 and Wayland."
2514         https://bugs.webkit.org/show_bug.cgi?id=145701
2515         http://trac.webkit.org/changeset/185453
2516
2517 2015-06-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2518
2519         [GTK] [Wayland] Should be possible to build with support for both X11 and Wayland.
2520         https://bugs.webkit.org/show_bug.cgi?id=145701
2521
2522         Reviewed by Žan Doberšek.
2523
2524         No new tests, no behavior changes.
2525
2526         When building both targets, we have to include the wayland-egl
2527         headers in order to build the Wayland target. This causes that
2528         EGLNativePixmapType and EGLNativeWindowType get defined as
2529         different types than when building only the X11 target.
2530
2531         By type casting them to the ones that are expected, we are able
2532         to build both targets at the same time.
2533
2534         I have done tests (building each target alone as also both targets
2535         at the same time), and everything seems to works as expected.
2536
2537         Once built for both targets, if you try to launch the MiniBrowser
2538         from inside a Wayland compositor (Weston on top of X for example),
2539         it will trigger the X11 target if the DISPLAY environment variable
2540         is set and the environment variable GDK_BACKEND is not set to wayland,
2541         otherwise it will trigger the Wayland target.
2542
2543         * platform/graphics/GLContext.cpp:
2544         (WebCore::GLContext::createContextForWindow): Add type cast.
2545         * platform/graphics/egl/GLContextEGL.cpp: Add missing include when
2546         building both targets that is required for defining DefaultRootWindow().
2547         (WebCore::GLContextEGL::createPixmapContext): Add type cast.
2548
2549 2015-06-11  Hunseop Jeong  <hs85.jeong@samsung.com>
2550
2551         [EFL] Fix the debug build after r185417.
2552         https://bugs.webkit.org/show_bug.cgi?id=145876 
2553
2554         Reviewed by Gyuyoung Kim.
2555
2556         * platform/graphics/efl/ImageBufferEfl.cpp: added the missing "MIMETypeRegistry.h".
2557
2558 2015-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
2559
2560         [iOS] Tahoma isn't installed on iOS, so there is no need to blacklist it
2561         https://bugs.webkit.org/show_bug.cgi?id=145865
2562
2563         Reviewed by Dan Bernstein.
2564
2565         No new tests because I can't copy Tahoma into our open source repository.
2566
2567         * platform/graphics/cocoa/FontCocoa.mm:
2568         (WebCore::fontFamilyShouldNotBeUsedForArabic):
2569
2570 2015-06-10  Commit Queue  <commit-queue@webkit.org>
2571
2572         Unreviewed, rolling out r185442.
2573         https://bugs.webkit.org/show_bug.cgi?id=145871
2574
2575         seems to have broken WTF.StringOperators test (Requested by
2576         alexchristensen on #webkit).
2577
2578         Reverted changeset:
2579
2580         "[Content Extensions] Limit number of rules."
2581         https://bugs.webkit.org/show_bug.cgi?id=145663
2582         http://trac.webkit.org/changeset/185442
2583
2584 2015-06-10  Jon Lee  <jonlee@apple.com>
2585
2586         Update presentation mode JS API to using 'picture-in-picture'
2587         https://bugs.webkit.org/show_bug.cgi?id=145826
2588         rdar://problem/2131153
2589
2590         Reviewed by Anders Carlsson.
2591
2592         Update presentation modes to use 'picture-in-picture' in lieu of 'optimized'.
2593
2594         * html/HTMLVideoElement.idl: Update to "picture-in-picture".
2595         * html/HTMLVideoElement.cpp:
2596         (WebCore::presentationModePictureInPicture): Rename static function returning string.
2597         (WebCore::presentationModeOptimized): Deleted.
2598         (WebCore::HTMLVideoElement::webkitSupportsPresentationMode): Use the new static function name.
2599         (WebCore::HTMLVideoElement::webkitSetPresentationMode): Ditto.
2600         (WebCore::HTMLVideoElement::webkitPresentationMode): Ditto.
2601
2602         * Modules/mediacontrols/mediaControlsiOS.js: Update to 'picture-in-picture'.
2603         (ControllerIOS.prototype.configureInlineControls): 
2604         (ControllerIOS.prototype.isFullScreen):
2605         (ControllerIOS.prototype.handleOptimizedFullscreenButtonClicked):
2606         (ControllerIOS.prototype.handlePresentationModeChange):
2607         (ControllerIOS.prototype.controlsAlwaysVisible):
2608
2609 2015-06-10  Boris Smus  <boris@smus.com>
2610
2611         [Mobile Safari, WKWebView] increase DeviceOrientationEvent events emission frequency
2612         https://bugs.webkit.org/show_bug.cgi?id=145814
2613
2614         Reviewed by Benjamin Poulain.
2615
2616         Increased the sampling rate of DeviceOrientationEvent from 20 Hz to 60
2617         Hz to make good head tracking possible.
2618
2619         * platform/ios/WebCoreMotionManager.h:
2620
2621 2015-06-10  Alex Christensen  <achristensen@webkit.org>
2622
2623         [Content Extensions] Limit number of rules.
2624         https://bugs.webkit.org/show_bug.cgi?id=145663
2625         rdar://problem/21242407
2626
2627         Reviewed by Benjamin Poulain.
2628
2629         Added an API test to make sure that parsing fails when there are too many rules.
2630
2631         * contentextensions/ContentExtensionError.cpp:
2632         (WebCore::ContentExtensions::contentExtensionErrorCategory):
2633         * contentextensions/ContentExtensionError.h:
2634         * contentextensions/ContentExtensionParser.cpp:
2635         (WebCore::ContentExtensions::loadEncodedRules):
2636         Fail to parse a content extension with more than 50000 rules.
2637
2638 2015-06-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
2639
2640         REGRESSION (r184895): Vertical border elements ([-webkit]-border-image set to 'repeat') that used to render perfectly are now rendering incorrectly.
2641         https://bugs.webkit.org/show_bug.cgi?id=145801
2642
2643         Reviewed by Simon Fraser.
2644
2645         When using the tiling to draw the sides of an image-border, the image slice
2646         is repeated only in one direction. For top and bottom sides, the slice is
2647         repeated horizontally and for left and right sides, it's repeated vertically.
2648         The tile might be scaled in the other direction of the tiling if the border
2649         extent and the slice extent are different in this direction.
2650         
2651         The bug happens because we were scaling the tile in the tiling direction.
2652
2653         Test: fast/borders/border-image-repeat-stretch.html
2654
2655         * rendering/style/NinePieceImage.cpp:
2656         (WebCore::NinePieceImage::scaleSlicesIfNeeded): Fix the type and the name
2657         of deviceScaleFactor.
2658         
2659         (WebCore::NinePieceImage::computeIntrinsicSideTileScale): Fix the scaling
2660         direction of the border image side tiling.
2661         
2662         * rendering/style/NinePieceImage.h:
2663
2664 2015-06-10  Chris Dumez  <cdumez@apple.com>
2665
2666         ASSERT_WITH_SECURITY_IMPLICATION in WebCore::DocumentOrderedMap::getElementById
2667         https://bugs.webkit.org/show_bug.cgi?id=145857
2668         <rdar://problem/16798440>
2669
2670         Reviewed by Darin Adler.
2671
2672         Make sure Node::insertedInto() gets called on the inserted node and its
2673         descendants after its insertion into the tree but *before*
2674         ContainerNode::childrenChanged() is called on the parent node. This is
2675         needed so that the descendants know they've been inserted into the tree
2676         (and their InDocumentFlag flag gets set) before the parent node does
2677         anything with them in childrenChanged().
2678
2679         In the case of <rdar://problem/16798440>, executing HTMLScriptElement's
2680         childrenChanged() after appending a child to a script element was causing
2681         the script to be executed. The script would call getElementBy() which
2682         would traverse the DOM tree and find a matching Element in the newly
2683         inserted subtree. However, the matching Element's InDocumentFlag flag was
2684         not set yet because the element's insertedInto() method has not been called
2685         yet at this point. This would cause us to hit an assertion as
2686         DocumentOrderedMap::getElementById() is only supposed to return elements
2687         that are in a Document.
2688
2689         This patch is based on Blink r178976 by <esprehn@chromium.org>:
2690         https://src.chromium.org/viewvc/blink?view=rev&revision=178976
2691
2692         Tests: fast/dom/script-getElementById-during-insertion.html
2693                fast/dom/script-remove-child-id-map.html
2694
2695         * dom/ContainerNode.cpp:
2696         (WebCore::ContainerNode::notifyChildInserted):
2697         (WebCore::ContainerNode::notifyChildRemoved):
2698         (WebCore::ContainerNode::removeChildren):
2699         (WebCore::ContainerNode::parserInsertBefore): Deleted.
2700         (WebCore::ContainerNode::removeChild): Deleted.
2701         (WebCore::ContainerNode::parserRemoveChild): Deleted.
2702         (WebCore::ContainerNode::parserAppendChild): Deleted.
2703         (WebCore::ContainerNode::childrenChanged): Deleted.
2704         (WebCore::ContainerNode::setAttributeEventListener): Deleted.
2705         (WebCore::ContainerNode::querySelector): Deleted.
2706         * dom/ContainerNodeAlgorithms.cpp:
2707         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument):
2708         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree):
2709         * dom/ContainerNodeAlgorithms.h:
2710         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
2711         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree):
2712         (WebCore::ChildNodeInsertionNotifier::notify):
2713         (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument): Deleted.
2714         * dom/Element.cpp:
2715         (WebCore::Element::addShadowRoot):
2716
2717 2015-06-10  Alex Christensen  <achristensen@webkit.org>
2718
2719         [Web Timing] Fix flaky test.
2720         https://bugs.webkit.org/show_bug.cgi?id=145846
2721
2722         Reviewed by Alexey Proskuryakov.
2723
2724         The timing data is gathered in ResourceHandle::getConnectionTimingData as 
2725         millisecond deltas from the fetch start time, not the navigation start time.
2726         The difference between navigation and fetch start time is usually so small that 
2727         it only caused one flaky test, but this should fix that flakiness. This patch 
2728         corrects how the millisecond deltas are used.
2729
2730         * page/PerformanceTiming.cpp:
2731         (WebCore::PerformanceTiming::domainLookupStart):
2732         (WebCore::PerformanceTiming::domainLookupEnd):
2733         (WebCore::PerformanceTiming::connectStart):
2734         (WebCore::PerformanceTiming::connectEnd):
2735         (WebCore::PerformanceTiming::secureConnectionStart):
2736         (WebCore::PerformanceTiming::requestStart):
2737         (WebCore::PerformanceTiming::responseStart):
2738         (WebCore::PerformanceTiming::responseEnd):
2739         (WebCore::PerformanceTiming::documentLoadTiming):
2740         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
2741         (WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds):
2742         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToAbsolute): Deleted.
2743         * page/PerformanceTiming.h:
2744
2745 2015-06-10  Beth Dakin  <bdakin@apple.com>
2746
2747         Overriding the overlay scrollbar style on WKView doesn't take effect immediately
2748         https://bugs.webkit.org/show_bug.cgi?id=145855
2749         -and corresponding-
2750         rdar://problem/20948706
2751
2752         Reviewed by Simon Fraser.
2753
2754         Since we opt into layer-per-part scrollbars in order to move the knob on the 
2755         secondary thread, AppKit is creating its own layers for the knob and track. To 
2756         invalidate them, we need to call into the ScrollbarPainter’s setNeedsDisplay.
2757
2758         New virtual function on ScrollAnimator to call into ScrollbarPainter’s 
2759         setNeedsDispay.
2760         * platform/ScrollAnimator.h:
2761
2762         Call the new function when setting the overlay style.
2763         * platform/ScrollableArea.cpp:
2764         (WebCore::ScrollableArea::setScrollbarOverlayStyle):
2765
2766         Add setNeedsDisplay to the list of ScrollbarPainter methods.
2767         * platform/mac/NSScrollerImpDetails.h:
2768
2769         Implement invalidateScrollbarPartLayers.
2770         * platform/mac/ScrollAnimatorMac.h:
2771         * platform/mac/ScrollAnimatorMac.mm:
2772         (WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
2773
2774 2015-06-10  Matt Rajca  <mrajca@apple.com>
2775
2776         MediaRemoteControls should be marked JSGenerateToJSObject.
2777         https://bugs.webkit.org/show_bug.cgi?id=145849
2778
2779         Reviewed by Eric Carlson.
2780
2781         Since MediaRemoteControls has a parent interface, we need to add the JSGenerateToJSObject attribute so the
2782         toJS(...) function gets generated. This is required for event handling to work.
2783
2784         * Modules/mediasession/MediaRemoteControls.idl:
2785
2786 2015-06-10  Dean Jackson  <dino@apple.com>
2787
2788         User can not scroll on page when dragging inside video
2789         https://bugs.webkit.org/show_bug.cgi?id=145848
2790         <rdar://problem/20997158>
2791
2792         Reviewed by Brent Fulgham.
2793
2794         Revert the change made in http://trac.webkit.org/changeset/183797
2795         which breaks panning on pages if the touch starts inside the video.
2796
2797         * Modules/mediacontrols/mediaControlsiOS.js:
2798         (ControllerIOS.prototype.handleWrapperTouchStart): Do not return true, which stops
2799         the handleEvent call in the superclass from preventing the default action.
2800
2801 2015-06-10  Matt Rajca  <mrajca@apple.com>
2802
2803         Explicitly keep track of active HTMLMediaElements in MediaSessions.
2804         https://bugs.webkit.org/show_bug.cgi?id=145829
2805
2806         Reviewed by Eric Carlson.
2807
2808         * Modules/mediasession/MediaSession.cpp: Add support for keeping track of active media elements.
2809         (WebCore::MediaSession::addActiveMediaElement):
2810         * Modules/mediasession/MediaSession.h:
2811         * html/HTMLMediaElement.cpp:
2812         (WebCore::HTMLMediaElement::playInternal): If the paused attribute is true and the readyState attribute has the
2813           value HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA, the media element becomes an active participating element of the
2814           media session.
2815
2816 2015-06-10  Chris Dumez  <cdumez@apple.com>
2817
2818         Drop unused argument for Node::didNotifySubtreeInsertions()
2819         https://bugs.webkit.org/show_bug.cgi?id=145845
2820
2821         Reviewed by Andreas Kling.
2822
2823         * dom/ContainerNodeAlgorithms.h:
2824         (WebCore::ChildNodeInsertionNotifier::notify):
2825         * dom/Node.h:
2826         (WebCore::Node::didNotifySubtreeInsertions):
2827         * html/HTMLFrameElementBase.cpp:
2828         (WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions):
2829         * html/HTMLFrameElementBase.h:
2830         * svg/SVGFEImageElement.cpp:
2831         (WebCore::SVGFEImageElement::didNotifySubtreeInsertions):
2832         * svg/SVGFEImageElement.h:
2833         * svg/SVGMPathElement.cpp:
2834         (WebCore::SVGMPathElement::didNotifySubtreeInsertions):
2835         * svg/SVGMPathElement.h:
2836         * svg/SVGTRefElement.cpp:
2837         (WebCore::SVGTRefElement::didNotifySubtreeInsertions):
2838         * svg/SVGTRefElement.h:
2839         * svg/SVGTextPathElement.cpp:
2840         (WebCore::SVGTextPathElement::didNotifySubtreeInsertions):
2841         * svg/SVGTextPathElement.h:
2842         * svg/animation/SVGSMILElement.cpp:
2843         (WebCore::SVGSMILElement::didNotifySubtreeInsertions):
2844         * svg/animation/SVGSMILElement.h:
2845
2846 2015-06-10  KwangHyuk Kim  <hyuki.kim@samsung.com>
2847
2848         [EFL] Jpeg image export implementation for Canvas.
2849         https://bugs.webkit.org/show_bug.cgi?id=145457
2850
2851         Reviewed by Gyuyoung Kim.
2852
2853         Add implementation of jpeg image export on Webkit EFL by using JPEGImageEncoder.
2854
2855         No new tests, fast/canvas/toDataURL-supportedTypes.html can be reused.
2856
2857         * PlatformEfl.cmake:
2858         * platform/MIMETypeRegistry.cpp:
2859         (WebCore::initializeSupportedImageMIMETypesForEncoding):
2860         * platform/graphics/cairo/ImageBufferCairo.cpp:
2861         * platform/graphics/efl/ImageBufferEfl.cpp: Added.
2862         (WebCore::writeFunction):
2863         (WebCore::encodeImage):
2864         (WebCore::ImageBuffer::toDataURL):
2865         * platform/image-encoders/JPEGImageEncoder.cpp:
2866         (WebCore::compressRGBABigEndianToJPEG):
2867
2868 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2869
2870         [GTK] Move KeyBindingTranslator from platform to WebKit2 layer
2871         https://bugs.webkit.org/show_bug.cgi?id=145840
2872
2873         Reviewed by Martin Robinson.
2874
2875         It's currently used only by WebKit2 in the UI process and it's
2876         another file built twice because of the GTK2 plugin process.
2877
2878         * PlatformGTK.cmake:
2879
2880 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2881
2882         [GTK] Get rid of GetEditorCommandsForKeyEvent sync message
2883         https://bugs.webkit.org/show_bug.cgi?id=145598
2884
2885         Reviewed by Žan Doberšek.
2886
2887         * platform/PlatformKeyboardEvent.h:
2888         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2889         (WebCore::PlatformKeyboardEvent::commands):
2890         * platform/gtk/KeyBindingTranslator.cpp: Use a single list of
2891         custom key bindings. We don't need to distinguish between key down and
2892         key press commands, since the web editor client already does that
2893         when executing the commands.
2894         (WebCore::KeyBindingTranslator::commandsForKeyEvent): This is
2895         getEditorCommandsForKeyEvent() renamed as commandsForKeyEvent(),
2896         since it now returns the list of commands to simplify the
2897         code. Also simplify the custom key bindings handling, by using the
2898         global list instead of moving it to a HashMap.
2899         (WebCore::KeyBindingTranslator::getEditorCommandsForKeyEvent): Deleted.
2900         * platform/gtk/KeyBindingTranslator.h:
2901
2902 2015-06-10  Per Arne Vollan  <peavo@outlook.com>
2903
2904         [WinCairo] Crash on exit when terminating egl
2905         https://bugs.webkit.org/show_bug.cgi?id=145832
2906
2907         Reviewed by Carlos Garcia Campos.
2908
2909         Avoid terminating egl on exit for WinCairo.
2910
2911         * platform/graphics/PlatformDisplay.cpp:
2912         (WebCore::PlatformDisplay::~PlatformDisplay):
2913
2914 2015-06-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2915
2916         Refactor AudioContext implementation to enable automatic binding generation of promise-based methods
2917         https://bugs.webkit.org/show_bug.cgi?id=145223
2918
2919         Reviewed by Darin Adler.
2920
2921         Introducing DOMPromise as a typed wrapper above DeferredWrapper.
2922         This DOMPromise allows constraining Promise resolution/rejection to a single resolution type and rejection type. 
2923         This might be useful for typed callback usage of promise based APIs, like getUserMedia() or ReadableStreamReader.read().
2924
2925         Applying DOMPromise to AudioContext close, suspend and resume.
2926         Changed binding code to represent what could be automatically generated by binding generator.
2927         Fixing unneeded copies of std::function callbacks.
2928
2929         Disabling DOMPromise copy constructors to lower chances that resolution/rejection is done twice on the same object.
2930
2931         Covered by existing tests.
2932
2933         * Modules/webaudio/AudioContext.cpp:
2934         (WebCore::AudioContext::addReaction):
2935         (WebCore::AudioContext::setState):
2936         (WebCore::AudioContext::suspend):
2937         (WebCore::AudioContext::resume):
2938         (WebCore::AudioContext::close):
2939         * Modules/webaudio/AudioContext.h:
2940         * bindings/js/JSAudioContextCustom.cpp:
2941         (WebCore::JSAudioContext::suspend):
2942         (WebCore::JSAudioContext::resume):
2943         (WebCore::JSAudioContext::close):
2944         * bindings/js/JSDOMPromise.cpp:
2945         (WebCore::DeferredWrapper::callFunction):
2946         * bindings/js/JSDOMPromise.h:
2947         (WebCore::DeferredWrapper::resolve):
2948         (WebCore::DeferredWrapper::reject):
2949         (WebCore::DOMPromise::DOMPromise):
2950         (WebCore::DOMPromise::resolve):
2951         (WebCore::DOMPromise::reject):
2952
2953 2015-06-10  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2954
2955         [Streams API] Implement pulling of a source by a ReadableStream
2956         https://bugs.webkit.org/show_bug.cgi?id=145262
2957
2958         Reviewed by Darin Adler
2959
2960         Introduced abstract ReadableStream::doPull() which is overriden in ReadableJSStream.
2961         Added support to call the "pull" JS callback in ReadableJSStream::doPull().
2962         Added calls to pull as requested by the spec (when resolving a read callback, at start time...).
2963
2964         Fixed issue in ReadableStreamReader::read() (use of successCallback(JSValue()) in lieu of endCallback())
2965
2966         Covered by rebased tests.
2967
2968         * Modules/streams/ReadableStream.cpp:
2969         (WebCore::ReadableStream::start): calling pull() once start.
2970         (WebCore::ReadableStream::pull): calling doPull() if readableStream states requires to.
2971         (WebCore::ReadableStream::read): calling pull() after resolving a read callback.
2972         * Modules/streams/ReadableStream.h:
2973         * Modules/streams/ReadableStreamReader.cpp:
2974         (WebCore::ReadableStreamReader::read): fixed JSValue() bug.
2975         * bindings/js/ReadableJSStream.cpp:
2976         (WebCore::ReadableJSStream::doPull): calling of JS callback.
2977         (WebCore::ReadableJSStream::storeException): catches exception and store them.
2978         (WebCore::ReadableJSStream::storeError): refactoring for checkForException.
2979         (WebCore::ReadableJSStream::enqueue):
2980         * bindings/js/ReadableJSStream.h:
2981
2982 2015-06-09  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2983
2984         DeferredWrapper should clear its JS strong references once its promise is resolved/rejected
2985         https://bugs.webkit.org/show_bug.cgi?id=145753
2986
2987         Reviewed by Darin Adler.
2988
2989         Clear strong references at the end of DeferredWrapper::resolve and DeferredWrapper::reject.
2990         Added assertions to check that resolve or reject is called only once.
2991
2992         Removed DeferredWrapper constructor that creates internally its promise.
2993         Reason is DeferredWrapper can be resolved synchronously and promise
2994         will be lost when returning it at the end of the binding promise function.
2995         Updated all custom bindings accordingly.
2996
2997         Covered by existing tests.
2998
2999         * bindings/js/JSAudioContextCustom.cpp:
3000         (WebCore::JSAudioContext::suspend): Updated DeferredWrapper constructor to properly return the promise.
3001         (WebCore::JSAudioContext::resume): Ditto.
3002         (WebCore::JSAudioContext::close): Ditto.
3003         * bindings/js/JSDOMPromise.cpp:
3004         (WebCore::DeferredWrapper::resolve): Cleared strong references after promise resolution.
3005         (WebCore::DeferredWrapper::reject): Cleared strong references after promise rejection.
3006         * bindings/js/JSDOMPromise.h:
3007         (WebCore::DeferredWrapper::resolve): Added ASSERT to check promise is not yet rejected/resolved.
3008         (WebCore::DeferredWrapper::reject): Ditto.
3009         (WebCore::DeferredWrapper::reject<ExceptionCode>): Ditto.
3010         (WebCore::DeferredWrapper::resolve<String>): Ditto.
3011         (WebCore::DeferredWrapper::resolve<bool>): Ditto.
3012         (WebCore::DeferredWrapper::resolve<JSC::JSValue>): Ditto.
3013         (WebCore::char>>):
3014         (WebCore::DeferredWrapper::reject<String>): Ditto.
3015         * bindings/js/JSMediaDevicesCustom.cpp:
3016         (WebCore::JSMediaDevices::getUserMedia): Updated DeferredWrapper constructor to properly return the promise.
3017         * bindings/js/JSReadableStreamReaderCustom.cpp:
3018         (WebCore::JSReadableStreamReader::read): Ditto.
3019         (WebCore::JSReadableStreamReader::closed): Ditto.
3020         * bindings/js/JSSubtleCryptoCustom.cpp:
3021         (WebCore::JSSubtleCrypto::encrypt): Ditto.
3022         (WebCore::JSSubtleCrypto::decrypt): Ditto.
3023         (WebCore::JSSubtleCrypto::sign): Ditto.
3024         (WebCore::JSSubtleCrypto::verify): Ditto.
3025         (WebCore::JSSubtleCrypto::digest): Ditto.
3026         (WebCore::JSSubtleCrypto::generateKey): Ditto.
3027         (WebCore::JSSubtleCrypto::importKey): Ditto.
3028         (WebCore::JSSubtleCrypto::exportKey): Ditto.
3029         (WebCore::JSSubtleCrypto::wrapKey): Ditto.
3030         (WebCore::JSSubtleCrypto::unwrapKey): Ditto.
3031
3032 2015-06-09  Zalan Bujtas  <zalan@apple.com>
3033
3034         Protect FrameView from being destroyed in Document::recalcStyle()
3035         https://bugs.webkit.org/show_bug.cgi?id=143033
3036         rdar://problem/20326871
3037
3038         Reviewed by Andreas Kling.
3039
3040         This patch ensures that FrameView stays valid in Document::recalcStyle().
3041         It follows the defensive pattern we use to deal with the refcounted FrameView (see EventDispatcher::dispatchEvent)
3042
3043         When the iframe destroys itself in the onBeforeLoad callback (as the result of
3044         PostResolutionCallbackDisabler -> HTMLObjectElement::updateWidget -> guardedDispatchBeforeLoadEvent),
3045         we detach the frame and release the FrameView. However Document::recalcStyle() expects
3046         the FrameView to stay valid.
3047
3048         Covered by fast/frames/flattening/crash-remove-iframe-during-object-beforeload.html.
3049
3050         * dom/Document.cpp:
3051         (WebCore::Document::recalcStyle):
3052
3053 2015-06-09  Daegyu Lee  <daegyu.lee@navercorp.com>
3054
3055         3D-transformed video does not display on platforms without accelerated video rendering
3056         https://bugs.webkit.org/show_bug.cgi?id=144782
3057
3058         Reviewed by Simon Fraser.
3059
3060         Video element does not get GraphicsLayer when MediaPlayerPrivate::supportsAcceleratedRendering() returns false
3061         which means not using accelerated video decoding.
3062         Although the video element gets GraphicsLayer by changing the CSS style of video element by javascript,
3063         there is no way to set GraphicsLayer::setDrawsContent(true) for updating the video content.
3064         As a result, after changing the CSS style, the video content does not show.
3065         To avoid missing setDrawsContent(true), add conditions(!supportsAcceleratedRendering() && m_requiresOwnBackingStore).
3066
3067         Test: media/video-transformed-by-javascript.html
3068               media/video-transformed-by-javascript-expected.html
3069
3070         * rendering/RenderLayerBacking.cpp:
3071         (WebCore::RenderLayerBacking::containsPaintedContent):
3072
3073 2015-06-09  Ryosuke Niwa  <rniwa@webkit.org>
3074
3075         REGRESSION(r180867): Tabbing to login field on iCloud.com doesn't have highlight for text
3076         https://bugs.webkit.org/show_bug.cgi?id=145830
3077
3078         Reviewed by Darin Adler.
3079
3080         The bug was caused by setSelection not updating RenderView when there is a style recalc scheduled
3081         that doesn't trigger a layout. Fixed the bug by explicitly updating the selection in
3082         Document::recalcStyle in that case.
3083
3084         Test: editing/selection/update-selection-by-style-change.html
3085
3086         * dom/Document.cpp:
3087         (WebCore::Document::recalcStyle):
3088         * editing/FrameSelection.cpp:
3089         (WebCore::FrameSelection::updateAppearanceAfterLayout): Renamed from didLayout.
3090         * editing/FrameSelection.h:
3091         * page/FrameView.cpp:
3092         (WebCore::FrameView::performPostLayoutTasks):
3093
3094 2015-06-09  Dean Jackson  <dino@apple.com>
3095
3096         MediaControls: Reenable resize of controls on pinch zoom
3097         https://bugs.webkit.org/show_bug.cgi?id=145824
3098         <rdar://problem/21212778>
3099
3100         Reviewed by Darin Adler.
3101
3102         Reinstate the code that updated the scaling of the
3103         controls in response to changes in page scale.
3104         This time around we have to change both the controls
3105         panel, and its blurry background.
3106
3107         * Modules/mediacontrols/mediaControlsApple.js:
3108         (Controller.prototype.set pageScaleFactor): Deleted a comment.
3109         * Modules/mediacontrols/mediaControlsiOS.css:
3110         (video::-webkit-media-controls-panel-background): Set the background to pin
3111         to the bottom of its view.
3112         * Modules/mediacontrols/mediaControlsiOS.js:
3113         (ControllerIOS.prototype.get pageScaleFactor): Basic getter, copied from mediaControlsApple.
3114         (ControllerIOS.prototype.set pageScaleFactor): The setter that reacts to the page scale
3115         and applies an inverse scaling on the control panel using a transform, and adjusts the
3116         height on the background similarly.
3117
3118 2015-06-09  Andreas Kling  <akling@apple.com>
3119
3120         GraphicsContext state stack wasting lots of memory when empty.
3121         <https://webkit.org/b/145817>
3122
3123         Reviewed by Geoffrey Garen.
3124
3125         Give the GraphicsContextState stack an inline capacity of 1, and make sure
3126         to free any heap-allocated backing store when the stack goes empty.
3127
3128         The 1 is because HTMLCanvasElement keeps one "save" on the underlying
3129         GraphicsContext at all times, and this prevents those canvases from always
3130         sitting on an empty stack with 16 capacity.
3131
3132         This saves ~520 kB on cnet.com video pages.
3133
3134         * platform/graphics/GraphicsContext.cpp:
3135         (WebCore::GraphicsContext::restore):
3136         * platform/graphics/GraphicsContext.h:
3137
3138 2015-06-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
3139
3140         SVG Fragment is not rendered if it is the css background image of an HTML element
3141         https://bugs.webkit.org/show_bug.cgi?id=91790
3142
3143         Reviewed by Darin Adler.
3144
3145         To show an SVG fragment, the SVGImage has to scrollToFragment() using
3146         the resource url. The changes http://trac.webkit.org/changeset/164804
3147         and http://trac.webkit.org/changeset/164983 set the url of SVGImage to
3148         to be used later in SVGImage::draw(). The problem is the SVGImage url
3149         is only set when it is the src of an <img> tag. We did not do the same
3150         thing when the SVGImage is the css background image of an HTML element.
3151         
3152         The fix is to set the url of the SVGImage always when it's created by 
3153         the CachedImage. The CachedImage must have a valid url when the SVGImage
3154         is created.
3155
3156         Test: svg/css/svg-resource-fragment-identifier-background.html
3157
3158         * loader/cache/CachedImage.cpp:
3159         (WebCore::CachedImage::load):
3160         (WebCore::CachedImage::checkShouldPaintBrokenImage):
3161         Replace the calls resourceRequest().url() and m_resourceRequest.url() by
3162         calling url() since they are all the same.
3163         
3164         (WebCore::CachedImage::createImage): Pass the resource url to SVGImage
3165         and change ImageObserver& by ImageObserver*, since null is not legal.
3166         
3167         * svg/graphics/SVGImage.cpp:
3168         (WebCore::SVGImage::SVGImage):
3169         * svg/graphics/SVGImage.h: Add a url parameter to SVGImage constructor.
3170         
3171         * svg/graphics/SVGImageCache.cpp:
3172         (WebCore::SVGImageCache::findImageForRenderer): Add a new helper function.
3173         
3174         (WebCore::SVGImageCache::imageSizeForRenderer):
3175         (WebCore::SVGImageCache::imageForRenderer): Code clean up.
3176         
3177         * svg/graphics/SVGImageCache.h: Make imageForRenderer() const.
3178
3179         * svg/graphics/SVGImageForContainer.cpp: Remove unneeded header file.
3180
3181 2015-06-09  Matt Rajca  <mrajca@apple.com>
3182
3183         Add support for toggling playback in MediaSessions and MediaSessionManagers.
3184         https://bugs.webkit.org/show_bug.cgi?id=145822
3185
3186         Reviewed by Eric Carlson.
3187
3188         * Modules/mediasession/MediaSession.cpp: Toggle playback of all active media elements.
3189         (WebCore::MediaSession::togglePlayback):
3190         * Modules/mediasession/MediaSession.h:
3191         * Modules/mediasession/MediaSessionManager.cpp: Toggle playback of all media sessions as described in the
3192           Media Session spec.
3193         (WebCore::MediaSessionManager::togglePlayback):
3194         * Modules/mediasession/MediaSessionManager.h:
3195
3196 2015-06-09  Darin Adler  <darin@apple.com>
3197
3198         Takes two delete key presses to delete pasted emoji up-pointing index finger with skin tone
3199         https://bugs.webkit.org/show_bug.cgi?id=145823
3200
3201         Reviewed by Anders Carlsson.
3202
3203         Tests: editing/deleting/delete-emoji.html
3204
3205         * rendering/RenderText.cpp:
3206         (WebCore::isHangulLVT): Use constants instead of macros. Also changed to take a UChar since
3207         the Hangul processing can work on UTF-16 code unit at a time and doesn't have to handle
3208         surrogate pairs.
3209         (WebCore::isMark): Use U_GC_M_MASK instead of writing the algorithm out another way.
3210         (WebCore::isInArmenianToLimbuRange): Added.
3211         (WebCore::RenderText::previousOffsetForBackwardDeletion): Refactored for clarity and to use
3212         the U16_PREV macro instead of doing what it does in a sloppier way. Added code to allow a
3213         variation selector before an emoji modifier to fix the bug. Changed Hangul logic to work a
3214         code unit at a time, since it can, to use an enum class, and to use constants rather than
3215         all capital macros. Also changed the "dumb" case to use a more appropriate ICU macro.
3216
3217 2015-06-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
3218
3219         feComposite filter does not clip the paint rect to its effect rect when the operator is 'in' or 'atop'
3220         https://bugs.webkit.org/show_bug.cgi?id=137856
3221
3222         Reviewed by Darin Adler.
3223
3224         There was bug in calculating the absolutePaintRect of the feComposite filter
3225         when the operator is equal to 'in' or 'atop'. The absolutePaintRect was set
3226         to the absolutePaintRect of the background FilterEffect which is correct.
3227         What was missing is clipping this rectangle to the maxEffectRect of the
3228         filter which we do for other operators.
3229
3230         Tests: svg/filters/feComposite-background-rect-control-operators.svg
3231
3232         * platform/graphics/IntRect.h:
3233         (WebCore::operator-=):
3234         (WebCore::operator-): Add new operators to IntRect.
3235
3236         * platform/graphics/filters/FEComposite.cpp:
3237         (WebCore::FEComposite::determineAbsolutePaintRect): Make sure the filter
3238         absolutePaintRect is clipped to maxEffectRect for all operators.
3239         
3240         (WebCore::FEComposite::platformApplySoftware): Code clean-up.
3241         
3242         * platform/graphics/filters/FilterEffect.cpp:
3243         (WebCore::FilterEffect::determineAbsolutePaintRect): Move the clipping
3244         part to a separate function.
3245         
3246         (WebCore::FilterEffect::clipAbsolutePaintRect): Clip the absolutePaintRect
3247         to the maxEffectRect of the filter.
3248         
3249         * platform/graphics/filters/FilterEffect.h:
3250
3251 2015-06-09  Matt Rajca  <mrajca@apple.com>
3252
3253         Implement MediaSessionManager to keep track of all MediaSessions.
3254         https://bugs.webkit.org/show_bug.cgi?id=145806
3255
3256         Reviewed by Eric Carlson.
3257
3258         * Modules/mediasession/MediaSession.cpp:
3259         (WebCore::MediaSession::MediaSession): Add ourselves to the MediaSessionManager upon construction.
3260         (WebCore::MediaSession::~MediaSession): Remove ourselves from the MediaSessionManager before destruction.
3261         * Modules/mediasession/MediaSessionManager.cpp: Added to keep track of all living MediaSessions.
3262         (WebCore::MediaSessionManager::singleton):
3263         (WebCore::MediaSessionManager::addMediaSession):
3264         (WebCore::MediaSessionManager::removeMediaSession):
3265         * Modules/mediasession/MediaSessionManager.h: Added.
3266         * WebCore.xcodeproj/project.pbxproj: Added new MediaSessionManager sources.
3267
3268 2015-06-09  Ryuan Choi  <ryuan.choi@navercorp.com>
3269
3270         [CoordinatedGraphics] Remove RefCounted from Tile
3271         https://bugs.webkit.org/show_bug.cgi?id=145788
3272
3273         Reviewed by Darin Adler.
3274
3275         Since r185140, Tile does not need to be RefCounted.
3276
3277         No new tests, no behavior changes.
3278
3279         * platform/graphics/texmap/coordinated/Tile.cpp:
3280         (WebCore::Tile::create): Deleted.
3281         * platform/graphics/texmap/coordinated/Tile.h:
3282         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
3283         (WebCore::TiledBackingStore::invalidate):
3284         (WebCore::TiledBackingStore::updateTileBuffers): Simplifies not to use unnecessary Vector.
3285         (WebCore::TiledBackingStore::coverageRatio):
3286         (WebCore::TiledBackingStore::createTiles):
3287         (WebCore::TiledBackingStore::resizeEdgeTiles):
3288         (WebCore::TiledBackingStore::setKeepRect):
3289         (WebCore::TiledBackingStore::tileAt): Deleted one line wrapper.
3290         (WebCore::TiledBackingStore::setTile): Ditto.
3291         (WebCore::TiledBackingStore::removeTile): Ditto.
3292         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
3293
3294 2015-06-09  Chris Dumez  <cdumez@apple.com>
3295
3296         Allow one sync GC per gcTimer interval on critical memory pressure warning
3297         https://bugs.webkit.org/show_bug.cgi?id=145773
3298
3299         Reviewed by Geoffrey Garen.
3300
3301         * bindings/js/GCController.cpp:
3302         (WebCore::GCController::garbageCollectNowIfNotDoneRecently):
3303
3304         Add new GCController::garbageCollectNowIfNotDoneRecently() API that
3305         allows one synchronous GC per full GC timer interval. If called more
3306         than once per interval, it becomes equivalent to garbageCollectSoon()
3307         and merely accelerates the next collection.
3308
3309         * bindings/js/GCController.h:
3310         * platform/MemoryPressureHandler.cpp:
3311         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
3312
3313         Call the new GCController::garbageCollectNowIfNotDoneRecently() on
3314         critical memory pressure instead of garbageCollectionSoon() to try
3315         as do a synchronous GC if one wasn't already done recently.
3316         Also drop call to fullSweep() as GCController::garbageCollectNow*()
3317         already do a sweep after the collection.
3318
3319 2015-06-09  Darin Adler  <darin@apple.com>
3320
3321         Follow-up fix for:
3322         JavaScript bindings are unnecessarily checking for impossible empty JSValue arguments
3323         https://bugs.webkit.org/show_bug.cgi?id=145811
3324
3325         There was one unusual case in the bindings generator that was depending on this.
3326
3327         * bindings/js/JSDOMBinding.h:
3328         (WebCore::argumentOrNull): Deleted.
3329         * bindings/scripts/CodeGeneratorJS.pm:
3330         (GenerateParametersCheck): Stop using argumentOrNull.
3331         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Updated.
3332         * bindings/scripts/test/JS/JSTestObj.cpp: Updated.
3333
3334 2015-06-09  Darin Adler  <darin@apple.com>
3335
3336         JavaScript bindings are unnecessarily checking for impossible empty JSValue arguments
3337         https://bugs.webkit.org/show_bug.cgi?id=145811
3338
3339         Reviewed by Antti Koivisto.
3340
3341         At some point, someone who didn't understand JSValue very well added checks for
3342         isEmpty (and the function isEmpty itself) in JavaScript bindings. But the engine
3343         never would pass an empty JSValue to a binding; that's used only inside the
3344         engine itself. I think this was done by some Google V8 experts a while back, so
3345         it's not entirely surprising they didn't understand this. But we don't want to
3346         keep all that unneeded code.
3347
3348         * bindings/js/JSAudioTrackCustom.cpp:
3349         (WebCore::JSAudioTrack::setKind): Removed the isEmpty clause here. I presume this
3350         was copied and pasted from script-generated bindings. While I was at it, I used a
3351         slightly more efficient code path that avoids doing a ref/deref on the string by
3352         using auto&. That's trickier to do correctly for functions with more than one
3353         argument, so I didn't do it in the bindings generator yet.
3354         (WebCore::JSAudioTrack::setLanguage): Ditto.
3355         * bindings/js/JSTextTrackCustom.cpp:
3356         (WebCore::JSTextTrack::setKind): Ditto.
3357         (WebCore::JSTextTrack::setLanguage): Ditto.
3358         * bindings/js/JSVideoTrackCustom.cpp:
3359         (WebCore::JSVideoTrack::setKind): Ditto.
3360         (WebCore::JSVideoTrack::setLanguage): Ditto.
3361
3362         * bindings/scripts/CodeGeneratorJS.pm:
3363         (GenerateImplementation): Use "=" syntax instead of constructor style syntax for
3364         the argument processing. I think this is more readable.
3365         (GenerateParametersCheck): For the enum code path, did the more efficient auto&
3366         idiom to avoid ref/deref on a string. For the toExistingAtomicString path,
3367         restructured so we don't have to check the flag indicating that something is atomic.
3368         Later we could also avoid the ref/deref; added a FIXME about that.
3369         (GetNativeType): Use String, not const String, for local variables. Sure, the
3370         string is const, but so is every other local variable type we use! No need to be
3371         wordy about it.
3372         (JSValueToNative): Removed the uneeded calls to isEmpty. Since the call sites no
3373         longer use construction syntax, used initializer syntax style for a couple classes
3374         that are constructed with multiple arguments.
3375
3376         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Updated.
3377         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Ditto.
3378         * bindings/scripts/test/JS/JSTestEventTarget.cpp: Ditto.
3379         * bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
3380         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Ditto.
3381         * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Ditto.
3382         * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
3383         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Ditto.
3384         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Ditto.
3385         * bindings/scripts/test/JS/JSTestTypedefs.cpp: Ditto.
3386
3387 2015-06-09  Csaba Osztrogonác  <ossy@webkit.org>
3388
3389         Fix unused private field warning in GraphicsLayerUpdater.h
3390         https://bugs.webkit.org/show_bug.cgi?id=145757
3391
3392         Reviewed by Darin Adler.
3393
3394         * platform/graphics/GraphicsLayerUpdater.cpp:
3395         (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
3396         * platform/graphics/GraphicsLayerUpdater.h:
3397
3398 2015-06-09  Yusuke Suzuki  <utatane.tea@gmail.com>
3399
3400         Crash when passing Symbol to NPAPI plugin objects
3401         https://bugs.webkit.org/show_bug.cgi?id=145798
3402
3403         Reviewed by Darin Adler.
3404
3405         Test: plugins/npruntime/script-object-with-symbols.html
3406
3407         For C bridge APIs, we add guards for symbols.
3408         This is the same to the existing guards in Objective-C APIs.
3409
3410         * bridge/c/c_class.cpp:
3411         (JSC::Bindings::CClass::methodNamed):
3412         (JSC::Bindings::CClass::fieldNamed):
3413         * bridge/objc/objc_class.mm:
3414         (JSC::Bindings::ObjcClass::methodNamed):
3415         (JSC::Bindings::ObjcClass::fieldNamed):
3416         (JSC::Bindings::ObjcClass::fallbackObject):
3417
3418 2015-06-09  Csaba Osztrogonác  <ossy@webkit.org>
3419
3420         [cmake] Fix the style issues in cmake project files
3421         https://bugs.webkit.org/show_bug.cgi?id=145755
3422
3423         Reviewed by Darin Adler.
3424
3425         * CMakeLists.txt:
3426         * PlatformEfl.cmake:
3427         * PlatformGTK.cmake:
3428         * PlatformMac.cmake:
3429         * PlatformWin.cmake:
3430         * PlatformWinCairo.cmake:
3431
3432 2015-06-09  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3433
3434         [Streams API] ReadableJSStream should handle JS source getters that throw
3435         https://bugs.webkit.org/show_bug.cgi?id=145600
3436
3437         Reviewed by Darin Adler.
3438
3439         Checking whether there is an exception when trying to access to a source method.
3440         If so, rethrowing it in case of "start".
3441
3442         Refactoring of code to prepare pulling, cancelling and additional parameter handling in ReadableStream construtor.
3443
3444         Fixed the case of ReadableStream constructor called with an undefined parameter.
3445
3446         Covered by rebased test expectation.
3447
3448         * bindings/js/JSReadableStreamCustom.cpp:
3449         (WebCore::constructJSReadableStream): Refactoring to group all parameter check and exception handling in ReadableJSStream::create.
3450         * bindings/js/ReadableJSStream.cpp:
3451         (WebCore::getPropertyFromObject):
3452         (WebCore::callFunction):
3453         (WebCore::ReadableJSStream::invoke): Added method to be used also for pulling and cancelling.
3454         (WebCore::ReadableJSStream::doStart):
3455         (WebCore::ReadableJSStream::create):
3456         * bindings/js/ReadableJSStream.h:
3457
3458 2015-06-08  Dan Bernstein  <mitz@apple.com>
3459
3460         Made MicroTask.h a project header.
3461
3462         Rubber-stamped by Anders Carlsson.
3463
3464         * WebCore.xcodeproj/project.pbxproj: Demoted MicroTask.h from Public to Project. WebCore
3465         doesn’t have public headers, and this header isn’t used by WebKit.
3466
3467 2015-06-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3468
3469         Purge PassRefPtr in JavaScriptCore
3470         https://bugs.webkit.org/show_bug.cgi?id=145750
3471
3472         Reviewed by Darin Adler.
3473
3474         As a step to purge PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr.
3475
3476         No new tests, no behavior changes.
3477
3478         * bindings/js/JSDOMWindowBase.cpp:
3479         (WebCore::JSDOMWindowBase::commonVM):
3480
3481 2015-06-08  Zalan Bujtas  <zalan@apple.com>
3482
3483         Subpixel rendering: Clip-path does not work properly on subpixel positions.
3484         https://bugs.webkit.org/show_bug.cgi?id=145749
3485         rdar://problem/20824305
3486
3487         Reviewed by Simon Fraser.
3488
3489         This patch ensures that clip-path is device pixel snapped both for composited and
3490         non-composited content.
3491
3492         Tests: compositing/masks/compositing-clip-path-on-subpixel-position.html
3493                fast/masking/clip-path-on-subpixel-position.html
3494
3495         * rendering/RenderLayer.cpp:
3496         (WebCore::RenderLayer::setupClipPath):
3497         * rendering/RenderLayerBacking.cpp:
3498         (WebCore::RenderLayerBacking::updateMaskingLayerGeometry):
3499
3500 2015-06-08  Chris Dumez  <cdumez@apple.com>
3501
3502         Access GCController instance via GCController::singleton() instead of a free function
3503         https://bugs.webkit.org/show_bug.cgi?id=145776
3504
3505         Reviewed by Darin Adler.
3506
3507         Access GCController instance via GCController::singleton() instead of a
3508         free function as per coding style and for consistency with other
3509         singleton classes in the codebase.
3510
3511         * bindings/js/GCController.cpp:
3512         (WebCore::GCController::singleton):
3513         (WebCore::gcController): Deleted.
3514         * bindings/js/GCController.h:
3515         * bindings/js/JSDOMWindowShell.cpp:
3516         (WebCore::JSDOMWindowShell::setWindow):
3517         * bindings/js/ScriptCachedFrameData.cpp:
3518         (WebCore::ScriptCachedFrameData::clear):
3519         * bindings/js/ScriptController.cpp:
3520         (WebCore::collectGarbageAfterWindowShellDestruction):
3521         * platform/MemoryPressureHandler.cpp:
3522         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
3523
3524 2015-06-08  Daniel Bates  <dabates@apple.com>
3525
3526         Mouse release on AutoFill button activates it; should only activate on click
3527         https://bugs.webkit.org/show_bug.cgi?id=145774
3528         <rdar://problem/21069245>
3529
3530         Reviewed by Ryosuke Niwa.
3531
3532         Fixes an issue where a click event was dispatched to a shadow tree node regardless of whether
3533         both the mouse press and mouse release were targeted at it. In particular, releasing the mouse
3534         on the AutoFill button activates it regardless of whether the mouse was pressed on it.
3535
3536         Currently we always dispatch a click event to a node n where the mouse was released when n is
3537         in a shadow tree regardless of whether the mouse was pressed on n. Instead we should only
3538         dispatch a click event to n if the mouse was pressed and released on n. If n is a shadow tree
3539         descendant, the mouse was released on n, and n never received a mouse press then we should
3540         dispatch the click event at the shadow host element of n to preserve the illusion to web
3541         developers that the shadow host element is a single element.
3542
3543         Test: fast/forms/auto-fill-button/mouse-down-input-mouse-release-auto-fill-button.html
3544
3545         * page/EventHandler.cpp:
3546         (WebCore::targetNodeForClickEvent): Added; returns the target node for the DOM click event.
3547         (WebCore::EventHandler::handleMouseReleaseEvent): Modified to use dispatch the DOM click event
3548         at the node returned by targetNodeForClickEvent().
3549         (WebCore::mouseIsReleasedOnPressedElement): Deleted.
3550
3551 2015-06-08  Chris Dumez  <cdumez@apple.com>
3552
3553         WebContent crash in WebCore::Page::sessionID() const + 0 (Page.cpp:1660)
3554         https://bugs.webkit.org/show_bug.cgi?id=145748
3555         <rdar://problem/21226577>
3556
3557         Reviewed by Brady Eidson.
3558
3559         We would sometimes crash when pruning the PageCache because it was
3560         possible for frames to still be loading while in the PageCache and
3561         we would try to stop the load when the CachedFrame is destroyed. This
3562         code path was not supposed to be exercised as we were not supposed to
3563         have pages still loading inside the PageCache.
3564
3565         r185017 made sure we don't insert into the PageCache pages that are
3566         still loading. However, nothing was preventing content from starting
3567         new loads in their 'pagehide' event handlers, *after* the decision
3568         to put the page in the PageCache was made.
3569
3570         This patch prevents content from starting loads from a 'pagehide'
3571         event handler so that we can no longer have content that is loading
3572         inside the PageCache. 'ping' image loads still go through though as
3573         these are specially handled and use PingLoaders.
3574
3575         Tests: http/tests/navigation/image-load-in-pagehide-handler.html
3576                http/tests/navigation/subframe-pagehide-handler-starts-load.html
3577                http/tests/navigation/subframe-pagehide-handler-starts-load2.html
3578
3579         * loader/FrameLoader.cpp:
3580         (WebCore::FrameLoader::FrameLoader):
3581         (WebCore::FrameLoader::stopLoading):
3582         (WebCore::FrameLoader::loadURL):
3583         (WebCore::FrameLoader::loadWithDocumentLoader):
3584         (WebCore::FrameLoader::stopAllLoaders):
3585         (WebCore::FrameLoader::handleBeforeUnloadEvent):
3586         * loader/FrameLoader.h:
3587         (WebCore::FrameLoader::pageDismissalEventBeingDispatched):
3588         (WebCore::FrameLoader::PageDismissalEventType::PageDismissalEventType):
3589         (WebCore::FrameLoader::PageDismissalEventType::operator Page::DismissalType):
3590
3591         Add wrapper class for m_pageDismissalEventBeingDispatched member type.
3592         The wrapper takes care of updating the m_dismissalEventBeingDispatched
3593         member on the Page every time the member on FrameLoader is updated. We
3594         now cache this information on the Page so that clients can cheaply
3595         query if a dismissal event is being dispatched in any of the Page's
3596         frame, without having to traverse the frame tree.
3597
3598         * loader/ImageLoader.cpp:
3599         (WebCore::pageIsBeingDismissed):
3600
3601         * loader/cache/CachedResource.cpp:
3602         (WebCore::CachedResource::load):
3603
3604         Abort the load early if we are currently dispatching a 'pagehide'
3605         event. We don't allow new loads at such point because we've already
3606         made the decision to add the Page to the PageCache.
3607
3608         * loader/cache/CachedResourceLoader.cpp:
3609         (WebCore::CachedResourceLoader::requestImage):
3610
3611         * page/Chrome.cpp:
3612         (WebCore::Chrome::runModal): Deleted.
3613         (WebCore::Chrome::setToolbarsVisible): Deleted.
3614         (WebCore::Chrome::toolbarsVisible): Deleted.
3615         (WebCore::Chrome::runJavaScriptConfirm): Deleted.
3616         (WebCore::Chrome::runJavaScriptPrompt): Deleted.
3617         (WebCore::Chrome::shouldInterruptJavaScript): Deleted.
3618         * page/Chrome.h:
3619         * page/ChromeClient.h:
3620         * page/DOMWindow.cpp:
3621         (WebCore::DOMWindow::canShowModalDialogNow):
3622
3623         Drop ChromeClient::shouldRunModalDialogDuringPageDismissal() and code
3624         using it as it is unused and I did not think it was worth updating
3625         this code.
3626
3627         * page/Page.h:
3628         (WebCore::Page::dismissalEventBeingDispatched):
3629         (WebCore::Page::setDismissalEventBeingDispatched):
3630
3631         Add a m_dismissalEventBeingDispatched member to the Page so that we can
3632         easily query if a dismissal event is being dispatched in any of the
3633         frames, without having to traverse the frame tree. I suspect more call
3634         sites of FrameLoader::pageDismissalEventBeingDispatched() may actually
3635         want this but I did not make such change in this patch. It is important
3636         to check all the frames and not simply the current one because a frame's
3637         pagehide event handler may trigger a load in another frame.
3638
3639 2015-06-08  Hunseop Jeong  <hs85.jeong@samsung.com>
3640
3641         Replaced 0 with nullptr in WebCore/Modules.
3642         https://bugs.webkit.org/show_bug.cgi?id=145758
3643
3644         Reviewed by Darin Adler.
3645
3646         No new tests, no behavior changes.
3647
3648         * Modules/battery/BatteryManager.cpp:
3649         (WebCore::BatteryManager::BatteryManager):
3650         * Modules/encryptedmedia/CDM.cpp:
3651         (WebCore::CDM::CDM):
3652         * Modules/encryptedmedia/MediaKeys.cpp:
3653         (WebCore::MediaKeys::MediaKeys):
3654         (WebCore::MediaKeys::~MediaKeys):
3655         * Modules/indexeddb/IDBCursor.h:
3656         (WebCore::IDBCursor::continueFunction):
3657         * Modules/indexeddb/IDBCursorBackendOperations.cpp:
3658         (WebCore::CursorAdvanceOperation::perform):
3659         (WebCore::CursorIterationOperation::perform):
3660         * Modules/indexeddb/IDBDatabase.cpp:
3661         (WebCore::IDBDatabase::transactionFinished):
3662         * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
3663         (WebCore::IDBDatabaseCallbacksImpl::IDBDatabaseCallbacksImpl):
3664         * Modules/indexeddb/IDBEventDispatcher.cpp:
3665         (WebCore::IDBEventDispatcher::dispatch):
3666         * Modules/indexeddb/IDBIndex.h:
3667         (WebCore::IDBIndex::openCursor):
3668         (WebCore::IDBIndex::count):
3669         (WebCore::IDBIndex::openKeyCursor):
3670         * Modules/indexeddb/IDBObjectStore.cpp:
3671         (WebCore::IDBObjectStore::add):
3672         (WebCore::IDBObjectStore::put):
3673         (WebCore::IDBObjectStore::index):
3674         (WebCore::IDBObjectStore::openCursor):
3675         * Modules/indexeddb/IDBObjectStore.h:
3676         (WebCore::IDBObjectStore::count):
3677         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3678         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
3679         (WebCore::IDBOpenDBRequest::onSuccess):
3680         * Modules/indexeddb/IDBRequest.cpp:
3681         (WebCore::IDBRequest::IDBRequest):
3682         * Modules/indexeddb/IDBTransaction.cpp:
3683         (WebCore::IDBTransaction::OpenCursorNotifier::cursorFinished):
3684         * Modules/indexeddb/IDBTransactionBackend.cpp:
3685         (WebCore::IDBTransactionBackend::commit):
3686         * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
3687         (WebCore::OpenCursorOperation::perform):
3688         * Modules/indieui/UIRequestEvent.cpp:
3689         (WebCore::UIRequestEventInit::UIRequestEventInit):
3690         (WebCore::UIRequestEvent::UIRequestEvent):
3691         * Modules/mediasource/MediaSource.cpp:
3692         (WebCore::MediaSource::MediaSource):
3693         (WebCore::MediaSource::setReadyState):
3694         (WebCore::MediaSource::removeSourceBuffer):
3695         * Modules/mediasource/SourceBuffer.cpp:
3696         (WebCore::SourceBuffer::~SourceBuffer):
3697         (WebCore::SourceBuffer::removedFromMediaSource):
3698         * Modules/mediastream/MediaStream.cpp:
3699         (WebCore::MediaStream::~MediaStream):
3700         * Modules/mediastream/MediaStreamEvent.cpp:
3701         (WebCore::MediaStreamEventInit::MediaStreamEventInit):
3702         * Modules/mediastream/MediaStreamTrackEvent.cpp:
3703         (WebCore::MediaStreamTrackEventInit::MediaStreamTrackEventInit):
3704         * Modules/mediastream/RTCDataChannel.cpp:
3705         (WebCore::RTCDataChannel::stop):
3706         * Modules/mediastream/UserMediaRequest.cpp:
3707         (WebCore::UserMediaRequest::contextDestroyed):
3708         * Modules/notifications/Notification.cpp:
3709         (WebCore::Notification::Notification):
3710         * Modules/notifications/Notification.h:
3711         * Modules/speech/SpeechSynthesis.cpp:
3712         (WebCore::SpeechSynthesis::SpeechSynthesis):
3713         (WebCore::SpeechSynthesis::setPlatformSynthesizer):
3714         (WebCore::SpeechSynthesis::cancel):
3715         (WebCore::SpeechSynthesis::handleSpeakingCompleted):
3716         * Modules/speech/SpeechSynthesisUtterance.cpp:
3717         (WebCore::SpeechSynthesisUtterance::~SpeechSynthesisUtterance):
3718         * Modules/webaudio/AudioBufferSourceNode.cpp:
3719         (WebCore::AudioBufferSourceNode::AudioBufferSourceNode):
3720         (WebCore::AudioBufferSourceNode::clearPannerNode):
3721         * Modules/webaudio/AudioContext.cpp:
3722         (WebCore::AudioContext::createMediaStreamSource):
3723         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
3724         (WebCore::MediaElementAudioSourceNode::~MediaElementAudioSourceNode):
3725         * Modules/webaudio/OscillatorNode.cpp:
3726         (WebCore::OscillatorNode::setType):
3727         (WebCore::OscillatorNode::process):
3728         * Modules/webdatabase/DatabaseManager.cpp:
3729         (WebCore::DatabaseManager::DatabaseManager):
3730         * Modules/webdatabase/DatabaseThread.cpp:
3731         (WebCore::DatabaseThread::DatabaseThread):
3732         (WebCore::DatabaseThread::databaseThread):
3733         * Modules/webdatabase/DatabaseThread.h:
3734         * Modules/webdatabase/DatabaseTracker.cpp:
3735         (WebCore::DatabaseTracker::DatabaseTracker):
3736         * Modules/webdatabase/SQLCallbackWrapper.h:
3737         (WebCore::SQLCallbackWrapper::clear):
3738         (WebCore::SQLCallbackWrapper::unwrap):
3739         * Modules/webdatabase/SQLStatementBackend.cpp:
3740         (WebCore::SQLStatementBackend::clearFailureDueToQuota):
3741         * Modules/webdatabase/SQLTransaction.cpp:
3742         (WebCore::SQLTransaction::deliverTransactionErrorCallback):
3743         * Modules/webdatabase/SQLTransactionBackend.cpp:
3744         (WebCore::SQLTransactionBackend::doCleanup):
3745         (WebCore::SQLTransactionBackend::getNextStatement):
3746         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
3747         (WebCore::SQLTransactionCoordinator::releaseLock):
3748         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
3749         (WebCore::ThreadableWebSocketChannelClientWrapper::ThreadableWebSocketChannelClientWrapper):
3750         (WebCore::ThreadableWebSocketChannelClientWrapper::clearPeer):
3751         (WebCore::ThreadableWebSocketChannelClientWrapper::clearClient):
3752         * Modules/websockets/WebSocket.cpp:
3753         (WebCore::WebSocket::stop):
3754         * Modules/websockets/WebSocketChannel.cpp:
3755         (WebCore::WebSocketChannel::disconnect):
3756         (WebCore::WebSocketChannel::didCloseSocketStream):
3757         * Modules/websockets/WebSocketFrame.h:
3758         * Modules/websockets/WebSocketHandshake.cpp:
3759         (WebCore::WebSocketHandshake::clearScriptExecutionContext):
3760         (WebCore::WebSocketHandshake::readStatusLine):
3761         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
3762         (WebCore::WorkerThreadableWebSocketChannel::Peer::disconnect):
3763         (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
3764         (WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge):
3765
3766 2015-06-08  Chris Fleizach  <cfleizach@apple.com>
3767
3768         AX: improve list heuristics (presentational use versus actual lists)
3769        ​https://bugs.webkit.org/show_bug.cgi?id=134187
3770
3771         Unreviewed. Rolling this change out temporarily.
3772
3773         * accessibility/AccessibilityList.cpp:
3774         (WebCore::AccessibilityList::isDescriptionList):
3775         (WebCore::AccessibilityList::determineAccessibilityRole):
3776         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers): Deleted.
3777         * accessibility/AccessibilityList.h:
3778
3779 2015-06-08  Eric Carlson  <eric.carlson@apple.com>
3780
3781         [Mac] Enable AVFoundation by default when QTKit is disabled by default
3782         https://bugs.webkit.org/show_bug.cgi?id=145760
3783
3784         Reviewed by Alexey Proskuryakov.
3785
3786         No new tests, this change makes existing tests pass.
3787
3788         Settings::gAVFoundationEnabled defaults to true.
3789
3790         * page/Settings.cpp:
3791         (WebCore::invalidateAfterGenericFamilyChange):
3792
3793 2015-06-08  Ryosuke Niwa  <rniwa@webkit.org>
3794
3795         Explicitly dismiss correction panel when user types a new character
3796         https://bugs.webkit.org/show_bug.cgi?id=145732
3797         <rdar://problem/19596892>
3798
3799         Reviewed by Darin Adler.
3800
3801         Explicitly dismiss the correction panel when the user types a new character.
3802         This patch shouldn't change any behavior we're currently relying on AppKit to do the same.
3803
3804         Manually ran tests in ManualTests/autocorrection.
3805
3806         * editing/AlternativeTextController.cpp:
3807         (WebCore::AlternativeTextController::respondToAppliedEditing):
3808
3809 2015-06-08  Javier Fernandez  <jfernandez@igalia.com>
3810
3811         [CSS Grid Layout] Setting height on a grid item doesn't have any effect
3812         https://bugs.webkit.org/show_bug.cgi?id=145604
3813
3814         Reviewed by Sergio Villar Senin.
3815
3816         Box Alignment spec states that stretch is only possible when height is
3817         'auto' and no 'auto' margins are used.
3818
3819         It might be the case that style changes so that stretching is not allowed,
3820         hence we need to detect it and clear the override height the stretching
3821         algorithm previously set. The new layout triggered by the style change
3822         will then set grid item's height according to the new style rules.
3823
3824         Test: fast/css-grid-layout/grid-item-should-not-be-stretched-when-height-or-margin-change.html
3825
3826         * rendering/RenderGrid.cpp:
3827         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
3828
3829 2015-06-08  Brady Eidson  <beidson@apple.com>
3830
3831         Completely remove all IDB properties/constructors when it is disabled at runtime.
3832         rdar://problem/18429374 and https://bugs.webkit.org/show_bug.cgi?id=137034
3833
3834         Reviewed by Geoffrey Garen.
3835
3836         Test: storage/indexeddb/properties-disabled-at-runtime.html
3837
3838         - Make constructors all runtime enabled.
3839         - Remove autogeneration of the window.(webkit)indexedDB accessors.
3840         - Add manual overrides for the (webkit)indexedDB accessors at runtime.
3841         
3842         * Modules/indexeddb/DOMWindowIndexedDatabase.idl:
3843         * Modules/indexeddb/IDBAny.idl:
3844         * Modules/indexeddb/IDBCursor.idl:
3845         * Modules/indexeddb/IDBCursorWithValue.idl:
3846         * Modules/indexeddb/IDBDatabase.idl:
3847         * Modules/indexeddb/IDBFactory.idl:
3848         * Modules/indexeddb/IDBIndex.idl:
3849         * Modules/indexeddb/IDBKeyRange.idl:
3850         * Modules/indexeddb/IDBObjectStore.idl:
3851         * Modules/indexeddb/IDBOpenDBRequest.idl:
3852         * Modules/indexeddb/IDBRequest.idl:
3853         * Modules/indexeddb/IDBTransaction.idl:
3854         * Modules/indexeddb/IDBVersionChangeEvent.idl:
3855         * page/DOMWindow.idl:
3856
3857         * bindings/js/JSDOMWindowCustom.cpp:
3858         (WebCore::jsDOMWindowIndexedDB):
3859         (WebCore::JSDOMWindow::getOwnPropertySlot):
3860
3861 2015-06-08  Michael Catanzaro  <mcatanzaro@igalia.com>
3862
3863         [SOUP] Performs DNS prefetch when a proxy is configured (information leak)
3864         https://bugs.webkit.org/show_bug.cgi?id=145542
3865
3866         Reviewed by Alexey Proskuryakov.
3867
3868         No new tests, because it's hard to test whether a DNS request has been sent. We could do
3869         this by adding new API to modify the GProxyResolver and GResolver used by the SoupSession in
3870         the network process, but even if such API were desirable, it would be a big job. Tests
3871         should not be allowed to dictate our public API.
3872
3873         * platform/network/DNSResolveQueue.cpp:
3874         (WebCore::DNSResolveQueue::add): Do not check whether the system is using a proxy, since
3875         this can't be determined for all ports here.
3876         (WebCore::DNSResolveQueue::timerFired): Do not check whether the system is using a proxy,
3877         since this can't be determined for all ports here.
3878         (WebCore::DNSResolveQueue::DNSResolveQueue): Remove member variables and member functions
3879         that are only needed by the CF backend. Rename platformResolve to
3880         platformMaybeResolveHost.
3881         (WebCore::DNSResolveQueue::isUsingProxy): Moved to DNSCFNet.cpp.
3882         * platform/network/DNSResolveQueue.h: Remove member variables that are only needed by the
3883         CF backend.
3884         * platform/network/cf/DNSCFNet.cpp:
3885         (WebCore::proxyIsEnabledInSystemPreferences): Renamed from
3886         platformProxyIsEnabledInSystemPreferences.
3887         (WebCore::isUsingProxy): Moved from DNSResolveQueue.cpp. The member variables removed from
3888         DNSResolveQueue are not static here. This is safe since it's a singleton.
3889         (WebCore::DNSResolveQueue::platformMaybeResolveHost): Renamed from platformResolve.
3890         Bail early from here if a proxy is configured.
3891         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences): Renamed to
3892         proxyIsEnabledInSystemPreferences.
3893         (WebCore::DNSResolveQueue::platformResolve): Renamed to platformMaybeResolveHost.
3894         * platform/network/soup/DNSSoup.cpp:
3895         (WebCore::gotProxySettingsCallback): Added. Call soup_session_prefetch_dns from here only
3896         if a proxy would not be used to resolve the host.
3897         (WebCore::DNSResolveQueue::platformMaybeResolveHost): Renamed from platformResolve.
3898         Look up proxy settings using g_proxy_resolver_lookup_async rather than calling
3899         soup_session_prefetch_dns directly.
3900         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences): Deleted.
3901         (WebCore::DNSResolveQueue::platformResolve): Renamed to platformMaybeResolveHost.
3902
3903 2015-06-08  Hunseop Jeong  <hs85.jeong@samsung.com>
3904
3905         Use modern for-loops in WebCore/Modules - 2
3906         https://bugs.webkit.org/show_bug.cgi?id=145541
3907
3908         Reviewed by Darin Adler.
3909
3910         No new tests, no behavior changes.
3911
3912         * Modules/mediastream/RTCConfiguration.h:
3913         (WebCore::RTCConfiguration::iceServers):
3914         * Modules/mediastream/RTCDTMFSender.cpp:
3915         (WebCore::RTCDTMFSender::scheduledEventTimerFired):
3916         * Modules/mediastream/RTCDataChannel.cpp:
3917         (WebCore::RTCDataChannel::scheduledEventTimerFired):
3918         * Modules/mediastream/RTCPeerConnection.cpp:
3919         (WebCore::processIceServer):
3920         (WebCore::RTCPeerConnection::~RTCPeerConnection):
3921         (WebCore::RTCPeerConnection::getStreamById):
3922         (WebCore::RTCPeerConnection::hasLocalStreamWithTrackId):
3923         (WebCore::RTCPeerConnection::stop):
3924         (WebCore::RTCPeerConnection::scheduledEventTimerFired):
3925         * Modules/mediastream/RTCStatsReport.cpp:
3926         (WebCore::RTCStatsReport::names):
3927         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
3928         (WebCore::initProtocolHandlerWhitelist):
3929         * Modules/speech/SpeechSynthesis.cpp:
3930         (WebCore::SpeechSynthesis::getVoices):
3931         * Modules/webaudio/AudioBuffer.cpp:
3932         (WebCore::AudioBuffer::memoryCost):
3933         * Modules/webaudio/AudioContext.cpp:
3934         (WebCore::AudioContext::createMediaStreamSource):
3935         (WebCore::AudioContext::derefFinishedSourceNodes):
3936         (WebCore::AudioContext::derefUnfinishedSourceNodes):
3937         (WebCore::AudioContext::handleDeferredFinishDerefs):
3938         (WebCore::AudioContext::handleDirtyAudioSummingJunctions):
3939         (WebCore::AudioContext::handleDirtyAudioNodeOutputs):
3940         (WebCore::AudioContext::updateAutomaticPullNodes):
3941         (WebCore::AudioContext::processAutomaticPullNodes):
3942         * Modules/webaudio/AudioNode.cpp:
3943         (WebCore::AudioNode::updateChannelsForInputs):
3944         (WebCore::AudioNode::checkNumberOfChannelsForInput):
3945         (WebCore::AudioNode::pullInputs):
3946         (WebCore::AudioNode::inputsAreSilent):
3947         (WebCore::AudioNode::silenceOutputs):
3948         (WebCore::AudioNode::unsilenceOutputs):
3949         (WebCore::AudioNode::enableOutputsIfNecessary):
3950         (WebCore::AudioNode::disableOutputsIfNecessary):
3951         (WebCore::AudioNode::finishDeref):
3952         * Modules/webaudio/AudioNodeInput.cpp:
3953         (WebCore::AudioNodeInput::numberOfChannels):
3954         (WebCore::AudioNodeInput::sumAllConnections):
3955         * Modules/webaudio/AudioNodeOutput.cpp:
3956         (WebCore::AudioNodeOutput::propagateChannelCount):
3957         (WebCore::AudioNodeOutput::disable):
3958         (WebCore::AudioNodeOutput::enable):
3959         * Modules/webaudio/AudioParam.cpp:
3960         (WebCore::AudioParam::calculateFinalValues):
3961         * Modules/webaudio/AudioParamTimeline.cpp:
3962         (WebCore::AudioParamTimeline::insertEvent):
3963         * Modules/webaudio/AudioSummingJunction.cpp:
3964         (WebCore::AudioSummingJunction::updateRenderingState):
3965         * Modules/webaudio/MediaStreamAudioSource.cpp:
3966         (WebCore::MediaStreamAudioSource::setAudioFormat):
3967         (WebCore::MediaStreamAudioSource::consumeAudio):
3968         * Modules/webaudio/WaveShaperProcessor.cpp:
3969         (WebCore::WaveShaperProcessor::setOversample):
3970         * Modules/webdatabase/DatabaseThread.cpp:
3971         (WebCore::DatabaseThread::handlePausedQueue):
3972         (WebCore::DatabaseThread::databaseThread):
3973         * Modules/webdatabase/DatabaseTracker.cpp:
3974         (WebCore::DatabaseTracker::interruptAllDatabasesForContext):
3975         (WebCore::DatabaseTracker::databaseNamesForOrigin):
3976         (WebCore::DatabaseTracker::getOpenDatabases):
3977         (WebCore::DatabaseTracker::usageForOrigin):
3978         (WebCore::DatabaseTracker::deleteAllDatabases):
3979         (WebCore::DatabaseTracker::deleteOrigin):