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