Remove CSS regions related fields from RenderStyle
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-09-24  Antti Koivisto  <antti@apple.com>
2
3         Remove CSS regions related fields from RenderStyle
4         https://bugs.webkit.org/show_bug.cgi?id=177415
5
6         Reviewed by Sam Weinig.
7
8         * css/CSSPrimitiveValueMappings.h:
9         (WebCore::CSSPrimitiveValue::operator RegionFragment const): Deleted.
10         * css/StyleResolver.cpp:
11         (WebCore::StyleResolver::adjustRenderStyle):
12         * rendering/RenderBlock.cpp:
13         (WebCore::RenderBlock::avoidsFloats const): Deleted.
14         * rendering/RenderBlock.h:
15         * rendering/RenderBlockFlow.cpp:
16         (WebCore::RenderBlockFlow::hasNextPage const):
17         * rendering/RenderLayer.cpp:
18         (WebCore::RenderLayer::calculateClipRects const):
19         * rendering/style/RenderStyle.cpp:
20         (WebCore::RenderStyle::changeRequiresLayout const):
21         * rendering/style/RenderStyle.h:
22         (WebCore::pseudoElementRendererIsNeeded):
23         (WebCore::RenderStyle::hasFlowInto const): Deleted.
24         (WebCore::RenderStyle::flowThread const): Deleted.
25         (WebCore::RenderStyle::hasFlowFrom const): Deleted.
26         (WebCore::RenderStyle::regionThread const): Deleted.
27         (WebCore::RenderStyle::regionFragment const): Deleted.
28         (WebCore::RenderStyle::setFlowThread): Deleted.
29         (WebCore::RenderStyle::setRegionThread): Deleted.
30         (WebCore::RenderStyle::setRegionFragment): Deleted.
31         (WebCore::RenderStyle::initialFlowThread): Deleted.
32         (WebCore::RenderStyle::initialRegionThread): Deleted.
33         (WebCore::RenderStyle::initialRegionFragment): Deleted.
34         * rendering/style/RenderStyleConstants.h:
35         * rendering/style/StyleRareNonInheritedData.cpp:
36         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
37         (WebCore::StyleRareNonInheritedData::operator== const):
38         * rendering/style/StyleRareNonInheritedData.h:
39
40 2017-09-24  Joanmarie Diggs  <jdiggs@igalia.com>
41
42         [ATK] Object attributes are missing for ARIA live region roles
43         https://bugs.webkit.org/show_bug.cgi?id=171174
44
45         Reviewed by Chris Fleizach.
46
47         Expose the values of aria-live, aria-atomic, and aria-relevant via AtkObject
48         attributes on live region elements and their descendants. In order to accomplish
49         exposure on descendants, add AccessibilityObject::ariaLiveRegionAncestor(). Add an
50         optional argument, excludeIfOff, to AccessibilityObject::isInsideARIALiveRegion()
51         and AccessibilityObject::supportsARIALiveRegion(). This is needed because we need
52         to expose live region properties via ATK even in the case where the live region
53         is disabled/off, but supportsARIALiveRegion() deliberately checks if the live
54         region is enabled.
55
56         Tests: accessibility/aria-liveregion-marquee-default.html
57                accessibility/aria-liveregions-attributes.html
58
59         * accessibility/AccessibilityObject.cpp:
60         (WebCore::AccessibilityObject::isInsideARIALiveRegion const):
61         (WebCore::AccessibilityObject::ariaLiveRegionAncestor const):
62         (WebCore::AccessibilityObject::supportsARIALiveRegion const):
63         * accessibility/AccessibilityObject.h:
64         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
65         (webkitAccessibleGetAttributes):
66
67 2017-09-23  Youenn Fablet  <youenn@apple.com>
68
69         Remove SetterMayThrowException
70         https://bugs.webkit.org/show_bug.cgi?id=177408
71
72         Reviewed by Sam Weinig.
73
74         No change of behavior.
75
76         Updating IDLs to remove SetterMayThrowException as it is no longer needed.
77         Updating AttributeSetter to compute the return type using Functor.
78
79         * Modules/indexeddb/IDBIndex.idl:
80         * Modules/indexeddb/IDBObjectStore.idl:
81         * Modules/mediasource/MediaSource.idl:
82         * Modules/mediasource/SourceBuffer.idl:
83         * Modules/mediastream/RTCDataChannel.idl:
84         * Modules/webaudio/AnalyserNode.idl:
85         * Modules/webaudio/AudioNode.idl:
86         * Modules/webaudio/ConvolverNode.idl:
87         * Modules/webaudio/OscillatorNode.idl:
88         * Modules/websockets/WebSocket.idl:
89         * bindings/js/JSDOMAttribute.h:
90         (WebCore::AttributeSetter::call):
91         (WebCore::AttributeSetter<ExceptionOr<void>>::call): Deleted.
92         (WebCore::AttributeSetter<void>::call): Deleted.
93         * bindings/scripts/CodeGeneratorJS.pm:
94         (GenerateAttributeSetterBodyDefinition):
95         * bindings/scripts/IDLAttributes.json:
96         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
97         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
98         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
99         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
100         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
101         * bindings/scripts/test/JS/JSTestInterface.cpp:
102         * bindings/scripts/test/JS/JSTestNode.cpp:
103         * bindings/scripts/test/JS/JSTestObj.cpp:
104         * bindings/scripts/test/JS/JSTestSerialization.cpp:
105         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
106         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
107         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
108         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
109         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
110         * bindings/scripts/test/TestObj.idl:
111         * bindings/scripts/test/TestTypedefs.idl:
112         * css/CSSRule.idl:
113         * css/CSSStyleDeclaration.idl:
114         * css/DeprecatedCSSOMValue.idl:
115         * css/FontFace.idl:
116         * css/MediaList.idl:
117         * dom/Document.idl:
118         * dom/Element.idl:
119         * dom/Node.idl:
120         * dom/ShadowRoot.idl:
121         * html/DOMURL.idl:
122         * html/HTMLElement.idl:
123         * html/HTMLInputElement.idl:
124         * html/HTMLMarqueeElement.idl:
125         * html/HTMLMediaElement.idl:
126         * html/HTMLOptionsCollection.idl:
127         * html/HTMLSelectElement.idl:
128         * html/HTMLTableElement.idl:
129         * html/HTMLTextAreaElement.idl:
130         * html/MediaController.idl:
131         * html/track/VTTCue.idl:
132         * html/track/VTTRegion.idl:
133         * page/History.idl:
134         * page/Location.idl:
135         * svg/SVGAltGlyphElement.idl:
136         * svg/SVGAngle.idl:
137         * svg/SVGAnimatedBoolean.idl:
138         * svg/SVGAnimatedEnumeration.idl:
139         * svg/SVGAnimatedInteger.idl:
140         * svg/SVGAnimatedNumber.idl:
141         * svg/SVGAnimatedString.idl:
142         * svg/SVGLength.idl:
143         * svg/SVGMatrix.idl:
144         * svg/SVGNumber.idl:
145         * svg/SVGPoint.idl:
146         * svg/SVGPreserveAspectRatio.idl:
147         * svg/SVGRect.idl:
148         * svg/SVGViewSpec.idl:
149         * xml/XMLHttpRequest.idl:
150
151 2017-09-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
152
153         Images may render partial frames even after loading all the encoded data
154         https://bugs.webkit.org/show_bug.cgi?id=177406
155
156         Reviewed by Simon Fraser.
157
158         Because we do not want to block the main thread waiting for the image decoding
159         thread to terminate, we let the decoding thread finish its work even it will
160         be thrown away. If a new decoding thread is created and the SynchronizedFixedQueue
161         is reopened, the terminating decoding thread might have the chance to process
162         a new frame request. After it finishes decoding it, it realize that it is
163         terminating so it will drop the decoded frame to the floor. So the new request
164         was not processed by the new thread and because it was processed by the
165         terminating thread, nothing will be reported to the BitmapImage object and
166         the renderer will not be repainted.
167
168         The fix is to create a new SynchronizedFixedQueue every time a decoding 
169         thread is created. This will guarantee that the terminating thread won't
170         have access to the new frame request and will shut down after being notified
171         by the old SynchronizedFixedQueue that it has been closed.
172
173         * platform/graphics/ImageFrameCache.cpp:
174         (WebCore::ImageFrameCache::frameRequestQueue):
175         (WebCore::ImageFrameCache::startAsyncDecodingQueue):
176         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
177         (WebCore::ImageFrameCache::stopAsyncDecodingQueue):
178         * platform/graphics/ImageFrameCache.h:
179
180 2017-09-22  Zalan Bujtas  <zalan@apple.com>
181
182         WeakPtrFactory should populate m_ref lazily.
183         https://bugs.webkit.org/show_bug.cgi?id=177375
184
185         Reviewed by Geoffrey Garen.
186
187         * Modules/encryptedmedia/CDM.cpp:
188         (WebCore::CDM::CDM):
189         * Modules/encryptedmedia/CDM.h:
190         (WebCore::CDM::createWeakPtr):
191         * Modules/encryptedmedia/MediaKeySession.cpp:
192         (WebCore::MediaKeySession::MediaKeySession):
193         (WebCore::MediaKeySession::generateRequest):
194         (WebCore::MediaKeySession::load):
195         (WebCore::MediaKeySession::update):
196         (WebCore::MediaKeySession::close):
197         (WebCore::MediaKeySession::remove):
198         * Modules/encryptedmedia/MediaKeys.cpp:
199         (WebCore::MediaKeys::MediaKeys):
200         (WebCore::MediaKeys::createSession):
201         * Modules/mediastream/MediaDevices.cpp:
202         (WebCore::MediaDevices::MediaDevices):
203         * Modules/mediastream/MediaDevices.h:
204         (WebCore::MediaDevices::createWeakPtr):
205         * Modules/mediastream/MediaStreamTrack.cpp:
206         (WebCore::MediaStreamTrack::MediaStreamTrack):
207         * Modules/mediastream/MediaStreamTrack.h:
208         (WebCore::MediaStreamTrack::createWeakPtr):
209         * accessibility/AccessibilityRenderObject.cpp:
210         (WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
211         * accessibility/AccessibilityRenderObject.h:
212         (WebCore::AccessibilityRenderObject::createWeakPtr):
213         * animation/WebAnimation.cpp:
214         (WebCore::WebAnimation::WebAnimation):
215         * animation/WebAnimation.h:
216         * css/FontFace.cpp:
217         (WebCore::FontFace::FontFace):
218         (WebCore::FontFace::createWeakPtr):
219         (WebCore::FontFace::createWeakPtr const): Deleted.
220         * css/FontFace.h:
221         * css/StyleSheetContents.h:
222         * dom/DataTransferItemList.cpp:
223         (WebCore::DataTransferItemList::DataTransferItemList):
224         (WebCore::DataTransferItemList::add):
225         (WebCore::DataTransferItemList::ensureItems const):
226         (WebCore::DataTransferItemList::didSetStringData):
227         * dom/Document.cpp:
228         (WebCore::Document::postTask):
229         * dom/Document.h:
230         (WebCore::Document::createWeakPtr):
231         * html/HTMLMediaElement.cpp:
232         (WebCore::HTMLMediaElement::HTMLMediaElement):
233         * html/HTMLMediaElement.h:
234         (WebCore::HTMLMediaElement::createWeakPtr):
235         * html/HTMLPictureElement.h:
236         * html/parser/HTMLResourcePreloader.h:
237         (WebCore::HTMLResourcePreloader::HTMLResourcePreloader):
238         (WebCore::HTMLResourcePreloader::createWeakPtr):
239         * loader/LinkLoader.cpp:
240         (WebCore::LinkLoader::LinkLoader):
241         * loader/LinkLoader.h:
242         (WebCore::LinkLoader::createWeakPtr):
243         * loader/MediaResourceLoader.cpp:
244         (WebCore::MediaResourceLoader::MediaResourceLoader):
245         * loader/MediaResourceLoader.h:
246         * page/DOMWindow.cpp:
247         (WebCore::DOMWindow::DOMWindow):
248         * page/DOMWindow.h:
249         * platform/GenericTaskQueue.cpp:
250         (WebCore::TaskDispatcher<Timer>::TaskDispatcher):
251         (WebCore::TaskDispatcher<Timer>::postTask):
252         * platform/GenericTaskQueue.h:
253         (WebCore::GenericTaskQueue::GenericTaskQueue):
254         (WebCore::GenericTaskQueue::enqueueTask):
255         * platform/ScrollableArea.h:
256         (WebCore::ScrollableArea::createWeakPtr):
257         * platform/Scrollbar.cpp:
258         (WebCore::Scrollbar::Scrollbar):
259         * platform/Scrollbar.h:
260         (WebCore::Scrollbar::createWeakPtr):
261         * platform/Widget.h:
262         (WebCore::Widget::createWeakPtr):
263         * platform/audio/mac/AudioHardwareListenerMac.cpp:
264         (WebCore::AudioHardwareListenerMac::AudioHardwareListenerMac):
265         * platform/graphics/FontCascade.cpp:
266         (WebCore::FontCascade::FontCascade):
267         * platform/graphics/FontCascade.h:
268         (WebCore::FontCascade::createWeakPtr const):
269         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
270         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
271         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
272         (WebCore::MediaPlayerPrivateAVFoundation::createWeakPtr):
273         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
274         (WebCore::CDMSessionAVFoundationObjC::createWeakPtr):
275         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
276         (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
277         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
278         (WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
279         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
280         (WebCore::MediaPlayerPrivateAVFoundationObjC::createWeakPtr):
281         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
282         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
283         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
284         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::createWeakPtr):
285         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
286         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
287         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
288         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
289         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
290         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
291         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
292         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
293         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
294         (WebCore::SourceBufferPrivateAVFObjC::append):
295         (WebCore::SourceBufferPrivateAVFObjC::abort):
296         * platform/graphics/cv/TextureCacheCV.mm:
297         (WebCore::TextureCacheCV::TextureCacheCV):
298         (WebCore::TextureCacheCV::textureFromImage):
299         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
300         (WebCore::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
301         (WebCore::DisplayRefreshMonitorMac::displayLinkFired):
302         * platform/ios/RemoteCommandListenerIOS.h:
303         (WebCore::RemoteCommandListenerIOS::createWeakPtr):
304         * platform/ios/RemoteCommandListenerIOS.mm:
305         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
306         * platform/mac/RemoteCommandListenerMac.h:
307         (WebCore::RemoteCommandListenerMac::createWeakPtr):
308         * platform/mediastream/MediaStreamPrivate.cpp:
309         (WebCore::MediaStreamPrivate::MediaStreamPrivate):
310         * platform/mediastream/MediaStreamPrivate.h:
311         (WebCore::MediaStreamPrivate::createWeakPtr):
312         * platform/mediastream/RealtimeMediaSource.cpp:
313         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
314         * platform/mediastream/RealtimeMediaSource.h:
315         * platform/mock/MockMediaEndpoint.cpp:
316         (WebCore::MockMediaEndpoint::MockMediaEndpoint):
317         (WebCore::MockMediaEndpoint::generateDtlsInfo):
318         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
319         (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
320         * rendering/RenderMultiColumnSpannerPlaceholder.h:
321         * rendering/RenderView.cpp:
322         (WebCore::RenderView::RenderView):
323         * rendering/RenderView.h:
324         * rendering/RenderWidget.cpp:
325         (WebCore::RenderWidget::RenderWidget):
326         * rendering/RenderWidget.h:
327         (WebCore::RenderWidget::createWeakPtr):
328         * rendering/RootInlineBox.cpp:
329         (WebCore::RootInlineBox::RootInlineBox):
330         * rendering/RootInlineBox.h:
331         (WebCore::RootInlineBox::createWeakPtr):
332         * svg/SVGPathElement.cpp:
333         (WebCore::SVGPathElement::SVGPathElement):
334         * svg/SVGPathElement.h:
335         * svg/properties/SVGMatrixTearOff.h:
336         * testing/MockCDMFactory.cpp:
337         (WebCore::MockCDMFactory::MockCDMFactory):
338         (WebCore::MockCDMFactory::createCDM):
339         (WebCore::MockCDM::MockCDM):
340         (WebCore::MockCDM::createInstance):
341         (WebCore::m_weakPtrFactory): Deleted.
342
343 2017-09-22  Tim Horton  <timothy_horton@apple.com>
344
345         Add env() as an alias of constant()
346         https://bugs.webkit.org/show_bug.cgi?id=177371
347
348         Reviewed by Simon Fraser.
349
350         * css/CSSValueKeywords.in:
351         * css/CSSVariableData.cpp:
352         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
353         (WebCore::CSSVariableData::resolveTokenRange const):
354         * css/parser/CSSVariableParser.cpp:
355         (WebCore::classifyBlock):
356         Add env() as an alias of constant() everywhere it is mentioned.
357
358 2017-09-22  Basuke Suzuki  <Basuke.Suzuki@sony.com>
359
360         [Curl] Use didReceiveBuffer instead of didReceiveData
361         https://bugs.webkit.org/show_bug.cgi?id=177260
362
363         Reviewed by Alex Christensen.
364
365         * platform/network/curl/CurlCacheEntry.cpp:
366         (WebCore::CurlCacheEntry::readCachedData):
367         * platform/network/curl/MultipartHandle.cpp:
368         (WebCore::MultipartHandle::didReceiveData):
369         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
370         (WebCore::ResourceHandleCurlDelegate::didReceiveContentData):
371         (WebCore::ResourceHandleCurlDelegate::handleDataURL):
372         (WebCore::ResourceHandleCurlDelegate::didReceiveData):
373         (WebCore::ResourceHandleCurlDelegate::didReceiveDataCallback):
374         * platform/network/curl/ResourceHandleCurlDelegate.h:
375
376 2017-09-22  John Wilander  <wilander@apple.com>
377
378         Non-prevalent resources should be allowed access to existing cookies in a third-party context
379         https://bugs.webkit.org/show_bug.cgi?id=177336
380         <rdar://problem/34578257>
381
382         Reviewed by Brent Fulgham.
383
384         No new tests. I will update existing tests and add at least
385         one new test in a follow-up patch,
386         see https://bugs.webkit.org/show_bug.cgi?id=177337. Need to
387         land this to meet submission deadline and fix the regression.
388
389         This patch restructures what is communicated to the network process,
390         from two vectors - with user interaction and without user interaction -
391         to three vectors - to partition, to block, to neither partition nor block.
392         The previous two vectors did not allow proper categorization into which
393         domains should be partitioned, blocked, or left alone. That was the cause
394         of the regression where non-prevalent third-party domains erroneously had
395         their cookies blocked when they should fall back to the old behavior of
396         access but no new cookies allowed to be set.
397
398         * loader/ResourceLoadStatistics.cpp:
399         (WebCore::ResourceLoadStatistics::toString const):
400         (WebCore::ResourceLoadStatistics::merge):
401         * loader/ResourceLoadStatistics.h:
402         * platform/network/NetworkStorageSession.h:
403         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
404         (WebCore::NetworkStorageSession::shouldPartitionCookies const):
405         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
406         (WebCore::NetworkStorageSession::shouldBlockCookies const):
407         (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
408         (WebCore::NetworkStorageSession::removePrevalentDomains):
409         (WebCore::NetworkStorageSession::shouldAllowThirdPartyCookies const): Deleted.
410         (WebCore::NetworkStorageSession::setPrevalentDomainsWithAndWithoutInteraction): Deleted.
411         * platform/network/mac/CookieJarMac.mm:
412         (WebCore::cookiesInBlockedForURL):
413         (WebCore::cookiesForURL):
414
415 2017-09-22  Fujii Hironori  <Hironori.Fujii@sony.com>
416
417         [CMake][Win] EventTargetInterfaces.h are generated twice
418         https://bugs.webkit.org/show_bug.cgi?id=177286
419
420         Reviewed by Brent Fulgham.
421
422         EventTargetInterfaces.h are generated twice in both
423         WebCoreDerivedSources.vcxproj and WebCore.vcxproj. This causes
424         unnecessary recompilation in CMake VisualStudio build.
425
426         WebCore target already has a dependency to WebCoreDerivedSources
427         target by calling add_dependencies. WebCore target doesn't need to
428         generate it.
429
430         * CMakeLists.txt: Don't ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES with EventTargetInterfaces.h.
431
432 2017-09-22  Antti Koivisto  <antti@apple.com>
433
434         Add asserts against layout time render tree mutations
435         https://bugs.webkit.org/show_bug.cgi?id=177361
436
437         Reviewed by Zalan Bujtas.
438
439         We don't have any mutations left. Add asserts.
440
441         * rendering/RenderElement.cpp:
442         (WebCore::RenderElement::insertChildInternal):
443         (WebCore::RenderElement::removeChildInternal):
444
445 2017-09-22  Chris Dumez  <cdumez@apple.com>
446
447         Use high resolution timestamp for event time
448         https://bugs.webkit.org/show_bug.cgi?id=154246
449         <rdar://problem/34333304>
450
451         Reviewed by Ryosuke Niwa.
452
453         Have event.timeStamp return a DOMHighResTimeStamp instead of a DOMResTimeStamp. It now
454         has better precision, is monotonic and is relative to PerformanceTiming.navigationStart.
455
456         This is as per:
457         - https://dom.spec.whatwg.org/#interface-event
458
459         Chrome, Firefox and Edge all already ship this so the compatibility risk should be low.
460
461         Also use WallTime / MonotonicTime instead of double type for clarity.
462
463         Test: imported/w3c/web-platform-tests/dom/events/Event-timestamp-high-resolution.html
464
465         * WebCore.xcodeproj/project.pbxproj:
466         * dom/DOMHighResTimeStamp.h: Copied from Source/WebKit/Shared/WebTouchEvent.cpp.
467         * dom/Element.cpp:
468         (WebCore::Element::dispatchMouseForceWillBegin):
469         * dom/Event.cpp:
470         (WebCore::Event::Event):
471         (WebCore::Event::timeStampForBindings const):
472         * dom/Event.h:
473         (WebCore::Event::timeStamp const):
474         * dom/Event.idl:
475         * dom/KeyboardEvent.cpp:
476         (WebCore::KeyboardEvent::KeyboardEvent):
477         * dom/MouseEvent.cpp:
478         (WebCore::MouseEvent::create):
479         (WebCore::MouseEvent::MouseEvent):
480         * dom/MouseEvent.h:
481         * dom/MouseRelatedEvent.cpp:
482         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
483         * dom/MouseRelatedEvent.h:
484         * dom/SimulatedClick.cpp:
485         * dom/TouchEvent.cpp:
486         (WebCore::TouchEvent::TouchEvent):
487         * dom/UIEvent.cpp:
488         (WebCore::UIEvent::UIEvent):
489         * dom/UIEvent.h:
490         * dom/UIEventWithKeyState.h:
491         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
492         * dom/WheelEvent.cpp:
493         (WebCore::WheelEvent::WheelEvent):
494         * html/TypeAhead.cpp:
495         (WebCore::TypeAhead::TypeAhead):
496         (WebCore::TypeAhead::handleEvent):
497         * html/TypeAhead.h:
498         * page/AutoscrollController.cpp:
499         (WebCore::AutoscrollController::AutoscrollController):
500         (WebCore::AutoscrollController::updateDragAndDrop):
501         (WebCore::AutoscrollController::autoscrollTimerFired):
502         * page/AutoscrollController.h:
503         * page/ContextMenuController.cpp:
504         (WebCore::ContextMenuController::showContextMenuAt):
505         * page/DragController.cpp:
506         (WebCore::createMouseEvent):
507         * page/EventHandler.cpp:
508         (WebCore::EventHandler::dispatchDragEvent):
509         (WebCore::EventHandler::sendContextMenuEventForKey):
510         (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
511         * page/EventHandler.h:
512         * page/Performance.cpp:
513         (WebCore::Performance::now const):
514         (WebCore::Performance::relativeTimeFromTimeOriginInReducedResolution const):
515         * page/Performance.h:
516         * page/ios/EventHandlerIOS.mm:
517         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
518         * page/win/EventHandlerWin.cpp:
519         * platform/PlatformEvent.h:
520         (WebCore::PlatformEvent::timestamp const):
521         (WebCore::PlatformEvent::PlatformEvent):
522         * platform/PlatformKeyboardEvent.h:
523         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
524         * platform/PlatformMouseEvent.h:
525         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
526         * platform/PlatformWheelEvent.h:
527         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
528         * platform/cocoa/ScrollController.mm:
529         (WebCore::ScrollController::handleWheelEvent):
530         * platform/glib/EventHandlerGLib.cpp:
531         * platform/gtk/ScrollAnimatorGtk.cpp:
532         (WebCore::ScrollAnimatorGtk::computeVelocity):
533         (WebCore::ScrollAnimatorGtk::handleWheelEvent):
534         * platform/ios/PlatformEventFactoryIOS.mm:
535         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
536         (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder):
537         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
538         (WebCore::PlatformTouchEventBuilder::PlatformTouchEventBuilder):
539         * platform/mac/PlatformEventFactoryMac.h:
540         * platform/mac/PlatformEventFactoryMac.mm:
541         (WebCore::eventTimeStampSince1970):
542
543 2017-09-22  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
544
545         [GTK] HTMLMediaElement resize event not fired when video size changes
546         https://bugs.webkit.org/show_bug.cgi?id=174582
547
548         Reviewed by Xabier Rodriguez-Calvar.
549
550         Modify AppendPipeline to notify MediaPlayerPrivateGStreamerMSE that a track is detected
551         not only for the initial track detection but also for subsequent in particular when the
552         video size has changed.
553
554         Update test expectation for new passing tests.
555
556         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
557         (WebCore::AppendPipeline::appsinkCapsChanged):
558         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
559         * platform/graphics/gstreamer/mse/AppendPipeline.h:
560         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
561         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
562         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
563         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
564         (WebCore::PlaybackPipeline::reattachTrack):
565         * platform/graphics/gstreamer/mse/PlaybackPipeline.h:
566
567 2017-09-22  Ms2ger  <Ms2ger@igalia.com>
568
569         [GTK] Couple of pasteboard related tests are failing after r222228
570         https://bugs.webkit.org/show_bug.cgi?id=177295
571
572         Reviewed by Michael Catanzaro.
573
574         Call writeToClipboard() from Pasteboard::writeString() on GTK.
575
576         When writePasteboard was replaced by commitToPasteboard in r222228,
577         the call to writeToClipboard() did not make it into the
578         platform-neutral code. This attempts to find another place in the
579         GTK-specific code to make the call.
580
581         Tests: editing/pasteboard/copy-without-selection.html
582                editing/pasteboard/pasting-empty-html-falls-back-to-text.html
583
584         * platform/gtk/PasteboardGtk.cpp:
585         (WebCore::Pasteboard::writeString):
586
587 2017-09-21  Brent Fulgham  <bfulgham@apple.com>
588
589         REGRESSION (r221017): iCloud mail logs me out after looking at a few messages
590         https://bugs.webkit.org/show_bug.cgi?id=177328
591
592         Reviewed by Daniel Bates.
593         <rdar://problem/34288629>
594
595         Reviewed by Dan Bates.
596
597         This site was triggering a log-out because the page was loading insecure images. We don't treat that as a security
598         issue for deciding to display mixed content since it can only affect pixels on screen, not trigger a change in
599         program logic or persistent storage.
600
601         Consequently, we can correct thsi compatibility problem without relaxing the security fix by not blocking Secure cookies
602         when we have merely displayed mixed content (i.e., encountered 'Inactive' mixed content), as opposed to executing mixed
603         content (i.e., loaded 'Active' mixed content).
604
605         * Modules/geolocation/Geolocation.cpp:
606         (WebCore::Geolocation::shouldBlockGeolocationRequests): Revise for new API.
607         * dom/SecurityContext.h:
608         (WebCore::SecurityContext::foundMixedContent const): Change to return an OptionSet of
609         mixed content types.
610         (WebCore::SecurityContext::setFoundMixedContent): Accept an enum stating the type of mixed content found.
611         * loader/CookieJar.cpp:
612         (WebCore::cookies): Only block Secure cookies for Active mixed content.
613         (WebCore::cookieRequestHeaderFieldValue): Ditto.
614         * loader/MixedContentChecker.cpp:
615         (WebCore::MixedContentChecker::canDisplayInsecureContent const): Mark the context as having found 'Inactive'
616         mixed content.
617         (WebCore::MixedContentChecker::canRunInsecureContent const): Mark the context as having found 'Active'
618         mixed content.
619
620 2017-09-21  Simon Fraser  <simon.fraser@apple.com>
621
622         Clean up RenderLayer z-order traversal code
623         https://bugs.webkit.org/show_bug.cgi?id=177325
624
625         Reviewed by Zalan Bujtas.
626
627         Remove isStackingContainer() checks before accessing posZOrderList() or negZOrderList();
628         we already have assertions in place to ensure that only stacking containers have non-null lists.
629
630         Use more auto.
631
632         No behavior change.
633
634         * rendering/RenderLayer.cpp:
635         (WebCore::RenderLayer::update3DTransformedDescendantStatus):
636         (WebCore::RenderLayer::calculateClipRects const):
637         * rendering/RenderLayerBacking.cpp:
638         (WebCore::traverseVisibleNonCompositedDescendantLayers):
639         * rendering/RenderLayerCompositor.cpp:
640         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
641         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
642         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
643         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
644         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
645         (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
646         (WebCore::RenderLayerCompositor::layerHas3DContent const):
647         * rendering/RenderTreeAsText.cpp:
648         (WebCore::writeLayers):
649
650 2017-09-21  Per Arne Vollan  <pvollan@apple.com>
651
652         Unreviewed Windows build fix after r222360.
653
654         * PlatformWin.cmake:
655
656 2017-09-21  Youenn Fablet  <youenn@apple.com>
657
658         Remove the need for SetterMayThrowException
659         https://bugs.webkit.org/show_bug.cgi?id=177099
660
661         Reviewed by Sam Weinig.
662
663         No change of behavior.
664         Introducing AttributeSetter to handle exception raising attribute setters,
665         based on the C++ class method instead of SetterMayThrowException.
666         A follow-up patch should remove SetterMayThrowException from the IDLs
667
668         * bindings/js/JSDOMAttribute.h:
669         (WebCore::AttributeSetter<ExceptionOr<void>>::call):
670         (WebCore::AttributeSetter<void>::call):
671         * bindings/scripts/CodeGeneratorJS.pm:
672         (GenerateAttributeSetterBodyDefinition):
673         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
674         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
675         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
676         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
677         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
678         * bindings/scripts/test/JS/JSTestInterface.cpp:
679         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
680         * bindings/scripts/test/JS/JSTestNode.cpp:
681         * bindings/scripts/test/JS/JSTestObj.cpp:
682         * bindings/scripts/test/JS/JSTestSerialization.cpp:
683         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
684         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
685         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
686         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
687         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
688
689 2017-09-21  Ryosuke Niwa  <rniwa@webkit.org>
690
691         DataTransfer.items should contain text/html and text/uri-list
692         https://bugs.webkit.org/show_bug.cgi?id=176772
693         <rdar://problem/34386899>
694
695         Reviewed by Darin Adler.
696
697         Expose text/html and text/uri-list in dataTransfer.items.
698
699         Tests: editing/pasteboard/datatransfer-items-copy-html.html
700                editing/pasteboard/datatransfer-items-copy-url.html
701
702         * dom/DataTransferItemList.cpp:
703         (WebCore::isSupportedType): Added both MIME types.
704         (WebCore::DataTransferItemList::add): Fixed the bug that new data transfer item was using
705         the original type string instead of the lowercased one.
706
707 2017-09-21  Per Arne Vollan  <pvollan@apple.com>
708
709         [Win] Compile error, PALHeaderDetection.h not found.
710         https://bugs.webkit.org/show_bug.cgi?id=177309
711
712         Reviewed by Brent Fulgham.
713
714         Copy PAL header files to WebCore forwarding headers folder.
715
716         * PlatformWin.cmake:
717
718 2017-09-21  Joseph Pecoraro  <pecoraro@apple.com>
719
720         Web Inspector: Remove support for CSS Regions
721         https://bugs.webkit.org/show_bug.cgi?id=177287
722
723         Reviewed by Matt Baker.
724
725         * inspector/InspectorCSSAgent.cpp:
726         (WebCore::InspectorCSSAgent::getNamedFlowCollection): Deleted.
727         * inspector/InspectorCSSAgent.h:
728         * inspector/InspectorOverlay.cpp:
729         (WebCore::buildRendererHighlight):
730         (WebCore::buildNodeHighlight):
731         (WebCore::InspectorOverlay::getHighlight const):
732         (WebCore::buildArrayForRendererFragments):
733         (WebCore::buildQuadObjectForCSSRegionContentClip): Deleted.
734         * inspector/InspectorOverlayPage.js:
735         (_createElementTitle):
736         (_drawElementTitle):
737         (_drawFragmentHighlight):
738         (drawNodeHighlight):
739         (_drawRegionNumber): Deleted.
740         (_quadMidPoint): Deleted.
741         (_drawRegionLink): Deleted.
742         (_drawRegionsHighlight): Deleted.
743
744 2017-09-21  Antti Koivisto  <antti@apple.com>
745
746         Remove some more code from RenderFlowThread
747         https://bugs.webkit.org/show_bug.cgi?id=177320
748
749         Reviewed by David Hyatt.
750
751         More dead code related to named flows.
752
753         * rendering/RenderFlowThread.cpp:
754         (WebCore::RenderFlowThread::RenderFlowThread):
755         (WebCore::RenderFlowThread::invalidateRegions):
756         (WebCore::RenderFlowThread::layout):
757         (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
758         (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
759         (WebCore::RenderFlowThread::addForcedRegionBreak):
760         (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion const):
761         (WebCore::RenderFlowThread::hasCachedOffsetFromLogicalTopOfFirstRegion const): Deleted.
762         (WebCore::RenderFlowThread::cachedOffsetFromLogicalTopOfFirstRegion const): Deleted.
763         (WebCore::RenderFlowThread::setOffsetFromLogicalTopOfFirstRegion): Deleted.
764         (WebCore::RenderFlowThread::clearOffsetFromLogicalTopOfFirstRegion): Deleted.
765         (WebCore::RenderFlowThread::currentActiveRenderBox const): Deleted.
766         (WebCore::RenderFlowThread::pushFlowThreadLayoutState): Deleted.
767         (WebCore::RenderFlowThread::popFlowThreadLayoutState): Deleted.
768         * rendering/RenderFlowThread.h:
769
770 2017-09-21  Chris Dumez  <cdumez@apple.com>
771
772         eventInitDict parameter to GamepadEvent constructor should be optional
773         https://bugs.webkit.org/show_bug.cgi?id=177308
774
775         Reviewed by Sam Weinig.
776
777         eventInitDict parameter to GamepadEvent constructor should be optional to match Firefox
778         and Chrome. Having such dictionary parameter is also not valid Web IDL:
779         """
780         If the type of an argument is a dictionary type (or a union type that has a dictionary as one
781         of its flattened member types), and that dictionary type and its ancestors have no required
782         members, and the argument is either the final argument or is followed only by optional arguments,
783         then the argument must be specified as optional. Such arguments are always considered to have a
784         default value of an empty dictionary, unless otherwise specified.
785         """
786
787         Test: gamepad/gamepad-event.html
788
789         * Modules/gamepad/GamepadEvent.idl:
790
791 2017-09-21  Brian Burg  <bburg@apple.com>
792
793         Web Inspector: keyboard shortcut for "Reload page from origin" doesn't match Safari, and doesn't work
794         https://bugs.webkit.org/show_bug.cgi?id=177010
795         <rdar://problem/33134548>
796
797         Reviewed by Joseph Pecoraro.
798
799         Use "reload from origin" nomenclature instead of "reload ignoring cache".
800
801         * inspector/InspectorPageAgent.cpp:
802         (WebCore::InspectorPageAgent::reload):
803         * inspector/InspectorPageAgent.h:
804
805 2017-09-21  Antti Koivisto  <antti@apple.com>
806
807         Remove RenderNamedFlowFragment
808         https://bugs.webkit.org/show_bug.cgi?id=177299
809
810         Reviewed by David Hyatt.
811
812         Remove the remaining named flow rendering code.
813
814         The feature is already disabled, no functional changes.
815
816         * WebCore.xcodeproj/project.pbxproj:
817         * rendering/RenderBlock.cpp:
818         (WebCore::RenderBlock::paint):
819         (WebCore::RenderBlock::selectionGaps):
820         (WebCore::RenderBlock::nodeAtPoint):
821         * rendering/RenderBlockFlow.cpp:
822         (WebCore::RenderBlockFlow::insertedIntoTree):
823         (WebCore::RenderBlockFlow::willBeDestroyed):
824         (WebCore::RenderBlockFlow::layoutBlock):
825         (WebCore::RenderBlockFlow::styleDidChange):
826         (WebCore::RenderBlockFlow::updateLogicalHeight):
827         (WebCore::RenderBlockFlow::positionForPoint):
828         (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded): Deleted.
829         (WebCore::RenderBlockFlow::canHaveChildren const): Deleted.
830         (WebCore::RenderBlockFlow::canHaveGeneratedChildren const): Deleted.
831         (WebCore::RenderBlockFlow::namedFlowFragmentNeedsUpdate const): Deleted.
832         (WebCore::RenderBlockFlow::setRenderNamedFlowFragment): Deleted.
833         * rendering/RenderBlockFlow.h:
834         (WebCore::RenderBlockFlow::RenderBlockFlowRareData::RenderBlockFlowRareData):
835         (WebCore::RenderBlockFlow::renderNamedFlowFragment const): Deleted.
836         (WebCore::RenderElement::isRenderNamedFlowFragmentContainer const): Deleted.
837         * rendering/RenderBox.cpp:
838         (WebCore::RenderBox::nodeAtPoint):
839         (WebCore::RenderBox::paintBoxDecorations):
840         (WebCore::RenderBox::pushContentsClip):
841         (WebCore::RenderBox::mapLocalToContainer const):
842         (WebCore::RenderBox::isUnsplittableForPagination const):
843         (WebCore::RenderBox::overflowRectForPaintRejection const):
844         * rendering/RenderBox.h:
845         * rendering/RenderBoxModelObject.cpp:
846         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
847         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
848         * rendering/RenderBoxModelObject.h:
849         * rendering/RenderElement.h:
850         (WebCore::RenderElement::generatingElement const):
851         * rendering/RenderFlowThread.cpp:
852         (WebCore::RenderFlowThread::RenderFlowThread):
853         (WebCore::RenderFlowThread::invalidateRegions):
854         (WebCore::RenderFlowThread::validateRegions):
855         (WebCore::RenderFlowThread::layout):
856         (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent const):
857         (WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle):
858         (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
859         (WebCore::RenderFlowThread::addForcedRegionBreak):
860         (WebCore::RenderFlowThread::hasCompositingRegionDescendant const): Deleted.
861         (WebCore::RenderFlowThread::getLayerListForRegion const): Deleted.
862         (WebCore::RenderFlowThread::regionForCompositedLayer const): Deleted.
863         (WebCore::RenderFlowThread::cachedRegionForCompositedLayer const): Deleted.
864         (WebCore::RenderFlowThread::updateLayerToRegionMappings): Deleted.
865         (WebCore::RenderFlowThread::updateAllLayerToRegionMappings): Deleted.
866         (WebCore::RenderFlowThread::collectsGraphicsLayersUnderRegions const): Deleted.
867         (WebCore::RenderFlowThread::isAutoLogicalHeightRegionsCountConsistent const): Deleted.
868         (WebCore::RenderFlowThread::initializeRegionsComputedAutoHeight): Deleted.
869         (WebCore::RenderFlowThread::markAutoLogicalHeightRegionsForLayout): Deleted.
870         (WebCore::RenderFlowThread::incrementAutoLogicalHeightRegions): Deleted.
871         (WebCore::RenderFlowThread::decrementAutoLogicalHeightRegions): Deleted.
872         * rendering/RenderFlowThread.h:
873         * rendering/RenderLayer.cpp:
874         (WebCore::RenderLayer::updateLayerPositions):
875         (WebCore::expandClipRectForDescendantsAndReflection):
876         (WebCore::RenderLayer::paintLayer):
877         (WebCore::RenderLayer::paintLayerContents):
878         (WebCore::RenderLayer::paintList):
879         (WebCore::isHitCandidate):
880         (WebCore::RenderLayer::hitTestLayer):
881         (WebCore::RenderLayer::hitTestList):
882         (WebCore::RenderLayer::calculateClipRects const):
883         (WebCore::expandClipRectForRegionAndReflection): Deleted.
884         (WebCore::RenderLayer::isFlowThreadCollectingGraphicsLayersUnderRegions const): Deleted.
885         (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer const): Deleted.
886         * rendering/RenderLayer.h:
887         * rendering/RenderLayerBacking.cpp:
888         (WebCore::RenderLayerBacking::shouldClipCompositedBounds const):
889         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
890         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
891         (WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread const): Deleted.
892         * rendering/RenderLayerBacking.h:
893         * rendering/RenderLayerCompositor.cpp:
894         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
895         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
896         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
897         (WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons):
898         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
899         (WebCore::RenderLayerCompositor::computeRegionCompositingRequirements): Deleted.
900         (WebCore::RenderLayerCompositor::rebuildRegionCompositingLayerTree): Deleted.
901         * rendering/RenderLayerCompositor.h:
902         * rendering/RenderNamedFlowFragment.cpp: Removed.
903         * rendering/RenderNamedFlowFragment.h: Removed.
904         * rendering/RenderObject.cpp:
905         (WebCore::RenderObject::containerForRepaint const):
906         (WebCore::RenderObject::fixedPositionedWithNamedFlowContainingBlock const): Deleted.
907         (WebCore::hasFixedPosInNamedFlowContainingBlock): Deleted.
908         (WebCore::RenderObject::currentRenderNamedFlowFragment const): Deleted.
909         * rendering/RenderObject.h:
910         (WebCore::RenderObject::isRenderRegion const):
911         (WebCore::RenderObject::isAnonymousBlock const):
912         (WebCore::RenderObject::isRenderNamedFlowFragment const): Deleted.
913         * rendering/RenderRegion.cpp:
914         * rendering/RenderRegion.h:
915         (WebCore::RenderRegion::hasAutoLogicalHeight const): Deleted.
916         * rendering/RenderReplaced.cpp:
917         (WebCore::RenderReplaced::shouldPaint):
918         * rendering/RenderTable.cpp:
919         (WebCore::RenderTable::overflowClipRect):
920         (WebCore::RenderTable::nodeAtPoint):
921         * rendering/RenderTableSection.cpp:
922         (WebCore::RenderTableSection::nodeAtPoint):
923         * rendering/RenderTreeAsText.cpp:
924         (WebCore::writeLayers):
925         * rendering/RenderView.cpp:
926         (WebCore::RenderView::layout):
927         (WebCore::RenderView::pushLayoutState):
928         (WebCore::RenderView::pushLayoutStateForPaginationIfNeeded):
929         (WebCore::RenderView::layoutContentInAutoLogicalHeightRegions): Deleted.
930         (WebCore::RenderView::checkTwoPassLayoutForAutoHeightRegions const): Deleted.
931         (WebCore::RenderView::pushLayoutStateForCurrentFlowThread): Deleted.
932         (WebCore::RenderView::popLayoutStateForCurrentFlowThread): Deleted.
933         * rendering/RenderView.h:
934         * rendering/RootInlineBox.cpp:
935         (WebCore::RootInlineBox::paint):
936         * rendering/svg/RenderSVGRoot.cpp:
937         (WebCore::RenderSVGRoot::paintReplaced):
938
939 2017-09-21  Alex Christensen  <achristensen@webkit.org>
940
941         Fix all builds after r222325
942
943         * loader/DocumentLoader.h:
944         WebKit needs this, too.
945
946 2017-09-21  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
947
948         [PAL] Move MediaTimeAVFoundation into PAL
949         https://bugs.webkit.org/show_bug.cgi?id=177222
950
951         Reviewed by Myles C. Maxfield.
952
953         No new tests. No change in behavior..
954
955         * Configurations/WebCore.unexp:
956         * PlatformAppleWin.cmake:
957         * WebCore.xcodeproj/project.pbxproj:
958         * platform/audio/mac/AudioSampleDataSource.mm:
959         (WebCore::AudioSampleDataSource::pushSamples):
960         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
961         (WebCore::AudioSourceProviderAVFObjC::process):
962         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
963         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
964         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
965         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
966         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
967         (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration const):
968         (WebCore::MediaPlayerPrivateAVFoundationCF::currentMediaTime const):
969         (WebCore::MediaPlayerPrivateAVFoundationCF::platformBufferedTimeRanges const):
970         (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable const):
971         (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable const):
972         (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded const):
973         (WebCore::AVFWrapper::seekToTime):
974         (WebCore::AVFWrapper::legibleOutputCallback):
975         (WebCore::AVFWrapper::createImageForTimeInRect):
976         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
977         (WebCore::ImageDecoderAVFObjC::readSampleMetadata):
978         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
979         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
980         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
981         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration const):
982         (WebCore::MediaPlayerPrivateAVFoundationObjC::currentMediaTime const):
983         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
984         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges const):
985         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable const):
986         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable const):
987         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded const):
988         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
989         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
990         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
991         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
992         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
993         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentMediaTime const):
994         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
995         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
996         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
997         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
998         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::calculateTimelineOffset):
999         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
1000         (WebCore::MediaSampleAVFObjC::presentationTime const):
1001         (WebCore::MediaSampleAVFObjC::outputPresentationTime const):
1002         (WebCore::MediaSampleAVFObjC::decodeTime const):
1003         (WebCore::MediaSampleAVFObjC::duration const):
1004         (WebCore::MediaSampleAVFObjC::outputDuration const):
1005         (WebCore::MediaSampleAVFObjC::offsetTimestampsBy):
1006         (WebCore::MediaSampleAVFObjC::setTimestamps):
1007         (WebCore::MediaSampleAVFObjC::divide):
1008         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1009         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
1010         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
1011         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
1012         (WebCore::WebCoreDecompressionSession::automaticDequeue):
1013         (WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
1014         (WebCore::WebCoreDecompressionSession::imageForTime):
1015         * platform/mac/PlatformClockCM.mm:
1016         (PlatformClockCM::setCurrentMediaTime):
1017         (PlatformClockCM::currentMediaTime const):
1018         * platform/mac/PlaybackSessionInterfaceMac.mm:
1019         (WebCore::timeRangesToArray):
1020         * platform/mac/VideoFullscreenInterfaceMac.mm:
1021         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1022         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
1023         (WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
1024         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
1025         (WebCore::RealtimeIncomingAudioSource::OnData):
1026         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1027
1028 2017-09-21  Alex Christensen  <achristensen@webkit.org>
1029
1030         Fix ASAN build after r222306
1031         https://bugs.webkit.org/show_bug.cgi?id=177255
1032
1033         * loader/DocumentLoader.cpp:
1034         (WebCore::DocumentLoader::setCustomHeaderFields):
1035         * loader/DocumentLoader.h:
1036         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
1037         Moving a Vector of a type requires more than just a forward declaration of the type, but only in ASAN builds.  Weird.
1038
1039 2017-09-21  Zhifei FANG  <facetothefate@gmail.com>
1040
1041         In regular block layout, the width of a child's margin box should always be equal to that of its containing block
1042         Merge from Blink https://bugs.chromium.org/p/chromium/issues/detail?id=708751
1043         https://bugs.webkit.org/show_bug.cgi?id=176620
1044
1045         Reviewed by Zalan Bujtas.
1046
1047         Test: fast/block/over-constrained-auto-margin.html
1048
1049         * rendering/RenderBox.cpp:
1050         (WebCore::RenderBox::computeLogicalWidthInRegion const):
1051
1052 2017-09-21  Javier Fernandez  <jfernandez@igalia.com>
1053
1054         Unpredictable selection when dragging out of float elements children of in-flow block-level box
1055         https://bugs.webkit.org/show_bug.cgi?id=176096
1056
1057         Reviewed by David Hyatt.
1058
1059         In order to improve Selection across float elements we need to
1060         consider them as HitTest candidates.  Additionally, since
1061         out-of-flow elements must not affect how in-flow elements are
1062         rendered we have to deal with some special cases when implementing
1063         the positionForPoint logic.
1064
1065         This patch addresses the issues caused by the fact that an in-flow
1066         box's logicalBottom does not consider the out-of-flow children, as
1067         they don't affect its height. Hence, we should add the lowest float
1068         logical bottom to figure out the box the point is actually hitting.
1069
1070         Tests: editing/selection/select-out-of-floated-non-editable-01.html
1071                editing/selection/select-out-of-floated-non-editable-02.html
1072                editing/selection/select-out-of-floated-non-editable-03.html
1073                editing/selection/select-out-of-floated-non-editable-04.html
1074                editing/selection/select-out-of-floated-non-editable-05.html
1075                editing/selection/select-out-of-floated-non-editable-06.html
1076                editing/selection/select-out-of-floated-non-editable-07.html
1077                editing/selection/select-out-of-floated-non-editable-08.html
1078                editing/selection/select-out-of-floated-non-editable-09.html
1079                editing/selection/select-out-of-floated-non-editable-10.html
1080                editing/selection/select-out-of-floated-non-editable-11.html
1081                editing/selection/select-out-of-floated-non-editable-12.html
1082
1083         * rendering/RenderBlock.cpp:
1084         (WebCore::isChildHitTestCandidate):
1085         (WebCore::RenderBlock::positionForPoint):
1086
1087 2017-09-21  Zan Dobersek  <zdobersek@igalia.com>
1088
1089         [WebCrypto] Support Elliptic Curve P-521
1090         https://bugs.webkit.org/show_bug.cgi?id=169231
1091         <rdar://problem/30881703>
1092
1093         Reviewed by Jiewen Tan.
1094
1095         Add support for the P-521 elliptic curve to the CryptoKeyEC class, but
1096         allow the underlying platform-specific implementations to opt out of
1097         supporting this feature.
1098
1099         This is achieved with the platformSupportedCurve() static function that
1100         each platform has to implement, returning true if the passed-in curve
1101         type is supported. The function is called at each CryptoKeyEC entrypoint,
1102         that is in each static function that could generate a new CryptoKeyEC
1103         object. These functions return a NotSupportedError exception in case the
1104         platformSupportedCurve() call returns false.
1105
1106         While the libgcrypt-based implementation will support P-521 curves in
1107         the near future, the CommonCrypto-based implementation might not. The use
1108         of platformSupportedCurve() ensures that the implementations that don't
1109         support EC P-521 continue to return the NotSupportedError exception at
1110         these entrypoints, instead of the OperationError exception that's returned
1111         when the platform-specific extensions of these entrypoints fail due to the
1112         specified elliptic curve not being supported.
1113
1114         Both libgcrypt-based and CommonCrypto-based implementations mark P-256 and
1115         P-384 curves as supported. Switch statements handling NamedCurve values
1116         must now also handle the NamedCurve::P521 value, but both implementations
1117         treat that as an unreachable case since support is not indicated in
1118         platformSupportedCurve(), and all CryptoKeyEC operations should have
1119         returned with an NotSupportedError exception before entering
1120         platform-specific code. The common CryptoKeyEC constructor similarly asserts
1121         that the specified curve is supported by the underlying implementation.
1122
1123         CryptoAlgorithmECDSA is modified to now also support 'ES512' as the algorithm
1124         identifier, matching it against the 'P-521' curve value.
1125
1126         No new tests -- tests covering EC P-521 already exist, but no platform
1127         runs them yet due to missing implementations.
1128
1129         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
1130         (WebCore::CryptoAlgorithmECDSA::importKey):
1131         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1132         (WebCore::curveName):
1133         (WebCore::curveIdentifier):
1134         (WebCore::curveSize):
1135         (WebCore::curveUncompressedFieldElementSize):
1136         (WebCore::CryptoKeyEC::platformSupportedCurve):
1137         * crypto/keys/CryptoKeyEC.cpp:
1138         (WebCore::toNamedCurve):
1139         (WebCore::CryptoKeyEC::CryptoKeyEC):
1140         (WebCore::CryptoKeyEC::generatePair):
1141         (WebCore::CryptoKeyEC::importRaw):
1142         (WebCore::CryptoKeyEC::importJwk):
1143         (WebCore::CryptoKeyEC::importSpki):
1144         (WebCore::CryptoKeyEC::importPkcs8):
1145         (WebCore::CryptoKeyEC::exportJwk const):
1146         (WebCore::CryptoKeyEC::namedCurveString const):
1147         (WebCore::CryptoKeyEC::algorithm const):
1148         * crypto/keys/CryptoKeyEC.h:
1149         * crypto/mac/CryptoKeyECMac.cpp:
1150         (WebCore::doesUncompressedPointMatchNamedCurve):
1151         (WebCore::doesFieldElementMatchNamedCurve):
1152         (WebCore::getKeySizeFromNamedCurve):
1153         (WebCore::CryptoKeyEC::platformSupportedCurve):
1154         (WebCore::getOID):
1155
1156 2017-09-20  Antti Koivisto  <antti@apple.com>
1157
1158         inspector/dom/content-node-region-info.html and inspector/dom/content-flow tests crashing
1159         https://bugs.webkit.org/show_bug.cgi?id=177249
1160         <rdar://problem/34559968>
1161
1162         Unreviewed.
1163
1164         * inspector/InspectorCSSAgent.cpp:
1165         (WebCore::InspectorCSSAgent::getNamedFlowCollection):
1166
1167             Fix crashing by adding a few lines of removed code back.
1168
1169 2017-09-20  Zalan Bujtas  <zalan@apple.com>
1170
1171         Remove redundant SelectionSubtreeData functions.
1172         https://bugs.webkit.org/show_bug.cgi?id=177288
1173
1174         Reviewed by Simon Fraser.
1175
1176         No change in functionality.
1177
1178         * rendering/SelectionSubtreeRoot.h:
1179         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData):
1180         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos const):
1181         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionClear const): Deleted.
1182         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionStart): Deleted.
1183         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionStartPos): Deleted.
1184         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionEnd): Deleted.
1185         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionEndPos): Deleted.
1186         (): Deleted.
1187
1188 2017-09-20  Alex Christensen  <achristensen@webkit.org>
1189
1190         Add infrastructure for adding custom headers to requests per website
1191         https://bugs.webkit.org/show_bug.cgi?id=177255
1192
1193         Reviewed by Geoffrey Garen.
1194
1195         Covered by API tests.
1196
1197         * CMakeLists.txt:
1198         * WebCore.xcodeproj/project.pbxproj:
1199         * loader/DocumentLoader.cpp:
1200         * loader/DocumentLoader.h:
1201         (WebCore::DocumentLoader::setCustomHeaderFields):
1202         * loader/HTTPHeaderField.cpp: Added.
1203         (WebCore::RFC7230::isTokenCharacter):
1204         (WebCore::RFC7230::isDelimiter):
1205         (WebCore::RFC7230::isVisibleCharacter):
1206         (WebCore::RFC7230::isWhitespace):
1207         (WebCore::RFC7230::isInRange):
1208         (WebCore::RFC7230::isOBSText):
1209         (WebCore::RFC7230::isQuotedTextCharacter):
1210         (WebCore::RFC7230::isQuotedPairSecondOctet):
1211         (WebCore::RFC7230::isCommentText):
1212         (WebCore::RFC7230::isValidName):
1213         (WebCore::RFC7230::isValidValue):
1214         (WebCore::HTTPHeaderField::HTTPHeaderField):
1215         * loader/HTTPHeaderField.h: Added.
1216         (WebCore::HTTPHeaderField::encode const):
1217         (WebCore::HTTPHeaderField::decode):
1218
1219 2017-09-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
1220
1221         REGRESSION(r191731): SVGPatternElement can only reference another SVGPatternElement in the same SVG document
1222         https://bugs.webkit.org/show_bug.cgi?id=176221
1223
1224         Reviewed by Tim Horton.
1225
1226         According to the specs:
1227
1228         https://www.w3.org/TR/SVG11/filters.html#FilterElementHrefAttribute
1229         https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementHrefAttribute
1230         https://www.w3.org/TR/SVG11/pservers.html#RadialGradientElementHrefAttribute
1231         https://www.w3.org/TR/SVG11/pservers.html#PatternElementHrefAttribute
1232
1233         The xlink:href attribute of the SVG filter, gradient and pattern elements
1234         must reference another element within the current SVG of the same type.
1235
1236         In r191731, the code of SVGPatternElement::collectPatternAttributes() was
1237         removed and replaced by RenderSVGResourcePattern::collectPatternAttributes()
1238         to avoid cyclic reference in the pattern element. The problem is the old
1239         code used to check whether the referenced element is<SVGPatternElement>
1240         before casting it. This code was not copied to the new function. So we
1241         now allow the SVGPatternElement to reference any SVG resource element.
1242
1243         To fix this issue, we need to prevent SVGResources from chaining an incorrect
1244         type of element to the SVG filter, gradient and pattern elements.
1245
1246         We also need to use the SVGResources for getting the referenced element
1247         when collecting the attributes for the gradient elements. SVGResources solves
1248         the cyclic referencing issue so there is no need to repeat the same code
1249         in many places. Also, from now on the SVGResources will have valid linked
1250         resource only. So casting the referenced element should always be valid.
1251
1252         Tests: svg/custom/pattern-invalid-content-inheritance.svg
1253
1254         * rendering/svg/RenderSVGResourcePattern.cpp:
1255         (WebCore::RenderSVGResourcePattern::collectPatternAttributes const): Asserts
1256         the linkedResource is of type RenderSVGResourcePattern.
1257         * rendering/svg/SVGResources.cpp:
1258         (WebCore::SVGResources::SVGResources):
1259         (WebCore::isChainableResource): Ensure that an SVG resource can reference
1260         only an SVG resource with the valid type.
1261         (WebCore::SVGResources::buildCachedResources):
1262         * rendering/svg/SVGResources.h:
1263
1264 2017-09-20  Daniel Bates  <dabates@apple.com>
1265
1266         Spelling and grammar dots should not overlap
1267         https://bugs.webkit.org/show_bug.cgi?id=177265
1268         <rdar://problem/34556424>
1269
1270         Reviewed by David Hyatt.
1271
1272         A line may contain both spelling and grammar errors such that these errors overlap.
1273         For example, "to mooof or not to mooof.". It is more pleasing aesthetically to
1274         paint spelling and grammar dots such that they do not overlap. This also matches
1275         AppKit's behavior.
1276
1277         A side benefit of this change is that it adds support infrastructure towards
1278         implementing the CSS Pseudo-Elements Module Level 4 pseudo elements ::spelling-error
1279         and ::grammar-error (see <https://bugs.webkit.org/show_bug.cgi?id=175784>).
1280         It will also make it straightforward to add ::inactive-selection and allow us
1281         to make ::selection conform to CSS Pseudo-Elements Module Level 4.
1282
1283         * CMakeLists.txt: Add file MarkerSubrange.cpp.
1284         * WebCore.xcodeproj/project.pbxproj: Add files MarkerSubrange.{cpp, h}.
1285         * rendering/InlineTextBox.cpp:
1286         (WebCore::InlineTextBox::paintDocumentMarker): Modified to take a const MarkerSubrange&
1287         instead of a RenderedDocumentMarker&.
1288         (WebCore::InlineTextBox::paintTextMatchMarker): Modified to take a const MarkerSubrange&
1289         instead of a RenderedDocumentMarker& and take a boolean as to whether the text match is active.
1290         (WebCore::InlineTextBox::paintDocumentMarkers): Collect the subranges that need to be
1291         painted, subdivide them preserving only the frontmost subrange when two or more subranges
1292         overlap and paint the resulting subranges.
1293         (WebCore::lineStyleForMarkerType): Deleted; converted to a lambda function inlined
1294         in paintDocumentMarker() as this is the only place we made use of this function.
1295         * rendering/InlineTextBox.h:
1296         * rendering/MarkerSubrange.cpp: Added.
1297         (WebCore::subdivide): Subdivides the specified list of subranges and returns a list of non-overlapping
1298         subranges in paint order. The implementation of subdivide() is derived from an algorithm that
1299         Said Abou-Hallawa came up with.
1300         * rendering/MarkerSubrange.h: Added.
1301         (WebCore::MarkerSubrange::MarkerSubrange):
1302
1303 2017-09-20  Alex Christensen  <achristensen@webkit.org>
1304
1305         Remove ActionType::CSSDisplayNoneStyleSheet
1306         https://bugs.webkit.org/show_bug.cgi?id=177275
1307
1308         Reviewed by Andy Estes.
1309
1310         It not a real action type anyways.  It was a fake action type
1311         that stored a String indicating which ContentRuleLists had not triggered
1312         an ignore-previous-rules action, so we should apply the default stylesheet,
1313         which is the css-display-none selectors that match everything.
1314
1315         No change in behaviour.  Covered by existing tests.
1316
1317         * contentextensions/ContentExtensionActions.h:
1318         * contentextensions/ContentExtensionCompiler.cpp:
1319         (WebCore::ContentExtensions::serializeActions):
1320         * contentextensions/ContentExtensionRule.cpp:
1321         (WebCore::ContentExtensions::Action::deserialize):
1322         (WebCore::ContentExtensions::Action::deserializeType):
1323         (WebCore::ContentExtensions::Action::serializedLength):
1324         * contentextensions/ContentExtensionRule.h:
1325         (WebCore::ContentExtensions::Action::Action):
1326         * contentextensions/ContentExtensionsBackend.cpp:
1327         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
1328         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
1329         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad):
1330         * contentextensions/ContentExtensionsBackend.h:
1331         * page/DOMWindow.cpp:
1332         (WebCore::DOMWindow::open):
1333         * page/UserContentProvider.cpp:
1334         (WebCore::UserContentProvider::actionsForResourceLoad):
1335         * page/UserContentProvider.h:
1336
1337 2017-09-20  Zalan Bujtas  <zalan@apple.com>
1338
1339         FloatingObject should not hold a raw pointer to RootInlineBox.
1340         https://bugs.webkit.org/show_bug.cgi?id=177266
1341
1342         Reviewed by Simon Fraser.
1343
1344         FloatingObject and RootInlineBox objects' lifetimes are very much independent from each other.
1345
1346         Not testable.
1347
1348         * rendering/FloatingObjects.cpp:
1349         (WebCore::FloatingObjects::clearLineBoxTreePointers):
1350         * rendering/FloatingObjects.h:
1351         (WebCore::FloatingObject::originatingLine const):
1352         (WebCore::FloatingObject::clearOriginatingLine):
1353         (WebCore::FloatingObject::setOriginatingLine):
1354         * rendering/RenderBlockFlow.cpp:
1355         (WebCore::RenderBlockFlow::removeFloatingObject):
1356         * rendering/RenderBlockLineLayout.cpp:
1357         (WebCore::RenderBlockFlow::appendFloatingObjectToLastLine):
1358         (WebCore::RenderBlockFlow::reattachCleanLineFloats):
1359         (WebCore::RenderBlockFlow::determineStartPosition):
1360         * rendering/RootInlineBox.cpp:
1361         (WebCore::RootInlineBox::RootInlineBox):
1362         * rendering/RootInlineBox.h:
1363         (WebCore::RootInlineBox::createWeakPtr):
1364
1365 2017-09-20  Chris Dumez  <cdumez@apple.com>
1366
1367         Drop legacy DOMError type
1368         https://bugs.webkit.org/show_bug.cgi?id=177207
1369
1370         Reviewed by Eric Carlson.
1371
1372         Drop legacy DOMError type. It has been removed from the Web standards,
1373         is no longer used by our implementation and was not exposed to the
1374         Web in WebKit (i.e. marked as [NoInterfaceObject]).
1375
1376         * CMakeLists.txt:
1377         * DerivedSources.cpp:
1378         * DerivedSources.make:
1379         * Modules/mediastream/MediaEndpointSessionDescription.h:
1380         * WebCore.xcodeproj/project.pbxproj:
1381         * bindings/js/JSDOMPromiseDeferred.cpp:
1382         * dom/DOMAllInOne.cpp:
1383         * dom/DOMError.cpp: Removed.
1384         * dom/DOMError.h: Removed.
1385         * dom/DOMError.idl: Removed.
1386         * platform/mock/RTCNotifiersMock.cpp:
1387
1388 2017-09-20  Commit Queue  <commit-queue@webkit.org>
1389
1390         Unreviewed, rolling out r222254.
1391         https://bugs.webkit.org/show_bug.cgi?id=177267
1392
1393         Caused fast/images/animated-gif-webkit-transform.html to time
1394         out, and possible perf regression (Requested by smfr on
1395         #webkit).
1396
1397         Reverted changeset:
1398
1399         "Simplify compositing layer updating"
1400         https://bugs.webkit.org/show_bug.cgi?id=176196
1401         http://trac.webkit.org/changeset/222254
1402
1403 2017-09-20  Alex Christensen  <achristensen@webkit.org>
1404
1405         Remove ActionType::InvalidAction
1406         https://bugs.webkit.org/show_bug.cgi?id=177262
1407
1408         Reviewed by Tim Horton.
1409
1410         This was needed before r213322 because we needed to have a default constructor.
1411         With all these cool new C++14/17 types, we don't need this any more.
1412
1413         No change in behaviour.
1414
1415         * contentextensions/ContentExtensionActions.h:
1416         * contentextensions/ContentExtensionCompiler.cpp:
1417         (WebCore::ContentExtensions::serializeActions):
1418         * contentextensions/ContentExtensionRule.cpp:
1419         (WebCore::ContentExtensions::Action::deserialize):
1420         (WebCore::ContentExtensions::Action::deserializeType):
1421         (WebCore::ContentExtensions::Action::serializedLength):
1422         * contentextensions/ContentExtensionRule.h:
1423         * contentextensions/ContentExtensionsBackend.cpp:
1424         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
1425         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad):
1426
1427 2017-09-20  Daniel Bates  <dabates@apple.com>
1428
1429         RenderedDocumentMarker.h should include DocumentMarker.h
1430         https://bugs.webkit.org/show_bug.cgi?id=177263
1431
1432         Reviewed by Andy Estes.
1433
1434         RenderedDocumentMarker extends DocumentMarker. RenderedDocumentMarker.h should
1435         include DocumentMarker.h. Otherwise, both DocumentMarker.h and RenderedDocumentMarker.h
1436         must be explicitly included.
1437
1438         * dom/RenderedDocumentMarker.h:
1439         * rendering/RenderText.cpp:
1440         * testing/Internals.cpp:
1441
1442 2017-09-20  Alex Christensen  <achristensen@webkit.org>
1443
1444         Clean up content extensions code in preparation for more actions with string arguments
1445         https://bugs.webkit.org/show_bug.cgi?id=177258
1446
1447         Reviewed by Tim Horton.
1448
1449         No change in behaviour.  Covered by existing tests.
1450
1451         * contentextensions/ContentExtensionCompiler.cpp:
1452         (WebCore::ContentExtensions::serializeString):
1453         (WebCore::ContentExtensions::resolvePendingDisplayNoneActions):
1454         (WebCore::ContentExtensions::serializeActions):
1455         (WebCore::ContentExtensions::serializeSelector): Deleted.
1456         * contentextensions/ContentExtensionParser.cpp:
1457         (WebCore::ContentExtensions::loadAction):
1458         (WebCore::ContentExtensions::loadRule):
1459         * contentextensions/ContentExtensionRule.cpp:
1460         (WebCore::ContentExtensions::deserializeString):
1461         (WebCore::ContentExtensions::Action::deserialize):
1462         (WebCore::ContentExtensions::Action::deserializeType):
1463         (WebCore::ContentExtensions::Action::serializedLength):
1464         * contentextensions/ContentExtensionRule.h:
1465         (WebCore::ContentExtensions::Action::Action):
1466
1467 2017-09-20  Joanmarie Diggs  <jdiggs@igalia.com>
1468
1469         [ATK] atk_table_get_n_rows() and atk_table_get_n_columns() should return values of aria-rowcount and aria-colcount, if present
1470         https://bugs.webkit.org/show_bug.cgi?id=171172
1471
1472         Reviewed by Chris Fleizach.
1473
1474         Modify webKitAccessibleTableGetNColumns() and webkitAccessibleTableGetNRows()
1475         to prefer the ARIA value over the DOM-based value.
1476
1477         No new tests needed: We already have coverage through aria-table-attributes.html.
1478         Platform expectations for this test were updated.
1479
1480         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
1481         (webkitAccessibleTableGetNColumns):
1482         (webkitAccessibleTableGetNRows):
1483
1484 2017-09-20  Youenn Fablet  <youenn@apple.com>
1485
1486         Rename CacheStorage to DOMCacheStorage
1487         https://bugs.webkit.org/show_bug.cgi?id=177025
1488
1489         Reviewed by Chris Dumez.
1490
1491         No change of behavior, just renaming CacheStorage class and files to DOMCacheStorage.
1492
1493         * CMakeLists.txt:
1494         * DerivedSources.make:
1495         * Modules/cache/DOMCacheStorage.cpp: Renamed from Source/WebCore/Modules/cache/CacheStorage.cpp.
1496         (WebCore::DOMCacheStorage::DOMCacheStorage):
1497         (WebCore::DOMCacheStorage::origin const):
1498         (WebCore::doSequentialMatch):
1499         (WebCore::startSequentialMatch):
1500         (WebCore::copyCaches):
1501         (WebCore::DOMCacheStorage::match):
1502         (WebCore::DOMCacheStorage::has):
1503         (WebCore::DOMCacheStorage::retrieveCaches):
1504         (WebCore::logConsolePersistencyError):
1505         (WebCore::DOMCacheStorage::open):
1506         (WebCore::DOMCacheStorage::remove):
1507         (WebCore::DOMCacheStorage::keys):
1508         (WebCore::DOMCacheStorage::stop):
1509         (WebCore::DOMCacheStorage::activeDOMObjectName const):
1510         (WebCore::DOMCacheStorage::canSuspendForDocumentSuspension const):
1511         * Modules/cache/DOMCacheStorage.h: Renamed from Source/WebCore/Modules/cache/CacheStorage.h.
1512         (WebCore::DOMCacheStorage::create):
1513         * Modules/cache/DOMCacheStorage.idl: Renamed from Source/WebCore/Modules/cache/CacheStorage.idl.
1514         * Modules/cache/DOMWindowCaches.cpp:
1515         (WebCore::DOMWindowCaches::caches):
1516         (WebCore::DOMWindowCaches::caches const):
1517         * Modules/cache/DOMWindowCaches.h:
1518         * Modules/cache/DOMWindowCaches.idl:
1519         * Modules/cache/WorkerGlobalScopeCaches.cpp:
1520         (WebCore::WorkerGlobalScopeCaches::caches):
1521         (WebCore::WorkerGlobalScopeCaches::caches const):
1522         * Modules/cache/WorkerGlobalScopeCaches.h:
1523         * Modules/cache/WorkerGlobalScopeCaches.idl:
1524         * WebCore.xcodeproj/project.pbxproj:
1525
1526 2017-09-20  Eric Carlson  <eric.carlson@apple.com>
1527
1528         Switch PeerConnection to release logging
1529         https://bugs.webkit.org/show_bug.cgi?id=177193
1530         <rdar://problem/34529014>
1531
1532         Reviewed by Youenn Fablet.
1533
1534         * Modules/mediastream/PeerConnectionBackend.cpp:
1535         (WebCore::PeerConnectionBackend::PeerConnectionBackend):
1536         (WebCore::PeerConnectionBackend::createOfferSucceeded):
1537         (WebCore::PeerConnectionBackend::createOfferFailed):
1538         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
1539         (WebCore::PeerConnectionBackend::createAnswerFailed):
1540         (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
1541         (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
1542         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
1543         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
1544         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
1545         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
1546         (WebCore::PeerConnectionBackend::newICECandidate):
1547         (WebCore::PeerConnectionBackend::doneGatheringCandidates):
1548         (WebCore::PeerConnectionBackend::logChannel const):
1549         * Modules/mediastream/PeerConnectionBackend.h:
1550         (WebCore::PeerConnectionBackend::PeerConnectionBackend): Deleted.
1551
1552         * Modules/mediastream/RTCPeerConnection.cpp:
1553         (WebCore::RTCPeerConnection::RTCPeerConnection):
1554         (WebCore::RTCPeerConnection::~RTCPeerConnection):
1555         (WebCore::RTCPeerConnection::addTrack):
1556         (WebCore::RTCPeerConnection::removeTrack):
1557         (WebCore::RTCPeerConnection::addTransceiver):
1558         (WebCore::RTCPeerConnection::queuedCreateOffer):
1559         (WebCore::RTCPeerConnection::queuedCreateAnswer):
1560         (WebCore::RTCPeerConnection::queuedSetLocalDescription):
1561         (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
1562         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
1563         (WebCore::RTCPeerConnection::initializeConfiguration):
1564         (WebCore::RTCPeerConnection::setConfiguration):
1565         (WebCore::RTCPeerConnection::createDataChannel):
1566         (WebCore::RTCPeerConnection::setSignalingState):
1567         (WebCore::RTCPeerConnection::updateIceGatheringState):
1568         (WebCore::RTCPeerConnection::updateIceConnectionState):
1569         (WebCore::RTCPeerConnection::updateConnectionState):
1570         (WebCore::RTCPeerConnection::replaceTrack):
1571         (WebCore::RTCPeerConnection::dispatchEvent):
1572         (WebCore::RTCPeerConnection::logChannel const):
1573         (WebCore::rtcIceGatheringStateToString): Deleted.
1574         (WebCore::rtcIceConnectionStateToString): Deleted.
1575         * Modules/mediastream/RTCPeerConnection.h:
1576
1577         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1578         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
1579         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
1580         (WebCore::LibWebRTCMediaEndpoint::startLoggingStats):
1581         (WebCore::LibWebRTCMediaEndpoint::logChannel const):
1582         (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
1583         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1584         (PAL::LogArgument<webrtc::RTCStats>::toString):
1585
1586         * platform/mediastream/RTCIceConnectionState.h:
1587         (PAL::LogArgument<WebCore::RTCIceConnectionState>::toString):
1588
1589         * platform/mediastream/RTCIceGatheringState.h:
1590         (PAL::LogArgument<WebCore::RTCIceGatheringState>::toString):
1591
1592         * platform/mediastream/RTCPeerConnectionState.h:
1593         (PAL::LogArgument<WebCore::RTCPeerConnectionState>::toString):
1594
1595         * platform/mediastream/RTCSignalingState.h:
1596         (PAL::LogArgument<WebCore::RTCSignalingState>::toString):
1597
1598 2017-09-20  Chris Dumez  <cdumez@apple.com>
1599
1600         Video errors should be instances of Error
1601         https://bugs.webkit.org/show_bug.cgi?id=174573
1602         <rdar://problem/34445494>
1603
1604         Reviewed by Youenn Fablet.
1605
1606         Video errors should be instances of DOMException and Error as per:
1607         - https://html.spec.whatwg.org/multipage/media.html#reject-pending-play-promises
1608         - https://html.spec.whatwg.org/multipage/media.html#loading-the-media-resource:reject-pending-play-promises-2
1609         - https://html.spec.whatwg.org/multipage/media.html#loading-the-media-resource:reject-pending-play-promises-3
1610         - https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:reject-pending-play-promises-3
1611         - https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:reject-pending-play-promises
1612
1613         No new tests, extended existing test.
1614
1615         * html/HTMLMediaElement.cpp:
1616         (WebCore::HTMLMediaElement::rejectPendingPlayPromises):
1617         (WebCore::HTMLMediaElement::noneSupported):
1618         (WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
1619         (WebCore::HTMLMediaElement::pauseInternal):
1620         * html/HTMLMediaElement.h:
1621
1622 2017-09-20  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1623
1624         [Curl] improve the implementation of FormDataStream
1625         https://bugs.webkit.org/show_bug.cgi?id=177111
1626
1627         Reviewed by Alex Christensen.
1628
1629         * platform/network/curl/FormDataStreamCurl.cpp:
1630         (WebCore::FormDataStream::read):
1631         (WebCore::FormDataStream::hasMoreElements const):
1632         * platform/network/curl/FormDataStreamCurl.h:
1633         (WebCore::FormDataStream::setHTTPBody):
1634         (WebCore::FormDataStream::FormDataStream): Deleted.
1635         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
1636         (WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
1637         (WebCore::ResourceHandleCurlDelegate::prepareSendData):
1638         (WebCore::ResourceHandleCurlDelegate::didFinish):
1639         (WebCore::ResourceHandleCurlDelegate::didFail):
1640         (WebCore::ResourceHandleCurlDelegate::setupFormData):
1641         * platform/network/curl/ResourceHandleCurlDelegate.h:
1642
1643 2017-09-20  Miguel Gomez  <magomez@igalia.com>
1644
1645         [GTK] Completely garbled display in GMail
1646         https://bugs.webkit.org/show_bug.cgi?id=168964
1647
1648         Reviewed by Carlos Garcia Campos.
1649
1650         Do not try to decode images that are bigger than 32768 pixels, as cairo won't be able to render them,
1651         and they will break the rendering of the rest of the page.
1652
1653         Covered by existent tests.
1654
1655         * platform/graphics/ImageBackingStore.h:
1656         (WebCore::ImageBackingStore::isOverSize):
1657
1658 2017-09-20  Antti Koivisto  <antti@apple.com>
1659
1660         Remove RenderNamedFlowThread and FlowThreadController
1661         https://bugs.webkit.org/show_bug.cgi?id=177229
1662
1663         Reviewed by Andreas Kling.
1664
1665         Get rid of some parts of the rendering code for CSS Regions.
1666
1667         The feature is disabled, no functional changes.
1668
1669         * WebCore.xcodeproj/project.pbxproj:
1670         * rendering/FlowThreadController.cpp: Removed.
1671         * rendering/FlowThreadController.h: Removed.
1672         * rendering/RenderBlock.cpp:
1673         (WebCore::RenderBlock::paintObject):
1674         (WebCore::canComputeRegionRangeForBox):
1675         (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
1676         * rendering/RenderBlockFlow.cpp:
1677         (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild):
1678         (WebCore::RenderBlockFlow::applyBeforeBreak):
1679         (WebCore::RenderBlockFlow::applyAfterBreak):
1680         (WebCore::RenderBlockFlow::logicalHeightForChildForFragmentation const):
1681         * rendering/RenderBlockLineLayout.cpp:
1682         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1683         * rendering/RenderBox.cpp:
1684         (WebCore::RenderBox::borderBoxRectInRegion const):
1685         (WebCore::RenderBox::scroll):
1686         (WebCore::RenderBox::renderBoxRegionInfo const):
1687         (WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
1688         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
1689         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
1690         * rendering/RenderBoxModelObject.cpp:
1691         (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent const):
1692         * rendering/RenderElement.cpp:
1693         (WebCore::RenderElement::willBeDestroyed):
1694         (WebCore::RenderElement::hoverAncestor const):
1695         * rendering/RenderFlowThread.cpp:
1696         (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent const):
1697         (WebCore::RenderFlowThread::incrementAutoLogicalHeightRegions):
1698         (WebCore::RenderFlowThread::decrementAutoLogicalHeightRegions):
1699         (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
1700         * rendering/RenderInline.cpp:
1701         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
1702         * rendering/RenderLayer.cpp:
1703         (WebCore::RenderLayer::paintLayerContents):
1704         (WebCore::RenderLayer::hitTestLayer):
1705         (WebCore::RenderLayer::calculateClipRects const):
1706         (WebCore::RenderLayer::paintFixedLayersInNamedFlows): Deleted.
1707         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows): Deleted.
1708         * rendering/RenderLayer.h:
1709         * rendering/RenderLayerCompositor.cpp:
1710         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1711         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1712         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
1713         (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed): Deleted.
1714         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed): Deleted.
1715         * rendering/RenderLayerCompositor.h:
1716         * rendering/RenderNamedFlowFragment.cpp:
1717         (WebCore::RenderNamedFlowFragment::checkRegionStyle):
1718         (WebCore::RenderNamedFlowFragment::namedFlowThread const): Deleted.
1719         * rendering/RenderNamedFlowFragment.h:
1720         * rendering/RenderNamedFlowThread.cpp: Removed.
1721         * rendering/RenderNamedFlowThread.h: Removed.
1722         * rendering/RenderObject.cpp:
1723         (WebCore::RenderObject::selectionRoot const):
1724         (WebCore::RenderObject::offsetParent const):
1725         (WebCore::RenderObject::currentRenderNamedFlowFragment const):
1726         * rendering/RenderObject.h:
1727         (WebCore::RenderObject::isRenderGrid const):
1728         (WebCore::RenderObject::isRenderNamedFlowThread const): Deleted.
1729         * rendering/RenderRegion.cpp:
1730         (WebCore::RenderRegion::RenderRegion):
1731         (WebCore::RenderRegion::attachRegion):
1732         * rendering/RenderRegion.h:
1733         (WebCore::RenderRegion::parentNamedFlowThread const): Deleted.
1734         * rendering/RenderTreeAsText.cpp:
1735         (WebCore::writeLayers):
1736         (WebCore::writeRenderRegionList): Deleted.
1737         (WebCore::writeRenderNamedFlowThreads): Deleted.
1738         * rendering/RenderView.cpp:
1739         (WebCore::RenderView::layoutContent):
1740         (WebCore::RenderView::layoutContentInAutoLogicalHeightRegions):
1741         (WebCore::RenderView::layout):
1742         (WebCore::RenderView::selectionBounds const):
1743         (WebCore::RenderView::repaintSelection const):
1744         (WebCore::RenderView::setSelection):
1745         (WebCore::RenderView::updateSelectionForSubtrees):
1746         (WebCore::RenderView::styleDidChange):
1747         (WebCore::RenderView::checkTwoPassLayoutForAutoHeightRegions const):
1748         (WebCore::RenderView::pushLayoutStateForCurrentFlowThread):
1749         (WebCore::RenderView::popLayoutStateForCurrentFlowThread):
1750         (WebCore::RenderView::layoutContentToComputeOverflowInRegions): Deleted.
1751         (WebCore::RenderView::splitSelectionBetweenSubtrees): Deleted.
1752         (WebCore::RenderView::hasRenderNamedFlowThreads const): Deleted.
1753         (WebCore::RenderView::flowThreadController): Deleted.
1754         * rendering/RenderView.h:
1755         * rendering/SelectionSubtreeRoot.cpp:
1756         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection): Deleted.
1757         * rendering/SelectionSubtreeRoot.h:
1758         (WebCore::SelectionSubtreeRoot::setSelectionData):
1759
1760 2017-09-20  Antti Koivisto  <antti@apple.com>
1761
1762         Remove DOM and styling support for CSS Regions
1763         https://bugs.webkit.org/show_bug.cgi?id=177221
1764
1765         Reviewed by Andreas Kling.
1766
1767         This patch removes all CSS Regions (aka "named flow") related code excluding rendering.
1768
1769         The feature is already disabled so no functional changes.
1770
1771         * CMakeLists.txt:
1772         * Configurations/FeatureDefines.xcconfig:
1773         * DerivedSources.make:
1774         * WebCore.xcodeproj/project.pbxproj:
1775         * bindings/js/JSCSSRuleCustom.cpp:
1776         (WebCore::toJSNewlyCreated):
1777         * css/CSSComputedStyleDeclaration.cpp:
1778         (WebCore::contentToCSSValue):
1779         (WebCore::ComputedStyleExtractor::propertyValue):
1780         (WebCore::convertToRegionBreak): Deleted.
1781         * css/CSSPrimitiveValueMappings.h:
1782         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1783         (WebCore::CSSPrimitiveValue::operator BreakBetween const):
1784         * css/CSSProperties.json:
1785         * css/CSSRule.cpp:
1786         * css/CSSRule.h:
1787         * css/CSSRule.idl:
1788         * css/ElementRuleCollector.cpp:
1789         (WebCore::ElementRuleCollector::matchAuthorRules):
1790         (WebCore::ElementRuleCollector::matchUserRules):
1791         (WebCore::ElementRuleCollector::collectMatchingRulesForRegion): Deleted.
1792         * css/ElementRuleCollector.h:
1793         (WebCore::ElementRuleCollector::setSameOriginOnly):
1794         (WebCore::ElementRuleCollector::setRegionForStyling): Deleted.
1795         * css/InspectorCSSOMWrappers.cpp:
1796         (WebCore::InspectorCSSOMWrappers::collect):
1797         * css/RuleSet.cpp:
1798         (WebCore::determinePropertyWhitelistType):
1799         (WebCore::RuleData::RuleData):
1800         (WebCore::RuleSet::addChildRules):
1801         (WebCore::RuleSet::shrinkToFit):
1802         (WebCore::RuleSet::addRegionRule): Deleted.
1803         * css/RuleSet.h:
1804         (WebCore::RuleSet:: const):
1805         (WebCore::RuleSet::regionSelectorsAndRuleSets const): Deleted.
1806         * css/StyleBuilderConverter.h:
1807         (WebCore::StyleBuilderConverter::convertRegionBreakBetween): Deleted.
1808         (WebCore::StyleBuilderConverter::convertRegionBreakInside): Deleted.
1809         * css/StyleProperties.cpp:
1810         * css/StyleResolver.cpp:
1811         (WebCore::StyleResolver::State::clear):
1812         (WebCore::StyleResolver::State::State):
1813         (WebCore::StyleResolver::styleForElement):
1814         (WebCore::StyleResolver::CascadedProperties::addMatch):
1815         (WebCore::StyleResolver::checkRegionStyle): Deleted.
1816         (WebCore::isValidRegionStyleProperty): Deleted.
1817         * css/StyleResolver.h:
1818         (WebCore::StyleResolver::State::regionForStyling const): Deleted.
1819         (WebCore::checkRegionSelector): Deleted.
1820         * css/StyleRule.cpp:
1821         (WebCore::StyleRuleBase::destroy):
1822         (WebCore::StyleRuleBase::copy const):
1823         (WebCore::StyleRuleBase::createCSSOMWrapper const):
1824         (WebCore::StyleRuleRegion::StyleRuleRegion): Deleted.
1825         * css/StyleRule.h:
1826         (WebCore::StyleRuleBase::isStyleRule const):
1827         (WebCore::StyleRuleBase::isRegionRule const): Deleted.
1828         * css/StyleSheetContents.cpp:
1829         (WebCore::traverseSubresourcesInRules):
1830         * css/WebKitCSSRegionRule.cpp: Removed.
1831         * css/WebKitCSSRegionRule.h: Removed.
1832         * css/WebKitCSSRegionRule.idl: Removed.
1833         * css/parser/CSSAtRuleID.cpp:
1834         (WebCore::cssAtRuleID):
1835         * css/parser/CSSAtRuleID.h:
1836         * css/parser/CSSParserFastPaths.cpp:
1837         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1838         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1839         * css/parser/CSSParserImpl.cpp:
1840         (WebCore::CSSParserImpl::consumeAtRule):
1841         (WebCore::CSSParserImpl::consumeRegionRule): Deleted.
1842         * css/parser/CSSParserImpl.h:
1843         * css/parser/CSSPropertyParser.cpp:
1844         (WebCore::isLegacyBreakProperty):
1845         (WebCore::CSSPropertyParser::parseSingleValue):
1846         (WebCore::mapFromLegacyBreakProperty):
1847         (WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
1848         (WebCore::consumeFlowProperty): Deleted.
1849         (WebCore::mapFromRegionBreakBetween): Deleted.
1850         * dom/ContainerNode.cpp:
1851         (WebCore::destroyRenderTreeIfNeeded):
1852         * dom/DOMNamedFlowCollection.cpp: Removed.
1853         * dom/DOMNamedFlowCollection.h: Removed.
1854         * dom/DOMNamedFlowCollection.idl: Removed.
1855         * dom/Document.cpp:
1856         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1857         (WebCore::Document::webkitGetNamedFlows): Deleted.
1858         (WebCore::Document::namedFlows): Deleted.
1859         * dom/Document.h:
1860         * dom/Document.idl:
1861         * dom/Element.cpp:
1862         (WebCore::Element::~Element):
1863         (WebCore::Element::clearStyleDerivedDataBeforeDetachingRenderer):
1864         (WebCore::Element::unregisterNamedFlowContentElement): Deleted.
1865         (WebCore::Element::setIsNamedFlowContentElement): Deleted.
1866         (WebCore::Element::clearIsNamedFlowContentElement): Deleted.
1867         (WebCore::Element::rareDataIsNamedFlowContentElement const): Deleted.
1868         (WebCore::Element::setRegionOversetState): Deleted.
1869         (WebCore::Element::regionOversetState const): Deleted.
1870         (WebCore::Element::renderNamedFlowFragment const): Deleted.
1871         (WebCore::Element::shouldMoveToFlowThread const): Deleted.
1872         (WebCore::Element::webkitRegionOverset const): Deleted.
1873         (WebCore::Element::webkitGetRegionFlowRanges const): Deleted.
1874         * dom/Element.h:
1875         (WebCore::Element::isNamedFlowContentElement const): Deleted.
1876         * dom/Element.idl:
1877         * dom/ElementRareData.cpp:
1878         * dom/ElementRareData.h:
1879         (WebCore::ElementRareData::ElementRareData):
1880         (WebCore::ElementRareData::regionOversetState const): Deleted.
1881         (WebCore::ElementRareData::setRegionOversetState): Deleted.
1882         (WebCore::ElementRareData::isNamedFlowContentElement const): Deleted.
1883         (WebCore::ElementRareData::setIsNamedFlowContentElement): Deleted.
1884         * dom/EventTargetFactory.in:
1885         * dom/NamedFlowCollection.cpp: Removed.
1886         * dom/NamedFlowCollection.h: Removed.
1887         * dom/PseudoElement.h:
1888         * dom/WebKitNamedFlow.cpp: Removed.
1889         * dom/WebKitNamedFlow.h: Removed.
1890         * dom/WebKitNamedFlow.idl: Removed.
1891         * inspector/InspectorCSSAgent.cpp:
1892         (WebCore::InspectorCSSAgent::resetNonPersistentData):
1893         (WebCore::ChangeRegionOversetTask::ChangeRegionOversetTask): Deleted.
1894         (WebCore::ChangeRegionOversetTask::scheduleFor): Deleted.
1895         (WebCore::ChangeRegionOversetTask::unschedule): Deleted.
1896         (WebCore::ChangeRegionOversetTask::reset): Deleted.
1897         (WebCore::ChangeRegionOversetTask::timerFired): Deleted.
1898         (WebCore::InspectorCSSAgent::didCreateNamedFlow): Deleted.
1899         (WebCore::InspectorCSSAgent::willRemoveNamedFlow): Deleted.
1900         (WebCore::InspectorCSSAgent::didChangeRegionOverset): Deleted.
1901         (WebCore::InspectorCSSAgent::regionOversetChanged): Deleted.
1902         (WebCore::InspectorCSSAgent::didRegisterNamedFlowContentElement): Deleted.
1903         (WebCore::InspectorCSSAgent::didUnregisterNamedFlowContentElement): Deleted.
1904         (WebCore::InspectorCSSAgent::getNamedFlowCollection): Deleted.
1905         (WebCore::InspectorCSSAgent::documentNodeWithRequestedFlowsId): Deleted.
1906         (WebCore::InspectorCSSAgent::buildArrayForRegions): Deleted.
1907         (WebCore::InspectorCSSAgent::buildObjectForNamedFlow): Deleted.
1908         * inspector/InspectorCSSAgent.h:
1909         * inspector/InspectorInstrumentation.cpp:
1910         (WebCore::InspectorInstrumentation::didCreateNamedFlowImpl): Deleted.
1911         (WebCore::InspectorInstrumentation::willRemoveNamedFlowImpl): Deleted.
1912         (WebCore::InspectorInstrumentation::didChangeRegionOversetImpl): Deleted.
1913         (WebCore::InspectorInstrumentation::didRegisterNamedFlowContentElementImpl): Deleted.
1914         (WebCore::InspectorInstrumentation::didUnregisterNamedFlowContentElementImpl): Deleted.
1915         * inspector/InspectorOverlay.cpp:
1916         (WebCore::buildRendererHighlight):
1917         (WebCore::buildObjectForElementData):
1918         (WebCore::buildObjectForRegion): Deleted.
1919         (WebCore::buildObjectForFlowRegions): Deleted.
1920         * page/EventHandler.cpp:
1921         (WebCore::handleWheelEventInAppropriateEnclosingBox):
1922         * rendering/FlowThreadController.cpp:
1923         (WebCore::FlowThreadController::ensureRenderFlowThreadWithName): Deleted.
1924         * rendering/FlowThreadController.h:
1925         * rendering/RegionOversetState.h: Removed.
1926         * rendering/RenderBlockFlow.cpp:
1927         (WebCore::RenderBlockFlow::applyBeforeBreak):
1928         (WebCore::RenderBlockFlow::applyAfterBreak):
1929         * rendering/RenderNamedFlowFragment.cpp:
1930         (WebCore::RenderNamedFlowFragment::getRanges const):
1931         (WebCore::RenderNamedFlowFragment::layoutBlock):
1932         (WebCore::RenderNamedFlowFragment::checkRegionStyle):
1933         (WebCore::RenderNamedFlowFragment::computeStyleInRegion const):
1934         (WebCore::RenderNamedFlowFragment::setRegionObjectsRegionStyle):
1935         (WebCore::RenderNamedFlowFragment::setRegionOversetState): Deleted.
1936         (WebCore::RenderNamedFlowFragment::regionOversetState const): Deleted.
1937         (WebCore::RenderNamedFlowFragment::updateOversetState): Deleted.
1938         * rendering/RenderNamedFlowFragment.h:
1939         * rendering/RenderNamedFlowThread.cpp:
1940         (WebCore::RenderNamedFlowThread::RenderNamedFlowThread):
1941         (WebCore::RenderNamedFlowThread::clearContentElements):
1942         (WebCore::RenderNamedFlowThread::registerNamedFlowContentElement):
1943         (WebCore::RenderNamedFlowThread::unregisterNamedFlowContentElement):
1944         (WebCore::RenderNamedFlowThread::hasContentElement const):
1945         (WebCore::RenderNamedFlowThread::flowThreadName const):
1946         (WebCore::RenderNamedFlowThread::dispatchRegionOversetChangeEventIfNeeded):
1947         (WebCore::RenderNamedFlowThread::regionOversetChangeEventTimerFired):
1948         (WebCore::RenderNamedFlowThread::setMarkForDestruction):
1949         (WebCore::RenderNamedFlowThread::resetMarkForDestruction):
1950         (WebCore::RenderNamedFlowThread::isMarkedForDestruction const):
1951         (WebCore::nextNodeInsideContentElement):
1952         * rendering/RenderNamedFlowThread.h:
1953         * rendering/RenderRegion.cpp:
1954         (WebCore::RenderRegion::installFlowThread):
1955         * rendering/style/RenderStyleConstants.h:
1956         * rendering/style/WillChangeData.cpp:
1957         (WebCore::WillChangeData::propertyCreatesStackingContext):
1958         * style/RenderTreePosition.cpp:
1959         (WebCore::RenderTreePosition::previousSiblingRenderer const):
1960         (WebCore::RenderTreePosition::nextSiblingRenderer const):
1961         (WebCore::RenderTreePosition::insertionPositionForFlowThread): Deleted.
1962         (WebCore::RenderTreePosition::isRendererReparented): Deleted.
1963         * style/RenderTreePosition.h:
1964         (WebCore::RenderTreePosition::RenderTreePosition):
1965         * style/RenderTreeUpdater.cpp:
1966         (WebCore::RenderTreeUpdater::updateElementRenderer):
1967         (WebCore::RenderTreeUpdater::createRenderer):
1968         (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
1969         (WebCore::registerElementForFlowThreadIfNeeded): Deleted.
1970         * style/RenderTreeUpdaterGeneratedContent.cpp:
1971         (WebCore::createContentRenderers):
1972         * style/StyleChange.cpp:
1973         (WebCore::Style::determineChange):
1974         * style/StyleTreeResolver.cpp:
1975         (WebCore::Style::TreeResolver::styleForElement):
1976         (WebCore::Style::affectsRenderedSubtree):
1977         * svg/SVGElement.cpp:
1978         (WebCore::SVGElement::shouldMoveToFlowThread const): Deleted.
1979         * svg/SVGElement.h:
1980
1981 2017-09-20  Ms2ger  <Ms2ger@igalia.com>
1982
1983         Add bindings for optional arguments to some WebGL2 methods.
1984         https://bugs.webkit.org/show_bug.cgi?id=177067
1985
1986         Reviewed by Antti Koivisto.
1987
1988         Add bindings for optional arguments to some WebGL2 methods.
1989
1990         No new tests: not much point in adding tests now; these methods don't
1991         do anything anyway.
1992
1993         * html/canvas/WebGL2RenderingContext.cpp:
1994         (WebCore::WebGL2RenderingContext::uniform1uiv):
1995         (WebCore::WebGL2RenderingContext::uniform2uiv):
1996         (WebCore::WebGL2RenderingContext::uniform3uiv):
1997         (WebCore::WebGL2RenderingContext::uniform4uiv):
1998         (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
1999         (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
2000         (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
2001         (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
2002         (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
2003         (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
2004         (WebCore::WebGL2RenderingContext::clearBufferiv):
2005         (WebCore::WebGL2RenderingContext::clearBufferuiv):
2006         (WebCore::WebGL2RenderingContext::clearBufferfv):
2007         * html/canvas/WebGL2RenderingContext.h:
2008         * html/canvas/WebGL2RenderingContext.idl:
2009
2010 2017-09-19  Ryosuke Niwa  <rniwa@webkit.org>
2011
2012         On Mac, dataTransfer claims to contain URL list when dropping files
2013         https://bugs.webkit.org/show_bug.cgi?id=177219
2014
2015         Reviewed by Wenson Hsieh.
2016
2017         Fixed the bug by removing code which was specifically adding local filenames as URLs in "text/uri-list"
2018         when pasting or dropping files. Neither Chrome nor Firefox exhibit this behavior, and exposing local
2019         filenames reveal sensitive information such as username.
2020
2021         Test: editing/pasteboard/datatransfer-types-dropping-text-file.html
2022
2023         * platform/mac/PasteboardMac.mm:
2024         (WebCore::Pasteboard::readString):
2025         (WebCore::addHTMLClipboardTypesForCocoaType):
2026         (WebCore::absoluteURLsFromPasteboard): Deleted.
2027
2028 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
2029
2030         Simplify compositing layer updating
2031         https://bugs.webkit.org/show_bug.cgi?id=176196
2032
2033         Reviewed by Zalan Bujtas.
2034
2035         Remove compositing layer updating from the updateLayerPositions() code path, which
2036         was problematic because it wasn't pre-order. Instead, just rely on post-layout
2037         compositing updates, which now need to do geometry updates. Micro benchmarking shows
2038         this to be no slower.
2039
2040         We can remove the 'OnHitTest' update type, since we always ensure that layout is updated
2041         before hit testing now.
2042
2043         Also remove a code path that could trigger updateGeometry() during a style change, and
2044         in response to images loads, which were bad because layout may not be up-to-date at this time.
2045
2046         Tested by existing compositing tests. Rebaselined two tests after confirming they are progressions.
2047
2048         * rendering/RenderLayer.cpp:
2049         (WebCore::RenderLayer::updateLayerPositions):
2050         (WebCore::RenderLayer::hitTestLayer):
2051         (WebCore::RenderLayer::calculateClipRects const):
2052         * rendering/RenderLayer.h:
2053         * rendering/RenderLayerBacking.cpp:
2054         (WebCore::RenderLayerBacking::updateGeometry):
2055         (WebCore::RenderLayerBacking::contentChanged):
2056         (WebCore::RenderLayerBacking::updateAfterLayout): Deleted.
2057         * rendering/RenderLayerBacking.h:
2058         * rendering/RenderLayerCompositor.cpp:
2059         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2060         (WebCore::RenderLayerCompositor::layerStyleChanged):
2061         (WebCore::operator<<):
2062         * rendering/RenderLayerCompositor.h:
2063
2064 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
2065
2066         Do more math in terms of FloatSizes and FloatPoints
2067         https://bugs.webkit.org/show_bug.cgi?id=177217
2068
2069         Reviewed by Zalan Bujtas.
2070         
2071         Add operator/(const FloatSize&, const FloatSize&), GraphicsContext::translate(const FloatPoint&),
2072         FloatRect.scale(FloatSize) and AffineTransform::translate(const FloatSize&)
2073         and use them in lots of places to do math in terms of points and sizes.
2074
2075         * html/canvas/CanvasRenderingContext2D.cpp:
2076         (WebCore::CanvasRenderingContext2D::drawImage):
2077         (WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
2078         (WebCore::CanvasRenderingContext2D::drawTextInternal):
2079         * page/mac/TextIndicatorWindow.mm:
2080         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
2081         * platform/Theme.cpp:
2082         (WebCore::Theme::drawNamedImage const):
2083         * platform/graphics/CrossfadeGeneratedImage.cpp:
2084         (WebCore::drawCrossfadeSubimage):
2085         (WebCore::CrossfadeGeneratedImage::draw):
2086         * platform/graphics/FloatRect.h:
2087         (WebCore::FloatRect::center const):
2088         (WebCore::FloatRect::scale):
2089         * platform/graphics/FloatSize.h:
2090         (WebCore::operator/):
2091         * platform/graphics/GradientImage.cpp:
2092         (WebCore::GradientImage::draw):
2093         * platform/graphics/GraphicsContext.cpp:
2094         (WebCore::GraphicsContext::scaleFactorForDrawing const):
2095         * platform/graphics/GraphicsContext.h:
2096         (WebCore::GraphicsContext::translate):
2097         * platform/graphics/Image.cpp:
2098         (WebCore::Image::drawTiled):
2099         * platform/graphics/ImageBuffer.cpp:
2100         (WebCore::ImageBuffer::clampedSize):
2101         (WebCore::ImageBuffer::createCompatibleBuffer):
2102         * platform/graphics/LayoutSize.h:
2103         * platform/graphics/NamedImageGeneratedImage.cpp:
2104         (WebCore::NamedImageGeneratedImage::draw):
2105         * platform/graphics/Path.cpp:
2106         (WebCore::Path::addRoundedRect):
2107         * platform/graphics/cg/ImageBufferCG.cpp:
2108         (WebCore::ImageBuffer::createCompatibleBuffer):
2109         * platform/graphics/cg/PDFDocumentImage.cpp:
2110         (WebCore::transformContextForPainting):
2111         (WebCore::applyRotationForPainting):
2112         (WebCore::PDFDocumentImage::drawPDFPage):
2113         * platform/graphics/filters/FETile.cpp:
2114         (WebCore::FETile::platformApplySoftware):
2115         * platform/graphics/transforms/AffineTransform.cpp:
2116         (WebCore::AffineTransform::translate):
2117         (WebCore::makeMapBetweenRects):
2118         * platform/graphics/transforms/AffineTransform.h:
2119         * platform/mac/ScrollbarThemeMac.mm:
2120         (WebCore::ScrollbarThemeMac::paint):
2121         * platform/mac/ThemeMac.mm:
2122         (WebCore::paintToggleButton):
2123         (WebCore::paintButton):
2124         (WebCore::paintStepper):
2125         * rendering/FilterEffectRenderer.cpp:
2126         (WebCore::FilterEffectRendererHelper::beginFilterEffect):
2127         * rendering/RenderBoxModelObject.cpp:
2128         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
2129         (WebCore::RenderBoxModelObject::paintBoxShadow):
2130         * rendering/RenderEmbeddedObject.cpp:
2131         (WebCore::RenderEmbeddedObject::getReplacementTextGeometry const):
2132         * rendering/RenderLayer.cpp:
2133         (WebCore::RenderLayer::calculateClipRects const):
2134         * rendering/RenderLayerBacking.cpp:
2135         (WebCore::RenderLayerBacking::paintContents):
2136         * rendering/RenderLayerCompositor.cpp:
2137         (WebCore::paintScrollbar):
2138         (WebCore::RenderLayerCompositor::paintContents):
2139         * rendering/RenderMediaControls.cpp:
2140         (WebCore::getUnzoomedRectAndAdjustCurrentContext):
2141         * rendering/RenderThemeMac.mm:
2142         (WebCore::RenderThemeMac::paintMenuList):
2143         (WebCore::RenderThemeMac::paintSliderThumb):
2144         (WebCore::RenderThemeMac::paintSearchField):
2145         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2146         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
2147         (WebCore::RenderThemeMac::paintImageControlsButton):
2148         * rendering/svg/RenderSVGForeignObject.cpp:
2149         (WebCore::RenderSVGForeignObject::RenderSVGForeignObject):
2150         (WebCore::RenderSVGForeignObject::localToParentTransform const):
2151         * rendering/svg/RenderSVGForeignObject.h:
2152         * rendering/svg/RenderSVGResourceClipper.cpp:
2153         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
2154         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
2155         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
2156         (WebCore::RenderSVGResourceClipper::resourceBoundingBox):
2157         * rendering/svg/RenderSVGResourceGradient.cpp:
2158         (WebCore::clipToTextMask):
2159         (WebCore::RenderSVGResourceGradient::applyResource):
2160         * rendering/svg/RenderSVGResourceMarker.cpp:
2161         (WebCore::RenderSVGResourceMarker::markerTransformation const):
2162         (WebCore::RenderSVGResourceMarker::markerContentTransformation const):
2163         * rendering/svg/RenderSVGResourceMasker.cpp:
2164         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
2165         (WebCore::RenderSVGResourceMasker::resourceBoundingBox):
2166         * rendering/svg/RenderSVGResourcePattern.cpp:
2167         (WebCore::RenderSVGResourcePattern::buildPattern):
2168         (WebCore::RenderSVGResourcePattern::createTileImage const):
2169         * rendering/svg/RenderSVGTransformableContainer.cpp:
2170         (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
2171         * rendering/svg/SVGRenderingContext.cpp:
2172         (WebCore::SVGRenderingContext::createImageBuffer):
2173         (WebCore::SVGRenderingContext::bufferForeground):
2174         * svg/SVGAnimateMotionElement.cpp:
2175         (WebCore::SVGAnimateMotionElement::buildTransformForProgress):
2176         * svg/SVGSVGElement.cpp:
2177         (WebCore::SVGSVGElement::localCoordinateSpaceTransform const):
2178         * svg/graphics/SVGImage.cpp:
2179         (WebCore::SVGImage::draw):
2180
2181 2017-09-19  Chris Dumez  <cdumez@apple.com>
2182
2183         IDBRequest and IDBTransaction error properties should be DOMExceptions
2184         https://bugs.webkit.org/show_bug.cgi?id=177201
2185
2186         Reviewed by Alex Christensen.
2187
2188         IDBRequest and IDBTransaction error properties should be DOMExceptions:
2189         - https://w3c.github.io/IndexedDB/#idbrequest
2190         - https://w3c.github.io/IndexedDB/#transaction
2191
2192         Previously, we used a DOMError type, which is obsolete.
2193
2194         No new tests, rebaselined existing test.
2195
2196         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2197         (WebCore::IDBOpenDBRequest::onError):
2198         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
2199         * Modules/indexeddb/IDBRequest.cpp:
2200         (WebCore:: const):
2201         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
2202         (WebCore::IDBRequest::onError):
2203         * Modules/indexeddb/IDBRequest.h:
2204         * Modules/indexeddb/IDBRequest.idl:
2205         * Modules/indexeddb/IDBTransaction.cpp:
2206         (WebCore::IDBTransaction::error const):
2207         (WebCore::IDBTransaction::abortDueToFailedRequest):
2208         (WebCore::IDBTransaction::didCreateIndexOnServer):
2209         (WebCore::IDBTransaction::connectionClosedFromServer):
2210         * Modules/indexeddb/IDBTransaction.h:
2211         * Modules/indexeddb/IDBTransaction.idl:
2212         * Modules/indexeddb/shared/IDBError.cpp:
2213         (WebCore::IDBError::toDOMException const):
2214         * Modules/indexeddb/shared/IDBError.h:
2215
2216 2017-09-19  Daewoong Jang  <daewoong.jang@naverlabs.com>
2217
2218         [Curl] Fix r222147
2219         https://bugs.webkit.org/show_bug.cgi?id=177128
2220
2221         Reviewed by Alex Christensen.
2222
2223         * platform/network/curl/CurlSSLHandle.h:
2224         * platform/network/curl/CurlSSLVerifier.cpp:
2225         (WebCore::CurlSSLVerifier::certVerifyCallback):
2226         * platform/network/curl/CurlSSLVerifier.h:
2227
2228 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
2229
2230         Image subclasses should support is<> and downcast<>
2231         https://bugs.webkit.org/show_bug.cgi?id=177209
2232
2233         Reviewed by Tim Horton.
2234
2235         Add SPECIALIZE_TYPE_TRAITS_IMAGE() for Image subclasses.
2236
2237         Also use #pragma once in these headers.
2238
2239         * platform/graphics/CrossfadeGeneratedImage.h:
2240         * platform/graphics/GeneratedImage.h:
2241         * platform/graphics/GradientImage.h:
2242         * platform/graphics/Image.h:
2243         * platform/graphics/NamedImageGeneratedImage.h:
2244
2245 2017-09-19  Wenson Hsieh  <wenson_hsieh@apple.com>
2246
2247         REGRESSION (r215613): Incorrect corners clipping with border-radius
2248         https://bugs.webkit.org/show_bug.cgi?id=176498
2249         <rdar://problem/34112607>
2250
2251         Reviewed by Tim Horton.
2252
2253         http://trac.webkit.org/r215613 introduced an optimization to bail out of repainting borders if the invalidated
2254         rect to paint is fully contained within the inner rounded rect of the border. However, due to issues with
2255         coordinate and intersection math in RoundedRect::contains() and ellipseContainsPoint(), this causes
2256         RenderBoxModelObject::paintBorder to return early even in circumstances where the border requires a repaint.
2257         This patch fixes the contains() helper in RoundedRect and adds a new API test suite for RoundedRect that covers
2258         these changes.
2259
2260         Test: WebCore.RoundedRectContainsRect
2261
2262         * platform/graphics/GeometryUtilities.cpp:
2263         (WebCore::ellipseContainsPoint):
2264
2265         This function attempts to return early if the Manhattan distance of the transformed point is less than the
2266         radius of the circle that results from applying the same transformation to the ellipse. However, this bails and
2267         returns true if `x + y <= R`, but this means that if x and y are negative, we'll always end up returning true.
2268         We fix this by adding the absolute values instead, so the check becomes: |x| + |y| <= R.
2269
2270         * platform/graphics/RoundedRect.cpp:
2271         (WebCore::RoundedRect::contains const):
2272
2273         Before this patch, otherRect's upper left location was being used to hit-test against the ellipses formed from
2274         each of the 4 corners of the rounded rect. Instead, this should use (x, y), (maxX, y), (x, maxY), (maxX, maxY)
2275         for the top left, top right, bottom left, and bottom right corners, respectively.
2276
2277         Additionally, the checks for the bottom left and bottom right to determine whether the rect corner should be
2278         checked for intersection against the ellipse's corner are incorrect. In the bottom left corner, the check for
2279         `otherRect.maxX() >= center.x()` should instead be `otherRect.x() <= center.x()`, and the check for
2280         `otherRect.x() <= center.x()` should instead be `otherRect.maxX() >= center.x()`.
2281
2282         * platform/graphics/RoundedRect.h:
2283
2284 2017-09-19  Alexey Proskuryakov  <ap@apple.com>
2285
2286         Layering violation in Editor::createFragment
2287         https://bugs.webkit.org/show_bug.cgi?id=176123
2288
2289         Reviewed by Darin Adler.
2290
2291         * WebCore.xcodeproj/project.pbxproj:
2292         * editing/cocoa/WebArchiveResourceFromNSAttributedString.h: Added.
2293         * editing/cocoa/WebArchiveResourceFromNSAttributedString.mm: Added.
2294         Added a wrapper class for ArchiveResource, suitable for use as a WebResourceHandler.
2295
2296         * editing/cocoa/WebArchiveResourceWebResourceHandler.h: Added.
2297         * editing/cocoa/WebArchiveResourceWebResourceHandler.mm: Added.
2298         Objects of this class can be passed as "WebResourceHandler", and created instances
2299         of the above class.
2300
2301         * editing/cocoa/WebContentReaderCocoa.mm:
2302         (WebCore::attributesForAttributedStringConversion):
2303         (WebCore::createFragment):
2304         On newer OS versions, don't use WebKitLegacy to convert NSAttributedString to a
2305         document fragment. We now only use system frameworks to convert the attributed
2306         string to HTML source, and parse HTML into a fragment directly in WebCore.
2307
2308         * platform/URL.h: Exported fakeURLWithRelativePart.
2309
2310 2017-09-19  Youenn Fablet  <youenn@apple.com>
2311
2312         Allow WTF::map to use any class that is iterable and has a size getter
2313         https://bugs.webkit.org/show_bug.cgi?id=177026
2314
2315         Reviewed by Darin Adler.
2316
2317         No change of behavior.
2318         Using WTF::map to go from maps to vectors.
2319
2320         * loader/appcache/ApplicationCacheHost.cpp:
2321         (WebCore::ApplicationCacheHost::resourceList):
2322         * page/DOMWindow.cpp:
2323         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
2324
2325 2017-09-19  Eric Carlson  <eric.carlson@apple.com>
2326
2327         Quiet media player private logging
2328         https://bugs.webkit.org/show_bug.cgi?id=177199
2329
2330         Reviewed by Jer Noble.
2331
2332         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2333         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2334
2335 2017-09-19  Alex Christensen  <achristensen@webkit.org>
2336
2337         Allow modern decoding of Vectors
2338         https://bugs.webkit.org/show_bug.cgi?id=177102
2339
2340         Reviewed by Andy Estes.
2341
2342         * Modules/cache/DOMCacheEngine.h:
2343         (WebCore::DOMCacheEngine::CacheInfos::decode):
2344         (WebCore::DOMCacheEngine::CacheIdentifierOperationResult::decode):
2345         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
2346         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
2347         * Modules/indexeddb/IDBDatabaseIdentifier.h:
2348         (WebCore::IDBDatabaseIdentifier::decode):
2349         * Modules/indexeddb/IDBFactory.cpp:
2350         (WebCore::IDBFactory::openInternal):
2351         (WebCore::IDBFactory::deleteDatabase):
2352         * Modules/indexeddb/IDBGetAllResult.h:
2353         (WebCore::IDBGetAllResult::decode):
2354         * Modules/indexeddb/IDBGetResult.h:
2355         (WebCore::IDBGetResult::decode):
2356         * Modules/indexeddb/IDBKeyData.h:
2357         (WebCore::IDBKeyData::decode):
2358         * Modules/indexeddb/IDBKeyRangeData.h:
2359         (WebCore::IDBKeyRangeData::decode):
2360         * Modules/indexeddb/IDBValue.h:
2361         (WebCore::IDBValue::decode):
2362         * Modules/indexeddb/shared/IDBError.h:
2363         * Modules/indexeddb/shared/IDBIterateCursorData.h:
2364         (WebCore::IDBIterateCursorData::decode):
2365         * Modules/indexeddb/shared/IDBRequestData.h:
2366         (WebCore::IDBRequestData::decode):
2367         * Modules/indexeddb/shared/IDBResultData.h:
2368         (WebCore::IDBResultData::decode):
2369         * page/SecurityOriginData.h:
2370         (WebCore::SecurityOriginData::decode):
2371         * platform/Cookie.h:
2372         (WebCore::Cookie::decode):
2373         * platform/mediastream/MediaConstraints.h:
2374         (WebCore::MediaTrackConstraintSetMap::decode):
2375         * platform/network/FormData.h:
2376         (WebCore::FormDataElement::decode):
2377         * workers/service/ServiceWorkerJobData.h:
2378         (WebCore::ServiceWorkerJobData::decode):
2379         * workers/service/ServiceWorkerRegistrationData.h:
2380         (WebCore::ServiceWorkerRegistrationData::decode):
2381         * workers/service/ServiceWorkerRegistrationKey.h:
2382         (WebCore::ServiceWorkerRegistrationKey::decode):
2383
2384 2017-09-19  Ryosuke Niwa  <rniwa@webkit.org>
2385
2386         On iOS, getData can't get text set by setData during copy event
2387         https://bugs.webkit.org/show_bug.cgi?id=176980
2388         <rdar://problem/34453915>
2389
2390         Reviewed by Darin Adler.
2391
2392         The bug was caused by iOS port not implementing Pasteboard::createPrivate(). Rather than implementing this in iOS,
2393         replace its use for copy & paste events by StaticPasteboard Wenson added for input events. This makes read-write
2394         pasteboard platform agnostic and paves the way to make writing to pasteboard in a single IPC in WebKit2.
2395
2396         Also fixed a bug that iOS port's Pasteboard::types returned the list of all supported types instead of ones
2397         actually present in the pasteboard.
2398
2399         This patch also adds a vector of types to StaticPasteboard to maintain the type order.
2400
2401         Tests: editing/pasteboard/dataTransfer-types-is-initially-empty-on-copy.html
2402                editing/pasteboard/dataTransfer-types-pasting-plaintext.html
2403
2404         * dom/DataTransfer.cpp:
2405         (WebCore::DataTransfer::createForCopyAndPaste): Make StaticPasteboard instead of a private pasteboard.
2406         (WebCore::DataTransfer::createForInputEvent):
2407         * editing/Editor.cpp:
2408         (WebCore::dispatchClipboardEvent): Call newly added commitToPasteboard on StaticPasteboard.
2409         * platform/Pasteboard.h:
2410         (WebCore::Pasteboard::isStatic const):
2411         * platform/PasteboardStrategy.h:
2412         * platform/StaticPasteboard.cpp:
2413         (WebCore::StaticPasteboard::create): Deleted.
2414         (WebCore::StaticPasteboard::StaticPasteboard):
2415         (WebCore::StaticPasteboard::hasData):
2416         (WebCore::StaticPasteboard::types): Deleted. Now simply returns m_type.
2417         (WebCore::StaticPasteboard::readString): Added.
2418         (WebCore::StaticPasteboard::writeString): Added.
2419         (WebCore::StaticPasteboard::clear): Added.
2420         (WebCore::StaticPasteboard::commitToPasteboard): Added.
2421         (isType): Added.
2422         * platform/StaticPasteboard.h:
2423         (WebCore::Pasteboard::isStatic const): Added.
2424         * platform/gtk/PasteboardGtk.cpp:
2425         (WebCore::Pasteboard::createPrivate): Deleted.
2426         (WebCore::Pasteboard::writePasteboard): Deleted.
2427         * platform/ios/PasteboardIOS.mm:
2428         (WebCore::Pasteboard::createPrivate): Deleted.
2429         (WebCore::Pasteboard::writePasteboard): Deleted.
2430         (WebCore::addHTMLClipboardTypesForCocoaType):
2431         (WebCore::Pasteboard::types): Return the actual list of types in the pasteboard.
2432         * platform/mac/PasteboardMac.mm:
2433         (WebCore::Pasteboard::createPrivate): Deleted.
2434         (WebCore::Pasteboard::writePasteboard): Deleted.
2435         * platform/win/PasteboardWin.cpp:
2436         (WebCore::Pasteboard::createPrivate): Deleted.
2437         (WebCore::Pasteboard::writePasteboard): Deleted.
2438         * platform/wpe/PasteboardWPE.cpp:
2439         (WebCore::Pasteboard::createPrivate): Deleted.
2440         (WebCore::Pasteboard::writePasteboard): Deleted.
2441
2442 2017-09-19  Zalan Bujtas  <zalan@apple.com>
2443
2444         AXObjectCache::performDeferredCacheUpdate is called recursively through FrameView::layout. 
2445         https://bugs.webkit.org/show_bug.cgi?id=176218
2446         <rdar://problem/34205612>
2447
2448         Reviewed by Simon Fraser.
2449
2450         There are certain cases when we might re-enter performDeferredCacheUpdate through recursive
2451         layout calls (see webkit.org/b/177176) and mutate m_deferredTextChangedList multiple times.
2452
2453         Test: accessibility/crash-table-recursive-layout.html
2454
2455         * accessibility/AXObjectCache.cpp:
2456         (WebCore::AXObjectCache::performDeferredCacheUpdate):
2457         * accessibility/AXObjectCache.h:
2458
2459 2017-09-19  Jer Noble  <jer.noble@apple.com>
2460
2461         [Cocoa] Add an ImageDecoder subclass backed by AVFoundation
2462         https://bugs.webkit.org/show_bug.cgi?id=176825
2463
2464         Reviewed by Eric Carlson.
2465
2466         Add a new concrete subclass of ImageDecoder which uses AVFoundation to parse and decode
2467         image data.
2468
2469         AVFoundation APIs require prior knowledge of the media data's mime type to determine whether
2470         the media data is decodable, so the mime type information must be passed through from the
2471         CachedResource -> CachedImage -> ImageFrameCache -> ImageSource so as to be available when
2472         creating the ImageDecoder:
2473
2474         (Drive-by fix: the createFrameImageAtIndex() method will mutate internal state, so make it
2475         non-const.)
2476
2477         * loader/cache/CachedImage.h:
2478         * loader/cache/CachedResource.h:
2479         (WebCore::CachedResource::mimeType const):
2480         * platform/cf/CoreMediaSoftLink.cpp:
2481         * platform/cf/CoreMediaSoftLink.h:
2482         * platform/cocoa/VideoToolboxSoftLink.cpp:
2483         * platform/cocoa/VideoToolboxSoftLink.h:
2484         * platform/graphics/Image.cpp:
2485         (WebCore::Image::mimeType const):
2486         (WebCore::Image::expectedContentSize const):
2487         * platform/graphics/Image.h:
2488         * platform/graphics/ImageDecoder.cpp:
2489         (WebCore::ImageDecoder::create):
2490         * platform/graphics/ImageDecoder.h:
2491         (WebCore::ImageDecoder::setExpectedContentSize):
2492         * platform/graphics/ImageFrameCache.cpp:
2493         (WebCore::ImageFrameCache::mimeType const):
2494         * platform/graphics/ImageFrameCache.h:
2495         * platform/graphics/ImageObserver.h:
2496         * platform/graphics/ImageSource.cpp:
2497         (WebCore::ImageSource::ensureDecoderAvailable):
2498         * platform/graphics/cg/ImageDecoderCG.cpp:
2499         (WebCore::ImageDecoderCG::createFrameImageAtIndex):
2500         * platform/graphics/cg/ImageDecoderCG.h:
2501
2502         Add the new class, ImageDecoderAVFObjC:
2503
2504         AVFoundation expects to load all the media data for an AVURLAsset itself. To map between the
2505         provided SharedData and AVURLAsset's requirements, create a delegate object
2506         WebCoreSharedBufferResourceLoaderDelegate, which responds to requests from the AVURLAsset by
2507         extracting data from the SharedData object. Ensure AVURLAsset doesn't load any data outside
2508         this delegate by passing the AVURLAssetReferenceRestrictionsKey /
2509         AVAssetReferenceRestrictionForbidAll key and value in the AVURLAsset creation options.
2510
2511         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h: Added.
2512         (WebCore::ImageDecoderAVFObjC::create):
2513         (WebCore::ImageDecoderAVFObjC::mimeType const):
2514         (WebCore::ImageDecoderAVFObjC::RotationProperties::isIdentity const):
2515         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: Added.
2516         (SOFT_LINK_CONSTANT):
2517         (-[WebCoreSharedBufferResourceLoaderDelegate initWithParent:]):
2518         (-[WebCoreSharedBufferResourceLoaderDelegate setExpectedContentSize:]):
2519         (-[WebCoreSharedBufferResourceLoaderDelegate updateData:complete:]):
2520         (-[WebCoreSharedBufferResourceLoaderDelegate canFulfillRequest:]):
2521         (-[WebCoreSharedBufferResourceLoaderDelegate enqueueRequest:]):
2522         (-[WebCoreSharedBufferResourceLoaderDelegate fulfillPendingRequests]):
2523         (-[WebCoreSharedBufferResourceLoaderDelegate fulfillRequest:]):
2524         (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
2525         (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
2526         (WebCore::customSchemeURL):
2527         (WebCore::imageDecoderAssetOptions):
2528         (WebCore::transformToRotationProperties):
2529         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
2530         (WebCore::ImageDecoderAVFObjC::canDecodeType):
2531         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
2532         (WebCore::ImageDecoderAVFObjC::readSampleMetadata): Parses the media data using AVSampleCursor to walk
2533             the media sample table, extracting frame presentation time, decode time, and duration.
2534         (WebCore::ImageDecoderAVFObjC::readTrackMetadata): Reads the affine transform and size information from
2535             the AVAssetTrack, and transforms the transform into a rotation value.
2536         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer): Decompress the incoming sample data, optionally rotate
2537             the output, and store the results in the sample data vector.
2538         (WebCore::ImageDecoderAVFObjC::advanceCursor): Wrap around the end of the sample table.
2539         (WebCore::ImageDecoderAVFObjC::setTrack): Reset all sample and track metadata.
2540         (WebCore::ImageDecoderAVFObjC::encodedDataStatus const): Retrieve from sample data.
2541         (WebCore::ImageDecoderAVFObjC::frameCount const): Ditto.
2542         (WebCore::ImageDecoderAVFObjC::repetitionCount const): Ditto.
2543         (WebCore::ImageDecoderAVFObjC::uti const): Ditto.
2544         (WebCore::ImageDecoderAVFObjC::filenameExtension const): Ditto.
2545         (WebCore::ImageDecoderAVFObjC::frameSizeAtIndex const): Ditto.
2546         (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const): Ditto.
2547         (WebCore::ImageDecoderAVFObjC::frameOrientationAtIndex const): Ditto.
2548         (WebCore::ImageDecoderAVFObjC::frameDurationAtIndex const): Ditto.
2549         (WebCore::ImageDecoderAVFObjC::frameHasAlphaAtIndex const): Ditto.
2550         (WebCore::ImageDecoderAVFObjC::frameAllowSubsamplingAtIndex const): Ditto.
2551         (WebCore::ImageDecoderAVFObjC::frameBytesAtIndex const): Ditto.
2552         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex): If the sample data has already been
2553             decompressed, return it. Otherwise, walk through the sample table decompressing frames
2554             until the desired frame is decoded.
2555         (WebCore::ImageDecoderAVFObjC::setData):
2556         (WebCore::ImageDecoderAVFObjC::clearFrameBufferCache):
2557
2558         Modify WebCoreDecompressionSession so that it can emit frames which have been converted from
2559         YUV -> RGB as part of the decode operation. Also, add a synchronous decoding operation
2560         method, for use in ImageDecoderAVFObjC.
2561
2562         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2563         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureDecompressionSession):
2564         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
2565         (WebCore::WebCoreDecompressionSession::createOpenGL):
2566         (WebCore::WebCoreDecompressionSession::createRGB):
2567         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2568         (WebCore::WebCoreDecompressionSession::WebCoreDecompressionSession):
2569         (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
2570         (WebCore::WebCoreDecompressionSession::decodeSample):
2571         (WebCore::WebCoreDecompressionSession::decodeSampleSync):
2572
2573         Other changes:
2574
2575         * WebCore.xcodeproj/project.pbxproj: Add new files to project.
2576         * platform/cocoa/VideoToolboxSoftLink.cpp: Add newly referenced methods.
2577         * platform/cocoa/VideoToolboxSoftLink.h: Ditto.
2578
2579
2580 2017-09-19  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2581
2582         [Curl] Move Authentication related tasks into AuthenticationChallenge class
2583         https://bugs.webkit.org/show_bug.cgi?id=177105
2584
2585         Currently those codes are in ResourceHandle or related companion. It will
2586         be reused with NetworkLoadTask so that it should be separated from them.
2587
2588         Reviewed by Alex Christensen.
2589
2590         * platform/Curl.cmake:
2591         * platform/network/curl/AuthenticationChallenge.h:
2592         (WebCore::AuthenticationChallenge::AuthenticationChallenge): Deleted.
2593         (WebCore::AuthenticationChallenge::authenticationClient const): Deleted.
2594         (WebCore::AuthenticationChallenge::setAuthenticationClient): Deleted.
2595         * platform/network/curl/AuthenticationChallengeCurl.cpp: Added.
2596         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
2597         (WebCore::AuthenticationChallenge::protectionSpaceServerTypeFromURI):
2598         (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
2599         (WebCore::AuthenticationChallenge::removeLeadingAndTrailingQuotes):
2600         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2601         (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
2602         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
2603         (WebCore::removeLeadingAndTrailingQuotes): Deleted.
2604         (WebCore::ResourceHandleCurlDelegate::getProtectionSpace): Deleted.
2605         * platform/network/curl/ResourceHandleCurlDelegate.h:
2606
2607 2017-09-19  Zalan Bujtas  <zalan@apple.com>
2608
2609         Do not mutate RenderText content during layout.
2610         https://bugs.webkit.org/show_bug.cgi?id=176219
2611         <rdar://problem/34205724>
2612
2613         Reviewed by David Hyatt.
2614
2615         Update combined text when the style/content change as opposed to lazily, during layout.
2616         -content mutation during layout might make the inline tree go out of sync.
2617
2618         Test: fast/text/international/dynamic-text-combine-crash.html
2619
2620         * rendering/RenderBlockFlow.cpp:
2621         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
2622         * rendering/RenderCombineText.cpp:
2623         (WebCore::RenderCombineText::styleDidChange):
2624         (WebCore::RenderCombineText::setRenderedText):
2625         (WebCore::RenderCombineText::combineTextIfNeeded):
2626         (WebCore::RenderCombineText::combineText): Deleted.
2627         * rendering/RenderCombineText.h:
2628         * rendering/RenderText.h:
2629         * rendering/line/BreakingContext.h:
2630         (WebCore::BreakingContext::handleText):
2631         * rendering/line/LineBreaker.cpp:
2632         (WebCore::LineBreaker::skipLeadingWhitespace):
2633
2634 2017-09-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2635
2636         createMarkupInternal should protect its pointer to the Range's common ancestor
2637         https://bugs.webkit.org/show_bug.cgi?id=177033
2638         <rdar://problem/34265390>
2639
2640         Reviewed by Tim Horton.
2641
2642         Adds basic safeguarding to codepaths hit while executing an outdent command.
2643
2644         Test: editing/execCommand/outdent-with-media-query-listener-in-iframe.html
2645
2646         * editing/IndentOutdentCommand.cpp:
2647         (WebCore::IndentOutdentCommand::outdentRegion):
2648
2649         Avoid an infinite loop if endOfCurrentParagraph is a null position.
2650
2651         * editing/markup.cpp:
2652         (WebCore::createMarkupInternal):
2653
2654         Protect the raw pointer to the Range's common ancestor node.
2655
2656 2017-09-19  Ryan Haddad  <ryanhaddad@apple.com>
2657
2658         Unreviewed, rolling out r222217 and r222214.
2659         This change introduced two LayoutTest failures.
2660         https://bugs.webkit.org/show_bug.cgi?id=177026
2661
2662         * rendering/RenderBlockFlow.cpp:
2663         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
2664         * rendering/RenderCombineText.cpp:
2665         (WebCore::RenderCombineText::styleDidChange):
2666         (WebCore::RenderCombineText::setRenderedText):
2667         (WebCore::RenderCombineText::combineText):
2668         (WebCore::RenderCombineText::combineTextIfNeeded): Deleted.
2669         * rendering/RenderCombineText.h:
2670         * rendering/RenderText.cpp:
2671         * rendering/RenderText.h:
2672         * rendering/line/BreakingContext.h:
2673         (WebCore::BreakingContext::handleText):
2674         * rendering/line/LineBreaker.cpp:
2675         (WebCore::LineBreaker::skipLeadingWhitespace):
2676
2677 2017-09-19  Zalan Bujtas  <zalan@apple.com>
2678
2679         Attempt to fix Linux build.
2680
2681         * rendering/RenderText.cpp:
2682
2683 2017-09-19  Zalan Bujtas  <zalan@apple.com>
2684
2685         Do not mutate RenderText content during layout.
2686         https://bugs.webkit.org/show_bug.cgi?id=176219
2687         <rdar://problem/34205724>
2688
2689         Reviewed by David Hyatt.
2690
2691         Update combined text when the style/content change as opposed to lazily, during layout.
2692         -content mutation during layout might make the inline tree go out of sync.
2693
2694         Test: fast/text/international/dynamic-text-combine-crash.html
2695
2696         * rendering/RenderBlockFlow.cpp:
2697         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
2698         * rendering/RenderCombineText.cpp:
2699         (WebCore::RenderCombineText::styleDidChange):
2700         (WebCore::RenderCombineText::setRenderedText):
2701         (WebCore::RenderCombineText::combineTextIfNeeded):
2702         (WebCore::RenderCombineText::combineText): Deleted.
2703         * rendering/RenderCombineText.h:
2704         * rendering/RenderText.h:
2705         * rendering/line/BreakingContext.h:
2706         (WebCore::BreakingContext::handleText):
2707         * rendering/line/LineBreaker.cpp:
2708         (WebCore::LineBreaker::skipLeadingWhitespace):
2709
2710 2017-09-19  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
2711
2712         [GTK] The binding code of Media Source Extension of AudioTrack, VideoTrack and TextTrack is not generated
2713         https://bugs.webkit.org/show_bug.cgi?id=174620
2714
2715         Reviewed by Michael Catanzaro.
2716
2717         Add AudioTrackMediaSource, VideoTrackMediaSource and TextTrackMediaSource IDL files in CMakeLists. Fix WPT test
2718         that checks MSE interfaces. This test failed since webm is not supported for MSE in GTK port. PR already merged
2719         in WPT repository.
2720
2721         Remove skipped test that is now passing in TestExpectation. Modify expected file for GTK (same as mac).
2722
2723         * CMakeLists.txt:
2724
2725 2017-09-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2726
2727         [Harfbuzz] adjustSelectionRectForComplexText() should also pass the character range when shaping
2728         https://bugs.webkit.org/show_bug.cgi?id=177049
2729
2730         Reviewed by Michael Catanzaro.
2731
2732         Now that the shaper support receiving a range we should use that also in
2733         adjustSelectionRectForComplexText(). This will ensure consistent results with
2734         getGlyphsAndAdvancesForComplexText().
2735
2736         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
2737         (WebCore::FontCascade::adjustSelectionRectForComplexText const):
2738
2739 2017-09-19  Dean Jackson  <dino@apple.com>
2740
2741         [WebGL] VideoTextureCopierCV doesn't correctly restore vertex attribute state
2742         https://bugs.webkit.org/show_bug.cgi?id=176771
2743         <rdar://problem/34386621>
2744
2745         Reviewed by Antoine Quint.
2746
2747         The OpenGL context in VideoTextureCopierCV wasn't being restored to
2748         the state it had before rendering a video to a texture. Specifically
2749         the vertex attribute values were never recorded by the state saver.
2750
2751         Update the existing test of VideoTextureCopierCV so that it is
2752         explicitly doing something different from the WebCore code, which
2753         means that state will have to be correctly restored for the test
2754         to pass.
2755
2756         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2757         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Make sure
2758         to record the vertex attribute state once we know the location of the position attribute.
2759         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
2760         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
2761         (WebCore::VideoTextureCopierCV::GC3DStateSaver::saveVertexAttribState): Save all the
2762         applicable vertex attribute state information.
2763         * platform/graphics/cv/VideoTextureCopierCV.h: GC3DStateSaver can use a reference
2764         to the GC3D rather than a pointer.
2765
2766 2017-09-19  Dean Jackson  <dino@apple.com>
2767
2768         [WebGL] accelerated texImage2D for video doesn't respect flipY
2769         https://bugs.webkit.org/show_bug.cgi?id=176491
2770         <rdar://problem/33833511>
2771
2772         Reviewed by Jer Noble.
2773
2774         (Take 3 - this was rolled out due to a test failure)
2775
2776         Previously, if UNPACK_FLIP_Y_WEBGL was set to true, we'd either fall
2777         back to software or fail to upload texture data. Fix this by intercepting
2778         the texImage2D call, checking the orientation of the video, and running
2779         a small shader program to flip it if necessary.
2780
2781         While there, implement UNPACK_PREMULTIPLY_ALPHA_WEBGL as well, although
2782         none of our media decoders support video with alpha, so unfortunately
2783         this will have no visible change.
2784
2785         Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html
2786                fast/canvas/webgl/texImage2D-video-flipY-true.html
2787
2788         * platform/cocoa/CoreVideoSoftLink.cpp: Add link to CVOpenGL(ES)TextureGetCleanTexCoords,
2789         which is used to check the orientation of the source video.
2790         * platform/cocoa/CoreVideoSoftLink.h:
2791
2792         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2793         (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): We can
2794         now handle flipped or premultiplied requests.
2795         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2796         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): Ditto.
2797
2798         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2799         (WebCore::VideoTextureCopierCV::VideoTextureCopierCV): Rename readFramebuffer to
2800         simply framebuffer.
2801         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV): Delete the program and buffer
2802         if they were created.
2803         (WebCore::VideoTextureCopierCV::initializeContextObjects): Sets up the shader program
2804         and the vertex buffer for drawing. Also records the location of the uniforms.
2805         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Create a new
2806         framebuffer object, and render the video texture into that framebuffer using a
2807         shader that can flip the coordinates.
2808         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver): Helper to restore
2809         the state of the user's GraphicsContext3D while we're intercepting calls.
2810         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
2811         * platform/graphics/cv/VideoTextureCopierCV.h:
2812
2813         * platform/graphics/GraphicsContext3D.h: Add two new entry points, for direct shader
2814         compilation and attribute access. This avoids going through ANGLE.
2815         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2816         (WebCore::GraphicsContext3D::compileShader):
2817         (WebCore::GraphicsContext3D::compileShaderDirect):
2818         (WebCore::GraphicsContext3D::getAttribLocationDirect):
2819
2820 2017-09-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
2821
2822         Make ImageFrame::duration() return Seconds instead of float
2823         https://bugs.webkit.org/show_bug.cgi?id=177103
2824
2825         Reviewed by Simon Fraser.
2826
2827         ScalableImageDecoder stores milliseconds for the duration of its ImageFrames.
2828         But ImageFrameCache store seconds for the duration of its ImageFrames.
2829         To fix this issue use Seconds for the ImageFrame duration.
2830
2831         * platform/graphics/BitmapImage.h:
2832         * platform/graphics/ImageDecoder.h:
2833         * platform/graphics/ImageFrame.h:
2834         (WebCore::ImageFrame::setDuration):
2835         (WebCore::ImageFrame::duration const):
2836         * platform/graphics/ImageFrameCache.cpp:
2837         (WebCore::ImageFrameCache::frameDurationAtIndex):
2838         * platform/graphics/ImageFrameCache.h:
2839         * platform/graphics/ImageSource.h:
2840         (WebCore::ImageSource::frameDurationAtIndex):
2841         * platform/graphics/cg/ImageDecoderCG.cpp:
2842         (WebCore::ImageDecoderCG::frameDurationAtIndex const):
2843         * platform/graphics/cg/ImageDecoderCG.h:
2844         * platform/image-decoders/ScalableImageDecoder.cpp:
2845         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
2846         * platform/image-decoders/ScalableImageDecoder.h:
2847         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2848         (WebCore::GIFImageDecoder::frameComplete):
2849         * platform/image-decoders/png/PNGImageDecoder.cpp:
2850         (WebCore::PNGImageDecoder::readChunks):
2851         (WebCore::PNGImageDecoder::frameHeader): Deleted.
2852         (WebCore::PNGImageDecoder::init): Deleted.
2853         (WebCore::PNGImageDecoder::clearFrameBufferCache): Deleted.
2854         (WebCore::PNGImageDecoder::initFrameBuffer): Deleted.
2855         (WebCore::PNGImageDecoder::frameComplete): Deleted.
2856         (WebCore::PNGImageDecoder::processingStart): Deleted.
2857         (WebCore::PNGImageDecoder::processingFinish): Deleted.
2858         (WebCore::PNGImageDecoder::fallbackNotAnimated): Deleted.
2859
2860 2017-09-18  Per Arne Vollan  <pvollan@apple.com>
2861
2862         [Win] Compile error in InbandTextTrackPrivateAVCF::readNativeSampleBuffer.
2863         https://bugs.webkit.org/show_bug.cgi?id=177108
2864
2865         Reviewed by Brent Fulgham.
2866
2867         The InbandTextTrackPrivateAVF::m_sampleInputBuffer is private and not accessible in this method.
2868  
2869         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
2870
2871 2017-09-18  Tim Horton  <timothy_horton@apple.com>
2872
2873         Support min() and max() in calc()
2874         https://bugs.webkit.org/show_bug.cgi?id=167000
2875         <rdar://problem/30153481>
2876
2877         Reviewed by David Hyatt.
2878         Patch originally by Myles Maxfield.
2879
2880         Add two new toplevel functions to CSS, min() and max(), which take an
2881         arbirary number of arguments and resolve to the minimum and maximum of
2882         the resolved value of the arguments, respectively. It is also possible
2883         to use min() and max() inside calc(), and to use calc()-like math
2884         inside min() and max().
2885
2886         * css/CSSCalculationValue.cpp:
2887         (WebCore::determineCategory):
2888         min and max operators don't use determineCategory; we have a specific
2889         implementation for them in createMinOrMax.
2890
2891         (WebCore::resolvedTypeForMinOrMax):
2892         The spec says that min() and max() should be marked as invalid if they
2893         have values of more than one type, but that percentages should resolve
2894         against the destination type before making this determination. So,
2895         if the destination type is length, percent turns into percent-length,
2896         and similarly for number.
2897
2898         (WebCore::isIntegerResult):
2899         Add an n-way implementation of isIntegerResult.
2900
2901         (WebCore::isSamePair):
2902         (WebCore::CSSCalcOperation::createMinOrMax): Create a min() or max()
2903         operation, as long as the types of arguments are all the same. Allow
2904         lengths to upgrade the whole operation to percent-length, and numbers
2905         to percent-number, which will cause us to use CalculationValue and friends
2906         in order to do proper resolution of all of the parameters instead of
2907         just comparing their numeric values.
2908
2909         (WebCore::CSSCalcOperation::createCalcExpression):
2910         (WebCore::CSSCalcOperation::doubleValue):
2911         (WebCore::CSSCalcOperation::computeLengthPx):
2912         (WebCore::CSSCalcOperation::customCSSText):
2913         (WebCore::CSSCalcOperation::primitiveType):
2914         (WebCore::CSSCalcOperation::CSSCalcOperation):
2915         (WebCore::CSSCalcOperation::evaluate):
2916         (WebCore::CSSCalcOperation::evaluateOperator):
2917         Adapt to child counts greater than two.
2918
2919         (WebCore::CSSCalcOperation::buildCssText):
2920         Add support for min() and max().
2921
2922         (WebCore::CSSCalcExpressionNodeParser::parseCalc):
2923         parseCalc now accepts a CSSValueID parameter indicating which calc function
2924         it should parse (calc, webkit-calc, min, or max), and delegates to either
2925         parseValueExpression or parseMinMaxExpression.
2926
2927         (WebCore::CSSCalcExpressionNodeParser::operatorValue):
2928         (WebCore::CSSCalcExpressionNodeParser::parseValue):
2929         If min() or max() are found while parsing a value (i.e. nested inside
2930         either calc or themselves), use parseMinMaxExpression on that subtree.
2931
2932         (WebCore::CSSCalcExpressionNodeParser::parseValueTerm):
2933         (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
2934         (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
2935         Adjust to the CSSCalcBinaryOperation->CSSCalcOperation rename.
2936
2937         (WebCore::CSSCalcExpressionNodeParser::parseMinMaxExpression):
2938         Added. Parse an arbitrary number of comma-and-whitespace-separated children.
2939
2940         (WebCore::createBlendHalf):
2941         Adjust to the CSSCalcBinaryOperation->CSSCalcOperation rename.
2942
2943         (WebCore::createCSS):
2944         Build the CSSCalcOperation for the platform-independent min and max operations.
2945
2946         (WebCore::CSSCalcValue::create):
2947         Pass the function being parsed and the destination calc category for the
2948         property being parsed for into create, and then into the parser so that
2949         it can know which function it is parsing for, and what kind of result it
2950         needs (as previously mentioned above in resolvedTypeForMinOrMax).
2951
2952         * css/CSSCalculationValue.h:
2953         * css/CSSValueKeywords.in:
2954         Add min and max functions as CSS keywords.
2955
2956         * css/StyleBuilderConverter.h:
2957         (WebCore::StyleBuilderConverter::convertLength):
2958         (WebCore::StyleBuilderConverter::convertTo100PercentMinusLength):
2959         * platform/Length.cpp:
2960         (WebCore::convertTo100PercentMinusLength):
2961         Adapt to the CalcExpressionOperation constructor taking a vector of
2962         arguments instead of two.
2963
2964         * css/parser/CSSPropertyParserHelpers.cpp:
2965         (WebCore::CSSPropertyParserHelpers::CalcParser::CalcParser):
2966         Store and pass the specific function being parsed down into CSSCalcValue.
2967
2968         (WebCore::CSSPropertyParserHelpers::consumeInteger):
2969         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
2970         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
2971         (WebCore::CSSPropertyParserHelpers::consumeNumber):
2972         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
2973         (WebCore::CSSPropertyParserHelpers::consumeLength):
2974         (WebCore::CSSPropertyParserHelpers::consumePercent):
2975         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
2976         (WebCore::CSSPropertyParserHelpers::consumeAngle):
2977         (WebCore::CSSPropertyParserHelpers::consumeTime):
2978         Pass the destination type into each calc parser.
2979
2980         * platform/CalculationValue.cpp:
2981         (WebCore::CalcExpressionOperation::evaluate const):
2982         (WebCore::CalcExpressionOperation::operator== const):
2983         (WebCore::CalcExpressionOperation::dump const):
2984         (WebCore::operator<<):
2985         (WebCore::CalcExpressionBinaryOperation::evaluate const): Deleted.
2986         (WebCore::CalcExpressionBinaryOperation::operator== const): Deleted.
2987         (WebCore::CalcExpressionBinaryOperation::dump const): Deleted.
2988         * platform/CalculationValue.h:
2989         (WebCore::CalcExpressionOperation::CalcExpressionOperation):
2990         (WebCore::operator==):
2991         (WebCore::toCalcExpressionOperation):
2992         (WebCore::CalcExpressionBinaryOperation::CalcExpressionBinaryOperation): Deleted.
2993         (WebCore::toCalcExpressionBinaryOperation): Deleted.
2994         Adjust to the CSSCalcBinaryOperation->CSSCalcOperation rename.
2995         Adjust to having n>2 children.
2996         Support min() and max() operators in various places.
2997         
2998
2999 2017-09-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3000
3001         [Curl] Move error generation task into ResourceError
3002         https://bugs.webkit.org/show_bug.cgi?id=176963
3003
3004         Reviewed by Alex Christensen.
3005
3006         * platform/Curl.cmake:
3007         * platform/network/curl/CurlContext.cpp:
3008         (WebCore::CurlHandle::errorDescription):
3009         (WebCore::CurlHandle::errorDescription const):
3010         * platform/network/curl/CurlContext.h:
3011         * platform/network/curl/ResourceError.h:
3012         (WebCore::ResourceError::setSslErrors):
3013         (WebCore::ResourceError::hasSSLConnectError const): Deleted.
3014         (WebCore::ResourceError::doPlatformIsolatedCopy): Deleted.
3015         * platform/network/curl/ResourceErrorCurl.cpp: Added.
3016         (WebCore::ResourceError::httpError):
3017         (WebCore::ResourceError::sslError):
3018         (WebCore::ResourceError::hasSSLConnectError const):
3019         (WebCore::ResourceError::doPlatformIsolatedCopy):
3020         (WebCore::ResourceError::platformCompare):
3021         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
3022         (WebCore::ResourceHandleCurlDelegate::notifyFail):
3023         (WebCore::ResourceHandleCurlDelegate::didFail):
3024         * platform/network/curl/ResourceHandleCurlDelegate.h:
3025
3026 2017-09-18  Ryan Haddad  <ryanhaddad@apple.com>
3027
3028         Unreviewed, rolling out r222170.
3029
3030         The API test added with this change is failing.
3031
3032         Reverted changeset:
3033
3034         "Allow WTF::map to use any class that is iterable and has a
3035         size getter"
3036         https://bugs.webkit.org/show_bug.cgi?id=177026
3037         http://trac.webkit.org/changeset/222170
3038
3039 2017-09-18  Don Olmstead  <don.olmstead@sony.com>
3040
3041         [Curl] Forward declare SSL context
3042
3043         Unreviewed build fix after r222147. OpenSSL's SHA1 declaration conflicts with WTF's.
3044
3045         No new tests. No change in behavior.
3046
3047         * platform/network/curl/CurlSSLHandle.h:
3048         * platform/network/curl/CurlSSLVerifier.cpp:
3049         * platform/network/curl/CurlSSLVerifier.h:
3050
3051 2017-09-18  Ryosuke Niwa  <rniwa@webkit.org>
3052
3053         getData('text/plain') doesn't work on iOS 10
3054         https://bugs.webkit.org/show_bug.cgi?id=177034
3055
3056         Reviewed by Wenson Hsieh.
3057
3058         The bug was caused by the mispatch of UTI between reading & writing plain text.
3059         Use kUTTypeText (instead of kUTTypePlainText) to read from UIPasteboard on iOS 10.
3060
3061         Re-enabled tests were passing on iOS 11 and continues to pass after this code change.
3062
3063         Tests: editing/pasteboard/clipboard-event.html
3064                editing/pasteboard/datatransfer-items-paste-plaintext.html
3065                editing/pasteboard/get-data-text-plain-paste.html
3066
3067         * platform/ios/PasteboardIOS.mm:
3068         (WebCore::cocoaTypeFromHTMLClipboardType):
3069
3070 2017-09-18  Youenn Fablet  <youenn@apple.com>
3071
3072         Allow WTF::map to use any class that is iterable and has a size getter
3073         https://bugs.webkit.org/show_bug.cgi?id=177026
3074
3075         Reviewed by Darin Adler.
3076
3077         No change of behavior.
3078         Using WTF::map to go from maps to vectors.
3079
3080         * loader/appcache/ApplicationCacheHost.cpp:
3081         (WebCore::ApplicationCacheHost::resourceList):
3082         * page/DOMWindow.cpp:
3083         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
3084
3085 2017-09-18  Emilio Cobos Ãlvarez  <emilio@crisal.io>
3086
3087         Always update display: contents styles in RenderTreeUpdater.
3088         https://bugs.webkit.org/show_bug.cgi?id=177065
3089
3090         Reviewed by Antti Koivisto.
3091
3092         Otherwise we keep an old style around, making following style updates wrong.
3093
3094         Test: fast/css/display-contents-style-update.html
3095
3096         * style/RenderTreeUpdater.cpp:
3097         (WebCore::RenderTreeUpdater::updateElementRenderer):
3098
3099 2017-09-18  Antti Koivisto  <antti@apple.com>
3100
3101         Avoid style resolution when clearing focused element.
3102         https://bugs.webkit.org/show_bug.cgi?id=176224
3103         <rdar://problem/34206409>
3104
3105         Reviewed by Zalan Bujtas.
3106
3107         Test: fast/dom/focus-style-resolution.html
3108
3109         * dom/Document.cpp:
3110         (WebCore::Document::setFocusedElement):
3111
3112             Don't do synchronous style resolution with FocusRemovalEventsMode::DoNotDispatch.
3113             Style resolution may dispatch events.
3114
3115         * html/HTMLInputElement.cpp:
3116         (WebCore::HTMLInputElement::didBlur):
3117
3118             Move resolveStyleIfNeeded call to setFocusedElement. It is the only client for didBlur.
3119
3120 2017-09-18  Antti Koivisto  <antti@apple.com>
3121
3122         Rolling out the previous to land again with a test.
3123
3124         * dom/Document.cpp:
3125         (WebCore::Document::setFocusedElement):
3126         * html/HTMLInputElement.cpp:
3127         (WebCore::HTMLInputElement::didBlur):
3128
3129 2017-09-18  Antti Koivisto  <antti@apple.com>
3130
3131         Avoid style resolution when clearing focused element.
3132         https://bugs.webkit.org/show_bug.cgi?id=176224
3133         <rdar://problem/34206409>
3134
3135         Reviewed by Zalan Bujtas.
3136
3137         Test: fast/dom/focus-style-resolution.html
3138
3139         * dom/Document.cpp:
3140         (WebCore::Document::setFocusedElement):
3141
3142             Don't do synchronous style resolution with FocusRemovalEventsMode::DoNotDispatch.
3143             Style resolution may dispatch events.
3144
3145         * html/HTMLInputElement.cpp:
3146         (WebCore::HTMLInputElement::didBlur):
3147
3148             Move resolveStyleIfNeeded call to setFocusedElement. It is the only client for didBlur.
3149
3150 2017-09-18  Per Arne Vollan  <pvollan@apple.com>
3151
3152         [WK1] Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing.
3153         https://bugs.webkit.org/show_bug.cgi?id=177071
3154
3155         Reviewed by Brent Fulgham.
3156
3157         The Page pointer in the history controller's frame is null. Add a null pointer check before
3158         accessing the page. 
3159
3160         No new tests, covered by exiting tests.
3161
3162         * loader/HistoryController.cpp:
3163         (WebCore::HistoryController::updateForStandardLoad):
3164         (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
3165         (WebCore::HistoryController::updateForClientRedirect):
3166
3167 2017-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3168
3169         REGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html is failing since r221974
3170         https://bugs.webkit.org/show_bug.cgi?id=177036
3171
3172         Reviewed by Michael Catanzaro.
3173
3174         In r221974 I rewrote the characterIndexForXPosition implementation without taking into account that there can be
3175         multiple glyphs for the same character, so we can't simply do index++ and index-- to get the next and previous
3176         character index.
3177
3178         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
3179         (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition): Always get the character index from
3180         m_glyphToCharacterIndexes array.
3181
3182 2017-09-18  Jer Noble  <jer.noble@apple.com>
3183
3184         Virtualize ImageDecoder
3185         https://bugs.webkit.org/show_bug.cgi?id=176118
3186
3187         Reviewed by Eric Carlson.
3188
3189         Add an explicit, abstract base class ImageDecoder, and convert ImageDecoderCG to a true
3190         subclass. This will allow multiple ImageDecoder subclasses to exist simultaneously at
3191         runtime.
3192
3193         * CMakeLists.txt:
3194         * WebCore.xcodeproj/project.pbxproj:
3195         * platform/ImageDecoders.cmake:
3196         * platform/graphics/ImageDecoder.cpp: Added.
3197         (WebCore::ImageDecoder::create):
3198         (WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
3199         * platform/graphics/ImageDecoder.h: Added.
3200         (WebCore::ImageDecoder::isSizeAvailable):
3201         (WebCore::ImageDecoder::isAllDataReceived const):
3202         * platform/graphics/cg/ImageDecoderCG.cpp:
3203         (WebCore::ImageDecoderCG::ImageDecoderCG):
3204         (WebCore::ImageDecoderCG::bytesDecodedToDetermineProperties):
3205         (WebCore::ImageDecoderCG::uti const):
3206         (WebCore::ImageDecoderCG::filenameExtension const):
3207         (WebCore::ImageDecoderCG::encodedDataStatus const):
3208         (WebCore::ImageDecoderCG::frameCount const):
3209         (WebCore::ImageDecoderCG::repetitionCount const):
3210         (WebCore::ImageDecoderCG::hotSpot const):
3211         (WebCore::ImageDecoderCG::frameSizeAtIndex const):
3212         (WebCore::ImageDecoderCG::frameIsCompleteAtIndex const):
3213         (WebCore::ImageDecoderCG::frameOrientationAtIndex const):
3214         (WebCore::ImageDecoderCG::frameDurationAtIndex const):
3215         (WebCore::ImageDecoderCG::frameAllowSubsamplingAtIndex const):
3216         (WebCore::ImageDecoderCG::frameHasAlphaAtIndex const):
3217         (WebCore::ImageDecoderCG::frameBytesAtIndex const):
3218         (WebCore::ImageDecoderCG::createFrameImageAtIndex const):
3219         (WebCore::ImageDecoderCG::setData):
3220         (WebCore::ImageDecoder::ImageDecoder): Deleted.
3221         (WebCore::ImageDecoder::bytesDecodedToDetermineProperties): Deleted.
3222         (WebCore::ImageDecoder::uti const): Deleted.
3223         (WebCore::ImageDecoder::filenameExtension const): Deleted.
3224         (WebCore::ImageDecoder::encodedDataStatus const): Deleted.
3225         (WebCore::ImageDecoder::frameCount const): Deleted.
3226         (WebCore::ImageDecoder::repetitionCount const): Deleted.
3227         (WebCore::ImageDecoder::hotSpot const): Deleted.
3228         (WebCore::ImageDecoder::frameSizeAtIndex const): Deleted.
3229         (WebCore::ImageDecoder::frameIsCompleteAtIndex const): Deleted.
3230         (WebCore::ImageDecoder::frameOrientationAtIndex const): Deleted.
3231         (WebCore::ImageDecoder::frameDurationAtIndex const): Deleted.
3232         (WebCore::ImageDecoder::frameAllowSubsamplingAtIndex const): Deleted.
3233         (WebCore::ImageDecoder::frameHasAlphaAtIndex const): Deleted.
3234         (WebCore::ImageDecoder::frameBytesAtIndex const): Deleted.
3235         (WebCore::ImageDecoder::createFrameImageAtIndex const): Deleted.
3236         (WebCore::ImageDecoder::setData): Deleted.
3237         * platform/graphics/cg/ImageDecoderCG.h:
3238         (WebCore::ImageDecoderCG::create):
3239         (WebCore::ImageDecoder::create): Deleted.
3240         (WebCore::ImageDecoder::isSizeAvailable): Deleted.
3241         (WebCore::ImageDecoder::isAllDataReceived const): Deleted.
3242         (WebCore::ImageDecoder::clearFrameBufferCache): Deleted.
3243         * platform/graphics/win/ImageDecoderDirect2D.cpp:
3244         (WebCore::ImageDecoderDirect2D::ImageDecoderDirect2D):
3245         (WebCore::ImageDecoderDirect2D::systemImagingFactory):
3246         (WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties):
3247         (WebCore::ImageDecoderDirect2D::filenameExtension const):
3248         (WebCore::ImageDecoderDirect2D::isSizeAvailable const):
3249         (WebCore::ImageDecoderDirect2D::encodedDataStatus const):
3250         (WebCore::ImageDecoderDirect2D::size const):
3251         (WebCore::ImageDecoderDirect2D::frameCount const):
3252         (WebCore::ImageDecoderDirect2D::repetitionCount const):
3253         (WebCore::ImageDecoderDirect2D::hotSpot const):
3254         (WebCore::ImageDecoderDirect2D::frameSizeAtIndex const):
3255         (WebCore::ImageDecoderDirect2D::frameIsCompleteAtIndex const):
3256         (WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const):
3257         (WebCore::ImageDecoderDirect2D::frameDurationAtIndex const):
3258         (WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const):
3259         (WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const):
3260         (WebCore::ImageDecoderDirect2D::frameBytesAtIndex const):
3261         (WebCore::ImageDecoderDirect2D::setTargetContext):
3262         (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex const):
3263         (WebCore::ImageDecoderDirect2D::setData):
3264         * platform/graphics/win/ImageDecoderDirect2D.h:
3265         (WebCore::ImageDecoderDirect2D::create):
3266         (WebCore::ImageDecoder::create): Deleted.
3267         (WebCore::ImageDecoder::isAllDataReceived const): Deleted.
3268         (WebCore::ImageDecoder::clearFrameBufferCache): Deleted.
3269         * platform/image-decoders/ScalableImageDecoder.cpp: Renamed from Source/WebCore/platform/image-decoders/ImageDecoder.cpp.
3270         (WebCore::ScalableImageDecoder::create):
3271         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
3272         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
3273         (WebCore::ScalableImageDecoder::frameBytesAtIndex const):
3274         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
3275         (WebCore::ScalableImageDecoder::createFrameImageAtIndex):
3276         (WebCore::ScalableImageDecoder::prepareScaleDataIfNecessary):
3277         (WebCore::ScalableImageDecoder::upperBoundScaledX):
3278         (WebCore::ScalableImageDecoder::lowerBoundScaledX):
3279         (WebCore::ScalableImageDecoder::upperBoundScaledY):
3280         (WebCore::ScalableImageDecoder::lowerBoundScaledY):
3281         (WebCore::ScalableImageDecoder::scaledY):
3282         * platform/image-decoders/ScalableImageDecoder.h: Renamed from Source/WebCore/platform/image-decoders/ImageDecoder.h.
3283         (WebCore::ScalableImageDecoder::ScalableImageDecoder):
3284         (WebCore::ScalableImageDecoder::~ScalableImageDecoder):
3285         (WebCore::ScalableImageDecoder::premultiplyAlpha const):
3286         (WebCore::ScalableImageDecoder::isAllDataReceived const):
3287         (WebCore::ScalableImageDecoder::size const):
3288         (WebCore::ScalableImageDecoder::scaledSize):
3289         (WebCore::ScalableImageDecoder::setSize):
3290         (WebCore::ScalableImageDecoder::setIgnoreGammaAndColorProfile):
3291         (WebCore::ScalableImageDecoder::ignoresGammaAndColorProfile const):
3292         (WebCore::ScalableImageDecoder::rgbColorProfile):
3293         (WebCore::ScalableImageDecoder::subsamplingLevelForScale):
3294         (WebCore::ScalableImageDecoder::inputDeviceColorProfile):
3295         (WebCore::ScalableImageDecoder::setFailed):
3296         (WebCore::ScalableImageDecoder::failed const):
3297         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
3298         (WebCore::BMPImageDecoder::BMPImageDecoder):
3299         (WebCore::BMPImageDecoder::setData):
3300         (WebCore::BMPImageDecoder::setFailed):
3301         * platform/image-decoders/bmp/BMPImageDecoder.h:
3302         * platform/image-decoders/bmp/BMPImageReader.h:
3303         * platform/image-decoders/gif/GIFImageDecoder.cpp:
3304         (WebCore::GIFImageDecoder::GIFImageDecoder):
3305         (WebCore::GIFImageDecoder::setData):
3306         (WebCore::GIFImageDecoder::setSize):
3307         (WebCore::GIFImageDecoder::setFailed):
3308         * platform/image-decoders/gif/GIFImageDecoder.h:
3309         * platform/image-decoders/ico/ICOImageDecoder.cpp:
3310         (WebCore::ICOImageDecoder::ICOImageDecoder):
3311         (WebCore::ICOImageDecoder::setData):
3312         (WebCore::ICOImageDecoder::size):
3313         (WebCore::ICOImageDecoder::setSize):
3314         (WebCore::ICOImageDecoder::setFailed):
3315         * platform/image-decoders/ico/ICOImageDecoder.h:
3316         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
3317         (WebCore::JPEGImageDecoder::JPEGImageDecoder):
3318         (WebCore::JPEGImageDecoder::setSize):
3319         (WebCore::JPEGImageDecoder::setFailed):
3320         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
3321         * platform/image-decoders/png/PNGImageDecoder.cpp:
3322         (WebCore::PNGImageReader::decode):
3323         (WebCore::PNGImageDecoder::PNGImageDecoder):
3324         (WebCore::PNGImageDecoder::setSize):
3325         (WebCore::PNGImageDecoder::frameBufferAtIndex):
3326         (WebCore::PNGImageDecoder::setFailed):
3327         * platform/image-decoders/png/PNGImageDecoder.h:
3328         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
3329         (WebCore::WEBPImageDecoder::WEBPImageDecoder):
3330         (WebCore::WEBPImageDecoder::decode):
3331         * platform/image-decoders/webp/WEBPImageDecoder.h:
3332
3333 2017-09-18  Andy Estes  <aestes@apple.com>
3334
3335         [Mac] Upstream miscellaneous WebKitSystemInterface functions
3336         https://bugs.webkit.org/show_bug.cgi?id=177029
3337
3338         Reviewed by Alex Christensen.
3339
3340         * Configurations/WebCore.xcconfig: Used -force_load of libPAL instead of -ObjC. This forces
3341         the linker to load both Objective-C and C PAL symbols in WebCore. This change is needed for
3342         PAL::popUpMenu(), which is used by WebKit and WebKitLegacy but not WebCore.
3343         * platform/cocoa/LocalizedStringsCocoa.mm:
3344         (WebCore::contextMenuItemTagSearchWeb):
3345         * platform/cocoa/ScrollController.mm:
3346         (WebCore::elasticDeltaForTimeDelta):
3347         (WebCore::elasticDeltaForReboundDelta):
3348         (WebCore::reboundDeltaForElasticDelta):
3349         * platform/graphics/ca/GraphicsLayerCA.cpp:
3350         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
3351         * platform/mac/CursorMac.mm:
3352         (WebCore::WKCoreCursor_coreCursorType):
3353         (WebCore::createCoreCursorClass):
3354         (WebCore::coreCursorClass):
3355         (WebCore::cursor):
3356         (WebCore::Cursor::ensurePlatformCursor const):
3357         * platform/mac/WebCoreSystemInterface.h:
3358         * platform/mac/WebCoreSystemInterface.mm:
3359         * rendering/RenderThemeMac.mm:
3360         (WebCore::RenderThemeMac::paintTextArea):
3361
3362 2017-09-18  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
3363
3364         [Win][PAL] Move WebCoreHeaderDetection.h to PAL
3365         https://bugs.webkit.org/show_bug.cgi?id=176990
3366
3367         Reviewed by Alex Christensen.
3368
3369         * PlatformWin.cmake:
3370         Stop generating WebCoreHeaderDetection.h in WebCore.
3371
3372         * config.h:
3373         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3374         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
3375         Include PALHeaderDetection.h instead of WebCoreHeaderDetection.h
3376
3377 2017-09-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3378
3379         [Curl] Create classes dedicated to handle SSL related tasks
3380         and separate verifier and certificate management.
3381         https://bugs.webkit.org/show_bug.cgi?id=176910
3382
3383         Reviewed by Alex Christensen.
3384
3385         * platform/Curl.cmake:
3386         * platform/network/curl/CurlContext.cpp:
3387         (WebCore::CurlContext::CurlContext):
3388         (WebCore::CurlHandle::setCACertPath):
3389         (WebCore::certificatePath): Deleted.
3390         (WebCore::CurlHandle::enableCAInfoIfExists): Deleted.
3391         (WebCore::CurlHandle::setSslErrors): Deleted.
3392         (WebCore::CurlHandle::getSslErrors): Deleted.
3393         * platform/network/curl/CurlContext.h:
3394         (WebCore::CurlContext::sslHandle):
3395         (WebCore::CurlContext::getCertificatePath const): Deleted.
3396         (WebCore::CurlContext::shouldIgnoreSSLErrors const): Deleted.
3397         * platform/network/curl/CurlDownload.cpp:
3398         (WebCore::CurlDownload::setupRequest):
3399         * platform/network/curl/CurlSSLHandle.cpp: Added.
3400         (WebCore::CurlSSLHandle::CurlSSLHandle):
3401         (WebCore::CurlSSLHandle::getCACertPathEnv):
3402         (WebCore::CurlSSLHandle::setHostAllowsAnyHTTPSCertificate):
3403         (WebCore::CurlSSLHandle::isAllowedHTTPSCertificateHost):
3404         (WebCore::CurlSSLHandle::canIgnoredHTTPSCertificate):
3405         (WebCore::CurlSSLHandle::setClientCertificateInfo):
3406         (WebCore::CurlSSLHandle::getSSLClientCertificate):
3407         * platform/network/curl/CurlSSLHandle.h: Renamed from Source/WebCore/platform/network/curl/SSLHandle.h.
3408         (WebCore::CurlSSLHandle::shouldIgnoreSSLErrors const):
3409         (WebCore::CurlSSLHandle::getCACertP