333c2ea260429c85724f3f66ca882aceaf6e8dc7
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-10-06  Hunseop Jeong  <hs85.jeong@samsung.com>
2
3         Use modern for-loops in WebCore/html.
4         https://bugs.webkit.org/show_bug.cgi?id=149662
5
6         Reviewed by Darin Adler.
7
8         No new tests because there is no behavior change.
9
10         * html/DOMFormData.cpp:
11         (WebCore::DOMFormData::DOMFormData):
12         * html/EmailInputType.cpp:
13         (WebCore::EmailInputType::typeMismatchFor):
14         * html/FileInputType.cpp:
15         (WebCore::FileInputType::receiveDroppedFiles):
16         * html/FormController.cpp:
17         (WebCore::FormControlState::serializeTo):
18         (WebCore::FormControlState::deserialize):
19         (WebCore::SavedFormState::serializeTo):
20         (WebCore::SavedFormState::getReferencedFilePaths):
21         (WebCore::FormController::createSavedFormStateMap):
22         (WebCore::FormController::formElementsState):
23         (WebCore::FormController::restoreControlStateIn):
24         (WebCore::FormController::getReferencedFilePaths):
25         * html/HTMLAnchorElement.cpp:
26         (WebCore::hasNonEmptyBox):
27         * html/HTMLCanvasElement.cpp:
28         (WebCore::HTMLCanvasElement::~HTMLCanvasElement):
29         (WebCore::HTMLCanvasElement::notifyObserversCanvasChanged):
30         (WebCore::HTMLCanvasElement::reset):
31         (WebCore::HTMLCanvasElement::paintsIntoCanvasBuffer):
32         * html/HTMLFieldSetElement.cpp:
33         (WebCore::HTMLFieldSetElement::length):
34         * html/HTMLFormControlsCollection.cpp:
35         (WebCore::firstNamedItem):
36         * html/HTMLFormElement.cpp:
37         (WebCore::HTMLFormElement::~HTMLFormElement):
38         (WebCore::HTMLFormElement::formWouldHaveSecureSubmission):
39         (WebCore::HTMLFormElement::removedFrom):
40         (WebCore::HTMLFormElement::length):
41         (WebCore::HTMLFormElement::submitImplicitly):
42         (WebCore::HTMLFormElement::validateInteractively):
43         (WebCore::HTMLFormElement::getTextFieldValues):
44         (WebCore::HTMLFormElement::submit):
45         (WebCore::HTMLFormElement::reset):
46         (WebCore::HTMLFormElement::defaultButton):
47         (WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
48         (WebCore::HTMLFormElement::removeFromPastNamesMap):
49         (WebCore::HTMLFormElement::documentDidResumeFromPageCache):
50         * html/HTMLInputElement.cpp:
51         (WebCore::parseAcceptAttribute):
52         * html/HTMLKeygenElement.cpp:
53         (WebCore::HTMLKeygenElement::HTMLKeygenElement):
54         * html/HTMLMediaElement.cpp:
55         (WebCore::HTMLMediaElement::setMediaGroup):
56         * html/HTMLOptionElement.cpp:
57         (WebCore::HTMLOptionElement::index):
58         * html/HTMLSelectElement.cpp:
59         (WebCore::HTMLSelectElement::saveLastSelection):
60         (WebCore::HTMLSelectElement::setActiveSelectionAnchorIndex):
61         (WebCore::HTMLSelectElement::setActiveSelectionEndIndex):
62         (WebCore::HTMLSelectElement::selectedIndex):
63         (WebCore::HTMLSelectElement::deselectItemsWithoutValidation):
64         (WebCore::HTMLSelectElement::saveFormControlState):
65         (WebCore::HTMLSelectElement::restoreFormControlState):
66         (WebCore::HTMLSelectElement::appendFormData):
67         (WebCore::HTMLSelectElement::reset):
68         * html/HTMLTextAreaElement.cpp:
69         (WebCore::HTMLTextAreaElement::setDefaultValue):
70         * html/InputType.cpp:
71         (WebCore::populateInputTypeFactoryMap):
72         * html/MediaController.cpp:
73         (MediaController::duration):
74         (MediaController::setCurrentTime):
75         (MediaController::play):
76         (MediaController::setPlaybackRate):
77         (MediaController::setVolume):
78         (MediaController::setMuted):
79         (playbackStateWaiting):
80         (MediaController::updateMediaElements):
81         (MediaController::bringElementUpToSpeed):
82         (MediaController::isBlocked):
83         (MediaController::hasEnded):
84         (MediaController::asyncEventTimerFired):
85         (MediaController::clearPositionTimerFired):
86         (MediaController::hasAudio):
87         (MediaController::hasVideo):
88         (MediaController::hasClosedCaptions):
89         (MediaController::setClosedCaptionsVisible):
90         (MediaController::supportsScanning):
91         (MediaController::beginScrubbing):
92         (MediaController::endScrubbing):
93         (MediaController::canPlay):
94         (MediaController::isLiveStream):
95         (MediaController::hasCurrentSrc):
96         (MediaController::returnToRealtime):
97         * html/MediaFragmentURIParser.cpp:
98         (WebCore::MediaFragmentURIParser::parseTimeFragment):
99         * html/PublicURLManager.cpp:
100         (WebCore::PublicURLManager::revoke):
101         (WebCore::PublicURLManager::stop):
102         * html/canvas/WebGLBuffer.cpp:
103         (WebCore::WebGLBuffer::getCachedMaxIndex):
104         (WebCore::WebGLBuffer::setCachedMaxIndex):
105         (WebCore::WebGLBuffer::setTarget):
106         * html/canvas/WebGLContextGroup.cpp:
107         (WebCore::WebGLContextGroup::loseContextGroup):
108         * html/canvas/WebGLDrawBuffers.cpp:
109         (WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements):
110         * html/canvas/WebGLFramebuffer.cpp:
111         (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
112         (WebCore::WebGLFramebuffer::checkStatus):
113         (WebCore::WebGLFramebuffer::deleteObjectImpl):
114         (WebCore::WebGLFramebuffer::initializeAttachments):
115         (WebCore::WebGLFramebuffer::drawBuffers):
116         * html/canvas/WebGLRenderingContextBase.cpp:
117         (WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase):
118         (WebCore::WebGLRenderingContextBase::deleteTexture):
119         * html/canvas/WebGLVertexArrayObject.cpp:
120         (WebCore::WebGLVertexArrayObject::deleteObjectImpl):
121         * html/canvas/WebGLVertexArrayObjectOES.cpp:
122         (WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl):
123         * html/parser/AtomicHTMLToken.h:
124         (WebCore::AtomicHTMLToken::initializeAttributes):
125         * html/parser/HTMLConstructionSite.cpp:
126         (WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement):
127         * html/parser/HTMLFormattingElementList.cpp:
128         (WebCore::HTMLFormattingElementList::ensureNoahsArkCondition):
129         * html/parser/HTMLPreloadScanner.cpp:
130         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
131         * html/parser/XSSAuditor.cpp:
132         (WebCore::semicolonSeparatedValueContainsJavaScriptURL):
133         * html/shadow/ContentDistributor.cpp:
134         (WebCore::ContentDistributor::distribute):
135         (WebCore::ContentDistributor::invalidate):
136         * html/shadow/MediaControlElements.cpp:
137         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
138         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
139         (WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
140         * html/track/AudioTrackList.cpp:
141         (AudioTrackList::getTrackById):
142         * html/track/LoadableTextTrack.cpp:
143         (WebCore::LoadableTextTrack::newCuesAvailable):
144         (WebCore::LoadableTextTrack::newRegionsAvailable):
145         * html/track/TextTrackCueList.cpp:
146         (WebCore::TextTrackCueList::getCueById):
147         (WebCore::TextTrackCueList::activeCues):
148         * html/track/TextTrackList.cpp:
149         (TextTrackList::getTrackIndexRelativeToRenderedTracks):
150         (TextTrackList::invalidateTrackIndexesAfterTrack):
151         * html/track/TrackListBase.cpp:
152         (TrackListBase::isAnyTrackEnabled):
153         * html/track/VideoTrackList.cpp:
154         (VideoTrackList::getTrackById):
155
156 2015-10-06  Alex Christensen  <achristensen@webkit.org>
157
158         Report error when main resource is blocked by content blocker
159         https://bugs.webkit.org/show_bug.cgi?id=149719
160         rdar://problem/21970595
161
162         Reviewed by Brady Eidson.
163
164         Test: http/tests/contentextensions/main-resource.html
165
166         * English.lproj/Localizable.strings:
167         * contentextensions/ContentExtensionActions.h:
168         * contentextensions/ContentExtensionError.h:
169         (WebCore::ContentExtensions::make_error_code):
170         * contentextensions/ContentExtensionsBackend.cpp:
171         (WebCore::ContentExtensions::ContentExtensionsBackend::globalDisplayNoneStyleSheet):
172         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
173         Instead of nulling out the ResourceRequest, processContentExtensionRulesForLoad 
174         now returns a status indicating whether the request should be blocked.
175         This is needed because the DocumentLoader needs a CachedResource with an error representing the blocking
176         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
177         * contentextensions/ContentExtensionsBackend.h:
178         * html/HTMLMediaElement.cpp:
179         (WebCore::HTMLMediaElement::loadResource):
180         * loader/DocumentLoader.cpp:
181         (WebCore::DocumentLoader::startLoadingMainResource):
182         Dispatch an error if the resource is blocked by a content blocker.
183         * loader/EmptyClients.h:
184         * loader/FrameLoader.cpp:
185         (WebCore::FrameLoader::loadResourceSynchronously):
186         (WebCore::FrameLoader::cancelledError):
187         (WebCore::FrameLoader::blockedByContentBlockerError):
188         (WebCore::FrameLoader::connectionProperties):
189         * loader/FrameLoader.h:
190         * loader/FrameLoaderClient.h:
191         * loader/ResourceLoader.cpp:
192         (WebCore::ResourceLoader::willSendRequestInternal):
193         * loader/cache/CachedResourceLoader.cpp:
194         (WebCore::CachedResourceLoader::requestResource):
195         * page/UserContentController.cpp:
196         (WebCore::UserContentController::removeAllUserContentExtensions):
197         (WebCore::UserContentController::processContentExtensionRulesForLoad):
198         (WebCore::UserContentController::actionsForResourceLoad):
199         * page/UserContentController.h:
200         * platform/efl/ErrorsEfl.cpp:
201         (WebCore::blockedError):
202         (WebCore::blockedByContentBlockerError):
203         (WebCore::cannotShowURLError):
204         * platform/efl/ErrorsEfl.h:
205         * platform/gtk/ErrorsGtk.cpp:
206         (WebCore::blockedError):
207         (WebCore::blockedByContentBlockerError):
208         (WebCore::cannotShowURLError):
209         * platform/gtk/ErrorsGtk.h:
210
211 2015-10-06  Xabier Rodriguez Calvar  <calvaris@igalia.com>
212
213         JSBuiltinConstructor must always add builtin header
214         https://bugs.webkit.org/show_bug.cgi?id=149759
215
216         Reviewed by Darin Adler.
217
218         Covered by TestJSBuiltinConstructor.idl.
219
220         * bindings/scripts/CodeGeneratorJS.pm:
221         (AddIncludesForJSBuiltinMethods): Forces adding the builtin header when the JSBuiltinConstructor is present.
222         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: Expectation.
223
224 2015-10-05  Youenn Fablet  <youenn.fablet@crf.canon.fr>
225
226         Migrate streams API to JS Builtins
227         https://bugs.webkit.org/show_bug.cgi?id=147092
228
229         Reviewed by Darin Adler.
230
231         Moved ReadableStream implementation from C++ to JS Builtins.
232         Created specific private constructors for ReadableStreamReader and ReadableStreamController.
233         Added these constructors to  JSDOMWindowBase.
234         Constructors are based on a template found in JSDOMConstructor which might serve to webidl-generated classes as well.
235
236         Covered by existing tests.
237
238         * CMakeLists.txt:
239         * DerivedSources.make:
240         * Modules/streams/ReadableStream.cpp: Removed.
241         * Modules/streams/ReadableStream.h: Removed.
242         * Modules/streams/ReadableStream.idl:
243         * Modules/streams/ReadableStream.js:
244         (strategy.size):
245         (initializeReadableStream):
246         (cancel):
247         (getReader):
248         (pipeTo):
249         (tee):
250         (locked):
251         * Modules/streams/ReadableStreamController.h:
252         * Modules/streams/ReadableStreamController.idl:
253         * Modules/streams/ReadableStreamController.js: Added.
254         (enqueue):
255         (error):
256         (close):
257         (desiredSize):
258         * Modules/streams/ReadableStreamInternals.js:
259         (privateInitializeReadableStreamReader):
260         (privateInitializeReadableStreamController):
261         (isReadableStream):
262         (isReadableStreamReader):
263         (isReadableStreamController):
264         (errorReadableStream):
265         (requestReadableStreamPull):
266         (getReadableStreamDesiredSize):
267         (releaseReadableStreamReader):
268         (cancelReadableStream):
269         (finishClosingReadableStream):
270         (closeReadableStream):
271         (closeReadableStreamReader):
272         (enqueueInReadableStream):
273         (readFromReadableStreamReader):
274         (invokeOrNoop):
275         (promiseInvokeOrNoop):
276         * Modules/streams/ReadableStreamReader.cpp: Removed.
277         * Modules/streams/ReadableStreamReader.h:
278         * Modules/streams/ReadableStreamReader.idl:
279         * Modules/streams/ReadableStreamReader.js: Copied from Source/WebCore/Modules/streams/ReadableStream.js.
280         (cancel):
281         (read):
282         (releaseLock):
283         (closed):
284         * WebCore.vcxproj/WebCore.vcxproj:
285         * WebCore.vcxproj/WebCore.vcxproj.filters:
286         * WebCore.xcodeproj/project.pbxproj:
287         * bindings/js/JSBindingsAllInOne.cpp:
288         * bindings/js/JSDOMConstructor.h: Added.
289         (WebCore::JSBuiltinConstructor::create):
290         (WebCore::JSBuiltinConstructor::createStructure):
291         (WebCore::JSBuiltinConstructor::JSBuiltinConstructor):
292         (WebCore::JSBuiltinConstructor::initializeProperties):
293         (WebCore::JSBuiltinConstructor<JSClass>::finishCreation):
294         (WebCore::JSBuiltinConstructor<JSClass>::construct):
295         (WebCore::JSBuiltinConstructor<JSClass>::getConstructData):
296         * bindings/js/JSDOMWindowBase.cpp:
297         (WebCore::JSDOMWindowBase::finishCreation):
298         * bindings/js/JSReadableStreamControllerCustom.cpp: Removed.
299         * bindings/js/JSReadableStreamCustom.cpp: Removed.
300         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Added.
301         (WebCore::constructJSReadableStreamController):
302         (WebCore::constructJSReadableStreamReader):
303         (WebCore::JSBuiltinConstructor<JSReadableStreamReader>::createJSObject):
304         (WebCore::JSBuiltinConstructor<JSReadableStreamController>::createJSObject):
305         (WebCore::JSBuiltinReadableStreamReaderPrivateConstructor::createInitializeFunction):
306         (WebCore::JSBuiltinReadableStreamControllerPrivateConstructor::createInitializeFunction):
307         (WebCore::createReadableStreamReaderPrivateConstructor):
308         (WebCore::createReadableStreamControllerPrivateConstructor):
309         * bindings/js/JSReadableStreamPrivateConstructors.h: Added.
310         * bindings/js/JSReadableStreamReaderCustom.cpp: Removed.
311         * bindings/js/ReadableJSStream.cpp: Removed.
312         * bindings/js/ReadableJSStream.h: Removed.
313         * bindings/js/WebCoreBuiltinNames.h: Added.
314         (WebCore::WebCoreBuiltinNames::WebCoreBuiltinNames):
315         * bindings/js/WebCoreJSBuiltins.cpp:
316         * bindings/js/WebCoreJSClientData.h:
317         (WebCore::WebCoreJSClientData::WebCoreJSClientData):
318         (WebCore::WebCoreJSClientData::builtinNames):
319         (WebCore::WebCoreJSClientData::readableStreamControllerBuiltins):
320         (WebCore::WebCoreJSClientData::readableStreamReaderBuiltins):
321
322 2015-10-05  Chris Dumez  <cdumez@apple.com>
323
324         data: URLs should not be preloaded
325         https://bugs.webkit.org/show_bug.cgi?id=149829
326
327         Reviewed by Ryosuke Niwa.
328
329         Update the HTMLPreloadScanner so that data: URLs do not get preloaded.
330         There is no need as the data is already available.
331
332         Test: fast/preloader/image-data-url.html
333
334         * html/parser/HTMLPreloadScanner.cpp:
335         (WebCore::TokenPreloadScanner::StartTagScanner::shouldPreload):
336
337 2015-10-05  Jer Noble  <jer.noble@apple.com>
338
339         [iOS] REGRESSION(r190434): Media continues to play when locking screen
340         https://bugs.webkit.org/show_bug.cgi?id=149822
341
342         Reviewed by Brent Fulgham.
343
344         In MediaSessionManagerIOS.mm, both -applicationWillEnterForeground: and
345         -applicationDidBecomeActive: called
346         PlatformMediaSessionManager::applicationWillEnterForeground(), leading to the
347         PlatformMediaSession's m_interruptionCount becoming increasingly unbalanced.
348
349         Rename PlatformMediaSessionManager::applicationWillEnterForeground() to
350         applicationDidEnterForeground() to more correctly reflect when this notification will be
351         called. Add a new method, MediaSessionManagerIOS::applicationWillEnterForeground(bool),
352         whose paramater is whether the screen was locked. This allows the beginInterruption() and
353         endInterruption() methods to be correctly balanced.
354
355         Drive-by fix: remove the unimplemented declarations for application{will,did}Enter{Fore,Back}ground()
356         from PlatformMediaSession.h.
357
358         * platform/audio/PlatformMediaSession.h:
359         * platform/audio/PlatformMediaSessionManager.cpp:
360         (WebCore::PlatformMediaSessionManager::applicationDidEnterForeground):
361         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground): Deleted.
362         * platform/audio/PlatformMediaSessionManager.h:
363         * platform/audio/ios/MediaSessionManagerIOS.h:
364         * platform/audio/ios/MediaSessionManagerIOS.mm:
365         (WebCore::MediaSessionManageriOS::applicationDidEnterBackground):
366         (WebCore::MediaSessionManageriOS::applicationWillEnterForeground):
367         (-[WebMediaSessionHelper applicationWillEnterForeground:]):
368         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
369         * testing/Internals.cpp:
370         (WebCore::Internals::applicationDidEnterForeground):
371         (WebCore::Internals::applicationWillEnterForeground): Deleted.
372         * testing/Internals.h:
373         * testing/Internals.idl:
374
375 2015-10-05  Alex Christensen  <achristensen@webkit.org>
376
377         Invalid CSS Selector for Content Blockers invalidates others
378         https://bugs.webkit.org/show_bug.cgi?id=148446
379         rdar://problem/22918235
380
381         Reviewed by Benjamin Poulain.
382
383         Test: http/tests/contentextensions/invalid-selector.html
384
385         * contentextensions/ContentExtensionParser.cpp:
386         (WebCore::ContentExtensions::loadTrigger):
387         (WebCore::ContentExtensions::isValidSelector):
388         (WebCore::ContentExtensions::loadAction):
389         (WebCore::ContentExtensions::loadRule):
390         Add a check to see if a selector is valid before adding it.
391
392 2015-10-05  Jiewen Tan  <jiewen_tan@apple.com>
393
394         CSSGradientValue should check whether gradientLength is zero or not.
395         https://bugs.webkit.org/show_bug.cgi?id=149373
396         <rdar://problem/22771418>
397
398         Reviewed by Darin Adler.
399
400         This is a merge of Blink r158220,
401         https://chromiumcodereview.appspot.com/24350008
402
403         Test: fast/gradients/css3-repeating-radial-gradients-crash.html
404
405         * css/CSSGradientValue.cpp:
406         (WebCore::CSSGradientValue::addStops):
407         Check whether gradientLength > 0 before using it as denominator.
408
409 2015-10-05  Dean Jackson  <dino@apple.com>
410
411         EXT_texture_filter_anisotropic extension exposed with WEBKIT_ prefix
412         https://bugs.webkit.org/show_bug.cgi?id=149765
413         <rdar://problem/22983722>
414
415         Reviewed by Beth Dakin.
416
417         We can now remove the WEBKIT_ prefix from this extension.
418
419         Test: fast/canvas/webgl/unprefixed-anisotropic-extension.html
420
421         * html/canvas/WebGL2RenderingContext.cpp: Support the prefixed and unprefixed form.
422         (WebCore::WebGL2RenderingContext::getExtension):
423         * html/canvas/WebGLRenderingContext.cpp:
424         (WebCore::WebGLRenderingContext::getExtension):
425         (WebCore::WebGLRenderingContext::getSupportedExtensions):
426
427 2015-10-05  Dean Jackson  <dino@apple.com>
428
429         Reference cycles during SVG dependency invalidation
430         https://bugs.webkit.org/show_bug.cgi?id=149824
431         <rdar://problem/22771412>
432
433         Reviewed by Tim Horton.
434
435         Detect any reference cycles as we are invalidating.
436
437         This is mostly a merge of the following Blink commit:
438         https://chromium.googlesource.com/chromium/blink/+/a4bc83453bda89823b672877dc02247652a02d51
439
440         Test: svg/custom/reference-cycle.svg
441
442         * rendering/svg/RenderSVGResource.cpp:
443         (WebCore::removeFromCacheAndInvalidateDependencies): Keep around a hash
444         table of dependencies, so that we can detect if an element is already
445         present before marking it.
446
447 2015-10-05  Jiewen Tan  <jiewen_tan@apple.com>
448
449         Fix null pointer dereference in WebSocket::connect()        
450         https://bugs.webkit.org/show_bug.cgi?id=149311
451         <rdar://problem/22748858>
452
453         Reviewed by Chris Dumez.
454
455         This is a merge of Blink r187441,
456         https://codereview.chromium.org/785933005
457
458         Test: http/tests/websocket/construct-in-detached-frame.html
459
460         * Modules/websockets/WebSocket.cpp:
461         (WebCore::WebSocket::connect):
462         Call function implemented below instead of duplicating the code.
463         * page/ContentSecurityPolicy.cpp:
464         (WebCore::ContentSecurityPolicy::shouldBypassMainWorldContentSecurityPolicy):
465         * page/ContentSecurityPolicy.h:
466         Factor the logic to check shouldBypassMainWorldContentSecurityPolicy into 
467         a function in this class. Check Frame pointers are not null before getting 
468         shouldBypassMainWorldContentSecurityPolicy via those pointers.
469         * page/EventSource.cpp:
470         (WebCore::EventSource::create):
471         This got fixed as a bonus.
472         * xml/XMLHttpRequest.cpp:
473         (WebCore::XMLHttpRequest::open):
474         This got fixed as a bonus too.
475
476 2015-10-05  Beth Dakin  <bdakin@apple.com>
477
478         WebCore::IOSurface should ask the IOSurface for the pixel format instead of 
479         caching it
480         https://bugs.webkit.org/show_bug.cgi?id=149820
481         -and corresponding-
482         rdar://problem/22976230
483
484         Reviewed by Tim Horton.
485
486         Also there is no reason to make YUV be iOS only, so this patch removes those 
487         PLATFORM checks.
488
489         * platform/graphics/cocoa/IOSurface.h:
490         * platform/graphics/cocoa/IOSurface.mm:
491         (IOSurface::IOSurface):
492         (IOSurface::format):
493         * platform/spi/cocoa/IOSurfaceSPI.h:
494
495 2015-10-02  Ryosuke Niwa  <rniwa@webkit.org>
496
497         ShadowRoot with leading or trailing white space cause a crash
498         https://bugs.webkit.org/show_bug.cgi?id=149782
499
500         Reviewed by Chris Dumez.
501
502         Fixed the crash by adding a null pointer check since a TextNode that appears as a direct child
503         of a ShadowRoot doesn't have a parent element.
504
505         Test: fast/shadow-dom/shadow-root-with-child-whitespace-text-crash.html
506
507         * style/RenderTreePosition.cpp:
508         (WebCore::RenderTreePosition::previousSiblingRenderer):
509
510 2015-10-05  Beth Dakin  <bdakin@apple.com>
511
512         Build fix. 
513
514         * platform/spi/cocoa/IOSurfaceSPI.h:
515
516 2015-10-05  Beth Dakin  <bdakin@apple.com>
517
518         Unreviewed build fix.
519
520         * platform/spi/cocoa/IOSurfaceSPI.h:
521
522 2015-10-05  Brady Eidson  <beidson@apple.com>
523
524         Modernize IDBRequest::ReadyState into an enum class.
525         https://bugs.webkit.org/show_bug.cgi?id=149817
526
527         Reviewed by Alex Christensen.
528
529         No new tests (Refactor, no behavior change).
530
531         * Modules/indexeddb/IDBRequest.h:
532         
533         * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp:
534         (WebCore::LegacyOpenDBRequest::shouldEnqueueEvent):
535         
536         * Modules/indexeddb/legacy/LegacyRequest.cpp:
537         (WebCore::LegacyRequest::LegacyRequest):
538         (WebCore::LegacyRequest::result):
539         (WebCore::LegacyRequest::error):
540         (WebCore::LegacyRequest::errorCode):
541         (WebCore::LegacyRequest::readyState):
542         (WebCore::LegacyRequest::markEarlyDeath):
543         (WebCore::LegacyRequest::abort):
544         (WebCore::LegacyRequest::setCursorDetails):
545         (WebCore::LegacyRequest::setPendingCursor):
546         (WebCore::LegacyRequest::setResultCursor):
547         (WebCore::LegacyRequest::finishCursor):
548         (WebCore::LegacyRequest::shouldEnqueueEvent):
549         (WebCore::LegacyRequest::stop):
550         (WebCore::LegacyRequest::dispatchEvent):
551         (WebCore::LegacyRequest::transactionDidFinishAndDispatch):
552         (WebCore::LegacyRequest::enqueueEvent):
553         * Modules/indexeddb/legacy/LegacyRequest.h:
554
555 2015-10-05  Jiewen Tan  <jiewen_tan@apple.com>
556
557         Cleaning up after revision 190339
558         https://bugs.webkit.org/show_bug.cgi?id=149732
559
560         Reviewed by Myles C. Maxfield.
561
562         * xml/XSLStyleSheet.h:
563         * xml/XSLStyleSheetLibxslt.cpp:
564         (WebCore::XSLStyleSheet::compileStyleSheet):
565
566 2015-10-05  Beth Dakin  <bdakin@apple.com>
567
568         Errant space!!
569         * platform/graphics/cocoa/IOSurface.mm:
570         (IOSurface::releaseGraphicsContext):
571         (IOSurface::convertToFormat):
572
573 2015-10-05  Beth Dakin  <bdakin@apple.com>
574
575         Compress snapshots on iOS
576         https://bugs.webkit.org/show_bug.cgi?id=149814
577         -and corresponding-
578         rdar://problem/22976230
579
580         Reviewed by Simon Fraser.
581
582         Though the default is still RGBA, it is now possible to create an IOSurface 
583         that uses the YUV422 pixel format.
584         * platform/graphics/cocoa/IOSurface.h:
585         * platform/graphics/cocoa/IOSurface.mm:
586         (IOSurface::surfaceFromPool):
587         (IOSurface::create):
588         (IOSurface::createFromImage):
589         (IOSurface::IOSurface):
590         (IOSurface::releaseGraphicsContext):
591
592         In order to have a YUV IOSurface, we actually have to create an RGBA surface 
593         first and then convert it to YUV, so this class method will handle that.
594         (IOSurface::convertToFormat):
595
596         Necessary SPI.
597         * platform/spi/cocoa/IOSurfaceSPI.h:
598
599 2015-10-05  Zalan Bujtas  <zalan@apple.com>
600
601         Mark the line dirty when RenderQuote's text changes.
602         https://bugs.webkit.org/show_bug.cgi?id=149784
603         rdar://problem/22558169
604
605         Reviewed by Antti Koivisto.
606
607         When quotation mark changes ( " -> ' or empty string), we
608         need to mark the line dirty to ensure its content gets laid out properly.
609
610         Test: fast/inline/quotation-text-changes-dynamically.html
611
612         * rendering/RenderQuote.cpp:
613         (WebCore::quoteTextRenderer):
614         (WebCore::RenderQuote::updateText):
615         (WebCore::fragmentChild): Deleted.
616
617 2015-10-03  Filip Pizlo  <fpizlo@apple.com>
618
619         Allow an object's marking state to track The Three Colors
620         https://bugs.webkit.org/show_bug.cgi?id=149654
621
622         Reviewed by Geoffrey Garen.
623
624         No new tests because no new behavior.
625
626         * bindings/scripts/CodeGeneratorJS.pm:
627         (GenerateImplementation):
628
629 2015-10-05  Katlyn Graff  <kgraff@apple.com>
630
631         Update setImageSmoothingQuality for additional reviews.
632         https://bugs.webkit.org/show_bug.cgi?id=149541
633
634         Reviewed by Chris Dumez.
635
636         * html/canvas/CanvasRenderingContext2D.cpp:
637         (WebCore::CanvasRenderingContext2D::setImageSmoothingQuality):
638
639 2015-10-05  Andreas Kling  <akling@apple.com>
640
641         Remove unused HistoryItem::targetItem()
642         <https://webkit.org/b/149803>
643
644         Reviewed by Anders Carlsson.
645
646         This is ancient code with no remaining clients since 2010 (r53650)
647
648         * history/HistoryItem.cpp:
649         (WebCore::HistoryItem::findTargetItem): Deleted.
650         (WebCore::HistoryItem::targetItem): Deleted.
651         * history/HistoryItem.h:
652
653 2015-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
654
655         Unprefix -webkit-font-feature-settings
656         https://bugs.webkit.org/show_bug.cgi?id=149722
657
658         Reviewed by Sam Weinig.
659
660         * css/CSSComputedStyleDeclaration.cpp:
661         (WebCore::ComputedStyleExtractor::propertyValue):
662         * css/CSSParser.cpp:
663         (WebCore::CSSParser::parseValue):
664         (WebCore::CSSParser::parseFontFeatureSettings):
665         * css/CSSPropertyNames.in:
666         * css/CSSValueKeywords.in:
667         * css/StyleBuilderCustom.h:
668         (WebCore::StyleBuilderCustom::applyInitialFontFeatureSettings):
669         (WebCore::StyleBuilderCustom::applyInheritFontFeatureSettings):
670         (WebCore::StyleBuilderCustom::applyInitialWebkitFontFeatureSettings): Deleted.
671         (WebCore::StyleBuilderCustom::applyInheritWebkitFontFeatureSettings): Deleted.
672
673 2015-10-05  Zan Dobersek  <zdobersek@igalia.com>
674
675         [GStreamer] Replace uses of std::bind() with lambdas
676         https://bugs.webkit.org/show_bug.cgi?id=149802
677
678         Reviewed by Carlos Garcia Campos.
679
680         Instead of std::bind(), use C++ lambdas to create std::function<>
681         wrappers in GStreamer-related class implementations.
682
683         Ref-counted classes are protected by capturing a RefPtr object.
684         GstObject-derived objects are protected by capturing a GRefPtr object.
685         Necessary specializations for WebKitVideoSink and WebKitWebSrc are added.
686
687         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
688         (WebCore::AudioFileReader::createBus):
689         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
690         (WTF::adoptGRef):
691         (WTF::refGPtr<WebKitVideoSink>):
692         (WTF::derefGPtr<WebKitVideoSink>):
693         (WTF::refGPtr<WebKitWebSrc>):
694         (WTF::derefGPtr<WebKitWebSrc>):
695         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
696         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
697         (WebCore::InbandTextTrackPrivateGStreamer::handleSample):
698         (WebCore::InbandTextTrackPrivateGStreamer::streamChanged):
699         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
700         (WebCore::MediaPlayerPrivateGStreamer::videoChanged):
701         (WebCore::MediaPlayerPrivateGStreamer::videoCapsChanged):
702         (WebCore::MediaPlayerPrivateGStreamer::audioChanged):
703         (WebCore::MediaPlayerPrivateGStreamer::textChanged):
704         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
705         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChanged):
706         (WebCore::MediaPlayerPrivateGStreamerBase::muteChanged):
707         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
708         (WebCore::TrackPrivateBaseGStreamer::activeChanged):
709         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
710         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
711         (webkitVideoSinkRender):
712         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
713         (webKitWebSrcChangeState):
714         (webKitWebSrcNeedDataCb):
715         (webKitWebSrcEnoughDataCb):
716         (webKitWebSrcSeekDataCb):
717
718 2015-10-05  Andreas Kling  <akling@apple.com>
719
720         Remove unused HistoryItem::parent
721         <https://webkit.org/b/149803>
722
723         Reviewed by Anders Carlsson.
724
725         Remove the effectively-unused "parent" field from HistoryItem.
726         This also allows us to get rid of a HistoryItem constructor.
727
728         * history/HistoryItem.cpp:
729         (WebCore::HistoryItem::HistoryItem): Deleted.
730         (WebCore::HistoryItem::reset): Deleted.
731         (WebCore::HistoryItem::parent): Deleted.
732         (WebCore::HistoryItem::setParent): Deleted.
733         * history/HistoryItem.h:
734         (WebCore::HistoryItem::create): Deleted.
735         * loader/HistoryController.cpp:
736         (WebCore::HistoryController::initializeItem): Deleted.
737
738 2015-10-05  Zan Dobersek  <zdobersek@igalia.com>
739
740         GLContext should control ownership of context-related objects
741         https://bugs.webkit.org/show_bug.cgi?id=149794
742
743         Reviewed by Martin Robinson.
744
745         Creation of GLContext objects can depend on various platform-specific
746         objects like native window representations. Since these objects are
747         used solely for the GLContext purposes, it would make sense to allow
748         GLContext to provide an extensible way to impose ownership on these
749         objects and control their lifetime.
750
751         GLContext::Data is declared with a defaulted virtual destructor.
752         Users of these implementations can declare classes that derive from
753         GLContext::Data and store context-related objects in instances of the
754         derived class, and ensure that these objects are properly cleaned up
755         when GLContext destroys the Data object.
756
757         The GLContext::Data object is managed through a protected
758         std::unique_ptr<> member in the GLContext class. For now the member
759         is only set in GLContextEGL::createWindowContext() and is destroyed
760         during the GLContext destruction.
761
762         The local OffscreenContextData class in
763         PlatformDisplayWayland::createSharingGLContext() derives from
764         GLContext::Data and is used to store the wl_surface and
765         EGLNativeWindowType (aka wl_egl_window) objects for offscreen
766         GLContexts under the Wayland platform that are used for the sharing
767         context and WebGL, effectively avoiding the leak that would further
768         propagate problems into the compositor and the graphics library.
769         (Such offscreen contexts are actually mimicked via a 1x1px
770         wl_egl_window object that acts as a dummy base for the related
771         wl_surface object).
772
773         * platform/graphics/GLContext.h:
774         * platform/graphics/egl/GLContextEGL.cpp:
775         (WebCore::GLContextEGL::createWindowContext):
776         * platform/graphics/egl/GLContextEGL.h:
777         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
778         (WebCore::PlatformDisplayWayland::createSharingGLContext):
779
780 2015-10-05  Zan Dobersek  <zdobersek@igalia.com>
781
782         Make gdk.h inclusion in FontPlatformDataFreeType.cpp properly GTK-specific
783         https://bugs.webkit.org/show_bug.cgi?id=149793
784
785         Reviewed by Carlos Garcia Campos.
786
787         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
788         Instead of including <gdk/gdk.h> header for all platforms but EFL, only
789         include it for the GTK platform, since no other platform depends on the
790         GDK library.
791
792 2015-10-03  Ricky Mondello  <rmondello@apple.com>
793
794         "Plug-in is blocked" message doesn't draw correctly
795         https://bugs.webkit.org/show_bug.cgi?id=149741
796         <rdar://problem/22920949>
797
798         Patch by Conrad Shultz and Ricky Mondello.
799
800         Reviewed by Anders Carlsson.
801
802         No new tests are added.
803
804         Add PluginData API to check whether a MIME type is supported, regardless of plug-in visibility.
805
806         * plugins/PluginData.cpp:
807         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices): Adopt getMimesAndPluginIndiciesForPlugins.
808         (WebCore::PluginData::getMimesAndPluginIndices): Added.
809         (WebCore::PluginData::getMimesAndPluginIndiciesForPlugins): Essentially factored out of
810             getWebVisibleMimesAndPluginIndices.
811         (WebCore::PluginData::supportsMimeType): Added. Somewhat similar to preexisting supportsWebVisibleMimeType.
812         * plugins/PluginData.h: Declare supportsMimeType.
813
814 2015-10-02  Antti Koivisto  <antti@apple.com>
815
816         Inserting a child to a slot assigned node doesn't trigger repaint
817         https://bugs.webkit.org/show_bug.cgi?id=149739
818
819         Reviewed by Ryosuke Niwa.
820
821         Test: fast/shadow-dom/insert-child-to-assigned-node.html
822
823         * dom/Node.cpp:
824         (WebCore::Node::derefEventTarget):
825         (WebCore::traverseStyleParent):
826         (WebCore::traverseFirstStyleParent):
827         (WebCore::Node::updateAncestorsForStyleRecalc):
828
829             Traverse in style parent order.
830
831 2015-10-02  Joseph Pecoraro  <pecoraro@apple.com>
832
833         Unreviewed, rolling out r190520, some tests assert / crash.
834
835         * ForwardingHeaders/heap/HeapObserver.h: Removed.
836         * ForwardingHeaders/inspector/agents/InspectorHeapAgent.h: Removed.
837         * WebCore.vcxproj/WebCore.vcxproj:
838         * WebCore.vcxproj/WebCore.vcxproj.filters:
839         * inspector/InspectorController.cpp:
840         (WebCore::InspectorController::InspectorController): Deleted.
841         (WebCore::InspectorController::vm): Deleted.
842         * inspector/InspectorController.h:
843         * inspector/WorkerInspectorController.cpp:
844         (WebCore::WorkerInspectorController::vm): Deleted.
845         * inspector/WorkerInspectorController.h:
846
847 2015-10-02  Joseph Pecoraro  <pecoraro@apple.com>
848
849         Web Inspector: Include Garbage Collection Event in Timeline
850         https://bugs.webkit.org/show_bug.cgi?id=142510
851
852         Reviewed by Geoffrey Garen.
853
854         Tests: inspector/heap/garbageCollected.html
855                inspector/heap/gc.html
856
857         * ForwardingHeaders/heap/HeapObserver.h: Added.
858         * ForwardingHeaders/inspector/agents/InspectorHeapAgent.h: Added.
859         * WebCore.vcxproj/WebCore.vcxproj:
860         * WebCore.vcxproj/WebCore.vcxproj.filters:
861         Forwarding headers.
862
863         * inspector/InspectorController.cpp:
864         (WebCore::InspectorController::InspectorController):
865         (WebCore::InspectorController::vm):
866         * inspector/InspectorController.h:
867         * inspector/WorkerInspectorController.cpp:
868         (WebCore::WorkerInspectorController::vm):
869         * inspector/WorkerInspectorController.h:
870         Implement InspectorEnvironment::vm and create a Heap agent for the
871         Page inspector controller.
872
873 2015-10-02  Jer Noble  <jer.noble@apple.com>
874
875         [MSE] Browser crashes when appending invalid data to MSE source buffer
876         https://bugs.webkit.org/show_bug.cgi?id=149689
877
878         Reviewed by Darin Adler.
879
880         Test: media/media-source/media-source-stpp-crash.html
881
882         Bail out early (as specced) after disconnecting the SourceBuffer from its MediaSource.
883
884         * Modules/mediasource/SourceBuffer.cpp:
885         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
886
887 2015-10-02  Simon Fraser  <simon.fraser@apple.com>
888
889         ASSERTION FAILED: param >= 0 in AnimationBase::updateStateMachine()
890         https://bugs.webkit.org/show_bug.cgi?id=149737
891         rdar://problem/19017465
892
893         Reviewed by Dean Jackson.
894
895         CoreAnimation can give us an animation beginTime that is slightly into the future,
896         which results in 'param' here being < 0, so relax the assertion slightly.
897         
898         Fixes lots of assertions running iOS WK2 layout tests.
899
900         * page/animation/AnimationBase.cpp:
901         (WebCore::AnimationBase::updateStateMachine):
902
903 2015-10-02  Per Arne Vollan  <peavo@outlook.com>
904
905         [WinCairo] Fix linker warnings.
906         https://bugs.webkit.org/show_bug.cgi?id=149754
907
908         Reviewed by Alex Christensen.
909
910         Avoid compiling these files twice, they are already included in
911         RenderingAllInOne.cpp.
912
913         * PlatformWinCairo.cmake:
914
915 2015-10-02  Alex Christensen  <achristensen@webkit.org>
916
917         Reloading without content blockers doesn't apply to resource loads after the main frame finishes
918         https://bugs.webkit.org/show_bug.cgi?id=149430
919         rdar://problem/22742222
920
921         Reviewed by Geoffrey Garen.
922
923         Test: http/tests/contentextensions/disable-blocker.html
924
925         * html/HTMLMediaElement.cpp:
926         (WebCore::HTMLMediaElement::loadResource):
927         * loader/DocumentLoader.h:
928         (WebCore::DocumentLoader::userContentExtensionsEnabled):
929         (WebCore::DocumentLoader::setUserContentExtensionsEnabled):
930         Store and use the state of whether content blockers are enabled or not on the DocumentLoader
931         so that it stays constant for a document's entire life.  This state comes from the Page when
932         making the DocumentLoader in WebKit2.
933         * loader/FrameLoader.cpp:
934         (WebCore::FrameLoader::loadResourceSynchronously):
935         * loader/ResourceLoader.cpp:
936         (WebCore::ResourceLoader::willSendRequestInternal):
937         * loader/cache/CachedResourceLoader.cpp:
938         (WebCore::CachedResourceLoader::requestResource):
939         * page/DOMWindow.cpp:
940         (WebCore::DOMWindow::open):
941         * page/UserContentController.cpp:
942         (WebCore::UserContentController::removeAllUserContentExtensions):
943         (WebCore::UserContentController::processContentExtensionRulesForLoad):
944         (WebCore::UserContentController::actionsForResourceLoad):
945         * page/UserContentController.h:
946
947 2015-10-02  Antoine Quint  <graouts@apple.com>
948
949         popstate is fired at the wrong time on load
950         https://bugs.webkit.org/show_bug.cgi?id=94265
951
952         Reviewed by Darin Adler.
953
954         Don't fire popstate event on initial document load
955
956         According to the specification [1], a popstate event should only be fired
957         when the document has a "last entry" and the entry being navigated to isn't
958         it.  A document is created without a "last entry" and gets one just after
959         this check when it is first navigated to, so a popstate should be fired any
960         time a document is navigated to except for the first time after it has been
961         created.
962
963         Patch adapted from work by jl@opera.com on Blink [2].
964
965         [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#traverse-the-history (step 12-14 in particular)
966         [2] https://src.chromium.org/viewvc/blink?revision=165221&view=revision
967
968         * dom/Document.cpp:
969         (WebCore::Document::implicitClose):
970
971 2015-10-02  Javier Fernandez  <jfernandez@igalia.com>
972
973         [CSS Grid Layout] Support for Content Alignment in grid layout
974         https://bugs.webkit.org/show_bug.cgi?id=145520
975
976         Reviewed by Darin Adler.
977
978         According to CSS Box Alignment specification, Content Distribution
979         alignment controls alignment of the box's content within the box. The
980         alignment container is the grid container's content box. The alignment
981         subjects are the grid tracks.
982
983         This patch implements Grid Layout support for Content Distribution
984         alignment along both block/column and inline/row axis, which are handled
985         by align-content and justify-content properties respectively.
986
987         This patch provides support for overflow handling, similar to what
988         Self Alignment provides with grid items, and both <content-position>
989         and <content-distribution> values.
990
991         Baseline Alignment is still missing because it requires some additional
992         behavior to be supported on grids before considering its implementation.
993
994         Tests: css3/overwrite-content-alignment.html
995                css3/overwrite-self-alignment.html
996                fast/css-grid-layout/grid-align-content-distribution-vertical-lr.html
997                fast/css-grid-layout/grid-align-content-distribution-vertical-rl.html
998                fast/css-grid-layout/grid-align-content-distribution.html
999                fast/css-grid-layout/grid-align-content-vertical-lr.html
1000                fast/css-grid-layout/grid-align-content-vertical-rl.html
1001                fast/css-grid-layout/grid-align-content.html
1002                fast/css-grid-layout/grid-content-alignment-overflow.html
1003                fast/css-grid-layout/grid-content-alignment-with-different-sized-tracks.html
1004                fast/css-grid-layout/grid-content-alignment-with-span-vertical-lr.html
1005                fast/css-grid-layout/grid-content-alignment-with-span-vertical-rl.html
1006                fast/css-grid-layout/grid-content-alignment-with-span.html
1007                fast/css-grid-layout/grid-justify-content-distribution-vertical-lr.html
1008                fast/css-grid-layout/grid-justify-content-distribution-vertical-rl.html
1009                fast/css-grid-layout/grid-justify-content-distribution.html
1010                fast/css-grid-layout/grid-justify-content-vertical-lr.html
1011                fast/css-grid-layout/grid-justify-content-vertical-rl.html
1012                fast/css-grid-layout/grid-justify-content.html
1013
1014         * rendering/RenderFlexibleBox.cpp:
1015         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
1016         (WebCore::RenderFlexibleBox::layoutColumnReverse):
1017         (WebCore::RenderFlexibleBox::alignFlexLines):
1018         * rendering/RenderGrid.cpp:
1019         (WebCore::ContentAlignmentData::ContentAlignmentData):
1020         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
1021         (WebCore::RenderGrid::layoutGridItems):
1022         (WebCore::RenderGrid::gridAreaBreadthForChild):
1023         (WebCore::RenderGrid::populateGridPositions):
1024         (WebCore::resolveContentDistributionFallback):
1025         (WebCore::offsetToStartEdge):
1026         (WebCore::offsetToEndEdge):
1027         (WebCore::contentDistributionOffset):
1028         (WebCore::RenderGrid::computeContentPositionAndDistributionColumnOffset):
1029         (WebCore::RenderGrid::computeContentPositionAndDistributionRowOffset):
1030         (WebCore::RenderGrid::findChildLogicalPosition):
1031         (WebCore::RenderGrid::computePreferredLogicalWidths): Deleted.
1032         (WebCore::RenderGrid::autoPlacementMajorAxisDirection): Deleted.
1033         (WebCore::RenderGrid::autoPlacementMinorAxisDirection): Deleted.
1034         (WebCore::RenderGrid::cachedGridCoordinate): Deleted.
1035         (WebCore::RenderGrid::rowPositionForChild): Deleted.
1036         * rendering/RenderGrid.h:
1037         * rendering/style/RenderStyle.cpp:
1038         (WebCore::RenderStyle::resolvedAlignContentPosition):
1039         (WebCore::RenderStyle::resolvedAlignContentDistribution):
1040         (WebCore::RenderStyle::resolvedJustifyContentPosition):
1041         (WebCore::RenderStyle::resolvedJustifyContentDistribution):
1042         * rendering/style/RenderStyle.h:
1043
1044 2015-10-02  Dean Jackson  <dino@apple.com>
1045
1046         Attempted build fix.
1047
1048         * DerivedSources.make:
1049         * page/make_settings.pl:
1050         (printGetterAndSetter):
1051
1052 2015-10-01  Dean Jackson  <dino@apple.com>
1053
1054         Expose WEBGL_debug_renderer_info
1055         https://bugs.webkit.org/show_bug.cgi?id=149735
1056         <rdar://problem/18343500>
1057
1058         Reviewed by Simon Fraser.
1059
1060         Take two at landing this.
1061
1062         Enable the extension that allows content to query
1063         for the GPUs vendor and details.
1064
1065         Now that we're enabling this, there was no need for
1066         the internal setting that identified privileged situations.
1067         However, since this meant that WEBGL_debug_shaders was
1068         also exposed, I explicitly disable it since it is
1069         not yet conformant.
1070
1071         Test: fast/canvas/webgl/webgl-debug-renderer-info.html
1072         as well as the general conformance suite.
1073
1074         * html/canvas/WebGL2RenderingContext.cpp: No need to guard around allowPrivilegedExtensions().
1075         (WebCore::WebGL2RenderingContext::getExtension):
1076         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
1077         * html/canvas/WebGLRenderingContext.cpp: Ditto.
1078         (WebCore::WebGLRenderingContext::getExtension):
1079         (WebCore::WebGLRenderingContext::getSupportedExtensions):
1080         * html/canvas/WebGLRenderingContextBase.cpp:
1081         (WebCore::WebGLRenderingContextBase::allowPrivilegedExtensions): Deleted.
1082         * html/canvas/WebGLRenderingContextBase.h:
1083         * page/Settings.in: Remove privilegedWebGLExtensions.
1084         * platform/graphics/opengl/Extensions3DOpenGL.cpp: Forbid the translated shader
1085         extension while it is still buggy.
1086         (WebCore::Extensions3DOpenGL::supportsExtension):
1087
1088 2015-10-01  Csaba Osztrogonác  <ossy@webkit.org>
1089
1090         Fix the #if guard in PointerLockController.cpp
1091         https://bugs.webkit.org/show_bug.cgi?id=149705
1092
1093         Reviewed by Gyuyoung Kim.
1094
1095         * page/PointerLockController.cpp:
1096
1097 2015-10-01  Dean Jackson  <dino@apple.com>
1098
1099         Rollout r190446 for the moment. It broke the build.
1100
1101         * html/canvas/WebGL2RenderingContext.cpp:
1102         (WebCore::WebGL2RenderingContext::getExtension):
1103         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
1104         * html/canvas/WebGLRenderingContext.cpp:
1105         (WebCore::WebGLRenderingContext::getExtension):
1106         (WebCore::WebGLRenderingContext::getSupportedExtensions):
1107         * html/canvas/WebGLRenderingContextBase.cpp:
1108         (WebCore::WebGLRenderingContextBase::allowPrivilegedExtensions):
1109         * html/canvas/WebGLRenderingContextBase.h:
1110         * page/Settings.in:
1111         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1112         (WebCore::Extensions3DOpenGL::supportsExtension): Deleted.
1113
1114 2015-10-01  Jaehun Lim  <ljaehun.lim@samsung.com>
1115
1116         Unreviewed, fix build warning after r190434
1117
1118         Fix error: variable ‘interruption’ set but not used [-Werror=unused-but-set-variable]
1119
1120         * testing/Internals.cpp:
1121         (WebCore::Internals::beginMediaSessionInterruption):
1122
1123 2015-10-01  Dean Jackson  <dino@apple.com>
1124
1125         Expose WEBGL_debug_renderer_info
1126         https://bugs.webkit.org/show_bug.cgi?id=149735
1127         <rdar://problem/18343500>
1128
1129         Reviewed by Simon Fraser.
1130
1131         Enable the extension that allows content to query
1132         for the GPUs vendor and details.
1133
1134         Now that we're enabling this, there was no need for
1135         the internal setting that identified privileged situations.
1136         However, since this meant that WEBGL_debug_shaders was
1137         also exposed, I explicitly disable it since it is
1138         not yet conformant.
1139
1140         Test: fast/canvas/webgl/webgl-debug-renderer-info.html
1141         as well as the general conformance suite.
1142
1143         * html/canvas/WebGL2RenderingContext.cpp: No need to guard around allowPrivilegedExtensions().
1144         (WebCore::WebGL2RenderingContext::getExtension):
1145         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
1146         * html/canvas/WebGLRenderingContext.cpp: Ditto.
1147         (WebCore::WebGLRenderingContext::getExtension):
1148         (WebCore::WebGLRenderingContext::getSupportedExtensions):
1149         * html/canvas/WebGLRenderingContextBase.cpp:
1150         (WebCore::WebGLRenderingContextBase::allowPrivilegedExtensions): Deleted.
1151         * html/canvas/WebGLRenderingContextBase.h:
1152         * page/Settings.in: Remove privilegedWebGLExtensions.
1153         * platform/graphics/opengl/Extensions3DOpenGL.cpp: Forbid the translated shader
1154         extension while it is still buggy.
1155         (WebCore::Extensions3DOpenGL::supportsExtension):
1156
1157 2015-10-01  Eric Carlson  <eric.carlson@apple.com>
1158
1159         [iOS] AirPlay should not stop when the screen locks
1160         https://bugs.webkit.org/show_bug.cgi?id=148315
1161         <rdar://problem/22770703>
1162
1163         Reviewed by Jer Noble.
1164
1165         Tested by media/video-interruption-with-resume-allowing-play.html
1166                   media/video-interruption-with-resume-not-allowing-play.html
1167
1168         * Modules/webaudio/AudioContext.h: overrideBackgroundPlaybackRestriction -> 
1169           shouldOverrideBackgroundPlaybackRestriction.
1170
1171         * html/HTMLMediaElement.cpp:
1172         (WebCore::HTMLMediaElement::suspendPlayback): Fix a typo in the logging.
1173         (WebCore::HTMLMediaElement::mayResumePlayback): Ditto.
1174         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction): Renamed from
1175           overrideBackgroundPlaybackRestriction.
1176         (WebCore::HTMLMediaElement::overrideBackgroundPlaybackRestriction): Deleted.
1177         * html/HTMLMediaElement.h:
1178
1179         * platform/audio/PlatformMediaSession.cpp:
1180         (WebCore::stateName):
1181         (WebCore::interruptionName): New, log the name of the interruption.
1182         (WebCore::PlatformMediaSession::beginInterruption): Log the interruption type. Don't
1183           increment the interruption counter if we are going to ignore it. Incorporate logic
1184           from doInterruption.
1185         (WebCore::PlatformMediaSession::doInterruption): Deleted.
1186         (WebCore::PlatformMediaSession::shouldDoInterruption): Deleted.
1187         (WebCore::PlatformMediaSession::forceInterruption): Deleted.
1188
1189         * platform/audio/PlatformMediaSession.h: Add SuspendedUnderLock interruption type.
1190         * platform/audio/PlatformMediaSessionManager.cpp:
1191         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground): Deleted.
1192         * platform/audio/PlatformMediaSessionManager.h:
1193
1194         * platform/audio/ios/MediaSessionManagerIOS.h:
1195         * platform/audio/ios/MediaSessionManagerIOS.mm:
1196         (WebCore::MediaSessionManageriOS::applicationDidEnterBackground): Call beginInterruption
1197           when appropriate.
1198
1199 2015-10-01  Ryosuke Niwa  <rniwa@webkit.org>
1200
1201         Slot elements should support fallback contents
1202         https://bugs.webkit.org/show_bug.cgi?id=149701
1203
1204         Reviewed by Antti Koivisto.
1205
1206         Following discussions on Github discussions [1] [2], we're adding the default rule of `display: contents`
1207         on slot elements and making slot elements render its children when there are no assigned nodes [3].
1208
1209         Make these changes by attaching renderers on direct-children of slot elements when there are no assigned
1210         nodes during render tree construction. Note `display: contents` will be aded in webkit.org/b/149439.
1211
1212         [1] https://github.com/w3c/webcomponents/issues/317
1213         [2] https://github.com/w3c/webcomponents/issues/308
1214         [3] https://github.com/w3c/webcomponents/issues/308#issuecomment-143655347
1215
1216         Tests: fast/shadow-dom/css-scoping-shadow-slot-fallback.html
1217                fast/shadow-dom/shadow-layout-after-slot-fallback-changes.html
1218
1219         * style/StyleResolveTree.cpp:
1220         (WebCore::Style::attachSlotAssignees):
1221         (WebCore::Style::detachSlotAssignees):
1222         (WebCore::Style::resolveSlotAssignees):
1223
1224 2015-10-01  Brent Fulgham  <bfulgham@apple.com>
1225
1226         Latch does not clear when a scroll snap animation is triggered
1227         https://bugs.webkit.org/show_bug.cgi?id=149681
1228         <rdar://problem/22733922>
1229
1230         Reviewed by Simon Fraser.
1231
1232         Test: tiled-drawing/scrolling/latched-div-with-scroll-snap.html
1233
1234         The scroll snap animation logic bypasses some of the normal clean-up code used
1235         for wheel event handling. When this happens, the scroll latching state is not
1236         cleared. In some cases this "stale" latch state is used when starting a new
1237         gesture in the same frame. This causes the wrong page element to receive the
1238         mouse wheel events, and hilarity ensues.
1239
1240         * page/mac/EventHandlerMac.mm:
1241         (WebCore::EventHandler::platformNotifyIfEndGesture): Clear latched state when
1242         ending the gesture.
1243
1244 2015-10-01  Brent Fulgham  <bfulgham@apple.com>
1245
1246         [Win] Unreviewed CMake build fixes.
1247
1248         * CMakeLists.txt: Match original Windows build flags for WebCoreTest.
1249         * PlatformAppleWin.cmake: Use the same build defines as the
1250         original Windows build.
1251
1252 2015-09-30  João Oliveira  <hello@jxs.pt>
1253
1254         Web Inspector: Adjust font size of Developer Tools using Command,+ or Command,-
1255         https://bugs.webkit.org/show_bug.cgi?id=149590
1256
1257         Reviewed by Joseph Pecoraro.
1258
1259         Patch by João Oliveira and Brian Burg.
1260
1261         Expose the frontend page's zoom factor so we can implement relative zoom.
1262
1263         * inspector/InspectorFrontendHost.cpp:
1264         (WebCore::InspectorFrontendHost::zoomFactor): Added.
1265         * inspector/InspectorFrontendHost.h:
1266         * inspector/InspectorFrontendHost.idl:
1267         * page/Frame.h:
1268         (WebCore::Frame::pageZoomFactor):
1269
1270 2015-10-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1271
1272         [GTK] Websites with invalid auth header keep loading forever
1273         https://bugs.webkit.org/show_bug.cgi?id=149710
1274
1275         Reviewed by Martin Robinson.
1276
1277         We don't correctly handle a null realm from the server when
1278         retrieving and storing credentials from libsecret. First
1279         secret_attributes_build() fails because we pass a null domain, and
1280         we pass null attributes to secret_service_search() that returns
1281         early on a g_return macro and the callback is never called so the
1282         load doesn't continue after the auth challenge.
1283
1284         * platform/network/gtk/CredentialBackingStore.cpp:
1285         (WebCore::createAttributeHashTableFromChallenge):
1286         (WebCore::CredentialBackingStore::credentialForChallenge):
1287         (WebCore::CredentialBackingStore::storeCredentialsForChallenge):
1288
1289 2015-10-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1290
1291         Refactor binding generator to factor JS DOM class m_impl handling
1292         https://bugs.webkit.org/show_bug.cgi?id=149660
1293
1294         Reviewed by Darin Adler.
1295
1296         Added JSDOMWrapperWithImplementation template class to move m_impl out of the binding generator.
1297         Updated custom bindings to use impl() instead of m_impl directly.
1298         Updated binding generator accordingly.
1299
1300         Covered by existing tests and binding tests.
1301
1302         * bindings/js/JSDOMStringMapCustom.cpp:
1303         (WebCore::JSDOMStringMap::getOwnPropertyNames):
1304         (WebCore::JSDOMStringMap::deleteProperty):
1305         * bindings/js/JSDOMWrapper.h:
1306         (WebCore::JSDOMWrapperWithImplementation::impl):
1307         (WebCore::JSDOMWrapperWithImplementation::~JSDOMWrapperWithImplementation):
1308         (WebCore::JSDOMWrapperWithImplementation::JSDOMWrapperWithImplementation):
1309         (WebCore::JSDOMWrapperWithImplementation::releaseImpl):
1310         * bindings/js/JSGeolocationCustom.cpp:
1311         (WebCore::JSGeolocation::getCurrentPosition):
1312         (WebCore::JSGeolocation::watchPosition):
1313         * bindings/js/JSSQLResultSetRowListCustom.cpp:
1314         (WebCore::JSSQLResultSetRowList::item):
1315         * bindings/js/JSSQLTransactionCustom.cpp:
1316         (WebCore::JSSQLTransaction::executeSql):
1317         * bindings/js/JSStorageCustom.cpp:
1318         (WebCore::JSStorage::deleteProperty):
1319         (WebCore::JSStorage::getOwnPropertyNames):
1320         * bindings/js/JSSubtleCryptoCustom.cpp:
1321         (WebCore::JSSubtleCrypto::encrypt):
1322         (WebCore::JSSubtleCrypto::decrypt):
1323         (WebCore::JSSubtleCrypto::sign):
1324         (WebCore::JSSubtleCrypto::verify):
1325         (WebCore::JSSubtleCrypto::wrapKey):
1326         (WebCore::JSSubtleCrypto::unwrapKey):
1327         * bindings/scripts/CodeGeneratorJS.pm:
1328         (GetParentClassName):
1329         (GetImplClassName):
1330         (GenerateHeader):
1331         (GenerateImplementation):
1332         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1333         (WebCore::JSTestActiveDOMObject::JSTestActiveDOMObject):
1334         (WebCore::JSTestActiveDOMObject::getOwnPropertySlot): Deleted.
1335         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1336         (WebCore::JSTestActiveDOMObject::~JSTestActiveDOMObject):
1337         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1338         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
1339         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor): Deleted.
1340         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
1341         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject):
1342         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::finishCreation): Deleted.
1343         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1344         (WebCore::JSTestCustomNamedGetter::JSTestCustomNamedGetter):
1345         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlot): Deleted.
1346         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1347         (WebCore::JSTestCustomNamedGetter::~JSTestCustomNamedGetter):
1348         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1349         (WebCore::JSTestEventConstructor::JSTestEventConstructor):
1350         (WebCore::jsTestEventConstructorAttr1): Deleted.
1351         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1352         (WebCore::JSTestEventConstructor::~JSTestEventConstructor):
1353         (WebCore::JSTestEventConstructor::finishCreation): Deleted.
1354         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1355         (WebCore::JSTestEventTarget::JSTestEventTarget):
1356         (WebCore::JSTestEventTarget::getOwnPropertySlot): Deleted.
1357         * bindings/scripts/test/JS/JSTestEventTarget.h:
1358         (WebCore::JSTestEventTarget::~JSTestEventTarget):
1359         * bindings/scripts/test/JS/JSTestException.cpp:
1360         (WebCore::JSTestException::JSTestException):
1361         (WebCore::JSTestException::getOwnPropertySlot): Deleted.
1362         * bindings/scripts/test/JS/JSTestException.h:
1363         (WebCore::JSTestException::~JSTestException):
1364         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1365         (WebCore::JSTestGenerateIsReachable::JSTestGenerateIsReachable):
1366         (WebCore::jsTestGenerateIsReachableConstructor): Deleted.
1367         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
1368         (WebCore::JSTestGenerateIsReachable::~JSTestGenerateIsReachable):
1369         (WebCore::JSTestGenerateIsReachable::finishCreation): Deleted.
1370         * bindings/scripts/test/JS/JSTestInterface.cpp:
1371         (WebCore::JSTestInterface::JSTestInterface):
1372         (WebCore::JSTestInterface::getOwnPropertySlot): Deleted.
1373         * bindings/scripts/test/JS/JSTestInterface.h:
1374         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1375         (WebCore::jsTestJSBuiltinConstructorConstructor): Deleted.
1376         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
1377         (WebCore::JSTestJSBuiltinConstructor::~JSTestJSBuiltinConstructor):
1378         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1379         (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener):
1380         (WebCore::jsTestMediaQueryListListenerConstructor): Deleted.
1381         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1382         (WebCore::JSTestMediaQueryListListener::~JSTestMediaQueryListListener):
1383         (WebCore::JSTestMediaQueryListListener::finishCreation): Deleted.
1384         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1385         (WebCore::JSTestNamedConstructor::JSTestNamedConstructor):
1386         (WebCore::jsTestNamedConstructorConstructor): Deleted.
1387         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1388         (WebCore::JSTestNamedConstructor::~JSTestNamedConstructor):
1389         (WebCore::JSTestNamedConstructor::finishCreation): Deleted.
1390         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1391         (WebCore::JSTestNondeterministic::JSTestNondeterministic):
1392         (WebCore::jsTestNondeterministicNondeterministicReadonlyAttr): Deleted.
1393         * bindings/scripts/test/JS/JSTestNondeterministic.h:
1394         (WebCore::JSTestNondeterministic::~JSTestNondeterministic):
1395         (WebCore::JSTestNondeterministic::finishCreation): Deleted.
1396         * bindings/scripts/test/JS/JSTestObj.cpp:
1397         (WebCore::JSTestObj::JSTestObj):
1398         (WebCore::JSTestObj::getOwnPropertySlot): Deleted.
1399         * bindings/scripts/test/JS/JSTestObj.h:
1400         (WebCore::JSTestObj::~JSTestObj):
1401         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1402         (WebCore::JSTestOverloadedConstructors::JSTestOverloadedConstructors):
1403         (WebCore::jsTestOverloadedConstructorsConstructor): Deleted.
1404         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1405         (WebCore::JSTestOverloadedConstructors::~JSTestOverloadedConstructors):
1406         (WebCore::JSTestOverloadedConstructors::finishCreation): Deleted.
1407         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1408         (WebCore::JSTestOverrideBuiltins::JSTestOverrideBuiltins):
1409         (WebCore::JSTestOverrideBuiltins::getOwnPropertySlot): Deleted.
1410         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1411         (WebCore::JSTestOverrideBuiltins::~JSTestOverrideBuiltins):
1412         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1413         (WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface):
1414         (WebCore::jsTestSerializedScriptValueInterfaceValue): Deleted.
1415         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1416         (WebCore::JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface):
1417         (WebCore::JSTestSerializedScriptValueInterface::finishCreation): Deleted.
1418         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1419         (WebCore::JSTestTypedefs::JSTestTypedefs):
1420         (WebCore::JSTestTypedefs::getOwnPropertySlot): Deleted.
1421         * bindings/scripts/test/JS/JSTestTypedefs.h:
1422         (WebCore::JSTestTypedefs::~JSTestTypedefs):
1423         * bindings/scripts/test/JS/JSattribute.cpp:
1424         (WebCore::JSattribute::JSattribute):
1425         (WebCore::jsattributeReadonly): Deleted.
1426         * bindings/scripts/test/JS/JSattribute.h:
1427         (WebCore::JSattribute::~JSattribute):
1428         (WebCore::JSattribute::finishCreation): Deleted.
1429         * bindings/scripts/test/JS/JSreadonly.cpp:
1430         (WebCore::JSreadonly::JSreadonly):
1431         (WebCore::jsreadonlyConstructor): Deleted.
1432         * bindings/scripts/test/JS/JSreadonly.h:
1433         (WebCore::JSreadonly::~JSreadonly):
1434         (WebCore::JSreadonly::finishCreation): Deleted.
1435
1436 2015-10-01  Csaba Osztrogonác  <ossy@webkit.org>
1437
1438         Fix the ARM build after r190192
1439         https://bugs.webkit.org/show_bug.cgi?id=149620
1440
1441         Reviewed by Darin Adler.
1442
1443         * platform/graphics/FontFeatureSettings.h:
1444         (WebCore::fontFeatureTag):
1445
1446 2015-10-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1447
1448         [Streams API] Add support for private WebCore JS builtins functions
1449         https://bugs.webkit.org/show_bug.cgi?id=149518
1450
1451         Reviewed by Darin Adler.
1452
1453         Using ReadableStream tee method as a testbed to add support for private WebCore JS builtins functions.
1454         Private functions are hooked to JSDOMWindowBase, as it is the one connected to WebCoreClientData.
1455         WebCoreClientData is responsible to export the private function symbols to the VM.
1456
1457         Updated generate-js-builtins script to generate a class that can create and own all JS functions.
1458         This class is used by JSDOMWindowBase to create the JS builtin functions.
1459         It is also used to manage the GC of these objects.
1460
1461         Covered by rebased tests.
1462
1463         * CMakeLists.txt: Adding ReadableStreamInternals builtin files.
1464         * DerivedSources.cpp: Ditto.
1465         * DerivedSources.make: Ditto.
1466         * Modules/streams/ReadableStream.idl: Adding tee declaration as builtin
1467         * Modules/streams/ReadableStream.js:
1468         (tee): Calling @teeReadableStream
1469         * Modules/streams/ReadableStreamInternals.js: Barebone @teeReadableStream implementation.
1470         (teeReadableStream):
1471         * WebCore.vcxproj/WebCore.vcxproj: Adding ReadableStreamInternals builtin files.
1472         * WebCore.xcodeproj/project.pbxproj: Adding ReadableStreamInternals builtin files.
1473         * bindings/js/JSDOMWindowBase.cpp:
1474         (WebCore::JSDOMWindowBase::JSDOMWindowBase): Creating ReadableStreamInternalsBuiltinFunctions object.
1475         (WebCore::JSDOMWindowBase::finishCreation): Creating builtin functions through ReadableStreamInternalsBuiltinFunctions and registering them to the JS engine.
1476         (WebCore::JSDOMWindowBase::visitChildren): Ensuring GC does not collect private builtin functions through ReadableStreamInternalsBuiltinFunctions object
1477         * bindings/js/JSDOMWindowBase.h:
1478         * bindings/js/WebCoreJSClientData.h:
1479         (WebCore::WebCoreJSClientData::WebCoreJSClientData): Exporting private names of ReadableStreamInternalsBuiltins
1480         (WebCore::WebCoreJSClientData::readableStreamBuiltins):
1481         (WebCore::WebCoreJSClientData::readableStreamInternalsBuiltins):
1482         * generate-js-builtins: Adding support for ReadableStreamInternalsBuiltinFunctions and exportNames.
1483
1484 2015-10-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1485
1486         Binding generator should make mutable CachedAttribute member fields
1487         https://bugs.webkit.org/show_bug.cgi?id=148056
1488
1489         Reviewed by Chris Dumez.
1490
1491         Making mutable CachedAttribute member fields.
1492         Removing const_cast from custom binding code.
1493         Rebased bindings tests.
1494
1495         No change in behavior.
1496
1497         * bindings/js/JSHistoryCustom.cpp:
1498         (WebCore::JSHistory::state):
1499         * bindings/js/JSMessageEventCustom.cpp:
1500         (WebCore::JSMessageEvent::data):
1501         * bindings/js/JSPopStateEventCustom.cpp:
1502         (WebCore::cacheState):
1503         (WebCore::JSPopStateEvent::state):
1504         * bindings/js/JSReadableStreamReaderEventCustom.cpp:
1505         (WebCore::JSReadableStreamReader::closed):
1506         * bindings/js/JSXMLHttpRequestCustom.cpp:
1507         (WebCore::JSXMLHttpRequest::response):
1508         * bindings/scripts/CodeGeneratorJS.pm:
1509         (GenerateHeader):
1510         * bindings/scripts/test/JS/JSTestObj.h:
1511         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1512
1513 2015-10-01  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1514
1515         [Streams API] Create ByteLengthQueuingStrategy object as per spec
1516         https://bugs.webkit.org/show_bug.cgi?id=147153
1517
1518         Reviewed by Darin Adler.
1519
1520         Added ByteLengthQueuingStream class as the spec defines at https://streams.spec.whatwg.org/#blqs-class.
1521
1522         Tests are covered by current set.
1523
1524         * CMakeLists.txt:
1525         * DerivedSources.cpp:
1526         * DerivedSources.make:
1527         * WebCore.vcxproj/WebCore.vcxproj:
1528         * WebCore.vcxproj/WebCore.vcxproj.filters:
1529         * WebCore.xcodeproj/project.pbxproj:
1530         * bindings/js/WebCoreJSBuiltins.cpp: Added build instructions.
1531         * Modules/streams/ByteLengthQueuingStrategy.idl: Added.
1532         * Modules/streams/ByteLengthQueuingStrategy.js: Copied from Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp.
1533         (size): Return byteLength attribute of the chunk.
1534         (initializeByteLengthQueuingStrategy): Initialize the highWaterMark property.
1535         * bindings/js/WebCoreJSClientData.h:
1536         (WebCore::WebCoreJSClientData::WebCoreJSClientData): Initialize the blqs builtins.
1537         (WebCore::WebCoreJSClientData::byteLengthQueuingStrategyBuiltins): Return the attribute.
1538
1539 2015-10-01  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1540
1541         Clean up all uses of PassRefPtr in Modules/geolocation
1542         https://bugs.webkit.org/show_bug.cgi?id=149552
1543
1544         Reviewed by Darin Adler.
1545
1546         * Modules/geolocation/GeoNotifier.cpp:
1547         (WebCore::GeoNotifier::GeoNotifier):
1548         (WebCore::GeoNotifier::setFatalError):
1549         * Modules/geolocation/GeoNotifier.h:
1550         (WebCore::GeoNotifier::create):
1551         * Modules/geolocation/Geolocation.cpp:
1552         (WebCore::createGeoposition):
1553         (WebCore::createPositionError):
1554         (WebCore::Geolocation::Watchers::add):
1555         (WebCore::Geolocation::getCurrentPosition):
1556         (WebCore::Geolocation::watchPosition):
1557         (WebCore::Geolocation::startRequest):
1558         * Modules/geolocation/Geolocation.h:
1559         * Modules/geolocation/GeolocationError.h:
1560         * Modules/geolocation/GeolocationPosition.h:
1561         * Modules/geolocation/Geoposition.h:
1562         (WebCore::Geoposition::create):
1563         (WebCore::Geoposition::isolatedCopy):
1564         (WebCore::Geoposition::Geoposition):
1565         * Modules/geolocation/PositionError.h:
1566         * Modules/geolocation/PositionOptions.h:
1567
1568 2015-09-30  Hunseop Jeong  <hs85.jeong@samsung.com>
1569
1570         [EFL][Gtk] Try to fix the build after r190379.
1571         https://bugs.webkit.org/show_bug.cgi?id=149693
1572
1573         Reviewed by Gyuyoung Kim.
1574
1575         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1576
1577 2015-09-30  Katlyn Graff  <kgraff@apple.com>
1578
1579         Add support for the imageSmoothingQuality property for CanvasRenderingContext2D.
1580         https://bugs.webkit.org/show_bug.cgi?id=149541
1581
1582         Reviewed by Ryosuke Niwa.
1583
1584         As documented here: https://html.spec.whatwg.org/multipage/scripting.html#image-smoothing
1585         Exposes the smooothing quality of algorithms used for scaling images. Valid input
1586         values are low, medium, and high: associated algorithms are expected to vary for
1587         differing hardware. setImageSmoothingQuality provides a handle into CGInterpolationQuality.
1588
1589         Test: fast/canvas/canvas-imageSmoothingQuality.html
1590
1591         * html/canvas/CanvasRenderingContext2D.cpp:
1592         (WebCore::CanvasRenderingContext2D::State::State):
1593         (WebCore::CanvasRenderingContext2D::State::operator=):
1594         (WebCore::smoothingToInterpolationQuality):
1595         (WebCore::CanvasRenderingContext2D::imageSmoothingQuality):
1596         (WebCore::CanvasRenderingContext2D::setImageSmoothingQuality):
1597         (WebCore::CanvasRenderingContext2D::setImageSmoothingEnabled):
1598         * html/canvas/CanvasRenderingContext2D.h:
1599         * html/canvas/CanvasRenderingContext2D.idl:
1600
1601 2015-09-30  Dean Jackson  <dino@apple.com>
1602
1603         GraphicsContext3D::mappedSymbolName should initialize count variable
1604         https://bugs.webkit.org/show_bug.cgi?id=149692
1605         <rdar://problem/22871304>
1606
1607         Reviewed by Simon Fraser.
1608
1609         While debugging another WebGL issue, I noticed that some
1610         OpenGL renderers can get into a state where they
1611         drop resources (e.g. a GPU reset). If we don't detect that
1612         in time, we might try to ask for the currently attached
1613         resources and our in-parameter will not be set. In this
1614         case, initialize it to zero so that we don't do silly things.
1615
1616         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1617         (WebCore::GraphicsContext3D::mappedSymbolName): Initialize count to 0.
1618
1619 2015-09-30  Dean Jackson  <dino@apple.com>
1620
1621         Crash in gleLookupHashObject when context is lost
1622         https://bugs.webkit.org/show_bug.cgi?id=149690
1623         <rdar://problem/22751585>
1624         <rdar://problem/22465495>
1625
1626         Reviewed by Simon Fraser.
1627
1628         When we received notification that the GPU has reset,
1629         we were nulling out and deleting our OpenGL contexts
1630         and then trying to do it all over again. The fix was
1631         to flip the order of operations.
1632
1633         While there I added some logging, and changed the
1634         way we check GPU status to make sure we do a check
1635         after the first draw call.
1636
1637         Unfortunately we can't test automatically because it
1638         involves resetting the GPU which can possibly cause
1639         concurrent tests to fail.
1640
1641         * platform/graphics/mac/GraphicsContext3DMac.mm:
1642         (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Move forceContextLost()
1643         to be the first thing we do after we've realised we need to
1644         bail.
1645
1646 2015-09-30  Brady Eidson  <beidson@apple.com>
1647
1648         Add UniqueIDBDatabase object, IDBBackingStore objects, and a database operation thread.
1649         https://bugs.webkit.org/show_bug.cgi?id=149678
1650
1651         Reviewed by Alex Christensen.
1652
1653         Test: storage/indexeddb/modern/opendatabase-request-event.html
1654
1655         - UniqueIDBDatabase represents a specific IDB database instance that can have multiple 
1656           connections to it.
1657         - IDBBackingStore is an abstract representation of a unique database's backing store, 
1658           and has a concrete in-memory implementation for now.
1659         - The database thread exists on IDBServer and is for offloading actual database I/O from 
1660           the main thread.
1661
1662         * CMakeLists.txt:
1663
1664         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
1665         (WebCore::IDBDatabaseIdentifier::isolatedCopy):
1666         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1667
1668         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1669         (WebCore::IDBClient::IDBConnectionToServer::openDatabase):
1670         (WebCore::IDBClient::IDBConnectionToServer::didOpenDatabase):
1671         * Modules/indexeddb/client/IDBConnectionToServer.h:
1672         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
1673
1674         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
1675         (WebCore::IDBClient::IDBFactory::openInternal):
1676
1677         * Modules/indexeddb/server/IDBBackingStore.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h.
1678         (WebCore::IDBServer::IDBBackingStore::~IDBBackingStore):
1679
1680         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
1681         (WebCore::IDBServer::IDBConnectionToClient::didOpenDatabase):
1682         * Modules/indexeddb/server/IDBConnectionToClient.h:
1683         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
1684
1685         * Modules/indexeddb/server/IDBServer.cpp:
1686         (WebCore::IDBServer::IDBServer::IDBServer):
1687         (WebCore::IDBServer::IDBServer::getOrCreateUniqueIDBDatabase):
1688         (WebCore::IDBServer::IDBServer::createBackingStore):
1689         (WebCore::IDBServer::IDBServer::openDatabase):
1690         (WebCore::IDBServer::IDBServer::deleteDatabase):
1691         (WebCore::IDBServer::IDBServer::postDatabaseTask):
1692         (WebCore::IDBServer::IDBServer::postDatabaseTaskReply):
1693         (WebCore::IDBServer::IDBServer::databaseThreadEntry):
1694         (WebCore::IDBServer::IDBServer::databaseRunLoop):
1695         (WebCore::IDBServer::IDBServer::handleTaskRepliesOnMainThread):
1696         * Modules/indexeddb/server/IDBServer.h:
1697
1698         * Modules/indexeddb/server/IDBServerOperation.cpp: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h.
1699         (WebCore::IDBServer::IDBServerOperation::create):
1700         (WebCore::IDBServer::IDBServerOperation::IDBServerOperation):
1701         * Modules/indexeddb/server/IDBServerOperation.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBServer.h.
1702         (WebCore::IDBServer::IDBServerOperation::connection):
1703         (WebCore::IDBServer::IDBServerOperation::requestData):
1704
1705         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp.
1706         (WebCore::IDBServer::MemoryIDBBackingStore::create):
1707         (WebCore::IDBServer::MemoryIDBBackingStore::MemoryIDBBackingStore):
1708         (WebCore::IDBServer::MemoryIDBBackingStore::~MemoryIDBBackingStore):
1709         (WebCore::IDBServer::MemoryIDBBackingStore::getOrEstablishDatabaseInfo):
1710         * Modules/indexeddb/server/MemoryIDBBackingStore.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h.
1711
1712         * Modules/indexeddb/server/UniqueIDBDatabase.cpp: Added.
1713         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
1714         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection):
1715         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
1716         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
1717         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
1718         * Modules/indexeddb/server/UniqueIDBDatabase.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBServer.h.
1719         (WebCore::IDBServer::UniqueIDBDatabase::create):
1720
1721         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h.
1722         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
1723         (WebCore::IDBDatabaseInfo::isolatedCopy):
1724         * Modules/indexeddb/shared/IDBDatabaseInfo.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h.
1725         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
1726
1727         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1728         (WebCore::InProcessIDBServer::didDeleteDatabase):
1729         (WebCore::InProcessIDBServer::openDatabase):
1730         (WebCore::InProcessIDBServer::didOpenDatabase):
1731         * Modules/indexeddb/shared/InProcessIDBServer.h:
1732
1733         * WebCore.xcodeproj/project.pbxproj:
1734
1735         * platform/CrossThreadCopier.cpp:
1736         (WebCore::IDBDatabaseInfo>::copy):
1737         (WebCore::IDBDatabaseIdentifier>::copy):
1738         * platform/CrossThreadCopier.h:
1739
1740 2015-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
1741
1742         Crash when using an SVG font with > 390 glyphs
1743         https://bugs.webkit.org/show_bug.cgi?id=149677
1744         <rdar://problem/21676402>
1745
1746         Reviewed by Simon Fraser.
1747
1748         The "Charset Index" in OTF are indices into a collection of strings. There are
1749         390 predefined strings in this collection. We were currently assigning each
1750         glyph to one of these strings. However, if there are more glyphs than strings,
1751         we will be using invalid indices.
1752
1753         The values of the strings themselves are not necessary for SVG fonts. Therefore,
1754         the solution is to create a single dummy string, and have all glyphs target it.
1755
1756         Tests: svg/custom/many-glyphs.svg
1757
1758         * css/CSSFontFaceSource.cpp:
1759         (WebCore::CSSFontFaceSource::font):
1760         * svg/SVGToOTFFontConversion.cpp:
1761         (WebCore::SVGToOTFFontConverter::appendCFFTable):
1762
1763 2015-09-30  Chris Dumez  <cdumez@apple.com>
1764
1765         Unreviewed, roll out r188331: "NetworkProcess: DNS prefetch happens in the Web Process"
1766         <rdar://problem/22560715>
1767
1768         Speculative roll out of r188331 as we had a ~2.5% PLT regression around
1769         the time it landed and it seems the most likely culprit. I'll reland if
1770         the perf bots do not recover after the roll out.
1771
1772         * html/HTMLAnchorElement.cpp:
1773         (WebCore::HTMLAnchorElement::parseAttribute):
1774         * loader/FrameLoaderClient.h:
1775         * loader/LinkLoader.cpp:
1776         (WebCore::LinkLoader::loadLink):
1777         * page/Chrome.cpp:
1778         (WebCore::Chrome::mouseDidMoveOverElement):
1779
1780 2015-09-30  Timothy Horton  <timothy_horton@apple.com>
1781
1782         Compute document marker rects at use time instead of paint time
1783         https://bugs.webkit.org/show_bug.cgi?id=149643
1784
1785         Reviewed by Darin Adler.
1786
1787         * dom/DocumentMarkerController.cpp:
1788         (WebCore::DocumentMarkerController::DocumentMarkerController):
1789         (WebCore::DocumentMarkerController::detach):
1790         Store and zero the Document backpointer.
1791
1792         (WebCore::DocumentMarkerController::addMarker):
1793         (WebCore::DocumentMarkerController::addTextMatchMarker):
1794         (WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker):
1795         (WebCore::DocumentMarkerController::addDictationResultMarker):
1796         (WebCore::DocumentMarkerController::copyMarkers):
1797         Remove some useless comments.
1798
1799         (WebCore::updateRenderedRectsForMarker):
1800         Use Range to compute the (unclipped, absolute) text rects, and store them
1801         on the RenderedDocumentMarker.
1802
1803         (WebCore::DocumentMarkerController::invalidateRectsForAllMarkers):
1804         (WebCore::DocumentMarkerController::invalidateRectsForMarkersInNode):
1805         Mark the relevant markers' rects as invalid, and notify the ChromeClient.
1806
1807         (WebCore::DocumentMarkerController::updateRectsForInvalidatedMarkersOfType):
1808         Run through all markers, computing rects for ones that don't have valid rects.
1809         We will do layout (once) if necessary. However, this is most commonly
1810         called from a place where layout should already be up to date, so this
1811         should not happen often. updateRenderedRectsForMarker also asserts
1812         that layout is up to date.
1813
1814         (WebCore::DocumentMarkerController::renderedRectsForMarkers):
1815         Retrieve all markers of the given type, clip them by overflow clip and
1816         frame clip, and return them to the caller.
1817
1818         (WebCore::DocumentMarkerController::addMarker):
1819         (WebCore::DocumentMarkerController::markerContainingPoint):
1820         (WebCore::DocumentMarkerController::markersFor):
1821         (WebCore::DocumentMarkerController::repaintMarkers):
1822         (WebCore::DocumentMarkerController::shiftMarkers):
1823         (DocumentMarkerController::setMarkersActive):
1824         (DocumentMarkerController::hasMarkers):
1825         Modern iteration.
1826         
1827         (WebCore::DocumentMarkerController::invalidateRenderedRectsForMarkersInRect): Deleted.
1828         * dom/DocumentMarkerController.h:
1829
1830         * dom/Document.cpp:
1831         (WebCore::Document::Document):
1832         Pass the Document to the DocumentMarkerController.
1833
1834         * dom/RenderedDocumentMarker.h:
1835         (WebCore::RenderedDocumentMarker::contains):
1836         (WebCore::RenderedDocumentMarker::setUnclippedAbsoluteRects):
1837         (WebCore::RenderedDocumentMarker::unclippedAbsoluteRects):
1838         (WebCore::RenderedDocumentMarker::invalidate):
1839         (WebCore::RenderedDocumentMarker::isValid):
1840         (WebCore::RenderedDocumentMarker::addRenderedRect): Deleted.
1841         (WebCore::RenderedDocumentMarker::renderedRects): Deleted.
1842         Instead of keeping "rendered" rects, keep unclipped rects in absolute
1843         document coordinates. Invalidation will happen wholesale instead of
1844         based on dirty rects, because computation no longer happens at paint
1845         time, so it's safe to throw all of the rects away.
1846         Keep track of whether we have valid rects or not.
1847
1848         * editing/Editor.cpp:
1849         (WebCore::Editor::countMatchesForText):
1850         We don't need to do a fake whole-document paint just to compute the
1851         document marker rects. They are computed on demand, using layout information
1852         instead of paint-time information.
1853
1854         * page/ChromeClient.h:
1855         Remove an unnecessary semicolon.
1856         Add didInvalidateDocumentMarkerRects, which DocumentMarkerController
1857         will call whenever document marker rects are invalidated (and when e.g.
1858         the find holes PageOverlay should repaint itself).
1859
1860         * page/FrameView.cpp:
1861         (WebCore::FrameView::layout):
1862         Invalidate document marker's layout-computed rects after layout is complete.
1863         They'll be lazily recomputed when next requested.
1864
1865         (WebCore::FrameView::willPaintContents):
1866         Remove the pre-painting invalidation of document marker rects.
1867
1868         * rendering/InlineTextBox.cpp:
1869         (WebCore::InlineTextBox::paintTextMatchMarker):
1870         (WebCore::InlineTextBox::paintDocumentMarker): Deleted.
1871         (WebCore::InlineTextBox::computeRectForReplacementMarker): Deleted.
1872         (WebCore::InlineTextBox::paintDocumentMarkers): Deleted.
1873         Don't bother computing rendered rects for document markers at paint time.
1874         Just do the actual painting work (which, for replacement markers, is
1875         nothing at all).
1876
1877         * rendering/InlineTextBox.h:
1878         * rendering/RenderLayer.cpp:
1879         (WebCore::RenderLayer::updateLayerPositions):
1880         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
1881         When RenderLayers move, invalidate document marker rects.
1882
1883         * rendering/svg/SVGInlineFlowBox.cpp:
1884         (WebCore::SVGInlineFlowBox::paint):
1885         (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer): Deleted.
1886         * rendering/svg/SVGInlineFlowBox.h:
1887         * rendering/svg/SVGRootInlineBox.cpp:
1888         (WebCore::SVGRootInlineBox::paint):
1889         Don't bother computing rendered rects for document markers at paint time.
1890
1891         * testing/Internals.cpp:
1892         (WebCore::markerTypeFrom):
1893         (WebCore::markerTypesFrom):
1894         Add markerTypeFrom, which returns MarkerType enum values for the input string
1895         instead of a MarkerTypes class.
1896
1897         (WebCore::Internals::dumpMarkerRects):
1898         Dump all markers for the given type, and request them from DocumentMarkerController
1899         instead of from the RenderedDocumentMarker, because we want fully clipped
1900         rects, which can only be obtained from DocumentMarkerController.
1901
1902         * editing/FrameSelection.cpp:
1903         (WebCore::FrameSelection::getTextRectangles):
1904         Avoid enclosing unnecessarily, to avoid inflating zero-width text rects
1905         to have a non-zero width. Callers appear to be OK with non-integral positions.
1906
1907         * testing/Internals.h:
1908         * testing/Internals.idl:
1909
1910 2015-09-30  Eric Carlson  <eric.carlson@apple.com>
1911
1912         REGRESSION(r190262): User media unit test failures after r190262
1913         https://bugs.webkit.org/show_bug.cgi?id=149580
1914
1915         Reviewed by Darin Adler.
1916
1917         * Modules/mediastream/RTCPeerConnection.cpp:
1918         (WebCore::RTCPeerConnection::getStats): Drive-by fix to deal with optional param.
1919
1920         * Modules/mediastream/UserMediaRequest.cpp:
1921         (WebCore::UserMediaRequest::constraintsValidated): Swap the track parameter order.
1922         * Modules/mediastream/UserMediaRequest.h:
1923
1924         * platform/mediastream/MediaStreamCreationClient.h:
1925         (WebCore::MediaStreamCreationClient::validateRequestConstraints): Swap the track parameter order.
1926
1927         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1928         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints): If there is no 
1929           constraint for a media type, don't return a device of that type.
1930
1931         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
1932         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable): Ditto.
1933
1934         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1935         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
1936
1937         * platform/mock/TimerEventBasedMock.h:
1938         (WebCore::TimerEvent::~TimerEvent): Clear the m_mock pointer.
1939
1940         * platform/mock/UserMediaClientMock.h:
1941         (WebCore::UserMediaClientMock::fire): Deal with empty device vectors.
1942
1943         * testing/Internals.cpp:
1944         (WebCore::Internals::Internals): Don't register UserMediaController, it isn't needed for
1945           WKTR.
1946
1947 2015-09-29  Antti Koivisto  <antti@apple.com>
1948
1949         Use separate style resolver for user agent shadow trees
1950         https://bugs.webkit.org/show_bug.cgi?id=149626
1951
1952         Reviewed by Andreas Kling.
1953
1954         We now support separate style resolvers for shadow trees. Use this mechanism to have a separate
1955         per-document style resolver for user agent shadow trees. This isolates user agent shadow trees
1956         from author style better and simplifies the style resolver. It can also avoid some unnecessary style recalcs.
1957
1958         * css/DocumentRuleSets.cpp:
1959         (WebCore::DocumentRuleSets::resetAuthorStyle):
1960         (WebCore::DocumentRuleSets::appendAuthorStyleSheets):
1961
1962             Change interface so that only the new rules are provided.
1963
1964         * css/DocumentRuleSets.h:
1965         * css/ElementRuleCollector.cpp:
1966         (WebCore::ElementRuleCollector::addElementStyleProperties):
1967         (WebCore::ElementRuleCollector::collectMatchingRules):
1968
1969             We can remove special bailout as shadow tree style resolver won't have other author style
1970
1971         (WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
1972
1973             Remove the exception that disables property whitelists for UA stylesheets. We don't seem to use the feature.
1974
1975         (WebCore::ElementRuleCollector::matchUARules):
1976         (WebCore::MatchingUARulesScope::MatchingUARulesScope): Deleted.
1977         (WebCore::MatchingUARulesScope::~MatchingUARulesScope): Deleted.
1978         (WebCore::MatchingUARulesScope::isMatchingUARules): Deleted.
1979
1980             Remove this unnecessary hack.
1981
1982         * css/ElementRuleCollector.h:
1983         (WebCore::ElementRuleCollector::ElementRuleCollector):
1984         * css/RuleSet.cpp:
1985         (WebCore::RuleSet::addStyleRule):
1986         (WebCore::RuleSet::copyShadowPseudoElementRulesFrom):
1987
1988             Also copy WebVTT rules. They are currently a sort of mixture of UA and author shadow tree.
1989
1990         (WebCore::shrinkMapVectorsToFit):
1991         * css/RuleSet.h:
1992         (WebCore::RuleData::containsUncommonAttributeSelector):
1993         (WebCore::RuleData::linkMatchType):
1994         (WebCore::RuleData::hasDocumentSecurityOrigin):
1995         (WebCore::RuleData::propertyWhitelistType):
1996         (WebCore::RuleData::descendantSelectorIdentifierHashes):
1997         (WebCore::RuleSet::ruleCount):
1998         (WebCore::RuleSet::hasShadowPseudoElementRules):
1999         * css/StyleInvalidationAnalysis.cpp:
2000         (WebCore::StyleInvalidationAnalysis::StyleInvalidationAnalysis):
2001         (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
2002
2003             Don't invalidate the whole tree when author shadow pseudo element rules change. Just invalidate the shadow trees.
2004
2005         (WebCore::StyleInvalidationAnalysis::invalidateStyleForTree):
2006         (WebCore::StyleInvalidationAnalysis::invalidateStyle):
2007         (WebCore::invalidateIfNeeded): Deleted.
2008         (WebCore::invalidateStyleForTree): Deleted.
2009         * css/StyleInvalidationAnalysis.h:
2010         (WebCore::StyleInvalidationAnalysis::dirtiesAllStyle):
2011         (WebCore::StyleInvalidationAnalysis::hasShadowPseudoElementRulesInAuthorSheet):
2012         * css/StyleResolver.cpp:
2013         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
2014         (WebCore::StyleResolver::StyleResolver):
2015         (WebCore::StyleResolver::appendAuthorStyleSheets):
2016
2017             Simpler interface.
2018
2019         * css/StyleResolver.h:
2020         (WebCore::StyleResolver::document):
2021         (WebCore::StyleResolver::documentSettings):
2022         (WebCore::StyleResolver::ruleSets):
2023         * dom/AuthorStyleSheets.cpp:
2024         (WebCore::AuthorStyleSheets::collectActiveStyleSheets):
2025         (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
2026
2027             Cleanups.
2028
2029         (WebCore::filterEnabledNonemptyCSSStyleSheets):
2030         (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
2031         (WebCore::AuthorStyleSheets::updateStyleResolver):
2032
2033             Factor to a function.
2034             Copy any author shadow pseudo elements to user agent shadow tree resolver.
2035
2036         (WebCore::AuthorStyleSheets::activeStyleSheetsForInspector):
2037         * dom/AuthorStyleSheets.h:
2038         * dom/Document.cpp:
2039         (WebCore::Document::createStyleResolver):
2040         (WebCore::Document::userAgentShadowTreeStyleResolver):
2041
2042             Use separate resolver.
2043
2044         (WebCore::Document::fontsNeedUpdate):
2045         (WebCore::Document::clearStyleResolver):
2046         * dom/Document.h:
2047         (WebCore::Document::ensureStyleResolver):
2048         * dom/ShadowRoot.cpp:
2049         (WebCore::ShadowRoot::styleResolver):
2050
2051             Return document-global shadow tree resolver for ua trees.
2052
2053         * style/StyleResolveTree.cpp:
2054         (WebCore::Style::resolveShadowTree):
2055
2056             Take styleChange of shadow root into account.
2057
2058 2015-09-30  Gwang Yoon Hwang  <yoon@igalia.com>
2059
2060         [GTK] Support HiDPI Properly in WebKitGtk+ with the TextureMapper
2061         https://bugs.webkit.org/show_bug.cgi?id=141782
2062
2063         Reviewed by Carlos Garcia Campos.
2064
2065         This patch fixes HiDPI issue in the TextureMapper.
2066         To support HiDPI in the TextureMapper, we need to draw scaled contents
2067         in the TextureMapperTile, and apply the global scale in the root layer
2068         to apply transforms correctly.
2069
2070         Supporting the device scale is handled at LayerTreeHostGtk and
2071         TextureMapperBackingStore, and GraphicsLayerTextureMapper doesn't handle
2072         the device scale directly.
2073
2074         From the TextureMapperLayer, deviceScale and pageScale do not have to be
2075         handled differently. These are multiplied and provided to
2076         TextureMapperBackingStore.
2077
2078         * platform/graphics/texmap/TextureMapperTile.cpp:
2079         (WebCore::TextureMapperTile::updateContents):
2080         * platform/graphics/texmap/TextureMapperTile.h:
2081         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
2082
2083             Modified to increase the cover rect for tiles creation. For the image
2084             contents, it just creates texture with a image size, regardless of the
2085             contents scale.
2086
2087         * platform/graphics/texmap/BitmapTexture.cpp:
2088         (WebCore::BitmapTexture::updateContents):
2089
2090             Apply the device scale to the graphics context before painting contents.
2091
2092         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2093         (WebCore::GraphicsLayerTextureMapper::setContentsToImage):
2094         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
2095
2096             Apply the device scale and the page scale to the backing store
2097
2098 2015-09-29  Ryosuke Niwa  <rniwa@webkit.org>
2099
2100         ASSERTION FAILED: !isUnreachableNode(m_target.get()) when hovering over any input element
2101         https://bugs.webkit.org/show_bug.cgi?id=149589
2102
2103         Reviewed by Darin Adler.
2104
2105         The bug was caused by target not being reset across shadow boundary when SHADOW_DOM was disabled.
2106
2107         No new tests since exiting tests cover this in debug builds. e.g. editing/deleting/5290534.html
2108
2109         * dom/EventDispatcher.cpp:
2110         (WebCore::EventPath::EventPath):
2111
2112 2015-09-29  Jon Honeycutt  <jhoneycutt@apple.com>
2113
2114         Avoid reparsing an XSLT stylesheet after the first failure.
2115         https://bugs.webkit.org/show_bug.cgi?id=149188
2116         <rdar://problem/22709912>
2117
2118         Reviewed by Dave Hyatt.
2119
2120         Patch by Jiewen Tan, jiewen_tan@apple.com.
2121
2122         Test: svg/custom/invalid-xslt-crash.svg
2123
2124         * xml/XSLStyleSheet.h:
2125         Add a new member variable m_compilationFailed that tracks whether
2126         compilation has failed. Default value is false.
2127
2128         * xml/XSLStyleSheetLibxslt.cpp:
2129         (WebCore::XSLStyleSheet::compileStyleSheet):
2130         Return early if the compilation has failed before. After compiling the
2131         style sheet, if we failed, set m_compilationFailed to true.
2132
2133 2015-09-29  Hunseop Jeong  <hs85.jeong@samsung.com>
2134
2135         Use modern for-loops in WebCore/loader.
2136         https://bugs.webkit.org/show_bug.cgi?id=149397
2137
2138         Reviewed by Darin Adler.
2139
2140         No new tests because there is no behavior change.
2141
2142         * loader/CrossOriginAccessControl.cpp:
2143         (WebCore::parseAccessControlExposeHeadersAllowList):
2144         * loader/DocumentLoader.cpp:
2145         (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
2146         * loader/FormSubmission.cpp:
2147         (WebCore::FormSubmission::create):
2148         * loader/FrameLoader.cpp:
2149         (WebCore::FrameLoader::~FrameLoader):
2150         (WebCore::FrameLoader::commitProvisionalLoad):
2151         (WebCore::FrameLoader::detachChildren):
2152         (WebCore::FrameLoader::shouldClose):
2153         (WebCore::FrameLoader::tellClientAboutPastMemoryCacheLoads):
2154         * loader/HistoryController.cpp:
2155         (WebCore::HistoryController::currentFramesMatchItem):
2156         * loader/SubframeLoader.cpp:
2157         (WebCore::findPluginMIMETypeFromURL):
2158         (WebCore::SubframeLoader::createJavaAppletWidget):
2159         * loader/appcache/ApplicationCache.cpp:
2160         (WebCore::ApplicationCache::isURLInOnlineWhitelist):
2161         (WebCore::ApplicationCache::urlMatchesFallbackNamespace):
2162         * loader/appcache/ApplicationCacheGroup.cpp:
2163         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
2164         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
2165         (WebCore::ApplicationCacheGroup::postListenerTask):
2166         * loader/appcache/ApplicationCacheHost.cpp:
2167         (WebCore::ApplicationCacheHost::stopDeferringEvents):
2168         * loader/appcache/ApplicationCacheStorage.cpp:
2169         (WebCore::StorageIDJournal::~StorageIDJournal):
2170         (WebCore::ApplicationCacheStorage::store):
2171         (WebCore::ApplicationCacheStorage::getOriginsWithCache):
2172         * loader/archive/Archive.cpp:
2173         (WebCore::Archive::clearAllSubframeArchivesImpl):
2174         * loader/archive/ArchiveResourceCollection.cpp:
2175         (WebCore::ArchiveResourceCollection::addAllResources):
2176         * loader/archive/cf/LegacyWebArchive.cpp:
2177         (WebCore::LegacyWebArchive::createPropertyListRepresentation):
2178         (WebCore::LegacyWebArchive::create):
2179         * loader/archive/mhtml/MHTMLArchive.cpp:
2180         (WebCore::MHTMLArchive::generateMHTMLData):
2181         * loader/cache/CachedImage.cpp:
2182         (WebCore::CachedImage::switchClientsToRevalidatedResource):
2183         (WebCore::CachedImage::createImage):
2184         * loader/cache/CachedResource.cpp:
2185         (WebCore::CachedResource::switchClientsToRevalidatedResource):
2186         * loader/cache/CachedResourceLoader.cpp:
2187         (WebCore::CachedResourceLoader::~CachedResourceLoader):
2188         (WebCore::CachedResourceLoader::reloadImagesIfNotDeferred):
2189         (WebCore::CachedResourceLoader::garbageCollectDocumentResources):
2190         (WebCore::CachedResourceLoader::isPreloaded):
2191         (WebCore::CachedResourceLoader::printPreloadStats):
2192         * loader/icon/IconDatabase.cpp:
2193         (WebCore::IconDatabase::removeAllIcons):
2194         (WebCore::IconDatabase::setIconDataForIconURL):
2195         (WebCore::IconDatabase::iconRecordCountWithData):
2196         (WebCore::IconDatabase::notifyPendingLoadDecisions):
2197         (WebCore::IconDatabase::performURLImport):
2198         (WebCore::IconDatabase::performPendingRetainAndReleaseOperations):
2199         (WebCore::IconDatabase::readFromDatabase):
2200         (WebCore::IconDatabase::writeToDatabase):
2201
2202 2015-09-29  Chris Dumez  <cdumez@apple.com>
2203
2204         sectionRowIndex must return -1 when its parent is not a table, tbody, thead, or tfoot
2205         https://bugs.webkit.org/show_bug.cgi?id=148841
2206         <rdar://problem/22586870>
2207
2208         Reviewed by Ryosuke Niwa.
2209
2210         Update HTMLTableRowElement.sectionRowIndex to match the specification:
2211         https://html.spec.whatwg.org/multipage/tables.html#dom-tr-sectionrowindex
2212
2213         In particular, it now returns -1 if the parent is not a table, tbody,
2214         thead and tfoot.
2215
2216         No new tests, already covered by existing test.
2217
2218         * html/HTMLTableRowElement.cpp:
2219         (WebCore::HTMLTableRowElement::sectionRowIndex):
2220
2221 2015-09-29  Daniel Bates  <dabates@apple.com>
2222
2223         Make WebKit for iOS Simulator build with the public iOS 9 SDK
2224         https://bugs.webkit.org/show_bug.cgi?id=149652
2225
2226         Reviewed by Simon Fraser.
2227
2228         * WebCore.xcodeproj/project.pbxproj: Add private header pthreadSPI.h. Also move entry for IDBTransaction.h so that it is in sorted order.
2229         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Substitute AVPlayerViewControllerDelegate_WebKitOnly for AVPlayerViewControllerDelegate.
2230         * platform/spi/cocoa/AVKitSPI.h: As of iOS 9, AVPlayerViewControllerDelegate is a public protocol. Separate out WebKit-specific SPI into protocol
2231         AVPlayerViewControllerDelegate_WebKitOnly, which extends AVPlayerViewControllerDelegate. Also, the properties -[AVPlayerViewController allowsPictureInPicturePlayback] and -[AVPlayerViewController delegate] are public in iOS 9.
2232         * platform/spi/cocoa/pthreadSPI.h: Added.
2233         * platform/spi/ios/LaunchServicesSPI.h: Add more SPI.
2234         * platform/spi/ios/MediaPlayerSPI.h: Ignore deprecation warnings for UIPopoverController and UIActionSheet.
2235
2236 2015-09-29  Brady Eidson  <beidson@apple.com>
2237
2238         Followup to "Move WebKit2 AsyncTask to WebCore CrossThreadTask."
2239         https://bugs.webkit.org/show_bug.cgi?id=149651
2240
2241         Rubberstamped by Alex Christensen.
2242
2243         No new tests (No change in behavior).
2244
2245         * platform/CrossThreadTask.h: Now in WebCore, use the WebCore namespace.
2246
2247 2015-09-29  Brady Eidson  <beidson@apple.com>
2248
2249         Move WebKit2 AsyncTask to WebCore CrossThreadTask.
2250         https://bugs.webkit.org/show_bug.cgi?id=149651
2251
2252         Reviewed by Alex Christensen.
2253
2254         No new tests (No change in behavior).
2255         
2256         It will be needed in WebCore to support IndexedDB.
2257
2258         * WebCore.xcodeproj/project.pbxproj:
2259         * platform/CrossThreadTask.h: Renamed from Source/WebKit2/Shared/AsyncTask.h.
2260         (WebKit::CrossThreadTask::CrossThreadTask):
2261         (WebKit::CrossThreadTask::performTask):
2262         (WebKit::createCrossThreadTask):
2263
2264 2015-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2265
2266         Snap offsets should update when style is programmatically changed
2267         https://bugs.webkit.org/show_bug.cgi?id=135964
2268         <rdar://problem/18162411>
2269
2270         Reviewed by Darin Adler.
2271
2272         Tests:  css3/scroll-snap/scroll-snap-style-changed-coordinates.html
2273                 css3/scroll-snap/scroll-snap-style-changed-repeat.html
2274
2275         Updating scroll snap style properties now programmatically updates the scroll snap container. Does not yet
2276         handle the case of reparented elements with scroll snap coordinates. Adds some plumbing the FrameView and
2277         RenderLayerCompositor to immediately update the scrolling coordinator when updating the FrameView due to
2278         style changes.
2279
2280         * page/FrameView.cpp:
2281         (WebCore::FrameView::updateScrollingCoordinatorScrollSnapProperties): Calls on the compositor to reupdate scroll snap
2282             properties on the FrameView.
2283         * page/FrameView.h:
2284         * page/scrolling/AsyncScrollingCoordinator.cpp: Sets snap offsets to an empty vector when appropriate.
2285         (WebCore::setStateScrollingNodeSnapOffsetsAsFloat): Ditto.
2286         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Ditto.
2287         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Ditto.
2288         (WebCore::AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView): Updates scroll snap properties
2289             from a given FrameView.
2290         * page/scrolling/AsyncScrollingCoordinator.h:
2291         * page/scrolling/ScrollingCoordinator.h:
2292         (WebCore::ScrollingCoordinator::updateScrollSnapPropertiesWithFrameView):
2293         * rendering/RenderLayerCompositor.cpp:
2294         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): Updates the scrolling coordinator's
2295             scroll snap properties.
2296         * rendering/RenderLayerCompositor.h: Plumb scroll snap property updating to the FrameView.
2297         * rendering/RenderLayerModelObject.cpp: Checks for style changes and updates snap offsets when appropriate.
2298         (WebCore::scrollSnapContainerRequiresUpdateForStyleUpdate): Ditto.
2299         (WebCore::RenderLayerModelObject::styleDidChange): Ditto.
2300
2301 2015-09-29  Jer Noble  <jer.noble@apple.com>
2302
2303         REGRESSION: WebAudio user-gesture restriction is no longer lifted by touchstart event
2304         https://bugs.webkit.org/show_bug.cgi?id=149367
2305
2306         Reviewed by Eric Carlson.
2307
2308         Use processingUserGestureForMedia() rather than processingUserGesture(),
2309         as the former includes touchstart and the latter does not.
2310
2311         * Modules/webaudio/AudioContext.cpp:
2312         (WebCore::AudioContext::willBeginPlayback):
2313         (WebCore::AudioContext::willPausePlayback):
2314         * html/MediaElementSession.cpp:
2315         (WebCore::MediaElementSession::playbackPermitted):
2316         (WebCore::MediaElementSession::dataLoadingPermitted):
2317         (WebCore::MediaElementSession::fullscreenPermitted):
2318         (WebCore::MediaElementSession::showPlaybackTargetPicker):
2319
2320 2015-09-29  Ryosuke Niwa  <rniwa@webkit.org>
2321
2322         Update style/layout when a slot is added or removed
2323         https://bugs.webkit.org/show_bug.cgi?id=149593
2324
2325         Reviewed by Antti Koivisto.
2326
2327         Fixed the bug by forcing the render tree reconstruction on the shadow host when a slot is inserted or removed.
2328         We should optimize these reconstructions by only triggering them on the affected slot elements in the future.
2329
2330         Also fixed a bug that we were not invalidating the slot assignments when a default slot is introduced dynamically
2331         after the slot assignment algorithm had run.
2332
2333         Test (existing): fast/shadow-dom/shadow-layout-after-slot-changes.html
2334
2335         * dom/ShadowRoot.cpp:
2336         (WebCore::ShadowRoot::addSlotElementByName): Passes in ShadowRoot.
2337         (WebCore::ShadowRoot::removeSlotElementByName): Ditto.
2338         * dom/SlotAssignment.cpp:
2339         (WebCore::SlotAssignment::addSlotElementByName): Call setNeedsStyleRecalc.
2340         (WebCore::SlotAssignment::removeSlotElementByName): Call setNeedsStyleRecalc if the host is still alive since this
2341         function can be called while the host is being destructed in which case shadowRoot.host() would be nullptr.
2342         * dom/SlotAssignment.h:
2343
2344 2015-09-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2345
2346         Improve binding of JSBuiltinConstructor classes
2347         https://bugs.webkit.org/show_bug.cgi?id=149556
2348
2349         Reviewed by Darin Adler.
2350
2351         JSBuiltinConstructor classes no longer need definition of a DOM class.
2352         These classes no longer go through the JS wrapper cache.
2353         Removed code related to DOM class handling (m_impl, releaseImpl, WrapperOwner, toJS, ...)
2354         Updated creation code.
2355
2356         Refactoring of the binding generator code to simplify whether generating or not some methods.
2357
2358         Removed unneeded include of DOM class in JSXX.cpp (already done in JSXX.h)
2359
2360         Added new binding test to cover JSBuiltinConstructor keyword.
2361
2362         Covered by binding tests.
2363
2364         * bindings/js/JSDOMBinding.h:
2365         (WebCore::createJSBuiltin):
2366         (WebCore::DOMConstructorObject::createStructure):.
2367         * bindings/scripts/CodeGeneratorJS.pm:
2368         (NeedsImplementationClass):
2369         (ShouldGenerateToWrapped):
2370         (ShouldGenerateWrapperOwnerCode):
2371         (ShouldGenerateToJSDeclaration):
2372         (ShouldGenerateToJSImplementation):
2373         (GenerateHeader):
2374         (GenerateImplementation):
2375         (GenerateConstructorDefinition):
2376         (ComputeFunctionSpecial):.
2377         (UseJSBuiltins):.
2378         * bindings/scripts/test/GObject/WebKitDOMTestJSBuiltinConstructor.cpp: Added.
2379         (WebKit::kit):
2380         (WebKit::core):
2381         (WebKit::wrapTestJSBuiltinConstructor):
2382         (webkit_dom_test_js_builtin_constructor_finalize):
2383         (webkit_dom_test_js_builtin_constructor_constructor):
2384         (webkit_dom_test_js_builtin_constructor_class_init):
2385         (webkit_dom_test_js_builtin_constructor_init):
2386         * bindings/scripts/test/GObject/WebKitDOMTestJSBuiltinConstructor.h: Added.
2387         * bindings/scripts/test/GObject/WebKitDOMTestJSBuiltinConstructorPrivate.h: Added.
2388         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2389         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2390         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2391         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2392         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2393         * bindings/scripts/test/JS/JSTestException.cpp:
2394         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2395         * bindings/scripts/test/JS/JSTestInterface.cpp:
2396         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: Added.
2397         (WebCore::JSTestJSBuiltinConstructorPrototype::create):
2398         (WebCore::JSTestJSBuiltinConstructorPrototype::createStructure):
2399         (WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype):
2400         (WebCore::JSTestJSBuiltinConstructorConstructor::create):
2401         (WebCore::JSTestJSBuiltinConstructorConstructor::createStructure):
2402         (WebCore::JSTestJSBuiltinConstructorConstructor::constructJSTestJSBuiltinConstructor):
2403         (WebCore::JSTestJSBuiltinConstructorConstructor::JSTestJSBuiltinConstructorConstructor):
2404         (WebCore::JSTestJSBuiltinConstructorConstructor::finishCreation):
2405         (WebCore::JSTestJSBuiltinConstructorConstructor::getConstructData):
2406         (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation):
2407         (WebCore::JSTestJSBuiltinConstructor::JSTestJSBuiltinConstructor):
2408         (WebCore::JSTestJSBuiltinConstructor::createPrototype):
2409         (WebCore::JSTestJSBuiltinConstructor::getPrototype):
2410         (WebCore::JSTestJSBuiltinConstructor::destroy):
2411         (WebCore::JSTestJSBuiltinConstructor::~JSTestJSBuiltinConstructor):
2412         (WebCore::jsTestJSBuiltinConstructorConstructor):
2413         (WebCore::JSTestJSBuiltinConstructor::getConstructor):
2414         (WebCore::JSTestJSBuiltinConstructor::visitChildren):
2415         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h: Added.
2416         (WebCore::JSTestJSBuiltinConstructor::create):
2417         (WebCore::JSTestJSBuiltinConstructor::createStructure):
2418         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2419         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2420         * bindings/scripts/test/JS/JSTestNode.cpp:
2421         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2422         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2423         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2424         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2425         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2426         * bindings/scripts/test/JS/JSattribute.cpp:
2427         * bindings/scripts/test/JS/JSreadonly.cpp:
2428         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.h: Added.
2429         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.mm: Added.
2430         (-[DOMTestJSBuiltinConstructor dealloc]):
2431         (-[DOMTestJSBuiltinConstructor finalize]):
2432         (core):
2433         (kit):
2434         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructorInternal.h: Added.
2435         * bindings/scripts/test/TestJSBuiltinConstructor.idl: Added.
2436
2437 2015-09-29  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2438
2439         [Streams API] [Win] Remove reference to dead CountQueuingStrategy.h
2440         https://bugs.webkit.org/show_bug.cgi?id=149623
2441
2442         Reviewed by Darin Adler.
2443
2444         No new tests needed.
2445
2446         * WebCore.vcxproj/WebCore.vcxproj.filters:
2447
2448 2015-09-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2449
2450         Build WebCore JS Builtins according the ENABLE flags
2451         https://bugs.webkit.org/show_bug.cgi?id=149624
2452
2453         Reviewed by Csaba Osztrogonác.
2454
2455         Created WebCoreJSBuiltins.cpp to include all JSXXBuiltins.cpp files with the right #ifdef.
2456         Added WebCoreJSBuiltins.cpp to CMake, win and mac build systems.
2457
2458         No change in behavior.
2459
2460         * CMakeLists.txt:
2461         * DerivedSources.cpp:
2462         * WebCore.vcxproj/WebCore.vcxproj:
2463         * WebCore.xcodeproj/project.pbxproj:
2464         * bindings/js/WebCoreJSBuiltins.cpp: Added.
2465
2466 2015-09-29  Javier Fernandez  <jfernandez@igalia.com>
2467
2468         [CSS Grid Layout] Flex tracks sizing alg must handle 0fr values
2469         https://bugs.webkit.org/show_bug.cgi?id=148944
2470
2471         Reviewed by Darin Adler.
2472
2473         We don't allow 0 as flexible size value, which is not following current
2474         specs; it just states that it must be a positive value. This patch
2475         adds such change in the parser but some additional logic must be added
2476         as well to handle 0 values during the flex tracks sizing algorithm.
2477
2478         The old algorithm didn't take 0 values into account, so there is the risk
2479         of division by zero. Additionally, it was not handling fraction values
2480         in the best way. The last versions of the spec changed this algorithm in
2481         order to handle fraction values so that they don't cause exponential
2482         grow of tracks using values bigger than 1.
2483
2484         This patch implements also such new algorithm, so we can deal not only
2485         with 0 values, but managing fraction values properly.
2486
2487         No new tests, just some additional test cases and some of them rebaselined.
2488
2489         * rendering/RenderGrid.cpp:
2490         (WebCore::normalizedFlexFraction):
2491         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
2492         (WebCore::RenderGrid::computeFlexFactorUnitSize): Added.
2493         (WebCore::RenderGrid::findFlexFactorUnitSize): Added.
2494         (WebCore::RenderGrid::GridTrackForNormalization): Deleted.
2495         (WebCore::RenderGrid::computeNormalizedFractionBreadth): Deleted.
2496         * rendering/RenderGrid.h:
2497
2498 2015-09-29  Csaba Osztrogonác  <ossy@webkit.org>
2499
2500         Fix the broken !ENABLE(STREAM_API) build
2501         https://bugs.webkit.org/show_bug.cgi?id=149525
2502
2503         Reviewed by Darin Adler.
2504
2505         * bindings/js/WebCoreJSClientData.h: Revert r190225.
2506
2507
2508 2015-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2509
2510         printing does not use minimum page zoom factor
2511         https://bugs.webkit.org/show_bug.cgi?id=108507
2512
2513         Reviewed by Darin Adler.
2514
2515         * page/PrintContext.cpp:
2516         (WebCore::PrintContext::beginAndComputePageRectsWithPageSize):
2517         Helper function to share common code from numberOfPages() and
2518         spoolAllPagesWithBoundaries().
2519         (WebCore::PrintContext::numberOfPages): Use beginAndComputePageRectsWithPageSize().
2520         (WebCore::PrintContext::spoolAllPagesWithBoundaries): Use
2521         beginAndComputePageRectsWithPageSize() and don't flip the Y axis
2522         for non Cocoa platforms.
2523         * page/PrintContext.h:
2524
2525 2015-09-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2526
2527         Add support for WebIDL JSBuiltin attributes
2528         https://bugs.webkit.org/show_bug.cgi?id=149554
2529
2530         Reviewed by Darin Adler.
2531
2532         Covered by bindings tests.
2533
2534         * bindings/scripts/CodeGeneratorGObject.pm:
2535         (SkipAttribute): Disabled GObject binding generation of JSBuiltin attribute.
2536         * bindings/scripts/CodeGeneratorJS.pm:
2537         (GetAttributeGetterName): Handling of Builtin function to retrieve BuiltinGenerator.
2538         (GetAttributeSetterName): Ditto.
2539         (GenerateAttributesHashTable): Set JSBuiltin attributes as "Accessor | Builtin".
2540         (GenerateImplementation): Skip implementation for JSBuiltin attributes
2541         * bindings/scripts/test/JS/JSTestObj.cpp: Adding binding test for JSBuiltin attributes.
2542         * bindings/scripts/test/ObjC/DOMTestObj.h:
2543         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2544         (-[DOMTestObj jsBuiltinAttribute]):
2545         (-[DOMTestObj setJsBuiltinAttribute:]):
2546         (-[DOMTestObj jsBuiltinReadOnlyAttribute]):
2547         * bindings/scripts/test/TestObj.idl: Ditto.
2548
2549 2015-09-28  Brent Fulgham  <bfulgham@apple.com>
2550
2551         [Win] Fix build after r190295.
2552
2553         * PlatformWin.cmake: Add missing Forwarding Header.
2554
2555 2015-09-28  Brady Eidson  <beidson@apple.com>
2556
2557         Add an IDB Server that can roundtrip a request back to the client.
2558         https://bugs.webkit.org/show_bug.cgi?id=149603
2559
2560         Reviewed by NOBODY (Build fix).
2561
2562         * Modules/indexeddb/IDBRequest.h: Remove unneeded #include, fixing the WK/WK2 builds.
2563
2564 2015-09-28  Brent Fulgham  <bfulgham@apple.com>
2565
2566         Expose 'geometryFlipped' state for debugging/logging purposes
2567         https://bugs.webkit.org/show_bug.cgi?id=149557
2568
2569         Reviewed by Simon Fraser.
2570
2571         No new tests: No new behavior.
2572
2573         * platform/graphics/ca/PlatformCALayer.h:
2574         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2575         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2576         (PlatformCALayerCocoa::geometryFlipped): Added.
2577         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2578         (PlatformCALayerWin::geometryFlipped): Added.
2579         (printLayer): Log flipped state of geometry.
2580         * platform/graphics/ca/win/PlatformCALayerWin.h:
2581
2582 2015-09-28  Brady Eidson  <beidson@apple.com>
2583
2584         Add an IDB Server that can roundtrip a request back to the client.
2585         https://bugs.webkit.org/show_bug.cgi?id=149603
2586
2587         Reviewed by Alex Christensen.
2588
2589         Test: storage/indexeddb/modern/deletedatabase-request-event.html
2590
2591         This is a critical piece of IDB infrastructure that:
2592         - Puts a database client/server divide in place.
2593         - Client synchronously sends requests to the server, and asynchronously receives a response back from it.
2594         - Introduces a class structure that makes it easy for WebKit2 to add a thin layer to replace the 
2595           in-process server with an out-of-process server.
2596
2597         To allow for the most basic of tests, the "delete database" request is hard coded as always failing 
2598         with an indeterminate error.
2599
2600         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
2601         (WebCore::DOMWindowIndexedDatabase::indexedDB):
2602
2603         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
2604         (WebCore::IDBDatabaseIdentifier::debugString):
2605         * Modules/indexeddb/IDBDatabaseIdentifier.h:
2606
2607         * Modules/indexeddb/client/IDBConnectionToServer.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp.
2608         (WebCore::IDBClient::IDBConnectionToServer::create):
2609         (WebCore::IDBClient::IDBConnectionToServer::IDBConnectionToServer):
2610         (WebCore::IDBClient::IDBConnectionToServer::identifier):
2611         (WebCore::IDBClient::IDBConnectionToServer::deleteDatabase):
2612         (WebCore::IDBClient::IDBConnectionToServer::didDeleteDatabase):
2613
2614         * Modules/indexeddb/client/IDBConnectionToServer.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
2615         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
2616         (WebCore::IDBClient::IDBConnectionToServerDelegate::~IDBConnectionToServerDelegate):
2617
2618         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
2619         (WebCore::IDBClient::IDBFactory::create):
2620         (WebCore::IDBClient::IDBFactory::IDBFactory):
2621         (WebCore::IDBClient::IDBFactory::openInternal):
2622         (WebCore::IDBClient::IDBFactory::deleteDatabase):
2623         * Modules/indexeddb/client/IDBFactoryImpl.h:
2624
2625         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
2626         (WebCore::IDBClient::IDBOpenDBRequest::createDeleteRequest):
2627         (WebCore::IDBClient::IDBOpenDBRequest::createOpenRequest):
2628         (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
2629         (WebCore::IDBClient::IDBOpenDBRequest::~IDBOpenDBRequest):
2630         (WebCore::IDBClient::IDBOpenDBRequest::requestCompleted):
2631         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
2632         (WebCore::IDBClient::IDBOpenDBRequest::databaseIdentifier):
2633         (WebCore::IDBClient::IDBOpenDBRequest::version):
2634         (WebCore::IDBClient::IDBOpenDBRequest::create): Deleted.
2635
2636         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2637         (WebCore::IDBClient::IDBRequest::IDBRequest):
2638         (WebCore::IDBClient::IDBRequest::enqueueEvent):
2639         * Modules/indexeddb/client/IDBRequestImpl.h:
2640         (WebCore::IDBClient::IDBRequest::requestIdentifier):
2641
2642         * Modules/indexeddb/server/IDBConnectionToClient.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp.
2643         (WebCore::IDBServer::IDBConnectionToClient::create):
2644         (WebCore::IDBServer::IDBConnectionToClient::IDBConnectionToClient):
2645         (WebCore::IDBServer::IDBConnectionToClient::identifier):
2646         (WebCore::IDBServer::IDBConnectionToClient::didDeleteDatabase):
2647         * Modules/indexeddb/server/IDBConnectionToClient.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
2648         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
2649         (WebCore::IDBServer::IDBConnectionToClientDelegate::~IDBConnectionToClientDelegate):
2650
2651         * Modules/indexeddb/server/IDBServer.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp.
2652         (WebCore::IDBServer::IDBServer::create):
2653         (WebCore::IDBServer::IDBServer::IDBServer):
2654         (WebCore::IDBServer::IDBServer::registerConnection):
2655         (WebCore::IDBServer::IDBServer::unregisterConnection):
2656         (WebCore::IDBServer::IDBServer::deleteDatabase):
2657         * Modules/indexeddb/server/IDBServer.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
2658
2659         * Modules/indexeddb/shared/IDBError.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.cpp.
2660         (WebCore::idbExceptionEntry):
2661         (WebCore::IDBError::IDBError):
2662         (WebCore::IDBError::operator=):
2663         (WebCore::IDBError::name):
2664         (WebCore::IDBError::message):
2665         * Modules/indexeddb/shared/IDBError.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.cpp.
2666         (WebCore::IDBError::IDBError):
2667         (WebCore::IDBError::isNull):
2668
2669         * Modules/indexeddb/shared/IDBRequestData.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp.
2670         (WebCore::IDBRequestData::IDBRequestData):
2671         * Modules/indexeddb/shared/IDBRequestData.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
2672         (WebCore::IDBRequestData::requestIdentifier):
2673         (WebCore::IDBRequestData::databaseIdentifier):
2674
2675         * Modules/indexeddb/shared/IDBRequestIdentifier.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp.
2676         (WebCore::nextRequestNumber):
2677         (WebCore::IDBRequestIdentifier::IDBRequestIdentifier):
2678         (WebCore::IDBRequestIdentifier::emptyValue):
2679         (WebCore::IDBRequestIdentifier::deletedValue):
2680         (WebCore::IDBRequestIdentifier::isHashTableDeletedValue):
2681         * Modules/indexeddb/shared/IDBRequestIdentifier.h: Added.
2682         (WebCore::IDBRequestIdentifier::isEmpty):
2683         (WebCore::IDBRequestIdentifier::hash):
2684         (WebCore::IDBRequestIdentifier::operator==):
2685         (WebCore::IDBRequestIdentifier::connectionIdentifier):
2686         (WebCore::IDBRequestIdentifierHash::hash):
2687         (WebCore::IDBRequestIdentifierHash::equal):
2688         (WebCore::IDBRequestIdentifierHashTraits::emptyValue):
2689         (WebCore::IDBRequestIdentifierHashTraits::isEmptyValue):
2690         (WebCore::IDBRequestIdentifierHashTraits::constructDeletedValue):
2691         (WebCore::IDBRequestIdentifierHashTraits::isDeletedValue):
2692
2693         * Modules/indexeddb/shared/IDBResultData.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp.
2694         (WebCore::IDBResultData::IDBResultData):
2695         * Modules/indexeddb/shared/IDBResultData.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
2696         (WebCore::IDBResultData::requestIdentifier):
2697         (WebCore::IDBResultData::error):
2698
2699         * Modules/indexeddb/shared/InProcessIDBServer.cpp: Added.
2700         (WebCore::InProcessIDBServer::create):
2701         (WebCore::InProcessIDBServer::InProcessIDBServer):
2702         (WebCore::InProcessIDBServer::identifier):
2703         (WebCore::InProcessIDBServer::connectionToServer):
2704         (WebCore::InProcessIDBServer::connectionToClient):
2705         (WebCore::InProcessIDBServer::deleteDatabase):
2706         (WebCore::InProcessIDBServer::didDeleteDatabase):
2707         * Modules/indexeddb/shared/InProcessIDBServer.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h.
2708
2709         * CMakeLists.txt:
2710         * WebCore.xcodeproj/project.pbxproj:
2711
2712         * loader/EmptyClients.cpp:
2713
2714         * page/DatabaseProvider.h:
2715
2716         * page/Page.cpp:
2717         (WebCore::Page::idbConnection):
2718         * page/Page.h:
2719
2720         * page/SecurityOriginData.cpp:
2721         (WebCore::SecurityOriginData::debugString):
2722         * page/SecurityOriginData.h:
2723
2724 2015-09-28  Ryosuke Niwa  <rniwa@webkit.org>
2725
2726         relatedNode should be retargeted respecting slots
2727         https://bugs.webkit.org/show_bug.cgi?id=149591
2728
2729         Reviewed by Antti Koivisto.
2730
2731         This patch retargets relatedNode with respect to shadow boundaries after r190214 as specified in
2732         https://w3c.github.io/webcomponents/spec/shadow/#retargeting-relatedtarget
2733
2734         Naively implementing the spec'ed behavior can result in O(n^2) behavior since we need to find the common tree scope
2735         ancestor for each target in the event path. This patch avoids this by implementing an O(1) incremental update step
2736         for when target's tree scope changes in the event path. See the description for moveToNewTreeScope below.
2737
2738         Test: fast/shadow-dom/event-with-related-target.html
2739
2740         * dom/EventContext.h: Replaced toMouseOrFocusEventContext by downcast<MouseOrFocusEventContext>.
2741         * dom/EventDispatcher.cpp:
2742         (WebCore::EventRelatedNodeResolver): Removed the code for relatedNode. This class is now only used for touch events.
2743         (WebCore::EventPath): Added m_event as a member variable.
2744
2745         (WebCore::RelatedNodeRetargeter): Added.
2746
2747         (WebCore::RelatedNodeRetargeter::RelatedNodeRetargeter): Does the initial retargeting of relatedNode. When the
2748         tree scope of relatedNode and the target are the same, we immediately exit without collecting ancestor tree scopes
2749         of relatedNode as an optimization. We also special case when the relatedNode and the target are in two different
2750         documents (relatedNode should be nullptr) and when one is in document and the other one is not in the document
2751         (relatedNode should be the host of the outermost shadow root). Otherwise we have to do the real work by collecting
2752         all tree scope ancestors and walking downwards from the document tree scope (note target and relatedNode share the
2753         same document scope here since we would have exited early otherwise).
2754
2755         (WebCore::RelatedNodeRetargeter::currentNode): Returned relatedNode retargeted for the current tree scope.
2756
2757         (WebCore::RelatedNodeRetargeter::moveToNewTreeScope): Moves to a new tree scope. If the original target and
2758         relatedNode were in different trees, there is nothing to be done. Note that we can only move out of a shadow root
2759         to its host or move into a slot so newTreeScope (current target's tree scope) and previousTreeScope (previous
2760         target's tree scope) must have a child-parent relationship.
2761
2762         If previousTreeScope did not contain the retargeted relatedNode, then neither can its child shadow trees. Thus,
2763         there is nothing to be done when moving into a slot in this case. If we're moving out of previousTreeScope, then
2764         newTreeScope may contain the retargeted relatedNode but that still doesn't require any work. So we exit early in
2765         both cases.
2766
2767         Otherwise (previousTreeScope contained retargeted relatedNode), if we're moving out of a child shadow root
2768         (previousTreeScope) then relatedNode should also move to previousTreeScope's shadow host since previousTreeScope
2769         is a direct-child shadow tree of newTreeScope and previousTreeScope's shadow host resides in newTreeScope.
2770
2771         If we're moving into a child shadow root via a slot, then there are three possibilities: relatedNode is in
2772         previousTreeScope, newTreeScope and its child shadow trees, or newTreeScope's sibling tree scopes and its children.
2773         If it is in previousTreeScope (m_lowestCommonAncestorIndex is zero) or in newTreeScope's sibling, then
2774         previousTreeScope is the lowest common tree scope ancestor so there is nothing to be done. If relatedNode is in
2775         newTreeScope, then the retargeted relatedNode is either the shadow host of the shadow tree that contains
2776         relatedNode or relatedNode itself.
2777
2778         (WebCore::RelatedNodeRetargeter::checkConsistency): Finds the retargeted relatedNode in the simplest way to verify
2779         the correctness of the algorithm. We can disable this consistency check if it slows down debug builds too much.
2780         (WebCore::RelatedNodeRetargeter::nodeInLowestCommonAncestor): Finds the 
2781         (WebCore::RelatedNodeRetargeter::collectTreeScopes):
2782         (WebCore::EventPath::setRelatedTarget): Rewritten using RelatedNodeRetargeter.
2783
2784 2015-09-28  Alex Christensen  <achristensen@webkit.org>
2785
2786         Build WK1 with CMake on Mac
2787         https://bugs.webkit.org/show_bug.cgi?id=149604
2788
2789         Reviewed by Chris Dumez.
2790
2791         * CMakeLists.txt:
2792         * PlatformMac.cmake:
2793         Make a list of IDL files for the ObjC bindings.
2794
2795 2015-09-28  Chris Dumez  <cdumez@apple.com>
2796
2797         Drop support for legacy EventException
2798         https://bugs.webkit.org/show_bug.cgi?id=149597
2799         <rdar://problem/22879795>
2800
2801         Reviewed by Sam Weinig.
2802
2803         Drop support for legacy EventException. Both Firefox and Chrome do not
2804         support it, and our implementation no longer throws such exceptions.
2805
2806         No new tests, already covered by existing test.
2807
2808         * CMakeLists.txt:
2809         * DerivedSources.cpp:
2810         * DerivedSources.make:
2811         * Modules/indexeddb/legacy/LegacyRequest.cpp:
2812         * Modules/indexeddb/legacy/LegacyTransaction.cpp:
2813         * Modules/websockets/WebSocket.cpp:
2814         * WebCore.vcxproj/WebCore.vcxproj:
2815         * WebCore.vcxproj/WebCore.vcxproj.filters:
2816         * WebCore.xcodeproj/project.pbxproj:
2817         * bindings/gobject/WebKitDOMPrivate.cpp:
2818         * bindings/js/JSExceptionBase.cpp:
2819         (WebCore::toExceptionBase): Deleted.
2820         * dom/DOMAllInOne.cpp:
2821         * dom/DOMExceptions.in:
2822         * dom/EventException.cpp: Removed.
2823         * dom/EventException.h:
2824         (WebCore::EventException::EventException): Deleted.
2825         * dom/EventException.idl:
2826         * dom/EventListenerMap.cpp:
2827         * dom/EventTarget.cpp:
2828         * dom/MessagePort.cpp:
2829         * dom/Node.cpp:
2830         * loader/appcache/DOMApplicationCache.cpp:
2831         * page/DOMWindow.cpp:
2832         * page/EventSource.cpp:
2833         * page/PerformanceUserTiming.h:
2834         * workers/AbstractWorker.cpp:
2835         * workers/Worker.cpp:
2836         * workers/WorkerGlobalScope.cpp:
2837         * xml/XMLHttpRequest.cpp:
2838         * xml/XMLHttpRequestUpload.cpp:
2839
2840 2015-09-28  Chris Dumez  <cdumez@apple.com>
2841
2842         Object.getOwnPropertyNames() does not return named properties
2843         https://bugs.webkit.org/show_bug.cgi?id=149562
2844         <rdar://problem/22879779>
2845
2846         Reviewed by Darin Adler.
2847
2848         Previously, Object.getOwnPropertyNames() did not return named properties
2849         for interfaces with named property getters. This patch adds support for
2850         this in the JS bindings generator and uses it for HTMLCollection only
2851         for now. Other interfaces will be taken care of independently.
2852
2853         Note that currently, even though the named properties are returned by
2854         Object.getOwnPropertyNames(), these properties are still not enumerated.
2855         This is because these are always unenumerable for existing DOM interfaces:
2856         - https://dom.spec.whatwg.org/#interface-htmlcollection
2857         - https://dom.spec.whatwg.org/#namednodemap
2858
2859         In the future, we may need to extend support if some interfaces require
2860         those to be enumerable.
2861
2862         Test: fast/dom/htmlcollection-getownpropertynames.html
2863
2864         * Modules/mediastream/RTCStatsResponse.cpp:
2865         (WebCore::WebCore::RTCStatsResponse::supportedPropertyNames):
2866         * Modules/mediastream/RTCStatsResponse.h:
2867         * bindings/scripts/CodeGeneratorJS.pm:
2868         (GenerateHeader):
2869         (GenerateImplementation):
2870         * css/StyleSheetList.cpp:
2871         (WebCore::StyleSheetList::supportedPropertyNames):
2872         * css/StyleSheetList.h:
2873         * dom/DOMNamedFlowCollection.cpp:
2874         (WebCore::DOMNamedFlowCollection::supportedPropertyNames):
2875         * dom/DOMNamedFlowCollection.h:
2876         * dom/NamedNodeMap.cpp:
2877         (WebCore::NamedNodeMap::supportedPropertyNames):
2878         * dom/NamedNodeMap.h:
2879         * html/HTMLCollection.cpp:
2880         (WebCore::HTMLCollection::supportedPropertyNames):
2881         * html/HTMLCollection.h:
2882         (WebCore::CollectionNamedElementCache::propertyNames):
2883         (WebCore::CollectionNamedElementCache::appendToIdCache):
2884         (WebCore::CollectionNamedElementCache::appendToNameCache):
2885         (WebCore::CollectionNamedElementCache::memoryCost):
2886         (WebCore::CollectionNamedElementCache::append):
2887         * plugins/DOMMimeTypeArray.cpp:
2888         (WebCore::DOMMimeTypeArray::supportedPropertyNames):
2889         * plugins/DOMMimeTypeArray.h:
2890         * plugins/DOMPlugin.cpp:
2891         (WebCore::DOMPlugin::supportedPropertyNames):
2892         * plugins/DOMPlugin.h:
2893         * plugins/DOMPluginArray.cpp:
2894         (WebCore::DOMPluginArray::supportedPropertyNames):
2895         * plugins/DOMPluginArray.h:
2896
2897 2015-09-28  Per Arne Vollan  <peavo@outlook.com>
2898
2899         [Curl] Deadlock when downloading.
2900         https://bugs.webkit.org/show_bug.cgi?id=149596
2901
2902         Reviewed by Alex Christensen.
2903
2904         Avoid grabbing the same lock twice.
2905
2906         * platform/network/curl/CurlDownload.cpp:
2907         (WebCore::CurlDownload::init):
2908         (WebCore::CurlDownload::addHeaders):
2909
2910 2015-09-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
2911
2912         An SVG inherits the container size of the previously drawn HTMLImageElement when drawing it on a canvas
2913         https://bugs.webkit.org/show_bug.cgi?id=148845
2914
2915         Reviewed by Darin Adler.
2916
2917         When drawing an SVG image on a canvas we need to make sure that the container
2918         size of the SVG is set to the image source size. If we do not do that, the
2919         previous container size will be used as the size of the image. When drawing
2920         it as HTMLImageElement, the renderer calls SVGImage::drawForContainer() which
2921         calls setContainerSize() and then calls draw(). This call ensures that the
2922         size is set correctly for cached images. But when drawing the SVGImage on
2923         CanvasRenderingContext2D, the SVGImage::draw() is called directly because
2924         it calls it through the base class method Image::draw().
2925         
2926         If the image.isSVGImage(), CanvasRenderingContext2D::drawImage() has to call
2927         SVGImage::setContainerSize() before calling Image::draw().
2928
2929         Test: svg/as-image/svg-cached-draw-canvas.html
2930
2931         * html/canvas/CanvasRenderingContext2D.cpp:
2932         (WebCore::CanvasRenderingContext2D::drawImage):
2933         Call SVGImage::setContainerSize() before calling Image::draw().
2934
2935 2015-09-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
2936
2937         Rename all the variables and parameters of type HTMLImageElement in CanvasRenderingContext2D.cpp from 'image' to 'imageElement'
2938
2939         Reviewed by Darin Adler.
2940
2941         This does not change functionality in this file. It is a preparation for
2942         the fix of the https://bugs.webkit.org/show_bug.cgi?id=148845.
2943
2944         * html/canvas/CanvasRenderingContext2D.cpp:
2945         (WebCore::size):
2946         (WebCore::normalizeRect):
2947         (WebCore::CanvasRenderingContext2D::drawImageFromRect):
2948         (WebCore::CanvasRenderingContext2D::setAlpha):
2949         (WebCore::CanvasRenderingContext2D::createRadialGradient):
2950         (WebCore::CanvasRenderingContext2D::createPattern):
2951         (WebCore::CanvasRenderingContext2D::drawImage):
2952
2953 2015-09-27  Yusuke Suzuki  <utatane.tea@gmail.com>
2954
2955         [ES6] Implement ES6 Module loader hook stubs in WebCore
2956         https://bugs.webkit.org/show_bug.cgi?id=149574
2957
2958         Reviewed by Ryosuke Niwa.
2959
2960         In this patch, we implement the loader hooks in the WebCore side.
2961         Since the fetcher and actual evaluation code are separated from
2962         this patch, they become empty.
2963
2964         Here, WebCore implements 3 loader hooks.
2965
2966         1. resolve hook
2967
2968             Takes the module name and resolve it to the unique module key.
2969             In WebCore, we use URL as a module key.
2970             And for the inlined module tag (e.g. <script type="module">import ...</script>),
2971             we use the ES6 symbol as a module key.
2972             In WebCore, we take the module name like "./hello.js" and resolve it by using
2973             the URL of the importer module.
2974             This functionality is implemented in this patch.
2975
2976         2. fetch hook
2977
2978             Fetches the resource specified by the module key. In WebCore, the module key is
2979             URL. We use CachedResource loading system to load the resource of the modules.
2980             The actual code of the fetch hook will be implemented in the subsequent patch.
2981
2982         3. evaluate hook
2983
2984             This is additional hook to instrument the module's execution for the inspector.
2985             The actual code of the evaluate hook will be implemented in the subsequent patch.
2986
2987         In addition to that, we added required JSC forward headers for the module loader
2988         implementation.
2989
2990         * CMakeLists.txt:
2991         * ForwardingHeaders/runtime/JSInternalPromise.h: Added.
2992         * ForwardingHeaders/runtime/JSInternalPromiseDeferred.h: Added.
2993         * ForwardingHeaders/runtime/JSModuleRecord.h: Added.
2994         * ForwardingHeaders/runtime/Symbol.h: Added.
2995         * WebCore.vcxproj/WebCore.vcxproj:
2996         * WebCore.vcxproj/WebCore.vcxproj.filters:
2997         * WebCore.xcodeproj/project.pbxproj:
2998         * bindings/js/JSBindingsAllInOne.cpp:
2999         * bindings/js/JSDOMWindowBase.cpp:
3000         (WebCore::JSDOMWindowBase::moduleLoaderResolve):
3001         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
3002         (WebCore::JSDOMWindowBase::moduleLoaderEvaluate):
3003         * bindings/js/JSDOMWindowBase.h:
3004         * bindings/js/JSModuleLoader.cpp: Added.
3005         (WebCore::JSModuleLoader::JSModuleLoader):
3006         (WebCore::JSModuleLoader::resolve):
3007         (WebCore::JSModuleLoader::fetch):
3008         (WebCore::JSModuleLoader::evaluate):
3009         * bindings/js/JSModuleLoader.h: Added.
3010         (WebCore::JSModuleLoader::document):
3011         * dom/Document.cpp:
3012         (WebCore::Document::Document):
3013         (WebCore::Document::~Document):
3014         * dom/Document.h:
3015         (WebCore::Document::moduleLoader):
3016
3017 2015-09-26  Hunseop Jeong  <hs85.jeong@samsung.com>
3018
3019         Use modern for-loops in WebCore/inspector.
3020         https://bugs.webkit.org/show_bug.cgi?id=149579
3021
3022         Reviewed by Darin Adler.
3023
3024         No new tests because there is no behavior change.
3025
3026         * inspector/DOMPatchSupport.cpp:
3027         (WebCore::DOMPatchSupport::diff):
3028         (WebCore::DOMPatchSupport::innerPatchChildren):
3029         (WebCore::DOMPatchSupport::removeChildAndMoveToNew):
3030         (WebCore::DOMPatchSupport::markNodeAsUsed):
3031         * inspector/InspectorCSSAgent.cpp:
3032         (WebCore::computePseudoClassMask):
3033         (WebCore::ChangeRegionOversetTask::timerFired):
3034         (WebCore::InspectorCSSAgent::getNamedFlowCollection):
3035         (WebCore::InspectorCSSAgent::resetPseudoStates):
3036         * inspector/InspectorDOMAgent.cpp:
3037         (WebCore::RevalidateStyleAttributeTask::timerFired):
3038         (WebCore::InspectorDOMAgent::releaseBackendNodeIds):
3039         (WebCore::InspectorDOMAgent::getEventListenersForNode):
3040         (WebCore::InspectorDOMAgent::getEventListeners):
3041         (WebCore::InspectorDOMAgent::performSearch):
3042         (WebCore::InspectorDOMAgent::styleAttributeInvalidated):
3043         * inspector/InspectorDOMDebuggerAgent.cpp:
3044         (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
3045         * inspector/InspectorDatabaseAgent.cpp:
3046         (WebCore::InspectorDatabaseAgent::enable):
3047         (WebCore::InspectorDatabaseAgent::disable):
3048         (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
3049         (WebCore::InspectorDatabaseAgent::databaseId):
3050         (WebCore::InspectorDatabaseAgent::findByFileName):
3051         * inspector/InspectorFrontendClientLocal.cpp:
3052         (WebCore::InspectorFrontendClientLocal::frontendLoaded):
3053         * inspector/InspectorFrontendHost.cpp:
3054         * inspector/InspectorIndexedDBAgent.cpp:
3055         * inspector/InspectorOverlay.cpp:
3056         (WebCore::buildRendererHighlight):
3057         (WebCore::buildObjectForHighlight):
3058         * inspector/InspectorPageAgent.cpp:
3059         (WebCore::InspectorPageAgent::getCookies):
3060         * inspector/InspectorReplayAgent.cpp:
3061         (WebCore::buildInspectorObjectForSession):
3062         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
3063         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
3064         * inspector/InspectorResourceAgent.cpp:
3065         (WebCore::InspectorResourceAgent::willDestroyCachedResource):
3066         (WebCore::InspectorResourceAgent::willRecalculateStyle):
3067         * inspector/InspectorStyleSheet.cpp:
3068         (flattenSourceData):
3069         (WebCore::InspectorStyle::buildArrayForComputedStyle):
3070         (WebCore::InspectorStyle::populateAllProperties):
3071         (WebCore::selectorsFromSource):
3072         (WebCore::InspectorStyleSheet::ruleIndexByStyle):
3073         (WebCore::InspectorStyleSheet::buildArrayForRuleList):
3074         * inspector/InspectorWorkerAgent.cpp:
3075         (WebCore::InspectorWorkerAgent::createWorkerFrontendChannelsForExistingWorkers):
3076         (WebCore::InspectorWorkerAgent::destroyWorkerFrontendChannels):
3077         * inspector/NetworkResourcesData.cpp:
3078         (WebCore::NetworkResourcesData::removeCachedResource):
3079         (WebCore::NetworkResourcesData::clear):
3080         * inspector/PageRuntimeAgent.cpp:
3081         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
3082         * inspector/PageScriptDebugServer.cpp:
3083         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
3084         * inspector/WebConsoleAgent.cpp:
3085         (WebCore::WebConsoleAgent::frameWindowDiscarded):
3086         * inspector/WebInjectedScriptManager.cpp:
3087         (WebCore::WebInjectedScriptManager::discardInjectedScriptsFor):
3088
3089 2015-09-25  Eric Carlson  <eric.carlson@apple.com>
3090
3091         Clean up user media request internal API
3092         https://bugs.webkit.org/show_bug.cgi?id=149527
3093
3094         Reviewed by Tim Horton.
3095
3096         No new tests, no functional change.
3097
3098         * Modules/mediastream/UserMediaRequest.cpp:
3099         (WebCore::UserMediaRequest::constraintsValidated): Use track persistent ID to create vectors
3100           as that is what the platform code needs to map to a capture device.
3101         (WebCore::UserMediaRequest::userMediaAccessGranted): m_chosenXXDeviceUID -> m_XXDeviceUIDAllowed.
3102           Use the device IDs to create the MediaStream. Switch audio/video parameter order.
3103         (WebCore::UserMediaRequest::didCreateStream): Don't assume constraints are valid.
3104         * Modules/mediastream/UserMediaRequest.h:
3105         (WebCore::UserMediaRequest::videoDeviceUIDs):
3106         (WebCore::UserMediaRequest::audioDeviceUIDs):
3107         (WebCore::UserMediaRequest::allowedVideoDeviceUID):
3108         (WebCore::UserMediaRequest::allowedAudioDeviceUID):
3109         (WebCore::UserMediaRequest::requiresAudio): Deleted.
3110         (WebCore::UserMediaRequest::requiresVideo): Deleted.
3111         (WebCore::UserMediaRequest::firstVideoDeviceUID): Deleted.
3112         (WebCore::UserMediaRequest::firstAudioDeviceUID): Deleted.
3113
3114         * platform/mediastream/mac/AVMediaCaptureSource.mm:
3115         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Call setPersistentId.
3116
3117 2015-09-25  Antti Koivisto  <antti@apple.com>
3118
3119         Implement scoped styling for shadow DOM
3120         https://bugs.webkit.org/show_bug.cgi?id=149230
3121
3122         Reviewed by Ryosuke Niwa.
3123
3124         Test: fast/shadow-dom/css-scoping-shadow-with-rules-no-style-leak.html
3125
3126         * css/ElementRuleCollector.cpp:
3127         (WebCore::ElementRuleCollector::collectMatchingRules):
3128
3129             Only use special path here for user agent shadow trees.
3130
3131         * dom/AuthorStyleSheets.cpp:
3132         (WebCore::AuthorStyleSheets::AuthorStyleSheets):
3133         (WebCore::AuthorStyleSheets::removePendingSheet):
3134         (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
3135
3136             Basic support for ShadowRoot scoped stylesheets.
3137
3138         * dom/AuthorStyleSheets.h:
3139         (WebCore::AuthorStyleSheets::activeStyleSheets):
3140         * dom/InlineStyleSheetOwner.cpp:
3141         (WebCore::InlineStyleSheetOwner::~InlineStyleSheetOwner):
3142         (WebCore::authorStyleSheetsForElement):
3143         (WebCore::InlineStyleSheetOwner::insertedIntoDocument):
3144         (WebCore::InlineStyleSheetOwner::removedFromDocument):
3145         (WebCore::InlineStyleSheetOwner::clearDocumentData):
3146         (WebCore::InlineStyleSheetOwner::childrenChanged):
3147         (WebCore::InlineStyleSheetOwner::createSheet):
3148         (WebCore::InlineStyleSheetOwner::isLoading):
3149         (WebCore::InlineStyleSheetOwner::sheetLoaded):
3150         (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
3151
3152             Basic support for ShadowRoot scoped inline stylesheets.
3153
3154         * dom/InlineStyleSheetOwner.h:
3155         (WebCore::InlineStyleSheetOwner::sheet):
3156         * dom/ShadowRoot.cpp:
3157         (WebCore::ShadowRoot::styleResolver):
3158
3159             Create and initialize ShadowRoot scoped style resolver.
3160
3161         (WebCore::ShadowRoot::resetStyleResolver):
3162         (WebCore::ShadowRoot::authorStyleSheets):
3163
3164             Collection of author stylesheets in the shadow tree.
3165
3166         (WebCore::ShadowRoot::updateStyle):
3167
3168             Trigger style recalc when stylesheets change.
3169
3170         (WebCore::ShadowRoot::cloneNode):
3171         * dom/ShadowRoot.h:
3172         (WebCore::ShadowRoot::resetStyleInheritance):
3173         * html/HTMLStyleElement.h:
3174         * svg/SVGStyleElement.h:
3175
3176 2015-09-25  Alex Christensen  <achristensen@webkit.org>
3177
3178         Clean up CMake build on Mac
3179         https://bugs.webkit.org/show_bug.cgi?id=149573
3180
3181         Reviewed by Chris Dumez.
3182
3183         * CMakeLists.txt:
3184         * PlatformEfl.cmake:
3185         * PlatformGTK.cmake:
3186         * PlatformMac.cmake:
3187         * platform/graphics/DisplayRefreshMonitor.cpp:
3188
3189 2015-09-25  Tim Horton  <timothy_horton@apple.com>
3190
3191         Scrolling a overflow: scroll region makes find overlay holes stick to the edge of the region
3192         https://bugs.webkit.org/show_bug.cgi?id=149572
3193         <rdar://problem/13093602>
3194
3195         Reviewed by Simon Fraser.
3196
3197         Test: fast/text/mark-matches-overflow-clip.html
3198
3199         * rendering/InlineTextBox.cpp:
3200         (WebCore::InlineTextBox::paintTextMatchMarker):
3201         Clip the rendered marker rect to the overflow rect.
3202
3203         * testing/Internals.cpp:
3204         (WebCore::Internals::dumpMarkerRectsForNode):
3205         * testing/Internals.h:
3206         * testing/Internals.idl:
3207         Add a internals function to dump the rendered rects for a marker.
3208
3209 2015-09-25  Alex Christensen  <achristensen@webkit.org>
3210
3211         [Win] Switch to CMake
3212         https://bugs.webkit.org/show_bug.cgi?id=148111
3213
3214         Reviewed by Brent Fulgham.
3215
3216         * WebCore.vcxproj/WebCore.proj:
3217
3218 2015-09-25  Beth Dakin  <bdakin@apple.com>
3219
3220         Clicking on a data detected item inside a form control always pops up a map 
3221         on force touch trackpad
3222         https://bugs.webkit.org/show_bug.cgi?id=149559
3223         -and corresponding-
3224         rdar://problem/22826796
3225
3226         Reviewed by Tim Horton.
3227
3228         The real bug here appears to be a bug in Lookup, but we can work around it. 
3229         For normal text, we call directly into Data Detectors for map results, and 
3230         that works fine. For text within form controls, we did not properly extract 
3231         the text for DD, so we sent it to Lookup instead, and Lookup has this bug 
3232         where they will pop open the map right away. If we properly extract the text 
3233         for form controls, then we can work around this bug.
3234
3235         * editing/mac/DataDetection.mm:
3236         (WebCore::detectItemAtPositionWithRange):
3237         (WebCore::DataDetection::detectItemAroundHitTestResult):
3238
3239 2015-09-25  Brady Eidson  <beidson@apple.com>
3240
3241         PassRefPtr<> to RefPtr<> conversion in legacy IndexedDB code.
3242         https://bugs.webkit.org/show_bug.cgi?id=149558
3243
3244         Reviewed by Beth Dakin.
3245
3246         No new tests (No behavior change.)
3247         
3248         This patch does not attempt to completely remove all PassRefPtr usage inside legacy IDB.
3249
3250         It just switches over all PassRefPtr usage at the top level IDB interfaces that 
3251         modern IDB is implementing.
3252
3253         The rest of the usage inside the legacy implementation can be dealt with later via `git rm`.
3254
3255         * Modules/indexeddb/IDBAny.h:
3256         * Modules/indexeddb/IDBCursor.h:
3257         * Modules/indexeddb/IDBDatabase.h:
3258         * Modules/indexeddb/IDBDatabaseError.h:
3259         * Modules/indexeddb/IDBFactory.h:
3260         * Modules/indexeddb/IDBIndex.h:
3261         * Modules/indexeddb/IDBObjectStore.h:
3262         * Modules/indexeddb/IDBRequest.h:
3263         * Modules/indexeddb/IDBTransaction.h:
3264         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
3265         (WebCore::IDBClient::IDBFactory::getDatabaseNames):
3266         (WebCore::IDBClient::IDBFactory::open):
3267         (WebCore::IDBClient::IDBFactory::deleteDatabase):
3268         * Modules/indexeddb/client/IDBFactoryImpl.h:
3269         * Modules/indexeddb/client/IDBRequestImpl.cpp:
3270         (WebCore::IDBClient::IDBRequest::result):
3271         (WebCore::IDBClient::IDBRequest::error):
3272         (WebCore::IDBClient::IDBRequest::source):
3273         (WebCore::IDBClient::IDBRequest::transaction):
3274         * Modules/indexeddb/client/IDBRequestImpl.h:
3275         * Modules/indexeddb/legacy/LegacyAny.cpp:
3276         (WebCore::LegacyAny::createInvalid):
3277         (WebCore::LegacyAny::createNull):
3278         (WebCore::LegacyAny::createString):
3279         (WebCore::LegacyAny::domStringList):
3280         (WebCore::LegacyAny::idbCursor):
3281         (WebCore::LegacyAny::idbCursorWithValue):
3282         (WebCore::LegacyAny::idbDatabase):
3283         (WebCore::LegacyAny::idbFactory):
3284         (WebCore::LegacyAny::idbIndex):
3285         (WebCore::LegacyAny::idbObjectStore):
3286         (WebCore::LegacyAny::idbTransaction):
3287         (WebCore::LegacyAny::LegacyAny):
3288         * Modules/indexeddb/legacy/LegacyAny.h:
3289         (WebCore::LegacyAny::create):
3290         * Modules/indexeddb/legacy/LegacyCursor.cpp:
3291         (WebCore::LegacyCursor::update):
3292         (WebCore::LegacyCursor::deleteFunction):
3293         * Modules/indexeddb/legacy/LegacyCursor.h:
3294         * Modules/indexeddb/legacy/LegacyDatabase.cpp:
3295         (WebCore::LegacyDatabase::objectStoreNames):
3296         (WebCore::LegacyDatabase::createObjectStore):
3297         (WebCore::LegacyDatabase::transaction):
3298         * Modules/indexeddb/legacy/LegacyDatabase.h:
3299         * Modules/indexeddb/legacy/LegacyFactory.cpp:
3300         (WebCore::LegacyFactory::getDatabaseNames):
3301         (WebCore::LegacyFactory::open):
3302         (WebCore::LegacyFactory::deleteDatabase):
3303         * Modules/indexeddb/legacy/LegacyFactory.h:
3304         * Modules/indexeddb/legacy/LegacyIndex.cpp:
3305         (WebCore::LegacyIndex::openCursor):
3306         (WebCore::LegacyIndex::count):
3307         (WebCore::LegacyIndex::openKeyCursor):
3308         (WebCore::LegacyIndex::get):
3309         (WebCore::LegacyIndex::getKey):
3310         * Modules/indexeddb/legacy/LegacyIndex.h:
3311         (WebCore::LegacyIndex::legacyObjectStore):
3312         * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
3313         (WebCore::LegacyObjectStore::indexNames):
3314         (WebCore::LegacyObjectStore::get):
3315         (WebCore::LegacyObjectStore::add):
3316         (WebCore::LegacyObjectStore::put):
3317         (WebCore::LegacyObjectStore::deleteFunction):
3318         (WebCore::LegacyObjectStore::clear):
3319         (WebCore::LegacyObjectStore::createIndex):
3320         (WebCore::LegacyObjectStore::index):
3321         (WebCore::LegacyObjectStore::openCursor):
3322         (WebCore::LegacyObjectStore::count):
3323         * Modules/indexeddb/legacy/LegacyObjectStore.h:
3324         (WebCore::LegacyObjectStore::keyPathAny):
3325         (WebCore::LegacyObjectStore::transaction):
3326         (WebCore::LegacyObjectStore::createIndex):
3327         (WebCore::LegacyObjectStore::count):
3328         * Modules/indexeddb/legacy/LegacyRequest.cpp:
3329         (WebCore::LegacyRequest::result):
3330         (WebCore::LegacyRequest::error):
3331         (WebCore::LegacyRequest::source):
3332         (WebCore::LegacyRequest::transaction):
3333         (WebCore::LegacyRequest::onSuccess):
3334         * Modules/indexeddb/legacy/LegacyRequest.h:
3335         * Modules/indexeddb/legacy/LegacyTransaction.cpp:
3336         (WebCore::LegacyTransaction::objectStore):
3337         * Modules/indexeddb/legacy/LegacyTransaction.h:
3338         * inspector/InspectorIndexedDBAgent.cpp:
3339
3340 2015-09-25  Per Arne Vollan  <peavo@outlook.com>
3341
3342         [WinCairo] Incorrect position for windowless plugins.
3343         https://bugs.webkit.org/show_bug.cgi?id=149524
3344
3345         Reviewed by Alex Christensen.
3346
3347         Added method to get graphics context HDC.
3348
3349         * platform/graphics/GraphicsContext.h:
3350         * platform/graphics/win/GraphicsContextWin.cpp:
3351         (WebCore::GraphicsContext::getWindowsContext):
3352         (WebCore::GraphicsContext::hdc):
3353         (WebCore::GraphicsContextPlatformPrivate::save):
3354
3355 2015-09-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3356
3357         Fix the broken !ENABLE(STREAM_API) build
3358         https://bugs.webkit.org/show_bug.cgi?id=149525
3359
3360         Reviewed by Darin Adler.
3361
3362         Removed some #ifdef ENABLE(STREAMS_API) to make build work when STREAMS_API is off.
3363         This is a temporary fix.
3364
3365         * bindings/js/WebCoreJSClientData.h:
3366         (WebCore::WebCoreJSClientData::WebCoreJSClientData):
3367         (WebCore::initNormalWorldClientData):
3368
3369 2015-09-25  Chris Dumez  <cdumez@apple.com>
3370
3371         Unreviewed, nit fix after r190229.
3372
3373         * dom/Range.cpp:
3374         (WebCore::Range::insertNode):
3375
3376 2015-09-25  Commit Queue  <commit-queue@webkit.org>
3377
3378         Unreviewed, rolling out r190232 and r190236.
3379         https://bugs.webkit.org/show_bug.cgi?id=149555
3380
3381         "It did not help" (Requested by cdumez on #webkit).
3382
3383         Reverted changesets:
3384
3385         "Unreviewed, roll out r187615 as it seems to have caused a ~1%
3386         PLT regression."
3387         http://trac.webkit.org/changeset/190232
3388
3389         "This started failing after this rollout:"
3390         http://trac.webkit.org/changeset/190236
3391
3392 2015-09-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3393
3394         Remove the need for DOMClass in case of JSBuiltinConstructor WebIDL
3395         https://bugs.webkit.org/show_bug.cgi?id=149522
3396
3397         Reviewed by Darin Adler.
3398
3399         Adding generation of the dummy DOM class for JSBuiltinConstructor interfaces.
3400         This is applied to CountQueuingStrategy.
3401
3402         Covered by existing tests of CountQueuingStrategy.
3403
3404         * Modules/streams/CountQueuingStrategy.h: Removed.
3405         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
3406         * WebCore.xcodeproj/project.pbxproj: Ditto.
3407         * bindings/scripts/CodeGeneratorJS.pm:
3408         (GenerateHeader): Removal of DOM class header include and generation of dummy class.
3409         (GenerateImplementation): Removal of DOM class header include.
3410         (UseDummyDOMClass): Helper routine.
3411         (GenerateDummyDOMClassForJSBuiltin): Ditto.
3412
3413 2015-09-24  Brent Fulgham  <bfulgham@apple.com>
3414
3415         [Win] Support composited content in WebView render-to-context methods
3416         https://bugs.webkit.org/show_bug.cgi?id=149516
3417         <rdar://problem/22635080>
3418
3419         Reviewed by Simon Fraser.
3420
3421         Extend the CACFLayerTreeHost implementation to render into a passed
3422         device context when requested. When no context is provided (the default
3423         case) paint as normal.
3424
3425         Will be tested by existing compositing tests in a future bug. DumpRenderTree
3426         has to be extended to do this painting properly.
3427
3428         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
3429         (WebCore::CACFLayerTreeHost::paint): Accept an optional HDC argument, and
3430         pass it to the render method.
3431         * platform/graphics/ca/win/CACFLayerTreeHost.h:
3432         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp: Add missing SOFT_LINK
3433         command for the WKCACFViewDrawIntoDC.
3434         (WebCore::WKCACFViewLayerTreeHost::paint): Accept optional HDC argument and
3435         pass it to the parent class.
3436         (WebCore::WKCACFViewLayerTreeHost::render): Accept new optional HDC argument.
3437         If provided, call WKCACFViewDrawIntoDC. Otherwise, call WKCACFVIewDraw.
3438         (WebCore::WKCACFViewLayerTreeHost::setShouldInvertColors):
3439         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
3440
3441 2015-09-24  Chris Dumez  <cdumez@apple.com>
3442
3443         Drop [NotDeletable] from QuickTimePluginReplacement.postEvent()
3444         https://bugs.webkit.org/show_bug.cgi?id=149547
3445
3446         Reviewed by Eric Carlson.
3447
3448         Drop [NotDeletable] from QuickTimePluginReplacement.postEvent(). It does
3449         not appear to be needed and this is the last user of this non-standard
3450         IDL attribute. This patch also drops support for this IDL attribute.
3451
3452         * Modules/plugins/QuickTimePluginReplacement.idl:
3453         * bindings/scripts/CodeGeneratorJS.pm:
3454         (ComputeFunctionSpecial):
3455         * bindings/scripts/IDLAttributes.txt:
3456
3457 2015-09-24  Chris Dumez  <cdumez@apple.com>
3458
3459         Node.replaceChild() does not behave according to the specification
3460         https://bugs.webkit.org/show_bug.cgi?id=149546
3461         <rdar://problem/22571887>
3462
3463         Reviewed by Ryosuke Niwa.
3464
3465         Node.replaceChild() does not behave according to the specification. In
3466         particular, when replacing |child| with |node| we are supposed to remove
3467         |node| from its parent *before* removing |child| from its parent:
3468         - https://dom.spec.whatwg.org/#concept-node-replace (Steps 10 & 11)
3469
3470         This patch reverses the order as per the specification. Our new behavior
3471         matches Firefox's behavior. Note that this patch also remove an
3472         optimization when replacing a child with its next sibling. This
3473         optimization was observable from JS. It seems likely this case is not
3474         common enough for it to be an issue. However, we can revisit if we see
3475         it regresses things.
3476
3477         This leads to incorrect Mutation Records being queued in some cases.
3478
3479         No new tests, already covered by existing test.
3480
3481         * dom/ContainerNode.cpp:
3482         (WebCore::ContainerNode::replaceChild):
3483
3484 2015-09-24  Chris Dumez  <cdumez@apple.com>
3485
3486         Unreviewed, roll out r187615 as it seems to have caused a ~1% PLT regression.
3487         <rdar://problem/22657123>
3488
3489         * platform/graphics/FontCache.h:
3490         (WebCore::FontDescriptionKey::makeFlagsKey):
3491         * platform/graphics/FontCascade.cpp:
3492         (WebCore::operator==):
3493         (WebCore::makeFontSelectorFlags):
3494         (WebCore::makeFontCascadeCacheKey):
3495         (WebCore::computeFontCascadeCacheHash):
3496
3497 2015-09-24  David Hyatt  <hyatt@apple.com>
3498
3499         Keep the already-parsed list of terms in custom property values so that we don't have to re-parse them
3500         later when doing variable resolution.
3501         https://bugs.webkit.org/show_bug.cgi?id=149544
3502
3503         Reviewed by Dean Jackson.
3504
3505         * css/CSSComputedStyleDeclaration.cpp:
3506         (WebCore::ComputedStyleExtractor::customPropertyValue):
3507         (WebCore::ComputedStyleExtractor::customPropertyText):
3508         Add a helper for getting the raw text. More closely parallels how non-custom properties work with the
3509         extractor.
3510
3511         (WebCore::ComputedStyleExtractor::propertyValue):
3512         Change propertyValue to use customPropertyText.
3513
3514         (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
3515         Don't copy CSS custom properties into the style declaration. This is just used for things like editing, so
3516         we didn't need to be putting the custom properties into this set.
3517
3518         (WebCore::CSSComputedStyleDeclaration::getPropertyValue):
3519         Patched to go straight to the serialized string value.
3520
3521         (WebCore::ComputedStyleExtractor::customPropertyValue): Deleted.
3522         Replaced by customPropertyText.
3523
3524         * css/CSSComputedStyleDeclaration.h:
3525         Rename customPropertyValue to customPropertyText and make it just return a String.
3526
3527         * css/CSSCustomPropertyValue.h:
3528         (WebCore::CSSCustomPropertyValue::create):
3529         (WebCore::CSSCustomPropertyValue::customCSSText):
3530         (WebCore::CSSCustomPropertyValue::name):
3531         (WebCore::CSSCustomPropertyValue::equals):
3532         (WebCore::CSSCustomPropertyValue::CSSCustomPropertyValue):
3533         (WebCore::CSSCustomPropertyValue::value): Deleted.
3534         Changed to hold both a CSSParserValueList, which it adopts from the CSSParser, and a string value that
3535         is constructed lazily only if the value is serialized. Now the problematic serialization code will only
3536         run if someone uses the CSS OM to trigger a serialization (this should be a rare occurrence, so perf
3537         improves with this change).
3538
3539         * css/CSSGrammar.y.in:
3540         Change parsing of custom properties to be identical to regular properties. This refactoring allows
3541         us to simply invoke the parser from style declarations as well and makes everything behave more
3542         similarly to normal property parsing.
3543
3544         * css/CSSParser.cpp:
3545         (WebCore::CSSParser::parseValue):
3546         (WebCore::CSSParser::parseCustomPropertyValue):
3547         (WebCore::CSSParser::parseCustomPropertyDeclaration):
3548         (WebCore::CSSParser::addCustomPropertyDeclaration): Deleted.
3549         * css/CSSParser.h:
3550         (WebCore::CSSParser::setCustomPropertyName):
3551         We now have a method for parsing custom properties that can be invoked from style declarations. The
3552         parser list is now adopted by the CSSCustomPropertyValue.
3553
3554         * css/CSSParserValues.cpp:
3555         (WebCore::CSSParserValueList::toString):
3556         Build the string serialization code right into CSSParserValueList.
3557
3558         * css/CSSParserValues.h:
3559         Add a toString() method for serialization.
3560
3561         * css/StyleProperties.cpp:
3562         (WebCore::MutableStyleProperties::setProperty):
3563         (WebCore::MutableStyleProperties::setCustomProperty):
3564         Changed to use the new CSSParser functions. This makes the code behave almost identically to regular
3565         property parsing.
3566
3567         * css/StyleResolver.cpp:
3568         (WebCore::StyleResolver::applyProperty):
3569         * rendering/style/RenderStyle.h:
3570         * rendering/style/StyleCustomPropertyData.h:
3571         Change the mapping on RenderStyle to store the custom CSS values. This way we can get to the original
3572         parser lists for each variable when it comes time to do variable resolution.
3573
3574 2015-09-24  Chris Dumez  <cdumez@apple.com>
3575
3576         Rewrite Range::insertNode() as per the latest DOM specification
3577         https://bugs.webkit.org/show_bug.cgi?id=149528
3578
3579         Reviewed by Ryosuke Niwa.
3580
3581         Rewrite Range::insertNode() as per the latest DOM specification:
3582         - https://dom.spec.whatwg.org/#concept-range-insert
3583
3584         Our previous implementation seemed outdated as we were failing a lot of
3585         W3C tests that Firefox is passing.
3586
3587         No new tests, already covered by existing tests.
3588
3589         * dom/ContainerNode.cpp:
3590         (WebCore::ContainerNode::ensurePreInsertionValidity):
3591         (WebCore::checkPreReplacementValidity):
3592         (WebCore::ContainerNode::insertBefore):
3593         (WebCore::ContainerNode::replaceChild):
3594         (WebCore::ContainerNode::appendChild):
3595         * dom/ContainerNode.h:
3596         * dom/Range.cpp:
3597         (WebCore::Range::insertNode):
3598         (WebCore::Range::surroundContents):
3599         (WebCore::Range::toString): Deleted.
3600         (WebCore::Range::toHTML): Deleted.
3601         (WebCore::Range::text): Deleted.
3602         (WebCore::Range::createContextualFragment): Deleted.
3603         (WebCore::Range::detach): Deleted.
3604         (WebCore::Range::absoluteBoundingBox): Deleted.
3605         * dom/Range.h:
3606
3607 2015-09-24  Brent Fulgham  <bfulgham@apple.com>
3608
3609         [Win] Unreviewed build failure.
3610
3611         * bindings/js/WebCoreJSClientData.h: Make sure Streams API headers
3612         are only included if the feature is on.
3613
3614 2015-09-24  Ryosuke Niwa  <rniwa@webkit.org>
3615
3616         Make event dispatching respect slotting
3617         https://bugs.webkit.org/show_bug.cgi?id=149243
3618
3619         Reviewed by Antti Koivisto.
3620
3621         There are primarily two cases to consider: getting out of a shadow root to its host,
3622         and moving into a slot from an assigned node.
3623
3624         When getting out of a shadow root, either the event originated in its shadow tree
3625         including its nodes' shadow trees (1) or it moved into this shadow tree via a slot (2).
3626         In (1), event.target should be set to the shadow host. In (2), it should be set to the
3627         first node in the event path that belongs to the same tree as the shadow host. In order
3628         to find such a node in O(1), we use a stack of event targets in each (shadow) tree. We
3629         push event.target of the current tree whenever we move up to a slot from an assigned node
3630         and pop it out of the stack when we move out of the shadow tree.
3631
3632         A follow up patch is needed to update the code to resolve related targets.
3633
3634         Tests: fast/shadow-dom/event-inside-shadow-tree.html
3635                fast/shadow-dom/event-inside-slotted-node.html
3636
3637         * dom/EventDispatcher.cpp:
3638         (WebCore::EventPath::EventPath):
3639
3640 2015-09-24  Chris Dumez  <cdumez@apple.com>
3641
3642         Drop XPATH_NAMESPACE_NODE from Node::NodeType enum
3643         https://bugs.webkit.org/show_bug.cgi?id=149532
3644
3645         Reviewed by Ryosuke Niwa.
3646
3647         Drop XPATH_NAMESPACE_NODE from Node::NodeType enum as there is currently
3648         no way to construct such Node in WebKit. This avoid having to handle this
3649         Node type everywhere.
3650
3651         * bindings/gobject/WebKitDOMPrivate.cpp:
3652         (WebKit::wrap): Deleted.
3653         * bindings/objc/DOM.mm:
3654         (kitClass): Deleted.
3655         * dom/Document.cpp:
3656         (WebCore::Document::importNode):
3657         (WebCore::Document::adoptNode): Deleted.
3658         (WebCore::Document::childTypeAllowed): Deleted.
3659         (WebCore::Document::canAcceptChild): Deleted.
3660         * dom/Node.cpp:
3661         (WebCore::Node::dumpStatistics): Deleted.
3662         (WebCore::Node::textContent): Deleted.
3663         (WebCore::Node::ancestorElement): Deleted.
3664         * dom/Node.h:
3665         * dom/Range.cpp:
3666         (WebCore::Range::checkNodeWOffset):
3667         (WebCore::lengthOfContentsInNode): Deleted.
3668         (WebCore::Range::processContentsBetweenOffsets): Deleted.
3669         (WebCore::Range::surroundContents): Deleted.
3670         * editing/MarkupAccumulator.cpp:
3671         (WebCore::MarkupAccumulator::appendStartMarkup): Deleted.
3672         * xml/XPathFunctions.cpp:
3673         (WebCore::XPath::expandedNameLocalPart): Deleted.
3674         * xml/XPathStep.cpp:
3675         (WebCore::XPath::Step::nodesInAxis):
3676         (WebCore::XPath::primaryNodeType): Deleted.
3677         * xml/XPathUtil.cpp:
3678         (WebCore::XPath::stringValue): Deleted.
3679         (WebCore::XPath::isValidContextNode): Deleted.
3680
3681 2015-09-24  David Hyatt  <hyatt@apple.com>
3682
3683         Add support for CSS Custom Properties (in preparation for implementing CSS Variables).
3684         https://bugs.webkit.org/show_bug.cgi?id=130397
3685
3686         Reviewed by Antti Koivisto.
3687
3688         Added new tests in fast/css/custom-properties.
3689
3690         * WebCore.xcodeproj/project.pbxproj:
3691         Add new header files to the project (CSSCustomPropertyValue and StyleCustomPropertyData).
3692
3693         * css/CSSComputedStyleDeclaration.cpp:
3694         (WebCore::ComputedStyleExtractor::customPropertyValue):
3695         (WebCore::ComputedStyleExtractor::propertyValue):
3696         If a custom property value is queried (i.e., it starts with "--"), then we use our
3697         customPropertyValue lookup to go to the RenderStyle and fetch the appropriate custom property
3698         value from the StyleCustomPropertyData.
3699
3700         (WebCore::CSSComputedStyleDeclaration::length):
3701         (WebCore::CSSComputedStyleDeclaration::item):
3702         Patched to include custom properties in the returned array. They appear at the end of the array
3703         after the built-in properties.
3704
3705         (WebCore::ComputedStyleExtractor::propertyMatches):
3706         Patched to check custom properties.
3707
3708         (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
3709         Make sure the custom properties get copied into the StyleDeclaration.
3710
3711         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
3712         (WebCore::CSSComputedStyleDeclaration::getPropertyValue):
3713         Patched to call customPropertyValue for custom properties.
3714
3715         * css/CSSComputedStyleDeclaration.h:
3716         Add customPropertyValue() to ComputedStyleExtractor.
3717
3718         * css/CSSCustomPropertyValue.h: Added.
3719         (WebCore::CSSCustomPropertyValue::create):
3720         (WebCore::CSSCustomPropertyValue::equals):
3721         (WebCore::CSSCustomPropertyValue::customCSSText):
3722         (WebCore::CSSCustomPropertyValue::name):
3723         (WebCore::CSSCustomPropertyValue::value):
3724         (WebCore::CSSCustomPropertyValue::CSSCustomPropertyValue):
3725         Custom properties are parsed as a property with an ID of CSSPropertyCustom and a CSSCustomPropertyValue
3726         that holds both the name and the value of the property. Ultimately we might want to just ditch property IDs in
3727         favor of AtomicStrings for all properties, and then the need to special case custom properties would go
3728         away. For now, though, this is the way we work custom properties into the existing system.
3729
3730         * css/CSSGrammar.y.in:
3731         Add a production for recognizing custom properties and storing them using a property ID of CSSPropertyCustom
3732         and a CSSCustomPropertyValue that has the name/value pair.
3733
3734         * css/CSSParser.cpp:
3735         (WebCore::filterProperties):
3736         Patched to track seen custom properties and to handle them correctly.
3737
3738         (WebCore::CSSParser::createStyleProperties):
3739         Pass in a seenCustomProperties table to ensure we bail when encountering the same custom property twice.
3740
3741         (WebCore::CSSParser::addCustomPropertyDeclaration):
3742         Called from the grammar production to create the CSSCustomPropertyValue.
3743
3744         (WebCore::isCustomPropertyIdentifier):
3745         Recognize the -- custom property during lexing.
3746
3747         (WebCore::CSSParser::parseIdentifier):
3748         Patched to return a CUSTOM_PROPERTY token when a custom property is identified.
3749
3750          * css/CSSParser.h:
3751         (WebCore::isCustomPropertyName):
3752         Add a helper function for asking if a property name is custom.
3753
3754         * css/CSSValue.cpp:
3755         (WebCore::CSSValue::equals):
3756         (WebCore::CSSValue::cssText):
3757         (WebCore::CSSValue::destroy):
3758         * css/CSSValue.h:
3759         Patched to add support for CSSCustomPropertyValue.
3760
3761         * css/PropertySetCSSStyleDeclaration.cpp:
3762         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
3763         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
3764         (WebCore::PropertySetCSSStyleDeclaration::getPropertyPriority):
3765         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
3766         (WebCore::PropertySetCSSStyleDeclaration::removeProperty):
3767         Add code for handling custom properties in the CSS OM.
3768
3769         * css/StyleProperties.cpp:
3770         (WebCore::StyleProperties::getPropertyValue):
3771         (WebCore::StyleProperties::getCustomPropertyValue):
3772         (WebCore::StyleProperties::getPropertyCSSValue):
3773         (WebCore::StyleProperties::getCustomPropertyCSSValue):
3774         (WebCore::MutableStyleProperties::removeProperty):
3775         (WebCore::MutableStyleProperties::removeCustomProperty):
3776         (WebCore::StyleProperties::propertyIsImportant):
3777         (WebCore::StyleProperties::customPropertyIsImportant):
3778         (WebCore::MutableStyleProperties::setProperty):
3779         (WebCore::MutableStyleProperties::setCustomProperty):
3780         (WebCore::MutableStyleProperties::addParsedProperty):
3781         (WebCore::MutableStyleProperties::findPropertyIndex):
3782         (WebCore::ImmutableStyleProperties::findCustomPropertyIndex):
3783         (WebCore::MutableStyleProperties::findCustomPropertyIndex):
3784         (WebCore::MutableStyleProperties::findCSSPropertyWithID):
3785         (WebCore::MutableStyleProperties::findCustomCSSPropertyWithName):
3786         (WebCore::StyleProperties::propertyMatches):
3787         (WebCore::StyleProperties::PropertyReference::cssName):
3788         * css/StyleProperties.h:
3789         (WebCore::StyleProperties::findCustomPropertyIndex):
3790         Patched to support handling custom properties in the CSS OM. We have to create equivalent methods that operate
3791         on AtomicString propertyNames instead of on property IDs.
3792
3793         * css/StyleResolver.cpp:
3794         (WebCore::StyleResolver::CascadedProperties::customProperties):
3795         (WebCore::StyleResolver::styleForKeyframe):
3796         (WebCore::StyleResolver::styleForPage):
3797         (WebCore::StyleResolver::applyMatchedProperties):
3798         (WebCore::StyleResolver::applyProperty):
3799         (WebCore::StyleResolver::CascadedProperties::set):
3800         (WebCore::StyleResolver::applyCascadedProperties):
3801         The resolver has to hold a HashMap from AtomicStrings to Properties. It matches identically to how built-in
3802         properties work except that an extensible table (HashMap) is used to hold the property data.
3803
3804         * css/makeprop.pl:
3805         Patched to include the special CSSPropertyCustom value of 1 (just after the CSSPropertyInvalid id value but before the first
3806         built-in property value).
3807
3808         * inspector/InspectorStyleSheet.cpp:
3809         (WebCore::InspectorStyle::getText):
3810         (WebCore::lowercasePropertyName):
3811         (WebCore::InspectorStyle::populateAllProperties):
3812         Patch inspector to not lowercase CSS custom property names, since they are case-sensitive.
3813
3814         * rendering/style/RenderStyle.h:
3815         * rendering/style/StyleCustomPropertyData.h: Added.
3816         (WebCore::StyleCustomPropertyData::create):
3817         (WebCore::StyleCustomPropertyData::copy):
3818         (WebCore::StyleCustomPropertyData::operator==):
3819         (WebCore::StyleCustomPropertyData::operator!=):
3820         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
3821         (WebCore::StyleCustomPropertyData::getCustomPropertyValue):
3822         (WebCore::StyleCustomPropertyData::hasCustomProperty):
3823         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
3824         * rendering/style/StyleRareInheritedData.cpp:
3825         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3826         (WebCore::StyleRareInheritedData::operator==):
3827         * rendering/style/StyleRareInheritedData.h:
3828         The front end storage in the RenderStyle for custom properties. For now, custom properties are always inherited, so the
3829         data is in StyleRareInheritedData.
3830
3831 2015-09-24  Chris Dumez  <cdumez@apple.com>
3832
3833         Optimize Range's lengthOfContentsInNode() for DocumentType Nodes
3834         https://bugs.webkit.org/show_bug.cgi?id=149529
3835
3836         Reviewed by Darin Adler.
3837
3838         Optimize Range's lengthOfContentsInNode() for DocumentType Nodes:
3839         - https://dom.spec.whatwg.org/#concept-node-length
3840
3841         We currently call Node::countChildNodes() unnecessarily on DocumentType
3842         Nodes instead of simply returning 0.
3843
3844         * dom/Range.cpp:
3845         (WebCore::lengthOfContentsInNode):
3846         (WebCore::Range::processContents):
3847
3848 2015-09-24  ChangSeok Oh  <changseok.oh@collabora.com>
3849
3850         Unreviewed, fix typo errors in a comment ("passed" -> "Passed", "Overwise" -> "Otherwise")
3851
3852         * css/mediaControlsGtk.css:
3853
3854 2015-09-24  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3855
3856         Reduce almost uses of PassRefPtr in Webcore/testing
3857         https://bugs.webkit.org/show_bug.cgi?id=149449
3858
3859         Reviewed by Darin Adler.
3860
3861         This patch removes all uses of PassRefPtr except for Internals::serializeObject() and Internals::deserializeObject().
3862         It will be removed by upcoming patch.
3863
3864         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
3865         (WebCore::CDMSessionClearKey::generateKeyRequest):
3866         * Modules/encryptedmedia/CDMSessionClearKey.h:
3867         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3868         (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
3869         * platform/graphics/CDMSession.h:
3870         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
3871         (WebCore::CDMSessionAVFoundationCF::generateKeyRequest):
3872         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
3873         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
3874         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
3875         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
3876         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
3877         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
3878         (WebCore::CDMSessionMediaSourceAVFObjC::generateKeyRequest):
3879         * testing/InternalSettings.h:
3880         (WebCore::InternalSettings::create):
3881         * testing/Internals.cpp:
3882         (WebCore::Internals::create):
3883         (WebCore::Internals::computedStyleIncludingVisitedInfo):
3884         (WebCore::Internals::markerRangeForNode):
3885         (WebCore::Internals::rangeFromLocationAndLength):
3886         (WebCore::Internals::subrange):
3887         (WebCore::Internals::nodesFromRect):
3888         (WebCore::Internals::mallocStatistics):
3889         (WebCore::Internals::typeConversions):
3890         (WebCore::Internals::memoryInfo):
3891         (WebCore::Internals::serializeObject):
3892         (WebCore::Internals::deserializeBuffer):
3893         (WebCore::Internals::createTimeRanges):
3894         * testing/Internals.h:
3895         * testing/MallocStatistics.h:
3896         (WebCore::MallocStatistics::create):
3897         * testing/MemoryInfo.h:
3898         (WebCore::MemoryInfo::create):
3899         * testing/MockCDM.cpp:
3900         (WebCore::MockCDMSession::generateKeyRequest):
3901         * testing/TypeConversions.h:
3902         (WebCore::TypeConversions::create):
3903
3904 2015-09-24  Ryosuke Niwa  <rniwa@webkit.org>
3905
3906         Ran sort-Xcode-project-file.
3907
3908         * WebCore.xcodeproj/project.pbxproj:
3909
3910 2015-09-24  ChangSeok Oh  <changseok.oh@collabora.com>
3911
3912         [GTK] playbutton in media controls is not changed when it is clicked.
3913         https://bugs.webkit.org/show_bug.cgi?id=149113
3914
3915         Reviewed by Philippe Normand.
3916
3917         When the play button in media controls is clicked, a 'paused' class is added or removed
3918         for the element to update its appearance. Although Document::recalcStyle is triggered
3919         by that class attribute change, the play button is not changed since there is
3920         no difference in styles whether having the 'paused' class or not. Gtk port
3921         does not define the -webkit-media-controls-play-button.paused. To fix this,
3922         -webkit-media-controls-play-button.paused is newly defined with a dummy style,
3923         "position: relative;", which should not change the play button appearance,
3924         but be clearly different in style.
3925
3926         Test: media/media-controls-play-button-updates.html
3927
3928         * css/mediaControlsGtk.css:
3929         (video::-webkit-media-controls-play-button.paused):
3930
3931 2015-09-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3932
3933         Unreviewed. Fix GObject DOM API breaks after r190120.
3934
3935         EntityReference has been removed from the DOM spec. Generate an
3936         empy GObject implementation to keep API and ABI
3937         compatibility. also add a deprecated impementation for the methods
3938         using WebKitEntityReference.
3939
3940         * PlatformGTK.cmake: Do not generate bindings for EntityReference.idl.
3941         * bindings/gobject/WebKitDOMDeprecated.cpp:
3942         (webkit_dom_entity_reference_init):
3943         (webkit_dom_entity_reference_class_init):
3944         (webkit_dom_node_iterator_get_expand_entity_references):
3945         (webkit_dom_tree_walker_get_expand_entity_references):
3946         (webkit_dom_document_create_entity_reference):
3947         * bindings/gobject/WebKitDOMDeprecated.h:
3948         * bindings/gobject/WebKitDOMDeprecated.symbols:
3949         * bindings/scripts/CodeGeneratorGObject.pm:
3950         (SkipFunction): Remove FIXME.
3951         * dom/Document.idl: Do not generate createEntityReference for GObject.
3952         * dom/EntityReference.idl: Do not generate empty files for GObject.
3953
3954 2015-09-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3955
3956         [Streams API] Add support for JS builtins constructor
3957         https://bugs.webkit.org/show_bug.cgi?id=149497
3958
3959         Reviewed by Darin Adler.
3960
3961         Covered by existing tests.
3962
3963         Making CountQueuingStrategy fully JS built-in implemented.
3964         Adding support for calling a JS builtin initialization function just after creating the JSXX object.
3965         This JS function must be named initializeXX and be in XX.Js file.
3966         The JSBuiltinConstructor keyword is added to the binding generator.
3967
3968         * CMakeLists.txt: Adding CountQueuingStrategy.js, removing JSCountQueuingStrategyCustom.cpp.
3969         * DerivedSources.cpp: Ditto.
3970         * DerivedSources.make: Ditto.
3971         * Modules/streams/CountQueuingStrategy.h: Making CountQueuingStrategy a dummy class.
3972         (WebCore::CountQueuingStrategy::create):
3973         (WebCore::CountQueuingStrategy::~CountQueuingStrategy):
3974         (WebCore::CountQueuingStrategy::CountQueuingStrategy):
3975         * Modules/streams/CountQueuingStrategy.idl:
3976         * Modules/streams/CountQueuingStrategy.js: Added.
3977         (size):
3978         (initializeCountQueuingStrategy):
3979         * WebCore.vcxproj/WebCore.vcxproj: Removing JSCountQueuingStrategyCustom.cpp.
3980         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
3981         * WebCore.xcodeproj/project.pbxproj: Ditto.
3982         * bindings/js/JSBindingsAllInOne.cpp: Ditto.
3983         * bindings/js/JSCountQueuingStrategyCustom.cpp: Removed.
3984         * bindings/js/JSDOMBinding.cpp: Adding support for DOMConstructorJSBuiltinObject.
3985         (WebCore::callInitializeFunction):
3986         (WebCore::DOMConstructorJSBuiltinObject::visitChildren):
3987         * bindings/js/JSDOMBinding.h: Diitto.
3988         (WebCore::createFromJSBuiltin):
3989         (WebCore::DOMConstructorJSBuiltinObject::DOMConstructorJSBuiltinObject):
3990         * bindings/js/WebCoreJSClientData.h: Adding support for CQS builtins functions.
3991         (WebCore::WebCoreJSClientData::WebCoreJSClientData):
3992         (WebCore::WebCoreJSClientData::countQueuingStrategyBuiltins):
3993         * bindings/scripts/CodeGeneratorJS.pm:
3994         (GetJSBuiltinFunctionName):
3995         (GetFunctionName):
3996         (InstanceNeedsVisitChildren): Generating visitChildren method in case of JSBuiltinConstructor.
3997         (GetParentConstructorClassName): Refactoring to make JSXXConstructor derive from DOMConstructorJSBuiltinObject in case of JSBuiltinConstructor.
3998         (GenerateConstructorDeclaration): Ditto.
3999         (GenerateConstructorDefinition): Generate specific constructor in case of JSBuiltinConstructor.
4000         (GenerateConstructorHelperMethods): Refactoring to use Base class.
4001         (IsConstructable): Ditto.
4002         (ConstructorHasProperties): Deleted.
4003         * bindings/scripts/IDLAttributes.txt: Adding JSBuiltinConstructor.
4004         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
4005         (WebCore::JSTestActiveDOMObjectConstructor::JSTestActiveDOMObjectConstructor):
4006         * bindings/scripts/test/JS/JSTestCallback.cpp:
4007         (WebCore::JSTestCallbackConstructor::JSTestCallbackConstructor):
4008         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
4009         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor):
4010         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
4011         (WebCore::JSTestCustomNamedGetterConstructor::JSTestCustomNamedGetterConstructor):
4012         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
4013         (WebCore::JSTestEventConstructorConstructor::JSTestEventConstructorConstructor):
4014         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
4015         (WebCore::JSTestEventTargetConstructor::JSTestEventTargetConstructor):
4016         * bindings/scripts/test/JS/JSTestException.cpp:
4017         (WebCore::JSTestExceptionConstructor::JSTestExceptionConstructor):
4018         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
4019         (WebCore::JSTestGenerateIsReachableConstructor::JSTestGenerateIsReachableConstructor):
4020         * bindings/scripts/test/JS/JSTestInterface.cpp:
4021         (WebCore::JSTestInterfaceConstructor::JSTestInterfaceConstructor):
4022         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
4023         (WebCore::JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor):
4024         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
4025         (WebCore::JSTestNamedConstructorConstructor::JSTestNamedConstructorConstruc