Try to fix Windows build.
[WebKit-https.git] / Source / WebCore / ChangeLog-2016-09-26
1 2016-09-26  Youenn Fablet  <youenn@apple.com>
2
3         ASSERTION FAILED: m_origin || m_type == CachedResource::MainResource
4         https://bugs.webkit.org/show_bug.cgi?id=162472
5         <rdar://problem/28431522>
6
7         Reviewed by Darin Adler.
8
9         No change of behavior.
10
11         Introducing a new CachedResource constructor for already loaded resources.
12         Sharing code with the other constructor in the init method.
13         The main difference with this new constructor is that the resource has no specified origin.
14         The response tainting remains Basic.
15
16         Making some additional code clean-up.
17
18         * loader/cache/CachedImage.cpp:
19         (WebCore::CachedImage::CachedImage): Making use of the new constructor.
20         * loader/cache/CachedResource.cpp:
21         (WebCore::CachedResource::CachedResource):
22         (WebCore::CachedResource::finishRequestInitialization):
23         * loader/cache/CachedResource.h:
24         (WebCore::CachedResource::type):
25
26 2016-09-26  Olivier Blin  <olivier.blin@softathome.com>
27
28         [GStreamer] Support flipY for GPU-to-GPU copy of video textures to WebGL
29         https://bugs.webkit.org/show_bug.cgi?id=162491
30
31         Reviewed by Philippe Normand.
32
33         GPU-GPU copy of video textures to WebGL has been added for
34         GStreamer in bug 159928. It did not handle textures with inverted
35         Y, and thus copy to such textures was not accelerated.
36
37         This occurs with THREE.js which defaults to flipY for textures.
38         It can be tested on http://flimshaw.github.io/Valiant360/
39
40         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
41         (WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface):
42         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
43         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
44         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
45
46 2016-09-25  Antti Koivisto  <antti@apple.com>
47
48         AuthorStyleSheets shouldn't trigger synchronous style resolutions
49         https://bugs.webkit.org/show_bug.cgi?id=162532
50
51         Reviewed by Darin Adler.
52
53         AuthorStyleSheets::didChange() took four different enum values, two of which triggered
54         a synchronous style resolution. This is almost always unnecessary as any subsequent
55         call that requires up-to-date style or layout will perform it. In the few cases where
56         it is actually needed the client can just do it manually.
57
58         The patch also replaces the remaining two enum values with functions:
59
60             void didChangeCandidatesForActiveSet();
61             void didChangeContentsOrInterpretation();
62
63         The first indicates that the set of active stylesheets might have changed and needs to be recomputed.
64         The seconds one indicates that either the content of some stylesheet has changed or that the environment
65         where we interpret the sheets has somehow changed.
66
67         The existing "AsNeeded" values map to didChangeCandidatesForActiveSet() and the rest map to
68         didChangeContentsOrInterpretation(). This also makes it obvious that some call sites use the wrong value.
69         The patch doesn't address these cases.
70
71         * css/CSSStyleSheet.cpp:
72         (WebCore::CSSStyleSheet::didMutateRules):
73         (WebCore::CSSStyleSheet::didMutate):
74         (WebCore::CSSStyleSheet::clearOwnerNode):
75         * dom/AuthorStyleSheets.cpp:
76         (WebCore::AuthorStyleSheets::AuthorStyleSheets):
77         (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
78         (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
79         (WebCore::AuthorStyleSheets::flushPendingChanges):
80         (WebCore::AuthorStyleSheets::scheduleActiveSetChange):
81         (WebCore::AuthorStyleSheets::didChange):
82         (WebCore::AuthorStyleSheets::pendingChangeTimerFired):
83         (WebCore::AuthorStyleSheets::flushPendingUpdates): Deleted.
84         (WebCore::AuthorStyleSheets::scheduleOptimizedUpdate): Deleted.
85         (WebCore::AuthorStyleSheets::optimizedUpdateTimerFired): Deleted.
86         * dom/AuthorStyleSheets.h:
87         (WebCore::AuthorStyleSheets::hasPendingUpdate):
88         * dom/Document.cpp:
89         (WebCore::Document::setContentLanguage):
90         (WebCore::Document::recalcStyle):
91         (WebCore::Document::updateStyleIfNeeded):
92         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
93         (WebCore::Document::didRemoveAllPendingStylesheet):
94         (WebCore::Document::usesStyleBasedEditability):
95         (WebCore::Document::processHttpEquiv):
96         (WebCore::Document::setSelectedStylesheetSet):
97         * dom/ExtensionStyleSheets.cpp:
98         (WebCore::ExtensionStyleSheets::clearPageUserSheet):
99         (WebCore::ExtensionStyleSheets::updatePageUserSheet):
100         (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
101         (WebCore::ExtensionStyleSheets::addUserStyleSheet):
102         (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
103         (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
104         * dom/InlineStyleSheetOwner.cpp:
105         (WebCore::InlineStyleSheetOwner::removedFromDocument):
106         * dom/ProcessingInstruction.cpp:
107         (WebCore::ProcessingInstruction::removedFrom):
108         * dom/ShadowRoot.cpp:
109         (WebCore::ShadowRoot::updateStyle):
110         * html/HTMLLinkElement.cpp:
111         (WebCore::HTMLLinkElement::setDisabledState):
112         (WebCore::HTMLLinkElement::parseAttribute):
113         (WebCore::HTMLLinkElement::process):
114         (WebCore::HTMLLinkElement::removedFrom):
115         (WebCore::HTMLLinkElement::removePendingSheet):
116         * html/HTMLStyleElement.cpp:
117         (WebCore::HTMLStyleElement::parseAttribute):
118         * inspector/InspectorCSSAgent.cpp:
119         (WebCore::InspectorCSSAgent::forcePseudoState):
120         (WebCore::InspectorCSSAgent::resetPseudoStates):
121         * inspector/InspectorPageAgent.cpp:
122         (WebCore::InspectorPageAgent::setEmulatedMedia):
123         * page/Frame.cpp:
124         (WebCore::Frame::setPrinting):
125         * page/FrameView.cpp:
126         (WebCore::FrameView::layout):
127         (WebCore::FrameView::setPagination):
128         (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
129         * page/Page.cpp:
130         (WebCore::Page::setViewMode):
131         (WebCore::Page::setNeedsRecalcStyleInAllFrames):
132         (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
133         * svg/SVGFontFaceElement.cpp:
134         (WebCore::SVGFontFaceElement::rebuildFontFace):
135         (WebCore::SVGFontFaceElement::removedFrom):
136         * xml/XMLTreeViewer.cpp:
137         (WebCore::XMLTreeViewer::transformDocumentToTreeView):
138         * xml/parser/XMLDocumentParser.cpp:
139         (WebCore::XMLDocumentParser::end):
140         * xml/parser/XMLDocumentParserLibxml2.cpp:
141         (WebCore::XMLDocumentParser::doEnd):
142
143 2016-09-24  Yusuke Suzuki  <utatane.tea@gmail.com>
144
145         Unreviewed, update results of DOM binding tests after r206354.
146         https://bugs.webkit.org/show_bug.cgi?id=162503
147
148         Update results of DOM binding tests. After r206354, setDOMException takes
149         ThrowScope as its second argument.
150
151         * bindings/scripts/test/JS/JSTestInterface.cpp:
152         (WebCore::JSTestInterfaceConstructor::construct):
153         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
154         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
155         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
156         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
157         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
158         (WebCore::jsTestNondeterministicNondeterministicGetterExceptionAttr):
159         (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
160         * bindings/scripts/test/JS/JSTestObj.cpp:
161         (WebCore::jsTestObjAttrWithGetterException):
162         (WebCore::jsTestObjAttrWithGetterExceptionWithMessage):
163         (WebCore::jsTestObjStringAttrWithGetterException):
164         (WebCore::jsTestObjWithScriptStateAttributeRaises):
165         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
166         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
167         (WebCore::jsTestObjNullableStringValue):
168         (WebCore::setJSTestObjAttrWithSetterException):
169         (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
170         (WebCore::setJSTestObjStringAttrWithSetterException):
171         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
172         (WebCore::jsTestObjPrototypeFunctionMethodWithException):
173         (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
174         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidException):
175         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
176         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
177         (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
178         (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
179         (WebCore::jsTestObjPrototypeFunctionGetSVGDocument):
180         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
181         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
182         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
183         (WebCore::jsTestTypedefsAttrWithGetterException):
184         (WebCore::jsTestTypedefsStringAttrWithGetterException):
185         (WebCore::setJSTestTypedefsAttrWithSetterException):
186         (WebCore::setJSTestTypedefsStringAttrWithSetterException):
187         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
188         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
189         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithException):
190
191 2016-09-24  Chris Dumez  <cdumez@apple.com>
192
193         REGRESSION (r206221): [USER] com.apple.WebKit.WebContent.Development at com.apple.JavaScriptCore: vmEntryToJavaScript + 299
194         https://bugs.webkit.org/show_bug.cgi?id=162536
195         <rdar://problem/28415971>
196
197         Reviewed by Gavin Barraclough.
198
199         Stop marking cross-origin Window/Location objects properties as cacheable
200         given that we do not support yet caching of such properties. This is because
201         they are using the new CustomAccesstor PropertySlot type, which is not handled
202         yet by Repatch.cpp. Performance is anyway not critical for cross-origin
203         Window / Location properties.
204
205         Test: http/tests/security/cross-origin-window-property-caching-crash.html
206
207         * bindings/js/JSDOMWindowCustom.cpp:
208         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
209         * bindings/js/JSLocationCustom.cpp:
210         (WebCore::JSLocation::getOwnPropertySlotDelegate):
211
212 2016-09-24  Chris Dumez  <cdumez@apple.com>
213
214         REGRESSION (r205524): Crash under WTF::numGraphemeClusters()
215         https://bugs.webkit.org/show_bug.cgi?id=162534
216         <rdar://problem/28463828>
217
218         Reviewed by David Kilzer.
219
220         We were constructing a StringView from a temporary String and then passing it to
221         WTF::numGraphemeClusters().
222
223         Test: fast/dom/HTMLInputElement/handleBeforeTextInsertedEvent-crash.html
224
225         * html/TextFieldInputType.cpp:
226         (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
227
228 2016-09-24  Chris Dumez  <cdumez@apple.com>
229
230         <a download> does not support Blob URLs
231         https://bugs.webkit.org/show_bug.cgi?id=156099
232         <rdar://problem/25535520>
233
234         Reviewed by Darin Adler.
235
236         Only allow trusted events to trigger downloads for <a download>, as per:
237         - https://html.spec.whatwg.org/#the-a-element:triggered-by-user-activation
238
239         Without this, a script could download a file to the user's disk without
240         any user gesture or consent, simply by calling a.click(). I have confirmed
241         that Firefox also ignores the click for <a download> if it is synthetic.
242         Chrome allows synthetic clicks to trigger downloads but I filed a bug
243         about it.
244
245         Test: fast/dom/HTMLAnchorElement/anchor-download-synthetic-click.html
246
247         * html/HTMLAnchorElement.cpp:
248         (WebCore::HTMLAnchorElement::handleClick):
249
250 2016-09-24  Yusuke Suzuki  <utatane.tea@gmail.com>
251
252         [Binding] setDOMException should be inlined and fall to the slow path if exception occurs
253         https://bugs.webkit.org/show_bug.cgi?id=162503
254
255         Reviewed by Saam Barati.
256
257         Binding code emits setDOMException in critical paths. However, it is not inlined.
258         Since exception less frequently occurs, we should have inlined setDOMException that
259         early returns if it does not need to raise an exception. And it should call the exception
260         raising code as slow path case. This tiny optimization can offer improvement if
261         the DOM function is tiny and DOM binding occupies large part of it. Combined with r206338,
262         it offers 5% improvement in Dromaeo dom-attr getAttribute / setAttribute tests.
263
264         * bindings/js/JSDOMBinding.cpp:
265         (WebCore::throwDOMException): Extract the actual exception raising code.
266         (WebCore::setDOMExceptionSlow): Call throwDOMException and keep it not inlined.
267         (WebCore::setDOMException):
268         * bindings/js/JSDOMBinding.h:
269         (WebCore::setDOMException): Use ThrowScope& to check `scope.exception()`.
270         And it has a path for normal case that allows early returning.
271         * bindings/scripts/CodeGeneratorJS.pm:
272         (GenerateImplementation):
273         (GenerateImplementationFunctionCall):
274         (GenerateConstructorDefinition):
275
276 2016-09-23  Antti Koivisto  <antti@apple.com>
277
278         Move stylesheet change logic from Document to AuthorStyleSheets
279         https://bugs.webkit.org/show_bug.cgi?id=162488
280
281         Reviewed by Andreas Kling.
282
283         That's where it belongs.
284
285         * WebCore.xcodeproj/project.pbxproj:
286         * css/CSSStyleSheet.cpp:
287         (WebCore::CSSStyleSheet::didMutateRules):
288         (WebCore::CSSStyleSheet::didMutate):
289         (WebCore::CSSStyleSheet::clearOwnerNode):
290         * dom/AuthorStyleSheets.cpp:
291         (WebCore::AuthorStyleSheets::AuthorStyleSheets):
292         (WebCore::AuthorStyleSheets::flushPendingUpdates):
293         (WebCore::AuthorStyleSheets::scheduleOptimizedUpdate):
294         (WebCore::AuthorStyleSheets::didChange):
295         (WebCore::AuthorStyleSheets::optimizedUpdateTimerFired):
296         * dom/AuthorStyleSheets.h:
297         (WebCore::AuthorStyleSheets::hasPendingUpdate):
298         (WebCore::AuthorStyleSheets::pendingUpdateType): Deleted.
299         (WebCore::AuthorStyleSheets::setPendingUpdateType): Deleted.
300         (WebCore::AuthorStyleSheets::flushPendingUpdates): Deleted.
301         * dom/Document.cpp:
302         (WebCore::Document::Document):
303         (WebCore::Document::setContentLanguage):
304         (WebCore::Document::needsStyleRecalc):
305         (WebCore::Document::updateStyleIfNeeded):
306         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
307         (WebCore::Document::didRemoveAllPendingStylesheet):
308         (WebCore::Document::processHttpEquiv):
309         (WebCore::Document::setSelectedStylesheetSet):
310         (WebCore::Document::updateHoverActiveState):
311
312             Remove StyleResolverUpdateFlag argument that was misused to indicate sync style recalc.
313             Clients can call updateStyleIfNeeded() directly though none of them appears to need it.
314
315         (WebCore::Document::optimizedStyleSheetUpdateTimerFired): Deleted.
316         (WebCore::Document::scheduleOptimizedStyleSheetUpdate): Deleted.
317         (WebCore::Document::styleResolverChanged): Deleted.
318         * dom/Document.h:
319         (WebCore::Document::needsStyleRecalc): Deleted.
320         * dom/ExtensionStyleSheets.cpp:
321         (WebCore::ExtensionStyleSheets::clearPageUserSheet):
322         (WebCore::ExtensionStyleSheets::updatePageUserSheet):
323         (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
324         (WebCore::ExtensionStyleSheets::addUserStyleSheet):
325         (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
326         (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
327         * dom/InlineStyleSheetOwner.cpp:
328         (WebCore::InlineStyleSheetOwner::removedFromDocument):
329         * dom/ProcessingInstruction.cpp:
330         (WebCore::ProcessingInstruction::removedFrom):
331
332             Also fix a bug that prevented document from rendering if a loading processing instruction was removed from the tree.
333             This is tested by fast/dom/StyleSheet/detached-style-pi-2.xhtml (after other changes in this patch).
334
335         * dom/ShadowRoot.cpp:
336         (WebCore::ShadowRoot::updateStyle):
337         * html/HTMLLinkElement.cpp:
338         (WebCore::HTMLLinkElement::setDisabledState):
339         (WebCore::HTMLLinkElement::parseAttribute):
340         (WebCore::HTMLLinkElement::process):
341         (WebCore::HTMLLinkElement::removedFrom):
342         (WebCore::HTMLLinkElement::removePendingSheet):
343         * html/HTMLStyleElement.cpp:
344         (WebCore::HTMLStyleElement::parseAttribute):
345         * inspector/InspectorCSSAgent.cpp:
346         (WebCore::InspectorCSSAgent::forcePseudoState):
347         (WebCore::InspectorCSSAgent::resetPseudoStates):
348         * inspector/InspectorPageAgent.cpp:
349         (WebCore::InspectorPageAgent::setEmulatedMedia):
350         * page/Frame.cpp:
351         (WebCore::Frame::setPrinting):
352         * page/FrameView.cpp:
353         (WebCore::FrameView::layout):
354         (WebCore::FrameView::setPagination):
355         (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
356         * page/Page.cpp:
357         (WebCore::Page::setViewMode):
358         (WebCore::Page::setNeedsRecalcStyleInAllFrames):
359         (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
360         * svg/SVGFontFaceElement.cpp:
361         (WebCore::SVGFontFaceElement::rebuildFontFace):
362         (WebCore::SVGFontFaceElement::removedFrom):
363         * xml/XMLTreeViewer.cpp:
364         (WebCore::XMLTreeViewer::transformDocumentToTreeView):
365         * xml/parser/XMLDocumentParser.cpp:
366         (WebCore::XMLDocumentParser::end):
367         * xml/parser/XMLDocumentParserLibxml2.cpp:
368         (WebCore::XMLDocumentParser::doEnd):
369
370 2016-09-23  Wenson Hsieh  <wenson_hsieh@apple.com>
371
372         Media controls playhead does not animate smoothly while playing
373         https://bugs.webkit.org/show_bug.cgi?id=162399
374         <rdar://problem/28115680>
375
376         Reviewed by Beth Dakin.
377
378         The media controls playhead currently does not animate smoothly during playback because we don't specify a
379         playback rate when updating the WebPlaybackControlsManager's timing value. However, simply setting this timing
380         value to the current playback rate (as known to the UI process) results in the UI process receiving multiple
381         updates from the web process where the current time is equal (or even less than) the time at which media began
382         to play, which results in the playhead seeking backwards to the start time multiple times when playing or
383         resuming media.
384
385         To address this, in WebCore, we inform the playback session model of the media time when playback begins (i.e.
386         a `playing` or `play` event is fired). This message precedes both the "rate changed" and "current time changed"
387         messages.
388
389         Unit tests to be added in a future patch.
390
391         * html/HTMLMediaElement.cpp:
392         (WebCore::HTMLMediaElement::notifyAboutPlaying):
393         (WebCore::HTMLMediaElement::setReadyState):
394         (WebCore::HTMLMediaElement::playInternal):
395         * html/HTMLMediaElement.h:
396         (WebCore::HTMLMediaElement::playbackStartedTime):
397         * platform/cocoa/WebPlaybackSessionModel.h:
398         (WebCore::WebPlaybackSessionModelClient::playbackStartedTimeChanged):
399         (WebCore::WebPlaybackSessionModelClient::bufferedTimeChanged): Deleted.
400         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
401         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
402         (WebPlaybackSessionModelMediaElement::updateForEventName):
403         (WebPlaybackSessionModelMediaElement::playbackStartedTime):
404         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
405         * platform/mac/WebPlaybackSessionInterfaceMac.h:
406         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
407         (WebCore::WebPlaybackSessionInterfaceMac::currentTimeChanged):
408         (WebCore::WebPlaybackSessionInterfaceMac::rateChanged):
409         (WebCore::WebPlaybackSessionInterfaceMac::beginScrubbing):
410         (WebCore::WebPlaybackSessionInterfaceMac::endScrubbing):
411         (WebCore::WebPlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming):
412
413 2016-09-23  Zalan Bujtas  <zalan@apple.com>
414
415         ASSERTION FAILED: !newRelayoutRoot.container() || is<RenderView>(newRelayoutRoot.container()) || !newRelayoutRoot.container()->needsLayout() while loading sohu.com
416         https://bugs.webkit.org/show_bug.cgi?id=162466
417
418         Reviewed by Simon Fraser.
419
420         When we come across a out-of-flow positioned renderer during layout, we add it to a tracker map with
421         its containing block (calling RenderBlock::insertPositionedObject).
422         It ensures that a containing block can easily access to the out-of-flow positioned descendants during layout/painting/hittesting.
423         We do it even when the containing block - positioned renderer pair is already in this tracker map.
424         RenderBlock::insertPositionedObject() eagerly sets the positioned-child-needs-layout flag on the containing block
425         assuming it needs to layout this descendant later in the layout phase.
426         This patch ensure that we only flag the containing block dirty when the descendant needs layout.
427
428         Test: fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block.html
429
430         * rendering/RenderBlock.cpp:
431         (WebCore::RenderBlock::insertPositionedObject):
432
433 2016-09-23  Yusuke Suzuki  <utatane.tea@gmail.com>
434
435         [Binding] Use unchekcedArgument if argumentCount is already checked
436         https://bugs.webkit.org/show_bug.cgi?id=162502
437
438         Reviewed by Geoffrey Garen.
439
440         It is not necessary to use `exec->argument(n)` after checking the argument exists.
441         This patch changes `argument(n)` to `uncheckedArgument(n)` if we already proved that
442         the argument exists. This change drops branches generated by `exec->argument(n)`.
443         And it is good for small DOM operations in which DOM binding code occupies large
444         part of entire processing. This patch and another small patch[1] offer roughly 5%
445         improvement in Dromaeo dom-attr's getAttribute and setAttribute tests.
446
447         [1]: https://bugs.webkit.org/show_bug.cgi?id=162503
448
449         * bindings/scripts/CodeGeneratorJS.pm:
450         (GenerateParametersCheck): GenerateParameterCheck requires GenerateArgumentsCountCheck.
451         As a result, existence of mandatory arguments are already checked. We can use `uncheckedArgument(n)`
452         for mandatory arguments.
453         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
454         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
455         (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
456         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
457         (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
458         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
459         (WebCore::jsTestEventTargetPrototypeFunctionItem):
460         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
461         (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation):
462         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1):
463         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2):
464         * bindings/scripts/test/JS/JSTestInterface.cpp:
465         (WebCore::JSTestInterfaceConstructor::construct):
466         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
467         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
468         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
469         (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
470         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
471         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
472         * bindings/scripts/test/JS/JSTestObj.cpp:
473         (WebCore::JSTestObjConstructor::construct):
474         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1):
475         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2):
476         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
477         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
478         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
479         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
480         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
481         (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString):
482         (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
483         (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
484         (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg):
485         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
486         (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg):
487         (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg):
488         (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString):
489         (WebCore::jsTestObjPrototypeFunctionSerializedValue):
490         (WebCore::jsTestObjPrototypeFunctionOptionsObject):
491         (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
492         (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod):
493         (WebCore::jsTestObjPrototypeFunctionAddEventListener):
494         (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
495         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
496         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
497         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
498         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
499         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArg):
500         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
501         (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg):
502         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
503         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
504         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
505         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
506         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
507         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
508         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
509         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
510         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
511         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
512         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
513         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
514         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
515         (WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
516         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
517         (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
518         (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
519         (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
520         (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
521         (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
522         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
523         (WebCore::jsTestObjPrototypeFunctionGetElementById):
524         (WebCore::jsTestObjPrototypeFunctionConvert1):
525         (WebCore::jsTestObjPrototypeFunctionConvert2):
526         (WebCore::jsTestObjPrototypeFunctionConvert3):
527         (WebCore::jsTestObjPrototypeFunctionConvert4):
528         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
529         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
530         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
531         (WebCore::jsTestObjPrototypeFunctionAny):
532         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
533         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
534         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
535         (WebCore::jsTestObjPrototypeFunctionConditionalOverload1):
536         (WebCore::jsTestObjPrototypeFunctionConditionalOverload2):
537         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
538         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
539         (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
540         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
541         (WebCore::constructJSTestOverloadedConstructors1):
542         (WebCore::constructJSTestOverloadedConstructors2):
543         (WebCore::constructJSTestOverloadedConstructors3):
544         (WebCore::constructJSTestOverloadedConstructors4):
545         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
546         (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
547         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
548         (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
549         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
550         (WebCore::JSTestTypedefsConstructor::construct):
551         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
552         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
553         (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg):
554         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
555         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
556         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
557         (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
558
559 2016-09-23  Alex Christensen  <achristensen@webkit.org>
560
561         Refactor URLParser
562         https://bugs.webkit.org/show_bug.cgi?id=162518
563
564         Reviewed by Brady Eidson.
565
566         Use a helper function to determine the currentPosition instead of always determining position based on the
567         size of the buffer.  Soon there will be nothing in the buffer in the common case where there are no syntax errors.
568         Also make more static functions into methods.  Give IPv6Addresses and IPv4Addresses names.  Start adding syntaxError stubs.
569
570         No change in behavior.  Covered by API tests.
571
572         * platform/URLParser.cpp:
573         (WebCore::URLParser::incrementIteratorSkippingTabAndNewLine):
574         (WebCore::URLParser::isWindowsDriveLetter):
575         (WebCore::URLParser::appendToASCIIBuffer):
576         (WebCore::URLParser::syntaxError):
577         (WebCore::URLParser::currentPosition):
578         (WebCore::URLParser::URLParser):
579         (WebCore::URLParser::parse):
580         (WebCore::URLParser::parseAuthority):
581         (WebCore::URLParser::appendNumberToASCIIBuffer):
582         (WebCore::URLParser::serializeIPv4):
583         (WebCore::URLParser::serializeIPv6Piece):
584         (WebCore::URLParser::serializeIPv6):
585         (WebCore::URLParser::parseIPv4Host):
586         (WebCore::URLParser::parseIPv6Host):
587         (WebCore::URLParser::parsePort):
588         (WebCore::URLParser::parseHostAndPort):
589         (WebCore::append): Deleted.
590         (WebCore::serializeIPv4): Deleted.
591         (WebCore::serializeIPv6Piece): Deleted.
592         (WebCore::serializeIPv6): Deleted.
593         (WebCore::parseIPv4Host): Deleted.
594         (WebCore::parseIPv6Host): Deleted.
595         * platform/URLParser.h:
596
597 2016-09-23  Alex Christensen  <achristensen@webkit.org>
598
599         Refactor URLParser
600         https://bugs.webkit.org/show_bug.cgi?id=162516
601
602         Reviewed by Brady Eidson.
603
604         Turn more static functions into methods, use a helper function to append characters to a buffer.
605
606         No change in behavior, but I added a new API test to cover an interesting 
607         ipv6 address parsing case that had no coverage.
608
609         * platform/URLParser.cpp:
610         (WebCore::CodePointIterator::codeUnitsSince):
611         (WebCore::URLParser::isWindowsDriveLetter):
612         (WebCore::URLParser::appendToASCIIBuffer):
613         (WebCore::URLParser::checkWindowsDriveLetter):
614         (WebCore::URLParser::percentEncodeByte):
615         (WebCore::URLParser::utf8PercentEncode):
616         (WebCore::URLParser::utf8QueryEncode):
617         (WebCore::URLParser::encodeQuery):
618         (WebCore::URLParser::copyASCIIStringUntil):
619         (WebCore::URLParser::copyURLPartsUntil):
620         (WebCore::URLParser::URLParser):
621         (WebCore::URLParser::parse):
622         (WebCore::URLParser::parseAuthority):
623         (WebCore::URLParser::parsePort):
624         (WebCore::URLParser::parseHostAndPort):
625         (WebCore::utf8PercentEncode): Deleted.
626         (WebCore::utf8QueryEncode): Deleted.
627         (WebCore::encodeQuery): Deleted.
628         (WebCore::copyASCIIStringUntil): Deleted.
629         * platform/URLParser.h:
630         (WebCore::URLParser::appendToASCIIBuffer):
631
632 2016-09-23  Caitlin Potter  <caitp@igalia.com>
633
634         [JSC] Implement parsing of Async Functions
635         https://bugs.webkit.org/show_bug.cgi?id=161409
636
637         Reviewed by Yusuke Suzuki.
638
639         * Configurations/FeatureDefines.xcconfig:
640
641 2016-09-23  Chris Dumez  <cdumez@apple.com>
642
643         Align HTMLLabelElement.prototype.form with the HTML specification
644         https://bugs.webkit.org/show_bug.cgi?id=162369
645
646         Reviewed by Ryosuke Niwa.
647
648         Align HTMLLabelElement.prototype.form with the HTML specification:
649         - https://html.spec.whatwg.org/#dom-label-form
650
651         In particular, the following behavior changes:
652         - We now return null if the label element has no labeled control.
653         - We now return the form element instead of returning null if
654           the label element is outside the form but its labeled control
655           is inside the form.
656
657         Firefox and Chrome match the specification.
658
659         No new tests, rebaselined existing tests.
660
661         * html/HTMLLabelElement.cpp:
662         (WebCore::HTMLLabelElement::form):
663         * html/HTMLLabelElement.h:
664
665 2016-09-23  Alex Christensen  <achristensen@webkit.org>
666
667         Refactor URLParser
668         https://bugs.webkit.org/show_bug.cgi?id=162511
669
670         Reviewed by Brady Eidson.
671
672         Make the constructor take the parameters instead of URL::parse.
673         Now we don't need to copy the input string on failure.
674         Also, turn some static functions into methods so they will be able to access member variables.
675
676         Covered by existing and new API tests.
677
678         * platform/URL.cpp:
679         (WebCore::URL::URL):
680         (WebCore::URL::setProtocol):
681         (WebCore::URL::setHost):
682         (WebCore::URL::removePort):
683         (WebCore::URL::setPort):
684         (WebCore::URL::setHostAndPort):
685         (WebCore::URL::setUser):
686         (WebCore::URL::setPass):
687         (WebCore::URL::setFragmentIdentifier):
688         (WebCore::URL::removeFragmentIdentifier):
689         (WebCore::URL::setQuery):
690         (WebCore::URL::setPath):
691         * platform/URLParser.cpp:
692         (WebCore::URLParser::incrementIteratorSkippingTabAndNewLine):
693         (WebCore::URLParser::isWindowsDriveLetter):
694         (WebCore::URLParser::checkWindowsDriveLetter):
695         (WebCore::URLParser::shouldCopyFileURL):
696         (WebCore::URLParser::failure):
697         (WebCore::URLParser::URLParser):
698         (WebCore::URLParser::parse):
699         (WebCore::incrementIteratorSkippingTabAndNewLine): Deleted.
700         (WebCore::isWindowsDriveLetter): Deleted.
701         (WebCore::checkWindowsDriveLetter): Deleted.
702         (WebCore::shouldCopyFileURL): Deleted.
703         * platform/URLParser.h:
704         (WebCore::URLParser::URLParser):
705         (WebCore::URLParser::result):
706         (WebCore::URLParser::parse): Deleted.
707         * platform/cf/URLCF.cpp:
708         (WebCore::URL::URL):
709         Drive-by fix: Actually assign the URL to be the result of parsing.
710         * platform/mac/URLMac.mm:
711         (WebCore::URL::URL):
712
713 2016-09-23  Alex Christensen  <achristensen@webkit.org>
714
715         Remove URLParser serialized template
716         https://bugs.webkit.org/show_bug.cgi?id=162501
717
718         Reviewed by Brady Eidson.
719
720         No change in behavior.  
721         This optimization conflicts with another optimization I'm doing.
722         We currently have the ParsedURLString tag, where we tell the parser to assume this URL is valid and canonicalized.
723         I'm going to instead make URLParser assume all URLs are valid and canonicalized until it finds that it is not, 
724         in which case it will canonicalize it if possible.
725
726         * platform/URL.cpp:
727         (WebCore::URL::URL):
728         * platform/URLParser.cpp:
729         (WebCore::incrementIteratorSkippingTabAndNewLine):
730         (WebCore::isWindowsDriveLetter):
731         (WebCore::checkWindowsDriveLetter):
732         (WebCore::shouldCopyFileURL):
733         (WebCore::utf8PercentEncode):
734         (WebCore::utf8QueryEncode):
735         (WebCore::URLParser::parse):
736         (WebCore::URLParser::parseAuthority):
737         (WebCore::URLParser::parsePort):
738         (WebCore::URLParser::parseHostAndPort):
739         (WebCore::URLParser::parseSerializedURL): Deleted.
740         * platform/URLParser.h:
741         (WebCore::URLParser::parse):
742
743 2016-09-23  Jer Noble  <jer.noble@apple.com>
744
745         Allow Seeking from the now playing controls
746         https://bugs.webkit.org/show_bug.cgi?id=162498
747
748         Reviewed by Beth Dakin.
749
750         We already have a handler for seek commands, we just need to register that handler
751         with MediaRemote.
752
753         * platform/mac/RemoteCommandListenerMac.mm:
754         (WebCore::RemoteCommandListenerMac::updateSupportedCommands):
755
756 2016-09-23  Wenson Hsieh  <wenson_hsieh@apple.com>
757
758         MediaSessionManagerMac::nowPlayingEligibleSession() needs to honor the main content heuristic
759         https://bugs.webkit.org/show_bug.cgi?id=162480
760         <rdar://problem/28430615>
761
762         Reviewed by Jer Noble.
763
764         Changes the implementation of nowPlayingEligibleSession to use bestMediaElementForShowingPlaybackControlsManager
765         and also early return nullptr if the current tab the web process is hosted in is the active tab, and the window
766         it is hosted in is the main window. This information is derived from the viewState flags in the Page of each
767         tab -- whenever the (visible && active) state changes, the Page tells the global media session manager to update
768         its Now Playing info. Then, when each MediaElementSession tries to determine whether it can show playback
769         controls for the purposes of Now Playing, each session consults its page's visible and active state. If a page
770         is both visible and active, no Now Playing controls are allowed for that media session.
771
772         Also adds some slight adjustments to MediaSessionManagerMac::updateNowPlayingInfo, so we reset the title, rate
773         and duration of the current active session when clearing out the now playing info. Likewise, when vending an
774         active video, if the video information matches that of the current session, we mark m_nowPlayingActive anyways.
775         These tweaks prevent us from getting in a bad state when switching between a tab with media and one without.
776
777         Unit tests to come in a future patch.
778
779         * html/HTMLMediaElement.cpp:
780         (WebCore::mediaElementSessionInfoForSession):
781         (WebCore::mediaSessionMayBeConfusedWithMainContent):
782         (WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager):
783         (WebCore::HTMLMediaElement::updatePlaybackControlsManager):
784         (WebCore::bestMediaSessionForShowingPlaybackControlsManager): Deleted.
785         * html/HTMLMediaElement.h:
786         * html/MediaElementSession.cpp:
787         (WebCore::MediaElementSession::canShowControlsManager):
788         (WebCore::MediaElementSession::pageAllowsNowPlayingControls):
789         * html/MediaElementSession.h:
790         * page/Page.cpp:
791         (WebCore::Page::setViewState):
792         (WebCore::Page::isVisibleAndActive):
793         * page/Page.h:
794         * platform/audio/PlatformMediaSessionManager.cpp:
795         (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary):
796         * platform/audio/PlatformMediaSessionManager.h:
797         * platform/audio/mac/MediaSessionManagerMac.mm:
798         (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary):
799         (WebCore::MediaSessionManagerMac::nowPlayingEligibleSession):
800         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
801
802 2016-09-23  Commit Queue  <commit-queue@webkit.org>
803
804         Unreviewed, rolling out r206311.
805         https://bugs.webkit.org/show_bug.cgi?id=162495
806
807         Broke internal iOS build (Requested by anttik on #webkit).
808
809         Reverted changeset:
810
811         "Move stylesheet change logic from Document to
812         AuthorStyleSheets"
813         https://bugs.webkit.org/show_bug.cgi?id=162488
814         http://trac.webkit.org/changeset/206311
815
816 2016-09-23  Antti Koivisto  <antti@apple.com>
817
818         Move stylesheet change logic from Document to AuthorStyleSheets
819         https://bugs.webkit.org/show_bug.cgi?id=162488
820
821         Reviewed by Andreas Kling.
822
823         That's where it belongs.
824
825         * WebCore.xcodeproj/project.pbxproj:
826         * css/CSSStyleSheet.cpp:
827         (WebCore::CSSStyleSheet::didMutateRules):
828         (WebCore::CSSStyleSheet::didMutate):
829         (WebCore::CSSStyleSheet::clearOwnerNode):
830         * dom/AuthorStyleSheets.cpp:
831         (WebCore::AuthorStyleSheets::AuthorStyleSheets):
832         (WebCore::AuthorStyleSheets::flushPendingUpdates):
833         (WebCore::AuthorStyleSheets::scheduleOptimizedUpdate):
834         (WebCore::AuthorStyleSheets::didChange):
835         (WebCore::AuthorStyleSheets::optimizedUpdateTimerFired):
836         * dom/AuthorStyleSheets.h:
837         (WebCore::AuthorStyleSheets::hasPendingUpdate):
838         (WebCore::AuthorStyleSheets::pendingUpdateType): Deleted.
839         (WebCore::AuthorStyleSheets::setPendingUpdateType): Deleted.
840         (WebCore::AuthorStyleSheets::flushPendingUpdates): Deleted.
841         * dom/Document.cpp:
842         (WebCore::Document::Document):
843         (WebCore::Document::setContentLanguage):
844         (WebCore::Document::needsStyleRecalc):
845         (WebCore::Document::updateStyleIfNeeded):
846         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
847         (WebCore::Document::didRemoveAllPendingStylesheet):
848         (WebCore::Document::processHttpEquiv):
849         (WebCore::Document::setSelectedStylesheetSet):
850         (WebCore::Document::updateHoverActiveState):
851         (WebCore::Document::optimizedStyleSheetUpdateTimerFired): Deleted.
852         (WebCore::Document::scheduleOptimizedStyleSheetUpdate): Deleted.
853         (WebCore::Document::styleResolverChanged): Deleted.
854         * dom/Document.h:
855         (WebCore::Document::needsStyleRecalc): Deleted.
856         * dom/ExtensionStyleSheets.cpp:
857         (WebCore::ExtensionStyleSheets::clearPageUserSheet):
858         (WebCore::ExtensionStyleSheets::updatePageUserSheet):
859         (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
860         (WebCore::ExtensionStyleSheets::addUserStyleSheet):
861         (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
862         (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
863         * dom/InlineStyleSheetOwner.cpp:
864         (WebCore::InlineStyleSheetOwner::removedFromDocument):
865         * dom/ProcessingInstruction.cpp:
866         (WebCore::ProcessingInstruction::removedFrom):
867
868             Also fix a bug that prevented document from rendering if a loading processing instruction was removed from the tree.
869             This is tested by fast/dom/StyleSheet/detached-style-pi-2.xhtml (after other changes in this patch).
870
871         * dom/ShadowRoot.cpp:
872         (WebCore::ShadowRoot::updateStyle):
873         * html/HTMLLinkElement.cpp:
874         (WebCore::HTMLLinkElement::setDisabledState):
875         (WebCore::HTMLLinkElement::parseAttribute):
876         (WebCore::HTMLLinkElement::process):
877         (WebCore::HTMLLinkElement::removedFrom):
878         (WebCore::HTMLLinkElement::removePendingSheet):
879         * html/HTMLStyleElement.cpp:
880         (WebCore::HTMLStyleElement::parseAttribute):
881         * inspector/InspectorCSSAgent.cpp:
882         (WebCore::InspectorCSSAgent::forcePseudoState):
883         (WebCore::InspectorCSSAgent::resetPseudoStates):
884         * inspector/InspectorPageAgent.cpp:
885         (WebCore::InspectorPageAgent::setEmulatedMedia):
886         * page/Frame.cpp:
887         (WebCore::Frame::setPrinting):
888         * page/FrameView.cpp:
889         (WebCore::FrameView::layout):
890         (WebCore::FrameView::setPagination):
891         (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
892         * page/Page.cpp:
893         (WebCore::Page::setViewMode):
894         (WebCore::Page::setNeedsRecalcStyleInAllFrames):
895         (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
896         * svg/SVGFontFaceElement.cpp:
897         (WebCore::SVGFontFaceElement::rebuildFontFace):
898         (WebCore::SVGFontFaceElement::removedFrom):
899         * xml/XMLTreeViewer.cpp:
900         (WebCore::XMLTreeViewer::transformDocumentToTreeView):
901         * xml/parser/XMLDocumentParser.cpp:
902         (WebCore::XMLDocumentParser::end):
903         * xml/parser/XMLDocumentParserLibxml2.cpp:
904         (WebCore::XMLDocumentParser::doEnd):
905
906 2016-09-22  Sergio Villar Senin  <svillar@igalia.com>
907
908         [css-grid] ASSERT when sizing tracks with percentages inside calc
909         https://bugs.webkit.org/show_bug.cgi?id=162383
910
911         Reviewed by Darin Adler.
912
913         There is an ASSERT to check that tracks are at least as wide as the initial base size. This
914         was added to verify that we never shrink tracks bellow that value. In order to compute the
915         value used for initialization we need a max size which is the value used to resolve
916         percentages to. The remaining free space was used to compute that value, that's totally
917         wrong because the free space decreases as the track sizing algorithm is run. The available
918         space should be used instead.
919
920         An extra ASSERT was removed too because it was redundant, we do always check the sizes of
921         the tracks after running the track sizing algorithm and that's precisely the unique point
922         were they could be modified.
923
924         Test: fast/css-grid-layout/tracks-wider-min-track-breadth-crash.html
925
926         * rendering/RenderGrid.cpp:
927         (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
928
929 2016-09-23  Chris Dumez  <cdumez@apple.com>
930
931         document.title getter does not strip / collapse the right whitespace characters
932         https://bugs.webkit.org/show_bug.cgi?id=162468
933
934         Reviewed by Ryosuke Niwa.
935
936         The document.title getter does not strip / collapse whitespace characters
937         as per:
938         - https://html.spec.whatwg.org/#document.title
939
940         This part of the specification provides more information about which
941         whitespace characters:
942         - https://html.spec.whatwg.org/#strip-and-collapse-whitespace
943         - https://html.spec.whatwg.org/#space-character
944
945         Firefox matches the specification. However, WebKit was stripping / collapsing
946         some characters it should not.
947
948         No new tests, rebaselined existing tests.
949
950         * dom/Document.cpp:
951         (WebCore::canonicalizedTitle):
952
953 2016-09-23  Chris Dumez  <cdumez@apple.com>
954
955         Align Element.insertAdjacentHTML() with the specification
956         https://bugs.webkit.org/show_bug.cgi?id=162479
957
958         Reviewed by Sam Weinig.
959
960         Align Element.insertAdjacentHTML() with the specification:
961         - https://w3c.github.io/DOM-Parsing/#dom-element-insertadjacenthtml (steps 1 & 2)
962
963         In particular, the following changes issues are now fixed:
964         - Calling insertAdjacentHTML() on an element whose parent is a
965           DocumentFragment now works insteas of throwing a
966           NO_MODIFICATION_ALLOWED_ERR.
967         - Calling insertAdjacentHTML() on child of the <html> element
968           no longer creates duplicate body / head elements.
969
970         Firefox agrees with the specification.
971
972         Test: fast/dom/insertAdjacentHTML-DocumentFragment-parent.html
973
974         * dom/Element.cpp:
975         (WebCore::contextNodeForInsertion):
976         (WebCore::Element::insertAdjacentHTML):
977
978 2016-09-23  Commit Queue  <commit-queue@webkit.org>
979
980         Unreviewed, rolling out r206165.
981         https://bugs.webkit.org/show_bug.cgi?id=162492
982
983         needs corresponding API change in bug 162475 (Requested by
984         alexchristensen on #webkit).
985
986         Reverted changeset:
987
988         "Non-special URLs should have an opaque origin"
989         https://bugs.webkit.org/show_bug.cgi?id=162254
990         http://trac.webkit.org/changeset/206165
991
992 2016-09-23  Carlos Garcia Campos  <cgarcia@igalia.com>
993
994         Unreviewed. Fix the build after r206300.
995
996         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Add missing header include.
997
998 2016-09-23  Jer Noble  <jer.noble@apple.com>
999
1000         Unreviewed build fix; Missed a file in the last checkin.
1001
1002         * platform/graphics/SourceBufferPrivate.h:
1003         (WebCore::SourceBufferPrivate::enqueuedSamplesForTrackID):
1004
1005 2016-09-23  Jer Noble  <jer.noble@apple.com>
1006
1007         REGRESSION (206001): Scrubbed video on Youtube stops playing
1008         https://bugs.webkit.org/show_bug.cgi?id=162481
1009         <rdar://problem/28436707>
1010
1011         Reviewed by Eric Carlson.
1012
1013         Test: media/media-source/media-source-seek-back.html
1014
1015         When re-enqueing samples after a seek, modified the algorithm for finding the first sample
1016         to re-enqueue. Instead of finding a sample which contained the requested presentation time,
1017         we searched for the first sample on-or-after the presentation time. This meant that if the
1018         last buffered sample in that range started before the seek time, and ended after, it would
1019         get skipped during re-enquing, and a far, far future sample would be enqueued instead. Now
1020         revert to the old behavior (find the sample containing the requested time), and only adopt
1021         the new behavior (find the next sample on-or-after the requested time) if the first failed.
1022         In addition, bail out if the second check resulted in a sample whose presentation time was
1023         greater than a "fudge factor" away from the requested time.
1024
1025         To test this behavior, add a new method onto Internals that returns a list of the enqueued
1026         samples from a SourceBuffer.
1027
1028         * Modules/mediasource/SourceBuffer.cpp:
1029         (WebCore::SourceBuffer::reenqueueMediaForTime):
1030         (WebCore::SourceBuffer::enqueuedSamplesForTrackID):
1031         * Modules/mediasource/SourceBuffer.h:
1032         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
1033         (WebCore::MockMediaSourcePrivate::seekToTime):
1034         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1035         (WebCore::MockSourceBufferPrivate::enqueuedSamplesForTrackID):
1036         (WebCore::MockSourceBufferPrivate::enqueueSample):
1037         * platform/mock/mediasource/MockSourceBufferPrivate.h:
1038         * testing/Internals.cpp:
1039         (WebCore::Internals::enqueuedSamplesForTrackID):
1040         * testing/Internals.h:
1041         * testing/Internals.idl:
1042
1043 2016-09-22  Zalan Bujtas  <zalan@apple.com>
1044
1045         Replace redundant prepareForDestruction() call with RELEASE_ASSERT in Document::removedLastRef.
1046         https://bugs.webkit.org/show_bug.cgi?id=162467
1047
1048         Reviewed by Chris Dumez.
1049
1050         Since r205786 fixed the root cause of webkit.org/b/159372, we no longer need the workaround.
1051         Replace it with a RELEASE_ASSERT to ensure clean state.
1052
1053         No new tests, covered by existing test.
1054
1055         * dom/Document.cpp:
1056         (WebCore::Document::removedLastRef):
1057
1058 2016-09-23  Antoine Quint  <graouts@apple.com>
1059
1060         Add a new runtime flag for work on modern media controls (off by default)
1061         https://bugs.webkit.org/show_bug.cgi?id=162420
1062         <rdar://problem/27989489>
1063
1064         Reviewed by Eric Carlson.
1065
1066         * bindings/generic/RuntimeEnabledFeatures.h:
1067         (WebCore::RuntimeEnabledFeatures::setModernMediaControlsEnabled):
1068         (WebCore::RuntimeEnabledFeatures::modernMediaControlsEnabled):
1069
1070 2016-09-22  Chris Dumez  <cdumez@apple.com>
1071
1072         [ShadowDOM] Add support for Node.getRootNode(options)
1073         https://bugs.webkit.org/show_bug.cgi?id=162457
1074
1075         Reviewed by Ryosuke Niwa.
1076
1077         Add support for Node.getRootNode(options):
1078         - https://dom.spec.whatwg.org/#dom-node-getrootnode
1079
1080         No new tests, rebaselined existing tests.
1081
1082         * dom/EventPath.cpp:
1083         (WebCore::RelatedNodeRetargeter::RelatedNodeRetargeter):
1084         (WebCore::RelatedNodeRetargeter::checkConsistency):
1085         * dom/Node.cpp:
1086         (WebCore::Node::rootNode):
1087         (WebCore::Node::shadowIncludingRoot):
1088         (WebCore::Node::getRootNode):
1089         * dom/Node.h:
1090         * dom/Node.idl:
1091         * editing/Editor.cpp:
1092         (WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
1093         * xml/XPathPath.cpp:
1094         (WebCore::XPath::LocationPath::evaluate):
1095
1096 2016-09-22  Brady Eidson  <beidson@apple.com>
1097
1098         IDBIndex.openCursor() matches indices on multiple object stores.
1099         <rdar://problem/28434463> and https://bugs.webkit.org/show_bug.cgi?id=158833
1100
1101         Reviewed by Alex Christensen.
1102
1103         Tests: storage/indexeddb/modern/multiple-objectstore-index-cursor-collision-private.html
1104                storage/indexeddb/modern/multiple-objectstore-index-cursor-collision.html
1105
1106         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1107         (WebCore::IDBServer::buildIndexStatement): Need to include the object store id in the statement for
1108           index cursors, otherwise there will be collisions amongst multiple object stores that happen to
1109           share primary keys.
1110         (WebCore::IDBServer::SQLiteIDBCursor::bindArguments):
1111
1112 2016-09-22  Zalan Bujtas  <zalan@apple.com>
1113
1114         ShowRenderTree: Shuffle letters to have better readability.
1115         https://bugs.webkit.org/show_bug.cgi?id=162460
1116
1117         Reviewed by Simon Fraser.
1118         old: (B)lock/(I)nline/I(N)line-block, (R)elative/A(B)solute/Fi(X)ed/Stick(Y) positioned, (O)verflow clipping, (A)nonymous, (G)enerated, (F)loating, has(L)ayer, (C)omposited, (D)irty layout, Dirty (S)tyle.
1119         new: (B)lock/(I)nline/I(N)line-block, (A)bsolute/Fi(X)ed/(R)elative/Stic(K)y, (F)loating, (O)verflow clip, Anon(Y)mous, (G)enerated, has(L)ayer, (C)omposited, (+)Dirty style, (+)Dirty layout.
1120
1121         Not testable.
1122
1123         * rendering/RenderObject.cpp:
1124         (WebCore::showRenderTreeLegend):
1125         (WebCore::RenderObject::showRenderObject):
1126
1127 2016-09-22  Daniel Bates  <dabates@apple.com>
1128
1129         [CSP] Violation report may be sent to wrong domain on frame-ancestors violation
1130         https://bugs.webkit.org/show_bug.cgi?id=162079
1131         <rdar://problem/28321575>
1132
1133         Reviewed by Andy Estes.
1134
1135         Fixes an issue where a CSP violation report may be sent to the wrong domain when the
1136         frame-ancestors directive is violated. In particular, when the frame-ancestors directive
1137         is violated for a page that specifies a report URI that is a relative URL then the
1138         report URI would be resolved with respect to the parent frame's document URL and hence
1139         be sent to the domain of the parent frame's document.
1140
1141         * page/csp/ContentSecurityPolicy.cpp:
1142         (WebCore::ContentSecurityPolicy::reportViolation): Adjust the report URL with respect
1143         to the blocked URL when we do not have a script execution context.
1144
1145 2016-09-22  Daniel Bates  <dabates@apple.com>
1146
1147         [XSS Auditor] HTML5 entities can bypass XSS Auditor
1148         https://bugs.webkit.org/show_bug.cgi?id=161939
1149         <rdar://problem/25819815>
1150
1151         Reviewed by David Kilzer.
1152
1153         Merged from Blink:
1154         <https://chromium.googlesource.com/chromium/src/+/04e44060dccee711842d08652bf1c622a0f43179>
1155
1156         Truncate a src-like URL at the first & character as it may mark the start of an HTML entity.
1157         We will evaluate the effectiveness of this approach and adjust it if necessary if we see an
1158         increase in false positives.
1159
1160         HTML5 defines more named character references, including named character references for common
1161         punctuation characters. Characters following some punctuation characters may come from the page
1162         itself. We truncate src-like strings at punctuation characters to avoid considering such page
1163         content when performing a match.
1164
1165         Test: http/tests/security/xssAuditor/script-tag-with-source-data-url5.html
1166
1167         * html/parser/XSSAuditor.cpp:
1168         (WebCore::truncateForSrcLikeAttribute):
1169
1170 2016-09-22  Daniel Bates  <dabates@apple.com>
1171
1172         [XSS Auditor] Truncate data URLs at quotes
1173         https://bugs.webkit.org/show_bug.cgi?id=161937
1174
1175         Reviewed by David Kilzer.
1176
1177         Merged from Blink: 
1178         <https://chromium.googlesource.com/chromium/src/+/c6d6331190dd43f09459e2341c3111e796f9de12/>
1179
1180         Truncate a data URL at the first single or double quote character to avoid considering
1181         characters that may come from the page content following an injected data URL.
1182
1183         Test: http/tests/security/xssAuditor/script-tag-with-source-data-url4.html
1184
1185         * html/parser/XSSAuditor.cpp:
1186         (WebCore::truncateForSrcLikeAttribute):
1187
1188 2016-09-22  Daniel Bates  <dabates@apple.com>
1189
1190         Remove more ENABLE(TEXT_AUTOSIZING) code
1191         https://bugs.webkit.org/show_bug.cgi?id=162456
1192
1193         Reviewed by Simon Fraser.
1194
1195         * page/Settings.in:
1196         * rendering/style/StyleVisualData.h:
1197         (WebCore::StyleVisualData::operator==):
1198
1199 2016-09-22  Jer Noble  <jer.noble@apple.com>
1200
1201         Fullscreen controls inoperative in WebKitLegacy web views
1202         https://bugs.webkit.org/show_bug.cgi?id=162374
1203
1204         Reviewed by Eric Carlson.
1205
1206         After r205365, the WebPlaybackSessionInterfaceAVKit was now created after the
1207         WebPlaybackSessionModel which fed it data, so it no longer received the burst of data upon
1208         creation. Instead, it should have always asked the model for its cached data as soon as it
1209         was connected to set up its inital state.
1210
1211         * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
1212         (WebCore::WebPlaybackSessionInterfaceAVKit::WebPlaybackSessionInterfaceAVKit):
1213
1214 2016-09-22  Chris Dumez  <cdumez@apple.com>
1215
1216         Fix serialization of HTML void elements when they have children
1217         https://bugs.webkit.org/show_bug.cgi?id=162418
1218
1219         Reviewed by Darin Adler.
1220
1221         Fix serialization of HTML void elements when they have children.
1222
1223         Void elements (such as <hr>) cannot have a closing tag. When
1224         encountering them, we would properly not serialize the void
1225         element's children (if it had any). However, we would incorrectly
1226         append an end tag (because the element technically has children).
1227
1228         Relevant specification:
1229         - https://html.spec.whatwg.org/#html-fragment-serialisation-algorithm
1230
1231         In particular, this part:
1232         ""
1233         If current node is an area, base, basefont, bgsound, br, col, embed,
1234         frame, hr, img, input, keygen, link, meta, param, source, track or wbr
1235         element, then continue on to the next child node at this point.
1236         ""
1237
1238         Firefox matches the specification.
1239
1240         No new tests, rebaselined existing test.
1241
1242         * editing/MarkupAccumulator.cpp:
1243         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
1244
1245 2016-09-22  Don Olmstead  <don.olmstead@am.sony.com>
1246
1247         [WinCairo] Fix build after r206196
1248
1249         Reviewed by Alex Christensen.
1250
1251         * platform/text/win/LocaleWin.cpp:
1252         (WebCore::LocaleWin::getLocaleInfoString):
1253
1254 2016-09-22  Jonathan Bedard  <jbedard@apple.com>
1255
1256         Automatic Text Replacement Testing in WebKit2
1257         https://bugs.webkit.org/show_bug.cgi?id=161919
1258
1259         Reviewed by Ryosuke Niwa.
1260
1261         Fixing existing tests:
1262             editing/inserting/smart-link-when-caret-is-moved-before-URL.html
1263             editing/inserting/typing-space-to-trigger-smart-link.html
1264
1265         Implemented test hooks for text replacement for WebKit2.
1266         Note that spell checking has not been implemented, so most tests which use text replacement still fail.
1267
1268         * testing/Internals.cpp:
1269         (WebCore::Internals::Internals): Reset TextChecker.
1270         (WebCore::Internals::setContinuousSpellCheckingEnabled): Converted exception to an assert.
1271         (WebCore::Internals::setAutomaticQuoteSubstitutionEnabled): Converted exception to an assert.
1272         (WebCore::Internals::setAutomaticLinkDetectionEnabled): Converted exception to an assert.
1273         (WebCore::Internals::setAutomaticDashSubstitutionEnabled): Converted exception to an assert.
1274         (WebCore::Internals::setAutomaticTextReplacementEnabled): Converted exception to an assert.
1275         (WebCore::Internals::setAutomaticSpellingCorrectionEnabled): Converted exception to an assert.
1276         * testing/Internals.h: Removed exception argument for TextChecker setters.
1277         * testing/Internals.idl: Ditto.
1278
1279 2016-09-22  Nan Wang  <n_wang@apple.com>
1280
1281         AX: aria-pressed state not correctly conveyed to VoiceOver iOS on <button> unless role=button added
1282         https://bugs.webkit.org/show_bug.cgi?id=162269
1283
1284         Reviewed by Chris Fleizach.
1285
1286         <button> with aria-pressed attribute has a toggle button role, however, we were looking for explicit
1287         roles in order to convey the aria-press state. Since there's no spec requiring authors explicitly defining
1288         default ARIA semantics in such case, I'm exposing the aria-pressed state for all valid toggle buttons.
1289
1290         Changes are covered in modified test.
1291
1292         * accessibility/AccessibilityNodeObject.cpp:
1293         (WebCore::AccessibilityNodeObject::isPressed):
1294
1295 2016-09-22  Anders Carlsson  <andersca@apple.com>
1296
1297         Attempt to fix the open source iOS build.
1298
1299         * platform/spi/cocoa/PassKitSPI.h:
1300
1301 2016-09-22  Olivier Blin  <olivier.blin@softathome.com>
1302
1303         [GStreamer] Support a direct GPU-to-GPU copy of video textures to WebGL
1304         https://bugs.webkit.org/show_bug.cgi?id=159928
1305
1306         Reviewed by Carlos Garcia Campos.
1307
1308         Copy of GStreamer video frames to WebGL textures was not accelerated.
1309
1310         WebGLRenderingContextBase::texImage2D(HTMLVideoElement) went
1311         through a slow software paint() wrapping the video frame into
1312         cairo surface (ImageGStreamer), downloading it to draw to the
1313         image cache context, copying it again in software, and uploading
1314         it back to an OpenGL texture.
1315
1316         This patch implements copyVideoTextureToPlatformTexture() for
1317         the GStreamer media player backend, to do GPU-to-GPU copy, by
1318         extracting code from nativeImageForCurrentTime().
1319
1320         Doing this also fixes bug #159621: red and blue colors were
1321         swapped in video rendered through WebGL with GSTREAMER_GL enabled.
1322
1323         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1324         (WebCore::MediaPlayerPrivateGStreamerBase::prepareContextForCairoPaint):
1325         (WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface):
1326         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
1327         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
1328         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1329
1330 2016-09-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1331
1332         [GTK] Rename DataObjectGtk as SelectionData
1333         https://bugs.webkit.org/show_bug.cgi?id=162380
1334
1335         Reviewed by Žan Doberšek.
1336
1337         DataObjectGtk represents the data of a selection, like GtkSelectionData, used for clipboard and drag adn drop
1338         operations. Data object is a very generic name, and the Gtk suffix sounds like if this is the GTK implementation
1339         of a generic DataObject class.
1340
1341         * PlatformGTK.cmake:
1342         * editing/gtk/EditorGtk.cpp:
1343         (WebCore::createFragmentFromPasteboardData):
1344         * page/gtk/DragControllerGtk.cpp:
1345         * platform/DragData.h:
1346         * platform/Pasteboard.h:
1347         * platform/PasteboardStrategy.h:
1348         (WebCore::PasteboardStrategy::~PasteboardStrategy): Deleted.
1349         * platform/PlatformPasteboard.h:
1350         * platform/gtk/DragDataGtk.cpp:
1351         * platform/gtk/PasteboardGtk.cpp:
1352         (WebCore::Pasteboard::createPrivate):
1353         (WebCore::Pasteboard::createForDragAndDrop):
1354         (WebCore::Pasteboard::Pasteboard):
1355         (WebCore::Pasteboard::selectionData):
1356         (WebCore::selectionDataTypeFromHTMLClipboardType):
1357         (WebCore::Pasteboard::writeToClipboard):
1358         (WebCore::Pasteboard::readFromClipboard):
1359         (WebCore::Pasteboard::writeString):
1360         (WebCore::Pasteboard::writePlainText):
1361         (WebCore::Pasteboard::write):
1362         (WebCore::Pasteboard::writePasteboard):
1363         (WebCore::Pasteboard::clear):
1364         (WebCore::Pasteboard::canSmartReplace):
1365         (WebCore::Pasteboard::read):
1366         (WebCore::Pasteboard::hasData):
1367         (WebCore::Pasteboard::types):
1368         (WebCore::Pasteboard::readString):
1369         (WebCore::Pasteboard::readFilenames):
1370         * platform/gtk/PasteboardHelper.cpp:
1371         (WebCore::PasteboardHelper::getClipboardContents):
1372         (WebCore::PasteboardHelper::targetListForSelectionData):
1373         (WebCore::PasteboardHelper::fillSelectionData):
1374         (WebCore::ClipboardSetData::ClipboardSetData):
1375         (WebCore::getClipboardContentsCallback):
1376         (WebCore::PasteboardHelper::writeClipboardContents):
1377         (WebCore::clearClipboardContentsCallback): Deleted.
1378         * platform/gtk/PasteboardHelper.h:
1379         * platform/gtk/PlatformPasteboardGtk.cpp:
1380         (WebCore::PlatformPasteboard::writeToClipboard):
1381         (WebCore::PlatformPasteboard::readFromClipboard):
1382         * platform/gtk/SelectionData.cpp: Renamed from Source/WebCore/platform/gtk/DataObjectGtk.cpp.
1383         (WebCore::SelectionData::setText):
1384         (WebCore::SelectionData::setURIList):
1385         (WebCore::SelectionData::setURL):
1386         (WebCore::SelectionData::urlLabel):
1387         (WebCore::SelectionData::clearAllExceptFilenames):
1388         (WebCore::SelectionData::clearAll):
1389         * platform/gtk/SelectionData.h: Renamed from Source/WebCore/platform/gtk/DataObjectGtk.h.
1390         (WebCore::SelectionData::create):
1391         (WebCore::SelectionData::text):
1392         (WebCore::SelectionData::hasText):
1393         (WebCore::SelectionData::clearText):
1394         (WebCore::SelectionData::setMarkup):
1395         (WebCore::SelectionData::markup):
1396         (WebCore::SelectionData::hasMarkup):
1397         (WebCore::SelectionData::clearMarkup):
1398         (WebCore::SelectionData::hasURL):
1399         (WebCore::SelectionData::clearURL):
1400         (WebCore::SelectionData::filenames):
1401         (WebCore::SelectionData::hasURIList):
1402         (WebCore::SelectionData::hasFilenames):
1403         (WebCore::SelectionData::setImage):
1404         (WebCore::SelectionData::image):
1405         (WebCore::SelectionData::hasImage):
1406         (WebCore::SelectionData::unknownTypeData):
1407         (WebCore::SelectionData::unknownTypes):
1408         (WebCore::SelectionData::hasUnknownTypeData):
1409         (WebCore::SelectionData::canSmartReplace):
1410         (WebCore::SelectionData::url): Deleted.
1411         (WebCore::SelectionData::uriList): Deleted.
1412         (WebCore::SelectionData::clearURIList): Deleted.
1413         (WebCore::SelectionData::clearImage): Deleted.
1414         (WebCore::SelectionData::setUnknownTypeData): Deleted.
1415
1416 2016-09-22  Youenn Fablet  <youenn@apple.com>
1417
1418         CachedResourceRequest should store a SecurityOrigin
1419         https://bugs.webkit.org/show_bug.cgi?id=162258
1420
1421         Reviewed by Sam Weinig.
1422
1423         Test: http/tests/local/script-crossorigin-loads-file-scheme.html
1424
1425         Passing SecurityOrigin from loader clients to CachedResource through CachedResourceRequest.
1426         This ensures that specific origin properties like universal access are well preserved.
1427
1428         * loader/DocumentThreadableLoader.cpp:
1429         (WebCore::DocumentThreadableLoader::loadRequest): Set origin to the request.
1430         * loader/cache/CachedResource.cpp:
1431         (WebCore::CachedResource::CachedResource): Setting origin from the request.
1432         Computing CORS state based on that origin.
1433         (WebCore::CachedResource::load): Removing origin computation.
1434         (WebCore::CachedResource::loadFrom): Ditto.
1435         (WebCore::CachedResource::computeOrigin): Deleted.
1436         * loader/cache/CachedResource.h:
1437         * loader/cache/CachedResourceLoader.cpp:
1438         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
1439         (WebCore::CachedResourceLoader::prepareFetch): Introduced to implement step 1 to 7 of https://fetch.spec.whatwg.org/#fetching.
1440         (WebCore::CachedResourceLoader::requestResource):
1441         * loader/cache/CachedResourceLoader.h:
1442         * loader/cache/CachedResourceRequest.cpp:
1443         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin): Storing origin.
1444         * loader/cache/CachedResourceRequest.h:
1445         (WebCore::CachedResourceRequest::setOrigin):
1446         (WebCore::CachedResourceRequest::releaseOrigin):
1447         (WebCore::CachedResourceRequest::origin):
1448
1449 2016-09-22  Youenn Fablet  <youenn@apple.com>
1450
1451         Refactor ContentSecurityPolicy::allow* methods
1452         https://bugs.webkit.org/show_bug.cgi?id=162335
1453
1454         Reviewed by Darin Adler.
1455
1456         No change of behavior.
1457
1458         Removing the second parameter of ContentSecurityPolicy::allow* methods.
1459         When true, this parameter makes the methods return true.
1460         This patch updates the callers of allow* methods to check for the parameter before making the call.
1461
1462         Made some refactoring to share more code between the various allow* methods.
1463
1464         * Modules/fetch/FetchLoader.cpp:
1465         (WebCore::FetchLoader::start):
1466         * Modules/websockets/WebSocket.cpp:
1467         (WebCore::WebSocket::connect):
1468         * html/HTMLMediaElement.cpp:
1469         (WebCore::HTMLMediaElement::isSafeToLoadURL):
1470         (WebCore::HTMLMediaElement::outOfBandTrackSources):
1471         * html/HTMLPlugInImageElement.cpp:
1472         (WebCore::HTMLPlugInImageElement::allowedToLoadPluginContent):
1473         * html/HTMLTrackElement.cpp:
1474         (WebCore::HTMLTrackElement::canLoadURL):
1475         * loader/DocumentThreadableLoader.cpp:
1476         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1477         (WebCore::DocumentThreadableLoader::redirectReceived):
1478         (WebCore::DocumentThreadableLoader::loadRequest):
1479         (WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy):
1480         * loader/DocumentThreadableLoader.h:
1481         * loader/FrameLoader.cpp:
1482         (WebCore::FrameLoader::checkIfFormActionAllowedByCSP):
1483         * loader/PolicyChecker.cpp:
1484         (WebCore::isAllowedByContentSecurityPolicy):
1485         * loader/SubframeLoader.cpp:
1486         (WebCore::SubframeLoader::createJavaAppletWidget):
1487         * loader/cache/CachedResourceLoader.cpp:
1488         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
1489         * page/EventSource.cpp:
1490         (WebCore::EventSource::create):
1491         * page/csp/ContentSecurityPolicy.cpp:
1492         (WebCore::ContentSecurityPolicy::allowObjectFromSource):
1493         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource):
1494         (WebCore::ContentSecurityPolicy::allowResourceFromSource):
1495         (WebCore::ContentSecurityPolicy::allowChildContextFromSource):
1496         (WebCore::ContentSecurityPolicy::allowScriptFromSource):
1497         (WebCore::ContentSecurityPolicy::allowImageFromSource):
1498         (WebCore::ContentSecurityPolicy::allowStyleFromSource):
1499         (WebCore::ContentSecurityPolicy::allowFontFromSource):
1500         (WebCore::ContentSecurityPolicy::allowMediaFromSource):
1501         (WebCore::ContentSecurityPolicy::allowConnectToSource):
1502         (WebCore::ContentSecurityPolicy::allowFormAction):
1503         * page/csp/ContentSecurityPolicy.h:
1504         * workers/AbstractWorker.cpp:
1505         (WebCore::AbstractWorker::resolveURL):
1506         * workers/WorkerGlobalScope.cpp:
1507         (WebCore::WorkerGlobalScope::importScripts):
1508         * xml/XMLHttpRequest.cpp:
1509         (WebCore::XMLHttpRequest::initSend):
1510
1511 2016-09-19  Sergio Villar Senin  <svillar@igalia.com>
1512
1513         [css-grid] Remove the x2 computation of row sizes with indefinite heights
1514         https://bugs.webkit.org/show_bug.cgi?id=162150
1515
1516         Reviewed by Darin Adler.
1517
1518         On r192154, among other things, we added a second pass of the track sizing algorithm for
1519         rows in order to properly compute row sizes when the height was indefinite. We did that in
1520         order to have a symmetrical implementation for columns and rows, but unfortunatelly that was
1521         not correct.
1522
1523         Apart from issuing incorrect results in some cases it created a huge performance issue in
1524         the case of having nested grids because we were exponentially increasing the amount of
1525         executions of the track sizing algorithm. The attached performance test shows a 200%
1526         improvement with the patch (26 vs 80 runs/s).
1527
1528         Test: fast/css-grid-layout/nested-grid.html
1529
1530         * rendering/RenderGrid.cpp:
1531         (WebCore::RenderGrid::layoutBlock):
1532         (WebCore::RenderGrid::computeIntrinsicLogicalHeight):
1533         (WebCore::RenderGrid::layoutGridItems):
1534
1535 2016-09-22  Youenn Fablet  <youenn@apple.com>
1536
1537         Improve DeferredWrapper code
1538         https://bugs.webkit.org/show_bug.cgi?id=161787
1539
1540         Reviewed by Darin Adler.
1541
1542         No change of behavior.
1543
1544         Renaming DeferredWrapper to DeferredPromise.
1545         Adding create method that creates the underlying JSC::JSPromiseDeferred in non-worker environments.
1546         Updated create method to take references.
1547         Introducing domWindow helper accessor into JSDOMObject to ease creation of promise in non-worker environments.
1548         Doing some minor clean up (renaming of m_wrapper to m_promiseDeferred, accessor change).
1549
1550         * Modules/applepay/ApplePaySession.cpp:
1551         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
1552         * Modules/applepay/ApplePaySession.h:
1553         * Modules/fetch/DOMWindowFetch.cpp:
1554         (WebCore::DOMWindowFetch::fetch):
1555         * Modules/fetch/DOMWindowFetch.h: Updated to take a DeferredPromise to make it consistent with WorkerGlobalScopeFetch.
1556         * Modules/fetch/FetchBody.cpp:
1557         (WebCore::FetchBody::arrayBuffer):
1558         (WebCore::FetchBody::blob):
1559         (WebCore::FetchBody::json):
1560         (WebCore::FetchBody::text):
1561         (WebCore::FetchBody::consume):
1562         (WebCore::FetchBody::consumeArrayBuffer):
1563         (WebCore::FetchBody::consumeArrayBufferView):
1564         (WebCore::FetchBody::consumeText):
1565         (WebCore::FetchBody::consumeBlob):
1566         * Modules/fetch/FetchBody.h:
1567         (WebCore::FetchBody::formData):
1568         * Modules/fetch/FetchBodyConsumer.cpp:
1569         (WebCore::FetchBodyConsumer::resolveWithData):
1570         (WebCore::FetchBodyConsumer::resolve):
1571         * Modules/fetch/FetchBodyConsumer.h:
1572         * Modules/fetch/FetchBodyOwner.cpp:
1573         (WebCore::FetchBodyOwner::arrayBuffer):
1574         (WebCore::FetchBodyOwner::blob):
1575         (WebCore::FetchBodyOwner::formData):
1576         (WebCore::FetchBodyOwner::json):
1577         (WebCore::FetchBodyOwner::text):
1578         * Modules/fetch/FetchBodyOwner.h:
1579         * Modules/fetch/FetchResponse.cpp:
1580         (WebCore::FetchResponse::consume):
1581         (WebCore::FetchResponse::finishConsumingStream):
1582         * Modules/fetch/FetchResponse.h:
1583         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
1584         (WebCore::WorkerGlobalScopeFetch::fetch):
1585         * Modules/fetch/WorkerGlobalScopeFetch.h:
1586         * bindings/js/JSCustomElementRegistryCustom.cpp:
1587         (WebCore::whenDefinedPromise):
1588         (WebCore::JSCustomElementRegistry::whenDefined):
1589         * bindings/js/JSDOMGlobalObject.cpp:
1590         (WebCore::JSDOMGlobalObject::visitChildren):
1591         * bindings/js/JSDOMGlobalObject.h:
1592         * bindings/js/JSDOMPromise.cpp:
1593         (WebCore::DOMDeferredPromise::DOMDeferredPromise):
1594         (WebCore::DOMDeferredPromise::~DOMDeferredPromise):
1595         (WebCore::DOMDeferredPromise::clear):
1596         (WebCore::DOMDeferredPromise::contextDestroyed):
1597         (WebCore::DOMDeferredPromise::promise):
1598         (WebCore::DOMDeferredPromise::callFunction):
1599         (WebCore::DOMDeferredPromise::reject):
1600         (WebCore::rejectPromiseWithExceptionIfAny):
1601         (WebCore::fulfillPromiseWithJSON):
1602         (WebCore::fulfillPromiseWithArrayBuffer):
1603         (WebCore::DeferredWrapper::DeferredWrapper): Deleted.
1604         (WebCore::DeferredWrapper::~DeferredWrapper): Deleted.
1605         (WebCore::DeferredWrapper::clear): Deleted.
1606         (WebCore::DeferredWrapper::contextDestroyed): Deleted.
1607         (WebCore::DeferredWrapper::promise): Deleted.
1608         (WebCore::DeferredWrapper::callFunction): Deleted.
1609         (WebCore::DeferredWrapper::reject): Deleted.
1610         * bindings/js/JSDOMPromise.h:
1611         (WebCore::DOMDeferredPromise::create):
1612         (WebCore::callPromiseFunction):
1613         (WebCore::DOMPromise::DOMPromise):
1614         (WebCore::DOMPromise::deferredPromise):
1615         (WebCore::DOMDeferredPromise::resolveWithValue):
1616         (WebCore::DOMDeferredPromise::resolveWithNewlyCreated):
1617         (WebCore::DOMDeferredPromise::rejectWithValue):
1618         (WebCore::DOMDeferredPromise::resolve):
1619         (WebCore::DOMDeferredPromise::reject):
1620         (WebCore::DeferredWrapper::create): Deleted.
1621         (WebCore::DOMPromise::deferredWrapper): Deleted.
1622         (WebCore::DeferredWrapper::resolveWithValue): Deleted.
1623         (WebCore::DeferredWrapper::resolveWithNewlyCreated): Deleted.
1624         (WebCore::DeferredWrapper::rejectWithValue): Deleted.
1625         (WebCore::DeferredWrapper::resolve): Deleted.
1626         (WebCore::DeferredWrapper::reject): Deleted.
1627         * bindings/js/JSDOMWrapper.cpp: Introducing domWindow() accessor.
1628         * bindings/js/JSDOMWrapper.h:
1629         * bindings/js/JSFontFaceCustom.cpp:
1630         (WebCore::JSFontFace::loaded):
1631         * bindings/js/JSFontFaceSetCustom.cpp:
1632         (WebCore::JSFontFaceSet::ready):
1633         * bindings/js/JSMediaDevicesCustom.cpp:
1634         (WebCore::JSMediaDevices::getUserMedia):
1635         * bindings/js/JSMediaStreamTrackCustom.cpp:
1636         (WebCore::JSMediaStreamTrack::applyConstraints):
1637         * bindings/js/JSReadableStreamSourceCustom.cpp:
1638         (WebCore::JSReadableStreamSource::start):
1639         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
1640         (WebCore::JSWebKitSubtleCrypto::encrypt):
1641         (WebCore::JSWebKitSubtleCrypto::decrypt):
1642         (WebCore::JSWebKitSubtleCrypto::sign):
1643         (WebCore::JSWebKitSubtleCrypto::verify):
1644         (WebCore::JSWebKitSubtleCrypto::digest):
1645         (WebCore::JSWebKitSubtleCrypto::generateKey):
1646         (WebCore::JSWebKitSubtleCrypto::importKey):
1647         (WebCore::JSWebKitSubtleCrypto::exportKey):
1648         (WebCore::JSWebKitSubtleCrypto::wrapKey):
1649         (WebCore::JSWebKitSubtleCrypto::unwrapKey):
1650         * bindings/scripts/CodeGeneratorJS.pm:
1651         (GenerateImplementation):
1652         (GenerateReturnParameters):
1653         * bindings/scripts/test/JS/JSTestObj.cpp:
1654         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
1655         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
1656         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
1657         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
1658         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
1659         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
1660         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
1661         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
1662         * dom/CustomElementRegistry.h:
1663         (WebCore::CustomElementRegistry::promiseMap):
1664
1665 2016-09-21  Alexey Proskuryakov  <ap@apple.com>
1666
1667         Rolling out r206244, as it caused flaky crashes on tests.
1668         Was: Correct uses of 'safeCast'
1669
1670         * loader/cache/MemoryCache.cpp:
1671         (WebCore::MemoryCache::adjustSize):
1672         * platform/graphics/BitmapImage.cpp:
1673         (WebCore::BitmapImage::destroyMetadataAndNotify):
1674         (WebCore::BitmapImage::cacheFrame):
1675         (WebCore::BitmapImage::didDecodeProperties):
1676         (WebCore::BitmapImage::dataChanged):
1677         (WebCore::BitmapImage::frameImageAtIndex):
1678         * platform/graphics/cg/PDFDocumentImage.cpp:
1679         (WebCore::PDFDocumentImage::decodedSizeChanged):
1680         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
1681
1682 2016-09-21  Chris Dumez  <cdumez@apple.com>
1683
1684         Fix serialization of bgsound, keygen and track elements
1685         https://bugs.webkit.org/show_bug.cgi?id=162353
1686
1687         Reviewed by Darin Adler.
1688
1689         Fix serialization of keygen and track elements to match the specification:
1690         - https://html.spec.whatwg.org/#serialising-html-fragments
1691
1692         They are not supposed to have an end tag. Firefox and Chrome agree with
1693         the specification.
1694
1695         No new tests, rebaselined existing tests.
1696
1697         * editing/MarkupAccumulator.cpp:
1698         (WebCore::MarkupAccumulator::elementCannotHaveEndTag):
1699
1700 2016-09-21  Keith Miller  <keith_miller@apple.com>
1701
1702         Fix build for future versions of Clang.
1703         https://bugs.webkit.org/show_bug.cgi?id=162346
1704
1705         Reviewed by Filip Pizlo.
1706
1707         This fixes issues with the WebCore build where inline
1708         template-class function definitions are marked as exported. This
1709         genereates a weak external symobl that our build does not like.
1710
1711         * Configurations/WebCore.unexp:
1712         * dom/Exception.h:
1713         * page/Frame.h:
1714         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
1715         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
1716         (WebCore::WebVideoFullscreenModelVideoElement::videoElement):
1717         * platform/graphics/Color.h:
1718         * platform/graphics/transforms/TransformationMatrix.h:
1719         (WebCore::TransformationMatrix::rotate):
1720         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1721         * platform/network/ParsedContentRange.h:
1722         (WebCore::ParsedContentRange::ParsedContentRange):
1723         (WebCore::ParsedContentRange::isValid):
1724         * platform/network/ResourceResponseBase.h:
1725         (WebCore::ResourceResponseBase::certificateInfo):
1726         * platform/text/TextStream.h:
1727         (WebCore::TextStream::increaseIndent):
1728         (WebCore::TextStream::decreaseIndent):
1729
1730 2016-09-20  Brent Fulgham  <bfulgham@apple.com>
1731
1732         Correct uses of 'safeCast'
1733         https://bugs.webkit.org/show_bug.cgi?id=162301
1734         <rdar://problem/28343658>
1735
1736         Reviewed by Antti Koivisto.
1737
1738         A number of integer calculations in BitmapImage and PDFDocumentImage
1739         are not properly checked for overflow. Correct this.
1740
1741         Tested by fast/images/large-size-image-crash.html
1742
1743         * loader/cache/MemoryCache.cpp:
1744         (WebCore::MemoryCache::adjustSize): RELEASE_ASSERT on overflow.
1745         * platform/graphics/BitmapImage.cpp:
1746         (WebCore::BitmapImage::destroyMetadataAndNotify):
1747         (WebCore::BitmapImage::cacheFrame):
1748         (WebCore::BitmapImage::didDecodeProperties):
1749         (WebCore::BitmapImage::dataChanged):
1750         (WebCore::BitmapImage::ensureFrameAtIndexIsCached):
1751         (WebCore::BitmapImage::frameImageAtIndex):
1752         * platform/graphics/BitmapImage.h:
1753         * platform/graphics/cg/PDFDocumentImage.cpp:
1754         (WebCore::PDFDocumentImage::decodedSizeChanged):
1755         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
1756
1757 2016-09-21  Chris Dumez  <cdumez@apple.com>
1758
1759         Setting HTMLMeterElement's attributes to non-finite values throws wrong exception type
1760         https://bugs.webkit.org/show_bug.cgi?id=162364
1761
1762         Reviewed by Darin Adler.
1763
1764         Setting HTMLMeterElement's attributes to non-finite values throws wrong exception type.
1765         It should throw a TypeError because their type is 'double' but we throw a
1766         NOT_SUPPORTED_ERR.
1767
1768         Specification:
1769         - https://html.spec.whatwg.org/#htmlmeterelement
1770
1771         Firefox and Chrome agree with the specification.
1772
1773         No new tests, updated existing test.
1774
1775         * html/HTMLMeterElement.cpp:
1776         (WebCore::HTMLMeterElement::setMin):
1777         (WebCore::HTMLMeterElement::setMax):
1778         (WebCore::HTMLMeterElement::setValue):
1779         (WebCore::HTMLMeterElement::setLow):
1780         (WebCore::HTMLMeterElement::setHigh):
1781         (WebCore::HTMLMeterElement::setOptimum):
1782         * html/HTMLMeterElement.h:
1783         * html/HTMLMeterElement.idl:
1784
1785 2016-09-21  Anders Carlsson  <andersca@apple.com>
1786
1787         Fix open source build.
1788
1789         * platform/spi/cocoa/PassKitSPI.h:
1790
1791 2016-09-21  Chris Dumez  <cdumez@apple.com>
1792
1793         Fix serialization of HTML Element attributes
1794         https://bugs.webkit.org/show_bug.cgi?id=162356
1795
1796         Reviewed by Alex Christensen.
1797
1798         Fix serialization of HTML Element attributes to align with:
1799         - https://html.spec.whatwg.org/#html-fragment-serialisation-algorithm
1800         - https://html.spec.whatwg.org/#escapingString
1801
1802         In particular, we should not escape '<' and '>'.
1803
1804         Firefox and Chrome both match the specification.
1805
1806         Note that we keep escaping '<' and '>' for Element attributes in the
1807         context of XML serialization, as per:
1808         - https://w3c.github.io/DOM-Parsing/#dfn-serializing-an-attribute-value
1809
1810         No new tests, rebaselined existing test.
1811
1812         * editing/MarkupAccumulator.h:
1813
1814 2016-09-21  Anders Carlsson  <andersca@apple.com>
1815
1816         support openPaymentSetup API on ApplePaySession object
1817         https://bugs.webkit.org/show_bug.cgi?id=162357
1818         rdar://problem/26776939
1819
1820         Reviewed by Tim Horton.
1821
1822         * Modules/applepay/ApplePaySession.cpp:
1823         (WebCore::ApplePaySession::openPaymentSetup):
1824         Perform security checks and then call into the PaymentCoordinator. In its completion handler, we resolve the promise.
1825
1826         * Modules/applepay/ApplePaySession.h:
1827         Add new members.
1828
1829         * Modules/applepay/ApplePaySession.idl:
1830         Add openPaymentSetup declaration.
1831
1832         * Modules/applepay/PaymentCoordinator.cpp:
1833         (WebCore::PaymentCoordinator::openPaymentSetup):
1834         Call through to the clients.
1835
1836         * Modules/applepay/PaymentCoordinator.h:
1837         * Modules/applepay/PaymentCoordinatorClient.h:
1838         Add new members.
1839
1840         * loader/EmptyClients.cpp:
1841         Add new stub.
1842
1843         * platform/spi/cocoa/PassKitSPI.h:
1844         Add SPI declaration.
1845
1846 2016-09-21  Commit Queue  <commit-queue@webkit.org>
1847
1848         Unreviewed, rolling out r206222 and r206227.
1849         https://bugs.webkit.org/show_bug.cgi?id=162361
1850
1851         "broke the windows build" (Requested by keith_mi_ on #webkit).
1852
1853         Reverted changesets:
1854
1855         "Fix build for future versions of Clang."
1856         https://bugs.webkit.org/show_bug.cgi?id=162346
1857         http://trac.webkit.org/changeset/206222
1858
1859         "Attempt to fix windows build after r206222."
1860         http://trac.webkit.org/changeset/206227
1861
1862 2016-09-21  Alex Christensen  <achristensen@webkit.org>
1863
1864         URLParser should match URL::parse when parsing data urls with slashes in them
1865         https://bugs.webkit.org/show_bug.cgi?id=162352
1866
1867         Reviewed by Darin Adler.
1868
1869         Covered by new API tests.
1870
1871         * platform/URLParser.cpp:
1872         (WebCore::URLParser::parse):
1873
1874 2016-09-21  Per Arne Vollan  <pvollan@apple.com>
1875
1876         [Win] Null pointer crash under WebCore::CACFLayerTreeHost::create().
1877         https://bugs.webkit.org/show_bug.cgi?id=162266
1878         <rdar://problem/28345073>
1879
1880         Reviewed by Brent Fulgham.
1881
1882         Add null pointer check.
1883
1884         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1885         (WebCore::CACFLayerTreeHost::create):
1886
1887 2016-09-21  Chris Dumez  <cdumez@apple.com>
1888
1889         Fix enumeration of properties cross origin
1890         https://bugs.webkit.org/show_bug.cgi?id=162328
1891
1892         Reviewed by Darin Adler.
1893
1894         All cross origin properties for Window / Location are supposed to be not enumerable:
1895         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
1896
1897         Therefore, there should be no properties to iterate on for cross origin Window /
1898         Location objects.
1899
1900         No new tests, rebaselined existing test.
1901
1902         * bindings/js/JSDOMWindowCustom.cpp:
1903         (WebCore::JSDOMWindow::getOwnPropertyNames):
1904         * bindings/js/JSLocationCustom.cpp:
1905         (WebCore::JSLocation::getOwnPropertyNames):
1906
1907 2016-09-21  Alex Christensen  <achristensen@webkit.org>
1908
1909         URLParser should fail when parsing invalid relative URLs with no schemes
1910         https://bugs.webkit.org/show_bug.cgi?id=162355
1911
1912         Reviewed by Tim Horton.
1913
1914         Covered by new API tests.
1915
1916         * platform/URLParser.cpp:
1917         (WebCore::copyASCIIStringUntil):
1918         When copying from a null String, is8Bit dereferences a null pointer.  We don't want to do that.
1919         (WebCore::URLParser::parse):
1920         What the spec calls a "null" URL matches !url.isValid(), not url.isNull().
1921         The former reflects whether the parsing succeeded, 
1922         the latter whether the contained String (which could be an invalid URL) is null.
1923
1924 2016-09-21  Antti Koivisto  <antti@apple.com>
1925
1926         Document::styleResolverChanged simplification
1927         https://bugs.webkit.org/show_bug.cgi?id=162347
1928
1929         Reviewed by Anders Carlsson.
1930
1931         * dom/Document.cpp:
1932         (WebCore::Document::implicitClose):
1933         (WebCore::Document::setParsing):
1934         (WebCore::Document::write):
1935         (WebCore::Document::styleResolverChanged):
1936
1937             - Remove unncessary AnimationUpdateBlock, it is created by recalcStyle.
1938             - Remove explicit setNeedsLayoutAndPrefWidthsRecalc/scheduleRelayout calls, style resolution
1939               invalidates those as needed.
1940             - Remove evaluateMediaQueryList call, that is done on layout as needed.
1941             - Remove the ancient INSTRUMENT_LAYOUT_SCHEDULING and the related printfs.
1942
1943 2016-09-21  Keith Miller  <keith_miller@apple.com>
1944
1945         Attempt to fix windows build after r206222.
1946
1947         * page/MainFrame.h:
1948         (WebCore::Frame::isMainFrame):
1949
1950 2016-09-21  Keith Rollin  <krollin@apple.com>
1951
1952         New DocumentLoader logging causes crashes
1953         https://bugs.webkit.org/show_bug.cgi?id=162348
1954         <rdar://problem/28404744>
1955
1956         Reviewed by Chris Dumez
1957
1958         Check for NULL m_frame before using it.
1959
1960         No new tests -- no tests for logging, though this issue was found by
1961         contentfiltering/block-after-will-send-request-then-allow-unblock.html
1962
1963         * loader/DocumentLoader.cpp:
1964         (WebCore::DocumentLoader::startLoadingMainResource):
1965
1966 2016-09-21  Alex Christensen  <achristensen@webkit.org>
1967
1968         Optimize URLParser
1969         https://bugs.webkit.org/show_bug.cgi?id=162338
1970
1971         Reviewed by Tim Horton.
1972
1973         No change in behavior. Just a marginal performance improvement.
1974
1975         * platform/URLParser.cpp:
1976         (WebCore::isValidSchemeCharacter):
1977         Added to reduce branches when parsing the scheme of a URL.  Now there is a table lookup instead of many range checks.
1978         (WebCore::URLParser::parse):
1979         Use appendVector, which uses memcpy.
1980         (WebCore::URLParser::parseHostAndPort):
1981         If we know that we are parsing the serialized output of a valid URL, 
1982         we do not need to convert host characters to lower case.
1983         They are already lower case.
1984
1985 2016-09-21  Keith Miller  <keith_miller@apple.com>
1986
1987         Fix build for future versions of Clang.
1988         https://bugs.webkit.org/show_bug.cgi?id=162346
1989
1990         Reviewed by Filip Pizlo.
1991
1992         This fixes issues with the WebCore build where inline
1993         template-class function definitions are marked as exported. This
1994         genereates a weak external symobl that our build does not like.
1995
1996         * Configurations/WebCore.unexp:
1997         * dom/Exception.h:
1998         * page/Frame.h:
1999         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
2000         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
2001         (WebCore::WebVideoFullscreenModelVideoElement::videoElement):
2002         * platform/graphics/Color.h:
2003         * platform/graphics/transforms/TransformationMatrix.h:
2004         (WebCore::TransformationMatrix::rotate):
2005         * platform/mac/WebVideoFullscreenInterfaceMac.h:
2006         * platform/network/ParsedContentRange.h:
2007         (WebCore::ParsedContentRange::ParsedContentRange):
2008         (WebCore::ParsedContentRange::isValid):
2009         * platform/network/ResourceResponseBase.h:
2010         (WebCore::ResourceResponseBase::certificateInfo):
2011         * platform/text/TextStream.h:
2012         (WebCore::TextStream::increaseIndent):
2013         (WebCore::TextStream::decreaseIndent):
2014
2015 2016-09-21  Chris Dumez  <cdumez@apple.com>
2016
2017         Object.getOwnPropertyDescriptor() does not work correctly cross origin
2018         https://bugs.webkit.org/show_bug.cgi?id=162311
2019
2020         Reviewed by Gavin Barraclough.
2021
2022         Object.getOwnPropertyDescriptor() does not work correctly cross origin. In particular:
2023         - We return value descriptors for attributes instead of getter/setter descriptors
2024         - attributes / operations are wrongly marked as non-configurable
2025
2026         Corresponding specification:
2027         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
2028         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
2029
2030         Test: http/tests/security/cross-origin-descriptors.html
2031
2032         * bindings/js/JSDOMWindowCustom.cpp:
2033         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2034         * bindings/js/JSLocationCustom.cpp:
2035         (WebCore::JSLocation::getOwnPropertySlotDelegate):
2036
2037 2016-09-21  Alex Christensen  <achristensen@webkit.org>
2038
2039         URLParser: Correctly parse URLs that are just nonspecialscheme:/
2040         https://bugs.webkit.org/show_bug.cgi?id=162340
2041
2042         Reviewed by Tim Horton.
2043
2044         Covered by new API tests.
2045
2046         * platform/URLParser.cpp:
2047         (WebCore::URLParser::parse):
2048         r206162 wasn't quite right.  If a url is just nonspecialscheme:/ then the path should indeed be /
2049
2050 2016-09-21  Alex Christensen  <achristensen@webkit.org>
2051
2052         URLParser: correctly parse relative URLs that are just one character
2053         https://bugs.webkit.org/show_bug.cgi?id=162344
2054
2055         Reviewed by Tim Horton.
2056
2057         Covered by new API tests.
2058
2059         * platform/URLParser.cpp:
2060         (WebCore::URLParser::parse):
2061
2062 2016-09-21  Daniel Bates  <dabates@apple.com>
2063
2064         REGRESSION (r201090): Setting style.webkitTextSizeAdjust does not change text change on iPad
2065         https://bugs.webkit.org/show_bug.cgi?id=162227
2066         <rdar://problem/27201529>
2067
2068         Reviewed by Simon Fraser.
2069
2070         The CSS property -webkit-text-size-adjust should be respected on all iOS devices. Following
2071         r201090 we respect it only on iPhone and in iPhone-apps run on iPad.
2072
2073         Tests: fast/text-autosizing/ios/ipad/programmatic-text-size-adjust.html
2074                fast/text-autosizing/ios/ipad/text-size-adjust-inline-style.html
2075                fast/text-autosizing/ios/programmatic-text-size-adjust.html
2076                fast/text-autosizing/ios/text-size-adjust-inline-style.html
2077                fast/text-autosizing/text-size-adjust-inline-style.html
2078
2079         * css/parser/CSSParser.cpp:
2080         (WebCore::isValidKeywordPropertyAndValue): Remove unused code to validate -webkit-text-size-adjust.
2081         This code is never used because -webkit-text-size-adjust is a value property (since it accepts a
2082         <percentage> as a value and CSSParserFastPaths::isKeywordPropertyID(CSSPropertyWebkitTextSizeAdjust)
2083         returns false). That is, it is not a keyword property.
2084         (WebCore::CSSParser::parseValue): Always enable the -webkit-text-size-adjust CSS property when
2085         building for iOS regardless of whether Settings:textAutosizingEnabled() is enabled.
2086
2087 2016-09-21  Miguel Gomez  <magomez@igalia.com>
2088
2089         [GTK] Build fails with GSTREAMER_GL enabled
2090         https://bugs.webkit.org/show_bug.cgi?id=162337
2091
2092         Reviewed by Michael Catanzaro.
2093
2094         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2095         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Remove uneeded const.
2096
2097 2016-09-21  Jer Noble  <jer.noble@apple.com>
2098
2099         REGRESSION(r206127): ASSERTION FAILED: !isClosed() in WebCore::MediaSource::detachFromElement
2100         https://bugs.webkit.org/show_bug.cgi?id=162307
2101
2102         Reviewed by Eric Carlson.
2103
2104         The test is crashing when the ScriptExecutionContext is calling stop() on the media element before
2105         it's attached MediaSource has been open()ed, which is a valid state. Removing this ASSERT().
2106
2107         * Modules/mediasource/MediaSource.cpp:
2108         (WebCore::MediaSource::detachFromElement):
2109
2110 2016-09-19  Jer Noble  <jer.noble@apple.com>
2111
2112         [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-activesourcebuffers.html
2113         https://bugs.webkit.org/show_bug.cgi?id=162257
2114
2115         Reviewed by Eric Carlson.
2116
2117         Some of the conditions in the track changed methods were reversed, and all failed to schedule
2118         a change event.
2119
2120         * Modules/mediasource/SourceBuffer.cpp:
2121         (WebCore::SourceBuffer::videoTrackSelectedChanged):
2122         (WebCore::SourceBuffer::audioTrackEnabledChanged):
2123         (WebCore::SourceBuffer::textTrackModeChanged):
2124
2125 2016-09-20  Jer Noble  <jer.noble@apple.com>
2126
2127         [media-source] Fix imported/w3c/web-platform-tests/media-source/URL-createObjectURL-null.html
2128         https://bugs.webkit.org/show_bug.cgi?id=162299
2129
2130         Reviewed by Eric Carlson.
2131
2132         URL.createObjectURL() should not take an optional parameter (nor return an optional String). 
2133         (Ref: https://w3c.github.io/FileAPI/#dfn-createObjectURL)
2134
2135         * Modules/mediasource/DOMURLMediaSource.cpp:
2136         (WebCore::DOMURLMediaSource::createObjectURL):
2137         * Modules/mediasource/DOMURLMediaSource.h:
2138         * Modules/mediasource/DOMURLMediaSource.idl:
2139         * Modules/mediasource/MediaSourceRegistry.cpp:
2140         (WebCore::MediaSourceRegistry::registerURL):
2141         * Modules/mediasource/MediaSourceRegistry.h:
2142         * Modules/mediastream/DOMURLMediaStream.cpp:
2143         (WebCore::DOMURLMediaStream::createObjectURL):
2144         * Modules/mediastream/DOMURLMediaStream.h:
2145         * Modules/mediastream/DOMURLMediaStream.idl:
2146         * Modules/mediastream/MediaStreamRegistry.cpp:
2147         (WebCore::MediaStreamRegistry::registerURL):
2148         * Modules/mediastream/MediaStreamRegistry.h:
2149         * fileapi/Blob.cpp:
2150         (WebCore::BlobURLRegistry::registerURL):
2151         * html/DOMURL.cpp:
2152         (WebCore::DOMURL::createObjectURL):
2153         (WebCore::DOMURL::createPublicURL):
2154         * html/DOMURL.h:
2155         * html/DOMURL.idl:
2156         * html/HTMLMediaElement.cpp:
2157         (WebCore::HTMLMediaElement::setSrcObject):
2158         * html/PublicURLManager.cpp:
2159         (WebCore::PublicURLManager::registerURL):
2160         * html/PublicURLManager.h:
2161         * html/URLRegistry.h:
2162
2163 2016-09-21  Youenn Fablet  <youenn@apple.com>
2164
2165         [Fetch] Align Accept header default values with fetch spec
2166         https://bugs.webkit.org/show_bug.cgi?id=162260
2167
2168         Reviewed by Sam Weinig.
2169
2170         Covered by existing and updated tests.
2171
2172         To start implementing step 1 to 7 of fetch algorithm, this patch updates Accept header handling.
2173
2174         Default values are set according the spec based on resource type.
2175         Some resource types are not defined in the spec and we keep using existing values.
2176
2177         We check if Accept header is already present in the request. If that is the case, no change is done to that header.
2178
2179         If the Accept header is not set, the default value '*/*' is used.
2180         An Accept header is therefore always set at CachedResourceLoader level.
2181
2182         * loader/cache/CachedCSSStyleSheet.cpp:
2183         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet): Removing accept initialization.
2184         * loader/cache/CachedResource.cpp:
2185         (WebCore::CachedResource::load): Removing accept header setting.
2186         * loader/cache/CachedResource.h:
2187         (WebCore::CachedResource::accept): Deleted.
2188         (WebCore::CachedResource::setAccept): Deleted.
2189         * loader/cache/CachedResourceLoader.cpp:
2190         (WebCore::acceptHeaderValueFromType): helper routine merging fetch spec and existing WebKit accept values.
2191         (WebCore::CachedResourceLoader::prepareFetch): Should implement step 1 to 7 of https://fetch.spec.whatwg.org/#fetching.
2192         (WebCore::CachedResourceLoader::requestResource): Making use of prepareFetch.
2193         * loader/cache/CachedResourceLoader.h:
2194         * loader/cache/CachedSVGDocument.cpp:
2195         (WebCore::CachedSVGDocument::CachedSVGDocument): Removing accept initialization.
2196         * loader/cache/CachedScript.cpp:
2197         (WebCore::CachedScript::CachedScript): Removing accept initialization.
2198         * loader/cache/CachedXSLStyleSheet.cpp:
2199         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet): Removing accept initialization.
2200         * platform/network/ResourceRequestBase.cpp:
2201         (WebCore::ResourceRequestBase::hasHTTPHeader): Introduced to check for header presence.
2202         * platform/network/ResourceRequestBase.h:
2203
2204 2016-09-21  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
2205
2206         [GTK] Fix build failure of ScrollbarThemeGtk with libc++
2207         https://bugs.webkit.org/show_bug.cgi?id=162302
2208
2209         Reviewed by Carlos Garcia Campos.
2210
2211         * platform/gtk/ScrollbarThemeGtk.cpp:
2212         (WebCore::ScrollbarThemeGtk::paint): Add missing #include <cstdlib>
2213
2214 2016-09-21  Philippe Normand  <pnormand@igalia.com>
2215
2216         [OpenWebRTC] Miscellaneous fixes
2217         https://bugs.webkit.org/show_bug.cgi?id=162332
2218
2219         Reviewed by Alejandro G. Castro.
2220
2221         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
2222         (WebCore::MediaPlayerPrivateGStreamerOwr::currentTime): Improved logging.
2223         (WebCore::MediaPlayerPrivateGStreamerOwr::load): Ditto.
2224         (WebCore::MediaPlayerPrivateGStreamerOwr::loadingFailed): Ditto.
2225         (WebCore::MediaPlayerPrivateGStreamerOwr::createGSTAudioSinkBin):
2226         Pre-roll the autoaudiosink, fetch the underlying platform audio
2227         sink and pass it to the OpenWebRTC renderer.
2228         (WebCore::MediaPlayerPrivateGStreamerOwr::maybeHandleChangeMutedState): Improved logging.
2229         (WebCore::MediaPlayerPrivateGStreamerOwr::setSize): Don't configure invalid video renderer.
2230         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
2231         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Fix copy-paste error.
2232
2233 2016-09-21  Youenn Fablet  <youenn@apple.com>
2234
2235         Refactor CachedResourceLoader::canRequest
2236         https://bugs.webkit.org/show_bug.cgi?id=162144
2237
2238         Reviewed by Darin Adler.
2239
2240         Covered by existing tests.
2241
2242         Simplifying CachedResourceLoader::canRequest by doing:
2243         - CSP checks in another method
2244         - Removing Same-Origin type-specific checks by setting FetchOptions::Mode appropriately in resource loader clients
2245         - Moving script specific check in ScriptElement
2246
2247         Note that the last check may affect the loading behavior in the case scripts are enabled when starting the load
2248         of a script, but gets disabled before receiving a redirection for the script load.
2249
2250         * dom/ProcessingInstruction.cpp:
2251         (WebCore::ProcessingInstruction::checkStyleSheet): Setting XSLT stylesheet fetch mode to SameOrigin.
2252         * dom/ScriptElement.cpp:
2253         (WebCore::ScriptElement::requestScriptWithCache): Returning early if scripts are disabled.
2254         * loader/CrossOriginPreflightChecker.cpp:
2255         (WebCore::CrossOriginPreflightChecker::startPreflight): Bypassing CSP checks.
2256         * loader/DocumentLoader.cpp:
2257         (WebCore::DocumentLoader::startLoadingMainResource): Bypassing CSP checks as CachedResourceLoader was not
2258         checking them for MainResource.
2259         * loader/DocumentThreadableLoader.cpp:
2260         (WebCore::DocumentThreadableLoader::loadRequest): Ditto.
2261         * loader/LinkLoader.cpp:
2262         (WebCore::LinkLoader::preloadIfNeeded): Using new CachedResourceRequest constructor to enable moving the ResourceRequest.
2263         (WebCore::LinkLoader::loadLink): Skipping CSP checks for link prefetch/subresources as CachedResourceLoader was
2264         not checking them for Link Prefetch and Subresource types.
2265         * loader/cache/CachedResourceLoader.cpp:
2266         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy): Helper routine to check for CSP.
2267         (WebCore::CachedResourceLoader::canRequest): Making use of introduced helper routine.
2268         Simplified same origin check as all requests should have their options set.
2269         * loader/cache/CachedResourceLoader.h:
2270         * loader/cache/CachedResourceRequest.cpp:
2271         (WebCore::CachedResourceRequest::CachedResourceRequest): More efficient constructor.
2272         * loader/cache/CachedResourceRequest.h:
2273         * loader/cache/CachedSVGDocumentReference.cpp:
2274         (WebCore::CachedSVGDocumentReference::load): Setting fetch mode to SameOrigin.
2275         * svg/SVGUseElement.cpp:
2276         (WebCore::SVGUseElement::updateExternalDocument): Ditto.
2277         * xml/XSLImportRule.cpp:
2278         (WebCore::XSLImportRule::loadSheet): Ditto.
2279
2280 2016-09-21  Miguel Gomez  <magomez@igalia.com>
2281
2282         Build fails with GSTREAMER_GL when both desktop GL and GLES2 are enabled in gst-plugins-bad
2283         https://bugs.webkit.org/show_bug.cgi?id=159562
2284
2285         Reviewed by Philippe Normand.
2286
2287         Refactor video orientation code so including TextureMapperGL in MediaPlayerPrivateGStreamerBase.h
2288         is not necessary.
2289
2290         Covered by existent tests.
2291
2292         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2293         (WebCore::texMapFlagFromOrientation):
2294         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
2295         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2296         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
2297         (WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation):
2298         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2299
2300 2016-09-21  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
2301
2302         [GTK] Fix build failure in clipboard support
2303         https://bugs.webkit.org/show_bug.cgi?id=162261
2304
2305         Reviewed by Carlos Garcia Campos.
2306
2307         * platform/PlatformPasteboard.h: Add missing #include <functional>
2308         * platform/gtk/PasteboardHelper.h: Add missing #include <functional>
2309
2310 2016-09-20  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
2311
2312         VariadicHelper::Result should not include constructor to initialize members
2313         https://bugs.webkit.org/show_bug.cgi?id=162298
2314
2315         Reviewed by Darin Adler.
2316
2317         Remove the constructor since member-wise initialization does the same thing.
2318
2319         No new tests required.
2320
2321         * bindings/js/JSDOMBinding.h: Remove useless constructor.
2322
2323 2016-09-20  Alex Christensen  <achristensen@webkit.org>
2324
2325         Optimize URLParser
2326         https://bugs.webkit.org/show_bug.cgi?id=162105
2327
2328         Reviewed by Geoffrey Garen.
2329
2330         Covered by new API tests.
2331         This is about a 5% speedup on my URLParser benchmark.
2332
2333         * platform/URLParser.cpp:
2334         (WebCore::percentEncodeByte):
2335         (WebCore::utf8PercentEncode):
2336         (WebCore::utf8QueryEncode):
2337         (WebCore::encodeQuery):
2338         (WebCore::URLParser::parse):
2339         (WebCore::serializeURLEncodedForm):
2340         (WebCore::percentEncode): Deleted.
2341         (WebCore::utf8PercentEncodeQuery): Deleted.
2342
2343 2016-09-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2344
2345         [GTK] Clean up DataObjectGtk handling
2346         https://bugs.webkit.org/show_bug.cgi?id=162267
2347
2348         Reviewed by Michael Catanzaro.
2349
2350         * platform/Pasteboard.h: Use Ref instead of RefPtr for DataObjectGtk member.
2351         * platform/PasteboardStrategy.h: Pass a const reference to DataObjectGtk in write method and return a Ref from read.
2352         * platform/PlatformPasteboard.h: Ditto.
2353         * platform/gtk/DataObjectGtk.h:
2354         (WebCore::DataObjectGtk::image): Use Image instead of GdkPixbuf.
2355         (WebCore::DataObjectGtk::setImage):
2356         * platform/gtk/PasteboardGtk.cpp:
2357         (WebCore::Pasteboard::createForDragAndDrop): Use a reference instead of a pointer.
2358         (WebCore::Pasteboard::Pasteboard): Receives a reference, so we can also remove the ASSERT.
2359         (WebCore::Pasteboard::dataObject):
2360         (WebCore::Pasteboard::writeToClipboard): Remove the ShouldIncludeSmartPaste parameter, callers should also update
2361         canSmartPaste property of DataObjectGtk before calling this.
2362         (WebCore::Pasteboard::writePlainText):
2363         (WebCore::Pasteboard::write): Do not convert the image the GdkPixbuf, pass the image to the DataObjectGtk instead.
2364         * platform/gtk/PasteboardHelper.cpp:
2365         (WebCore::PasteboardHelper::fillSelectionData): Convert the DataObjectGtk image to GdkPixbuf right before
2366         passing it to gtk_selection_data_set_pixbuf().
2367         (WebCore::ClipboardSetData::ClipboardSetData): Use reference instead of pointer.
2368         (WebCore::getClipboardContentsCallback):
2369         (WebCore::clearClipboardContentsCallback): Never clear the saved DataObjectGtk, that was only needed when we had
2370         a global DataObjectGtk associated to a GtkClipboard.
2371         (WebCore::PasteboardHelper::writeClipboardContents): Use TemporaryChange to set the settingClipboardDataObject global.
2372         * platform/gtk/PlatformPasteboardGtk.cpp:
2373         (WebCore::PlatformPasteboard::writeToClipboard):
2374         (WebCore::PlatformPasteboard::readFromClipboard):
2375
2376 2016-09-20  Alex Christensen  <achristensen@webkit.org>
2377
2378         Require WTFMove for String::adopt
2379         https://bugs.webkit.org/show_bug.cgi?id=162313
2380
2381         Reviewed by Yusuke Suzuki.
2382
2383         No change in behavior.  This just makes it more clear what is going on when a String adopts a Vector.
2384
2385         * bindings/js/SerializedScriptValue.cpp:
2386         (WebCore::CloneDeserializer::readString):
2387         * css/parser/CSSParser.cpp:
2388         (WebCore::quoteCSSStringInternal):
2389         * dom/Document.cpp:
2390         (WebCore::canonicalizedTitle):
2391         * html/canvas/CanvasRenderingContext2D.cpp:
2392         (WebCore::normalizeSpaces):
2393         * html/parser/HTMLTreeBuilder.cpp:
2394         (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemainingWhitespace):
2395         * platform/Length.cpp:
2396         (WebCore::newCoordsArray):
2397         * platform/URLParser.cpp:
2398         (WebCore::URLParser::parse):
2399         (WebCore::URLParser::serialize):
2400         * platform/graphics/ca/GraphicsLayerCA.cpp:
2401         (WebCore::GraphicsLayerCA::ReplicaState::cloneID):
2402         * platform/text/TextCodecUTF16.cpp:
2403         (WebCore::TextCodecUTF16::decode):
2404         * platform/text/TextCodecUTF8.cpp:
2405         (WebCore::TextCodecUTF8::decode):
2406         * platform/text/mac/TextCodecMac.cpp:
2407         (WebCore::TextCodecMac::decode):
2408
2409 2016-09-20  Jer Noble  <jer.noble@apple.com>
2410
2411         Adopt MRMediaRemoteSetParentApplication.
2412         https://bugs.webkit.org/show_bug.cgi?id=162259
2413         <rdar://problem/28376161>
2414
2415         Reviewed by Anders Carlsson.
2416
2417         Allow MediaSessionManagerMac to retrieve the correct parent application identifier
2418         from a PlatformMediaSession so that it can pass that identifier through to MediaRemote
2419         via MRMediaRemoteSetParentApplication.
2420
2421         * Modules/webaudio/AudioContext.cpp:
2422         (WebCore::AudioContext::sourceApplicationIdentifier):
2423         * Modules/webaudio/AudioContext.h:
2424         * platform/audio/PlatformMediaSession.cpp:
2425         (WebCore::PlatformMediaSession::sourceApplicationIdentifier):
2426         * platform/audio/PlatformMediaSession.h:
2427         (WebCore::PlatformMediaSession::resetPlaybackSessionState): Deleted.
2428         * platform/audio/mac/MediaSessionManagerMac.mm:
2429         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
2430         * platform/mac/MediaRemoteSoftLink.cpp:
2431         * platform/mac/MediaRemoteSoftLink.h:
2432
2433
2434 2016-09-20  Nan Wang  <n_wang@apple.com>
2435
2436         AX: AppleVisUser: VO can't navigate web dialogs iOS10
2437         https://bugs.webkit.org/show_bug.cgi?id=162322
2438
2439         Reviewed by Chris Fleizach.
2440
2441         When using VoiceOver to navigate a web dialog's children, we were setting focus
2442         onto the focusable parent in accessibilityElementDidBecomeFocused. When the focusable
2443         parent is the dialog, it will cause the VO cursor jumping back and forward. Fixed it
2444         by not setting focus on web dialogs in such case.
2445
2446         Test: accessibility/ios-simulator/dialog-did-become-focused.html
2447
2448         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2449         (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):
2450
2451 2016-09-20  Keith Rollin  <krollin@apple.com>
2452
2453         Add new logging for network resource loading
2454         https://bugs.webkit.org/show_bug.cgi?id=162237
2455
2456         Reviewed by Antti Koivisto.
2457
2458         Add new logging along the non-main path for resource loading. This
2459         logging should allow us to differentiate between lack-of-logging due
2460         execution along a path that doesn't have logging statements and
2461         lack-of-logging due to a hung process.
2462
2463         No new tests -- there are no tests for logging.
2464
2465         * loader/DocumentLoader.cpp:
2466         (WebCore::DocumentLoader::startLoadingMainResource):
2467         (WebCore::DocumentLoader::isAlwaysOnLoggingAllowed):
2468         * loader/DocumentLoader.h:
2469         * loader/FrameLoader.cpp:
2470         (WebCore::FrameLoader::continueLoadAfterWillSubmitForm):
2471         * loader/cache/CachedResource.cpp:
2472         (WebCore::CachedResource::load):
2473         * loader/cache/CachedResourceLoader.cpp:
2474         (WebCore::CachedResourceLoader::requestResource):
2475         (WebCore::CachedResourceLoader::isAlwaysOnLoggingAllowed):
2476         * loader/cache/CachedResourceLoader.h:
2477         * page/Frame.h:
2478
2479 2016-09-20  Zalan Bujtas  <zalan@apple.com>
2480
2481         REGRESSION (r204552): Athlete search on Strava gives bad rendering.
2482         https://bugs.webkit.org/show_bug.cgi?id=162250
2483
2484         Reviewed by Simon Fraser.
2485
2486         Test: fast/layers/blank-content-when-child-layer-is-at-negative-big-number.html
2487
2488         * platform/graphics/LayoutRect.cpp:
2489         (WebCore::LayoutRect::checkedUnite):
2490         * platform/graphics/LayoutRect.h:
2491         (WebCore::LayoutRect::isMaxXMaxYRepresentable):
2492         (WebCore::LayoutRect::maxXMaxYCorner): Deleted.
2493         * rendering/RenderLayer.cpp:
2494         (WebCore::RenderLayer::calculateClipRects):
2495
2496 2016-09-20  Jer Noble  <jer.noble@apple.com>
2497
2498         [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-appendwindow.html
2499         https://bugs.webkit.org/show_bug.cgi?id=162306
2500
2501         Reviewed by Darin Adler.
2502
2503         appendWindowStart should be a restricted double, and both it and appendWindowEnd should throw
2504         TypeError exceptions when setting them to disallowed values.
2505
2506         * Modules/mediasource/SourceBuffer.cpp:
2507         (WebCore::SourceBuffer::setAppendWindowStart):
2508         (WebCore::SourceBuffer::setAppendWindowEnd):
2509         * Modules/mediasource/SourceBuffer.idl:
2510
2511 2016-09-20  Jer Noble  <jer.noble@apple.com>
2512
2513         [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-preload.html
2514         https://bugs.webkit.org/show_bug.cgi?id=162304
2515
2516         Reviewed by Darin Adler.
2517
2518         If an error occurs while loading a URL on behalf of MediaPlayerPrivateAVFObjC, make sure to signal
2519         that error to AVFoundation, so that the HTMLMediaElement is notified of the error.
2520
2521         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2522         (WebCore::WebCoreAVFResourceLoader::notifyFinished):
2523
2524 2016-09-20  Anders Carlsson  <andersca@apple.com>
2525
2526         Remove "in-store" from "-apple-pay-button-type"
2527         https://bugs.webkit.org/show_bug.cgi?id=162321
2528         rdar://problem/28394581
2529
2530         Reviewed by Beth Dakin.
2531
2532         * css/CSSPrimitiveValueMappings.h:
2533         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2534         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
2535         * css/CSSValueKeywords.in:
2536         * css/parser/CSSParser.cpp:
2537         (WebCore::isValidKeywordPropertyAndValue):
2538         * css/parser/CSSParserFastPaths.cpp:
2539         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2540         * rendering/RenderThemeCocoa.mm:
2541         (WebCore::toPKPaymentButtonType):
2542         * rendering/style/RenderStyleConstants.h:
2543
2544 2016-09-20  Alex Christensen  <achristensen@webkit.org>
2545
2546         Fix occasional using uninitialized memory crashes after r206168.
2547         https://bugs.webkit.org/show_bug.cgi?id=162247
2548
2549         This fixes a crash in imported/w3c/web-platform-tests/url/urlsearchparams-constructor.html
2550         I could reproduce about 10% of the time.
2551
2552         * html/URLSearchParams.h:
2553         Initialize the pointer to nullptr.
2554
2555 2016-09-20  Alex Christensen  <achristensen@webkit.org>
2556
2557         Reduce allocations in URLParser
2558         https://bugs.webkit.org/show_bug.cgi?id=162241
2559
2560         Reviewed by Chris Dumez.
2561
2562         Use Vectors instead of StringBuilders.  This allows us to use the inline capacity on the stack
2563         for short URLs (<2KB) and also allows us to skip branches because we know whether the
2564         contained type is UChar or LChar at compile time.  It also allows us to use uncheckedAppend.
2565
2566         Added new API tests for parts that were less tested, but there is
2567         no change in behavior except for a performance improvement.
2568
2569         * platform/URLParser.cpp:
2570         (WebCore::appendCodePoint):
2571         (WebCore::encodeQuery):
2572         (WebCore::URLParser::failure):
2573         (WebCore::URLParser::parse):
2574         (WebCore::percentDecode):
2575         (WebCore::domainToASCII):
2576         (WebCore::hasInvalidDomainCharacter):
2577         (WebCore::URLParser::parseHost):
2578         (WebCore::formURLDecode):
2579         (WebCore::isC0Control): Deleted.
2580         * platform/URLParser.h:
2581
2582 2016-09-20  Nan Wang  <n_wang@apple.com>
2583
2584         AX: voiceover does not read contents of input role="spinbutton"
2585         https://bugs.webkit.org/show_bug.cgi?id=162137
2586
2587         Reviewed by Chris Fleizach.
2588
2589         The aria-valuenow attribute value on the spinbutton is not exposed
2590         on iOS. We should expose aria-valuenow attribute for range controls
2591         based on https://www.w3.org/TR/wai-aria/states_and_properties#aria-valuenow
2592
2593         Changes are covered in the modified test.
2594
2595         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2596         (-[WebAccessibilityObjectWrapper accessibilityValue]):
2597
2598 2016-09-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2599
2600         URLParser: uidna_IDNToASCII_56 is deprecated
2601         https://bugs.webkit.org/show_bug.cgi?id=161841
2602
2603         Reviewed by Alex Christensen.
2604
2605         Add pragmas to silence the warning, plus a FIXME.
2606
2607         * platform/URLParser.cpp:
2608         (WebCore::domainToASCII):
2609
2610 2016-09-20  Alex Christensen  <achristensen@webkit.org>
2611
2612         Make URLSearchParams spec-compliant
2613         https://bugs.webkit.org/show_bug.cgi?id=162247
2614
2615         Reviewed by Chris Dumez and Sam Weinig.
2616
2617         Covered by newly-passing web platform tests.
2618
2619         * html/DOMURL.cpp:
2620         (WebCore::DOMURL::~DOMURL):
2621         (WebCore::DOMURL::setHref):
2622         (WebCore::DOMURL::setQuery):
2623         Update any associated URLSearchParams object when the query could change.
2624         (WebCore::DOMURL::searchParams):
2625         The lifetime of the URLSearchParams was wrong.  We were creating a new URLSearchParams each time
2626         URL.searchParams was called, and we should have been creating one the first time and returning the
2627         same instance for subsequent calls.  This means the DOMURL must own the URLSearchParams if it is associated,
2628         but if it is not associated, then a URLSearchParams can live on its own.
2629         * html/DOMURL.h:
2630         * html/URLSearchParams.h:
2631         (WebCore::URLSearchParams::URLDestroyed):
2632         (WebCore::URLSearchParams::setContents):
2633
2634 2016-09-20  Antti Koivisto  <antti@apple.com>
2635
2636         Remove AuthorStyleSheets::m_hadActiveLoadingStylesheet bit
2637         https://bugs.webkit.org/show_bug.cgi?id=162312
2638
2639         Reviewed by Chris Dumez.
2640
2641         * dom/AuthorStyleSheets.cpp:
2642         (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
2643
2644             We can handle loading sheets with the normal stylesheet change logic. Remove the special case.
2645
2646         (WebCore::filterEnabledNonemptyCSSStyleSheets):
2647
2648             Filter out loading stylesheets.
2649
2650         * dom/AuthorStyleSheets.h:
2651
2652 2016-09-20  Keith Rollin  <krollin@apple.com>
2653
2654         Adjust current networking logging
2655         https://bugs.webkit.org/show_bug.cgi?id=162235
2656
2657         Reviewed by Antti Koivisto.
2658
2659         Update the "always on" network logging in order to better track the
2660         loading of a particular resource and to better bind together the
2661         resources downloaded for a particular page and frame. Do this by
2662         consistently logging pageID, frameID, and resourceID.
2663
2664         No new tests -- there are no tests for logging.
2665
2666         * loader/FrameLoader.cpp:
2667         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2668         * loader/ResourceLoader.h:
2669         (WebCore::ResourceLoader::frame):
2670
2671 2016-09-20  Alex Christensen  <achristensen@webkit.org>
2672
2673         Non-special URLs should have an opaque origin
2674         https://bugs.webkit.org/show_bug.cgi?id=162254
2675
2676         Reviewed by Sam Weinig.
2677
2678         Covered by newly passing web platform tests.
2679
2680         * page/SecurityOrigin.cpp:
2681         (WebCore::shouldTreatAsUniqueOrigin):
2682         According to https://url.spec.whatwg.org/#origin all URLs with non-special protocols
2683         should have a unique SecurityOrigin whose serialization is "null".
2684
2685 2016-09-20  Christopher Reid  <Christopher.Reid@am.sony.com>
2686
2687         [WinCairo]  Not building since 206044
2688         https://bugs.webkit.org/show_bug.cgi?id=162246
2689
2690         Reviewed by Alex Christensen.
2691
2692         No new tests. No change in behaviour.
2693
2694         * bindings/js/JSWebGLRenderingContextCustom.cpp:
2695         * platform/network/curl/CookieJarCurl.cpp:
2696
2697 2016-09-20  Alex Christensen  <achristensen@webkit.org>
2698
2699         Align URLParser with web platform tests when parsing non-special relative URLs ending in AuthorityOrHost state
2700         https://bugs.webkit.org/show_bug.cgi?id=162251
2701
2702         Reviewed by Tim Horton.
2703
2704         Covered by new and updated API tests.
2705
2706         * platform/URLParser.cpp:
2707         (WebCore::URLParser::parse):
2708         Fix parsing of non-special URLs that end after scheme:// with no authority.
2709         We used to assume that parsing non-special schemes would never end with just scheme:// but a string can indeed end right there.
2710         When a non-special relative URL contains just scheme:// we need the resulting URL to be valid to conform with the web platform tests.
2711         (WebCore::URLParser::parseHostAndPort):
2712         Renamed to reflect what the function actually does.
2713         (WebCore::URLParser::internalValuesConsistent):
2714         Add utility function for testing.
2715         (WebCore::URLParser::parseHost): Deleted.
2716         * platform/URLParser.h:
2717
2718 2016-09-20  Javier Fernandez  <jfernandez@igalia.com>
2719
2720         [css-grid] The 'grid' shorthand has a new syntax.
2721         https://bugs.webkit.org/show_bug.cgi?id=161954
2722
2723         Reviewed by Darin Adler.
2724
2725         Implementation of the new CSS syntax for the 'grid' shorthand, as
2726         defined in the CSS Grid Layout specification:
2727         - https://drafts.csswg.org/css-grid/#grid-shorthand
2728
2729         No new tests, just adapted the ones we already have and added a few additional test cases.
2730
2731         * css/CSSValueKeywords.in:
2732         * css/parser/CSSParser.cpp:
2733         (WebCore::CSSParser::parseImplicitAutoFlow): Added. Similar to parseGridAutoFlow, but using the new 'auto-flow' keyword.
2734         (WebCore::CSSParser::parseGridShorthand): New syntax of the 'grid' shorthand.
2735         * css/parser/CSSParser.h:
2736
2737 2016-09-20  Alex Christensen  <achristensen@webkit.org>
2738
2739         URLParser should allow '@' in user
2740         https://bugs.webkit.org/show_bug.cgi?id=162272
2741
2742         Reviewed by Tim Horton.
2743
2744         Covered by a new API test.
2745
2746         * platform/URLParser.cpp:
2747         (WebCore::URLParser::parse):
2748         The spec describes using an "@ flag" and rewinding iterators.  I've implemented the authority parsing
2749         and host parsing a little differently, but this makes it equivalent.
2750
2751 2016-09-20  Alex Christensen  <achristensen@webkit.org>
2752
2753         URLParser: Fix parsing relative URLs with one slash after the scheme:
2754         https://bugs.webkit.org/show_bug.cgi?id=162294
2755
2756         Reviewed by Tim Horton.
2757
2758         This fixes the relatively-obscure case where a relative URL has the same special scheme as the base,
2759         but there is only one slash after the scheme: at the beginning of the relative URL.  According to spec,
2760         this should be interpreted the same as if the scheme: were not there.
2761         For example, parsing "http:/example.com/" relative to "http://example.org/foo/bar" should be the same as
2762         parsing "/example.com/" relative to "http://example.org/foo/bar".
2763
2764         Covered by a new API test.
2765
2766         * platform/URLParser.cpp:
2767         (WebCore::URLParser::parse):
2768
2769 2016-09-20  Alex Christensen  <achristensen@webkit.org>
2770
2771         Fix Windows file URL quirks in URLParser
2772         https://bugs.webkit.org/show_bug.cgi?id=162303
2773
2774         Reviewed by Tim Horton.
2775
2776         Windows file urls allow c:\ and c|\ to have the same meaning, but when serialized they should both be c:/.
2777         This is now standardized to allow cross-platform uniform behavior of URLs.
2778
2779         Covered by new API tests and progress on web platform tests when URLParser is enabled.
2780
2781         * platform/URLParser.cpp:
2782         (WebCore::incrementIteratorSkippingTabAndNewLine):
2783         (WebCore::isWindowsDriveLetter):
2784         (WebCore::checkWindowsDriveLetter):
2785         (WebCore::shouldCopyFileURL):
2786         (WebCore::URLParser::parseSerializedURL):
2787         (WebCore::URLParser::parse):
2788
2789 2016-09-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
2790
2791         Rename FrameData to ImageFrame, move it to a separate file and use it for all ports
2792         https://bugs.webkit.org/show_bug.cgi?id=159819
2793
2794         Reviewed by Simon Fraser.
2795
2796         Rename FrameData to ImageFrame and move it to a separate file so caching
2797         it can be managed outside the BitmapImage object. Make the data members
2798         of FrameData be private and add getters to return their values. Add backing
2799         store and disposalMethod members, getter and setters to ImageFrame so it can
2800         replace the non-CG ImageFrame class.
2801
2802         * CMakeLists.txt:
2803         * WebCore.xcodeproj/project.pbxproj:
2804         Add ImageFrame class to WebCore project.
2805         
2806         * platform/graphics/BitmapImage.cpp:
2807         (WebCore::BitmapImage::BitmapImage): The metadata for the non-decoder case is now calculated in the ImageFrame::initialize().
2808         (WebCore::BitmapImage::haveFrameImageAtIndex): Call ImageFrame's getters instead of access private members.
2809         (WebCore::BitmapImage::destroyDecodedData): Pass ImageFrame::Caching::Metadata to ImageFrame::clear() to clear the image only.
2810         (WebCore::BitmapImage::destroyDecodedDataIfNecessary): ImageFrame::usedFrameBytes() is now renamed to ImageFrame::frameBytes().
2811         (WebCore::BitmapImage::cacheFrame): Call ImageFrame::initialize() to set the image and cache the frame's metadata.
2812         (WebCore::BitmapImage::dataChanged): Pass ImageFrame::Caching::Empty to ImageFrame::clear() to clear the frame's image and metadata.
2813         (WebCore::BitmapImage::ensureFrameAtIndexIsCached): Call ImageFrame's getters instead of access private members.
2814         (WebCore::BitmapImage::frameImageAtIndex): Call ImageFrame's getters instead of access private members.
2815         (WebCore::BitmapImage::frameIsCompleteAtIndex): Pass ImageFrame::Caching::Metadata to ensureFrameAtIndexIsCached() to ensure the frame's metadata is cached.
2816         (WebCore::BitmapImage::frameDurationAtIndex): Pass ImageFrame::Caching::Metadata to ensureFrameAtIndexIsCached() to ensure the frame's metadata is cached.
2817         (WebCore::BitmapImage::frameHasAlphaAtIndex): Pass ImageFrame::Caching::Metadata to ensureFrameAtIndexIsCached() to ensure the frame's metadata is cached.
2818         (WebCore::BitmapImage::frameOrientationAtIndex): Pass ImageFrame::Caching::Metadata to ensureFrameAtIndexIsCached() to ensure the frame's metadata is cached.
2819         (WebCore::BitmapImage::singlePixelSolidColor): Call ImageFrame's getters instead of access private members.
2820         (WebCore::BitmapImage::repetitionCount): Change the return type to be RepetitionCount instead of int.
2821         (WebCore::BitmapImage::shouldAnimate): Use a simpler condition since RepetitionCountNone is equal to zero.
2822         (WebCore::BitmapImage::startAnimation): Replace the cAnimation* constants by the new RepetitionCount* enum.
2823         (WebCore::BitmapImage::internalAdvanceAnimation): Replace the cAnimation* constants by the new RepetitionCount* enum.
2824
2825         * platform/graphics/BitmapImage.h: FrameData is renamed to ImageFrame and moved to a separate file named ImageFrame.h.
2826         (WebCore::FrameData::FrameData): Deleted.
2827         (WebCore::FrameData::~FrameData): Deleted.
2828         (WebCore::FrameData::clear): Deleted.
2829         (WebCore::FrameData::usedFrameBytes): Deleted.
2830
2831         * platform/graphics/ImageBackingStore.h: 
2832         (WebCore::ImageBackingStore::fillRect): Make it efficient to fill a rect in the ImageBackingStore with the same color.
2833         (WebCore::ImageBackingStore::pixelAt): Asserts the point is in the bounds of the ImageBackingStore size.
2834         (WebCore::ImageBackingStore::setPixel): Use pixelValue().
2835         (WebCore::ImageBackingStore::inBounds): Private functions check whether a point or a rect is in the bounds of the ImageBackingStore size.
2836         (WebCore::ImageBackingStore::pixelValue): Calculate the RGBA value form red, green, blue and alpha values.
2837
2838         * platform/graphics/ImageFrame.cpp: Added.
2839         (WebCore::ImageFrame::ImageFrame): 
2840         (WebCore::ImageFrame::~ImageFrame):
2841         (WebCore::ImageFrame::operator=):
2842         (WebCore::ImageFrame::fillMetaData): Caches the ImageFrame's metadata.
2843         (WebCore::ImageFrame::clearImage): Deletes all the allocated memory by ImageFrame which can be the ImageBackingStore or the NativeImagePtr.
2844         (WebCore::ImageFrame::clear): Deletes the allocated memory and may or may not clears the metadata also.
2845         (WebCore::ImageFrame::initialize): Sets a new ImageBackingStore or a new NativeImagePtr in the ImageFrame.
2846         (WebCore::ImageFrame::size): Returns the size of the ImageFrame which can be the size of ImageBackingStore or the size of NativeImagePtr.
2847         (WebCore::ImageFrame::singlePixelSolidColor): Returns whether the ImageFrame can be drawn by filling the image rectangle with a solid color.
2848         
2849         * platform/graphics/ImageFrame.h: Added.
2850         (WebCore::operator++): SubsamplingLevel is strongly typed but RepetitionCount is not since it can be any unsigned value in addition to -1.
2851         (WebCore::ImageFrame::ImageFrame):
2852         (WebCore::ImageFrame::setDecoding):
2853         (WebCore::ImageFrame::decoding):
2854         (WebCore::ImageFrame::isEmpty):
2855         (WebCore::ImageFrame::isPartial):
2856         (WebCore::ImageFrame::isComplete):
2857         (WebCore::ImageFrame::sizeRespectingOrientation):
2858         (WebCore::ImageFrame::frameBytes):
2859         (WebCore::ImageFrame::subsamplingLevel):
2860         (WebCore::ImageFrame::setDisposalMethod):
2861         (WebCore::ImageFrame::disposalMethod):
2862         (WebCore::ImageFrame::image):
2863         (WebCore::ImageFrame::setOrientation):
2864         (WebCore::ImageFrame::orientation):
2865         (WebCore::ImageFrame::setDuration):
2866         (WebCore::ImageFrame::duration):
2867         (WebCore::ImageFrame::setHasAlpha):
2868         (WebCore::ImageFrame::hasAlpha):
2869         (WebCore::ImageFrame::hasImage):
2870         (WebCore::ImageFrame::hasInvalidImage):
2871         (WebCore::ImageFrame::hasMetadata):
2872         (WebCore::ImageFrame::backingStore):
2873         (WebCore::ImageFrame::hasBackingStore):
2874         Setters and getters for the private members.
2875
2876         * platform/graphics/ImageSource.cpp:
2877         (WebCore::ImageSource::calculateMaximumSubsamplingLevel): allowSubsamplingOfFrameAtIndex() is renamed to frameAllowSubsamplingAtIndex().
2878         (WebCore::ImageSource::subsamplingLevelForScale): Use the values of the enum class SubsamplingLevel.
2879         (WebCore::ImageSource::size): Use the values of the enum class SubsamplingLevel.
2880         (WebCore::ImageSource::sizeRespectingOrientation): Use the values of the enum class SubsamplingLevel.
2881         (WebCore::ImageSource::repetitionCount): Replace the constants cAnimation* by the enum RepetitionCount*.
2882         (WebCore::ImageSource::frameAllowSubsamplingAtIndex): Rename allowSubsamplingOfFrameAtIndex() to frameAllowSubsamplingAtIndex().
2883         (WebCore::ImageSource::frameSizeAtIndex): Replace the call to orientationAtIndex() by frameOrientationAtIndex().
2884         (WebCore::ImageSource::frameOrientationAtIndex): Rename orientationAtIndex() to frameOrientationAtIndex().
2885         (WebCore::ImageSource::dump): Replace the call to orientationAtIndex() by frameOrientationAtIndex().
2886         (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex): Deleted.
2887         (WebCore::ImageSource::orientationAtIndex): Deleted.
2888         
2889         * platform/graphics/ImageSource.h:
2890         (WebCore::ImageSource::decoder): We need this function temporarily till we move caching the frames outside BitmapImage. 
2891
2892         * platform/graphics/NativeImage.h: Change SubImages() to Subimages(). See Darin's comment in https://bugs.webkit.org/show_bug.cgi?id=159819#c6.
2893         * platform/graphics/cairo/NativeImageCairo.cpp:
2894         (WebCore::clearNativeImageSubimages):
2895         (WebCore::clearNativeImageSubImages): Deleted.
2896
2897         * platform/graphics/cg/ImageDecoderCG.cpp:
2898         (WebCore::createImageSourceOptions): Use the values of the enum class SubsamplingLevel.
2899         (WebCore::imageSourceOptions): Use the values of the enum class SubsamplingLevel.
2900         (WebCore::ImageDecoder::repetitionCount): Change the return type to be RepetitionCount instead of int.
2901         (WebCore::ImageDecoder::frameOrientationAtIndex): orientationAtIndex() is renamed to frameOrientationAtIndex().
2902         (WebCore::ImageDecoder::frameAllowSubsamplingAtIndex): allowSubsamplingOfFrameAtIndex() is renamed to frameAllowSubsamplingAtIndex().
2903         (WebCore::ImageDecoder::orientationAtIndex): Deleted.
2904         (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex): Deleted.
2905         * platform/graphics/cg/ImageDecoderCG.h:
2906
2907         * platform/graphics/cg/NativeImageCG.cpp:
2908         (WebCore::clearNativeImageSubimages): Change SubImages() to Subimages().
2909         (WebCore::clearNativeImageSubImages): Deleted.
2910
2911         * platform/image-decoders/ImageDecoder.cpp:
2912         (WebCore::ImageDecoder::frameIsCompleteAtIndex): Use ImageFrame::isComplete() instead of checking the value of the decoding status().
2913         (WebCore::ImageDecoder::frameHasAlphaAtIndex): Use ImageFrame::isComplete() instead of checking the value of the decoding status().
2914         (WebCore::ImageDecoder::frameDurationAtIndex): Use ImageFrame::isEmpty() instead of checking the value of the decoding status().
2915         (WebCore::ImageDecoder::createFrameImageAtIndex): Access the ImageBackingStore::image() function directly.
2916         (WebCore::ImageFrame::ImageFrame): Deleted.
2917         (WebCore::ImageFrame::operator=): Deleted.
2918         (WebCore::ImageFrame::clearPixelData): Deleted.
2919         (WebCore::ImageFrame::zeroFillPixelData): Deleted.
2920         (WebCore::ImageFrame::zeroFillFrameRect): Deleted.
2921         (WebCore::ImageFrame::initializeBackingStore): Deleted.
2922         (WebCore::ImageFrame::hasAlpha): Deleted.
2923         (WebCore::ImageFrame::setHasAlpha): Deleted.
2924         (WebCore::ImageFrame::setOriginalFrameRect): Deleted.
2925         (WebCore::ImageFrame::setStatus): Deleted.
2926
2927         * platform/image-decoders/ImageDecoder.h:
2928         (WebCore::ImageDecoder::repetitionCount): Use the type RepetitionCount and the enum RepetitionCount* values.
2929         (WebCore::ImageDecoder::frameOrientationAtIndex): Rename orientationAtIndex() to frameOrientationAtIndex().
2930         (WebCore::ImageDecoder::frameAllowSubsamplingAtIndex): Rename allowSubsamplingOfFrameAtIndex() to frameAllowSubsamplingAtIndex().
2931         (WebCore::ImageDecoder::subsamplingLevelForScale): Use the enum class SubsamplingLevel value instead of integer values.
2932         (WebCore::ImageFrame::ImageFrame): Deleted.
2933         (WebCore::ImageFrame::copyRowNTimes): Deleted.
2934         (WebCore::ImageFrame::size): Deleted.
2935         (WebCore::ImageFrame::asNewNativeImage): Deleted.
2936         (WebCore::ImageFrame::backingStore): Deleted.
2937         (WebCore::ImageFrame::hasBackingStore): Deleted.
2938         (WebCore::ImageFrame::originalFrameRect): Deleted.
2939         (WebCore::ImageFrame::status): Deleted.
2940         (WebCore::ImageFrame::duration): Deleted.
2941         (WebCore::ImageFrame::disposalMethod): Deleted.
2942         (WebCore::ImageFrame::setDuration): Deleted.
2943         (WebCore::ImageFrame::setDisposalMethod): Deleted.
2944         (WebCore::ImageFrame::pixelAt): Deleted.
2945         (WebCore::ImageFrame::setPixel): Deleted.
2946         (WebCore::ImageFrame::blendPixel): Deleted.
2947         (WebCore::ImageDecoder::orientationAtIndex): Deleted.
2948         (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex): Deleted.
2949
2950         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
2951         (WebCore::BMPImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
2952         (WebCore::BMPImageDecoder::decode): Ditto.
2953
2954         * platform/image-decoders/bmp/BMPImageReader.cpp:
2955         (WebCore::BMPImageReader::decodeBMP): Call ImageFrame::isEmpty(). ImageBuffer::initializeBackingStore() is renamed to initialize().
2956         (WebCore::BMPImageReader::processNonRLEData): Replace ImageFrame::zeroFillPixelData() by ImageBackingStore::clear() and ImageFrame::setAlpha().
2957
2958         * platform/image-decoders/bmp/BMPImageReader.h:
2959         (WebCore::BMPImageReader::setPixel): Call ImageBackingStore::setPixel() directly.
2960         (WebCore::BMPImageReader::fillRGBA): Replace an efficient loop to call setPixel() by ImageBackingStore::fillRect().
2961
2962         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2963         (WebCore::GIFImageDecoder::GIFImageDecoder): Move the initialization of m_repetitionCount to the header file.
2964         (WebCore::GIFImageDecoder::repetitionCount): Change the return type.
2965         (WebCore::GIFImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
2966         (WebCore::GIFImageDecoder::clearFrameBufferCache): Use the values of the new enum class ImageFrame::DisposalMethod.
2967         (WebCore::GIFImageDecoder::haveDecodedRow): Call the ImageBackingStore API's directly.
2968         (WebCore::GIFImageDecoder::frameComplete): Use the values of the new enum class ImageFrame::DisposalMethod.
2969         (WebCore::GIFImageDecoder::initFrameBuffer): Move calling ImageBackingStore::setFrameRect() to be after initializing the ImageBackingStore itself.
2970
2971         * platform/image-decoders/gif/GIFImageDecoder.h: Make repetitionCount() returns RepetitionCount and use the new enum class ImageFrame::DisposalMethod.
2972         
2973         * platform/image-decoders/gif/GIFImageReader.cpp:
2974         (GIFImageReader::parse):
2975
2976         * platform/image-decoders/gif/GIFImageReader.h:
2977         (GIFFrameContext::GIFFrameContext): Use new enum class ImageFrame::DisposalMethod.
2978         
2979         * platform/image-decoders/ico/ICOImageDecoder.cpp:
2980         (WebCore::ICOImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
2981         (WebCore::ICOImageDecoder::decode): Ditto.
2982
2983         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
2984         (WebCore::JPEGImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
2985         (WebCore::setPixel): Call ImageBackingStore::setPixel() directly.
2986         (WebCore::JPEGImageDecoder::outputScanlines): ImageFrame::initializeBackingStore() is renamed to initialize().
2987         (WebCore::JPEGImageDecoder::jpegComplete): ImageFrame::setStatus() is renamed to ImageFrame::setDecoding().
2988         (WebCore::JPEGImageDecoder::decode): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
2989
2990         * platform/image-decoders/png/PNGImageDecoder.cpp:
2991         (WebCore::PNGImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
2992         (WebCore::PNGImageDecoder::rowAvailable): Call the ImageBackingStore APIs directly.
2993         (WebCore::PNGImageDecoder::pngComplete): ImageFrame::setStatus() is renamed to setDecoding().
2994         (WebCore::PNGImageDecoder::readChunks): Use the values of the new enum class ImageFrame::DisposalMethod.
2995         (WebCore::PNGImageDecoder::clearFrameBufferCache): Replace the call to ImageFrame::clearPixelData() by  ImageFrame::clear().
2996         (WebCore::PNGImageDecoder::initFrameBuffer): Move calling ImageBackingStore::setFrameRect() to be after initializing the ImageBackingStore itself.
2997         (WebCore::PNGImageDecoder::frameComplete): Call the ImageBackingStore APIs directly.
2998
2999         * platform/image-decoders/png/PNGImageDecoder.h: Call ImageFrame::isComplete() instead of checking the value of the decoding status().
3000
3001         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
3002         (WebCore::WEBPImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
3003         (WebCore::WEBPImageDecoder::decode): ImageFrame::setStatus() is renamed to setDecoding(). And initializeBackingStore() is renamed to initialize().
3004
3005 2016-09-20  Don Olmstead  <don.olmstead@am.sony.com>
3006
3007         [WinCairo] Use find_package cairo in build
3008         https://bugs.webkit.org/show_bug.cgi?id=162239
3009
3010         Reviewed by Alex Christensen.
3011
3012         No new tests. No change in behavior.
3013
3014         * PlatformWinCairo.cmake:
3015
3016 2016-09-20  Jer Noble  <jer.noble@apple.com>
3017
3018         [media-source] Support MediaSource.setLiveSeekableRanges()
3019         https://bugs.webkit.org/show_bug.cgi?id=162252
3020
3021         Reviewed by Sam Weinig.
3022
3023         Fixes tests: imported/w3c/web-platform-tests/media-source/interfaces.html
3024                      imported/w3c/web-platform-tests/media-source/mediasource-liveseekable.html
3025
3026         Add support for a new part of the Media Source specification, the ability for clients to
3027         specify the seekable ranges for a MediaSource-backed HTMLMediaElement.
3028
3029         Adding the live-seekable methods to MediaSource fixes a large number of the interfaces.html
3030         tests, and the rest are fixed by adding on<event> handlers to MediaSource, SourceBuffer,
3031         and SourceBufferList.
3032
3033         * Modules/mediasource/MediaSource.cpp:
3034         (WebCore::MediaSource::seekable):
3035         (WebCore::MediaSource::setLiveSeekableRange):
3036         (WebCore::MediaSource::clearLiveSeekableRange):
3037         * Modules/mediasource/MediaSource.h:
3038         * Modules/mediasource/MediaSource.idl:
3039         * Modules/mediasource/SourceBuffer.idl:
3040         * Modules/mediasource/SourceBufferList.idl:
3041         * Modules/mediasource/VideoPlaybackQuality.idl:
3042         * html/HTMLMediaElement.cpp:
3043         (WebCore::HTMLMediaElement::seekable):
3044
3045 2016-09-20  Per Arne Vollan  <pvollan@apple.com>
3046
3047         [Win] Unreviewed warning fix.
3048
3049         * page/CaptionUserPreferencesMediaAF.cpp:
3050
3051 2016-09-19  Chris Dumez  <cdumez@apple.com>
3052
3053         Add support for HTMLSourceElement.prototype.sizes / HTMLSourceElement.prototype.srcset
3054         https://bugs.webkit.org/show_bug.cgi?id=162244
3055
3056         Reviewed by Alex Christensen.
3057
3058         Add support for HTMLPrototype.prototype.sizes / HTMLPrototype.prototype.srcset:
3059         - https://html.spec.whatwg.org/#the-source-element
3060
3061         We already support the corresponding content attributes internally. However, we
3062         are missing the corresponding IDL attributes that are supposed to reflect them.
3063
3064         Chrome and Firefox support them. We already had those IDL attributes on
3065         HTMLImageElement.
3066
3067         No new tests, rebaselined existing test.
3068
3069         * html/HTMLSourceElement.idl:
3070
3071 2016-09-19  Anders Carlsson  <andersca@apple.com>
3072
3073         Suppress JavaScript prompts early on in certain cases
3074         https://bugs.webkit.org/show_bug.cgi?id=162243
3075         rdar://problem/27661602
3076
3077         Reviewed by Geoffrey Garen.
3078
3079         Export symbols needed by WebKit2.
3080
3081         * loader/FrameLoader.h:
3082         * loader/FrameLoaderStateMachine.h:
3083
3084 2016-09-19  Chris Dumez  <cdumez@apple.com>
3085
3086         Align HTMLAppletElement with the specification
3087         https://bugs.webkit.org/show_bug.cgi?id=162240
3088
3089         Reviewed by Alex Christensen.
3090
3091         Align HTMLAppletElement with the specification:
3092         - https://html.spec.whatwg.org/#htmlappletelement
3093
3094         In particular:
3095         - space / vspace should be of type "unsigned long", not DOMString
3096         - codeBase and object should reflect as URLs
3097
3098         Firefox agree with the specification. Chrome does not have
3099         HTMLAppletElement anymore.
3100
3101         No new tests, rebaselined existing test.
3102
3103         * html/HTMLAppletElement.cpp:
3104         (WebCore::HTMLAppletElement::isURLAttribute):
3105         * html/HTMLAppletElement.h:
3106         * html/HTMLAppletElement.idl:
3107
3108 2016-09-16  Jer Noble  <jer.noble@apple.com>
3109
3110         [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-avtracks.html
3111         https://bugs.webkit.org/show_bug.cgi?id=162104
3112
3113         Reviewed by Eric Carlson.
3114
3115         Fixes test: imported/w3c/web-platform-tests/media-source/mediasource-avtracks.html
3116
3117         Multiple overlapping issues are causing this test to fail:
3118
3119         - When a MediaSource object is not attached from a HTMLMediaElement, it's SourceBuffer
3120           objects will return `null` from .videoTracks and .audioTracks, foiling the tests ability
3121           to assert that sourceBuffer.videoTracks.length == 0.
3122
3123         - When a MediaSource object is detached from a HTMLMediaElement, it's tracks are removed
3124           but do not generate 'removedtrack' events.
3125
3126         When these bugs were fixed, a few more popped up:
3127
3128         - The HTMLMediaElement removes its tracks before it closes the MediaSource, which causes an
3129           assertion when the MediaSource tells the HTMLMediaElement to remove its copy of the 
3130           source's tracks (which have already been removed).
3131
3132         - When the HTMLMediaElement is stop()-ed due to its ScriptExecutionContext being destroyed,
3133           it tries to close its MediaSource, which has itself already been stop()-ed and thus asserts.
3134
3135         To eliminate all these bugs and make the code more self explanatory, we will rename the 
3136         HTMLMediaElement's closeMediaSource() method to detachMediaSource(), and the MediaSource's
3137         close() method to detachFromElement(). The only way to close a MediaSource is now by calling
3138         detachMediaSource() from the HTMLMediaElement.  The parts of the "Detaching from a media
3139         element" algorithm which were previously spread across setReadyState() and onReadyStateChange()
3140         are now unified in the newly renamed detachFromElement() method. The HTMLMediaElement will
3141         first detach its MediaSource, and only after that remove all its tracks.
3142
3143         * Modules/mediasource/MediaSource.cpp:
3144         (WebCore::MediaSource::setReadyState): Move steps into detachFromElement().
3145         (WebCore::MediaSource::onReadyStateChange): Ditto.
3146         (WebCore::MediaSource::detachFromElement): Perform the steps as specified.
3147         (WebCore::MediaSource::attachToElement): Takes a reference rather than a bare pointer.
3148         (WebCore::MediaSource::stop): Ask the media elemnet to detach.
3149         (WebCore::MediaSource::close): Renamed to detachFromElement().
3150         * Modules/mediasource/MediaSource.h:
3151         * Modules/mediasource/SourceBuffer.cpp:
3152         (WebCore::SourceBuffer::videoTracks): Always return a valid TrackList object.
3153         (WebCore::SourceBuffer::audioTracks): Ditto.
3154         (WebCore::SourceBuffer::textTracks): Ditto.
3155         * html/HTMLMediaElement.cpp:
3156         (WebCore::HTMLMediaElement::~HTMLMediaElement): Renamed closeMediaSource() -> detachMediaSource().
3157         (WebCore::HTMLMediaElement::prepareForLoad): Ditto.
3158         (WebCore::HTMLMediaElement::loadResource): Ditto.
3159         (WebCore::HTMLMediaElement::noneSupported): Ditto.
3160         (WebCore::HTMLMediaElement::mediaLoadingFailedFatally): Ditto.
3161         (WebCore::HTMLMediaElement::detachMediaSource): Ditto.
3162         (WebCore::HTMLMediaElement::userCancelledLoad): Ditto.
3163         (WebCore::HTMLMediaElement::createMediaPlayer): Ditto.
3164         (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto. Also, detach from the MediaSource before
3165             removing tracks.
3166         (WebCore::HTMLMediaElement::closeMediaSource): Deleted.
3167         * html/HTMLMediaElement.h:
3168         * html/track/TrackListBase.cpp:
3169         (TrackListBase::remove): Only try to clear the media element from Tracks that have one.
3170
3171 2016-09-19  Alex Christensen  <achristensen@webkit.org>
3172
3173         URLParser can read memory out of bounds
3174         https://bugs.webkit.org/show_bug.cgi?id=162206
3175
3176         Reviewed by Geoff Garen.
3177
3178         Covered by new API tests.
3179         URLParser is disabled by default still.
3180
3181         * platform/URLParser.cpp:
3182         (WebCore::parseIPv4Host):
3183         If there are fewer than two numbers in an ipv4 address, we would subtract two from the Vector's size, 
3184         causing us to read memory up to std::numeric_limits<size_t>::max() - 2.  Added a bounds check and many tests.
3185
3186 2016-09-19  Alex Christensen  <achristensen@webkit.org>
3187
3188         URLParser should parse serialized valid URLs faster than unknown input
3189         https://bugs.webkit.org/show_bug.cgi?id=162228
3190
3191         Reviewed by Chris Dumez.
3192
3193         The URL constructor with ParsedURLStringTag is almost twice as fast as the other URL constructors.
3194         Assuming there are no tabs or newlines, and assuming characters are already encoded decreases the URLParser
3195         runtime by over 25% and adds infrastructure for more optimizations.
3196
3197         No new tests. No change in behaviour.
3198
3199         * platform/URL.cpp:
3200         (WebCore::URL::URL):
3201         * platform/URLParser.cpp:
3202         (WebCore::utf8PercentEncode):
3203         (WebCore::utf8PercentEncodeQuery):
3204         (WebCore::URLParser::parse):
3205         (WebCore::URLParser::parseSerializedURL):
3206         (WebCore::incrementIterator):
3207         (WebCore::URLParser::parseAuthority):
3208         (WebCore::URLParser::parsePort):
3209         (WebCore::URLParser::parseHost):
3210         * platform/URLParser.h:
3211         (WebCore::URLParser::parse): Deleted.
3212
3213 2016-09-19  Daniel Bates  <dabates@apple.com>
3214
3215         Cleanup: Remove an extraneous copy of SecurityOrigin
3216         https://bugs.webkit.org/show_bug.cgi?id=162118
3217
3218         Reviewed by Youenn Fablet.
3219
3220         Share one isolated copy of the SecurityOrigin between the ContentSecurityPolicy and
3221         LoaderTaskOptions objects instead of creating two isolated copies of the SecurityOrigin.
3222         This is safe because both ContentSecurityPolicy and LoaderTaskOptions are instantiated
3223         in WorkerThreadableLoader::MainThreadBridge for use on the main thread only.
3224
3225         * loader/WorkerThreadableLoader.cpp:
3226         (WebCore::LoaderTaskOptions::LoaderTaskOptions):
3227         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
3228
3229 2016-09-19  Antti Koivisto  <antti@apple.com>
3230
3231         Add size assert for RenderElement
3232         https://bugs.webkit.org/show_bug.cgi?id=162096
3233
3234         Reviewed by Simon Fraser.
3235
3236         Also remove the unused m_visibleInViewportState field.
3237
3238         * rendering/RenderElement.cpp:
3239         (WebCore::RenderElement::unregisterForVisibleInViewportCallback):
3240         * rendering/RenderElement.h:
3241
3242 2016-09-19  Keith Rollin  <krollin@apple.com>
3243
3244         REGRESSION (r205275): LOG_WITH_STREAM() macros are all compiled in release builds now
3245         https://bugs.webkit.org/show_bug.cgi?id=162180
3246
3247         Reviewed by Simon Fraser.
3248
3249         Disable LOG_WITH_STREAM in release mode. Along with this, remove a
3250         local variable in GraphcsContextCG.cpp in release mode that's no
3251         longer referenced. And adjust logFunctionResult so that it gets
3252         defined only in debug mode, too, to match its declaration in
3253         LogMacros.h.
3254
3255         No new tests -- there are no tests for logging.
3256
3257         * platform/LogMacros.h:
3258         * platform/Logging.cpp:
3259         * platform/graphics/cg/GraphicsContextCG.cpp:
3260         (WebCore::GraphicsContext::drawNativeImage):
3261
3262 2016-09-19  Daniel Bates  <dabates@apple.com>
3263
3264         Remove ENABLE(TEXT_AUTOSIZING) automatic text size adjustment code
3265         https://bugs.webkit.org/show_bug.cgi?id=162167
3266
3267         Reviewed by Simon Fraser.
3268
3269         Remove the automatic text size adjustment code guarded by ENABLE(TEXT_AUTOSIZING)
3270         because it is not used by any port. On Mac and iOS, analogous code guarded by
3271         ENABLE(IOS_TEXT_AUTOSIZING) is used.
3272
3273         * CMakeLists.txt:
3274         * Configurations/FeatureDefines.xcconfig:
3275         * dom/Document.cpp:
3276         (WebCore::Document::Document):
3277         * dom/Document.h:
3278         (WebCore::Document::textAutosizer): Deleted.
3279         * page/FrameView.cpp:
3280         (WebCore::FrameView::setFrameRect):
3281         (WebCore::FrameView::layout):
3282         * page/Settings.cpp:
3283         (WebCore::Settings::Settings):
3284         (WebCore::Settings::setTextAutosizingFontScaleFactor): Deleted.
3285         * page/Settings.h:
3286         (WebCore::Settings::textAutosizingFontScaleFactor): Deleted.
3287         * page/animation/CSSPropertyAnimation.cpp:
3288         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
3289         * rendering/RenderingAllInOne.cpp:
3290         * rendering/TextAutosizer.cpp: Removed.
3291         * rendering/TextAutosizer.h: Removed.
3292         * rendering/style/RenderStyle.cpp:
3293         (WebCore::RenderStyle::changeRequiresLayout):
3294         (WebCore::RenderStyle::lineHeight):
3295         (WebCore::RenderStyle::setFontSize):
3296         * rendering/style/RenderStyle.h:
3297         (WebCore::RenderStyle::textAutosizingMultiplier): Deleted.
3298         (WebCore::RenderStyle::setTextAutosizingMultiplier): Deleted.
3299         * rendering/style/StyleVisualData.cpp:
3300         (WebCore::StyleVisualData::StyleVisualData):
3301         * rendering/style/StyleVisualData.h:
3302         * testing/InternalSettings.cpp:
3303         (WebCore::InternalSettings::Backup::Backup):