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