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