RenderSVGRoot should check the renderers inside its visualOverflowRect for hit testin...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-10-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
2
3         RenderSVGRoot should check the renderers inside its visualOverflowRect for hit testing if the overflow is visible
4         https://bugs.webkit.org/show_bug.cgi?id=177953
5         <rdar://problem/34788389>
6
7         Reviewed by Simon Fraser.
8
9         Test: svg/hittest/svg-visual-overflow-rect.html
10
11         If an SVGElement is positioned outside the rectangle of the root element,
12         it can still be drawn if the root element has "overflow: visible" applied.
13         But since SVGElement can be drawn in this case, it should be accessible
14         through nodeAtPoint() which is used for hit testing.
15
16         * rendering/svg/RenderSVGRoot.cpp:
17         (WebCore::RenderSVGRoot::nodeAtPoint):
18
19 2017-10-05  Zalan Bujtas  <zalan@apple.com>
20
21         RenderButton should not hold raw pointers to its direct children.
22         https://bugs.webkit.org/show_bug.cgi?id=177960
23         <rdar://problem/34840807>
24
25         Reviewed by Antti Koivisto.
26
27         The correct way of destroying a renderer is to call ::removeFromParentAndDestroy().
28
29         Covered by existing tests.
30
31         * rendering/RenderButton.cpp:
32         (WebCore::RenderButton::RenderButton):
33         (WebCore::RenderButton::addChild):
34         (WebCore::RenderButton::takeChild):
35         (WebCore::RenderButton::updateAnonymousChildStyle const):
36         (WebCore::RenderButton::setText):
37         (WebCore::RenderButton::text const):
38         * rendering/RenderButton.h:
39
40 2017-10-05  David Kilzer  <ddkilzer@apple.com>
41
42         Bug 177893: Disable -Wcast-qual for new clang compiler in Apple ports
43         <https://webkit.org/b/177893>
44         <rdar://problem/33667497>
45
46         Reviewed by Tim Horton.
47
48         * Configurations/Base.xcconfig:
49         (WARNING_CFLAGS): Remvoe -Wcast-qual until we can provide a safe
50         cast function that lets us re-enable the warning.
51
52 2017-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
53
54         Implement font-display loading behaviors
55         https://bugs.webkit.org/show_bug.cgi?id=175384
56         <rdar://problem/33813243>
57
58         Reviewed by Darin Adler.
59
60         The font-display descriptors works off of the following model of font loading:
61
62         1. When a font loads, the @font-face enters the first phase, called the "block period." Here,
63         text using this @font-face is rendered as invisible using a fallback font for metrics. If the
64         file finishes loading during this period, it is swapped in (visibly).
65         2. When the first phase is over, the @font-face enters the second phase, called the "swap
66         period." Here, text using this @font-face is rendered visibly using a fallback font. If the
67         file finishes loading during this period, it is swapped in.
68         3. When the second phase is over, the @font-face enters the third phase, called the "failure
69         period." Here, text using this @font-face is rendered visibly using a fallback font. If the
70         file finishes loading during this period, it is not swapped in (but it does live in the
71         network cache for subsequent page loads). This phase lasts forever.
72
73         The font-display descriptor changes the duration of these phases. For example, our default
74         font loading behavior can be achieved by making the first phase 3 seconds long and making the
75         second phase infinitely long (so the third phase is never reached).
76
77         Luckily, our CSSFontFace class already has states which correspond to each phase listed above:
78         Loading, TimedOut, and Failure. This patch migrates our existing 3-second timer to have logic
79         to correctly set the timeout duration based on the value of the font-display descriptor and
80         the current status(). This occurs inside CSSFontFace::setStatus().
81
82         This has implications for testing. Previously, our tests for the font loading behavior had a
83         single boolean that describes whether or not font loads should immediately jump to the "swap
84         period". Clearly, this is insufficient for testing all aspects of the font-display descriptor.
85         Instead, this patch deletes this existing infrastructure and instead creates three more fake
86         values of font-display (achieved in tests by using window.internals). These fake values make
87         fonts immediately jump into a particular state and stay there forever (so the timeout values
88         are, for example, [0, infinity, infinity] to test the swap period). This works because
89         CSSFontFace is smart enough to synchronously move between states that have a 0 timeout, so
90         there is no race between these timers and font loads.
91
92         We also need to test the behavior when a file downloads and when a file hasn't been loaded
93         yet (and the @font-face is in a particular state). Therefore, this patch adds another bool
94         which indicates whether the font subsystem should totally ignore font load events. This means
95         that a font will successfully download (and DOMContentLoaded will be fired, because that
96         uses the loading subsystem), but the font subsystem will plug its ears and ignore the load.
97         This means we can test the invisibility of text during the "block period" because DRT will
98         see that the page load has completed, but the font subsystem will pretend like the font is
99         still loading and draw invisibly.
100
101         Therefore, there are 6 tests: a test to test each of the 3 states an @font-face block may be
102         in, times 2 for whether or not we are ignoring font loads. These are more comprehensive than
103         the existing font loading tests which used internals.settings.setWebFontsAlwaysFallBack(),
104         so I deleted those tests in favor of these new ones.
105
106         Tests: fast/text/loading-block-finish.html
107                fast/text/loading-block-nofinish.html
108                fast/text/loading-failure-finish.html
109                fast/text/loading-failure-nofinish.html
110                fast/text/loading-swap-finish.html
111                fast/text/loading-swap-nofinish.html
112
113         * css/CSSFontFace.cpp:
114         (WebCore::CSSFontFace::setLoadingBehavior):
115         (WebCore::CSSFontFace::fontLoadEventOccurred): Remove old testing infrastructure.
116         (WebCore::CSSFontFace::timeoutFired): Previously, the timer was only used for going
117         from Loading -> TimedOut. Now, we have to ask the status() to figure out which
118         state transition we should be performing.
119         (WebCore::CSSFontFace::allSourcesFailed const): A Failed state needs to return true
120         here, even if some of the sources successfully downloaded.
121         (WebCore::CSSFontFace::setStatus): The logic to figure out how long to set the timer
122         for. Also, if the timer value is 0, synchronously recurse to change the status instead
123         of setting a 0-delay timer.
124         (WebCore::CSSFontFace::fontLoaded): Remove old testing infrastructure.
125         (WebCore::CSSFontFace::fontTimeoutIndex const): Implement new testing infrastructure.
126         (WebCore::CSSFontFace::shouldIgnoreFontLoadCompletions const): Ditto.
127         (WebCore::CSSFontFace::pump): See comment. Also, we're allowed to be in the Failure
128         state in more scenarios now, so relax some of our ASSERT()s.
129         (WebCore::CSSFontFace::font): Ditto.
130         (WebCore::CSSFontFace::webFontsShouldAlwaysFallBack const): Deleted.
131         * css/CSSFontFace.h: Migrate to new testing infrastructure.
132         * css/CSSFontFaceSource.cpp:
133         (WebCore::CSSFontFaceSource::CSSFontFaceSource): Implement new testing infrastructure.
134         (WebCore::CSSFontFaceSource::shouldIgnoreFontLoadCompletions const): Ditto.
135         (WebCore::CSSFontFaceSource::fontLoaded): Ditto.
136         * css/CSSFontFaceSource.h:
137         * css/CSSFontSelector.cpp:
138         (WebCore::CSSFontSelector::beginLoadingFontSoon): Remove old testing infrastructure.
139         * css/CSSSegmentedFontFace.cpp: It's possible to get different values out of
140         CSSFontFace::font() in successive calls during the same runloop. FontRanges will 
141         include a raw pointer to one of the values, so all the values need to be kept alive.
142         * page/Settings.cpp: Migrate to new testing infrastructure.
143         (WebCore::Settings::Settings):
144         (WebCore::Settings::setFontTimeoutIndex):
145         (WebCore::Settings::setShouldIgnoreFontLoadCompletions):
146         (WebCore::Settings::setWebFontsAlwaysFallBack): Deleted.
147         * page/Settings.h: Ditto.
148         (WebCore::Settings::fontTimeoutIndex const):
149         (WebCore::Settings::shouldIgnoreFontLoadCompletions const):
150         (WebCore::Settings::webFontsAlwaysFallBack const): Deleted.
151         * testing/InternalSettings.cpp: Ditto.
152         (WebCore::InternalSettings::Backup::Backup):
153         (WebCore::InternalSettings::Backup::restoreTo):
154         (WebCore::InternalSettings::setFontTimeoutIndex):
155         (WebCore::InternalSettings::setShouldIgnoreFontLoadCompletions):
156         (WebCore::InternalSettings::setWebFontsAlwaysFallBack): Deleted.
157         * testing/InternalSettings.h: Ditto.
158         * testing/InternalSettings.idl: Ditto.
159
160 2017-10-05  Zalan Bujtas  <zalan@apple.com>
161
162         RenderMathMLFenced should not hold a raw pointer to RenderMathMLFencedOperator
163         https://bugs.webkit.org/show_bug.cgi?id=177950
164         <rdar://problem/34837002>
165
166         Reviewed by Antti Koivisto.
167
168         Even though RenderMathMLFencedOperator is a child renderer, it's lifetime is not explicitly managed by
169         RenderMathMLFenced.
170
171         Covered by existing test cases.
172
173         * rendering/mathml/RenderMathMLFenced.cpp:
174         (WebCore::RenderMathMLFenced::RenderMathMLFenced):
175         (WebCore::RenderMathMLFenced::makeFences):
176         (WebCore::RenderMathMLFenced::addChild):
177         * rendering/mathml/RenderMathMLFenced.h:
178
179 2017-10-05  Andy Estes  <aestes@apple.com>
180
181         [Payment Request] Add a payment method that supports Apple Pay
182         https://bugs.webkit.org/show_bug.cgi?id=177850
183
184         Reviewed by Youenn Fablet.
185
186         This patch implements a payment method dictionary and a payment handler for Apple Pay.
187
188         It reuses existing Apple Pay code by:
189         1. Moving shared properties from ApplePayPaymentRequest to ApplePayRequestBase and having
190            ApplePayPaymentRequest inherit from ApplePayRequestBase.
191         2. Creating an ApplePayRequest dictionary that inherits from ApplePayRequestBase and adds
192            PaymentRequest-specific properties (right now that's just the version property).
193         3. Moving validation logic from ApplePaySession into various places that can be reused by
194            PaymentRequest and ApplePayPaymentHandler.
195         4. Storing currency values for both ApplePaySession and PaymentRequest in Strings rather
196            than integers representing whole cents, since PaymentRequest supports high-precision
197            currency values.
198
199         This patch does not implement any event handling for merchant validation, payment method
200         changes, or shipping address/option changes. That will be handled in a follow-on.
201
202         Test: http/tests/ssl/applepay/PaymentRequest.html
203
204         * DerivedSources.make:
205         * Modules/applepay/ApplePayContactField.cpp: Added.
206         (WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
207         * Modules/applepay/ApplePayContactField.h: Added.
208         * Modules/applepay/ApplePayContactField.idl: Added.
209         * Modules/applepay/ApplePayMerchantCapability.cpp: Added.
210         (WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
211         * Modules/applepay/ApplePayMerchantCapability.h: Added.
212         * Modules/applepay/ApplePayMerchantCapability.idl: Added.
213         * Modules/applepay/ApplePayPaymentRequest.h: Moved fields shared with ApplePayRequest into ApplePayRequestBase.
214         * Modules/applepay/ApplePayPaymentRequest.idl: Ditto.
215         * Modules/applepay/ApplePayRequestBase.cpp: Added.
216         (WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
217         * Modules/applepay/ApplePayRequestBase.h: Added.
218         * Modules/applepay/ApplePayRequestBase.idl: Added.
219         * Modules/applepay/ApplePaySession.cpp:
220         (WebCore::validateAmount): Renamed from parseAmount.
221         (WebCore::convertAndValidateTotal):
222         (WebCore::convertAndValidate):
223         (WebCore::parseDigit): Deleted.
224         (WebCore::parseAmount): Renamed to validateAmount.
225         * Modules/applepay/ApplePaySessionPaymentRequest.h: Changed amount from an int64_t to a String.
226         * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
227         (WebCore::convert):
228         * Modules/applepay/PaymentRequestValidator.mm: Renamed from Source/WebCore/Modules/applepay/PaymentRequestValidator.cpp.
229         (WebCore::PaymentRequestValidator::validateTotal): Used NSDecimalNumber to validate amounts.
230         (WebCore::validateShippingMethod): Ditto.
231         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: Added.
232         (WebCore::ApplePayPaymentHandler::handlesIdentifier): Added. Returns true if identifier is a URL with host "apple.com" and path "/apple-pay".
233         (WebCore::ApplePayPaymentHandler::ApplePayPaymentHandler):
234         (WebCore::convert): Added. Converts PaymentRequest types to ApplePaySessionPaymentRequest types.
235         (WebCore::ApplePayPaymentHandler::convertData): Added. JSON-parses data into an ApplePayRequest,
236         then uses that along with the PaymentRequest to construct and validate an ApplePaySessionPaymentRequest.
237         (WebCore::ApplePayPaymentHandler::show): Added a FIXME.
238         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: Added.
239         * Modules/applepay/paymentrequest/ApplePayRequest.h: Added.
240         * Modules/applepay/paymentrequest/ApplePayRequest.idl: Added. Inherits from ApplePayRequestBase and adds a required version property.
241         * Modules/paymentrequest/PaymentHandler.cpp: Added.
242         (WebCore::PaymentHandler::create): Returns a PaymentHandler subclass based on the payment method identifier.
243         (WebCore::PaymentHandler::~PaymentHandler):
244         * Modules/paymentrequest/PaymentHandler.h: Added.
245         * Modules/paymentrequest/PaymentRequest.cpp:
246         (WebCore::convertAndValidatePaymentMethodIdentifier): Added.
247         (WebCore::PaymentRequest::show): Removed an unnecessary call to RunLoop::dispatch().
248         Created a PaymentHandler for each payment method and called show() on the first available PaymentHandler.
249         (WebCore::PaymentRequest::abort): Removed an unnecessary call to RunLoop::dispatch().
250         (WebCore::PaymentRequest::canMakePayment): Ditto.
251         (WebCore::PaymentRequest::finishShowing): Deleted.
252         * Modules/paymentrequest/PaymentRequest.h:
253         * WebCore.xcodeproj/project.pbxproj:
254
255 2017-10-05  Antti Koivisto  <antti@apple.com>
256
257         Move more multicolumn render tree mutation code to RenderTreeUpdater::MultiColumn
258         https://bugs.webkit.org/show_bug.cgi?id=177942
259
260         Reviewed by Zalan Bujtas.
261
262         * rendering/RenderMultiColumnFlow.cpp:
263         (WebCore::RenderMultiColumnFlow::RenderMultiColumnFlow):
264
265             Use std::unique_ptr for the spanner map for safe owenership transfer.
266
267         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
268         (WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
269         (WebCore::RenderMultiColumnFlow::fragmentedFlowRelativeWillBeRemoved):
270         (WebCore::RenderMultiColumnFlow::populate): Deleted.
271         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy): Deleted.
272
273             This code moves to RenderTreeUpdater::MultiColumn.
274
275         * rendering/RenderMultiColumnFlow.h:
276         * style/RenderTreeUpdaterMultiColumn.cpp:
277         (WebCore::RenderTreeUpdater::MultiColumn::update):
278         (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
279         (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):
280
281             Use Hyatt's preferred 'fragmented flow' terminology.
282
283         * style/RenderTreeUpdaterMultiColumn.h:
284
285 2017-10-05  Darin Adler  <darin@apple.com>
286
287         Remove additional WebKitSystemInterface remnants
288         https://bugs.webkit.org/show_bug.cgi?id=177948
289
290         Reviewed by Andy Estes.
291
292         * PlatformMac.cmake: Remove logic to select and link an appropriate
293         WebKitSystemInterface library.
294
295         * html/shadow/MediaControlElementTypes.h: Remove comment about matching
296         WebKitSystemInterface.h, now obsolete.
297
298         * rendering/RenderMediaControls.cpp: Wrap whole file in a single conditional
299         to make it clear that it's only used at all in this one particular case.
300         (wkHitTestMediaUIPart): Deleted.
301         (wkMeasureMediaUIPart): Deleted.
302         (wkDrawMediaUIPart): Deleted.
303         (wkDrawMediaSliderTrack): Deleted.
304         (WebCore::determineState): Deleted.
305         (WebCore::getUnzoomedRectAndAdjustCurrentContext): Deleted.
306         (WebCore::RenderMediaControls::adjustMediaSliderThumbSize): Call the
307         WKMeasureMediaUIPart instead of through an inline function to rename it.
308         (WebCore::RenderMediaControls::paintMediaControlsPart): Deleted.
309
310         * rendering/RenderMediaControls.h: Wrap whole file in a single conditional
311         to make it clear that it's only used at all in this one particular case.
312         Removed unneeded includes, forward declarations, and function declaration.
313
314         * rendering/RenderThemeMac.mm: Removed include of RenderMediaControls.h.
315
316 2017-10-05  Zalan Bujtas  <zalan@apple.com>
317
318         Remove redundant LayoutStateDisabler from RenderTreeUpdaterFirstLetter
319         https://bugs.webkit.org/show_bug.cgi?id=177946
320
321         Reviewed by Simon Fraser.
322
323         First letter is updated prior to layout.
324
325         Covered by existing tests.
326
327         * style/RenderTreeUpdaterFirstLetter.cpp:
328         (WebCore::updateFirstLetterStyle):
329
330 2017-10-05  Andy Estes  <aestes@apple.com>
331
332         [Payment Request] Factor out ApplePaySession's interface to PaymentCoordinator into a base class
333         https://bugs.webkit.org/show_bug.cgi?id=177904
334
335         Reviewed by Daniel Bates.
336
337         In a follow-on patch, something other than ApplePaySession will need to be the
338         PaymentCoordinator's active session during PaymentRequest sessions.
339
340         To support this, this patch factors out the ApplePaySession functions called by
341         PaymentCoordinator into a new base class called PaymentSession.
342
343         * Modules/applepay/ApplePaySession.h:
344         * Modules/applepay/PaymentCoordinator.cpp:
345         (WebCore::PaymentCoordinator::beginPaymentSession):
346         * Modules/applepay/PaymentCoordinator.h:
347         * Modules/applepay/PaymentSession.h: Added.
348         (WebCore::PaymentSession::~PaymentSession):
349         * WebCore.xcodeproj/project.pbxproj:
350
351 2017-10-05  Zalan Bujtas  <zalan@apple.com>
352
353         Move multicolumn flow clear to RenderTreeUpdater
354         https://bugs.webkit.org/show_bug.cgi?id=177898
355         <rdar://problem/34820157>
356
357         Reviewed by Antti Koivisto.
358
359         There are 2 cases when we need to clear the the multicolumn flow from its container.
360
361         1. When the column renderer is not need anymore due to style change (evacuateAndDestroy).
362         During the subtree reparenting (moving back the descendants to the original position),
363         if we still had the multicolumn set on the RenderBlockFlow, RenderBlockFlow::addChild() would
364         put the children back under the column. -> Move the clear call to the RenderTreeUpdater.
365          
366         2. When the column is detached from the tree/destroyed (willBeRemoveFromTree).
367         Since it does not trigger reparenting, we don't need to clear the column immediately. 
368         We call clear to avoid accessing state column renderer. -> Use WeakPtr to
369         manage lifetime instead.
370
371         Covered by existing tests.
372
373         * rendering/RenderBlockFlow.cpp:
374         (WebCore::RenderBlockFlow::setMultiColumnFlow):
375         (WebCore::RenderBlockFlow::clearMultiColumnFlow):
376         * rendering/RenderBlockFlow.h:
377         * rendering/RenderMultiColumnFlow.cpp:
378         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
379         (WebCore::RenderMultiColumnFlow::willBeRemovedFromTree):
380         * style/RenderTreeUpdaterMultiColumn.cpp:
381         (WebCore::RenderTreeUpdater::MultiColumn::update):
382         (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
383
384 2017-10-05  Miguel Gomez  <magomez@igalia.com>
385
386         [GTK][WPE] GIFImageDecoder never clears decoded frames even when told to do so
387         https://bugs.webkit.org/show_bug.cgi?id=177864
388
389         Reviewed by Carlos Garcia Campos.
390
391         Fix GIFImageDecoder::clearFrameBufferCache() so it really deletes decoded buffers, and modify
392         GIFImageDecoder to be able to decode frames that are not requested in the expected order.
393
394         Covered by existent tests.
395
396         * platform/image-decoders/gif/GIFImageDecoder.cpp:
397         (WebCore::GIFImageDecoder::findFirstRequiredFrameToDecode):
398         (WebCore::GIFImageDecoder::frameBufferAtIndex):
399         (WebCore::GIFImageDecoder::clearFrameBufferCache):
400         * platform/image-decoders/gif/GIFImageDecoder.h:
401         * platform/image-decoders/gif/GIFImageReader.cpp:
402         (GIFImageReader::decode):
403         * platform/image-decoders/gif/GIFImageReader.h:
404         (GIFImageReader::frameContext const):
405
406 2017-10-05  Fujii Hironori  <Hironori.Fujii@sony.com>
407
408         [WinCairo] Fix build after Bug 167956
409         https://bugs.webkit.org/show_bug.cgi?id=177921
410
411         Reviewed by Carlos Garcia Campos.
412
413         FontCascade::fontForCombiningCharacterSequence wasn't defined for
414         WinCairo port. It should be defined if !USE(HARFBUZZ).
415
416         No new tests because there is no behavior change.
417
418         * platform/graphics/FontCascade.cpp: Use !USE(HARFBUZZ) instead of !USE(CAIRO).
419
420 2017-10-05  Zan Dobersek  <zdobersek@igalia.com>
421
422         Align BitmapImage::LargeAnimationCutoff to a megabyte value
423         https://bugs.webkit.org/show_bug.cgi?id=177924
424
425         Reviewed by Carlos Garcia Campos.
426
427         * platform/graphics/BitmapImage.h: Fix the 1014 multiplier used to calculate
428         the LargeAnimationCutoff value. It was most likely a typo.
429
430 2017-10-05  Wenson Hsieh  <wenson_hsieh@apple.com>
431
432         Address post-review feedback following r222885
433         https://bugs.webkit.org/show_bug.cgi?id=177853
434         <rdar://problem/34807346>
435
436         Reviewed by Ryosuke Niwa and Dan Bates.
437
438         * dom/DataTransfer.cpp:
439         (WebCore::DataTransfer::updateFileList):
440         (WebCore::DataTransfer::types const):
441         (WebCore::DataTransfer::filesFromPasteboardAndItemList const):
442         * dom/DataTransferItem.h:
443         (WebCore::DataTransferItem::file):
444         (WebCore::DataTransferItem::file const): Deleted.
445         * dom/DataTransferItemList.cpp:
446         (WebCore::DataTransferItemList::add):
447         (WebCore::DataTransferItemList::remove):
448
449         When removing a data transfer item, capture it in a Ref for the scope of remove(), so that it won't be destroyed
450         immediately after removing from the item list.
451
452 2017-10-05  Youenn Fablet  <youenn@apple.com>
453
454         Make LibWebRTCProvider port agnostic
455         https://bugs.webkit.org/show_bug.cgi?id=177747
456
457         Reviewed by Alex Christensen & Alex Garcia.
458
459         No change of behavior.
460
461         LibWebRTCProvider had some Mac/iOS specific members that are now
462         moved to LibWebRTCProviderCocoa.
463         This consists in the codec factories that are VideoToolBox specific.
464         Introducing LibWebRTCProvider::create to allow different port implementations of LibWebRTCProvider.
465
466         * WebCore.xcodeproj/project.pbxproj:
467         * inspector/InspectorOverlay.cpp:
468         (WebCore::InspectorOverlay::overlayPage):
469         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
470         (WebCore::LibWebRTCProvider::create):
471         (WebCore::LibWebRTCProvider::factory):
472         (WebCore::LibWebRTCProvider::createPeerConnectionFactory):
473         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
474         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
475         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
476         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
477         (WebCore::LibWebRTCProviderCocoa::setActive):
478         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
479         * svg/graphics/SVGImage.cpp:
480         (WebCore::SVGImage::dataChanged):
481
482 2017-10-04  Alex Christensen  <achristensen@webkit.org>
483
484         Remove WebCoreSystemInterface
485         https://bugs.webkit.org/show_bug.cgi?id=177916
486
487         Reviewed by Antti Koivisto.
488
489         * Configurations/WebCore.xcconfig:
490         * PlatformMac.cmake:
491         * WebCore.xcodeproj/project.pbxproj:
492         * accessibility/mac/AXObjectCacheMac.mm:
493         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
494         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
495         * dom/Document.cpp:
496         * editing/mac/DictionaryLookup.mm:
497         * page/ios/FrameIOS.mm:
498         * page/ios/UserAgentIOS.mm:
499         * page/mac/EventHandlerMac.mm:
500         * platform/cocoa/LocalizedStringsCocoa.mm:
501         * platform/cocoa/ScrollController.mm:
502         * platform/graphics/Font.h:
503         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
504         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
505         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
506         * platform/graphics/ca/GraphicsLayerCA.cpp:
507         * platform/graphics/cg/GraphicsContextCG.cpp:
508         * platform/graphics/cg/ImageBufferCG.cpp:
509         * platform/graphics/cg/PathCG.cpp:
510         * platform/graphics/cg/PatternCG.cpp:
511         * platform/graphics/cocoa/FontCascadeCocoa.mm:
512         * platform/graphics/cocoa/FontCocoa.mm:
513         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
514         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
515         * platform/graphics/mac/FontCacheMac.mm:
516         * platform/graphics/mac/GlyphPageMac.cpp:
517         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
518         * platform/ios/LegacyTileCache.mm:
519         * platform/ios/PlatformScreenIOS.mm:
520         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
521         * platform/ios/WebCoreSystemInterfaceIOS.mm: Removed.
522         * platform/ios/wak/WAKWindow.mm:
523         * platform/mac/CursorMac.mm:
524         * platform/mac/FileSystemMac.mm:
525         * platform/mac/PlatformEventFactoryMac.mm:
526         * platform/mac/PlatformSpeechSynthesizerMac.mm:
527         * platform/mac/ScrollAnimatorMac.mm:
528         * platform/mac/ScrollbarThemeMac.mm:
529         * platform/mac/ThemeMac.mm:
530         * platform/mac/WebCoreNSURLExtras.mm:
531         * platform/mac/WebCoreSystemInterface.h: Removed.
532         * platform/mac/WebCoreSystemInterface.mm: Removed.
533         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
534         * platform/mac/WebWindowAnimation.mm:
535         * platform/network/cf/CookieStorageCFNet.cpp:
536         * platform/network/cf/CredentialStorageCFNet.cpp:
537         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
538         * platform/network/cf/ResourceHandleCFNet.cpp:
539         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
540         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
541         * platform/network/cf/ResourceRequestCFNet.cpp:
542         * platform/network/cf/ResourceResponseCFNet.cpp:
543         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
544         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
545         * platform/network/cocoa/ResourceRequestCocoa.mm:
546         * platform/network/ios/WebCoreURLResponseIOS.mm:
547         * platform/network/mac/CookieJarMac.mm:
548         * platform/network/mac/ResourceHandleMac.mm:
549         * platform/network/mac/WebCoreURLResponse.mm:
550         * platform/text/TextEncodingRegistry.cpp:
551         * rendering/RenderThemeMac.mm:
552
553 2017-10-04  Alex Christensen  <achristensen@webkit.org>
554
555         Remove unnecessary includes of WebKitSystemInterface on Cocoa platforms
556         https://bugs.webkit.org/show_bug.cgi?id=177912
557
558         Reviewed by Saam Barati.
559
560         * WebCore.xcodeproj/project.pbxproj:
561         Also stop compiling RenderMediaControls.cpp on Cocoa platforms.  It's not used.
562
563 2017-09-30  Yusuke Suzuki  <utatane.tea@gmail.com>
564
565         [JSC] Introduce import.meta
566         https://bugs.webkit.org/show_bug.cgi?id=177703
567
568         Reviewed by Filip Pizlo.
569
570         * bindings/js/JSDOMWindowBase.cpp:
571         * bindings/js/JSWorkerGlobalScopeBase.cpp:
572
573 2017-10-04  Tim Horton  <timothy_horton@apple.com>
574
575         Link WebCore against CFNetwork in the CMake build
576         https://bugs.webkit.org/show_bug.cgi?id=177910
577
578         Reviewed by Ryosuke Niwa.
579
580         * PlatformMac.cmake:
581         This is enough to get WebKit1 MiniBrowser running; otherwise, we
582         crash trying to access the public suffix list.
583
584 2017-10-04  Daniel Bates  <dabates@apple.com>
585
586         Have TextDecorationPainter hold an OptionSet of decorations
587         https://bugs.webkit.org/show_bug.cgi?id=177889
588
589         Reviewed by Simon Fraser.
590
591         Currently TextDecorationPainter implicitly maintains the set of one or more TextDecoration
592         flags in a instance variable bitmask of type TextDecoration. Instead we should represent
593         this set explicitly as an OptionSet to improve readability of the code.
594
595         For now we have the TextDecorationPainter constructor and TextDecorationPainter::stylesForRenderer()
596         to take the set of decorations as an unsigned value to avoid the need to update callers.
597         We will look to apply a similar change throughout the code in <https://bugs.webkit.org/show_bug.cgi?id=176844>.
598
599         No functionality changed. So, no new tests.
600
601         * rendering/TextDecorationPainter.cpp:
602         (WebCore::TextDecorationPainter::TextDecorationPainter): For now, changed data type for passed
603         decorations from TextDecoration to unsigned to convey that it is a bitmask.
604         (WebCore::TextDecorationPainter::paintTextDecoration): Renamed linesAreOpaque to areLinesOpaque
605         while I am here. Fixed some minor style issues.
606         (WebCore::collectStylesForRenderer): Modified to take the remaining decorations as an OptionSet,
607         and removed an unnecessary copy of these decorations by taking advantage of the fact that they
608         are passed by value.
609         (WebCore::TextDecorationPainter::stylesForRenderer): Convert the passed decorations to an OptionSet as needed to
610         pass to collectStylesForRenderer().
611         * rendering/TextDecorationPainter.h: Change m_decoration from TextDecoration to OptionSet<TextDecoration>
612         and rename it to m_decorations to reflect that it is used as a set of one or more TextDecoration flags.
613         Also remove unnecessary initializer for m_isPrinting while I am here and group it with the other boolean,
614         m_isHorizontal. There is exactly one constructor for this class and it initializes m_isPrinting.
615
616 2017-10-04  Matt Baker  <mattbaker@apple.com>
617
618         Web Inspector: Improve CanvasManager recording events
619         https://bugs.webkit.org/show_bug.cgi?id=177762
620
621         Reviewed by Devin Rousso.
622
623         Dispatch Canvas.recordingFinished regardless of whether any actions were
624         recorded. Without this extra guarantee, the frontend has to keep track
625         of additional state to determine whether a recording is in progress.
626
627         * inspector/InspectorCanvasAgent.cpp:
628         (WebCore::InspectorCanvasAgent::startRecording):
629         (WebCore::InspectorCanvasAgent::stopRecording):
630         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
631         (WebCore::InspectorCanvasAgent::requestRecording): Deleted.
632         (WebCore::InspectorCanvasAgent::cancelRecording): Deleted.
633         * inspector/InspectorCanvasAgent.h:
634
635 2017-10-04  Nan Wang  <n_wang@apple.com>
636
637         AX: Make video objects accessible on iOS
638         https://bugs.webkit.org/show_bug.cgi?id=177788
639         <rdar://problem/34778028>
640
641         Reviewed by Chris Fleizach.
642
643         Exposed certain <video> elements on iOS:
644         1. If they have no controls attribute set and have playsinline attribute set, that means
645            normally there are custom controls provided. 
646         2. Without autoplay attribute set. From iOS 10, with the motivation to improve performace by 
647            replacing GIF with <video>, elements will now honor the autoplay attribute if they
648            have no audio. So normally those <video> elements are not interactive.
649
650         Also provided functions to let iOS users interact with the video elements:
651         - Play/Pause: accessibilityActivate
652         - Fast forward: accessibilityIncrement
653         - Rewind: accessibilityDecrement
654
655         Test: accessibility/ios-simulator/video-elements-ios.html
656
657         * WebCore.xcodeproj/project.pbxproj:
658         * accessibility/AXObjectCache.cpp:
659         (WebCore::createFromRenderer):
660         * accessibility/AccessibilityMediaObject.cpp: Added.
661         (WebCore::AccessibilityMediaObject::AccessibilityMediaObject):
662         (WebCore::AccessibilityMediaObject::~AccessibilityMediaObject):
663         (WebCore::AccessibilityMediaObject::create):
664         (WebCore::AccessibilityMediaObject::computeAccessibilityIsIgnored const):
665         (WebCore::AccessibilityMediaObject::mediaElement const):
666         (WebCore::AccessibilityMediaObject::stringValue const):
667         (WebCore::AccessibilityMediaObject::interactiveVideoDuration const):
668         (WebCore::AccessibilityMediaObject::mediaSeek):
669         (WebCore::AccessibilityMediaObject::toggleMute):
670         (WebCore::AccessibilityMediaObject::increment):
671         (WebCore::AccessibilityMediaObject::decrement):
672         (WebCore::AccessibilityMediaObject::press):
673         (WebCore::AccessibilityMediaObject::hasControlsAttributeSet const):
674         (WebCore::AccessibilityMediaObject::isPlaying const):
675         (WebCore::AccessibilityMediaObject::isMuted const):
676         (WebCore::AccessibilityMediaObject::isAutoplayEnabled const):
677         (WebCore::AccessibilityMediaObject::isPlayingInline const):
678         (WebCore::AccessibilityMediaObject::enterFullscreen const):
679         * accessibility/AccessibilityMediaObject.h: Added.
680         * accessibility/AccessibilityObject.cpp:
681         * accessibility/AccessibilityObject.h:
682         (WebCore::AccessibilityObject::isMediaObject const):
683         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
684         (-[WebAccessibilityObjectWrapper accessibilityIsWebInteractiveVideo]):
685         (-[WebAccessibilityObjectWrapper interactiveVideoDescription]):
686         (-[WebAccessibilityObjectWrapper accessibilityIsMediaPlaying]):
687         (-[WebAccessibilityObjectWrapper accessibilityIsMediaMuted]):
688         (-[WebAccessibilityObjectWrapper accessibilityToggleMuteForMedia]):
689         (-[WebAccessibilityObjectWrapper accessibilityVideoEnterFullscreen]):
690         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
691         (-[WebAccessibilityObjectWrapper stringValueShouldBeUsedInLabel]):
692         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
693
694 2017-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
695
696         Add basic support for the version of DataTransferItemList.add that takes a File
697         https://bugs.webkit.org/show_bug.cgi?id=177853
698         <rdar://problem/34807346>
699
700         Reviewed by Ryosuke Niwa.
701
702         Adds very basic support for DataTransferItemList.add(File). So far, a File added in this way can only be read
703         back from the same DataTransfer, during dragstart or copy. This File isn't written to the platform pasteboard
704         yet, so even dropping or pasting in the same page will not transfer the File, but this brings us closer to
705         parity with other browsers. See per-method comments for details.
706
707         Tests: editing/pasteboard/data-transfer-item-list-add-file-multiple-times.html
708                editing/pasteboard/data-transfer-item-list-add-file-on-copy.html
709                editing/pasteboard/data-transfer-item-list-add-file-on-drag.html
710
711         * dom/DataTransfer.cpp:
712         (WebCore::DataTransfer::updateFileList):
713
714         Recompute the DataTransfer's FileList. This behaves the same way as destroying the FileList altogether and
715         building it from scratch, but we avoid that approach because the FileList object needs to maintain the same DOM
716         wrapper after a File-backed item is removed.
717
718         (WebCore::DataTransfer::itemListDidAddFile):
719
720         Add the newly appended DataTransferItem's File to the DataTransfer's FileList.
721
722         (WebCore::DataTransfer::types const):
723
724         Return only the "Files" type if there are file-backed items in the DataTransfer's item list.
725
726         (WebCore::DataTransfer::updatedFilesForFileList const):
727         (WebCore::DataTransfer::files const):
728         * dom/DataTransfer.h:
729         * dom/DataTransferItem.h:
730         (WebCore::DataTransferItem::file const):
731         * dom/DataTransferItemList.cpp:
732         (WebCore::DataTransferItemList::add):
733         (WebCore::DataTransferItemList::remove):
734         (WebCore::DataTransferItemList::clear):
735
736         When removing a File, only clear from the DataTransfer's pasteboard if the removed item is not a File (otherwise,
737         clearing a File that shares the same type as some other item in the pasteboard will erroneously clear that other
738         item as well). Additionally, call out to the DataTransfer to update the FileList.
739
740         * dom/DataTransferItemList.h:
741         (WebCore::DataTransferItemList::hasItems const):
742         (WebCore::DataTransferItemList::items const):
743
744         Add helpers for directly accessing an item list's items. items() should be used in conjunction with hasItems().
745         This route is taken to (1) avoid having to copy the vector of Files, and (2) to avoid generating m_items if it
746         doesn't already exist.
747
748 2017-10-04  Zalan Bujtas  <zalan@apple.com>
749
750         RenderMultiColumnFlow populate/evacuate should not disable layout state.
751         https://bugs.webkit.org/show_bug.cgi?id=177894
752         <rdar://problem/34818696>
753
754         Reviewed by Antti Koivisto.
755
756         Populate/evacuate methods are not called at layout time.
757
758         Covered by existing tests.
759
760         * rendering/RenderMultiColumnFlow.cpp:
761         (WebCore::RenderMultiColumnFlow::populate):
762         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
763
764 2017-10-04  Zalan Bujtas  <zalan@apple.com>
765
766         RenderMultiColumnFlow::m_beingEvacuated is redundant.
767         https://bugs.webkit.org/show_bug.cgi?id=177886
768         <rdar://problem/34815997>
769
770         Reviewed by Simon Fraser.
771
772         m_beingEvacuated was introduced to protect RenderMultiColumnFlow from triggering
773         remove/insert code while the column is being destroyed and the descendants are getting reparented.
774         However, 
775         1. the setMultiColumnFlow(nullptr) call already protects from triggering the remove callback
776         2. When adding the children back to their original position, we should not be able to find
777         this column as the enclosing block anymore (simply because we are moving the children as siblings
778         to the multicol renderer) 
779
780         Covered by existing tests.
781
782         * rendering/RenderMultiColumnFlow.cpp:
783         (WebCore::RenderMultiColumnFlow::RenderMultiColumnFlow):
784         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
785         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
786         (WebCore::RenderMultiColumnFlow::fragmentedFlowRelativeWillBeRemoved):
787         * rendering/RenderMultiColumnFlow.h:
788
789 2017-10-04  Antti Koivisto  <antti@apple.com>
790
791         Fix typo.
792
793         Unreviewed.
794
795         * rendering/RenderView.cpp:
796         (WebCore::RenderView::willBeDestroyed):
797
798 2017-10-04  Daniel Bates  <dabates@apple.com>
799
800         Teach TextDecorationPainter about pseudo styles
801         https://bugs.webkit.org/show_bug.cgi?id=177882
802
803         Reviewed by Simon Fraser.
804
805         As a step towards implementing support for CSS pseudo elements ::spelling-error and ::grammar-error
806         (https://bugs.webkit.org/show_bug.cgi?id=175784) teach TextDecorationPainter about pseudo styles.
807
808         * rendering/TextDecorationPainter.cpp:
809         (WebCore::TextDecorationPainter::TextDecorationPainter): Modified to take an optional
810         pseudo style (defaults to NOPSEUDO - no pseudo style).
811         (WebCore::collectStylesForRenderer): Modified to take a pseudo style. Note that getCachedPseudoStyle()
812         is only defined on RenderText and RenderElement objects (i.e. it is not a virtual function on RenderObject).
813         So, we must explicitly type check the renderer and cast appropriately before calling it. We may want
814         to consider making it virtual in the future if we find there are more call sites that would benefit
815         from polymorphism.
816         (WebCore::TextDecorationPainter::stylesForRenderer): Modified to take an optional
817         pseudo style (defaults to NOPSEUDO - no pseudo style).
818         * rendering/TextDecorationPainter.h:
819
820 2017-10-04  Antti Koivisto  <antti@apple.com>
821
822         Add assert verifying all renderers get destroyed
823         https://bugs.webkit.org/show_bug.cgi?id=177870
824
825         Reviewed by Zalan Bujtas.
826
827         * rendering/RenderView.cpp:
828         (WebCore::RenderView::willBeDestroyed):
829
830             Add assert to verify all renderers for this tree have been destroyed before the RenderView is.
831
832         * rendering/RenderView.h:
833
834 2017-10-04  Daniel Bates  <dabates@apple.com>
835
836         TextDecorationPainter::m_wavyOffset should be a float
837         https://bugs.webkit.org/show_bug.cgi?id=177883
838
839         Reviewed by Simon Fraser.
840
841         In r194447 we extracted the text decoration painting code from InlineTextBox into
842         TextDecorationPainter and changed the data type of the wavy offset from float to int.
843         We use floating point numbers throughout the painting code and should store the wavy
844         offset as a float.
845
846         * rendering/TextDecorationPainter.cpp:
847         (WebCore::TextDecorationPainter::TextDecorationPainter): Use C++ uniform initializer
848         syntax to initialize member fields.
849         (WebCore::TextDecorationPainter::paintTextDecoration): Change int to float.
850         * rendering/TextDecorationPainter.h: Remove unnecessary equal initializer for m_wavyOffset
851         as this class has exactly one constructor and it always initializes it.
852
853 2017-10-04  Youenn Fablet  <youenn@apple.com>
854
855         Remove OpenWebRTC backend
856         https://bugs.webkit.org/show_bug.cgi?id=177868
857
858         Reviewed by Alejandro G. Castro.
859
860         * CMakeLists.txt:
861         * DerivedSources.make:
862         * Modules/mediastream/MediaEndpointPeerConnection.cpp: Removed.
863         * Modules/mediastream/MediaEndpointPeerConnection.h: Removed.
864         * Modules/mediastream/MediaEndpointSessionDescription.cpp: Removed.
865         * Modules/mediastream/MediaEndpointSessionDescription.h: Removed.
866         * Modules/mediastream/SDPProcessor.cpp: Removed.
867         * Modules/mediastream/SDPProcessor.h: Removed.
868         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
869         * WebCore.xcodeproj/project.pbxproj:
870         * platform/GStreamer.cmake:
871         * platform/graphics/MediaPlayer.cpp:
872         (WebCore::buildMediaEnginesVector):
873         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
874         (WebCore::MediaPlayerPrivateGStreamer::supportsType):
875         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp: Removed.
876         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h: Removed.
877         * platform/mediastream/MediaEndpoint.cpp: Removed.
878         * platform/mediastream/MediaEndpoint.h: Removed.
879         * platform/mediastream/MediaEndpointSessionConfiguration.h: Removed.
880         * platform/mediastream/SDPProcessorScriptResource.cpp: Removed.
881         * platform/mediastream/SDPProcessorScriptResource.h: Removed.
882         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Removed.
883         * platform/mediastream/openwebrtc/MediaEndpointOwr.h: Removed.
884         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Removed.
885         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Removed.
886         * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Removed.
887         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Removed.
888         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Removed.
889         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Removed.
890         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Removed.
891         * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Removed.
892         * platform/mock/MockMediaEndpoint.cpp: Removed.
893         * platform/mock/MockMediaEndpoint.h: Removed.
894         * platform/mock/MockRealtimeMediaSource.cpp:
895         (WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
896         * platform/mock/MockRealtimeMediaSource.h:
897         * testing/Internals.cpp:
898         (WebCore::Internals::Internals):
899         (WebCore::Internals::enableMockMediaEndpoint): Deleted.
900         * testing/Internals.h:
901
902 2017-10-04  Zalan Bujtas  <zalan@apple.com>
903
904         Remove RenderTreeInternalMutationScope
905         https://bugs.webkit.org/show_bug.cgi?id=177875
906         <rdar://problem/34813088>
907
908         Reviewed by Antti Koivisto.
909
910         RenderTree mutation is in the past now. -and we've got assertions in place.
911
912         Not testable.
913
914         * page/FrameView.cpp:
915         (WebCore::FrameView::layout):
916         * rendering/RenderMultiColumnFlow.cpp:
917         (WebCore::RenderMultiColumnFlow::populate):
918         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
919         * rendering/RenderQuote.cpp:
920         (WebCore::RenderQuote::updateTextRenderer):
921         (WebCore::RenderQuote::updateRenderer):
922         * rendering/RenderView.h:
923         (WebCore::RenderTreeInternalMutationScope::RenderTreeInternalMutationScope): Deleted.
924         (WebCore::RenderTreeInternalMutationScope::~RenderTreeInternalMutationScope): Deleted.
925
926 2017-10-04  Miguel Gomez  <magomez@igalia.com>
927
928         Unreviewed: fix GTK debug build after r222841.
929
930         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
931         (WebCore::WEBPImageDecoder::initFrameBuffer):
932
933 2017-10-04  Zalan Bujtas  <zalan@apple.com>
934
935         RenderFragmentContainerRange should not hold raw pointers.
936         https://bugs.webkit.org/show_bug.cgi?id=177854
937         <rdar://problem/34805954>
938
939         Reviewed by Antti Koivisto.
940
941         m_startFragment and m_endFragment object's lifetimes are not tied to the lifetime of
942         RenderFragmentContainerRange.
943
944         Covered by existing tests.
945
946         * rendering/RenderFragmentedFlow.cpp:
947         (WebCore::RenderFragmentedFlow::setFragmentRangeForBox):
948         * rendering/RenderFragmentedFlow.h:
949
950 2017-10-04  Zalan Bujtas  <zalan@apple.com>
951
952         RenderMultiColumnSpannerPlaceholder should not hold raw pointers.
953         https://bugs.webkit.org/show_bug.cgi?id=177840
954         <rdar://problem/34800109>
955
956         Reviewed by Sam Weinig.
957
958         Though we should always have a spanner as long as there's a RenderMultiColumnSpannerPlaceholder,
959         the spanner inject/removal logic is complicated enough to protect them with WeakPtr.  
960
961         Covered by existing tests.
962
963         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
964         (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
965         * rendering/RenderMultiColumnSpannerPlaceholder.h:
966
967 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
968
969         [GTK] GtkUtilities.h should not be included in libs not linked to GTK
970         https://bugs.webkit.org/show_bug.cgi?id=177860
971
972         Reviewed by Carlos Garcia Campos.
973
974         * platform/FreeType.cmake:
975         * platform/gtk/GtkUtilities.cpp:
976         (WebCore::topLevelPath): Deleted.
977         (WebCore::webkitBuildDirectory): Deleted.
978         * platform/gtk/GtkUtilities.h:
979         (WebCore::wallTimeForEvent):
980         * platform/text/hyphen/HyphenationLibHyphen.cpp:
981         (WebCore::topLevelPath):
982         (WebCore::webkitBuildDirectory):
983
984 2017-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>
985
986         [Harfbuzz] Implement ComplexTextController on top of HarfBuzz
987         https://bugs.webkit.org/show_bug.cgi?id=167956
988
989         Reviewed by Myles C. Maxfield.
990
991         Implement ComplexTextController using HarfBuzz and remove HarfBuzzShaper.
992
993         Covered by existing tests, a rebaseline will be neeed.
994
995         * platform/FreeType.cmake:
996         * platform/graphics/ComplexTextController.cpp:
997         (WebCore::TextLayoutDeleter::operator() const): Enable TextLayout when using HarfBuzz.
998         (WebCore::FontCascade::createLayout const): Ditto.
999         (WebCore::FontCascade::width): Ditto.
1000         * platform/graphics/ComplexTextController.h:
1001         (WebCore::ComplexTextController::ComplexTextRun::create): Add constructor that receives an hb_buffer_t.
1002         * platform/graphics/Font.cpp:
1003         (WebCore::Font::variantCapsSupportsCharacterForSynthesis const): Simple implementation for non-cocoa ports.
1004         * platform/graphics/FontCascade.cpp:
1005         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Moved from FontCascadeCocoa.mm.
1006         (WebCore::FontCascade::floatWidthForComplexText const): Ditto.
1007         (WebCore::FontCascade::adjustSelectionRectForComplexText const): Ditto.
1008         (WebCore::FontCascade::offsetForPositionForComplexText const): Ditto.
1009         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1010         (WebCore::FontCascade::fontForCombiningCharacterSequence const): Normalize the sequence and get the font of the
1011         base character.
1012         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1013         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
1014         (WebCore::harfBuzzPositionToFloat):
1015         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
1016         (WebCore::fontFeatures):
1017         (WebCore::characterScript):
1018         (WebCore::scriptsAreCompatibleForCharacters):
1019         (WebCore::findNextRun):
1020         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1021         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
1022         (WebCore::harfBuzzGetGlyph): Check here if the character is a white space and use the space or zeroWidthSpace
1023         to ensure we get a glyph.
1024         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp: Removed.
1025         * platform/graphics/harfbuzz/HarfBuzzShaper.h: Removed.
1026         * platform/graphics/harfbuzz/HbUniquePtr.h: Added.
1027         (WebCore::HbPtrDeleter::operator() const):
1028         (WebCore::HbPtrDeleter<hb_font_t>::operator() const):
1029         (WebCore::HbPtrDeleter<hb_buffer_t>::operator() const):
1030         * platform/graphics/opentype/OpenTypeMathData.h: Use HbUniquePtr.
1031
1032 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1033
1034         Unreviewed, fix typo in function name scanDirectoryForDicionaries
1035         https://bugs.webkit.org/show_bug.cgi?id=177866
1036
1037         * platform/text/hyphen/HyphenationLibHyphen.cpp:
1038         (WebCore::scanDirectoryForDictionaries):
1039         (WebCore::scanTestDictionariesDirectoryIfNecessary):
1040         (WebCore::availableLocales):
1041         (WebCore::scanDirectoryForDicionaries): Deleted.
1042
1043 2017-10-04  Miguel Gomez  <magomez@igalia.com>
1044
1045         Add animation support for WebP images
1046         https://bugs.webkit.org/show_bug.cgi?id=113124
1047
1048         Reviewed by Žan Doberšek.
1049
1050         Implement decoding of WebP animations.
1051
1052         Test: fast/images/animated-webp.html
1053
1054         * platform/graphics/ImageBackingStore.h:
1055         (WebCore::ImageBackingStore::blendPixel):
1056         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
1057         (WebCore::WEBPImageDecoder::WEBPImageDecoder):
1058         (WebCore::WEBPImageDecoder::~WEBPImageDecoder):
1059         (WebCore::WEBPImageDecoder::setData):
1060         (WebCore::WEBPImageDecoder::repetitionCount const):
1061         (WebCore::WEBPImageDecoder::frameBufferAtIndex):
1062         (WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
1063         (WebCore::WEBPImageDecoder::decode):
1064         (WebCore::WEBPImageDecoder::decodeFrame):
1065         (WebCore::WEBPImageDecoder::initFrameBuffer):
1066         (WebCore::WEBPImageDecoder::applyPostProcessing):
1067         (WebCore::WEBPImageDecoder::parseHeader):
1068         (WebCore::WEBPImageDecoder::clearFrameBufferCache):
1069         * platform/image-decoders/webp/WEBPImageDecoder.h:
1070
1071 2017-10-04  Ryosuke Niwa  <rniwa@webkit.org>
1072
1073         Use blob URL when pasting RTFD instead of overriding DocumentLoader
1074         https://bugs.webkit.org/show_bug.cgi?id=177801
1075         <rdar://problem/34542270>
1076
1077         Reviewed by Wenson Hsieh.
1078
1079         Before this patch, pasting RTFD resulted in images and other subresources in RTFD are being placed
1080         into the document using WebKit fake URL, and DocumentLoader was overridden to return the appropriate
1081         data upon resource requests. This is bad because there is no mechanism for websites to access its content.
1082
1083         Like r222119 and r208451, this patch fixes thie problem by using a blob URL instead of a WebKit fake URL.
1084         This patch also adds a Blob::create variant which takes a SharedBuffer.
1085
1086         API Tests: PasteRTFD
1087
1088         * editing/WebCorePasteboardFileReader.cpp:
1089         (WebCore::WebCorePasteboardFileReader::readBuffer):
1090         * editing/cocoa/WebContentReaderCocoa.mm:
1091         (WebCore::DeferredLoadingScope): Extracted out of createFragmentAndAddResources for clarity.
1092         (WebCore::DeferredLoadingScope::DeferredLoadingScope):
1093         (WebCore::DeferredLoadingScope::~DeferredLoadingScope):
1094         (WebCore::createFragmentAndAddResources): Instead of adding resources to document loader, replace each
1095         URL in the document by a blob URL.
1096         (WebCore::WebContentReader::readImage):
1097         * editing/markup.cpp:
1098         (WebCore::replaceSubresourceURLs): Added. A helper to replace each URL in the document fragment by a blob
1099         URL created for each subresource. This won't work for iframes or srcset but that's okay for now since DOM
1100         constructed from RTFD doesn't use either.
1101         * editing/markup.h:
1102         * fileapi/Blob.cpp:
1103         (WebCore::Blob::Blob): Added a variant which takes a SharedBuffer.
1104         * fileapi/Blob.h:
1105         (WebCore::Blob::create): Ditto.
1106
1107 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1108
1109         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
1110         https://bugs.webkit.org/show_bug.cgi?id=177449
1111
1112         Reviewed by Chris Dumez.
1113
1114         * platform/gtk/GtkUtilities.cpp:
1115         (WebCore::wallTimeForEvent):
1116         * platform/gtk/GtkUtilities.h:
1117         (WebCore::wallTimeForEvent):
1118
1119 2017-10-04  Miguel Gomez  <magomez@igalia.com>
1120
1121         [GTK][WPE] Fix playback of GIFs
1122         https://bugs.webkit.org/show_bug.cgi?id=176089
1123
1124         Reviewed by Carlos Garcia Campos.
1125
1126         Allow GIFImageReader to decode again already decoded frames. Thanks to this, we don't
1127         need to delete the GIFImageReader when GIFImageDecoder::clearFrameBufferCache() is
1128         called, and the we don't need the lock to avoid crashes in that situation.
1129
1130         Covered by existent tests.
1131
1132         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1133         (WebCore::GIFImageDecoder::clearFrameBufferCache):
1134         (WebCore::GIFImageDecoder::decode):
1135         * platform/image-decoders/gif/GIFImageDecoder.h:
1136         * platform/image-decoders/gif/GIFImageReader.cpp:
1137         (GIFImageReader::decode):
1138
1139 2017-10-04  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1140
1141         Unreviewed build fix.
1142
1143         Use different enum value for the check. UP_DEVICE_LEVEL_NORMAL is only available on newer
1144         upower.
1145
1146         * platform/glib/LowPowerModeNotifierGLib.cpp:
1147         (WebCore::LowPowerModeNotifier::updateState):
1148
1149 2017-10-03  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1150
1151         [GLib] Let WebCore know of low power situations
1152         https://bugs.webkit.org/show_bug.cgi?id=177810
1153
1154         Reviewed by Carlos Garcia Campos.
1155
1156         WebCore can use knowledge of low power situations to throttle timers and avoid expensive
1157         checks, lowering power usage. We can use upower's warning level to let WebCore know we are
1158         in such a situation.
1159
1160         No tests as there is no way to mock upower.
1161
1162         * PlatformGTK.cmake: add new file.
1163         * PlatformWPE.cmake: add new file.
1164         * platform/LowPowerModeNotifier.cpp: use upower-glib to know about low power situations.
1165         * platform/LowPowerModeNotifier.h: includes upower header as UpClient and UpDevice are not forward
1166         declaration-friendly.
1167         * platform/glib/LowPowerModeNotifierGLib.cpp: Added.
1168         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
1169         (WebCore::LowPowerModeNotifier::updateState): update low power mode from warning-level.
1170         (WebCore::LowPowerModeNotifier::warningLevelCallback): track upower's warning-level to know when
1171         a low power situation occurs.
1172         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier): stop tracking the warning-level signal.
1173         (WebCore::LowPowerModeNotifier::isLowPowerModeEnabled const):
1174
1175 2017-10-04  Joanmarie Diggs  <jdiggs@igalia.com>
1176
1177         AX: [ATK] aria-pressed="mixed" should be exposed via ATK_STATE_INDETERMINATE
1178         https://bugs.webkit.org/show_bug.cgi?id=177807
1179
1180         Reviewed by Chris Fleizach.
1181
1182         Include toggle buttons in the element types for which the mixed state is checked
1183         and exposed via ATK_STATE_INDETERMINATE if found. Also only do the role checks when
1184         AccessibilityObject::isIndeterminate() has returned false.
1185
1186         Test: accessibility/gtk/aria-pressed-mixed-value.html
1187
1188         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1189         (setAtkStateSetFromCoreObject):
1190
1191 2017-10-04  Joanmarie Diggs  <jdiggs@igalia.com>
1192
1193         AX: [ATK] ARIA tabpanel role should be exposed as ATK_ROLE_SCROLL_PANE
1194         https://bugs.webkit.org/show_bug.cgi?id=177815
1195
1196         Reviewed by Chris Fleizach.
1197
1198         Change the mapping of TabPanelRole from ATK_ROLE_PANEL to ATK_ROLE_SCROLL_PANE.
1199
1200         No new tests because this mapping is already covered by aria-tab-roles.html and
1201         roles-exposed.html. The platform expectations for each test have been updated.
1202
1203         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1204         (atkRole):
1205
1206 2017-10-03  Antti Koivisto  <antti@apple.com>
1207
1208         Use WeakPtr in RenderFullScreen
1209         https://bugs.webkit.org/show_bug.cgi?id=177827
1210
1211         Reviewed by Zalan Bujtas.
1212
1213         Make Document::m_fullScreenRenderer RenderFullScreen::m_placeholder WeakPtrs
1214         and get rid of the custom nulling code.
1215
1216         * dom/Document.cpp:
1217         (WebCore::Document::destroyRenderTree):
1218         (WebCore::Document::webkitWillEnterFullScreenForElement):
1219         (WebCore::Document::webkitDidExitFullScreenForElement):
1220         (WebCore::Document::setFullScreenRenderer):
1221         (WebCore::Document::fullScreenRendererDestroyed): Deleted.
1222         * dom/Document.h:
1223         (WebCore::Document::fullScreenRenderer const):
1224         * rendering/RenderFullScreen.cpp:
1225         (WebCore::RenderFullScreen::RenderFullScreen):
1226         (WebCore::RenderFullScreen::willBeDestroyed):
1227         (WebCore::RenderFullScreen::createPlaceholder):
1228         (WebCore::RenderFullScreenPlaceholder::willBeDestroyed): Deleted.
1229         (WebCore::RenderFullScreen::setPlaceholder): Deleted.
1230         * rendering/RenderFullScreen.h:
1231
1232 2017-10-03  Ryosuke Niwa  <rniwa@webkit.org>
1233
1234         Enable pasteboard custom data in macOS 10.12 and earlier
1235         https://bugs.webkit.org/show_bug.cgi?id=177855
1236
1237         Reviewed by Wenson Hsieh.
1238
1239         Make customPasteboardDataEnabled return true on macOS 10.12 and earlier as long as the app is Safari.
1240
1241         * page/Settings.cpp:
1242         (WebCore::Settings::customPasteboardDataEnabled):
1243
1244 2017-10-03  Jon Davis  <jond@apple.com>
1245
1246         Update several features to "Supported"
1247         https://bugs.webkit.org/show_bug.cgi?id=177831
1248
1249         Reviewed by Alexey Proskuryakov.
1250
1251         Update Media Capture and Streams, Performance Observer, Resource Timing, User Timing, 
1252         Web Cryptography, and WebRTC.
1253
1254         * features.json:
1255
1256 2017-10-03  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1257
1258         [Curl] Reimplement CurlDownload with CurlRequest
1259         https://bugs.webkit.org/show_bug.cgi?id=177779
1260
1261         Reviewed by Alex Christensen.
1262
1263         * platform/network/curl/CurlContext.cpp:
1264         (WebCore::CurlHandle::enableAllowedProtocols):
1265         (WebCore::CurlHandle::enableFollowLocation): Deleted.
1266         (WebCore::CurlHandle::getEffectiveURL): Deleted.
1267         * platform/network/curl/CurlContext.h:
1268         * platform/network/curl/CurlDownload.cpp:
1269         (WebCore::CurlDownload::~CurlDownload):
1270         (WebCore::CurlDownload::init):
1271         (WebCore::CurlDownload::start):
1272         (WebCore::CurlDownload::cancel):
1273         (WebCore::CurlDownload::createCurlRequest):
1274         (WebCore::CurlDownload::curlDidReceiveResponse):
1275         (WebCore::CurlDownload::curlDidReceiveBuffer):
1276         (WebCore::CurlDownload::curlDidComplete):
1277         (WebCore::CurlDownload::curlDidFailWithError):
1278         (WebCore::CurlDownload::shouldRedirectAsGET):
1279         (WebCore::CurlDownload::willSendRequest):
1280         (WebCore::CurlDownload::getResponse const): Deleted.
1281         (WebCore::CurlDownload::retain): Deleted.
1282         (WebCore::CurlDownload::release): Deleted.
1283         (WebCore::CurlDownload::setupTransfer): Deleted.
1284         (WebCore::CurlDownload::didCompleteTransfer): Deleted.
1285         (WebCore::CurlDownload::didCancelTransfer): Deleted.
1286         (WebCore::CurlDownload::closeFile): Deleted.
1287         (WebCore::CurlDownload::moveFileToDestination): Deleted.
1288         (WebCore::CurlDownload::writeDataToFile): Deleted.
1289         (WebCore::CurlDownload::didReceiveHeader): Deleted.
1290         (WebCore::CurlDownload::didReceiveData): Deleted.
1291         (WebCore::CurlDownload::didReceiveResponse): Deleted.
1292         (WebCore::CurlDownload::didReceiveDataOfLength): Deleted.
1293         (WebCore::CurlDownload::didFinish): Deleted.
1294         (WebCore::CurlDownload::didFail): Deleted.
1295         (WebCore::CurlDownload::writeCallback): Deleted.
1296         (WebCore::CurlDownload::headerCallback): Deleted.
1297         * platform/network/curl/CurlDownload.h:
1298         (WebCore::CurlDownloadListener::didReceiveResponse):
1299         * platform/network/curl/CurlRequest.cpp:
1300         (WebCore::CurlRequest::didReceiveData):
1301         (WebCore::CurlRequest::finalizeTransfer):
1302         (WebCore::CurlRequest::enableDownloadToFile):
1303         (WebCore::CurlRequest::getDownloadedFilePath):
1304         (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled):
1305         (WebCore::CurlRequest::closeDownloadFile):
1306         * platform/network/curl/CurlRequest.h:
1307         (WebCore::CurlRequest::create):
1308         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
1309         (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
1310         * platform/network/curl/ResourceHandleCurlDelegate.h:
1311
1312 2017-10-03  Zalan Bujtas <zalan@apple.com>
1313
1314         Move scroll snap point unregistration from willBeRemovedFromTree to willBeDestroyed
1315         https://bugs.webkit.org/show_bug.cgi?id=177830
1316         <rdar://problem/34796065>
1317
1318         Reviewed by Antti Koivisto.
1319
1320         willBeRemovedFromTree is called conditionally, relying on unregistering objects in there is highly error prone.
1321
1322         Covered by existing tests.
1323
1324         * rendering/RenderBox.cpp:
1325         (WebCore::RenderBox::willBeDestroyed):
1326         (WebCore::RenderBox::willBeRemovedFromTree): Deleted.
1327         * rendering/RenderBox.h:
1328
1329 2017-10-03  Joanmarie Diggs  <jdiggs@igalia.com>
1330
1331         AX: [ATK] ARIA menuitems should be exposed with ATK_ROLE_MENU_ITEM even when it's the child of group role
1332         https://bugs.webkit.org/show_bug.cgi?id=177811
1333
1334         Reviewed by Chris Fleizach.
1335
1336         AccessibilityNodeObject::remapAriaRoleDueToParent() remaps ARIA menuitems to the
1337         MenuButtonRole AccessibilityRole when the menuitem's parent is an ARIA group, but
1338         the ATK code was not handling that remapped role value. As a result, the element
1339         was being exposed as ATK_ROLE_UNKNOWN. Add MenuButtonRole to the AccessibilityRole
1340         types exposed as ATK_ROLE_MENU_ITEM.
1341
1342         Test: accessibility/gtk/menu-with-group-child-tree.html
1343
1344         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1345         (atkRole):
1346
1347 2017-10-03  Joanmarie Diggs  <jdiggs@igalia.com>
1348
1349         AX: [ATK] aria-rowindex set on row element is not being exposed
1350         https://bugs.webkit.org/show_bug.cgi?id=177821
1351
1352         Reviewed by Chris Fleizach.
1353
1354         Expose the value of aria-rowindex when set on a row as an object
1355         attribute, as we already do when it's set on a cell.
1356
1357         Test: accessibility/gtk/aria-rowindex-on-row.html
1358
1359         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1360         (webkitAccessibleGetAttributes):
1361
1362 2017-10-03  Daniel Bates  <dabates@apple.com>
1363
1364         Share code to normalize an HTTP method
1365         https://bugs.webkit.org/show_bug.cgi?id=177837
1366
1367         Reviewed by Andy Estes.
1368
1369         Currently we duplicate code in XMLHttpRequest and FetchRequest to normalize an HTTP method.
1370         We should add a common helper function and update both classes to make use of it.
1371
1372         No functionality changed. So, no new tests.
1373
1374         * Modules/fetch/FetchRequest.cpp:
1375         (WebCore::setMethod): Modified to use WebCore::normalizeHTTPMethod().
1376         * platform/network/HTTPParsers.cpp:
1377         (WebCore::normalizeHTTPMethod): Moved from XMLHttpRequest.cpp.
1378         * platform/network/HTTPParsers.h:
1379         * xml/XMLHttpRequest.cpp:
1380         (WebCore::XMLHttpRequest::open): Modified to use WebCore::normalizeHTTPMethod().
1381         (WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod): Deleted; moved to HTTPParsers.cpp.
1382         * xml/XMLHttpRequest.h:
1383
1384 2017-10-03  Daniel Bates  <dabates@apple.com>
1385
1386         Share code to determine a forbidden method
1387         https://bugs.webkit.org/show_bug.cgi?id=177833
1388
1389         Reviewed by Andy Estes.
1390
1391         Currently we duplicate code in XMLHttpRequest and FetchRequest to determine if a method is
1392         forbidden. We should add a common helper function and update both classes to make use of it.
1393
1394         No functionality changed. So, no new tests.
1395
1396         * Modules/fetch/FetchRequest.cpp:
1397         (WebCore::setMethod): Modified to use WebCore::isForbiddenMethod().
1398         * platform/network/HTTPParsers.cpp:
1399         (WebCore::isForbiddenMethod): Added.
1400         * platform/network/HTTPParsers.h:
1401         * xml/XMLHttpRequest.cpp:
1402         (WebCore::XMLHttpRequest::open): Modified to use WebCore::isForbiddenMethod().
1403         (WebCore::XMLHttpRequest::isAllowedHTTPMethod): Deleted.
1404         * xml/XMLHttpRequest.h:
1405
1406 2017-10-03  Zalan Bujtas  <zalan@apple.com>
1407
1408         RenderMenuList should not hold raw pointers
1409         https://bugs.webkit.org/show_bug.cgi?id=177836
1410
1411         Reviewed by Antti Koivisto.
1412
1413         While both m_buttonText and m_innerBlock are child renderers of
1414         the RenderMenuList, so the their lifecycles are supposed to tied
1415         to the parent object, this patch removes some manual raw pointer managing.
1416
1417         Covered by existing tests.
1418
1419         * rendering/RenderMenuList.cpp:
1420         (WebCore::RenderMenuList::RenderMenuList):
1421         (WebCore::RenderMenuList::createInnerBlock):
1422         (RenderMenuList::takeChild):
1423         (RenderMenuList::setText):
1424         * rendering/RenderMenuList.h:
1425
1426 2017-10-03  Timothy Horton  <timothy_horton@apple.com>
1427
1428         Include a few widespread WTF headers in WebCorePrefix.h
1429         https://bugs.webkit.org/show_bug.cgi?id=173481
1430
1431         * WebCorePrefix.h:
1432         Turn this off on Windows because it doesn't work; needs further investigation.
1433
1434 2017-10-03  Tim Horton  <timothy_horton@apple.com>
1435
1436         Include a few widespread WTF headers in WebCorePrefix.h
1437         https://bugs.webkit.org/show_bug.cgi?id=173481
1438
1439         Reviewed by Alex Christensen.
1440
1441         * WebCorePrefix.h:
1442         These are four of the headers that contribute the most pre-processed
1443         source to the WebCore build. They (and their dependents) change infrequently
1444         enough that a world rebuild of WebCore when they change seems like an
1445         acceptable tradeoff for the ~9% reduction in WebCore build time that I
1446         measure from this change.
1447
1448         We can't do this on macOS 10.12 because of https://bugs.llvm.org/show_bug.cgi?id=33520.
1449
1450 2017-10-03  Daniel Bates  <dabates@apple.com>
1451
1452         XMLHttpRequest.setRequestHeader() should allow Content-Transfer-Encoding header; remove
1453         duplicate logic to check for a forbidden XHR header field
1454         https://bugs.webkit.org/show_bug.cgi?id=177829
1455
1456         Reviewed by Alexey Proskuryakov.
1457
1458         Use isForbiddenHeaderName() (defined in HTTPParsers.h) to check if the header field specified
1459         to XMLHttpRequest.setRequestHeader() is allowed. Among other benefits this makes the behavior
1460         of XMLHttpRequest.setRequestHeader() more closely aligned with the behavior of this method in
1461         the XHR standard, <https://xhr.spec.whatwg.org> (8 September 2017). In particular, XMLHttpRequest.setRequestHeader()
1462         no longer forbids setting the header Content-Transfer-Encoding. This header has not been
1463         considered a forbidden header since <https://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/>.
1464
1465         * xml/XMLHttpRequest.cpp:
1466         (WebCore::XMLHttpRequest::setRequestHeader):
1467         (WebCore::isForbiddenRequestHeader): Deleted.
1468         (WebCore::XMLHttpRequest::isAllowedHTTPHeader): Deleted.
1469         * xml/XMLHttpRequest.h:
1470
1471 2017-10-03  Commit Queue  <commit-queue@webkit.org>
1472
1473         Unreviewed, rolling out r222686, r222695, and r222698.
1474         https://bugs.webkit.org/show_bug.cgi?id=177835
1475
1476         Caused LayoutTests to crash in
1477         WebCore::TimerBase::setNextFireTime (Requested by ryanhaddad
1478         on #webkit).
1479
1480         Reverted changesets:
1481
1482         "[Settings] Replace SettingsMacros.h with a generated base
1483         class for Settings"
1484         https://bugs.webkit.org/show_bug.cgi?id=177681
1485         http://trac.webkit.org/changeset/222686
1486
1487         "[Settings] Enums should not be passed by const reference"
1488         https://bugs.webkit.org/show_bug.cgi?id=177727
1489         http://trac.webkit.org/changeset/222695
1490
1491         "[Settings] Move remaining simple settings to Settings.in"
1492         https://bugs.webkit.org/show_bug.cgi?id=177730
1493         http://trac.webkit.org/changeset/222698
1494
1495 2017-10-03  Jer Noble  <jer.noble@apple.com>
1496
1497         Implement quality-of-service tiers in WebCoreDecompressionSession
1498         https://bugs.webkit.org/show_bug.cgi?id=177769
1499
1500         Reviewed by Dean Jackson.
1501
1502         VTDecompressionSession will suggest quality-of-service tiers to be used when decompression
1503         can't keep up with playback speed. Use a simple exponential-moving-average heuristic to
1504         determine when to move up and down the tiers.
1505
1506         Drive-by fix: When frames are so late that they miss the display deadline, mark them as
1507         dropped rather than just delayed.
1508
1509         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
1510         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
1511         (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
1512         (WebCore::WebCoreDecompressionSession::decodeSample):
1513         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
1514         (WebCore::WebCoreDecompressionSession::automaticDequeue):
1515         (WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
1516         (WebCore::WebCoreDecompressionSession::resetQosTier):
1517         (WebCore::WebCoreDecompressionSession::increaseQosTier):
1518         (WebCore::WebCoreDecompressionSession::decreaseQosTier):
1519         (WebCore::WebCoreDecompressionSession::updateQosWithDecodeTimeStatistics):
1520         * platform/cocoa/VideoToolboxSoftLink.cpp:
1521         * platform/cocoa/VideoToolboxSoftLink.h:
1522
1523 2017-10-03  Adrian Perez de Castro  <aperez@igalia.com>
1524
1525         [GTK] Support the "system" CSS font family
1526         https://bugs.webkit.org/show_bug.cgi?id=177755
1527
1528         Reviewed by Carlos Garcia Campos.
1529
1530         Obtain the system UI font from the GtkSettings::gtk-font-name property
1531
1532         Test: platform/gtk/fonts/systemFont.html
1533
1534         * platform/graphics/freetype/FontCacheFreeType.cpp:
1535         (WebCore::getFamilyNameStringFromFamily): Use defaultGtkSystemFont()
1536         to handle -webkit-system-font and -webkit-system-ui.
1537         (WebCore::isCommonlyUsedGenericFamily): Handle -webkit-system-font and
1538         -webkit-system-ui as generic family names.
1539         * platform/graphics/gtk/GtkUtilities.cpp:
1540         (WebCore::defaultGtkSystemFont): Added.
1541         * platform/graphics/gtk/GtkUtilities.h: Add prototype for defaultGtkSystemFont().
1542
1543 2017-10-03  Daniel Bates  <dabates@apple.com>
1544
1545         [XHR] Only exempt Dashboard widgets from XHR header restrictions
1546         https://bugs.webkit.org/show_bug.cgi?id=177824
1547         <rdar://problem/34384301>
1548
1549         Reviewed by Alexey Proskuryakov.
1550
1551         Currently we allow file URLs to set arbitrary XHR headers. In contrast, non-file URLs are
1552         restricted from setting some XHR headers (e.g. COOKIE). Historically the relaxation for file
1553         URL was for backwards compatibility to allow Dashboard widgets to work. Instead we should
1554         apply the non-file URL policy to all URLs and only relax the policy for Dashboard widgets.
1555
1556         Tests: fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html
1557                fast/xmlhttprequest/set-dangerous-headers.html
1558
1559         * xml/XMLHttpRequest.cpp:
1560         (WebCore::XMLHttpRequest::setRequestHeader):
1561
1562 2017-10-03  Fujii Hironori  <Hironori.Fujii@sony.com>
1563
1564         REGRESSION(r221909): Failing fast/text/international/iso-8859-8.html
1565         https://bugs.webkit.org/show_bug.cgi?id=177364
1566
1567         Reviewed by Carlos Garcia Campos.
1568
1569         Range.getClientRects returned an incorrect rect for a last
1570         collapsed space of RenderText in HarfBuzz port.
1571
1572         HarfBuzzShaper::selectionRect needs to return a valid value even
1573         if the arguments 'from' and 'to' point to the just after the end
1574         of the text run.
1575
1576         Tests: fast/text/international/iso-8859-8.html
1577
1578         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
1579         (WebCore::HarfBuzzShaper::shape): Do not check the return value of
1580         fillGlyphBuffer.
1581         (WebCore::HarfBuzzShaper::fillGlyphBuffer): Change the return
1582         value type from bool to void.
1583         (WebCore::HarfBuzzShaper::selectionRect): Set the rightmost
1584         position to fromX if foundFromX is false.
1585         * platform/graphics/harfbuzz/HarfBuzzShaper.h: Change the return
1586         value type of fillGlyphBuffer from bool to void.
1587
1588 2017-10-03  JF Bastien  <jfbastien@apple.com>
1589
1590         WebAssembly: no VM / JS version of everything but Instance
1591         https://bugs.webkit.org/show_bug.cgi?id=177473
1592
1593         Reviewed by Filip Pizlo.
1594
1595         * ForwardingHeaders/wasm/WasmModule.h: Added. This used to be
1596         included in JSWebAssemblyModule.h.
1597         * bindings/js/SerializedScriptValue.cpp: Update postMessage code
1598         according to C++ API changes.
1599
1600 2017-10-03  Zalan Bujtas  <zalan@apple.com>
1601
1602         [AX] Do not trigger redundant layout on tables.
1603         https://bugs.webkit.org/show_bug.cgi?id=177781
1604         <rdar://problem/34777030>
1605
1606         Reviewed by Antti Koivisto.
1607
1608         RenderTable::forceSectionsRecalc() marks the RenderTable dirty and schedules a layout.
1609         Every time AccessibilityTable asks for the table element (including during construction),
1610         we end up triggering a layout. This call was added (r191357) to ensure RenderTable's m_firstBody is always
1611         up-to-date (in case of anonymous wrapper table renderer). Instead of relying on the m_firstBody,
1612         let's just use the first child to find the table element. The first child always points to a valid
1613         renderer (or nullptr), while m_firstBody is the result of section computation.
1614
1615         Covered by existing tests.
1616
1617         * accessibility/AccessibilityTable.cpp:
1618         (WebCore::AccessibilityTable::tableElement const):
1619
1620 2017-10-03  Daniel Bates  <dabates@apple.com>
1621
1622         [CSP] Check policy before opening a new window to a JavaScript URL
1623         https://bugs.webkit.org/show_bug.cgi?id=176815
1624         <rdar://problem/34400057>
1625
1626         Reviewed by Brent Fulgham.
1627
1628         Ensure that the Content Security Policy of the page allows navigation to a JavaScript URL
1629         before opening a new window to it.
1630
1631         Test: http/tests/security/contentSecurityPolicy/window-open-javascript-url-blocked.html
1632
1633         * loader/FrameLoader.cpp:
1634         (WebCore::createWindow):
1635
1636 2017-10-03  Joanmarie Diggs  <jdiggs@igalia.com>
1637
1638         AX: [ATK] ARIA drag-and-drop attribute values should be exposed via AtkObject attributes
1639         https://bugs.webkit.org/show_bug.cgi?id=177763
1640
1641         Reviewed by Chris Fleizach.
1642
1643         Expose the values of aria-grabbed and aria-dropeffect via the "grabbed" and "dropeffect"
1644         AtkObject attributes.
1645
1646         Test: accessibility/gtk/aria-drag-and-drop.html
1647
1648         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1649         (webkitAccessibleGetAttributes):
1650
1651 2017-10-03  Brent Fulgham  <bfulgham@apple.com>
1652
1653         Unreviewed test fix after r222779.
1654
1655         * testing/cocoa/WebArchiveDumpSupport.mm:
1656         (WebCoreTestSupport::createCFURLResponseFromResponseData): Setting NSSecureCoding in this test code should be
1657         done based on build system, just like it is in the actual WebArchive handling code.
1658
1659 2017-10-03  Youenn Fablet  <youenn@apple.com>
1660
1661         Clean-up RealtimeIncomingVideoSource
1662         https://bugs.webkit.org/show_bug.cgi?id=177782
1663
1664         Reviewed by Alejandro G. Castro.
1665
1666         No change of behavior.
1667         Removing code that is no longer needed.
1668
1669         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
1670         (WebCore::RealtimeIncomingVideoSource::create):
1671         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
1672         * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
1673
1674 2017-10-03  Brent Fulgham  <bfulgham@apple.com>
1675
1676         [Mac] Use safer decoding practices for NSKeyedUnarchiver
1677         https://bugs.webkit.org/show_bug.cgi?id=175887
1678         <rdar://problem/33435281>
1679
1680         Reviewed by Daniel Bates.
1681
1682         * loader/archive/cf/LegacyWebArchiveMac.mm:
1683         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Use NSSecureCoding to unarchive.
1684         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto for archiving.
1685         * testing/cocoa/WebArchiveDumpSupport.mm:
1686         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to use NSSecureCoding if possible.
1687
1688 2017-10-03  Ryan Haddad  <ryanhaddad@apple.com>
1689
1690         Unreviewed, rolling out r222760.
1691
1692         This change caused LayoutTest crashes.
1693
1694         Reverted changeset:
1695
1696         "[Mac] Use safer decoding practices for NSKeyedUnarchiver"
1697         https://bugs.webkit.org/show_bug.cgi?id=175887
1698         http://trac.webkit.org/changeset/222760
1699
1700 2017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1701
1702         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
1703         https://bugs.webkit.org/show_bug.cgi?id=177449
1704
1705         Reviewed by Chris Dumez.
1706
1707         * platform/gtk/GtkUtilities.cpp:
1708         (WebCore::wallTimeForEvent):
1709         * platform/gtk/GtkUtilities.h:
1710         (WebCore::wallTimeForEvent):
1711         * platform/gtk/PlatformKeyboardEventGtk.cpp:
1712         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1713         * platform/gtk/PlatformMouseEventGtk.cpp:
1714         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1715         * platform/gtk/PlatformWheelEventGtk.cpp:
1716         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1717
1718 2017-10-03  Youenn Fablet  <youenn@apple.com>
1719
1720         Use vector map routine in WebCore CacheStorage implementation
1721         https://bugs.webkit.org/show_bug.cgi?id=177002
1722
1723         Reviewed by Darin Adler.
1724
1725         No change of behavior.
1726         Replacing use of reserveInitialCapacity/uncheckedAppend by use of map.
1727
1728         * Modules/cache/CacheStorage.cpp:
1729         (WebCore::copyCache):
1730         (WebCore::CacheStorage::match):
1731         (WebCore::CacheStorage::retrieveCaches):
1732         (WebCore::CacheStorage::keys):
1733         (WebCore::copyCaches): Deleted.
1734         * Modules/cache/DOMCache.cpp:
1735         (WebCore::DOMCache::matchAll):
1736         (WebCore::copyRequestRef):
1737         (WebCore::DOMCache::keys):
1738         * Modules/cache/DOMCacheEngine.cpp:
1739         (WebCore::DOMCacheEngine::isolateCacheInfo):
1740         (WebCore::DOMCacheEngine::CacheInfos::isolatedCopy):
1741         * Modules/cache/WorkerCacheStorageConnection.cpp:
1742         (WebCore::recordsDataFromRecords):
1743         (WebCore::recordsFromRecordsData):
1744
1745 2017-10-02  Myles C. Maxfield  <mmaxfield@apple.com>
1746
1747         Move LineEnding.{h,cpp} from WebCore/platform/text to wtf/text
1748         https://bugs.webkit.org/show_bug.cgi?id=176575
1749
1750         Reviewed by Alex Christensen.
1751
1752         No new tests because there is no behavior change.
1753
1754         * WebCore.xcodeproj/project.pbxproj:
1755         * fileapi/BlobBuilder.cpp:
1756         * html/FormDataList.cpp:
1757
1758 2017-10-02  Joseph Pecoraro  <pecoraro@apple.com>
1759
1760         Web Inspector: Rename methods ending in *Json() as *JSON()
1761         https://bugs.webkit.org/show_bug.cgi?id=177793
1762
1763         Reviewed by Matt Baker.
1764
1765         * inspector/InspectorNetworkAgent.cpp:
1766         (WebCore::InspectorNetworkAgent::buildObjectForCachedResource):
1767         (WebCore::InspectorNetworkAgent::willSendRequest):
1768         (WebCore::InspectorNetworkAgent::didReceiveResponse):
1769         * inspector/InspectorPageAgent.cpp:
1770         (WebCore::InspectorPageAgent::resourceTypeJSON):
1771         (WebCore::InspectorPageAgent::cachedResourceTypeJSON):
1772         (WebCore::InspectorPageAgent::buildObjectForFrameTree):
1773         (WebCore::InspectorPageAgent::resourceTypeJson): Deleted.
1774         (WebCore::InspectorPageAgent::cachedResourceTypeJson): Deleted.
1775         * inspector/InspectorPageAgent.h:
1776
1777 2017-10-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1778
1779         REGRESSION(r222595): Intermittent crash while accessing DataTransferItemList
1780         https://bugs.webkit.org/show_bug.cgi?id=177791
1781         <rdar://problem/34781456>
1782
1783         Reviewed by Ryosuke Niwa.
1784
1785         DataTransfer::moveDragState() currently attempts to move the other DataTransfer's DataTransferItemList and
1786         DragImageLoader as members of its own. This is incorrect, since both of these entities hold raw references of
1787         some form to the other DataTransfer, yet they are held as unique_ptrs in the new DataTransfer. To fix this, we
1788         (1) remove the line of code that moves the item list, since item lists will be lazily generated on the new
1789         DataTransfer anyways, and (2) update the DataTransfer pointer on the old DataTransfer's DragImageLoader after
1790         moving it to the new DataTransfer.
1791
1792         Test: editing/pasteboard/drag-end-crash-accessing-item-list.html
1793
1794         * dom/DataTransfer.cpp:
1795         (WebCore::DragImageLoader::moveToDataTransfer):
1796         (WebCore::DataTransfer::moveDragState):
1797
1798 2017-10-02  Chris Dumez  <cdumez@apple.com>
1799
1800         Rename computeSharedStringHash() overload taking a URL to computedVisitedLinkHash()
1801         https://bugs.webkit.org/show_bug.cgi?id=177776
1802
1803         Reviewed by Alex Christensen.
1804
1805         * dom/VisitedLinkState.cpp:
1806         (WebCore::linkHashForElement):
1807         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
1808         * html/HTMLAnchorElement.h:
1809         (WebCore::HTMLAnchorElement::visitedLinkHash const):
1810         * platform/SharedStringHash.cpp:
1811         (WebCore::computeVisitedLinkHash):
1812         * platform/SharedStringHash.h:
1813
1814 2017-10-02  Joanmarie Diggs  <jdiggs@igalia.com>
1815
1816         AX: [ATK] The value of aria-level is not exposed on non-heading roles
1817         https://bugs.webkit.org/show_bug.cgi?id=177775
1818
1819         Reviewed by Chris Fleizach.
1820
1821         Expose the value of aria-level via the "level" AtkObject attribute, as is currently
1822         done for headings.
1823
1824         Test: accessibility/gtk/aria-level.html
1825
1826         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1827         (webkitAccessibleGetAttributes):
1828
1829 2017-10-02  Andy Estes  <aestes@apple.com>
1830
1831         [Payment Request] Validate payment method identifiers
1832         https://bugs.webkit.org/show_bug.cgi?id=177794
1833
1834         Reviewed by Sam Weinig.
1835
1836         * Modules/paymentrequest/PaymentRequest.cpp:
1837         (WebCore::isValidStandardizedPaymentMethodIdentifier):
1838         (WebCore::isValidURLBasedPaymentMethodIdentifier):
1839         (WebCore::convertAndValidatePaymentMethodIdentifier):
1840         (WebCore::PaymentRequest::create):
1841         * Modules/paymentrequest/PaymentRequest.h:
1842
1843 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
1844
1845         Move more code into PasteboardCustomData
1846         https://bugs.webkit.org/show_bug.cgi?id=177795
1847
1848         Reviewed by Wenson Hsieh.
1849
1850         Moved sharedBufferFromCustomData, customDataFromSharedBuffer, and customWebKitPasteboardDataType into
1851         PasteboardCustomData as createSharedBuffer, fromSharedBuffer, and cocoaType respectively.
1852
1853         * platform/Pasteboard.cpp:
1854         (WebCore::PasteboardCustomData::createSharedBuffer const): Renamed from sharedBufferFromCustomData.
1855         (WebCore::PasteboardCustomData::fromSharedBuffer): Renamed from customDataFromSharedBuffer.
1856         * platform/Pasteboard.h:
1857         * platform/StaticPasteboard.cpp:
1858         (WebCore::StaticPasteboard::commitToPasteboard): Now initializes with an empty origin string.
1859         * platform/cocoa/PasteboardCocoa.mm:
1860         (WebCore::PasteboardCustomData::cocoaType): Moved here from Pasteboard.h
1861         (WebCore::Pasteboard::readStringInCustomData):
1862         * platform/ios/PlatformPasteboardIOS.mm:
1863         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
1864         (WebCore::PlatformPasteboard::write):
1865         * platform/ios/WebItemProviderPasteboard.mm:
1866         (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]):
1867         * platform/mac/PlatformPasteboardMac.mm:
1868         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
1869         (WebCore::PlatformPasteboard::write):
1870
1871 2017-10-02  Brent Fulgham  <bfulgham@apple.com>
1872
1873         [Mac] Use safer decoding practices for NSKeyedUnarchiver
1874         https://bugs.webkit.org/show_bug.cgi?id=175887
1875         <rdar://problem/33435281>
1876
1877         Reviewed by Daniel Bates.
1878
1879         * loader/archive/cf/LegacyWebArchiveMac.mm:
1880         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Use NSSecureCoding to unarchive.
1881         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto for archiving.
1882         * testing/cocoa/WebArchiveDumpSupport.mm:
1883         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to use NSSecureCoding if possible.
1884
1885 2017-10-02  Daniel Bates  <dabates@apple.com>
1886
1887         Use InlineTextBox::lineFont() in more places
1888         https://bugs.webkit.org/show_bug.cgi?id=177749
1889
1890         Reviewed by Zalan Bujtas.
1891
1892         Currently InlineTextBox::paint() calls InlineTextBox::lineFont() to compute the font for the
1893         line and then passes this value to various paint helper functions. The computation is not
1894         expensive and it is sufficient to have the individual paint helper functions compute it
1895         directly. We should have the individual paint helper functions compute it directly. This
1896         will help towards sharing more code throughout InlineTextBox by reducing the noise of
1897         passing the font for the line.
1898
1899         No functionality changed. So, no new tests.
1900
1901         * rendering/InlineTextBox.cpp:
1902         (WebCore::InlineTextBox::paint):
1903         (WebCore::InlineTextBox::paintSelection):
1904         (WebCore::InlineTextBox::paintTextSubrangeBackground):
1905         (WebCore::InlineTextBox::paintCompositionBackground):
1906         (WebCore::InlineTextBox::paintTextMatchMarker):
1907         (WebCore::InlineTextBox::paintDecoration):
1908         (WebCore::InlineTextBox::paintDocumentMarker):
1909         (WebCore::InlineTextBox::paintDocumentMarkers):
1910         * rendering/InlineTextBox.h:
1911
1912 2017-10-02  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1913
1914         [Curl] Implement missing async method in RecourceHandle and make it actually async
1915         https://bugs.webkit.org/show_bug.cgi?id=173964
1916
1917         Reviewed by Alex Christensen.
1918
1919         * platform/network/ResourceHandle.cpp:
1920         (WebCore::ResourceHandle::continueWillSendRequest): Deleted.
1921         (WebCore::ResourceHandle::continueDidReceiveResponse): Deleted.
1922         (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace): Deleted.
1923         * platform/network/curl/CurlRequest.cpp:
1924         (WebCore::CurlRequest::start):
1925         (WebCore::CurlRequest::cancel):
1926         (WebCore::CurlRequest::suspend):
1927         (WebCore::CurlRequest::resume):
1928         (WebCore::CurlRequest::didReceiveHeader):
1929         (WebCore::CurlRequest::didReceiveData):
1930         (WebCore::CurlRequest::didCompleteTransfer):
1931         (WebCore::CurlRequest::didCancelTransfer):
1932         (WebCore::CurlRequest::finalizeTransfer):
1933         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
1934         (WebCore::CurlRequest::invokeDidReceiveResponse):
1935         (WebCore::CurlRequest::completeDidReceiveResponse):
1936         (WebCore::CurlRequest::setRequestPaused):
1937         (WebCore::CurlRequest::setCallbackPaused):
1938         (WebCore::CurlRequest::pausedStatusChanged):
1939         (WebCore::CurlRequest::setPaused): Deleted.
1940         * platform/network/curl/CurlRequest.h:
1941         (WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
1942         (WebCore::CurlRequest::isPaused const):
1943         * platform/network/curl/ResourceHandleCurl.cpp:
1944         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
1945         (WebCore::ResourceHandle::continueDidReceiveResponse):
1946         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
1947         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
1948         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
1949         (WebCore::ResourceHandleCurlDelegate::continueDidReceiveResponse):
1950         (WebCore::ResourceHandleCurlDelegate::platformContinueSynchronousDidReceiveResponse):
1951         (WebCore::ResourceHandleCurlDelegate::continueAfterDidReceiveResponse):
1952         (WebCore::ResourceHandleCurlDelegate::shouldRedirectAsGET):
1953         * platform/network/curl/ResourceHandleCurlDelegate.h:
1954         * platform/network/curl/ResourceResponseCurl.cpp:
1955         (WebCore::ResourceResponse::shouldRedirect):
1956         (WebCore::ResourceResponse::isMovedPermanently const):
1957         (WebCore::ResourceResponse::isFound const):
1958         (WebCore::ResourceResponse::isSeeOther const):
1959         (WebCore::ResourceResponse::isNotModified const):
1960         (WebCore::ResourceResponse::isUnauthorized const):
1961
1962 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
1963
1964         PasteImage tests are failing on debug builds
1965         https://bugs.webkit.org/show_bug.cgi?id=177778
1966
1967         Reviewed by Wenson Hsieh.
1968
1969         After r222702, PlatformPasteboard is no longer responsible for adding "Files" as a type"
1970         as DataTransfer takes care of it now. Removed the code to do this from PlatformPasteboardIOS.mm
1971         and PlatformPasteboardMac.mm so that we don't fail assertions in debug builds.
1972
1973         * platform/ios/PlatformPasteboardIOS.mm:
1974         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
1975         * platform/mac/PlatformPasteboardMac.mm:
1976         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
1977         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
1978
1979 2017-10-02  Daniel Bates  <dabates@apple.com>
1980
1981         No need to truncate text after calling InlineTextBox::text()
1982         https://bugs.webkit.org/show_bug.cgi?id=177748
1983
1984         Reviewed by Zalan Bujtas.
1985
1986         Following r222670 it is no longer necessary to explicitly truncate the text run length
1987         as InlineTextBox::text() returns a text run with respect to the truncation of the text box.
1988
1989         No functionality changed. So, no new tests.
1990
1991         * rendering/InlineTextBox.cpp:
1992         (WebCore::InlineTextBox::paint):
1993
1994 2017-10-02  Antti Koivisto  <antti@apple.com>
1995
1996         Add makeWeakPtr variant that takes pointer
1997         https://bugs.webkit.org/show_bug.cgi?id=177767
1998
1999         Reviewed by Zalan Bujtas.
2000
2001         Use it.
2002
2003         * rendering/SelectionRangeData.h:
2004         (WebCore::SelectionRangeData::Context::Context):
2005
2006 2017-10-02  Antti Koivisto  <antti@apple.com>
2007
2008         Make RenderPtr a type alias of std::unique_ptr
2009         https://bugs.webkit.org/show_bug.cgi?id=177739
2010
2011         Reviewed by Sam Weinig.
2012
2013         It just needs a custom deleter.
2014
2015         * page/FrameView.h:
2016         * rendering/RenderElement.cpp:
2017         (WebCore::RenderElement::insertChildInternal):
2018         * rendering/RenderMultiColumnFlow.cpp:
2019         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
2020         (WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
2021         * rendering/RenderObject.cpp:
2022         (WebCore::RenderObjectDeleter::operator() const):
2023         (WebCore::RenderObject::willBeDestroyed):
2024         * rendering/RenderPtr.h:
2025         (WebCore::createRenderer):
2026         (WebCore::static_pointer_cast):
2027
2028             Make this safer with downcast.
2029
2030         (WebCore::RenderPtr::RenderPtr): Deleted.
2031         (WebCore::RenderPtr::~RenderPtr): Deleted.
2032         (WebCore::RenderPtr::get const): Deleted.
2033         (WebCore::RenderPtr::operator* const): Deleted.
2034         (WebCore::RenderPtr::operator-> const): Deleted.
2035         (WebCore::RenderPtr::operator! const): Deleted.
2036         (WebCore::RenderPtr::operator UnspecifiedBoolType const): Deleted.
2037         (WebCore::RenderPtr::operator=): Deleted.
2038         (WebCore::RenderPtr::swap): Deleted.
2039         (WebCore::RenderPtr::operator==): Deleted.
2040         (WebCore::RenderPtr::operator!=): Deleted.
2041         (WebCore::RenderPtr<T>::clear): Deleted.
2042         (WebCore::RenderPtr<T>::leakPtr): Deleted.
2043         (WebCore::RenderPtr<T>::RenderPtr): Deleted.
2044         (WebCore::=): Deleted.
2045         (WebCore::swap): Deleted.
2046         (WebCore::operator==): Deleted.
2047         (WebCore::operator!=): Deleted.
2048         (WebCore::getPtr): Deleted.
2049         (WTF::HashTraits<WebCore::RenderPtr<T>>::emptyValue): Deleted.
2050         (WTF::HashTraits<WebCore::RenderPtr<T>>::peek): Deleted.
2051
2052             We already have hash traits for std::unique_ptr.
2053
2054 2017-10-02  Joseph Pecoraro  <pecoraro@apple.com>
2055
2056         Web Inspector: Include Beacon and Ping requests in Network tab
2057         https://bugs.webkit.org/show_bug.cgi?id=177641
2058         <rdar://problem/33086839>
2059
2060         Reviewed by Chris Dumez.
2061
2062         Tests: http/tests/inspector/network/beacon-type.html
2063                http/tests/inspector/network/ping-type.html
2064
2065         * Modules/beacon/NavigatorBeacon.cpp:
2066         (WebCore::NavigatorBeacon::sendBeacon):
2067         Fix a typo.
2068
2069         * loader/PingLoader.cpp:
2070         (WebCore::PingLoader::startPingLoad):
2071         * loader/cache/CachedResource.cpp:
2072         (WebCore::CachedResource::load):
2073         Include InspectorInstrumentation hooks for ping network loads.
2074
2075         * loader/LoaderStrategy.h:
2076         * platform/network/PingHandle.h:
2077         Include an optional ResourceResponse in the ping load completion callback.
2078         If available this will be enough for Web Inspector to include details such
2079         as the response statusCode.
2080
2081         * inspector/InspectorInstrumentation.cpp:
2082         (WebCore::InspectorInstrumentation::willSendRequestOfTypeImpl):
2083         (WebCore::InspectorInstrumentation::continueAfterPingLoaderImpl): Deleted.
2084         * inspector/InspectorInstrumentation.h:
2085         (WebCore::InspectorInstrumentation::willSendRequestOfType):
2086         (WebCore::InspectorInstrumentation::continueAfterPingLoader): Deleted.
2087         * inspector/InspectorNetworkAgent.cpp:
2088         (WebCore::resourceTypeForCachedResource):
2089         (WebCore::resourceTypeForLoadType):
2090         (WebCore::InspectorNetworkAgent::willSendRequest):
2091         (WebCore::InspectorNetworkAgent::willSendRequestOfType):
2092         * inspector/InspectorNetworkAgent.h:
2093         Make a general willSendRequestOfType hook when sending a request that does
2094         not go through normal CachedResource loading. The Ping and Beacon requests
2095         go through this process, we may also use this path for Preflight requests.
2096
2097         * inspector/InspectorPageAgent.cpp:
2098         (WebCore::InspectorPageAgent::resourceTypeJson):
2099         (WebCore::InspectorPageAgent::cachedResourceType):
2100         * inspector/InspectorPageAgent.h:
2101         Small refactoring.
2102
2103 2017-10-02  Zalan Bujtas  <zalan@apple.com>
2104
2105         SelectionRangeData should not hold raw RenderObject pointers
2106         https://bugs.webkit.org/show_bug.cgi?id=177677
2107         <rdar://problem/34763060>
2108
2109         Reviewed by Sam Weinig.
2110
2111         SelectionRangeData::Context start and end renderers' lifetime is not strictly tied
2112         to the lifetime of SelectionRangeData.
2113
2114         Covered by existing tests.
2115
2116         * editing/FrameSelection.cpp:
2117         (WebCore::FrameSelection::updateAppearance):
2118         * platform/DragImage.cpp:
2119         (WebCore::createDragImageForRange):
2120         * rendering/SelectionRangeData.cpp:
2121         (WebCore::isValidRendererForSelection):
2122         (WebCore::collect):
2123         (WebCore::SelectionRangeData::set):
2124         (WebCore::SelectionRangeData::clear):
2125         (WebCore::SelectionRangeData::repaint const):
2126         (WebCore::SelectionRangeData::collectBounds const):
2127         (WebCore::SelectionRangeData::apply):
2128         * rendering/SelectionRangeData.h:
2129         (WebCore::SelectionRangeData::Context::Context):
2130         (WebCore::SelectionRangeData::Context::start const):
2131         (WebCore::SelectionRangeData::Context::end const):
2132         (WebCore::SelectionRangeData::Context::startPosition const):
2133         (WebCore::SelectionRangeData::Context::endPosition const):
2134         (WebCore::SelectionRangeData::Context::operator== const):
2135         (WebCore::SelectionRangeData::start const):
2136         (WebCore::SelectionRangeData::end const):
2137         (WebCore::SelectionRangeData::startPosition const):
2138         (WebCore::SelectionRangeData::endPosition const):
2139
2140 2017-10-02  Olivier Blin  <olivier.blin@softathome.com>
2141
2142         [WPE] Remove GnuTLS dependency
2143         https://bugs.webkit.org/show_bug.cgi?id=177750
2144
2145         Reviewed by Michael Catanzaro.
2146
2147         libgcrypt is used by default instead of GnuTLS.
2148         See bug 163125
2149
2150         * PlatformWPE.cmake:
2151
2152 2017-10-02  Zalan Bujtas  <zalan@apple.com>
2153
2154         Addressing post-review comments after r222621
2155         https://bugs.webkit.org/show_bug.cgi?id=177610
2156
2157         Reviewed by Darin Adler.
2158
2159         * rendering/RenderMenuList.cpp:
2160         (RenderMenuList::didUpdateActiveOption):
2161
2162 2017-10-02  Daniel Bates  <dabates@apple.com>
2163
2164         Remove length argument from TextPainter::paint()
2165         https://bugs.webkit.org/show_bug.cgi?id=177758
2166
2167         Reviewed by Alex Christensen.
2168
2169         Have TextPainter.paint() use the length of the specified TextRun as opposed to
2170         taking an explicit argument for the length of the TextRun.
2171
2172         Following r222670 InlineTextBox creates a TextRun with respect to the truncated
2173         line. Prior to r222670 InlineTextBox did not do this and hence it had to pass both
2174         the TextRun and truncated length to TextPainter.paint() to have the line painted.
2175         Code that needs to paint a substring of a TextRun can still do so by using TextPainter.paintRange().
2176
2177         No functionality changed. So, no new tests.
2178
2179         * rendering/InlineTextBox.cpp:
2180         (WebCore::InlineTextBox::paint):
2181         * rendering/SimpleLineLayoutFunctions.cpp:
2182         (WebCore::SimpleLineLayout::paintFlow):
2183         * rendering/TextPainter.cpp:
2184         (WebCore::TextPainter::paint):
2185         * rendering/TextPainter.h:
2186
2187 2017-10-02  Fujii Hironori  <Hironori.Fujii@sony.com>
2188
2189         [curl] Crashes in CurlRequest::setupPUT()
2190         https://bugs.webkit.org/show_bug.cgi?id=177733
2191
2192         Reviewed by Alex Christensen.
2193
2194         Tests: http/tests/xmlhttprequest/xmlhttprequest-open-method-allowed.html
2195
2196         * platform/network/curl/CurlRequest.cpp:
2197         (WebCore::CurlRequest::setupPUT): Null-check the result of request.httpBody().
2198
2199 2017-10-02  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2200
2201         [CURL] Should handle redirects in WebCore
2202         https://bugs.webkit.org/show_bug.cgi?id=21242
2203
2204         Reviewed by Alex Christensen.
2205
2206         * platform/network/ResourceHandle.cpp:
2207         * platform/network/curl/CurlContext.cpp:
2208         (WebCore::CurlHandle::enableAutoReferer): Deleted.
2209         * platform/network/curl/CurlContext.h:
2210         * platform/network/curl/CurlRequest.cpp:
2211         (WebCore::CurlRequest::setupTransfer):
2212         (WebCore::CurlRequest::didReceiveHeader):
2213         (WebCore::CurlRequest::didReceiveData):
2214         * platform/network/curl/ResourceHandleCurl.cpp:
2215         (WebCore::ResourceHandle::start):
2216         (WebCore::ResourceHandle::continueDidReceiveResponse):
2217         (WebCore::ResourceHandle::continueWillSendRequest):
2218         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2219         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
2220         (WebCore::ResourceHandleCurlDelegate::shouldRedirectAsGET):
2221         (WebCore::ResourceHandleCurlDelegate::willSendRequest):
2222         (WebCore::ResourceHandleCurlDelegate::continueWillSendRequest):
2223         (WebCore::ResourceHandleCurlDelegate::continueAfterWillSendRequest):
2224         * platform/network/curl/ResourceHandleCurlDelegate.h:
2225         * platform/network/curl/ResourceResponse.h:
2226         * platform/network/curl/ResourceResponseCurl.cpp:
2227         (WebCore::ResourceResponse::shouldRedirect):
2228         (WebCore::ResourceResponse::isMovedPermanently const):
2229         (WebCore::ResourceResponse::isFound const):
2230         (WebCore::ResourceResponse::isSeeOther const):
2231         (WebCore::ResourceResponse::isRedirection const): Deleted.
2232
2233 2017-10-02  Antti Koivisto  <antti@apple.com>
2234
2235         Crashes with guard malloc under RenderFullScreen::unwrapRenderer
2236         https://bugs.webkit.org/show_bug.cgi?id=177760
2237
2238         Unreviewed.
2239
2240         * rendering/RenderFullScreen.cpp:
2241         (WebCore::RenderFullScreen::unwrapRenderer):
2242
2243         The assert accesses 'this' after it has been deleted. It is not very valuable so remove the assert.
2244
2245 2017-10-02  Zan Dobersek  <zdobersek@igalia.com>
2246
2247         GraphicsContext: remove unused ENABLE(3D_TRANSFORMS) && USE(TEXTURE_MAPPER)
2248         https://bugs.webkit.org/show_bug.cgi?id=177757
2249
2250         Reviewed by Michael Catanzaro.
2251
2252         Remove three methods from the GraphicsContext class that were conditioned
2253         with the ENABLE(3D_TRANSFORMS) and USE(TEXTURE_MAPPER) guards. These aren't
2254         used anywhere at this point, but apparently used to be in the TextureMapper
2255         implementation.
2256
2257         * platform/graphics/GraphicsContext.h:
2258         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2259         (WebCore::GraphicsContext::get3DTransform const): Deleted.
2260         (WebCore::GraphicsContext::concat3DTransform): Deleted.
2261         (WebCore::GraphicsContext::set3DTransform): Deleted.
2262
2263 2017-10-02  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2264
2265         [GLib] NetworkStateNotifier implementation missing
2266         https://bugs.webkit.org/show_bug.cgi?id=177741
2267
2268         Reviewed by Carlos Garcia Campos.
2269
2270         No new tests. The DOM support is already being tested, but we would need a way
2271         of simulating a network outage to test GNetworkMonitor.
2272
2273         * PlatformGTK.cmake: add new file.
2274         * PlatformWPE.cmake: add new file.
2275         * platform/network/NetworkStateNotifier.cpp: no longer need the empty implementations, all platforms covered.
2276         * platform/network/NetworkStateNotifier.h:
2277         * platform/network/glib/NetworkStateNotifierGLib.cpp: Added.
2278         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying): update the network state using GNetworkMonitor's availability.
2279         (WebCore::NetworkStateNotifier::networkChangedCallback): when network-changed is emitted, trigger a state update.
2280         (WebCore::NetworkStateNotifier::startObserving): watch GNetworkMonitor's network-changed signal.
2281
2282 2017-10-02  Olivier Blin  <olivier.blin@softathome.com>
2283
2284         Fix build with MathML disabled
2285         https://bugs.webkit.org/show_bug.cgi?id=177744
2286
2287         Reviewed by Michael Catanzaro.
2288
2289         These are regressions from r217549 (StyleResolver) and r221379 (RenderBlockFlow), which do not guard MathML usage.
2290
2291         * css/StyleResolver.cpp:
2292         (WebCore::hasEffectiveDisplayNoneForDisplayContents):
2293         * rendering/RenderBlockFlow.cpp:
2294         (WebCore::RenderBlockFlow::willCreateColumns const):
2295
2296 2017-10-02  Yusuke Suzuki  <utatane.tea@gmail.com>
2297
2298         Use ThreadIdentifier instead of thread::this_thread::get_id
2299         https://bugs.webkit.org/show_bug.cgi?id=177729
2300
2301         Reviewed by Sam Weinig.
2302
2303         We can use WTF::ThreadIdentifier instead of thread::this_thread::get_id
2304         to make use of ThreadIdentifier consistent in WebKit. In the other places,
2305         we use ThreadIdentifier for this debugging purpose. And this is the only
2306         place using thread::this_thread::get_id for the exact same purpose.
2307         Furthermore, thread::this_thread::get_id in Windows platform. So we prefer
2308         using ThreadIdentifier than thread::this_thread::get_id.
2309
2310         * Modules/webdatabase/DatabaseDetails.h:
2311         (WebCore::DatabaseDetails::DatabaseDetails):
2312         (WebCore::DatabaseDetails::threadID const):
2313         * Modules/webdatabase/DatabaseManager.cpp:
2314         (WebCore::DatabaseManager::detailsForNameAndOrigin):
2315
2316 2017-10-02  Antti Koivisto  <antti@apple.com>
2317
2318         Fix memory leaks in RenderMultiColumnFlow
2319         https://bugs.webkit.org/show_bug.cgi?id=177735
2320
2321         Reviewed by Zalan Bujtas.
2322
2323         * rendering/RenderMultiColumnFlow.cpp:
2324         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
2325
2326             Switch from destroy() to removeFromParentAndDestroy() (they are currently equivalent in practice).
2327
2328         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
2329
2330             Destroy the placeholders instead of leaking them.
2331
2332         (WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
2333
2334             Destroy the placeholder instead of leaking it.
2335
2336 2017-10-02  Charles Turner  <cturner@igalia.com>
2337
2338         Try to play AVC codec even if H.264 decoder only advertises byte-stream profile.
2339         https://bugs.webkit.org/show_bug.cgi?id=177550
2340
2341         GStreamer's element factory filters will claim they can't play videos with AVC
2342         codec strings, but the elements really are capable of playing them when filters
2343         like videoconvert are inserted by playbin. Videos of this variety are in the YouTube
2344         2018 EME conformance tests.
2345
2346         Also replace std::array with a stack array, this saves having to count
2347         the number of elements (the compiler does that now) and reduces braces.
2348
2349         Reviewed by Carlos Alberto Lopez Perez.
2350
2351         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2352         (WebCore::codecSet):
2353
2354 2017-10-02  Tomas Popela  <tpopela@redhat.com>
2355
2356         [SOUP] Default kerberos authentication credentials are used in ephemeral (private) mode
2357         https://bugs.webkit.org/show_bug.cgi?id=177738
2358
2359         Reviewed by Carlos Garcia Campos.
2360
2361         If the session is ephemeral then don't enable the Negotiate support in
2362         our SoupSession.
2363
2364         * platform/network/soup/NetworkStorageSessionSoup.cpp: Pass the
2365         session ID if it's known to the SoupNetworkSession.
2366         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
2367         (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const):
2368         * platform/network/soup/SoupNetworkSession.cpp:
2369         (WebCore::SoupNetworkSession::SoupNetworkSession): If the session is
2370         ephemeral (based on given session ID) then don't activate the
2371         Negotiate support in SoupSession.
2372         * platform/network/soup/SoupNetworkSession.h:
2373         Change the constructor to accept the PAL::SessionID with the default
2374         value set to PAL::SessionID::emptySessionID.
2375
2376 2017-10-02  Joanmarie Diggs  <jdiggs@igalia.com>
2377
2378         REGRESSION(r222640) [GTK] Build broken with ATK 2.14
2379         https://bugs.webkit.org/show_bug.cgi?id=177634
2380
2381         Reviewed by Michael Catanzaro.
2382
2383         Use ATK_CHECK_VERSION to prevent the build failure.
2384
2385         No new tests. This fixes a downstream build failure.
2386
2387         * accessibility/atk/AXObjectCacheAtk.cpp:
2388         (WebCore::AXObjectCache::postPlatformNotification):
2389
2390 2017-10-01  Ryosuke Niwa  <rniwa@webkit.org>
2391
2392         Pasteboard shouldn't add "Files" as a type
2393         https://bugs.webkit.org/show_bug.cgi?id=177731
2394
2395         Reviewed by Wenson Hsieh.
2396
2397         Removed the platform specific code to add "Files" when there is a file present in platform's pasteboard.
2398         DataTransfer::types now adds "Files" automatically when Pasteboard::containsFiles returns true.
2399
2400         No new tests since there should be no behavioral change.
2401
2402         * dom/DataTransfer.cpp:
2403         (WebCore::DataTransfer::types const):
2404         * platform/gtk/PasteboardGtk.cpp:
2405         (WebCore::Pasteboard::typesForLegacyUnsafeBindings):
2406         * platform/ios/PasteboardIOS.mm:
2407         (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
2408         * platform/mac/PasteboardMac.mm:
2409         (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
2410         * platform/win/PasteboardWin.cpp:
2411         (WebCore::addMimeTypesForFormat): Removed the code to add "Text" and "URL" as separate types since
2412         this is not what the rest of ports do, and this type normalization is now taken care of by DataTransfer
2413         since r221063.
2414
2415 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
2416
2417         Another attempt to fix Windows build after r222697.
2418
2419         * editing/FrameSelection.cpp:
2420         (WebCore::FrameSelection::updateAppearance):
2421         * platform/DragImage.cpp:
2422         (WebCore::createDragImageForRange):
2423         * rendering/SelectionRangeData.cpp:
2424         (WebCore::SelectionRangeData::clear):
2425         * rendering/SelectionRangeData.h:
2426         (WebCore::SelectionRangeData::Context::Context):
2427
2428 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
2429
2430         Windows build fix attempt after r222697.
2431
2432         * platform/DragImage.cpp:
2433         (WebCore::createDragImageForRange):
2434
2435 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
2436
2437         Merge readFilenames() and read(PasteboardFileReader)
2438         https://bugs.webkit.org/show_bug.cgi?id=177728
2439         <rdar://problem/34761725>
2440
2441         Reviewed by Sam Weinig.
2442
2443         Generalized PasteboardFileReader to return multiple files instead of just one file, and replaced the use
2444         of Pasteboard::readFilenames() with it. Because eliminates the need for finding the list of types to read
2445         as files in addition to file names, this patch also removes Pasteboard::typesTreatedAsFiles().
2446
2447         Note that Pasteboard::readFilenames() continues to exist in macOS and iOS as it's internally used by
2448         Pasteboard::read(PasteboardFileReader) in PasteboardCocoa.mm.
2449
2450         No new tests since there should be no behavioral change.
2451
2452         * dom/DataTransfer.cpp:
2453         (WebCore::DataTransfer::files const): Now makes a single call to Pasteboard::read(PasteboardFileReader)
2454         instead of reading filenames and then falling back to it. Also got rid of if-def for drag drop checks
2455         since forDrag() and forFileDrag() are always defined since r222688.
2456         (WebCore::PasteboardFileTypeReader): Added. Gets the list of all file types.
2457         (WebCore::PasteboardFileTypeReader::readFilename): Added. Gets the list of all file types.
2458         (WebCore::PasteboardFileTypeReader::readBuffer): Added. Gets the list of all file types.
2459         (WebCore::DataTransfer::hasFileOfType): Reimplemented using PasteboardFileTypeReader.
2460         * editing/WebCorePasteboardFileReader.cpp:
2461         (WebCore::WebCorePasteboardFileReader::readFilename): Added.
2462         (WebCore::WebCorePasteboardFileReader::readBuffer): Renamed from read.
2463         * editing/WebCorePasteboardFileReader.h:
2464         * platform/Pasteboard.h:
2465         (WebCore::PasteboardFileReader): Removed the constructor since we no longer specify a specific type to
2466         read off of pasteboard, and renamed the existing read function to readBuffer, and added a new variant
2467         which takes a filename.
2468         * platform/StaticPasteboard.h:
2469         * platform/cocoa/PasteboardCocoa.mm:
2470         (WebCore::imageTypeToFakeFilename): Return "image/png" for ImageType::TIFF (to do TIFF-to-PNG conversion;
2471         see r222656 for why this is needed) now that this function is used to convert directly from image type
2472         converted from cocoa type instead of the one reverse-converted from MIME type.
2473         (WebCore::mimeTypeToImageType): Deleted.
2474         (WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
2475         (WebCore::Pasteboard::typesForLegacyUnsafeBindings): Use newly added readTypesWithSecurityCheck.
2476         (WebCore::convertTIFFToPNG): Extracted out of read(PasteboardFileReader).
2477         (WebCore::Pasteboard::read): Generalized to add filenames as well as image buffers as files. Because now
2478         we're concerting Cocoa types to ImageType, we no longer have to detect when TIFF-as-PNG conversion is
2479         happening here. We just treat ImageType::TIFF as PNG and do the conversion.
2480         (WebCore::Pasteboard::readStringInCustomData): Use newly added readBufferForTypeWithSecurityCheck.
2481         (WebCore::Pasteboard::readTypesWithSecurityCheck): Added.
2482         (WebCore::Pasteboard::readBufferForTypeWithSecurityCheck): Added.
2483         * platform/gtk/PasteboardGtk.cpp:
2484         (WebCore::Pasteboard::read): Implemented.
2485         (WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
2486         (WebCore::Pasteboard::containsFiles): Implemented without calling readFilenames, which has been deleted.
2487         (WebCore::Pasteboard::readFilenames): Deleted.
2488         * platform/win/PasteboardWin.cpp:
2489         (WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
2490         (WebCore::PasteboardFileCounter): Added. Used to counts the number of files in the pasteboard.
2491         (WebCore::PasteboardFileCounter::readFilename):
2492         (WebCore::PasteboardFileCounter::readBuffer):
2493         (WebCore::Pasteboard::containsFiles):
2494         (WebCore::Pasteboard::read): Moved the code to extract filenames out of readFilenames.
2495         (WebCore::Pasteboard::readFilenames): Deleted.
2496         * platform/wpe/PasteboardWPE.cpp:
2497         (WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
2498         (WebCore::Pasteboard::readFilenames): Deleted.
2499
2500 2017-10-01  Sam Weinig  <sam@webkit.org>
2501
2502         [Settings] Move remaining simple settings to Settings.in
2503         https://bugs.webkit.org/show_bug.cgi?id=177730
2504
2505         Reviewed by Darin Adler.
2506
2507         - Adds new option type for Settings.in, 'getter', which allows you to specify
2508           a custom name for the setting's getter. For instance, the setting javaEnabled
2509           has a custom getter name, 'isJavaEnabled'.
2510         - Adds support for WTF::Seconds as a type of setting. Used by only 
2511           timeWithoutMouseMovementBeforeHidingControls at the moment.
2512         - Moves non-generated settings from Settings.h/cpp that don't require custom
2513           action when set, to Settings.in
2514
2515         * Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py:
2516         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
2517         * Scripts/GenerateSettings/Settings.py:
2518
2519             Add support for 'getter' and the Seconds type.
2520
2521         * WebCore.xcodeproj/project.pbxproj:
2522         * platform/text/FontRenderingMode.h: Copied from Source/WebCore/platform/text/TextFlags.h.
2523         * platform/text/TextFlags.h:
2524         
2525             Add FontRenderingMode.h. Moved out of TextFlags.h to be accessible by
2526             the settings generator.
2527         
2528         * page/Settings.cpp:
2529         (WebCore::Settings::Settings):
2530         (WebCore::Settings::setJavaEnabled): Deleted.
2531         (WebCore::Settings::setJavaEnabledForLocalFiles): Deleted.
2532         (WebCore::Settings::setPreferMIMETypeForImages): Deleted.
2533         (WebCore::Settings::setForcePendingWebGLPolicy): Deleted.
2534         (WebCore::Settings::setNeedsAdobeFrameReloadingQuirk): Deleted.
2535         (WebCore::Settings::setFontRenderingMode): Deleted.
2536         (WebCore::Settings::fontRenderingMode const): Deleted.
2537         (WebCore::Settings::setShowTiledScrollingIndicator): Deleted.
2538         (WebCore::Settings::setFontFallbackPrefersPictographs): Deleted.
2539         (WebCore::Settings::setWebFontsAlwaysFallBack): Deleted.
2540         * page/Settings.h:
2541         (WebCore::Settings::isJavaEnabled const): Deleted.
2542         (WebCore::Settings::isJavaEnabledForLocalFiles const): Deleted.
2543         (WebCore::Settings::preferMIMETypeForImages const): Deleted.
2544         (WebCore::Settings::needsAcrobatFrameReloadingQuirk const): Deleted.
2545         (WebCore::Settings::showTiledScrollingIndicator const): Deleted.
2546         (WebCore::Settings::setTouchEventEmulationEnabled): Deleted.
2547         (WebCore::Settings::isTouchEventEmulationEnabled const): Deleted.
2548         (WebCore::Settings::setTimeWithoutMouseMovementBeforeHidingControls): Deleted.
2549         (WebCore::Settings::timeWithoutMouseMovementBeforeHidingControls const): Deleted.
2550         (WebCore::Settings::fontFallbackPrefersPictographs const): Deleted.
2551         (WebCore::Settings::webFontsAlwaysFallBack const): Deleted.
2552         (WebCore::Settings::setMediaKeysStorageDirectory): Deleted.
2553         (WebCore::Settings::mediaKeysStorageDirectory const): Deleted.
2554         (WebCore::Settings::setMediaDeviceIdentifierStorageDirectory): Deleted.
2555         (WebCore::Settings::mediaDeviceIdentifierStorageDirectory const): Deleted.
2556         (WebCore::Settings::applePayEnabled const): Deleted.
2557         (WebCore::Settings::setApplePayEnabled): Deleted.
2558         (WebCore::Settings::applePayCapabilityDisclosureAllowed const): Deleted.
2559         (WebCore::Settings::setApplePayCapabilityDisclosureAllowed): Deleted.
2560         (WebCore::Settings::isForcePendingWebGLPolicy const): Deleted.
2561         * page/Settings.in:
2562
2563             Moved hand-written settings to be Settings.in based.
2564
2565 2017-10-01  Zalan Bujtas  <zalan@apple.com>
2566
2567         RenderView does not need to be a SelectionSubtreeRoot
2568         https://bugs.webkit.org/show_bug.cgi?id=177713
2569
2570         Reviewed by Darin Adler and Antti Koivisto.
2571
2572         1. SelectionSubtreeRoot -> SelectionRangeData 
2573         2. Move all selection logic from RenderView to SelectionRangeData
2574         3. class RenderView : public SelectionSubtreeRoot -> SelectionRangeData m_selection;
2575         4. Remove redundant code
2576         5. General modernization
2577  
2578         No change in functionality.
2579
2580         * editing/FrameSelection.cpp:
2581         (WebCore::FrameSelection::setNeedsSelectionUpdate):
2582         (WebCore::DragCaretController::nodeWillBeRemoved):
2583         (WebCore::FrameSelection::respondToNodeModification):
2584         (WebCore::FrameSelection::prepareForDestruction):
2585         (WebCore::FrameSelection::focusedOrActiveStateChanged):
2586         (WebCore::FrameSelection::updateAppearance):
2587         (WebCore::FrameSelection::selectionBounds const):
2588         * page/FrameView.cpp:
2589         (WebCore::FrameView::paintContentsForSnapshot):
2590         * platform/DragImage.cpp:
2591         (WebCore::ScopedFrameSelectionState::ScopedFrameSelectionState):
2592         (WebCore::ScopedFrameSelectionState::~ScopedFrameSelectionState):
2593         (WebCore::createDragImageForRange):
2594         * rendering/InlineTextBox.cpp:
2595         (WebCore::InlineTextBox::selectionState):
2596         (WebCore::InlineTextBox::selectionStartEnd const):
2597         * rendering/RenderBlock.cpp:
2598         (WebCore::RenderBlock::isSelectionRoot const):
2599         * rendering/RenderObject.cpp:
2600         (WebCore::RenderObject::isSelectionBorder const):
2601         * rendering/RenderObject.h:
2602         * rendering/RenderReplaced.cpp:
2603         (WebCore::RenderReplaced::isSelected const):
2604         * rendering/RenderText.cpp:
2605         (WebCore::RenderText::collectSelectionRectsForLineBoxes):
2606         * rendering/RenderTextLineBoxes.cpp:
2607         (WebCore::RenderTextLineBoxes::setSelectionState):
2608         * rendering/RenderView.cpp:
2609         (WebCore::RenderView::RenderView):
2610         (WebCore::SelectionIterator::SelectionIterator): Deleted.
2611         (WebCore::SelectionIterator::current const): Deleted.
2612         (WebCore::SelectionIterator::next): Deleted.
2613         (WebCore::SelectionIterator::checkForSpanner): Deleted.
2614         (WebCore::rendererAfterPosition): Deleted.
2615         (WebCore::RenderView::selectionBounds const): Deleted.
2616         (WebCore::RenderView::subtreeSelectionBounds const): Deleted.
2617         (WebCore::RenderView::repaintSelection const): Deleted.
2618         (WebCore::RenderView::repaintSubtreeSelection const): Deleted.
2619         (WebCore::RenderView::setSelection): Deleted.
2620         (WebCore::isValidObjectForNewSelection): Deleted.
2621         (WebCore::RenderView::clearSubtreeSelection const): Deleted.
2622         (WebCore::RenderView::applySubtreeSelection): Deleted.
2623         (WebCore::RenderView::getSelection const): Deleted.
2624         (WebCore::RenderView::clearSelection): Deleted.
2625         * rendering/RenderView.h:
2626         * rendering/SelectionSubtreeRoot.cpp:
2627         (WebCore::rendererAfterPosition):
2628         (WebCore::SelectionIterator::SelectionIterator):
2629         (WebCore::SelectionIterator::current const):
2630         (WebCore::SelectionIterator::next):
2631         (WebCore::SelectionIterator::checkForSpanner):
2632         (WebCore::SelectionRangeData::SelectionRangeData):
2633         (WebCore::SelectionRangeData::set):
2634         (WebCore::SelectionRangeData::clear):
2635         (WebCore::SelectionRangeData::repaint const):
2636         (WebCore::SelectionRangeData::bounds const):
2637         (WebCore::SelectionRangeData::collectAndClear const):
2638         (WebCore::SelectionRangeData::apply):
2639         (WebCore::SelectionRangeData::isValidRendererForNewSelection const):
2640         (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot): Deleted.
2641         * rendering/SelectionSubtreeRoot.h:
2642         (WebCore::SelectionRangeData::Context::operator== const):
2643         (WebCore::SelectionRangeData::get const):
2644         (WebCore::SelectionRangeData::start const):
2645         (WebCore::SelectionRangeData::end const):
2646         (WebCore::SelectionRangeData::startPosition const):
2647         (WebCore::SelectionRangeData::endPosition const):
2648         (WebCore::SelectionSubtreeRoot::OldSelectionData::OldSelectionData): Deleted.
2649         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData): Deleted.
2650         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStart const): Deleted.
2651         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartPos const): Deleted.
2652         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEnd const): Deleted.
2653         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos const): Deleted.
2654         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartEndPositions const): Deleted.
2655         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::clearSelection): Deleted.
2656         (WebCore::SelectionSubtreeRoot::selectionData): Deleted.
2657         (WebCore::SelectionSubtreeRoot::selectionData const): Deleted.
2658         (WebCore::SelectionSubtreeRoot::setSelectionData): Deleted.
2659
2660 2017-10-01  Sam Weinig  <sam@webkit.org>
2661
2662         [Settings] Enums should not be passed by const reference
2663         https://bugs.webkit.org/show_bug.cgi?id=177727
2664
2665         Reviewed by Darin Adler.
2666
2667         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
2668         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
2669         (printGetterAndSetter):
2670         
2671             Use the new typeIsAggregate predicate to determine whether to
2672             use const reference or not.
2673         
2674         (includeForSetting): Deleted.
2675
2676             Move includeForSetting to Settings.py with the rest of the Setting
2677             helpers.
2678
2679         * Scripts/GenerateSettings/Settings.py:
2680         (mapToIDLType):
2681         (typeIsPrimitive):
2682         (typeIsAggregate):
2683         
2684             Add predicate to determine if a setting's type is an aggregate (struct or class)
2685             or a primitive. Remove references to size_t, which is not used.
2686
2687 2017-10-01  Sam Weinig  <sam@webkit.org>
2688
2689         Add support for DOM aborting (https://dom.spec.whatwg.org/#aborting-ongoing-activities)
2690         https://bugs.webkit.org/show_bug.cgi?id=177718
2691
2692         Reviewed by Darin Adler.
2693
2694         Adds standalone support for AbortController and AbortSignal. No integration
2695         with other specs yet.
2696
2697         * CMakeLists.txt:
2698         * DerivedSources.make:
2699         * WebCore.xcodeproj/project.pbxproj:
2700         
2701             Add new files.
2702         
2703         * dom/AbortController.cpp: Added.
2704         * dom/AbortController.h: Added.
2705         * dom/AbortController.idl: Added.
2706         * dom/AbortSignal.cpp: Added.
2707         * dom/AbortSignal.h: Added.
2708         * dom/AbortSignal.idl: Added.
2709         
2710             Add basic support AbortController and AbortSignal.
2711         
2712         * dom/EventTargetFactory.in:
2713         
2714             Add AbortSignal to the list of EventTargets.
2715
2716 2017-10-01  Antti Koivisto  <antti@apple.com>
2717
2718         Use WeakPtr for first-letter memory management
2719         https://bugs.webkit.org/show_bug.cgi?id=177716
2720
2721         Reviewed by Darin Adler.
2722
2723         * rendering/RenderElement.cpp:
2724         (WebCore::RenderElement::destroyLeftoverChildren):
2725
2726             Remove first-letter special case.
2727             Use removeAndDestroyChild instead of calling destroy() directly. The latter should
2728             eventually stop calling takeChild and assert that the renderer is not in the tree.
2729
2730         * rendering/RenderTextFragment.cpp:
2731         (WebCore::RenderTextFragment::willBeDestroyed):
2732         (WebCore::RenderTextFragment::setText):
2733         * rendering/RenderTextFragment.h:
2734
2735             Use WeakPtr.
2736
2737 2017-10-01  Sam Weinig  <sam@webkit.org>
2738
2739         XMLHttpRequest's responseXML should be annotated with [Exposed=Window]
2740         https://bugs.webkit.org/show_bug.cgi?id=177714
2741
2742         Reviewed by Darin Adler.
2743
2744         Tests: imported/w3c/web-platform-tests/XMLHttpRequest/responseType-document-in-worker.html
2745                imported/w3c/web-platform-tests/XMLHttpRequest/responseXML-unavailable-in-worker.html
2746
2747         * xml/XMLHttpRequest.cpp:
2748         (WebCore::XMLHttpRequest::responseXML):
2749         
2750             Replace returning null for non-document contexts with an assertion now
2751             that the bindings layer ensures this doesn't get called.
2752         
2753         (WebCore::XMLHttpRequest::setResponseType):
2754         
2755             Match the spec and turn attempts to set a responseType of 'document' in
2756             non-documents contexts as a no-op.
2757         
2758         * xml/XMLHttpRequest.idl:
2759         
2760             Address FIXME and annotate responseXML with [Exposed=Window] now that it
2761             is supported.
2762
2763 2017-09-30  Ryosuke Niwa  <rniwa@webkit.org>
2764
2765         Don't reveal file URL when pasting an image
2766         https://bugs.webkit.org/show_bug.cgi?id=177710
2767         <rdar://problem/34757924>
2768
2769         Reviewed by Wenson Hsieh.
2770
2771         Fixed the bug by generalizing the code we had for drag & drop to hide string types when there is a file.
2772
2773         We don't hide string types when customPasteboardDataEnabled() is false to preserve the backwards compatiblity
2774         with apps that are relying on being able to read files URLs in the pasteboard.
2775
2776         Test: editing/pasteboard/paste-image-does-not-reveal-file-url.html
2777
2778         * dom/DataTransfer.cpp:
2779         (WebCore::DataTransfer::getData const): Pretend there is no string data when there is a file in the pasteboard
2780         custom pasteboard data is enabled.
2781         (WebCore::DataTransfer::setData): Ditto.
2782         (WebCore::DataTransfer::types const): Ditto.
2783         * dom/DataTransfer.h:
2784         (WebCore::DataTransfer::forDrag const): Added for when drag & drop support is disabled at compilation time.
2785         (WebCore::DataTransfer::forFileDrag const): Ditto.
2786         * platform/Pasteboard.h:
2787         * platform/StaticPasteboard.h:
2788         * platform/cocoa/PasteboardCocoa.mm:
2789         (WebCore::Pasteboard::containsFiles): Added.
2790         * platform/gtk/PasteboardGtk.cpp:
2791         (WebCore::Pasteboard::containsFiles): Added.
2792         * platform/win/PasteboardWin.cpp:
2793         (WebCore::Pasteboard::containsFiles): Added.
2794         * platform/wpe/PasteboardWPE.cpp:
2795         (WebCore::Pasteboard::containsFiles): Added.
2796         (WebCore::Pasteboard::readFilenames): Annotated this function with notImplemented().
2797
2798 2017-09-30  Sam Weinig  <sam@webkit.org>
2799
2800         [Settings] Replace SettingsMacros.h with a generated base class for Settings
2801         https://bugs.webkit.org/show_bug.cgi?id=177681
2802
2803         Reviewed by Darin Adler.
2804
2805         - Adds a SettingsGenerated class that Settings inherits from. The new class
2806           has the members and getters/setters for all the generated bindings.
2807         - Some default values for settings are literals in Settings.in, but rather
2808           constants or functions defined externally. These have all been moved to
2809           SettingsDefaultValues.h to allow for the script to include them all for
2810           SettingsGenerated.
2811         - Previously, a few enums were declared in Settings.h for use by Settings.
2812           Now that SettingsGenerated needs access, we standarize the same way that
2813           exists for the IDL generator; expecting the enum to be in a header of the
2814           same name.
2815
2816         * CMakeLists.txt:
2817         * DerivedSources.make:
2818         * WebCore.xcodeproj/project.pbxproj:
2819         * WebCoreMacros.cmake:
2820
2821             Add new files / generation steps.
2822         
2823         * Scripts/GenerateSettings.py:
2824         * Scripts/GenerateSettings/GenerateSettings.py:
2825         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Added.
2826         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Added.
2827         * Scripts/GenerateSettings/GenerateSettingsMacrosHeader.py: Removed.
2828         * Scripts/GenerateSettings/Settings.py:
2829         
2830             Replace script to generate SettingsMacros.h with scripts to generate a SettingsGenerated.{h,cpp}.
2831         
2832         * accessibility/ForcedAccessibilityValue.h: Added.
2833         * editing/EditableLinkBehavior.h: Added.
2834         * editing/EditingBehavior.h:
2835         * editing/EditingBehaviorType.h: Copied from editing/EditingBehaviorTypes.h.
2836         * editing/EditingBehaviorTypes.h: Removed.
2837         * editing/cocoa/DataDetection.h:
2838         * editing/cocoa/DataDetectorTypes.h: Added.
2839         * page/DebugOverlayRegions.h: Added.
2840         * page/FrameFlattening.h: Added.
2841         * page/PDFImageCachingPolicy.h: Added.
2842         * page/TextDirectionSubmenuInclusionBehavior.h: Added.
2843         * page/UserInterfaceDirectionPolicy.h: Added.
2844         * platform/text/TextDirection.h: Added.
2845         * platform/text/WritingMode.h:
2846
2847             Split out enums from Settings.h
2848
2849         * css/MediaQueryEvaluator.cpp:
2850
2851             Update for new name of ForcedAccessibilityValue.
2852
2853         * html/parser/HTMLParserOptions.cpp:
2854
2855             Update for new name of defaultMaximumHTMLParserDOMTreeDepth.
2856
2857         * page/Settings.cpp:
2858         * page/Settings.h:
2859         
2860             - Move defaults to SettingsDefaultValues.h (and SettingsDefaultValuesCocoa.mm for defaultTextAutosizingEnabled).
2861             - Move enums to their own files.
2862             - Inherit from SettingsGenerated.h
2863         
2864         * page/Settings.in:
2865         
2866             - Use new 'include' option for javaScriptRuntimeFlags setting to include <runtime/RuntimeFlags.h>,
2867               as it doesn't fit the normal idiomatic model.
2868             - Replace call to defaultMinimumZoomFontSize() with direct constant access.
2869
2870         * page/SettingsDefaultValues.h: Added.
2871         * page/cocoa/SettingsDefaultValuesCocoa.mm: Added.
2872
2873             Move default values from Settings to this new file.
2874
2875         * page/cocoa/SettingsCocoa.mm:
2876         
2877             Move defaultTextAutosizingEnabled() out of here and into SettingsDefaultValuesCocoa.mm.
2878         
2879         * style/StyleTreeResolver.cpp:
2880
2881             - Update for new scoping of defaultMaximumRenderTreeDepth.
2882             - Move defaultMaximumRenderTreeDepth from Settings here. This is the only use.
2883
2884         * testing/InternalSettings.cpp:
2885         (WebCore::InternalSettings::forcedColorsAreInvertedAccessibilityValue const):
2886         (WebCore::InternalSettings::setForcedColorsAreInvertedAccessibilityValue):
2887         (WebCore::InternalSettings::forcedDisplayIsMonochromeAccessibilityValue const):
2888         (WebCore::InternalSettings::setForcedDisplayIsMonochromeAccessibilityValue):
2889         (WebCore::InternalSettings::forcedPrefersReducedMotionAccessibilityValue const):
2890         (WebCore::InternalSettings::setForcedPrefersReducedMotionAccessibilityValue):
2891         (WebCore::settingsToInternalSettingsValue): Deleted.
2892         (WebCore::internalSettingsToSettingsValue): Deleted.
2893         * testing/InternalSettings.h:
2894         
2895             Replace duplicate definition of ForcedAccessibilityValue with a using declaration
2896             and simplify code now that it doesn't need to map between the two enums.
2897
2898 2017-09-30  Wenson Hsieh  <wenson_hsieh@apple.com>
2899
2900         [iOS WK2] API test EditorStateTests.ContentViewHasTextInContentEditableElement is a flaky failure
2901         https://bugs.webkit.org/show_bug.cgi?id=177698
2902
2903         Reviewed by Ryosuke Niwa.
2904
2905         The WebKit2 API test EditorStateTests.ContentViewHasTextInContentEditableElement is currently hitting
2906         intermittent failures on test runners. After inserting just an image in the editable element, we would expect
2907         that -hasText should return NO because the text content is an empty string, but we find that -hasText is YES.
2908         This is because we're bailing on an early return in computeEditableRootHasContentAndPlainText because the
2909         EditorState's PostLayoutData contains non-zero characters near the selection, which is incorrect.
2910
2911         However, upon closer inspection, this is due to a latent bug in the charactersAroundPosition helper function.
2912         This function attempts to compute characters before and after the current selection by initializing a Vector
2913         of size 3 with the relevant character data, and then sets oneAfter, oneBefore and twoBefore to the UChar32
2914         values in the vector. However, in the case where there are less than three characters, we end up assigning
2915         the uninitialized values in the vector to one or more of oneAfter, oneBefore and twoBefore, which causes the
2916         helper added in r222654 to bail early when it should not.
2917
2918         To fix this, we initialize the values in `characters` to 0 (which is the initial value for the 3 corresponding
2919         members in the PostLayoutData struct). We also turn `characters` into a UChar32 array on the stack, to avoid the
2920         heap allocations using a Vector<UChar32>.
2921
2922         No new tests; fixes a flaky API test.
2923
2924         * editing/VisibleUnits.cpp:
2925         (WebCore::charactersAroundPosition):
2926
2927 2017-09-30  Antti Koivisto  <antti@apple.com>
2928
2929         Add makeWeakPtr for easier WeakPtr construction
2930         https://bugs.webkit.org/show_bug.cgi?id=177706
2931
2932         Reviewed by Sam Weinig.
2933
2934         Use it in render tree.
2935
2936         * loader/SubframeLoader.cpp:
2937         (WebCore::SubframeLoader::loadPlugin):
2938         * page/FrameView.cpp:
2939         (WebCore::FrameView::updateEmbeddedObject):
2940         * rendering/RenderMultiColumnFlow.cpp:
2941         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
2942         * rendering/RenderObject.h:
2943         (WebCore::RenderObject::weakFactory const):
2944         (WebCore::RenderObject::createWeakPtr): Deleted.
2945         * rendering/RenderView.cpp:
2946         (WebCore::RenderView::RepaintRegionAccumulator::RepaintRegionAccumulator):
2947         * rendering/RenderWidget.cpp:
2948         (WebCore::RenderWidget::setWidgetGeometry):
2949         (WebCore::RenderWidget::setWidget):
2950         (WebCore::RenderWidget::updateWidgetPosition):
2951
2952 2017-09-30  Ryosuke Niwa  <rniwa@webkit.org>
2953
2954         Share more pasteboard code between iOS and macOS and remove dependency on Settings
2955         https://bugs.webkit.org/show_bug.cgi?id=177700
2956
2957         Reviewed by Wenson Hsieh.
2958
2959         Moved more code from PasteboardIOS.mm and PasteboardMac.mm into PasteboardCocoa.mm to share code.
2960
2961         This patch also removes the layering violation inadvertently introduced in r222595 whereby which
2962         Pasteboard code depends on Settings. To do this, this patch splits readStringForBindings is into
2963         readString and readStringInCustomData and typesForBindings into typesSafeForBindings and
2964         typesForLegacyUnsafeBindings, and moves the logic to decide whether a given type or string is read
2965         off of the native pasteboard entry or our custom data entry is moved to DataTransfer.
2966
2967         No new tests since there should be no behavioral change.
2968
2969         * dom/DataTransfer.cpp:
2970         (WebCore::DataTransfer::getData const): Moved the code to decide whether string is
2971         read off of custom data or native pasteboard from readStringForBindings.
2972         (WebCore::DataTransfer::types const): Ditto from typesForBindings.
2973         * platform/Pasteboard.cpp:
2974         (WebCore::Pasteboard::isSafeTypeForDOMToReadAndWrite): Moved into Pasteboard.
2975         * platform/Pasteboard.h:
2976         * platform/StaticPasteboard.cpp:
2977         (WebCore::StaticPasteboard::readString): Renamed from readStringForBindings.
2978         (WebCore::StaticPasteboard::readStringInCustomData): Added.
2979         (WebCore::StaticPasteboard::writeString):
2980         * platform/StaticPasteboard.h:
2981         * platform/cocoa/PasteboardCocoa.mm:
2982         (WebCore::Pasteboard::typesSafeForBindings): Extracted out of typesForBindings in PasteboardIOS.mm
2983         and PasteboardMac.mm.
2984         (WebCore::Pasteboard::typesForLegacyUnsafeBindings): Ditto.
2985         (WebCore::Pasteboard::readString): Ditto.
2986         (WebCore::Pasteboard::readStringInCustomData): Ditto.
2987         (WebCore::Pasteboard::writeCustomData): Moved here from PasteboardIOS.mm and PasteboardCocoa.mm.
2988         (WebCore::Pasteboard::changeCount const): Ditto.
2989         * platform/gtk/PasteboardGtk.cpp:
2990         (WebCore::Pasteboard::typesSafeForBindings): Added.
2991         (WebCore::Pasteboard::typesForLegacyUnsafeBindings): Renamed from readStringForBindings.
2992         (WebCore::Pasteboard::readString):
2993         (WebCore::Pasteboard::readStringInCustomData): Added.
2994         * platform/ios/PasteboardIOS.mm:
2995         (WebCore::Pasteboard::writeCustomData): Moved to PasteboardCocoa.mm.
2996         (WebCore::Pasteboard::changeCount const): Ditto.
2997         (WebCore::Pasteboard::readPlatformValueAsString): Moved into Pasteboard.
2998         (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType): Ditto.
2999         (WebCore::Pasteboard::readStringForBindings): Moved to PasteboardCocoa.mm.
3000         (WebCore::Pasteboard::typesForBindings): Ditto.
3001         * platform/ios/PlatformPasteboardIOS.mm:
3002         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
3003         * platform/mac/PasteboardMac.mm:
3004         (WebCore::Pasteboard::changeCount const): Moved to PasteboardCocoa.mm.
3005         (WebCore::Pasteboard::writeCustomData): Ditto.
3006         (WebCore::Pasteboard::readPlatformValueAsString): Moved into Pasteboard.
3007         (WebCore::Pasteboard::readStringForBindings): Moved to PasteboardCocoa.mm.
3008         (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType): Moved into Pasteboard.
3009         (WebCore::Pasteboard::typesForBindings): Moved to PasteboardCocoa.mm.
3010         * platform/mac/PlatformPasteboardMac.mm:
3011         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
3012         * platform/win/PasteboardWin.cpp:
3013         (WebCore::Pasteboard::typesSafeForBindings): Added.
3014         (WebCore::Pasteboard::typesForLegacyUnsafeBindings): Renamed from readStringForBindings.
3015         (WebCore::Pasteboard::readString): Renamed from readStringForBindings.
3016         (WebCore::Pasteboard::readStringInCustomData): Added.
3017         * platform/wpe/PasteboardWPE.cpp:
3018         (WebCore::Pasteboard::typesSafeForBindings): Added.
3019         (WebCore::PasteboardtypesForLegacyUnsafeBindings): Renamed from readStringForBindings.
3020         (WebCore::Pasteboard::readString): Renamed from readStringForBindings.
3021         (WebCore::Pasteboard::readStringInCustomData): Added.
3022
3023 2017-09-29  Antti Koivisto  <antti@apple.com>
3024
3025         Use smart pointers for creating, adding and removing renderers
3026         https://bugs.webkit.org/show_bug.cgi?id=177603
3027
3028         Reviewed by Zalan Bujtas.
3029
3030         With this patch RenderObject ownership is consistently managed using RenderPtrs. It also
3031         clarifies that in-tree renderers are always owned by the parent renderer.
3032
3033         - renderers are constructed with createRenderer<> which returns RenderPtr
3034         - addChild and related functions take RenderPtrs
3035         - removeChild is replaced with takeChild that returns a RenderPtr
3036         - only addChildInternal/takeChildInternal deal with raw ownder renderer pointers.
3037
3038         There are still a few exception left, noted below, to be fixed later.
3039
3040         * dom/Document.cpp:
3041         (WebCore::Document::webkitWillEnterFullScreenForElement):
3042         * rendering/RenderBlock.cpp:
3043         (WebCore::RenderBlock::addChildToContinuation):
3044         (WebCore::RenderBlock::addChild):
3045         (WebCore::RenderBlock::addChildIgnoringContinuation):
3046         (WebCore::RenderBlock::makeChildrenNonInline):
3047         (WebCore::RenderBlock::dropAnonymousBoxChild):
3048         (WebCore::RenderBlock::takeChild):
3049         (WebCore::RenderBlock::createAnonymousBlockWithStyleAndDisplay):
3050         (WebCore::RenderBlock::removeChild): Deleted.
3051         * rendering/RenderBlock.h:
3052         (WebCore::RenderBlock::createAnonymousWithParentRendererAndDisplay):
3053         (WebCore::RenderBlock::createAnonymousBoxWithSameTypeAs const):
3054         (WebCore::RenderBlock::createAnonymousBlock const):
3055         * rendering/RenderBlockFlow.cpp:
3056         (WebCore::RenderBlockFlow::addChild):
3057         (WebCore::RenderBlockFlow::takeChild):
3058         (WebCore::RenderBlockFlow::removeChild): Deleted.
3059         * rendering/RenderBlockFlow.h:
3060         * rendering/RenderBox.cpp:
3061         (WebCore::RenderBox::splitAnonymousBoxesAroundChild):
3062         * rendering/RenderBox.h:
3063         (WebCore::RenderBox::createAnonymousBoxWithSameTypeAs const):
3064         * rendering/RenderBoxModelObject.cpp:
3065         (WebCore::RenderBoxModelObject::moveChildTo):
3066         * rendering/RenderButton.cpp:
3067         (WebCore::RenderButton::addChild):
3068         (WebCore::RenderButton::takeChild):
3069         (WebCore::RenderButton::setText):
3070         (WebCore::RenderButton::removeChild): Deleted.
3071         * rendering/RenderButton.h:
3072         * rendering/RenderElement.cpp:
3073         (WebCore::RenderElement::addChild):
3074         (WebCore::RenderElement::takeChild):
3075         (WebCore::RenderElement::removeAndDestroyChild):
3076         (WebCore::RenderElement::destroyLeftoverChildren):
3077
3078             Keep the existing behavior and leak the firstLetter renderer. The comment claims they get destroyed by RenderTextFragment.
3079             To be cleaned up later.
3080
3081         (WebCore::RenderElement::insertChildInternal):
3082         (WebCore::RenderElement::takeChildInternal):
3083         (WebCore::RenderElement::handleDynamicFloatPositionChange):
3084         (WebCore::RenderElement::removeChild): Deleted.
3085         (WebCore::RenderElement::removeChildInternal): Deleted.
3086         * rendering/RenderElement.h:
3087         (WebCore::RenderElement::addChildIgnoringContinuation):
3088         * rendering/RenderFullScreen.cpp:
3089         (WebCore::RenderFullScreen::willBeDestroyed):
3090         (WebCore::RenderFullScreen::wrapNewRenderer):
3091         (WebCore::RenderFullScreen::wrapExistingRenderer):
3092
3093             Split wrapRenderer() into two functions, wrapNewRenderer() and wrapExistingRenderer().
3094             The first one deals with adding new renderers to the tree while the latter mutates
3095             existing render tree in-place.
3096
3097         (WebCore::RenderFullScreen::unwrapRenderer):
3098         (WebCore::RenderFullScreen::createPlaceholder):
3099         (WebCore::RenderFullScreen::wrapRenderer): Deleted.
3100         * rendering/RenderFullScreen.h:
3101         * rendering/RenderGrid.cpp:
3102         (WebCore::RenderGrid::addChild):
3103         (WebCore::RenderGrid::takeChild):
3104         (WebCore::RenderGrid::removeChild): Deleted.
3105         * rendering/RenderGrid.h:
3106         * rendering/RenderInline.cpp:
3107         (WebCore::RenderInline::addChild):
3108         (WebCore::RenderInline::addChildIgnoringContinuation):
3109         (WebCore::RenderInline::splitInlines):
3110         (WebCore::RenderInline::splitFlow):
3111         (WebCore::RenderInline::addChildToContinuation):
3112         (WebCore::RenderInline::childBecameNonInline):
3113         * rendering/RenderInline.h:
3114         * rendering/RenderMenuList.cpp:
3115         (WebCore::RenderMenuList::createInnerBlock):
3116         (RenderMenuList::addChild):
3117         (RenderMenuList::takeChild):
3118         (RenderMenuList::setText):
3119         (RenderMenuList::removeChild): Deleted.
3120         * rendering/RenderMenuList.h:
3121         * rendering/RenderMultiColumnFlow.cpp:
3122         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
3123         (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
3124         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
3125
3126             Keep the existing behavior and leak the placeholder renderer.
3127             To be cleaned up later.
3128
3129         (WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
3130
3131             Keep the existing behavior and leak the placeholder renderer.
3132             To be cleaned up later.
3133
3134         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
3135         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
3136         * rendering/RenderMultiColumnSpannerPlaceholder.h:
3137         * rendering/RenderObject.cpp:
3138         (WebCore::RenderObject::removeFromParentAndDestroy):
3139         (WebCore::RenderObject::willBeDestroyed):
3140         (WebCore::RenderObject::destroy):
3141         (WebCore::RenderObject::removeFromParent): Deleted.
3142         * rendering/RenderObject.h:
3143         * rendering/RenderQuote.cpp:
3144         (WebCore::RenderQuote::updateTextRenderer):
3145         * rendering/RenderRuby.cpp:
3146         (WebCore::createAnonymousRubyInlineBlock):
3147         (WebCore::RenderRubyAsInline::addChild):
3148         (WebCore::RenderRubyAsInline::takeChild):
3149         (WebCore::RenderRubyAsBlock::addChild):
3150         (WebCore::RenderRubyAsBlock::takeChild):
3151         (WebCore::RenderRubyAsInline::removeChild): Deleted.
3152         (WebCore::RenderRubyAsBlock::removeChild): Deleted.
3153         * rendering/RenderRuby.h:
3154         * rendering/RenderRubyBase.cpp:
3155         (WebCore::RenderRubyBase::moveInlineChildren):
3156         * rendering/RenderRubyRun.cpp:
3157         (WebCore::RenderRubyRun::rubyBaseSafe):
3158         (WebCore::RenderRubyRun::addChild):
3159         (WebCore::RenderRubyRun::takeChild):
3160         (WebCore::RenderRubyRun::createRubyBase const):
3161         (WebCore::RenderRubyRun::staticCreateRubyRun):
3162         (WebCore::RenderRubyRun::removeChild): Deleted.
3163         * rendering/RenderRubyRun.h:
3164         * rendering/RenderTable.cpp:
3165         (WebCore::RenderTable::addChild):
3166         (WebCore::RenderTable::createTableWithStyle):
3167         (WebCore::RenderTable::createAnonymousWithParentRenderer):
3168         * rendering/RenderTable.h:
3169         (WebCore::RenderTable::createAnonymousBoxWithSameTypeAs const):
3170         * rendering/RenderTableCell.cpp:
3171         (WebCore::RenderTableCell::createTableCellWithStyle):
3172         (WebCore::RenderTableCell::createAnonymousWithParentRenderer):
3173         * rendering/RenderTableCell.h:
3174         (WebCore::RenderTableCell::createAnonymousBoxWithSameTypeAs const):
3175         * rendering/RenderTableRow.cpp:
3176         (WebCore::RenderTableRow::addChild):
3177         (WebCore::RenderTableRow::createTableRowWithStyle):
3178         (WebCore::RenderTableRow::createAnonymousWithParentRenderer):
3179         * rendering/RenderTableRow.h:
3180         (WebCore::RenderTableRow::createAnonymousBoxWithSameTypeAs const):
3181         * rendering/RenderTableSection.cpp:
3182         (WebCore::RenderTableSection::addChild):
3183         (WebCore::RenderTableSection::createTableSectionWithStyle):
3184         (WebCore::RenderTableSection::createAnonymousWithParentRenderer):
3185         * rendering/RenderTableSection.h:
3186         (WebCore::RenderTableSection::createAnonymousBoxWithSameTypeAs const):
3187         * rendering/mathml/RenderMathMLFenced.cpp:
3188         (WebCore::RenderMathMLFenced::makeFences):
3189         (WebCore::RenderMathMLFenced::addChild):
3190         * rendering/mathml/RenderMathMLFenced.h:
3191         * rendering/svg/RenderSVGContainer.cpp:
3192         (WebCore::RenderSVGContainer::addChild):
3193         (WebCore::RenderSVGContainer::takeChild):
3194         (WebCore::RenderSVGContainer::removeChild): Deleted.
3195         * rendering/svg/RenderSVGContainer.h:
3196         * rendering/svg/RenderSVGInline.cpp:
3197         (WebCore::RenderSVGInline::addChild):
3198         (WebCore::RenderSVGInline::takeChild):
3199         (WebCore::RenderSVGInline::removeChild): Deleted.
3200         * rendering/svg/RenderSVGInline.h:
3201         * rendering/svg/RenderSVGRoot.cpp:
3202         (WebCore::RenderSVGRoot::addChild):
3203         (WebCore::RenderSVGRoot::takeChild):
3204         (WebCore::RenderSVGRoot::removeChild): Deleted.
3205         * rendering/svg/RenderSVGRoot.h:
3206         * rendering/svg/RenderSVGText.cpp:
3207         (WebCore::RenderSVGText::addChild):
3208         (WebCore::RenderSVGText::takeChild):
3209         (WebCore::RenderSVGText::removeChild): Deleted.
3210         * rendering/svg/RenderSVGText.h:
3211         * style/RenderTreePosition.h:
3212         (WebCore::RenderTreePosition::insert):
3213         * style/RenderTreeUpdater.cpp:
3214         (WebCore::RenderTreeUpdater::createRenderer):
3215         (WebCore::createTextRenderer):
3216         * style/RenderTreeUpdaterFirstLetter.cpp:
3217         (WebCore::updateFirstLetterStyle):
3218         (WebCore::createFirstLetterRenderer):
3219         * style/RenderTreeUpdaterGeneratedContent.cpp:
3220         (WebCore::createContentRenderers):
3221         * style/RenderTreeUpdaterListItem.cpp:
3222         (WebCore::RenderTreeUpdater::ListItem::updateMarker):
3223         * style/RenderTreeUpdaterMultiColumn.cpp:
3224         (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
3225
3226 2017-09-29  Zalan Bujtas  <zalan@apple.com>
3227
3228         Remove redundant RenderObject::selectionRoot and dependencies
3229         https://bugs.webkit.org/show_bug.cgi?id=177696
3230
3231         Reviewed by Ryosuke Niwa.
3232
3233         There's only one selection root (RenderView).
3234
3235         * rendering/InlineTextBox.cpp:
3236         (WebCore::InlineTextBox::selectionState):
3237         (WebCore::InlineTextBox::selectionStartEnd const):
3238         * rendering/RenderObject.cpp:
3239         (WebCore::RenderObject::selectionRoot const): Deleted.
3240         (WebCore::RenderObject::selectionStartEnd const): Deleted.
3241         * rendering/RenderObject.h:
3242         * rendering/RenderReplaced.cpp:
3243         (WebCore::RenderReplaced::isSelected const):
3244         * rendering/RenderText.cpp:
3245         (WebCore::RenderText::collectSelectionRectsForLineBoxes):
3246         * rendering/RenderTextLineBoxes.cpp:
3247         (WebCore::RenderTextLineBoxes::setSelectionState):
3248         * rendering/RenderView.h:
3249         * rendering/SelectionSubtreeRoot.h:
3250
3251 2017-09-29  Chris Dumez  <cdumez@apple.com>
3252
3253         http/tests/preconnect/link-rel-preconnect-https.html is flaky
3254         https://bugs.webkit.org/show_bug.cgi?id=177673
3255
3256         Reviewed by Alex Christensen.
3257
3258         No new tests, unskipped test that is now passing consistently.
3259
3260         * loader/LinkLoader.cpp:
3261         (WebCore::LinkLoader::loadLink):
3262         * loader/LoaderStrategy.h:
3263
3264 2017-09-29  Daniel Bates  <dabates@apple.com>
3265
3266         Extract logic to compute text to render into common function
3267         https://bugs.webkit.org/show_bug.cgi?id=177607
3268
3269         Reviewed by Zalan Bujtas.
3270
3271         Currently we duplicate the logic to compute the text to render
3272         throughout InlineTextBox. Instead we should move this common
3273         code into a member function. This will allow us to audit the
3274         the code paths that render text and ensure such code paths
3275         account for hyphenation and combined text, if applicable.
3276
3277         Note that a TextRun does not own the text. The caller owns it.
3278
3279         No functionality changed. So, no new tests.
3280
3281         * rendering/InlineTextBox.cpp:
3282         (WebCore::InlineTextBox::localSelectionRect const): Modified to
3283         use text() and createTextRun() to compute the text to render
3284         and the text run for it.
3285         (WebCore::InlineTextBox::paint): Ditto.
3286         (WebCore::InlineTextBox::paintSelection): Ditto. Additionally query
3287         lineStyle() for the style of the line instead of requiring it to be
3288         passed as an argument.
3289         (WebCore::InlineTextBox::paintTextSubrangeBackground): Modified
3290         to use text() and createTextRun() to compute the text to render
3291         and the text run for it.
3292         (WebCore::InlineTextBox::paintDocumentMarker): Ditto.
3293         (WebCore::InlineTextBox::offsetForPosition const): Ditto.
3294         (WebCore::InlineTextBox::positionForOffset const): Ditto.
3295         (WebCore::InlineTextBox::createTextRun const): Added; formerly named constructTextRun.
3296         (WebCore::InlineTextBox::text const): Added.
3297         (WebCore::InlineTextBox::substringToRender const): Deleted.
3298         (WebCore::InlineTextBox::hyphenatedStringForTextRun const): Deleted.
3299         (WebCore::InlineTextBox::constructTextRun const): Deleted.
3300         * rendering/InlineTextBox.h:
3301         (WebCore::InlineTextBox::substringToRender): Deleted.
3302         (WebCore::InlineTextBox::hyphenatedStringForTextRun): Deleted.
3303         (WebCore::InlineTextBox::constructTextRun): Deleted; renamed to createTextRun.
3304
3305 2017-09-29  Zalan Bujtas  <zalan@apple.com>
3306
3307         Remove SelectionSubtreeRoot::RenderSubtreesMap
3308         https://bugs.webkit.org/show_bug.cgi?id=177685
3309
3310         Reviewed by Andy Estes.
3311
3312         This is in preparation of removing redundant SelectionSubtreeRoot.
3313         (Now that we removed regions, RenderView is the only selection root) 
3314
3315         No change in functionality.
3316
3317         * rendering/RenderView.cpp:
3318         (WebCore::RenderView::selectionBounds const):
3319         (WebCore::RenderView::subtreeSelectionBounds const):
3320         (WebCore::RenderView::repaintSelection const):
3321         (WebCore::RenderView::repaintSubtreeSelection const):
3322         (WebCore::RenderView::setSelection):
3323         (WebCore::isValidObjectForNewSelection):
3324         (WebCore::RenderView::clearSubtreeSelection const):
3325         (WebCore::RenderView::applySubtreeSelection):
3326         (WebCore::RenderView::updateSelectionForSubtrees): Deleted.
3327         * rendering/RenderView.h:
3328         * rendering/SelectionSubtreeRoot.h:
3329
3330 2017-09-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3331
3332         [Curl] Extract a features to manage HTTP communication from ResourceHandle
3333         https://bugs.webkit.org/show_bug.cgi?id=175148
3334
3335         Reviewed by Alex Christensen.
3336
3337         * platform/Curl.cmake:
3338         * platform/network/curl/CurlRequest.cpp: Added.
3339         (WebCore::CurlRequest::CurlRequest):
3340         (WebCore::CurlRequest::setUserPass):
3341         (WebCore::CurlRequest::start):
3342         (WebCore::CurlRequest::startWithJobManager):
3343         (WebCore::CurlRequest::cancel):
3344         (WebCore::CurlRequest::suspend):
3345         (WebCore::CurlRequest::resume):
3346         (WebCore::CurlRequest::callDelegate):
3347         (WebCore::CurlRequest::setupTransfer):
3348         (WebCore::CurlRequest::willSetupSslCtx):
3349         (WebCore::CurlRequest::willSendData):
3350         (WebCore::CurlRequest::didReceiveHeader):
3351         (WebCore::CurlRequest::didReceiveData):
3352         (WebCore::CurlRequest::didCompleteTransfer):
3353         (WebCore::CurlRequest::didCancelTransfer):
3354         (WebCore::CurlRequest::resolveBlobReferences):
3355         (WebCore::CurlRequest::setupPUT):
3356         (WebCore::CurlRequest::setupPOST):
3357         (WebCore::CurlRequest::setupFormData):
3358         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
3359         (WebCore::CurlRequest::invokeDidReceiveResponse):
3360         (WebCore::CurlRequest::setPaused):
3361         (WebCore::CurlRequest::willSetupSslCtxCallback):
3362         (WebCore::CurlRequest::willSendDataCallback):
3363         (WebCore::CurlRequest::didReceiveHeaderCallback):
3364         (WebCore::CurlRequest::didReceiveDataCallback):
3365         * platform/network/curl/CurlRequest.h: Added.
3366         (WebCore::CurlRequest::~CurlRequest):
3367         (WebCore::CurlRequest::setDelegate):
3368         (WebCore::CurlRequest::isSyncRequest):
3369         (WebCore::CurlRequest::getNetworkLoadMetrics):
3370         * platform/network/curl/CurlRequestDelegate.h: Added.
3371         * platform/network/curl/ResourceHandleCurl.cpp:
3372         (WebCore::ResourceHandle::cancel):
3373         (WebCore::ResourceHandle::platformSetDefersLoading):
3374         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3375         (WebCore::ResourceHandle::receivedCredential):
3376         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
3377         (WebCore::ResourceHandle::receivedCancellation):
3378         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
3379         (WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
3380         (WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
3381         (WebCore::ResourceHandleCurlDelegate::start):
3382         (WebCore::ResourceHandleCurlDelegate::cancel):
3383         (WebCore::ResourceHandleCurlDelegate::setDefersLoading):
3384         (WebCore::ResourceHandleCurlDelegate::setAuthentication):
3385         (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
3386         (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
3387         (WebCore::ResourceHandleCurlDelegate::cancelledOrClientless):
3388         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
3389         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
3390         (WebCore::ResourceHandleCurlDelegate::curlDidComplete):
3391         (WebCore::ResourceHandleCurlDelegate::curlDidFailWithError):
3392         (WebCore::ResourceHandleCurlDelegate::response):
3393         (WebCore::ResourceHandleCurlDelegate::getCredential):
3394         (WebCore::ResourceHandleCurlDelegate::retain): Deleted.
3395         (WebCore::ResourceHandleCurlDelegate::release): Deleted.
3396         (WebCore::ResourceHandleCurlDelegate::setupTransfer): Deleted.
3397         (WebCore::ResourceHandleCurlDelegate::didCompleteTransfer): Deleted.
3398         (WebCore::ResourceHandleCurlDelegate::didCancelTransfer): Deleted.
3399         (WebCore::ResourceHandleCurlDelegate::setupAuthentication): Deleted.
3400         (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders): Deleted.
3401         (WebCore::ResourceHandleCurlDelegate::didReceiveContentData): Deleted.
3402         (WebCore::ResourceHandleCurlDelegate::handleLocalReceiveResponse): Deleted.
3403         (WebCore::ResourceHandleCurlDelegate::prepareSendData): Deleted.
3404         (WebCore::ResourceHandleCurlDelegate::didFinish): Deleted.
3405         (WebCore::ResourceHandleCurlDelegate::didFail): Deleted.
3406         (WebCore::ResourceHandleCurlDelegate::setupPOST): Deleted.
3407         (WebCore::ResourceHandleCurlDelegate::setupPUT): Deleted.
3408         (WebCore::ResourceHandleCurlDelegate::getFormElementsCount): Deleted.
3409         (WebCore::ResourceHandleCurlDelegate::setupFormData): Deleted.
3410         (WebCore::ResourceHandleCurlDelegate::applyAuthentication): Deleted.
3411         (WebCore::ResourceHandleCurlDelegate::getNetworkLoadMetrics): Deleted.
3412         (WebCore::ResourceHandleCurlDelegate::willSetupSslCtx): Deleted.
3413         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader): Deleted.