[LFC] Add Rect interface to Display::Box
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-05-28  Zalan Bujtas  <zalan@apple.com>
2
3         [LFC] Add Rect interface to Display::Box
4         https://bugs.webkit.org/show_bug.cgi?id=186019
5
6         Reviewed by Antti Koivisto.
7
8         Having a dedicated Rect class and moving the geometry invalidation to it enables us to call
9         displayBox.contentBox().left() even when the widht/height are not computed yet.
10         Also having Rect with top/left/bottom/right interface is more aligned with the rest of the layout code than x/y/maxX/maxY.
11
12         * layout/FormattingContextGeometry.cpp:
13         (WebCore::Layout::contentHeightForFormattingContextRoot):
14         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
15         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
16         * layout/displaytree/DisplayBox.cpp:
17         (WebCore::Display::Box::marginBox const):
18         (WebCore::Display::Box::borderBox const):
19         (WebCore::Display::Box::paddingBox const):
20         (WebCore::Display::Box::contentBox const):
21         * layout/displaytree/DisplayBox.h:
22         (WebCore::Display::Box::Rect::invalidateTop):
23         (WebCore::Display::Box::Rect::invalidateLeft):
24         (WebCore::Display::Box::Rect::invalidateWidth):
25         (WebCore::Display::Box::Rect::invalidateHeight):
26         (WebCore::Display::Box::Rect::hasValidPosition const):
27         (WebCore::Display::Box::Rect::hasValidSize const):
28         (WebCore::Display::Box::Rect::hasValidGeometry const):
29         (WebCore::Display::Box::rect const):
30         (WebCore::Display::Box::top const):
31         (WebCore::Display::Box::left const):
32         (WebCore::Display::Box::bottom const):
33         (WebCore::Display::Box::right const):
34         (WebCore::Display::Box::topLeft const):
35         (WebCore::Display::Box::bottomRight const):
36         (WebCore::Display::Box::size const):
37         (WebCore::Display::Box::width const):
38         (WebCore::Display::Box::height const):
39         (WebCore::Display::Box::setTopLeft):
40         (WebCore::Display::Box::setTop):
41         (WebCore::Display::Box::setLeft):
42         (WebCore::Display::Box::setWidth):
43         (WebCore::Display::Box::setHeight):
44         (WebCore::Display::Box::Rect::invalidatePosition):
45         (WebCore::Display::Box::Rect::setHasValidPosition):
46         (WebCore::Display::Box::Rect::Rect):
47         (WebCore::Display::Box::Rect::top const):
48         (WebCore::Display::Box::Rect::left const):
49         (WebCore::Display::Box::Rect::bottom const):
50         (WebCore::Display::Box::Rect::right const):
51         (WebCore::Display::Box::Rect::topLeft const):
52         (WebCore::Display::Box::Rect::bottomRight const):
53         (WebCore::Display::Box::Rect::size const):
54         (WebCore::Display::Box::Rect::width const):
55         (WebCore::Display::Box::Rect::height const):
56         (WebCore::Display::Box::Rect::setTopLeft):
57         (WebCore::Display::Box::Rect::setTop):
58         (WebCore::Display::Box::Rect::setLeft):
59         (WebCore::Display::Box::Rect::setWidth):
60         (WebCore::Display::Box::Rect::setHeight):
61         (WebCore::Display::Box::Rect::shiftLeftTo):
62         (WebCore::Display::Box::Rect::shiftRightTo):
63         (WebCore::Display::Box::Rect::shiftTopTo):
64         (WebCore::Display::Box::Rect::shiftBottomTo):
65         (WebCore::Display::Box::Rect::expand):
66         (WebCore::Display::Box::invalidateTop): Deleted.
67         (WebCore::Display::Box::invalidateLeft): Deleted.
68         (WebCore::Display::Box::invalidateWidth): Deleted.
69         (WebCore::Display::Box::invalidateHeight): Deleted.
70         (WebCore::Display::Box::hasValidPosition const): Deleted.
71         (WebCore::Display::Box::hasValidSize const): Deleted.
72         (WebCore::Display::Box::hasValidGeometry const): Deleted.
73         (WebCore::Display::Box::invalidatePosition): Deleted.
74         (WebCore::Display::Box::setHasValidPosition): Deleted.
75
76 2018-05-28  Zalan Bujtas  <zalan@apple.com>
77
78         [LFC] Add formatting context testing codepath in FrameViewLayoutContext
79         https://bugs.webkit.org/show_bug.cgi?id=186036
80
81         Reviewed by Antti Koivisto.
82
83         This is to verify the formatting context layout correctness.
84
85         * layout/LayoutContext.cpp:
86         (WebCore::Layout::LayoutContext::LayoutContext):
87         (WebCore::Layout::LayoutContext::initializeRoot):
88         * layout/LayoutContext.h:
89         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
90         * page/FrameViewLayoutContext.cpp:
91         (WebCore::layoutUsingFormattingContext):
92         (WebCore::FrameViewLayoutContext::layout):
93
94 2018-05-28  Zalan Bujtas  <zalan@apple.com>
95
96         [LFC] Add layout tree verification.
97         https://bugs.webkit.org/show_bug.cgi?id=186018
98
99         Reviewed by Antti Koivisto.
100
101         Compare layout and render tree geometry and output the mismtaching rectangles.
102
103         * Sources.txt:
104         * WebCore.xcodeproj/project.pbxproj: Add missing headers and make then private.
105         * layout/LayoutContext.h:
106         * layout/Verification.cpp: Added.
107         (WebCore::Layout::outputMismatchedBoxInformationIfNeeded):
108         (WebCore::Layout::verifySubtree):
109         (WebCore::Layout::LayoutContext::verifyAndOutputLayoutTree const):
110
111 2018-05-28  Sam Weinig  <sam@webkit.org>
112
113         Modernize SVGRenderStyleDefs.h
114         https://bugs.webkit.org/show_bug.cgi?id=186024
115
116         Reviewed by Daniel Bates.
117
118         Modernized the set of enums in SVGRenderStyleDefs.h and WindRule.h by:
119             - Converting them to enum classes
120             - Renaming them to remove unnecessary prefix 'E's
121             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
122             - Renaming to match modern conventions (e.g BNONE -> None)
123
124         Modernizes the following enums:
125             SVGPaintType
126             BaselineShift (renamed from EBaselineShift)
127             TextAnchor (renamed from ETextAnchor)
128             ColorInterpolation (renamed from EColorInterpolation)
129             ColorRendering (renamed from EColorRendering)
130             ShapeRendering (renamed from EShapeRendering)
131             GlyphOrientation (renamed from EGlyphOrientation)
132             AlignmentBaseline (renamed from EAlignmentBaseline)
133             DominantBaseline (renamed from EDominantBaseline)
134             VectorEffect (renamed from EVectorEffect)
135             BufferedRendering (renamed from EBufferedRendering)
136             MaskType (renamed from EMaskType)
137             WindRule
138
139         * css/CSSBasicShapes.cpp:
140         (WebCore::buildPathString):
141         (WebCore::buildPolygonString):
142         * css/CSSBasicShapes.h:
143         * css/CSSPrimitiveValueMappings.h:
144         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
145         (WebCore::CSSPrimitiveValue::operator WindRule const):
146         (WebCore::CSSPrimitiveValue::operator AlignmentBaseline const):
147         (WebCore::CSSPrimitiveValue::operator BufferedRendering const):
148         (WebCore::CSSPrimitiveValue::operator ColorInterpolation const):
149         (WebCore::CSSPrimitiveValue::operator ColorRendering const):
150         (WebCore::CSSPrimitiveValue::operator DominantBaseline const):
151         (WebCore::CSSPrimitiveValue::operator ShapeRendering const):
152         (WebCore::CSSPrimitiveValue::operator TextAnchor const):
153         (WebCore::CSSPrimitiveValue::operator VectorEffect const):
154         (WebCore::CSSPrimitiveValue::operator MaskType const):
155         (WebCore::CSSPrimitiveValue::operator EAlignmentBaseline const): Deleted.
156         (WebCore::CSSPrimitiveValue::operator EBufferedRendering const): Deleted.
157         (WebCore::CSSPrimitiveValue::operator EColorInterpolation const): Deleted.
158         (WebCore::CSSPrimitiveValue::operator EColorRendering const): Deleted.
159         (WebCore::CSSPrimitiveValue::operator EDominantBaseline const): Deleted.
160         (WebCore::CSSPrimitiveValue::operator EShapeRendering const): Deleted.
161         (WebCore::CSSPrimitiveValue::operator ETextAnchor const): Deleted.
162         (WebCore::CSSPrimitiveValue::operator EVectorEffect const): Deleted.
163         (WebCore::CSSPrimitiveValue::operator EMaskType const): Deleted.
164         * css/SVGCSSComputedStyleDeclaration.cpp:
165         (WebCore::glyphOrientationToCSSPrimitiveValue):
166         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
167         (WebCore::ComputedStyleExtractor::svgPropertyValue):
168         * css/StyleBuilderConverter.h:
169         (WebCore::StyleBuilderConverter::convertGlyphOrientation):
170         (WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
171         * css/StyleBuilderCustom.h:
172         (WebCore::StyleBuilderCustom::applyValueBaselineShift):
173         (WebCore::StyleBuilderCustom::applyValueFill):
174         (WebCore::StyleBuilderCustom::applyValueStroke):
175         * css/parser/CSSPropertyParser.cpp:
176         (WebCore::consumeBasicShapePolygon):
177         (WebCore::consumeBasicShapePath):
178         * html/canvas/CanvasRenderingContext2DBase.cpp:
179         (WebCore::toWindRule):
180         * page/animation/CSSPropertyAnimation.cpp:
181         (WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
182         * platform/graphics/FloatPolygon.cpp:
183         (WebCore::FloatPolygon::contains const):
184         * platform/graphics/GraphicsContext.cpp:
185         (WebCore::GraphicsContext::fillRectWithRoundedHole):
186         * platform/graphics/GraphicsContext.h:
187         * platform/graphics/GraphicsLayer.cpp:
188         (WebCore::GraphicsLayer::shapeLayerWindRule const):
189         * platform/graphics/GraphicsLayer.h:
190         * platform/graphics/GraphicsTypes.cpp:
191         (WebCore::operator<<):
192         * platform/graphics/Path.h:
193         * platform/graphics/ShadowBlur.cpp:
194         (WebCore::ShadowBlur::drawInsetShadow):
195         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
196         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
197         * platform/graphics/WindRule.h:
198         (): Deleted.
199         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
200         (PlatformCALayerCocoa::shapeWindRule const):
201         (PlatformCALayerCocoa::setShapeWindRule):
202         * platform/graphics/cg/GraphicsContextCG.cpp:
203         (WebCore::calculateDrawingMode):
204         (WebCore::GraphicsContext::fillPath):
205         (WebCore::GraphicsContext::fillRectWithRoundedHole):
206         (WebCore::GraphicsContext::clipPath):
207         * platform/graphics/cg/PathCG.cpp:
208         (WebCore::Path::contains const):
209         * platform/mock/MockRealtimeVideoSource.cpp:
210         (WebCore::MockRealtimeVideoSource::drawAnimation):
211         * rendering/FilterEffectRenderer.cpp:
212         (WebCore::FilterEffectRenderer::buildReferenceFilter):
213         * rendering/RenderBoxModelObject.cpp:
214         (WebCore::RenderBoxModelObject::paintBorder):
215         (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
216         * rendering/RenderElement.cpp:
217         (WebCore::RenderElement::paintOutline):
218         * rendering/RenderLayer.cpp:
219         (WebCore::RenderLayer::computeClipPath const):
220         * rendering/style/BasicShapes.h:
221         (WebCore::BasicShape::windRule const):
222         * rendering/style/RenderStyle.h:
223         (WebCore::RenderStyle::fillPaintType const):
224         (WebCore::RenderStyle::setFillPaintColor):
225         (WebCore::RenderStyle::strokePaintType const):
226         (WebCore::RenderStyle::setStrokePaintColor):
227         * rendering/style/SVGRenderStyle.h:
228         (WebCore::SVGRenderStyle::initialAlignmentBaseline):
229         (WebCore::SVGRenderStyle::initialDominantBaseline):
230         (WebCore::SVGRenderStyle::initialBaselineShift):
231         (WebCore::SVGRenderStyle::initialVectorEffect):
232         (WebCore::SVGRenderStyle::initialBufferedRendering):
233         (WebCore::SVGRenderStyle::initialClipRule):
234         (WebCore::SVGRenderStyle::initialColorInterpolation):
235         (WebCore::SVGRenderStyle::initialColorInterpolationFilters):
236         (WebCore::SVGRenderStyle::initialColorRendering):
237         (WebCore::SVGRenderStyle::initialFillRule):
238         (WebCore::SVGRenderStyle::initialShapeRendering):
239         (WebCore::SVGRenderStyle::initialTextAnchor):
240         (WebCore::SVGRenderStyle::initialGlyphOrientationHorizontal):
241         (WebCore::SVGRenderStyle::initialGlyphOrientationVertical):
242         (WebCore::SVGRenderStyle::initialFillPaintType):
243         (WebCore::SVGRenderStyle::initialStrokePaintType):
244         (WebCore::SVGRenderStyle::initialMaskType):
245         (WebCore::SVGRenderStyle::setAlignmentBaseline):
246         (WebCore::SVGRenderStyle::setDominantBaseline):
247         (WebCore::SVGRenderStyle::setBaselineShift):
248         (WebCore::SVGRenderStyle::setVectorEffect):
249         (WebCore::SVGRenderStyle::setBufferedRendering):
250         (WebCore::SVGRenderStyle::setClipRule):
251         (WebCore::SVGRenderStyle::setColorInterpolation):
252         (WebCore::SVGRenderStyle::setColorInterpolationFilters):
253         (WebCore::SVGRenderStyle::setColorRendering):
254         (WebCore::SVGRenderStyle::setFillRule):
255         (WebCore::SVGRenderStyle::setShapeRendering):
256         (WebCore::SVGRenderStyle::setTextAnchor):
257         (WebCore::SVGRenderStyle::setGlyphOrientationHorizontal):
258         (WebCore::SVGRenderStyle::setGlyphOrientationVertical):
259         (WebCore::SVGRenderStyle::setMaskType):
260         (WebCore::SVGRenderStyle::alignmentBaseline const):
261         (WebCore::SVGRenderStyle::dominantBaseline const):
262         (WebCore::SVGRenderStyle::baselineShift const):
263         (WebCore::SVGRenderStyle::vectorEffect const):
264         (WebCore::SVGRenderStyle::bufferedRendering const):
265         (WebCore::SVGRenderStyle::clipRule const):
266         (WebCore::SVGRenderStyle::colorInterpolation const):
267         (WebCore::SVGRenderStyle::colorInterpolationFilters const):
268         (WebCore::SVGRenderStyle::colorRendering const):
269         (WebCore::SVGRenderStyle::fillRule const):
270         (WebCore::SVGRenderStyle::shapeRendering const):
271         (WebCore::SVGRenderStyle::textAnchor const):
272         (WebCore::SVGRenderStyle::glyphOrientationHorizontal const):
273         (WebCore::SVGRenderStyle::glyphOrientationVertical const):
274         (WebCore::SVGRenderStyle::fillPaintType const):
275         (WebCore::SVGRenderStyle::strokePaintType const):
276         (WebCore::SVGRenderStyle::maskType const):
277         (WebCore::SVGRenderStyle::visitedLinkFillPaintType const):
278         (WebCore::SVGRenderStyle::visitedLinkStrokePaintType const):
279         (WebCore::SVGRenderStyle::hasStroke const):
280         (WebCore::SVGRenderStyle::hasFill const):
281         (WebCore::SVGRenderStyle::setBitDefaults):
282         * rendering/style/SVGRenderStyleDefs.h:
283         (WebCore::StyleFillData::create):
284         (WebCore::StyleFillData::operator!= const):
285         (WebCore::StyleStrokeData::create):
286         (WebCore::StyleStrokeData::operator!= const):
287         (WebCore::StyleStopData::create):
288         (WebCore::StyleStopData::operator!= const):
289         (WebCore::StyleTextData::create):
290         (WebCore::StyleTextData::operator!= const):
291         (WebCore::StyleMiscData::create):
292         (WebCore::StyleMiscData::operator!= const):
293         (WebCore::StyleShadowSVGData::create):
294         (WebCore::StyleShadowSVGData::operator!= const):
295         (WebCore::StyleResourceData::create):
296         (WebCore::StyleResourceData::operator!= const):
297         (WebCore::StyleInheritedResourceData::create):
298         (WebCore::StyleInheritedResourceData::operator!= const):
299         (WebCore::StyleLayoutData::create):
300         (WebCore::StyleLayoutData::operator!= const):
301         (): Deleted.
302         * rendering/svg/RenderSVGImage.cpp:
303         (WebCore::RenderSVGImage::paint):
304         * rendering/svg/RenderSVGRect.cpp:
305         (WebCore::RenderSVGRect::updateShapeFromElement):
306         * rendering/svg/RenderSVGResource.cpp:
307         (WebCore::requestPaintingResource):
308         * rendering/svg/RenderSVGResourceClipper.cpp:
309         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
310         * rendering/svg/RenderSVGResourceFilter.cpp:
311         (WebCore::RenderSVGResourceFilter::buildPrimitives const):
312         * rendering/svg/RenderSVGResourceGradient.cpp:
313         (WebCore::RenderSVGResourceGradient::applyResource):
314         * rendering/svg/RenderSVGResourceMasker.cpp:
315         (WebCore::RenderSVGResourceMasker::applyResource):
316         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
317         * rendering/svg/RenderSVGResourcePattern.cpp:
318         (WebCore::RenderSVGResourcePattern::applyResource):
319         * rendering/svg/RenderSVGShape.cpp:
320         (WebCore::RenderSVGShape::paint):
321         * rendering/svg/RenderSVGShape.h:
322         (WebCore::RenderSVGShape::hasNonScalingStroke const):
323         * rendering/svg/SVGRenderTreeAsText.cpp:
324         (WebCore::writeStyle):
325         (WebCore::writeSVGInlineTextBox):
326         * rendering/svg/SVGResources.cpp:
327         (WebCore::paintingResourceFromSVGPaint):
328         * rendering/svg/SVGTextChunk.cpp:
329         (WebCore::SVGTextChunk::SVGTextChunk):
330         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
331         (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const):
332         (WebCore::SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline const):
333         (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const):
334         (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):
335         * rendering/svg/SVGTextLayoutEngineBaseline.h:
336
337 2018-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>
338
339         [Web Animations] Test webanimations/css-animations.html is crashing
340         https://bugs.webkit.org/show_bug.cgi?id=186031
341
342         Reviewed by Antoine Quint.
343
344         This is another case of std::optional value being used while it's nullopt, I guess this started to fail when we
345         stopped using the WTF implementation of std::optional. The problem is that we try to get the current iteration
346         of a declarative animation when the active time is unresolved.
347
348         * animation/DeclarativeAnimation.cpp:
349         (WebCore::DeclarativeAnimation::invalidateDOMEvents): Use value_or(0) instead of value() to get the current
350         iteration of the effect.
351
352 2018-05-28  Thibault Saunier  <tsaunier@igalia.com>
353
354         [GStreamer] Handle changes in the "drm-preferred-decryption-system-id" NEED_CONTEXT message.
355         https://bugs.webkit.org/show_bug.cgi?id=185948
356
357         Reviewed by Xabier Rodriguez-Calvar.
358
359         - The "stream-encryption-systems" field of the "drm-preferred-decryption-system-id" query was renamed to
360           "avalaible-stream-encryption-systems"
361         - It can now be NULL, meaning there is no decryptor avalaible.
362
363         Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-*
364
365         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
366         (WebCore::extractEventsAndSystemsFromMessage): Handle NULL value for "avalaible-stream-encryption-systems",
367         moved some code to make the order of the Arrays in the pair clearer.
368
369 2018-05-27  Dan Bernstein  <mitz@apple.com>
370
371         Reverted the changes made for https://webkit.org/b/186016
372
373         They broke the USE(APPLE_INTERNAL_SDK) Sierra build.
374
375 2018-05-27  David Kilzer  <ddkilzer@apple.com>
376
377         [iOS] Fix warnings about leaks found by clang static analyzer
378         <https://webkit.org/b/186009>
379         <rdar://problem/40574267>
380
381         Reviewed by Daniel Bates.
382
383         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
384         (WebCore::LocalAuthenticator::makeCredential):
385         (WebCore::LocalAuthenticator::getAssertion):
386         (WebCore::LocalAuthenticator::issueClientCertificate const):
387         - Don't leak CF objects in early return paths, and get rid of
388           `retained*` variables, by making original variables use
389           RetainPtr<>.
390         * bridge/objc/WebScriptObject.mm:
391         (+[WebUndefined allocWithZone:]): Modernize WebUndefined by
392         using NeverDestroyed<RetainPr<WebUndefined>> type.  Explicitly
393         retain the object returned on each call.
394         (+[WebUndefined undefined]): Explicitly autorelease the object
395         returned.  Note that neither of these changes fixes the static
396         analyzer warnings in this source file.
397         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
398         (WebCore::exernalDeviceDisplayNameForPlayer): Use RetainPtr<> to
399         stop leaking NSString objects in a loop.
400         * platform/ios/wak/WAKWindow.h:
401         (-[WAKWindow _newFirstResponderAfterResigning]): Mark as
402         NS_RETURNS_NOT_RETAINED like the corresponding AppKit method
403         since this doesn't return a new object.  This fixes some
404         false-positive leaks warnings.
405
406 2018-05-27  Dan Bernstein  <mitz@apple.com>
407
408         [Cocoa] Avoid importing directly from subumbrella frameworks
409         https://bugs.webkit.org/show_bug.cgi?id=186016
410
411         Reviewed by Sam Weinig.
412
413         * Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
414           OTHER_CPLUSPLUSFLAGS.
415         * editing/mac/DictionaryLookup.mm: Import Quartz.h instead of a PDFKit header.
416         * html/HTMLKeygenElement.cpp: Removed "using namespace WebCore" from this WebCore
417           implementation file.
418         * platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
419         * platform/mac/PlatformScreenMac.mm: Import ApplicationServices.h instead of ColorSync.h
420           when using SDKs earlier than 10.13.
421         * platform/mediastream/CaptureDeviceManager.cpp: Enclosed the definitions in the WebCore
422           namespace and removed "using namespace WebCore" from this WebCore implementation file.
423         * platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
424
425 2018-05-27  Fujii Hironori  <Hironori.Fujii@sony.com>
426
427         REGRESSION(r232198) [WinCairo] cannot convert from 'WTF::StringView' to 'const WTF::String'
428         https://bugs.webkit.org/show_bug.cgi?id=186027
429
430         Unreviewed build fix
431
432         No new tests (No behavior change).
433
434         * platform/network/curl/AuthenticationChallengeCurl.cpp:
435         (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
436         * platform/network/curl/CurlRequest.cpp:
437         (WebCore::CurlRequest::setupTransfer):
438         (WebCore::CurlRequest::willSetupSslCtx):
439
440 2018-05-27  Sam Weinig  <sam@webkit.org>
441
442         Modernize RenderStyleConstants.h - Part 3
443         https://bugs.webkit.org/show_bug.cgi?id=186015
444
445         Reviewed by Yusuke Suzuki.
446
447         Modernized the third and final set of enums in RenderStyleConstants.h by:
448             - Converting them to enum classes
449             - Renaming them to remove unnecessary prefix 'E's
450             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
451
452         Modernizes the following enums:
453             TextDecoration
454             TextDecorationSkip (renamed from TextDecorationSkipItems)
455             TextUnderlinePosition
456             HangingPunctuation
457             SpeakAs (renamed from ESpeakAs)
458             TextEmphasisPosition (renamed from TextEmphasisPositions)
459
460         This final set of enums are mostly (TextUnderlinePosition isn't really) used as bitmasks,
461         so this change also converts their uses to use OptionSet. 
462
463         * accessibility/AccessibilityObject.h:
464         (WebCore::AccessibilityObject::speakAsProperty const):
465         * accessibility/AccessibilityRenderObject.cpp:
466         (WebCore::AccessibilityRenderObject::speakAsProperty const):
467         (WebCore::AccessibilityRenderObject::hasPlainText const):
468         (WebCore::AccessibilityRenderObject::hasUnderline const):
469         * accessibility/AccessibilityRenderObject.h:
470         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
471         (AXAttributeStringSetStyle):
472         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
473         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
474         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
475         (AXAttributeStringSetStyle):
476         * css/CSSComputedStyleDeclaration.cpp:
477         (WebCore::renderTextDecorationFlagsToCSSValue):
478         (WebCore::renderTextDecorationSkipFlagsToCSSValue):
479         (WebCore::renderEmphasisPositionFlagsToCSSValue):
480         (WebCore::speakAsToCSSValue):
481         (WebCore::hangingPunctuationToCSSValue):
482         * css/CSSLineBoxContainValue.h:
483         * css/CSSPrimitiveValueMappings.h:
484         (WebCore::CSSPrimitiveValue::operator HangingPunctuation const):
485         (WebCore::CSSPrimitiveValue::operator TextDecoration const):
486         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
487         (WebCore::CSSPrimitiveValue::operator TextUnderlinePosition const):
488         (WebCore::CSSPrimitiveValue::operator SpeakAs const):
489         (WebCore::CSSPrimitiveValue::operator ESpeakAs const): Deleted.
490         * css/StyleBuilderConverter.h:
491         (WebCore::StyleBuilderConverter::convertTextDecoration):
492         (WebCore::StyleBuilderConverter::valueToEmphasisPosition):
493         (WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
494         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
495         (WebCore::StyleBuilderConverter::valueToDecorationSkip):
496         (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
497         (WebCore::StyleBuilderConverter::convertSpeakAs):
498         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
499         * editing/cocoa/EditorCocoa.mm:
500         (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle const):
501         * editing/cocoa/HTMLConverter.mm:
502         (WebCore::editingAttributedStringFromRange):
503         * rendering/InlineFlowBox.cpp:
504         (WebCore::InlineFlowBox::maxLogicalBottomForTextDecorationLine const):
505         (WebCore::InlineFlowBox::minLogicalTopForTextDecorationLine const):
506         * rendering/InlineFlowBox.h:
507         * rendering/InlineTextBox.cpp:
508         (WebCore::emphasisPositionHasNeitherLeftNorRight):
509         (WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
510         (WebCore::InlineTextBox::paint):
511         (WebCore::InlineTextBox::paintMarkedTextDecoration):
512         * rendering/RenderBlockFlow.cpp:
513         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
514         * rendering/RenderBlockLineLayout.cpp:
515         (WebCore::setLogicalWidthForTextRun):
516         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
517         * rendering/RenderElement.cpp:
518         (WebCore::RenderElement::enclosingRendererWithTextDecoration const):
519         * rendering/RenderElement.h:
520         * rendering/RenderTableSection.cpp:
521         (WebCore::RenderTableSection::addCell):
522         * rendering/SimpleLineLayout.cpp:
523         (WebCore::SimpleLineLayout::canUseForStyle):
524         (WebCore::SimpleLineLayout::canUseForWithReason):
525         * rendering/SimpleLineLayoutFunctions.cpp:
526         (WebCore::SimpleLineLayout::paintFlow):
527         * rendering/TextDecorationPainter.cpp:
528         (WebCore::TextDecorationPainter::TextDecorationPainter):
529         (WebCore::TextDecorationPainter::paintTextDecoration):
530         (WebCore::collectStylesForRenderer):
531         (WebCore::TextDecorationPainter::stylesForRenderer):
532         * rendering/TextDecorationPainter.h:
533         * rendering/TextPaintStyle.cpp:
534         (WebCore::computeTextPaintStyle):
535         * rendering/line/BreakingContext.h:
536         (WebCore::BreakingContext::handleText):
537         * rendering/style/RenderStyle.cpp:
538         (WebCore::RenderStyle::RenderStyle):
539         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
540         * rendering/style/RenderStyle.h:
541         (WebCore::RenderStyle::textDecorationsInEffect const):
542         (WebCore::RenderStyle::textDecoration const):
543         (WebCore::RenderStyle::textDecorationSkip const):
544         (WebCore::RenderStyle::hangingPunctuation const):
545         (WebCore::RenderStyle::textEmphasisPosition const):
546         (WebCore::RenderStyle::speakAs const):
547         (WebCore::RenderStyle::addToTextDecorationsInEffect):
548         (WebCore::RenderStyle::setTextDecorationsInEffect):
549         (WebCore::RenderStyle::setTextDecoration):
550         (WebCore::RenderStyle::setTextDecorationSkip):
551         (WebCore::RenderStyle::setSpeakAs):
552         (WebCore::RenderStyle::setTextEmphasisPosition):
553         (WebCore::RenderStyle::setHangingPunctuation):
554         (WebCore::RenderStyle::initialHangingPunctuation):
555         (WebCore::RenderStyle::initialTextDecoration):
556         (WebCore::RenderStyle::initialTextDecorationSkip):
557         (WebCore::RenderStyle::initialTextUnderlinePosition):
558         (WebCore::RenderStyle::initialSpeakAs):
559         (WebCore::RenderStyle::initialTextEmphasisPosition):
560         * rendering/style/RenderStyleConstants.h:
561         (WebCore::operator|): Deleted.
562         (WebCore::operator|=): Deleted.
563         * rendering/style/StyleRareInheritedData.cpp:
564         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
565         * rendering/style/StyleVisualData.cpp:
566         (WebCore::StyleVisualData::StyleVisualData):
567         * rendering/svg/SVGInlineTextBox.cpp:
568         (WebCore::SVGInlineTextBox::paint):
569         (WebCore::positionOffsetForDecoration):
570         (WebCore::thicknessForDecoration):
571         (WebCore::findRendererDefininingTextDecoration):
572         (WebCore::SVGInlineTextBox::paintDecoration):
573         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
574         * rendering/svg/SVGInlineTextBox.h:
575         * style/InlineTextBoxStyle.cpp:
576         (WebCore::computeUnderlineOffset):
577         (WebCore::visualOverflowForDecorations):
578
579 2018-05-26  Zalan Bujtas  <zalan@apple.com>
580
581         [LFC] Implement margin computation
582         https://bugs.webkit.org/show_bug.cgi?id=186008
583
584         Reviewed by Antti Koivisto.
585
586         * WebCore.xcodeproj/project.pbxproj:
587         * layout/FormattingContext.cpp:
588         (WebCore::Layout::FormattingContext::computeMargin const):
589         (WebCore::Layout::FormattingContext::marginTop const): Deleted.
590         (WebCore::Layout::FormattingContext::marginLeft const): Deleted.
591         (WebCore::Layout::FormattingContext::marginBottom const): Deleted.
592         (WebCore::Layout::FormattingContext::marginRight const): Deleted.
593         * layout/FormattingContext.h:
594         * layout/blockformatting/BlockFormattingContext.cpp:
595         (WebCore::Layout::BlockFormattingContext::layout const):
596         (WebCore::Layout::BlockFormattingContext::computeMargin const):
597         (WebCore::Layout::BlockFormattingContext::marginTop const): Deleted.
598         (WebCore::Layout::BlockFormattingContext::marginBottom const): Deleted.
599         * layout/blockformatting/BlockFormattingContext.h:
600         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
601         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight):
602         (WebCore::Layout::BlockFormattingContext::Geometry::computedMargin):
603         * layout/blockformatting/BlockMarginCollapse.cpp:
604         (WebCore::Layout::_isMarginBottomCollapsedWithParent):
605         (WebCore::Layout::collapsedMarginBottomFromLastChild):
606         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
607         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
608         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
609         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom):
610         (WebCore::Layout::BlockMarginCollapse::marginTop): Deleted.
611         (WebCore::Layout::BlockMarginCollapse::marginBottom): Deleted.
612         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
613         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
614         * layout/blockformatting/BlockMarginCollapse.h: Removed.
615
616 2018-05-25  Myles C. Maxfield  <mmaxfield@apple.com>
617
618         [Cocoa] Delete unnecessary WebCascadeList in ComplexTextController
619         https://bugs.webkit.org/show_bug.cgi?id=186007
620
621         Reviewed by Zalan Bujtas.
622
623         Inside ComplexTextController::collectComplexTextRuns(), we chop up text based on which fonts should be
624         used to render which grapheme clusters. For each grapheme cluster, we run through the font-family list
625         in FontCascade::fontForCombiningCharacterSequence() and find the first font that can render the cluster.
626         If no items can render the cluster, we construct a WebCascadeList and let CoreText try to figure out
627         which fonts can render which clusters.
628
629         Except there's no point, because we just determined that no font in the list can be used to render the
630         cluster. CoreText isn't magic; it isn't going to somehow disagree with us. WebCascadeList is just
631         useless code.
632
633         No new tests because there is no behavior change.
634
635         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
636         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
637         (-[WebCascadeList initWithFont:character:]): Deleted.
638         (-[WebCascadeList count]): Deleted.
639         (-[WebCascadeList objectAtIndex:]): Deleted.
640
641 2018-05-25  Myles C. Maxfield  <mmaxfield@apple.com>
642
643         Improve the performance of Font::canRenderCombiningCharacterSequence()
644         https://bugs.webkit.org/show_bug.cgi?id=185933
645
646         Reviewed by Ryosuke Niwa.
647
648         We don't need to create a whole CTLine just to determine whether or not a font supports rendering a grapheme cluster.
649         Instead, the right way to do it is just see if the font's cmap table supports every code point in the cluster.
650
651         This patch reports a 2% progression on the attached PerformanceTest.
652
653         Test: Layout/ComplexLongUnique.html
654
655         * platform/graphics/Font.cpp:
656         (WebCore::Font::canRenderCombiningCharacterSequence const):
657         * platform/graphics/Font.h:
658         * platform/graphics/cocoa/FontCocoa.mm:
659         (WebCore::provideStringAndAttributes): Deleted.
660         (WebCore::Font::canRenderCombiningCharacterSequence const): Deleted.
661         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
662         (WebCore::Font::canRenderCombiningCharacterSequence const): Deleted.
663
664 2018-05-25  Eric Carlson  <eric.carlson@apple.com>
665
666         Captions are sized incorrectly in PiP mode
667         https://bugs.webkit.org/show_bug.cgi?id=186005
668         <rdar://problem/39729718>
669
670         Reviewed by Dean Jackson.
671
672         * html/shadow/MediaControlElements.cpp:
673         (WebCore::MediaControlTextTrackContainerElement::updateSizes): Only sync text track bounds 
674         when the size actually changes.
675
676         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
677         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenFrame): Call syncTextTrackBounds.
678         (WebCore::VideoFullscreenLayerManagerObjC::syncTextTrackBounds): Set the text track layer size
679         to m_videoFullscreenFrame, it is always set the size of the PiP/Fullscreen layer.
680
681 2018-05-25  Timothy Hatcher  <timothy@apple.com>
682
683         Setting drawsBackground to YES on a WKView doesn't take effect immediately
684         https://bugs.webkit.org/show_bug.cgi?id=185885
685         rdar://problem/39706506
686
687         Reviewed by Simon Fraser.
688
689         * page/Frame.cpp:
690         (WebCore::Frame::createView): Always call updateBackgroundRecursively, it handles
691         invalid colors correctly already.
692         * page/FrameView.cpp:
693         (WebCore::FrameView::setTransparent): Call setNeedsLayout() since base background color
694         and transparent is used to update layers.
695         (WebCore::FrameView::setBaseBackgroundColor): Ditto.
696         (WebCore::FrameView::updateBackgroundRecursively): Schedule layout if needed.
697         * page/FrameView.h:
698         * rendering/RenderLayerCompositor.cpp:
699         (WebCore::RenderLayerCompositor::viewHasTransparentBackground const): Use baseBackgroundColor
700         instead of hardcoding white.
701         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged): Fixed incorrect changed logging.
702
703 2018-05-25  Youenn Fablet  <youenn@apple.com>
704
705         Migrate From-Origin to Cross-Origin-Resource-Policy
706         https://bugs.webkit.org/show_bug.cgi?id=185840
707
708         Reviewed by Chris Dumez.
709
710         Tests: http/wpt/cross-origin-resource-policy/fetch-in-iframe.html
711                http/wpt/cross-origin-resource-policy/fetch.html
712                http/wpt/cross-origin-resource-policy/iframe-loads.html
713                http/wpt/cross-origin-resource-policy/image-loads.html
714                http/wpt/cross-origin-resource-policy/script-loads.html
715
716         * platform/network/HTTPHeaderNames.in:
717         * platform/network/HTTPParsers.cpp:
718         (WebCore::parseCrossOriginResourcePolicyHeader):
719         * platform/network/HTTPParsers.h:
720
721 2018-05-25  Daniel Bates  <dabates@apple.com>
722
723         NavigationAction should not hold a strong reference to a Document
724         https://bugs.webkit.org/show_bug.cgi?id=185712
725         <rdar://problem/40320916>
726
727         Reviewed by Brent Fulgham.
728
729         Have NavigationAction store all the relevant details callers need to know about the document
730         that initiated the navigation in an independent data structure, called NavigationAction::Requester,
731         as opposed to holding a RefPtr to the document itself. The benefit of this approach is that it
732         is a step towards ensuring that NavigationAction does not keep the document alive after navigating
733         to a new document given that DocumentLoader stores the NavigationAction for the last navigation.
734
735         * loader/NavigationAction.cpp:
736         (WebCore::NavigationAction::Requester::Requester): Track all relevant details of the document that
737         requested this navigation that are needed to support WebKit API/SPI. We hold the SecurityOrigin in
738         a RefPtr to avoid the need to explicitly define a copy constructor and copy-assignment constructor
739         because Requester needs to be copyable as NavigationAction, which owns a Requester, is copyable.
740         (WebCore::shouldTreatAsSameOriginNavigation): Fix some style nits.
741         (WebCore::NavigationAction::NavigationAction): Instantiate a Requester from the specified document.
742         * loader/NavigationAction.h:
743         (WebCore::NavigationAction::Requester::url const): Added.
744         (WebCore::NavigationAction::Requester::securityOrigin const): Added.
745         (WebCore::NavigationAction::Requester::pageID const): Added.
746         (WebCore::NavigationAction::Requester::frameID const): Added.
747         (WebCore::NavigationAction::requester const): Returns details about the document that requested
748         this navigation, if applicable.
749         (WebCore::NavigationAction::isEmpty const): Update criterion for being empty to consider the
750         requester.
751         (WebCore::NavigationAction::setOpener): Extracted out the datatype of the parameter into a
752         type alias to avoid duplication and updated this code to use the alias.
753         (WebCore::NavigationAction::opener const): Ditto.
754         (WebCore::NavigationAction::sourceDocument const): Deleted.
755
756 2018-05-25  Jeremy Jones  <jeremyj@apple.com>
757
758         Fullscreen element can be clipped by ancestor.
759         https://bugs.webkit.org/show_bug.cgi?id=185980
760         rdar://problem/40320006
761
762         Reviewed by Jer Noble.
763
764         Adds style to fullscreen css to prevent the fullscreen element from being clipped by an ancestor element.
765
766         * css/fullscreen.css:
767         (:-webkit-full-screen-ancestor:not(iframe)):
768
769 2018-05-25  Jeremy Jones  <jeremyj@apple.com>
770
771         Use correct AVKit delegate for picture in picture failure.
772         https://bugs.webkit.org/show_bug.cgi?id=185981
773         rdar://problem/40549652
774
775         Reviewed by Eric Carlson.
776
777         No new tests since we don't have a way to simulate picture-in-picture failure.
778
779         Use the new name for this delegate callback.
780
781         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
782         (-[WebAVPlayerViewControllerDelegate playerViewController:failedToStartPictureInPictureWithError:]):
783         (-[WebAVPlayerViewControllerDelegate playerViewControllerFailedToStartPictureInPicture:withError:]): Deleted.
784
785 2018-05-25  Zalan Bujtas  <zalan@apple.com>
786
787         iBooks: text can disappear/flash during finger drag highlight
788         https://bugs.webkit.org/show_bug.cgi?id=185993
789         <rdar://problem/34026943>
790
791         Reviewed by Simon Fraser.
792
793         Reuse existing tiles when override rect is fully covered by the active grid.
794         Also, recover dropped tiles if override rect forces us to create new ones. 
795
796         Unable to create a reproducible test case.
797
798         * platform/ios/LegacyTileCache.h:
799         * platform/ios/LegacyTileCache.mm:
800         (WebCore::LegacyTileCache::setOverrideVisibleRect):
801         * platform/ios/LegacyTileLayer.mm:
802         (-[LegacyTileHostLayer renderInContext:]):
803
804 2018-05-25  Eric Carlson  <eric.carlson@apple.com>
805
806         Encode ISOWebVTTCue "strings" when logging
807         https://bugs.webkit.org/show_bug.cgi?id=185991
808         <rdar://problem/40563902>
809
810         Reviewed by Jer Noble.
811
812         * platform/graphics/iso/ISOVTTCue.cpp:
813         (WebCore::ISOWebVTTCue::toJSONString const): Use encodeWithURLEscapeSequences for all Strings
814         taken from ISO boxes.
815
816 2018-05-25  Alex Christensen  <achristensen@webkit.org>
817
818         URL::host should return a StringView to reduce allocations
819         https://bugs.webkit.org/show_bug.cgi?id=185986
820
821         Reviewed by Geoff Garen.
822
823         No change in behaviour.  Just fewer allocations.
824
825         * Modules/plugins/YouTubePluginReplacement.cpp:
826         (WebCore::isYouTubeURL):
827         (WebCore::processAndCreateYouTubeURL):
828         * Modules/websockets/WebSocketHandshake.cpp:
829         (WebCore::hostName):
830         (WebCore::WebSocketHandshake::host const):
831         * contentextensions/ContentExtension.cpp:
832         (WebCore::ContentExtensions::ContentExtension::populateConditionCacheIfNeeded):
833         * html/HTMLAnchorElement.cpp:
834         (WebCore::HTMLAnchorElement::parseAttribute):
835         * html/HTMLMediaElement.cpp:
836         (WebCore::HTMLMediaElement::mediaSessionTitle const):
837         (WebCore::needsSeekingSupportQuirk):
838         * html/HTMLPlugInImageElement.cpp:
839         (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
840         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
841         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
842         * html/ImageDocument.cpp:
843         (WebCore::ImageDocument::finishedParsing):
844         * html/URLUtils.h:
845         (WebCore::URLUtils<T>::hostname const):
846         * loader/FrameLoader.cpp:
847         (WebCore::FrameLoader::setFirstPartyForCookies):
848         * loader/LinkLoader.cpp:
849         (WebCore::LinkLoader::loadLink):
850         * loader/ResourceLoadStatistics.cpp:
851         (WebCore::ResourceLoadStatistics::primaryDomain):
852         * loader/mac/LoaderNSURLExtras.mm:
853         (suggestedFilenameWithMIMEType):
854         * page/Chrome.cpp:
855         (WebCore::Chrome::mouseDidMoveOverElement):
856         * page/Location.cpp:
857         (WebCore::Location::hostname const):
858         * page/Page.cpp:
859         (WebCore::Page::mainFrameLoadStarted):
860         * page/PerformanceMonitor.cpp:
861         (WebCore::reportPageOverPostLoadResourceThreshold):
862         * page/SecurityOrigin.cpp:
863         (WebCore::isLoopbackIPAddress):
864         (WebCore::shouldTreatAsPotentiallyTrustworthy):
865         (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress):
866         * page/SecurityOrigin.h:
867         * page/SecurityOriginData.h:
868         (WebCore::SecurityOriginData::fromURL):
869         * page/UserContentURLPattern.cpp:
870         (WebCore::UserContentURLPattern::matchesHost const):
871         * page/csp/ContentSecurityPolicySource.cpp:
872         (WebCore::ContentSecurityPolicySource::hostMatches const):
873         * platform/PublicSuffix.h:
874         * platform/URL.cpp:
875         (WebCore::URL::host const):
876         (WebCore::URL::hostAndPort const):
877         (WebCore::URL::isMatchingDomain const):
878         * platform/URL.h:
879         * platform/mac/SSLKeyGeneratorMac.mm:
880         (WebCore::signedPublicKeyAndChallengeString):
881         * platform/network/ResourceRequestBase.h:
882         (WebCore::registrableDomainsAreEqual):
883         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
884         (WebCore::getPartitioningDomain):
885         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
886         (WebCore::SocketStreamHandleImpl::createStreams):
887         * workers/WorkerLocation.cpp:
888         (WebCore::WorkerLocation::hostname const):
889         * workers/service/server/SWServer.cpp:
890         (WebCore::SWServer::performGetOriginsWithRegistrationsCallbacks):
891
892 2018-05-24  Dean Jackson  <dino@apple.com>
893
894         Need to provide a way to feature detect support for system preview
895         https://bugs.webkit.org/show_bug.cgi?id=185970
896         <rdar://problem/40538321>
897
898         Reviewed by Sam Weinig.
899
900         Update the supports function in the DOMTokenList that HTMLAnchorElement
901         produces for relList to return true for the system preview token.
902
903         Tested internally.
904
905         * html/HTMLAnchorElement.cpp:
906         (WebCore::HTMLAnchorElement::relList const):
907
908 2018-05-25  Chris Dumez  <cdumez@apple.com>
909
910         Minor ApplicationCacheStorage clean up
911         https://bugs.webkit.org/show_bug.cgi?id=185984
912
913         Reviewed by Youenn Fablet.
914
915         * loader/appcache/ApplicationCacheStorage.cpp:
916         (WebCore::ApplicationCacheStorage::getManifestURLs):
917         (WebCore::ApplicationCacheStorage::deleteCacheGroup):
918         (WebCore::ApplicationCacheStorage::originsWithCache):
919         (WebCore::ApplicationCacheStorage::deleteAllCaches):
920         (WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
921         (WebCore::ApplicationCacheStorage::ApplicationCacheStorage):
922         (WebCore::ApplicationCacheStorage::cacheDirectory const): Deleted.
923         (WebCore::ApplicationCacheStorage::cacheGroupSize): Deleted.
924         (WebCore::ApplicationCacheStorage::getOriginsWithCache): Deleted.
925         (WebCore::ApplicationCacheStorage::create): Deleted.
926         * loader/appcache/ApplicationCacheStorage.h:
927         (WebCore::ApplicationCacheStorage::create):
928
929 2018-05-25  Sihui Liu  <sihui_liu@apple.com>
930
931         [WKHTTPCookieStore getAllCookies] returns inconsistent creation time
932         https://bugs.webkit.org/show_bug.cgi?id=185041
933         <rdar://problem/34684214>
934
935         Reviewed by Geoffrey Garen.
936
937         Set creationtime property when creating Cookie object to keep consistency after conversion.
938
939         New API test: WebKit.WKHTTPCookieStoreCreationTime.
940
941         * platform/network/cocoa/CookieCocoa.mm:
942         (WebCore::Cookie::operator NSHTTPCookie * const):
943
944 2018-05-25  Zalan Bujtas  <zalan@apple.com>
945
946         [LFC] Implement border and padding computation
947         https://bugs.webkit.org/show_bug.cgi?id=185972
948
949         Reviewed by Antti Koivisto.
950
951         This patch also removes redundant Display::Box methods and adds a lightweight Edge struct.
952         (Since padding is optional, if during layout we mistakenly try to access paddingTop/Left/Bottom/Right, Display::Box will assert!)
953
954         * layout/FormattingContext.cpp:
955         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
956         * layout/FormattingContext.h:
957         * layout/FormattingContextGeometry.cpp:
958         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
959         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
960         * layout/blockformatting/BlockFormattingContext.cpp:
961         (WebCore::Layout::BlockFormattingContext::layout const):
962         * layout/displaytree/DisplayBox.cpp:
963         (WebCore::Display::Box::marginBox const):
964         (WebCore::Display::Box::paddingBox const):
965         (WebCore::Display::Box::contentBox const):
966         * layout/displaytree/DisplayBox.h:
967         (WebCore::Display::Box::Edges::Edges):
968         (WebCore::Display::Box::setHasValidPosition):
969         (WebCore::Display::Box::setWidth):
970         (WebCore::Display::Box::setHeight):
971         (WebCore::Display::Box::setMargin):
972         (WebCore::Display::Box::setBorder):
973         (WebCore::Display::Box::setPadding):
974         (WebCore::Display::Box::marginTop const):
975         (WebCore::Display::Box::marginLeft const):
976         (WebCore::Display::Box::marginBottom const):
977         (WebCore::Display::Box::marginRight const):
978         (WebCore::Display::Box::paddingTop const):
979         (WebCore::Display::Box::paddingLeft const):
980         (WebCore::Display::Box::paddingBottom const):
981         (WebCore::Display::Box::paddingRight const):
982         (WebCore::Display::Box::borderTop const):
983         (WebCore::Display::Box::borderLeft const):
984         (WebCore::Display::Box::borderBottom const):
985         (WebCore::Display::Box::borderRight const):
986         (WebCore::Display::Box::invalidateSize): Deleted.
987         (WebCore::Display::Box::setHasValidSize): Deleted.
988         (WebCore::Display::Box::setHasValidGeometry): Deleted.
989         (WebCore::Display::Box::setRect): Deleted.
990         (WebCore::Display::Box::setSize): Deleted.
991         * layout/layouttree/LayoutBox.cpp:
992         (WebCore::Layout::Box::isPaddingEnabled const):
993         * layout/layouttree/LayoutBox.h:
994
995 2018-05-25  David Kilzer  <ddkilzer@apple.com>
996
997         Fix issues with -dealloc methods found by clang static analyzer
998         <https://webkit.org/b/185887>
999
1000         Reviewed by Joseph Pecoraro.
1001
1002         * platform/ios/WebAVPlayerController.mm:
1003         (-[WebAVPlayerController dealloc]): Release `_minTiming` and
1004         `_maxTiming` to fix leaks.
1005         * platform/ios/WebBackgroundTaskController.mm:
1006         (-[WebBackgroundTaskController dealloc]): Release
1007         `_backgroundTaskStartBlock` and `_backgroundTaskEndBlock` to fix
1008         leaks.
1009         * platform/ios/WebItemProviderPasteboard.mm:
1010         (-[WebItemProviderRegistrationInfoList dealloc]): Release
1011         `_teamData` to fix leak.
1012
1013 2018-05-25  Antoine Quint  <graouts@apple.com>
1014
1015         [Web Animations] WebAnimation objects never get destroyed
1016         https://bugs.webkit.org/show_bug.cgi?id=185917
1017         <rdar://problem/39539371>
1018
1019         Reviewed by Dean Jackson and Antti Koivisto.
1020
1021         The AnimationTimeline class keeps references to WebAnimation objects organized in various ways. First, there
1022         are three main maps across which all animations are stored, one for non-subclass WebAnimation objects
1023         (m_elementToAnimationsMap), one for CSSSAnimation objects (m_elementToCSSAnimationsMap) and one for CSSTranstion
1024         objects (m_elementToCSSTransitionsMap). On top of that, we also keep a map to access CSSAnimation objects for
1025         a given element by CSS animation name (m_elementToCSSAnimationByName) and another map to access CSSTransition 
1026         objects for a given element by CSS property (m_elementToCSSTransitionByCSSPropertyID).
1027
1028         None of the RefPtr<WebAnimation> stored in these maps would get cleared when the document would get torn down,
1029         which would also prevent the AnimationTimeline (and its DocumentTimeline subclass) from being destroyed.
1030
1031         We now ensure that element and document tear-down correctly removes animations and clears those maps, which
1032         in turn allows the DocumentTimeline to be destroyed, fixing the significant memory leak introduced by Web Animations
1033         so far.
1034
1035         Finally, we change the collection type for those maps to be ListHashRef instead of Vector to guarantee we only
1036         add an animation once per collection due to changes in how setEffect() and setTimeline() operate.
1037
1038         Test: animations/leak-document-with-css-animation.html
1039
1040         * animation/AnimationTimeline.cpp:
1041         (WebCore::AnimationTimeline::~AnimationTimeline): There is no need to clear those tables as they'll need to be empty
1042         for the AnimationTimeline to even be destroyed.
1043         (WebCore::AnimationTimeline::relevantMapForAnimation): Change to use ListHashRef instead of Vector.
1044         (WebCore::AnimationTimeline::animationWasAddedToElement): Change to use ListHashRef instead of Vector.
1045         (WebCore::AnimationTimeline::animationWasRemovedFromElement): When an animation is removed from an element, ensure that
1046         references to this animation stored in the m_elementToCSSAnimationByName and m_elementToCSSTransitionByCSSPropertyID maps
1047         are cleared.
1048         (WebCore::AnimationTimeline::animationsForElement const): Change to use ListHashRef instead of Vector.
1049         (WebCore::AnimationTimeline::removeAnimationsForElement): Instead of just calling cancel() on all known declarative animations
1050         (this method used to be called cancelDeclarativeAnimationsForElement()), we now set the effect of known animations, declarative
1051         or not, for the provided element which will in turn call animationWasRemovedFromElement() and remove the animation from all
1052         maps that might keep a reference to it.
1053         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Replace call to removeDeclarativeAnimation() with a simple call
1054         to removeAnimation() which will remove references for this animation from the relevant maps.
1055         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Ditto.
1056         (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement): Deleted.
1057         (WebCore::AnimationTimeline::removeDeclarativeAnimation): Deleted.
1058         * animation/AnimationTimeline.h:
1059         (WebCore::AnimationTimeline::elementToAnimationsMap): Change to use ListHashRef instead of Vector.
1060         (WebCore::AnimationTimeline::elementToCSSAnimationsMap): Change to use ListHashRef instead of Vector.
1061         (WebCore::AnimationTimeline::elementToCSSTransitionsMap): Change to use ListHashRef instead of Vector.
1062         * animation/WebAnimation.cpp:
1063         (WebCore::WebAnimation::setEffect): In the case of a declarative animation, we don't want to remove the animation from the relevant
1064         maps because while the effect was set via the API, the element still has a transition or animation set up and we must not break the
1065         timeline-to-animation relationship.
1066         (WebCore::WebAnimation::setEffectInternal): Factor parts of setEffect() out into a new method that can be called from
1067         AnimationTimeline::removeAnimationsForElement() to reset the m_effect member and correctly call animationWasRemovedFromElement()
1068         without all the Web Animations machinery of setEffect(), which is a public API that has unwanted side effects (such as rejecting
1069         promises).
1070         (WebCore::WebAnimation::setTimeline): In the case of a declarative animation, we don't want to remove the animation from the
1071         relevant maps because, while the timeline was set via the API, the element still has a transition or animation set up and we must
1072         not break the relationship.
1073         * animation/DocumentTimeline.cpp:
1074         (WebCore::DocumentTimeline::~DocumentTimeline):
1075         (WebCore::DocumentTimeline::detachFromDocument): Close the GenericTaskQueues when detaching from the document as it's too late to
1076         perform this work in the destructor. We also cancel the schedule timer which we had forgotten to do before.
1077         * animation/WebAnimation.h:
1078         * dom/Document.cpp:
1079         (WebCore::Document::prepareForDestruction):
1080         * dom/Element.cpp:
1081         (WebCore::Element::removedFromAncestor):
1082         * dom/PseudoElement.cpp:
1083         (WebCore::PseudoElement::clearHostElement):
1084         * rendering/updating/RenderTreeUpdater.cpp:
1085         (WebCore::RenderTreeUpdater::tearDownRenderers):
1086
1087 2018-05-24  Chris Dumez  <cdumez@apple.com>
1088
1089         Avoid doing unnecessary work in Document::shouldEnforceContentDispositionAttachmentSandbox() when setting is disabled
1090         https://bugs.webkit.org/show_bug.cgi?id=185964
1091
1092         Reviewed by Geoffrey Garen.
1093
1094         * dom/Document.cpp:
1095         (WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox const):
1096
1097 2018-05-24  Chris Dumez  <cdumez@apple.com>
1098
1099         [iOS] Avoid dlopening QuickLooks in the common case where the main resource is HTML or plain text
1100         https://bugs.webkit.org/show_bug.cgi?id=185966
1101
1102         Reviewed by Geoffrey Garen.
1103
1104         Avoid dlopening QuickLooks in the common case where the main resource is HTML or plain text
1105         for performance reasons.
1106
1107         * loader/ios/PreviewLoader.mm:
1108         (WebCore::PreviewLoader::shouldCreateForMIMEType):
1109
1110 2018-05-24  Sam Weinig  <sam@webkit.org>
1111
1112         Modernize RenderStyleConstants.h - Part 2
1113         https://bugs.webkit.org/show_bug.cgi?id=185901
1114
1115         Reviewed by Simon Fraser.
1116
1117         Modernized the second set of enums in RenderStyleConstants.h by:
1118             - Converting them to enum classes
1119             - Renaming them to remove unnecessary prefix 'E's
1120             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
1121             - Renaming to match modern conventions (e.g BNONE -> None)
1122             - Reformatting them so that each value is on its own line.
1123
1124         Modernizes the following enums:
1125             PseudoId
1126             ListStyleType (renamed from EListStyleType)
1127             BorderFit (renamed from EBorderFit)
1128             AnimationFillMode (renamed from EAnimationFillMode)
1129             AnimationPlayState (renamed from EAnimPlayState)
1130             WhiteSpace (renamed from EWhiteSpace)
1131             TextAlignMode (renamed from ETextAlign)
1132             TextTransform (renamed from ETextTransform)
1133             TextDecorationStyle
1134             TextAlignLast
1135             TextJustify
1136             TextZoom
1137             BreakBetween
1138             BreakInside
1139             EmptyCell (renamed from EEmptyCell)
1140             CaptionSide (renamed from ECaptionSide)
1141             ListStylePosition (renamed from EListStylePosition)
1142             Visibility (renamed from EVisibility)
1143             CursorType (renamed from ECursor)
1144             CursorVisibility
1145             DisplayType (renamed from EDisplay)
1146             InsideLink (renamed from EInsideLink)
1147             PointerEvents (renamed from EPointerEvents)
1148             Hyphens
1149             TextEmphasisFill
1150             TextEmphasisMark
1151             ImageResolutionSource
1152             ImageResolutionSnap
1153             Order
1154             ColumnAxis
1155             ColumnProgression
1156             LineSnap
1157             LineAlign
1158             RubyPosition
1159             AutoRepeatType
1160             CSSBoxType
1161
1162         * accessibility/AXObjectCache.cpp:
1163         (WebCore::AXObjectCache::isNodeVisible const):
1164         * accessibility/AccessibilityList.cpp:
1165         (WebCore::AccessibilityList::determineAccessibilityRole):
1166         * accessibility/AccessibilityMediaControls.cpp:
1167         (WebCore::AccessibilityMediaControl::computeAccessibilityIsIgnored const):
1168         (WebCore::AccessibilityMediaTimeDisplay::computeAccessibilityIsIgnored const):
1169         * accessibility/AccessibilityObject.cpp:
1170         (WebCore::AccessibilityObject::isDOMHidden const):
1171         * accessibility/AccessibilityRenderObject.cpp:
1172         (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
1173         (WebCore::AccessibilityRenderObject::isUnvisited const):
1174         (WebCore::AccessibilityRenderObject::isVisited const):
1175         (WebCore::AccessibilityRenderObject::setValue):
1176         * accessibility/AccessibilityTable.cpp:
1177         (WebCore::AccessibilityTable::isDataTable const):
1178         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1179         (getAttributeSetForAccessibilityObject):
1180         * animation/AnimationTimeline.cpp:
1181         (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
1182         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
1183         * animation/CSSAnimation.cpp:
1184         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
1185         * animation/DeclarativeAnimation.cpp:
1186         (WebCore::DeclarativeAnimation::initialize):
1187         * animation/KeyframeEffectReadOnly.cpp:
1188         (WebCore::KeyframeEffectReadOnly::backingAnimationForCompositedRenderer const):
1189         * css/CSSComputedStyleDeclaration.cpp:
1190         (WebCore::renderTextDecorationStyleFlagsToCSSValue):
1191         (WebCore::convertToPageBreak):
1192         (WebCore::convertToColumnBreak):
1193         (WebCore::ComputedStyleExtractor::styledElement const):
1194         (WebCore::ComputedStyleExtractor::styledRenderer const):
1195         (WebCore::computeRenderStyleForProperty):
1196         (WebCore::shapePropertyValue):
1197         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1198         * css/CSSComputedStyleDeclaration.h:
1199         * css/CSSPrimitiveValueMappings.h:
1200         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1201         (WebCore::CSSPrimitiveValue::operator CaptionSide const):
1202         (WebCore::CSSPrimitiveValue::operator CursorType const):
1203         (WebCore::CSSPrimitiveValue::operator CursorVisibility const):
1204         (WebCore::CSSPrimitiveValue::operator DisplayType const):
1205         (WebCore::CSSPrimitiveValue::operator EmptyCell const):
1206         (WebCore::CSSPrimitiveValue::operator ListStylePosition const):
1207         (WebCore::CSSPrimitiveValue::operator ListStyleType const):
1208         (WebCore::CSSPrimitiveValue::operator BreakBetween const):
1209         (WebCore::CSSPrimitiveValue::operator BreakInside const):
1210         (WebCore::CSSPrimitiveValue::operator TextAlignMode const):
1211         (WebCore::CSSPrimitiveValue::operator TextAlignLast const):
1212         (WebCore::CSSPrimitiveValue::operator TextJustify const):
1213         (WebCore::CSSPrimitiveValue::operator TextDecorationStyle const):
1214         (WebCore::CSSPrimitiveValue::operator TextTransform const):
1215         (WebCore::CSSPrimitiveValue::operator Visibility const):
1216         (WebCore::CSSPrimitiveValue::operator WhiteSpace const):
1217         (WebCore::CSSPrimitiveValue::operator RubyPosition const):
1218         (WebCore::CSSPrimitiveValue::operator TextEmphasisFill const):
1219         (WebCore::CSSPrimitiveValue::operator TextEmphasisMark const):
1220         (WebCore::CSSPrimitiveValue::operator PointerEvents const):
1221         (WebCore::CSSPrimitiveValue::operator Hyphens const):
1222         (WebCore::CSSPrimitiveValue::operator LineSnap const):
1223         (WebCore::CSSPrimitiveValue::operator LineAlign const):
1224         (WebCore::CSSPrimitiveValue::operator Order const):
1225         (WebCore::CSSPrimitiveValue::operator BorderFit const):
1226         (WebCore::CSSPrimitiveValue::operator ColumnAxis const):
1227         (WebCore::CSSPrimitiveValue::operator ColumnProgression const):
1228         (WebCore::CSSPrimitiveValue::operator CSSBoxType const):
1229         (WebCore::CSSPrimitiveValue::operator TextZoom const):
1230         (WebCore::CSSPrimitiveValue::operator ECaptionSide const): Deleted.
1231         (WebCore::CSSPrimitiveValue::operator ECursor const): Deleted.
1232         (WebCore::CSSPrimitiveValue::operator EDisplay const): Deleted.
1233         (WebCore::CSSPrimitiveValue::operator EEmptyCell const): Deleted.
1234         (WebCore::CSSPrimitiveValue::operator EListStylePosition const): Deleted.
1235         (WebCore::CSSPrimitiveValue::operator EListStyleType const): Deleted.
1236         (WebCore::CSSPrimitiveValue::operator ETextAlign const): Deleted.
1237         (WebCore::CSSPrimitiveValue::operator ETextTransform const): Deleted.
1238         (WebCore::CSSPrimitiveValue::operator EVisibility const): Deleted.
1239         (WebCore::CSSPrimitiveValue::operator EWhiteSpace const): Deleted.
1240         (WebCore::CSSPrimitiveValue::operator EPointerEvents const): Deleted.
1241         (WebCore::CSSPrimitiveValue::operator EBorderFit const): Deleted.
1242         * css/CSSSelector.cpp:
1243         (WebCore::CSSSelector::pseudoId):
1244         * css/CSSToStyleMap.cpp:
1245         (WebCore::CSSToStyleMap::mapAnimationFillMode):
1246         (WebCore::CSSToStyleMap::mapAnimationPlayState):
1247         * css/CSSValueKeywords.in:
1248         * css/ElementRuleCollector.cpp:
1249         (WebCore::ElementRuleCollector::collectMatchingRules):
1250         (WebCore::ElementRuleCollector::ruleMatches):
1251         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
1252         * css/ElementRuleCollector.h:
1253         * css/SelectorChecker.cpp:
1254         (WebCore::SelectorChecker::match const):
1255         (WebCore::SelectorChecker::matchHostPseudoClass const):
1256         (WebCore::hasScrollbarPseudoElement):
1257         (WebCore::SelectorChecker::matchRecursively const):
1258         * css/SelectorChecker.h:
1259         * css/StyleBuilderConverter.h:
1260         (WebCore::StyleBuilderConverter::convertTextAlign):
1261         (WebCore::StyleBuilderConverter::convertClipPath):
1262         (WebCore::StyleBuilderConverter::convertShapeValue):
1263         (WebCore::StyleBuilderConverter::createGridTrackList):
1264         (WebCore::StyleBuilderConverter::csstoLengthConversionDataWithTextZoomFactor):
1265         (WebCore::StyleBuilderConverter::convertPageBreakBetween):
1266         (WebCore::StyleBuilderConverter::convertPageBreakInside):
1267         (WebCore::StyleBuilderConverter::convertColumnBreakBetween):
1268         (WebCore::StyleBuilderConverter::convertColumnBreakInside):
1269         * css/StyleBuilderCustom.h:
1270         (WebCore::StyleBuilderCustom::applyValueImageResolution):
1271         (WebCore::computeBaseSpecifiedFontSize):
1272         (WebCore::StyleBuilderCustom::applyValueWebkitTextZoom):
1273         (WebCore::StyleBuilderCustom::isValidDisplayValue):
1274         (WebCore::StyleBuilderCustom::applyInheritDisplay):
1275         (WebCore::StyleBuilderCustom::applyValueDisplay):
1276         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
1277         (WebCore::StyleBuilderCustom::applyValueCursor):
1278         (WebCore::StyleBuilderCustom::applyValueContent):
1279         (WebCore::StyleBuilderCustom::determineRubyTextSizeMultiplier):
1280         (WebCore::StyleBuilderCustom::applyValueAlt):
1281         * css/StyleResolver.cpp:
1282         (WebCore::StyleResolver::styleForElement):
1283         (WebCore::equivalentBlockDisplay):
1284         (WebCore::doesNotInheritTextDecoration):
1285         (WebCore::StyleResolver::adjustStyleForInterCharacterRuby):
1286         (WebCore::adjustDisplayContentsStyle):
1287         (WebCore::StyleResolver::adjustSVGElementStyle):
1288         (WebCore::StyleResolver::adjustRenderStyle):
1289         (WebCore::StyleResolver::styleRulesForElement):
1290         (WebCore::isCacheableInMatchedPropertiesCache):
1291         (WebCore::StyleResolver::applyMatchedProperties):
1292         (WebCore::StyleResolver::CascadedProperties::Property::apply):
1293         * css/StyleResolver.h:
1294         (WebCore::StyleResolver::State::elementLinkState const):
1295         * cssjit/SelectorCompiler.cpp:
1296         (WebCore::SelectorCompiler::constructFragmentsInternal):
1297         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRequestedPseudoElementEqualsToSelectorPseudoElement):
1298         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateMarkPseudoStyleForPseudoElement):
1299         * dom/Document.cpp:
1300         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
1301         (WebCore::Document::isPageBoxVisible):
1302         (WebCore::Document::setVisuallyOrdered):
1303         * dom/Document.h:
1304         * dom/Element.cpp:
1305         (WebCore::Element::isFocusable const):
1306         (WebCore::Element::hasDisplayContents const):
1307         (WebCore::Element::storeDisplayContentsStyle):
1308         (WebCore::Element::rendererIsNeeded):
1309         (WebCore::beforeOrAfterPseudoElement):
1310         (WebCore::Element::computedStyle):
1311         * dom/Element.h:
1312         * dom/Node.cpp:
1313         (WebCore::computeEditabilityFromComputedStyle):
1314         * dom/Node.h:
1315         (WebCore::Node::isPseudoElement const):
1316         (WebCore::Node::isBeforePseudoElement const):
1317         (WebCore::Node::isAfterPseudoElement const):
1318         (WebCore::Node::pseudoId const):
1319         (WebCore::Node::customPseudoId const):
1320         * dom/Position.cpp:
1321         (WebCore::Position::upstream const):
1322         (WebCore::Position::downstream const):
1323         (WebCore::Position::isCandidate const):
1324         (WebCore::Position::rendersInDifferentPosition const):
1325         * dom/PositionIterator.cpp:
1326         (WebCore::PositionIterator::isCandidate const):
1327         * dom/PseudoElement.cpp:
1328         (WebCore::PseudoElement::pseudoElementNameForEvents):
1329         (WebCore::PseudoElement::PseudoElement):
1330         * dom/VisitedLinkState.cpp:
1331         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
1332         * dom/VisitedLinkState.h:
1333         (WebCore::VisitedLinkState::determineLinkState):
1334         * editing/Editing.cpp:
1335         (WebCore::isSpecialHTMLElement):
1336         (WebCore::isNodeRendered):
1337         * editing/TextIterator.cpp:
1338         (WebCore::hasVisibleTextNode):
1339         (WebCore::TextIterator::handleTextNode):
1340         (WebCore::TextIterator::handleTextBox):
1341         (WebCore::TextIterator::handleTextNodeFirstLetter):
1342         (WebCore::TextIterator::handleReplacedElement):
1343         (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
1344         (WebCore::SimplifiedBackwardsTextIterator::advance):
1345         * editing/VisibleUnits.cpp:
1346         (WebCore::findStartOfParagraph):
1347         (WebCore::findEndOfParagraph):
1348         * editing/ios/EditorIOS.mm:
1349         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
1350         * html/HTMLAreaElement.cpp:
1351         (WebCore::HTMLAreaElement::isFocusable const):
1352         * html/HTMLFormElement.cpp:
1353         (WebCore::HTMLFormElement::rendererIsNeeded):
1354         * html/HTMLIFrameElement.cpp:
1355         (WebCore::HTMLIFrameElement::rendererIsNeeded):
1356         * html/HTMLInputElement.cpp:
1357         (WebCore::HTMLInputElement::createInnerTextStyle):
1358         * html/HTMLOptGroupElement.cpp:
1359         (WebCore::HTMLOptGroupElement::isFocusable const):
1360         * html/HTMLOptionElement.cpp:
1361         (WebCore::HTMLOptionElement::isFocusable const):
1362         * html/HTMLTextAreaElement.cpp:
1363         (WebCore::HTMLTextAreaElement::createInnerTextStyle):
1364         * html/HTMLTextFormControlElement.cpp:
1365         (WebCore::HTMLTextFormControlElement::setSelectionRange):
1366         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
1367         * html/MediaElementSession.cpp:
1368         (WebCore::MediaElementSession::autoplayPermitted const):
1369         (WebCore::isMainContentForPurposesOfAutoplay):
1370         * html/RubyElement.cpp:
1371         (WebCore::RubyElement::createElementRenderer):
1372         * html/RubyTextElement.cpp:
1373         (WebCore::RubyTextElement::createElementRenderer):
1374         * html/shadow/TextControlInnerElements.cpp:
1375         (WebCore::TextControlInnerElement::resolveCustomStyle):
1376         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
1377         * inspector/InspectorOverlay.cpp:
1378         (WebCore::buildObjectForElementData):
1379         * inspector/agents/InspectorCSSAgent.cpp:
1380         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
1381         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
1382         * inspector/agents/InspectorDOMAgent.cpp:
1383         (WebCore::pseudoElementType):
1384         (WebCore::InspectorDOMAgent::buildObjectForNode):
1385         * inspector/agents/InspectorLayerTreeAgent.cpp:
1386         (WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
1387         * layout/layouttree/LayoutBox.cpp:
1388         (WebCore::Layout::Box::isInlineBlockBox const):
1389         (WebCore::Layout::Box::isBlockLevelBox const):
1390         (WebCore::Layout::Box::isInlineLevelBox const):
1391         (WebCore::Layout::Box::isBlockContainerBox const):
1392         * page/EventHandler.cpp:
1393         (WebCore::EventHandler::selectCursor):
1394         * page/Frame.cpp:
1395         (WebCore::Frame::searchForLabelsAboveCell):
1396         (WebCore::Frame::searchForLabelsBeforeElement):
1397         * page/FrameView.cpp:
1398         (WebCore::FrameView::createScrollbar):
1399         (WebCore::FrameView::adjustScrollStepForFixedContent):
1400         (WebCore::FrameView::updateScrollCorner):
1401         * page/animation/AnimationBase.cpp:
1402         (WebCore::AnimationBase::playStatePlaying const):
1403         (WebCore::AnimationBase::updatePlayState):
1404         * page/animation/AnimationBase.h:
1405         * page/animation/CSSPropertyAnimation.cpp:
1406         (WebCore::blendFunc):
1407         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1408         * page/animation/CompositeAnimation.cpp:
1409         (WebCore::CompositeAnimation::updateTransitions):
1410         (WebCore::CompositeAnimation::updateKeyframeAnimations):
1411         (WebCore::CompositeAnimation::suspendAnimations):
1412         (WebCore::CompositeAnimation::resumeAnimations):
1413         * page/animation/KeyframeAnimation.cpp:
1414         (WebCore::KeyframeAnimation::animate):
1415         * page/ios/FrameIOS.mm:
1416         (WebCore::Frame::nodeRespondingToClickEvents):
1417         * platform/animation/Animation.cpp:
1418         (WebCore::Animation::Animation):
1419         * platform/animation/Animation.h:
1420         (WebCore::Animation::clearPlayState):
1421         (WebCore::Animation::fillMode const):
1422         (WebCore::Animation::playState const):
1423         (WebCore::Animation::setFillMode):
1424         (WebCore::Animation::setPlayState):
1425         (WebCore::Animation::fillsBackwards const):
1426         (WebCore::Animation::fillsForwards const):
1427         (WebCore::Animation::initialFillMode):
1428         (WebCore::Animation::initialPlayState):
1429         * platform/graphics/GraphicsTypes.h:
1430         * platform/graphics/ca/GraphicsLayerCA.cpp:
1431         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1432         * platform/ios/wak/WAKWindow.mm:
1433         (-[WAKWindow dumpTiles]):
1434         * platform/mac/WebCoreNSURLExtras.mm:
1435         (WebCore::isLookalikeCharacter):
1436         * rendering/ClipPathOperation.h:
1437         * rendering/InlineBox.h:
1438         (WebCore::InlineBox::visibleToHitTesting const):
1439         * rendering/InlineFlowBox.cpp:
1440         (WebCore::InlineFlowBox::addToLine):
1441         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
1442         (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
1443         (WebCore::InlineFlowBox::paint):
1444         (WebCore::InlineFlowBox::paintBoxDecorations):
1445         (WebCore::InlineFlowBox::paintMask):
1446         (WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
1447         (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
1448         (WebCore::InlineFlowBox::collectLeafBoxesInLogicalOrder const):
1449         * rendering/InlineFlowBox.h:
1450         (WebCore::InlineFlowBox::InlineFlowBox):
1451         * rendering/InlineTextBox.cpp:
1452         (WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
1453         (WebCore::InlineTextBox::paint):
1454         (WebCore::InlineTextBox::createTextRun const):
1455         * rendering/PointerEventsHitRules.cpp:
1456         (WebCore::PointerEventsHitRules::PointerEventsHitRules):
1457         * rendering/PointerEventsHitRules.h:
1458         * rendering/RenderBlock.cpp:
1459         (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
1460         (WebCore::RenderBlock::paint):
1461         (WebCore::RenderBlock::paintObject):
1462         (WebCore::RenderBlock::shouldPaintSelectionGaps const):
1463         (WebCore::RenderBlock::adjustLogicalLeftOffsetForLine const):
1464         (WebCore::RenderBlock::adjustLogicalRightOffsetForLine const):
1465         (WebCore::isChildHitTestCandidate):
1466         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
1467         (WebCore::RenderBlock::firstLineBlock const):
1468         (WebCore::findFirstLetterBlock):
1469         (WebCore::RenderBlock::getFirstLetter):
1470         (WebCore::RenderBlock::createAnonymousBlockWithStyleAndDisplay):
1471         (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
1472         (WebCore::RenderBlock::constructTextRun):
1473         (WebCore::RenderBlock::layoutExcludedChildren):
1474         * rendering/RenderBlock.h:
1475         (WebCore::RenderBlock::createAnonymousWithParentRendererAndDisplay):
1476         (WebCore::RenderBlock::createAnonymousBlock const):
1477         * rendering/RenderBlockFlow.cpp:
1478         (WebCore::RenderBlockFlow::willCreateColumns const):
1479         (WebCore::RenderBlockFlow::layoutBlock):
1480         (WebCore::RenderBlockFlow::applyBeforeBreak):
1481         (WebCore::RenderBlockFlow::applyAfterBreak):
1482         (WebCore::RenderBlockFlow::adjustForUnsplittableChild):
1483         (WebCore::RenderBlockFlow::updateStylesForColumnChildren):
1484         (WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
1485         (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const):
1486         (WebCore::RenderBlockFlow::adjustForBorderFit const):
1487         (WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded):
1488         (WebCore::RenderBlockFlow::lineAtIndex const):
1489         (WebCore::RenderBlockFlow::lineCount const):
1490         (WebCore::getHeightForLineCount):
1491         (WebCore::RenderBlockFlow::clearTruncation):
1492         (WebCore::RenderBlockFlow::findClosestTextAtAbsolutePoint):
1493         (WebCore::RenderBlockFlow::lineCountForTextAutosizing):
1494         (WebCore::RenderBlockFlow::setComputedColumnCountAndWidth):
1495         (WebCore::RenderBlockFlow::updateColumnProgressionFromStyle):
1496         (WebCore::RenderBlockFlow::isTopLayoutOverflowAllowed const):
1497         (WebCore::RenderBlockFlow::isLeftLayoutOverflowAllowed const):
1498         * rendering/RenderBlockFlow.h:
1499         * rendering/RenderBlockLineLayout.cpp:
1500         (WebCore::RenderBlockFlow::constructLine):
1501         (WebCore::RenderBlockFlow::textAlignmentForLine const):
1502         (WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
1503         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
1504         (WebCore::expansionBehaviorForInlineTextBox):
1505         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1506         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1507         (WebCore::RenderBlockFlow::checkFloatInCleanLine):
1508         (WebCore::RenderBlockFlow::deleteEllipsisLineBoxes):
1509         (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
1510         (WebCore::RenderBlockFlow::startAlignedOffsetForLine):
1511         * rendering/RenderBox.cpp:
1512         (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
1513         (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
1514         (WebCore::isCandidateForOpaquenessTest):
1515         (WebCore::RenderBox::paintMask):
1516         (WebCore::RenderBox::paintClippingMask):
1517         (WebCore::RenderBox::positionLineBox):
1518         (WebCore::RenderBox::clippedOverflowRectForRepaint const):
1519         (WebCore::RenderBox::computeLogicalWidthInFragment const):
1520         (WebCore::RenderBox::computeInlineDirectionMargins const):
1521         (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation const):
1522         (WebCore::RenderBox::positionForPoint):
1523         (WebCore::RenderBox::isUnsplittableForPagination const):
1524         * rendering/RenderBoxModelObject.cpp:
1525         (WebCore::RenderBoxModelObject::localCaretRectForEmptyElement):
1526         * rendering/RenderBoxModelObject.h:
1527         * rendering/RenderCounter.cpp:
1528         (WebCore::planCounter):
1529         (WebCore::RenderCounter::originalText const):
1530         * rendering/RenderDeprecatedFlexibleBox.cpp:
1531         (WebCore::childDoesNotAffectWidthOrFlexing):
1532         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
1533         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
1534         * rendering/RenderDetailsMarker.cpp:
1535         (WebCore::RenderDetailsMarker::paint):
1536         * rendering/RenderElement.cpp:
1537         (WebCore::RenderElement::createFor):
1538         (WebCore::RenderElement::computeFirstLineStyle const):
1539         (WebCore::RenderElement::propagateStyleToAnonymousChildren):
1540         (WebCore::RenderElement::styleWillChange):
1541         (WebCore::RenderElement::insertedIntoTree):
1542         (WebCore::RenderElement::willBeRemovedFromTree):
1543         (WebCore::RenderElement::repaintAfterLayoutIfNeeded):
1544         (WebCore::RenderElement::isVisibleInDocumentRect const):
1545         (WebCore::RenderElement::getCachedPseudoStyle const):
1546         (WebCore::RenderElement::getUncachedPseudoStyle const):
1547         (WebCore::RenderElement::selectionPseudoStyle const):
1548         * rendering/RenderElement.h:
1549         (WebCore::RenderElement::visibleToHitTesting const):
1550         * rendering/RenderFileUploadControl.cpp:
1551         (WebCore::RenderFileUploadControl::paintObject):
1552         * rendering/RenderFullScreen.cpp:
1553         (WebCore::createFullScreenStyle):
1554         * rendering/RenderGrid.cpp:
1555         (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat const):
1556         * rendering/RenderImage.cpp:
1557         (WebCore::RenderImage::repaintOrMarkForLayout):
1558         * rendering/RenderInline.cpp:
1559         (WebCore::RenderInline::willBeDestroyed):
1560         (WebCore::updateStyleOfAnonymousBlockContinuations):
1561         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
1562         (WebCore::RenderInline::clippedOverflowRectForRepaint const):
1563         (WebCore::RenderInline::addAnnotatedRegions):
1564         * rendering/RenderLayer.cpp:
1565         (WebCore::RenderLayer::RenderLayer):
1566         (WebCore::RenderLayer::updateDescendantDependentFlags):
1567         (WebCore::RenderLayer::createScrollbar):
1568         (WebCore::styleRequiresScrollbar):
1569         (WebCore::styleDefinesAutomaticScrollbar):
1570         (WebCore::computeReferenceBox):
1571         (WebCore::RenderLayer::calculateClipRects const):
1572         * rendering/RenderLayerBacking.cpp:
1573         (WebCore::RenderLayerBacking::updateAfterDescendants):
1574         * rendering/RenderLayerCompositor.cpp:
1575         (WebCore::scrollbarHasDisplayNone):
1576         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
1577         (WebCore::RenderLayerCompositor::requiresCompositingForFrame const):
1578         * rendering/RenderListBox.cpp:
1579         (WebCore::RenderListBox::paintObject):
1580         (WebCore::itemOffsetForAlignment):
1581         (WebCore::RenderListBox::paintItemForeground):
1582         (WebCore::RenderListBox::paintItemBackground):
1583         (WebCore::RenderListBox::createScrollbar):
1584         * rendering/RenderListItem.cpp:
1585         (WebCore::RenderListItem::computeMarkerStyle const):
1586         * rendering/RenderListMarker.cpp:
1587         (WebCore::effectiveListMarkerType):
1588         (WebCore::listMarkerSuffix):
1589         (WebCore::listMarkerText):
1590         (WebCore::RenderListMarker::paint):
1591         (WebCore::RenderListMarker::updateContent):
1592         (WebCore::RenderListMarker::computePreferredLogicalWidths):
1593         (WebCore::RenderListMarker::updateMargins):
1594         (WebCore::RenderListMarker::suffix const):
1595         (WebCore::RenderListMarker::isInside const):
1596         (WebCore::RenderListMarker::getRelativeMarkerRect):
1597         * rendering/RenderListMarker.h:
1598         * rendering/RenderMediaControlElements.cpp:
1599         (WebCore::RenderMediaVolumeSliderContainer::layout):
1600         (WebCore::RenderTextTrackContainerElement::layout):
1601         * rendering/RenderMenuList.cpp:
1602         (WebCore::RenderMenuList::adjustInnerStyle):
1603         (WebCore::if):
1604         (RenderMenuList::itemStyle const):
1605         (RenderMenuList::menuStyle const):
1606         (RenderMenuList::createScrollbar):
1607         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
1608         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
1609         * rendering/RenderObject.cpp:
1610         (WebCore::RenderObject::addAnnotatedRegions):
1611         * rendering/RenderObject.h:
1612         (WebCore::RenderObject::isAnonymousBlock const):
1613         (WebCore::RenderObject::isBeforeContent const):
1614         (WebCore::RenderObject::isAfterContent const):
1615         * rendering/RenderReplaced.cpp:
1616         (WebCore::RenderReplaced::shouldPaint):
1617         (WebCore::RenderReplaced::clippedOverflowRectForRepaint const):
1618         * rendering/RenderRubyBase.cpp:
1619         (WebCore::RenderRubyBase::textAlignmentForLine const):
1620         * rendering/RenderRubyBase.h:
1621         * rendering/RenderRubyRun.cpp:
1622         (WebCore::RenderRubyRun::createRubyBase const):
1623         (WebCore::RenderRubyRun::staticCreateRubyRun):
1624         (WebCore::RenderRubyRun::layoutBlock):
1625         * rendering/RenderRubyText.cpp:
1626         (WebCore::RenderRubyText::textAlignmentForLine const):
1627         (WebCore::RenderRubyText::adjustInlineDirectionLineBounds const):
1628         * rendering/RenderRubyText.h:
1629         * rendering/RenderScrollbar.cpp:
1630         (WebCore::pseudoForScrollbarPart):
1631         (WebCore::RenderScrollbar::updateScrollbarPart):
1632         * rendering/RenderSearchField.cpp:
1633         (WebCore::RenderSearchField::updateCancelButtonVisibility const):
1634         (WebCore::RenderSearchField::visibilityForCancelButton const):
1635         (WebCore::RenderSearchField::menuStyle const):
1636         (WebCore::RenderSearchField::createScrollbar):
1637         * rendering/RenderSearchField.h:
1638         * rendering/RenderTable.cpp:
1639         (WebCore::RenderTable::willInsertTableSection):
1640         (WebCore::RenderTable::layoutCaptions):
1641         (WebCore::RenderTable::layout):
1642         (WebCore::RenderTable::paintObject):
1643         (WebCore::RenderTable::adjustBorderBoxRectForPainting):
1644         (WebCore::RenderTable::paintMask):
1645         (WebCore::RenderTable::recalcSections const):
1646         (WebCore::RenderTable::createTableWithStyle):
1647         * rendering/RenderTableCell.cpp:
1648         (WebCore::RenderTableCell::styleDidChange):
1649         (WebCore::RenderTableCell::paintCollapsedBorders):
1650         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
1651         (WebCore::RenderTableCell::paintBoxDecorations):
1652         (WebCore::RenderTableCell::paintMask):
1653         (WebCore::RenderTableCell::createTableCellWithStyle):
1654         * rendering/RenderTableCol.cpp:
1655         (WebCore::RenderTableCol::updateFromElement):
1656         (WebCore::RenderTableCol::isChildAllowed const):
1657         * rendering/RenderTableCol.h:
1658         * rendering/RenderTableRow.cpp:
1659         (WebCore::RenderTableRow::styleDidChange):
1660         (WebCore::RenderTableRow::paintOutlineForRowIfNeeded):
1661         (WebCore::RenderTableRow::createTableRowWithStyle):
1662         * rendering/RenderTableSection.cpp:
1663         (WebCore::RenderTableSection::addCell):
1664         (WebCore::RenderTableSection::paint):
1665         (WebCore::RenderTableSection::createTableSectionWithStyle):
1666         * rendering/RenderText.cpp:
1667         (WebCore::RenderText::styleDidChange):
1668         (WebCore::RenderText::computePreferredLogicalWidths):
1669         (WebCore::applyTextTransform):
1670         * rendering/RenderTextFragment.cpp:
1671         (WebCore::RenderTextFragment::styleDidChange):
1672         (WebCore::RenderTextFragment::blockForAccompanyingFirstLetter):
1673         * rendering/RenderTheme.cpp:
1674         (WebCore::RenderTheme::adjustStyle):
1675         * rendering/RenderThemeMac.mm:
1676         (WebCore::RenderThemeMac::adjustMenuListStyle const):
1677         * rendering/RenderThemeWin.cpp:
1678         (WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
1679         * rendering/RenderView.cpp:
1680         (WebCore::rendererObscuresBackground):
1681         * rendering/RenderWidget.cpp:
1682         (WebCore::RenderWidget::setWidget):
1683         (WebCore::RenderWidget::styleDidChange):
1684         * rendering/RootInlineBox.cpp:
1685         (WebCore::RootInlineBox::paintEllipsisBox const):
1686         (WebCore::RootInlineBox::lineSnapAdjustment const):
1687         (WebCore::RootInlineBox::lineSelectionGap):
1688         (WebCore::RootInlineBox::computeCaretRect const):
1689         * rendering/SimpleLineLayout.cpp:
1690         (WebCore::SimpleLineLayout::canUseForFontAndText):
1691         (WebCore::SimpleLineLayout::canUseForStyle):
1692         (WebCore::SimpleLineLayout::computeLineLeft):
1693         (WebCore::SimpleLineLayout::updateLineConstrains):
1694         (WebCore::SimpleLineLayout::createLineRuns):
1695         (WebCore::SimpleLineLayout::textAlignForLine):
1696         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
1697         * rendering/SimpleLineLayoutFunctions.cpp:
1698         (WebCore::SimpleLineLayout::paintFlow):
1699         (WebCore::SimpleLineLayout::hitTestFlow):
1700         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1701         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
1702         * rendering/SimpleLineLayoutTextFragmentIterator.h:
1703         * rendering/TextDecorationPainter.cpp:
1704         (WebCore::textDecorationStyleToStrokeStyle):
1705         (WebCore::TextDecorationPainter::paintTextDecoration):
1706         (WebCore::collectStylesForRenderer):
1707         * rendering/TextDecorationPainter.h:
1708         * rendering/line/BreakingContext.h:
1709         (WebCore::BreakingContext::BreakingContext):
1710         (WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
1711         (WebCore::BreakingContext::handleBR):
1712         (WebCore::BreakingContext::handleOutOfFlowPositioned):
1713         (WebCore::BreakingContext::handleText):
1714         (WebCore::BreakingContext::canBreakAtThisPosition):
1715         (WebCore::BreakingContext::handleEndOfLine):
1716         * rendering/line/LineInlineHeaders.h:
1717         (WebCore::shouldCollapseWhiteSpace):
1718         * rendering/line/LineWidth.cpp:
1719         (WebCore::newFloatShrinksLine):
1720         * rendering/mathml/MathOperator.cpp:
1721         (WebCore::MathOperator::paint):
1722         * rendering/mathml/RenderMathMLFraction.cpp:
1723         (WebCore::RenderMathMLFraction::paint):
1724         * rendering/mathml/RenderMathMLMath.cpp:
1725         (WebCore::RenderMathMLMath::layoutBlock):
1726         * rendering/mathml/RenderMathMLMenclose.cpp:
1727         (WebCore::RenderMathMLMenclose::paint):
1728         * rendering/mathml/RenderMathMLRoot.cpp:
1729         (WebCore::RenderMathMLRoot::paint):
1730         * rendering/mathml/RenderMathMLToken.cpp:
1731         (WebCore::RenderMathMLToken::paint):
1732         * rendering/shapes/BoxShape.cpp:
1733         (WebCore::computeRoundedRectForBoxShape):
1734         * rendering/shapes/ShapeOutsideInfo.cpp:
1735         (WebCore::referenceBox):
1736         (WebCore::ShapeOutsideInfo::setReferenceBoxLogicalSize):
1737         (WebCore::ShapeOutsideInfo::logicalTopOffset const):
1738         (WebCore::ShapeOutsideInfo::logicalLeftOffset const):
1739         * rendering/style/CounterContent.h:
1740         (WebCore::CounterContent::CounterContent):
1741         (WebCore::CounterContent::listStyle const):
1742         * rendering/style/RenderStyle.cpp:
1743         (WebCore::RenderStyle::createAnonymousStyleWithDisplay):
1744         (WebCore::RenderStyle::createStyleInheritingFromPseudoStyle):
1745         (WebCore::RenderStyle::RenderStyle):
1746         (WebCore::RenderStyle::hasUniquePseudoStyle const):
1747         (WebCore::RenderStyle::getCachedPseudoStyle const):
1748         (WebCore::RenderStyle::addCachedPseudoStyle):
1749         (WebCore::RenderStyle::changeRequiresLayout const):
1750         (WebCore::requiresPainting):
1751         (WebCore::RenderStyle::hyphenString const):
1752         (WebCore::RenderStyle::textEmphasisMarkString const):
1753         (WebCore::RenderStyle::visitedDependentColor const):
1754         (WebCore::RenderStyle::textEmphasisMark const):
1755         (WebCore::RenderStyle::setColumnStylesFromPaginationMode):
1756         * rendering/style/RenderStyle.h:
1757         (WebCore::RenderStyle::setStyleType):
1758         (WebCore::RenderStyle::setRTLOrdering):
1759         (WebCore::RenderStyle::display const):
1760         (WebCore::RenderStyle::visibility const):
1761         (WebCore::RenderStyle::textAlign const):
1762         (WebCore::RenderStyle::textTransform const):
1763         (WebCore::RenderStyle::whiteSpace const):
1764         (WebCore::RenderStyle::emptyCells const):
1765         (WebCore::RenderStyle::captionSide const):
1766         (WebCore::RenderStyle::listStyleType const):
1767         (WebCore::RenderStyle::listStylePosition const):
1768         (WebCore::RenderStyle::cursor const):
1769         (WebCore::RenderStyle::insideLink const):
1770         (WebCore::RenderStyle::borderFit const):
1771         (WebCore::RenderStyle::pointerEvents const):
1772         (WebCore::RenderStyle::setDisplay):
1773         (WebCore::RenderStyle::setOriginalDisplay):
1774         (WebCore::RenderStyle::setVisibility):
1775         (WebCore::RenderStyle::setTextAlign):
1776         (WebCore::RenderStyle::setTextTransform):
1777         (WebCore::RenderStyle::setTextDecorationStyle):
1778         (WebCore::RenderStyle::setTextDecorationSkip):
1779         (WebCore::RenderStyle::setTextUnderlinePosition):
1780         (WebCore::RenderStyle::setDirection):
1781         (WebCore::RenderStyle::setTextZoom):
1782         (WebCore::RenderStyle::setWhiteSpace):
1783         (WebCore::RenderStyle::setEmptyCells):
1784         (WebCore::RenderStyle::setCaptionSide):
1785         (WebCore::RenderStyle::setListStyleType):
1786         (WebCore::RenderStyle::setListStylePosition):
1787         (WebCore::RenderStyle::setCursor):
1788         (WebCore::RenderStyle::setCursorVisibility):
1789         (WebCore::RenderStyle::setInsideLink):
1790         (WebCore::RenderStyle::setHyphens):
1791         (WebCore::RenderStyle::setBorderFit):
1792         (WebCore::RenderStyle::setColumnAxis):
1793         (WebCore::RenderStyle::setColumnProgression):
1794         (WebCore::RenderStyle::setTextEmphasisFill):
1795         (WebCore::RenderStyle::setTextEmphasisMark):
1796         (WebCore::RenderStyle::setRubyPosition):
1797         (WebCore::RenderStyle::setBreakBefore):
1798         (WebCore::RenderStyle::setBreakAfter):
1799         (WebCore::RenderStyle::setBreakInside):
1800         (WebCore::RenderStyle::setHangingPunctuation):
1801         (WebCore::RenderStyle::setLineSnap):
1802         (WebCore::RenderStyle::setLineAlign):
1803         (WebCore::RenderStyle::setPointerEvents):
1804         (WebCore::RenderStyle::initialDisplay):
1805         (WebCore::RenderStyle::initialBreakBetween):
1806         (WebCore::RenderStyle::initialBreakInside):
1807         (WebCore::RenderStyle::initialCaptionSide):
1808         (WebCore::RenderStyle::initialColumnAxis):
1809         (WebCore::RenderStyle::initialColumnProgression):
1810         (WebCore::RenderStyle::initialEmptyCells):
1811         (WebCore::RenderStyle::initialListStylePosition):
1812         (WebCore::RenderStyle::initialListStyleType):
1813         (WebCore::RenderStyle::initialTextTransform):
1814         (WebCore::RenderStyle::initialVisibility):
1815         (WebCore::RenderStyle::initialWhiteSpace):
1816         (WebCore::RenderStyle::initialCursor):
1817         (WebCore::RenderStyle::initialTextAlign):
1818         (WebCore::RenderStyle::initialTextDecorationStyle):
1819         (WebCore::RenderStyle::initialTextZoom):
1820         (WebCore::RenderStyle::initialHyphens):
1821         (WebCore::RenderStyle::initialBorderFit):
1822         (WebCore::RenderStyle::initialRTLOrdering):
1823         (WebCore::RenderStyle::initialPointerEvents):
1824         (WebCore::RenderStyle::initialTextEmphasisColor):
1825         (WebCore::RenderStyle::initialTextEmphasisFill):
1826         (WebCore::RenderStyle::initialTextEmphasisMark):
1827         (WebCore::RenderStyle::initialRubyPosition):
1828         (WebCore::RenderStyle::initialImageResolutionSource):
1829         (WebCore::RenderStyle::initialImageResolutionSnap):
1830         (WebCore::RenderStyle::initialTextAlignLast):
1831         (WebCore::RenderStyle::initialTextJustify):
1832         (WebCore::RenderStyle::initialCursorVisibility):
1833         (WebCore::RenderStyle::initialGridAutoRepeatType):
1834         (WebCore::RenderStyle::initialLineSnap):
1835         (WebCore::RenderStyle::initialLineAlign):
1836         (WebCore::RenderStyle::NonInheritedFlags::hasAnyPublicPseudoStyles const):
1837         (WebCore::RenderStyle::originalDisplay const):
1838         (WebCore::RenderStyle::NonInheritedFlags::hasPseudoStyle const):
1839         (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyle):
1840         (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyles):
1841         (WebCore::RenderStyle::autoWrap):
1842         (WebCore::RenderStyle::preserveNewline):
1843         (WebCore::RenderStyle::collapseWhiteSpace):
1844         (WebCore::RenderStyle::breakOnlyAfterWhiteSpace const):
1845         (WebCore::RenderStyle::hasInlineColumnAxis const):
1846         (WebCore::RenderStyle::isDisplayRegionType const):
1847         (WebCore::RenderStyle::isDisplayReplacedType):
1848         (WebCore::RenderStyle::isDisplayInlineType):
1849         (WebCore::RenderStyle::isDisplayFlexibleBox):
1850         (WebCore::RenderStyle::isDisplayGridBox):
1851         (WebCore::RenderStyle::isDisplayFlexibleOrGridBox):
1852         (WebCore::pseudoElementRendererIsNeeded):
1853         * rendering/style/RenderStyleConstants.cpp:
1854         (WebCore::operator<<):
1855         (WebCore::alwaysPageBreak):
1856         * rendering/style/RenderStyleConstants.h:
1857         (WebCore::PseudoIdSet::has const):
1858         (WebCore::PseudoIdSet::add):
1859         * rendering/style/ShapeValue.h:
1860         * rendering/style/StyleMultiColData.cpp:
1861         (WebCore::StyleMultiColData::StyleMultiColData):
1862         * rendering/style/StyleRareInheritedData.cpp:
1863         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1864         * rendering/style/StyleRareNonInheritedData.cpp:
1865         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1866         * rendering/style/StyleRareNonInheritedData.h:
1867         * rendering/svg/RenderSVGContainer.cpp:
1868         (WebCore::RenderSVGContainer::paint):
1869         * rendering/svg/RenderSVGImage.cpp:
1870         (WebCore::RenderSVGImage::paint):
1871         (WebCore::RenderSVGImage::nodeAtFloatPoint):
1872         * rendering/svg/RenderSVGInlineText.cpp:
1873         (WebCore::RenderSVGInlineText::styleDidChange):
1874         * rendering/svg/RenderSVGModelObject.cpp:
1875         (WebCore::RenderSVGModelObject::checkIntersection):
1876         (WebCore::RenderSVGModelObject::checkEnclosure):
1877         * rendering/svg/RenderSVGResource.cpp:
1878         (WebCore::requestPaintingResource):
1879         * rendering/svg/RenderSVGResourceClipper.cpp:
1880         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
1881         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
1882         (WebCore::RenderSVGResourceClipper::calculateClipContentRepaintRect):
1883         * rendering/svg/RenderSVGResourceMasker.cpp:
1884         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
1885         (WebCore::RenderSVGResourceMasker::calculateMaskContentRepaintRect):
1886         * rendering/svg/RenderSVGRoot.cpp:
1887         (WebCore::RenderSVGRoot::clippedOverflowRectForRepaint const):
1888         * rendering/svg/RenderSVGShape.cpp:
1889         (WebCore::RenderSVGShape::paint):
1890         (WebCore::RenderSVGShape::nodeAtFloatPoint):
1891         * rendering/svg/RenderSVGText.cpp:
1892         (WebCore::RenderSVGText::nodeAtFloatPoint):
1893         * rendering/svg/SVGInlineTextBox.cpp:
1894         (WebCore::SVGInlineTextBox::paintSelectionBackground):
1895         (WebCore::SVGInlineTextBox::paint):
1896         (WebCore::SVGInlineTextBox::constructTextRun const):
1897         (WebCore::SVGInlineTextBox::paintDecoration):
1898         (WebCore::SVGInlineTextBox::nodeAtPoint):
1899         * rendering/svg/SVGRenderSupport.cpp:
1900         (WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
1901         * rendering/svg/SVGRenderingContext.cpp:
1902         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1903         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
1904         (WebCore::processRenderSVGInlineText):
1905         * rendering/svg/SVGTextMetricsBuilder.cpp:
1906         (WebCore::SVGTextMetricsBuilder::measureTextRenderer):
1907         * rendering/updating/RenderTreeBuilderBlock.cpp:
1908         (WebCore::RenderTreeBuilder::Block::detach):
1909         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
1910         (WebCore::styleForFirstLetter):
1911         (WebCore::RenderTreeBuilder::FirstLetter::updateAfterDescendants):
1912         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
1913         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
1914         * rendering/updating/RenderTreeBuilderInline.cpp:
1915         (WebCore::RenderTreeBuilder::Inline::attachIgnoringContinuation):
1916         (WebCore::RenderTreeBuilder::Inline::newChildIsInline):
1917         * rendering/updating/RenderTreeBuilderList.cpp:
1918         (WebCore::RenderTreeBuilder::List::updateItemMarker):
1919         * rendering/updating/RenderTreeBuilderMathML.cpp:
1920         (WebCore::RenderTreeBuilder::MathML::createMathMLOperator):
1921         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
1922         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
1923         (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
1924         * rendering/updating/RenderTreeBuilderRuby.cpp:
1925         (WebCore::isAnonymousRubyInlineBlock):
1926         (WebCore::isRubyBeforeBlock):
1927         (WebCore::isRubyAfterBlock):
1928         (WebCore::createAnonymousRubyInlineBlock):
1929         * rendering/updating/RenderTreeBuilderTable.cpp:
1930         (WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
1931         * rendering/updating/RenderTreeUpdater.cpp:
1932         (WebCore::RenderTreeUpdater::updateBeforeDescendants):
1933         (WebCore::RenderTreeUpdater::updateAfterDescendants):
1934         (WebCore::RenderTreeUpdater::updateElementRenderer):
1935         (WebCore::elementImplicitVisibility):
1936         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
1937         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
1938         * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
1939         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
1940         * style/InlineTextBoxStyle.cpp:
1941         (WebCore::visualOverflowForDecorations):
1942         * style/StyleChange.cpp:
1943         (WebCore::Style::determineChange):
1944         * style/StyleFontSizeFunctions.cpp:
1945         (WebCore::Style::computedFontSizeFromSpecifiedSize):
1946         * style/StyleResolveForDocument.cpp:
1947         (WebCore::Style::resolveForDocument):
1948         * style/StyleSharingResolver.cpp:
1949         * style/StyleTreeResolver.cpp:
1950         (WebCore::Style::affectsRenderedSubtree):
1951         (WebCore::Style::TreeResolver::resolveElement):
1952         (WebCore::Style::TreeResolver::resolvePseudoStyle):
1953         (WebCore::Style::TreeResolver::parentBoxStyle const):
1954         (WebCore::Style::createInheritedDisplayContentsStyleIfNeeded):
1955         (WebCore::Style::TreeResolver::resolveComposedTree):
1956         * svg/SVGElement.h:
1957         * svg/SVGGElement.cpp:
1958         (WebCore::SVGGElement::createElementRenderer):
1959
1960 2018-05-24  Chris Dumez  <cdumez@apple.com>
1961
1962         Enable subsampling for progressive JPEG images
1963         https://bugs.webkit.org/show_bug.cgi?id=185956
1964
1965         Reviewed by Said Abou-Hallawa.
1966
1967         Enable subsampling for progressive JPEG images now that it is supposed (rdar://problem/5191418).
1968         I verified locally that such images are still loading and do not cause any hang on iOS.
1969
1970         * platform/graphics/cg/ImageDecoderCG.cpp:
1971         (WebCore::ImageDecoderCG::frameAllowSubsamplingAtIndex const):
1972
1973 2018-05-24  Chris Dumez  <cdumez@apple.com>
1974
1975         Reduce copying of FontCascadeDescription objects by moving them around
1976         https://bugs.webkit.org/show_bug.cgi?id=185963
1977
1978         Reviewed by Simon Fraser.
1979
1980         Reduce copying of FontCascadeDescription objects by moving them around when possible.
1981
1982         * css/StyleBuilderCustom.h:
1983         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
1984         (WebCore::StyleBuilderCustom::applyInitialFontFamily):
1985         (WebCore::StyleBuilderCustom::applyInheritFontFamily):
1986         (WebCore::StyleBuilderCustom::applyValueFontFamily):
1987         (WebCore::StyleBuilderCustom::applyInheritFontVariantLigatures):
1988         (WebCore::StyleBuilderCustom::applyInitialFontVariantLigatures):
1989         (WebCore::StyleBuilderCustom::applyValueFontVariantLigatures):
1990         (WebCore::StyleBuilderCustom::applyInheritFontVariantNumeric):
1991         (WebCore::StyleBuilderCustom::applyInitialFontVariantNumeric):
1992         (WebCore::StyleBuilderCustom::applyValueFontVariantNumeric):
1993         (WebCore::StyleBuilderCustom::applyInheritFontVariantEastAsian):
1994         (WebCore::StyleBuilderCustom::applyInitialFontVariantEastAsian):
1995         (WebCore::StyleBuilderCustom::applyValueFontVariantEastAsian):
1996         (WebCore::StyleBuilderCustom::applyInitialFontSize):
1997         (WebCore::StyleBuilderCustom::applyInheritFontSize):
1998         (WebCore::StyleBuilderCustom::applyInitialFontStyle):
1999         (WebCore::StyleBuilderCustom::applyInheritFontStyle):
2000         (WebCore::StyleBuilderCustom::applyValueFontStyle):
2001         (WebCore::StyleBuilderCustom::applyValueFontSize):
2002         * css/StyleResolver.cpp:
2003         (WebCore::checkForOrientationChange):
2004         (WebCore::StyleResolver::checkForTextSizeAdjust):
2005         (WebCore::StyleResolver::checkForZoomChange):
2006         (WebCore::StyleResolver::checkForGenericFamilyChange):
2007         (WebCore::StyleResolver::initializeFontStyle):
2008         * css/StyleResolver.h:
2009         (WebCore::StyleResolver::State::setFontDescription):
2010         (WebCore::StyleResolver::setFontDescription):
2011         * css/makeprop.pl:
2012         (generateInitialValueSetter):
2013         (generateInheritValueSetter):
2014         (generateValueSetter):
2015         * html/canvas/CanvasRenderingContext2D.cpp:
2016         (WebCore::CanvasRenderingContext2D::setFont):
2017         * page/DebugPageOverlays.cpp:
2018         (WebCore::NonFastScrollableRegionOverlay::drawRect):
2019         * page/linux/ResourceUsageOverlayLinux.cpp:
2020         * platform/graphics/FontCascade.cpp:
2021         (WebCore::FontCascade::FontCascade):
2022         * platform/graphics/FontCascade.h:
2023         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2024         (PlatformCALayerWin::drawTextAtPoint const):
2025         * platform/mock/MockRealtimeVideoSource.cpp:
2026         (WebCore::MockRealtimeVideoSource::drawText):
2027         * platform/win/DragImageWin.cpp:
2028         (WebCore::dragLabelFont):
2029         * platform/win/PopupMenuWin.cpp:
2030         (WebCore::PopupMenuWin::calculatePositionAndSize):
2031         (WebCore::PopupMenuWin::paint):
2032         * rendering/RenderBox.cpp:
2033         (WebCore::RenderBox::styleDidChange):
2034         * rendering/RenderCombineText.cpp:
2035         (WebCore::RenderCombineText::combineTextIfNeeded):
2036         * rendering/RenderEmbeddedObject.cpp:
2037         (WebCore::RenderEmbeddedObject::getReplacementTextGeometry const):
2038         * rendering/RenderListBox.cpp:
2039         (WebCore::bolder):
2040         (WebCore::RenderListBox::paintItemForeground):
2041         * rendering/RenderListItem.cpp:
2042         (WebCore::RenderListItem::computeMarkerStyle const):
2043         * rendering/RenderTheme.cpp:
2044         (WebCore::RenderTheme::adjustStyle):
2045         * rendering/RenderThemeMac.mm:
2046         (WebCore::RenderThemeMac::setFontFromControlSize const):
2047         * rendering/TextAutoSizing.cpp:
2048         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
2049         (WebCore::TextAutoSizingValue::reset):
2050         * rendering/style/RenderStyle.cpp:
2051         (WebCore::RenderStyle::setFontDescription):
2052         (WebCore::RenderStyle::setFontSize):
2053         (WebCore::RenderStyle::setFontVariationSettings):
2054         (WebCore::RenderStyle::setFontWeight):
2055         (WebCore::RenderStyle::setFontStretch):
2056         (WebCore::RenderStyle::setFontItalic):
2057         * rendering/style/RenderStyle.h:
2058         * rendering/svg/RenderSVGInlineText.cpp:
2059         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
2060         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2061         (WebCore::styleForFirstLetter):
2062         * style/StyleResolveForDocument.cpp:
2063         (WebCore::Style::resolveForDocument):
2064
2065 2018-05-24  Chris Dumez  <cdumez@apple.com>
2066
2067         Avoid constructing the string "all" repeatedly in MediaQueryParser
2068         https://bugs.webkit.org/show_bug.cgi?id=185961
2069
2070         Reviewed by Simon Fraser.
2071
2072         Avoid constructing the string "all" repeatedly in MediaQueryParser by:
2073         - Having MediaQueryData use an std::optional<String> instead of a String
2074         - Updating MediaQueryParser to use a static to store the default media type
2075           and use it when the MediaQueryData's media type is std::nullopt.
2076
2077         Also do some cleanup.
2078
2079         * css/parser/MediaQueryParser.cpp:
2080         (WebCore::MediaQueryParser::commitMediaQuery):
2081         (WebCore::MediaQueryParser::MediaQueryData::MediaQueryData):
2082         (WebCore::MediaQueryParser::MediaQueryData::clear):
2083         (WebCore::MediaQueryParser::MediaQueryData::addExpression):
2084         (WebCore::MediaQueryParser::MediaQueryData::lastExpressionValid):
2085         (WebCore::MediaQueryParser::MediaQueryData::removeLastExpression):
2086         * css/parser/MediaQueryParser.h:
2087         (WebCore::MediaQueryParser::MediaQueryData::setMediaType):
2088         (WebCore::MediaQueryParser::MediaQueryData::restrictor const):
2089         (WebCore::MediaQueryParser::MediaQueryData::expressions):
2090         (WebCore::MediaQueryParser::MediaQueryData::mediaType const):
2091         (WebCore::MediaQueryParser::MediaQueryData::currentMediaQueryChanged const):
2092         (WebCore::MediaQueryParser::MediaQueryData::restrictor):
2093         (WebCore::MediaQueryParser::MediaQueryData::setRestrictor):
2094         (WebCore::MediaQueryParser::MediaQueryData::setMediaFeature):
2095         (WebCore::MediaQueryParser::MediaQueryData::setMediaQueryParserContext):
2096
2097 2018-05-24  Joseph Pecoraro  <pecoraro@apple.com>
2098
2099         [iOS] Hard link AppSupport instead of soft linking
2100         https://bugs.webkit.org/show_bug.cgi?id=185959
2101         <rdar://problem/40506538>
2102
2103         Reviewed by Timothy Horton.
2104
2105         * Configurations/WebCore.xcconfig:
2106         * platform/network/ios/NetworkStateNotifierIOS.mm:
2107         (-[WebNetworkStateObserver initWithBlock:]):
2108         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
2109
2110 2018-05-24  Chris Dumez  <cdumez@apple.com>
2111
2112         Cache navigator.userAgent for performance
2113         https://bugs.webkit.org/show_bug.cgi?id=185952
2114
2115         Reviewed by Geoffrey Garen.
2116
2117         Cache navigator.userAgent for performance. Previously, we would ask the client 5 times
2118         while loading apple.com.
2119
2120         * page/Navigator.cpp:
2121         (WebCore::Navigator::userAgent const):
2122         * page/Navigator.h:
2123         * page/NavigatorBase.h:
2124         * page/NavigatorID.idl:
2125         * page/WorkerNavigator.cpp:
2126         (WebCore::WorkerNavigator::userAgent const):
2127         * page/WorkerNavigator.h:
2128
2129 2018-05-24  Chris Dumez  <cdumez@apple.com>
2130
2131         Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds
2132         https://bugs.webkit.org/show_bug.cgi?id=185951
2133
2134         Reviewed by Geoffrey Garen.
2135
2136         Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds and slows down
2137         launch time. In particular, it is unnecessary to read NSDefaults to figure out which logging channels
2138         should be enabled.
2139
2140         * platform/mac/LoggingMac.mm:
2141         (WebCore::logLevelString):
2142         * platform/unix/LoggingUnix.cpp:
2143         (WebCore::logLevelString):
2144         * platform/win/LoggingWin.cpp:
2145         (WebCore::logLevelString):
2146
2147 2018-05-24  Chris Dumez  <cdumez@apple.com>
2148
2149         [iOS WK2] Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-fetch-event.https.html is a flaky failure
2150         https://bugs.webkit.org/show_bug.cgi?id=181499
2151         <rdar://problem/36443428>
2152
2153         Reviewed by Youenn Fablet.
2154
2155         After resolving a registration promise, we send an IPC back to the StorageProcess
2156         for synchronization purposes, to make sure the registration does not get updated
2157         before the promise's JS code has been executed. However, resolving a promise
2158         schedules a microtask to run the JS and we would therefore send the IPC back too
2159         early, thus causing flakiness. We now only send the IPC back back only after that
2160         microtask has run and the JS has been executed.
2161
2162         * bindings/js/JSDOMPromiseDeferred.cpp:
2163         (WebCore::DeferredPromise::callFunction):
2164         (WebCore::DeferredPromise::whenSettled):
2165         * bindings/js/JSDOMPromiseDeferred.h:
2166         * workers/service/ServiceWorkerContainer.cpp:
2167         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2168
2169 2018-05-24  Jinho Bang  <zino@chromium.org>
2170
2171         [PaymentRequest] Remove currencySystem member
2172         https://bugs.webkit.org/show_bug.cgi?id=185860
2173
2174         Reviewed by Andy Estes.
2175
2176         After a long discussion, Web Payment Working Group decided to remove
2177         the `currencySystem` member[1]. The currency code should be well-formed
2178         3-letter alphabetic code and is allowed even if that is not part of
2179         the official ISO 4217 list.
2180
2181         [1] https://github.com/w3c/payment-request/pull/694
2182
2183         Test: http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html
2184
2185         * Modules/paymentrequest/PaymentCurrencyAmount.h:
2186         * Modules/paymentrequest/PaymentCurrencyAmount.idl:
2187         * Modules/paymentrequest/PaymentRequest.cpp:
2188         (WebCore::checkAndCanonicalizeAmount):
2189         (WebCore::checkAndCanonicalizeTotal):
2190         * inspector/WebInjectedScriptHost.cpp:
2191         (WebCore::objectForPaymentCurrencyAmount):
2192
2193 2018-05-24  Zalan Bujtas  <zalan@apple.com>
2194
2195         [LFC] Implement position computation for inflow positioned elements
2196         https://bugs.webkit.org/show_bug.cgi?id=185936
2197
2198         Reviewed by Antti Koivisto.
2199
2200         * layout/blockformatting/BlockFormattingContext.cpp:
2201         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
2202         * layout/blockformatting/BlockFormattingContext.h:
2203         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2204         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
2205
2206 2018-05-24  Zalan Bujtas  <zalan@apple.com>
2207
2208         [LFC] Implement FormattingContext::placeInFlowPositionedChildren
2209         https://bugs.webkit.org/show_bug.cgi?id=185934
2210
2211         Reviewed by Antti Koivisto.
2212
2213         * layout/FormattingContext.cpp:
2214         (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const):
2215         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
2216         * layout/FormattingContext.h:
2217         * layout/blockformatting/BlockFormattingContext.cpp:
2218         (WebCore::Layout::BlockFormattingContext::layout const):
2219
2220 2018-05-23  Joseph Pecoraro  <pecoraro@apple.com>
2221
2222         Use ASCIILiteral with applicationBundleIsEqualTo in RuntimeApplicationChecksCocoa
2223         https://bugs.webkit.org/show_bug.cgi?id=185935
2224
2225         Reviewed by Yusuke Suzuki.
2226
2227         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2228         (WebCore::MacApplication::isSafari):
2229         (WebCore::MacApplication::isAppleMail):
2230         (WebCore::MacApplication::isIBooks):
2231         (WebCore::MacApplication::isITunes):
2232         (WebCore::MacApplication::isMicrosoftMessenger):
2233         (WebCore::MacApplication::isAdobeInstaller):
2234         (WebCore::MacApplication::isAOLInstantMessenger):
2235         (WebCore::MacApplication::isMicrosoftMyDay):
2236         (WebCore::MacApplication::isMicrosoftOutlook):
2237         (WebCore::MacApplication::isQuickenEssentials):
2238         (WebCore::MacApplication::isAperture):
2239         (WebCore::MacApplication::isVersions):
2240         (WebCore::MacApplication::isHRBlock):
2241         (WebCore::MacApplication::isIAdProducer):
2242         (WebCore::MacApplication::isSolidStateNetworksDownloader):
2243         (WebCore::IOSApplication::isMobileMail):
2244         (WebCore::IOSApplication::isMobileSafari):
2245         (WebCore::IOSApplication::isWebBookmarksD):
2246         (WebCore::IOSApplication::isDumpRenderTree):
2247         (WebCore::IOSApplication::isMobileStore):
2248         (WebCore::IOSApplication::isSpringBoard):
2249         (WebCore::IOSApplication::isWebApp):
2250         (WebCore::IOSApplication::isIBooks):
2251         (WebCore::IOSApplication::isIBooksStorytime):
2252         (WebCore::IOSApplication::isTheSecretSocietyHiddenMystery):
2253         (WebCore::IOSApplication::isCardiogram):
2254         (WebCore::IOSApplication::isNike):
2255
2256 2018-05-23  Brent Fulgham  <bfulgham@apple.com>
2257
2258         Avoid keeping FormState alive longer than necessary
2259         https://bugs.webkit.org/show_bug.cgi?id=185877
2260         <rdar://problem/39329219>
2261
2262         Reviewed by Ryosuke Niwa.
2263
2264         A number of crash fixes were done to prevent FormState objects from being
2265         accessed after their relevant Frames had been destroyed. Unfortunately, this
2266         could cause the FormState to persist after the owning Frame had been
2267         destroyed, resulting in nullptr dereferences.
2268
2269         This patch does the following:
2270
2271         1. Uses WeakPtr's for FormState objects passed to completion handlers, rather
2272            than RefPtr, since those completion handlers might fire as part of the
2273            clean-up process during Frame destruction. This allows us to use the FormState
2274            if they are still valid, but gracefully handle cases where a form submission
2275            is cancelled in-flight.
2276         2. Moves FormState object as they pass through the loader.
2277         3. Removes some extraneous WTFMove() calls being made on bare FormState pointers.
2278         4. Changes FormSubmission to hold a RefPtr so we can move the FormState to the
2279            loader in the code path that uses it (the FormSubmission is always destroyed
2280            shortly afterwards).
2281         5. Changes the trap from Bug 183704 so that it only fires if the FormState object
2282            is being retained more than once.
2283
2284         * loader/DocumentLoader.cpp:
2285         (WebCore::DocumentLoader::willSendRequest): Update for new CompletionHandler
2286         signature.
2287         * loader/FormState.cpp:
2288         (WebCore::FormState::willDetachPage): Revise trap to check for retain counts
2289         above one.
2290         * loader/FormState.h:
2291         (WebCore::FormState::weakPtrFactory const): Added.
2292         * loader/FormSubmission.h:
2293         (WebCore::FormSubmission::state const): Revised for change to RefPtr.
2294         (WebCore::FormSubmission::takeState): Added.
2295         * loader/FrameLoader.cpp:
2296         (WebCore::FrameLoader::urlSelected): Update for new CompletionHandler signature.
2297         (WebCore::FrameLoader::loadURLIntoChildFrame): Ditto.
2298         (WebCore::FrameLoader::loadFrameRequest): Ditto.
2299         (WebCore::FrameLoader::loadURL): Ditto.
2300         (WebCore::FrameLoader::load): Ditto.
2301         (WebCore::FrameLoader::loadWithNavigationAction): Ditto.
2302         (WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
2303         (WebCore::FrameLoader::reloadWithOverrideEncoding): Ditto.
2304         (WebCore::FrameLoader::reload): Ditto.
2305         (WebCore::FrameLoader::loadPostRequest): Ditto.
2306         (WebCore::FrameLoader::loadDifferentDocumentItem): Ditto.
2307         * loader/FrameLoader.h:
2308         * loader/NavigationScheduler.cpp:
2309         * loader/PolicyChecker.cpp:
2310         (WebCore::PolicyChecker::checkNavigationPolicy):Revise to use WeakPtr for
2311         FormState passed to the completion handler. Remove some extraneous WTFMove()
2312         calls on bare pointers.
2313         (WebCore::PolicyChecker::checkNewWindowPolicy): Ditto.
2314         * loader/PolicyChecker.h:
2315         * page/ContextMenuController.cpp:
2316         (WebCore::openNewWindow): Revise for new signatures.
2317         (WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
2318
2319 2018-05-23  Keith Miller  <keith_miller@apple.com>
2320
2321         Expose $vm if window.internals is exposed
2322         https://bugs.webkit.org/show_bug.cgi?id=185900
2323
2324         Reviewed by Mark Lam.
2325
2326         This is useful for testing vm internals when running LayoutTests.
2327
2328         * testing/js/WebCoreTestSupport.cpp:
2329         (WebCoreTestSupport::injectInternalsObject):
2330
2331 2018-05-23  David Kilzer  <ddkilzer@apple.com>
2332
2333         Don't create the SubimageCache just to clear an image from it
2334         <https://webkit.org/b/185757>
2335
2336         Reviewed by Said Abou-Hallawa.
2337
2338         To fix this we make SubimageCacheWithTimer::clearImage() a
2339         static class method that checks whether the cache exists before
2340         removing it.  We also make SubimageCacheWithTimer::getImage() a
2341         static class method, and move more methods into the
2342         SubimageCacheWithTimer class and make them private to reduce API
2343         footprint.
2344
2345         * platform/graphics/cg/GraphicsContextCG.cpp:
2346         (WebCore::GraphicsContext::drawNativeImage): Switch to use new
2347         SubimageCacheWithTimer::getSubimage() static class method.
2348         * platform/graphics/cg/NativeImageCG.cpp:
2349         (WebCore::clearNativeImageSubimages): Switch to use new
2350         SubimageCacheWithTimer::clearImage() static class method which
2351         returns early if the subimage cache has not been created yet.
2352         This fixes the bug.
2353
2354         * platform/graphics/cg/SubimageCacheWithTimer.cpp:
2355         (WebCore::SubimageCacheWithTimer::s_cache): Allocate space for
2356         static class variable.
2357         (WebCore::SubimageCacheWithTimer::getSubimage): Replace instance
2358         method with new static class method that gets the subimage cache
2359         singleton and calls the subimage() instance method.
2360         (WebCore::SubimageCacheWithTimer::clearImage): Replace instance
2361         methdod with new static class method that returns early if the
2362         static cache singleton doesn't exist (fixes the bug), otherwise
2363         calls the clearImageAndSubimages() instance method.
2364         (WebCore::SubimageCacheWithTimer::subimage): Rename from
2365         getSubimage().  Use `auto` after renaming SubimageCache typedef
2366         to SubimageCacheHashSet.
2367         (WebCore::SubimageCacheWithTimer::clearImageAndSubimages):
2368         Rename from clearImage().  Modernize loops.
2369         (WebCore::SubimageCacheWithTimer::subimageCache): Change
2370         WebCore::subimageCache() to a static class method that creates
2371         the subimage cache singleton if it doesn't exist yet, and
2372         returns it.
2373         (WebCore::SubimageCacheWithTimer::subimageCacheExists): Add.
2374         Returns false if the subimage cache singleton has not been
2375         created yet.
2376
2377         * platform/graphics/cg/SubimageCacheWithTimer.h:
2378         - Rename typedef SubimageCache to SubimageCacheHashSet to avoid
2379           general confusion.
2380         (WebCore::SubimageCacheWithTimer::getSubimage):
2381         (WebCore::SubimageCacheWithTimer::clearImage):
2382         - Change to static class methods.
2383         (WebCore::SubimageCacheWithTimer::SubimageCacheWithTimer):
2384         - Make private.
2385         (WebCore::SubimageCacheWithTimer::subimage):
2386         - Rename from getSubimage() and make private.
2387         (WebCore::SubimageCacheWithTimer::clearImageAndSubimages):
2388         - Rename from clearImage() and make private.
2389         (WebCore::SubimageCacheWithTimer::subimageCache):
2390         - Rename from WebCore::subimageCache() and make a private static
2391           class method.
2392         (WebCore::SubimageCacheWithTimer::subimageCacheExists):
2393         - Add private static class method.
2394         (WebCore::SubimageCacheWithTimer::s_cache):
2395         - Declare private static variable to hold singleton.
2396
2397 2018-05-23  Eric Carlson  <eric.carlson@apple.com>
2398
2399         Avoid loading AVFoundation to check supported MIME types if possible
2400         https://bugs.webkit.org/show_bug.cgi?id=185839
2401         <rdar://problem/40182010>
2402
2403         Reviewed by Jer Noble.
2404
2405         Avoid loading AVFoundation to call +[AVURLAssetClass audiovisualMIMETypes] as long as possible,
2406         and when they are loaded send the list to the UI process so it can pass it to all extant
2407         and all new web processes so they can won't have call it at all.
2408
2409         * WebCore.xcodeproj/project.pbxproj:
2410         * platform/graphics/ImageDecoder.cpp:
2411         (WebCore::ImageDecoder::create): Don't call ImageDecoderAVFObjC::canDecodeType if 
2412         ImageDecoderCG can decode the type so we don't have to load AVFoundation.
2413         (WebCore::ImageDecoder::supportsMediaType): Return as soon as a decoder class says
2414         it supports a media type to avoid calling more than one. Call ImageDecoderAVFObjC last.
2415
2416         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h:
2417         (WebCore::AVFoundationMIMETypeCache::setCacheMIMETypesCallback):
2418         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
2419         (WebCore::AVFoundationMIMETypeCache::singleton): Simplify.
2420         (WebCore::AVFoundationMIMETypeCache::setSupportedTypes): Cache the supplied list of types
2421         so we won't have to load AVFoundation when asked for types later.
2422         (WebCore::AVFoundationMIMETypeCache::types):
2423         (WebCore::AVFoundationMIMETypeCache::supportsContentType): New convenience routine.
2424         (WebCore::AVFoundationMIMETypeCache::canDecodeType): Ditto.
2425         (WebCore::AVFoundationMIMETypeCache::isAvailable const): New, check to see if AVFoundation.framework
2426         is available without actually loading it.
2427         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes): Load types if possible.
2428         (WebCore::AVFoundationMIMETypeCache::AVFoundationMIMETypeCache): Deleted.
2429         (WebCore::AVFoundationMIMETypeCache::loadTypes): Deleted.
2430
2431         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2432         (WebCore::ImageDecoderAVFObjC::create): Use AVFoundationMIMETypeCache::isAvailable instead
2433         of loading the frameworks.
2434         (WebCore::ImageDecoderAVFObjC::supportsMediaType): Ditto.
2435         (WebCore::ImageDecoderAVFObjC::supportsContentType): Use AVFoundationMIMETypeCache::supportsContentType.
2436         (WebCore::ImageDecoderAVFObjC::canDecodeType): Use AVFoundationMIMETypeCache::canDecodeType.
2437
2438         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2439         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): ASSERT if the 
2440         AVFoundationMIMETypeCache is empty, it shouldn't be possible to get here in that state.
2441         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Use AVFoundationMIMETypeCache::supportsContentType.
2442         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): Use AVFoundationMIMETypeCache::canDecodeType.
2443
2444         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2445         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): ASSERT if the 
2446         AVFoundationMIMETypeCache is empty, it shouldn't be possible to get here in that state.
2447         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Use AVFoundationMIMETypeCache::canDecodeType.
2448
2449         * platform/graphics/cg/ImageDecoderCG.cpp:
2450         (WebCore::ImageDecoderCG::canDecodeType): New.
2451         * platform/graphics/cg/ImageDecoderCG.h:
2452
2453 2018-05-23  Chris Dumez  <cdumez@apple.com>
2454
2455         RenderLayer::scrollRectToVisible() should not propagate a subframe's scroll to its cross-origin parent
2456         https://bugs.webkit.org/show_bug.cgi?id=185664
2457         <rdar://problem/36185260>
2458
2459         Reviewed by Simon Fraser.
2460
2461         RenderLayer::scrollRectToVisible() should not propagate a subframe's scroll to its
2462         cross-origin parent. There was logic in FrameLoader::scrollToFragmentWithParentBoundary()
2463         to temporarily set the 'safeToPropagateScrollToParent' flag to false on the cross-origin
2464         ancestor frame during the call to FrameView::scrollToFragment(). This would correctly
2465         prevent RenderLayer::scrollRectToVisible() to propagate the scroll to the cross-origin
2466         ancestor frame when scrollRectToVisible() is called synchronously. However,
2467         scrollRectToVisible() can get called asynchronously in case of a dirty layout, as part
2468         of the post layout tasks.
2469
2470         To address the issue, we get rid of the safeToPropagateScrollToParent flag on FrameView
2471         and instead update FrameView::safeToPropagateScrollToParent() to do the cross-origin
2472         check. FrameView::safeToPropagateScrollToParent() is called by RenderLayer::scrollRectToVisible()
2473         and this is a lot more robust than relying on a flag which gets temporarily set.
2474
2475         Test: http/tests/navigation/fragment-navigation-cross-origin-subframe-no-scrolling-parent.html
2476
2477         * dom/Document.cpp:
2478         * dom/Document.h:
2479         * loader/FrameLoader.cpp:
2480         (WebCore::FrameLoader::scrollToFragmentWithParentBoundary):
2481         * page/FrameView.cpp:
2482         (WebCore::FrameView::FrameView):
2483         (WebCore::FrameView::reset):
2484         (WebCore::FrameView::safeToPropagateScrollToParent const):
2485         * page/FrameView.h:
2486
2487 2018-05-23  Youenn Fablet  <youenn@apple.com>
2488
2489         NetworkLoadChecker should check cached redirections
2490         https://bugs.webkit.org/show_bug.cgi?id=185849
2491
2492         Reviewed by Chris Dumez.
2493
2494         Covered by rebased tests.
2495
2496         * loader/SubresourceLoader.cpp:
2497         (WebCore::SubresourceLoader::willSendRequestInternal):
2498        Log the case of a redirection with fetch error mode.
2499
2500 2018-05-23  Nan Wang  <n_wang@apple.com>
2501
2502         AX: setValue on contenteditable should preserve whitespace
2503         https://bugs.webkit.org/show_bug.cgi?id=185897
2504
2505         Reviewed by Chris Fleizach.
2506
2507         RenderText is using its parent renderer's style to determine if
2508         whitespace collapsing is necessary. So when setting the innerText
2509         of the element in setValue, let's also set its style in order to 
2510         preserve whitespaces.
2511
2512         Modified an existing test to cover this change.
2513
2514         * accessibility/AccessibilityRenderObject.cpp:
2515         (WebCore::AccessibilityRenderObject::setValue):
2516
2517 2018-05-23  Michael Catanzaro  <mcatanzaro@igalia.com>
2518
2519         [GTK] Silence GCC 8 warnings
2520         https://bugs.webkit.org/show_bug.cgi?id=185556
2521
2522         Reviewed by Žan Doberšek.
2523
2524         Silence remaining -Wcast-function-type warnings by casting through void (*)(void), aka
2525         GCallback.
2526
2527         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
2528         (webkitAccessibleHyperlinkSetProperty):
2529         (webkitAccessibleHyperlinkGetType):
2530         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2531         (webkitAccessibleGetType):
2532         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2533         (WebCore::NetworkStorageSession::getCredentialFromPersistentStorage):
2534
2535 2018-05-23  Zalan Bujtas  <zalan@apple.com>
2536
2537         [LFC] Move sizing/positioning logic to helper classes
2538         https://bugs.webkit.org/show_bug.cgi?id=185898
2539
2540         Reviewed by Antti Koivisto.
2541
2542         The idea here is to move all the sizing and positioning logic to helper classes so that
2543         the formatting context code stays lean.
2544         This is similar to the dedicated BlockMarginCollapse class for the collapsing logic.
2545         The helper classes have only static functions. These static functions do not mutate the associated DisplayBoxes,
2546         but instead they simply retun the computed values.
2547
2548         * Sources.txt:
2549         * WebCore.xcodeproj/project.pbxproj:
2550         * layout/FormattingContext.cpp:
2551         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
2552         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
2553         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
2554         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
2555         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
2556         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const): Deleted.
2557         (WebCore::Layout::FormattingContext::computeFloatingNonReplacedHeight const): Deleted.
2558         (WebCore::Layout::FormattingContext::computeReplacedHeight const): Deleted.
2559         (WebCore::Layout::FormattingContext::computeReplacedWidth const): Deleted.
2560         (WebCore::Layout::FormattingContext::contentHeightForFormattingContextRoot const): Deleted.
2561         (WebCore::Layout::FormattingContext::computeFloatingNonReplacedWidth const): Deleted.
2562         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const): Deleted.
2563         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedHeight const): Deleted.
2564         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedWidth const): Deleted.
2565         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedPosition const): Deleted.
2566         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedPosition const): Deleted.
2567         (WebCore::Layout::FormattingContext::shrinkToFitWidth const): Deleted.
2568         * layout/FormattingContext.h:
2569         * layout/FormattingContextGeometry.cpp: Copied from Source/WebCore/layout/FormattingContext.cpp.
2570         (WebCore::Layout::contentHeightForFormattingContextRoot):
2571         (WebCore::Layout::shrinkToFitWidth):
2572         (WebCore::Layout::FormattingContextGeometry::outOfFlowNonReplacedHeight):
2573         (WebCore::Layout::FormattingContextGeometry::outOfFlowNonReplacedWidth):
2574         (WebCore::Layout::FormattingContextGeometry::outOfFlowReplacedHeight):
2575         (WebCore::Layout::FormattingContextGeometry::outOfFlowReplacedWidth):
2576         (WebCore::Layout::FormattingContextGeometry::floatingNonReplacedHeight):
2577         (WebCore::Layout::FormattingContextGeometry::floatingNonReplacedWidth):
2578         (WebCore::Layout::FormattingContextGeometry::floatingReplacedHeight):
2579         (WebCore::Layout::FormattingContextGeometry::floatingReplacedWidth):
2580         (WebCore::Layout::FormattingContextGeometry::outOfFlowNonReplacedPosition):
2581         (WebCore::Layout::FormattingContextGeometry::outOfFlowReplacedPosition):
2582         (WebCore::Layout::FormattingContextGeometry::replacedHeight):
2583         (WebCore::Layout::FormattingContextGeometry::replacedWidth):
2584         * layout/FormattingContextGeometry.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingContext.h.
2585         * layout/blockformatting/BlockFormattingContext.cpp:
2586         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
2587         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
2588         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
2589         (WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedWidth const): Deleted.
2590         (WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedHeight const): Deleted.
2591         * layout/blockformatting/BlockFormattingContext.h:
2592         * layout/blockformatting/BlockFormattingContextGeometry.cpp: Added.
2593         (WebCore::Layout::BlockFormattingContextGeometry::inFlowNonReplacedHeight):
2594         (WebCore::Layout::BlockFormattingContextGeometry::inFlowNonReplacedWidth):
2595         (WebCore::Layout::BlockFormattingContextGeometry::inFlowReplacedHeight):
2596         (WebCore::Layout::BlockFormattingContextGeometry::inFlowReplacedWidth):
2597         (WebCore::Layout::BlockFormattingContextGeometry::staticPosition):
2598         * layout/blockformatting/BlockFormattingContextGeometry.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingContext.h.
2599         * layout/displaytree/DisplayBox.h:
2600
2601 2018-05-23  Antti Koivisto  <antti@apple.com>
2602
2603         Page keeps reloading when viewing photos in google drive (due to too high canvas memory limits)
2604         https://bugs.webkit.org/show_bug.cgi?id=185903
2605         <rdar://problem/38420562>
2606
2607         Reviewed by Simon Fraser.
2608
2609         The canvas memory usage limits don't work on iOS since the current 2GB minimum limit is
2610         larger than the maximum process size.
2611
2612         * html/HTMLCanvasElement.cpp:
2613         (WebCore::maxActivePixelMemory):
2614
2615         Always base this on the reported ramSize() on iOS. Make it still fairly large to not risk breaking
2616         any currently working content. In practice the limit computes to 448MB on device at the moment.
2617
2618 2018-05-23  Zalan Bujtas  <zalan@apple.com>
2619
2620         [LFC] Implement positioning for replaced out-of-flow elements
2621         https://bugs.webkit.org/show_bug.cgi?id=185902
2622
2623         Reviewed by Antti Koivisto.
2624
2625         * layout/FormattingContext.cpp:
2626         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedPosition const):
2627
2628 2018-05-22  Myles C. Maxfield  <mmaxfield@apple.com>
2629
2630         Text can wrap between hyphens and commas
2631         https://bugs.webkit.org/show_bug.cgi?id=185899
2632         <rdar://problem/40118983>
2633
2634         Reviewed by Zalan Bujtas.
2635
2636         Chrome, Firefox, and ICU all agree that text shouldn't wrap there.
2637
2638         Test: fast/text/line-break-hyphen-comma.html
2639
2640         * rendering/BreakLines.cpp:
2641
2642 2018-05-22  Simon Fraser  <simon.fraser@apple.com>
2643
2644         Add notifyutil callbacks to dump the memory cache, and the list of live Pages and Documents
2645         https://bugs.webkit.org/show_bug.cgi?id=185853
2646
2647         Reviewed by Keith Miller.
2648
2649         Add a notifyutil callback to dump the PageCache, which dumps the stats, and the list of live pages.
2650         This can be invoked on iOS and macOS via "notifyutil -p com.apple.WebKit.showPageCache".
2651         
2652         Add a notifyutil callback that dumps the list of all Pages, and the list of all Documents, with
2653         Document pointer address and URL.
2654         This can be invoked on iOS and macOS via "notifyutil -p com.apple.WebKit.showAllDocuments".
2655
2656         * history/PageCache.cpp:
2657         (WebCore::PageCache::PageCache):
2658         (WebCore::PageCache::dump const):
2659         * history/PageCache.h:
2660         * loader/cache/CachedResource.h:
2661         (WebCore::CachedResource::numberOfClients const):
2662         (WebCore::CachedResource::count const): Deleted.
2663         * loader/cache/MemoryCache.cpp:
2664         (WebCore::MemoryCache::MemoryCache):
2665         (WebCore::MemoryCache::pruneLiveResourcesToSize):
2666         (WebCore::MemoryCache::dumpStats):
2667         (WebCore::MemoryCache::dumpLRULists const):
2668         * loader/cache/MemoryCache.h:
2669         * page/mac/PageMac.mm:
2670         (WebCore::Page::platformInitialize):
2671
2672 2018-05-22  Dean Jackson  <dino@apple.com>
2673
2674         Optimized path zoom animation needs a valid UIImage and CGRect
2675         https://bugs.webkit.org/show_bug.cgi?id=185883
2676         <rdar://problem/40306056>
2677
2678         Build fix.
2679
2680         * loader/FrameLoadRequest.h:
2681
2682 2018-05-22  Commit Queue  <commit-queue@webkit.org>
2683
2684         Unreviewed, rolling out r232081.
2685         https://bugs.webkit.org/show_bug.cgi?id=185895
2686
2687         Broke two API tests (Requested by bfulgham_ on #webkit).
2688
2689         Reverted changeset:
2690
2691         "Avoid keeping FormState alive longer than necessary"
2692         https://bugs.webkit.org/show_bug.cgi?id=185877
2693         https://trac.webkit.org/changeset/232081
2694
2695 2018-05-22  Dean Jackson  <dino@apple.com>
2696
2697         Optimized path zoom animation needs a valid UIImage and CGRect
2698         https://bugs.webkit.org/show_bug.cgi?id=185883
2699         <rdar://problem/40306056>
2700
2701         Reviewed by Jon Lee.
2702
2703         Pass the bounding box of the element that was clicked onto
2704         the UI process, so it can perform an animation from that spot.
2705
2706         This involved adding an IntRect to the ResourceRequest, and passing
2707         that info into it from the HTMLAnchorElement, using a new struct
2708         called SystemPreviewInfo.
2709
2710         * html/HTMLAnchorElement.cpp:
2711         (WebCore::HTMLAnchorElement::handleClick):
2712         * loader/FrameLoadRequest.cpp:
2713         (WebCore::FrameLoadRequest::FrameLoadRequest):
2714         * loader/FrameLoadRequest.h:
2715         (WebCore::FrameLoadRequest::FrameLoadRequest):
2716         (WebCore::FrameLoadRequest::isSystemPreview const):
2717         (WebCore::FrameLoadRequest::systemPreviewRect const):
2718         * loader/FrameLoader.cpp:
2719         (WebCore::FrameLoader::urlSelected):
2720         (WebCore::FrameLoader::loadURL):
2721         * loader/FrameLoader.h:
2722         (WebCore::FrameLoader::urlSelected):
2723         * loader/FrameLoaderTypes.h:
2724         * platform/network/ResourceRequestBase.cpp:
2725         (WebCore::ResourceRequestBase::systemPreviewRect const):
2726         (WebCore::ResourceRequestBase::setSystemPreviewRect):
2727         * platform/network/ResourceRequestBase.h:
2728
2729 2018-05-22  Chris Dumez  <cdumez@apple.com>
2730
2731         [POSIX] Use access() instead of stat() in FileSystem::fileExists()
2732         https://bugs.webkit.org/show_bug.cgi?id=185882
2733
2734         Reviewed by Geoffrey Garen.
2735
2736         Use access() instead of stat() in FileSystem::fileExists(). stat() returns a lot of information we
2737         do not leverage and local benchmarking on macOS shows access() being > 80% faster than stat():
2738         stat: 0.31567 (lower is better)
2739         access: 0.16074 (lower is better)
2740         stat: 0.303665 (lower is better)
2741         access: 0.165468 (lower is better)
2742
2743         * platform/posix/FileSystemPOSIX.cpp:
2744         (WebCore::FileSystem::fileExists):
2745
2746 2018-05-22  Brent Fulgham  <bfulgham@apple.com>
2747
2748         Avoid keeping FormState alive longer than necessary
2749         https://bugs.webkit.org/show_bug.cgi?id=185877
2750         <rdar://problem/39329219>
2751
2752         Reviewed by Ryosuke Niwa.
2753
2754         A number of crash fixes were done to prevent FormState objects from being
2755         accessed after their relevant Frames had been destroyed. Unfortunately, this
2756         could cause the FormState to persist after the owning Frame had been
2757         destroyed, resulting in nullptr dereferences.
2758
2759         This patch does the following:
2760
2761         1. Changes to use WeakPtr's for FormState objects passed to completion handlers,
2762            rather than RefPtr, since those completion handlers might fire as part of
2763            the clean-up process during Frame destruction. This allows us to use the FormState
2764            if they are still valid, but gracefully handle cases where a form submission
2765            is cancelled in-flight.
2766         2. Removes some extraneous WTFMove() calls being made on bare FormState pointers.
2767         3. Changes the trap from Bug 183704 so that it only fires if the FormState object
2768            is being retained more than once.
2769
2770         * loader/DocumentLoader.cpp:
2771         (WebCore::DocumentLoader::willSendRequest): Update for new CompletionHandler
2772         signature.
2773         * loader/FormState.cpp:
2774         (WebCore::FormState::willDetachPage): Revise trap to check for retain counts
2775         above one.
2776         * loader/FormState.h:
2777         (WebCore::FormState::weakPtrFactory const): Added.
2778         * loader/FrameLoader.cpp:
2779         (WebCore::FrameLoader::loadFrameRequest): Revise to use WeakPtr for FormState
2780         passed to the completion handler.
2781         (WebCore::FrameLoader::loadURL): Update for new CompletionHandler signature.
2782         (WebCore::FrameLoader::load): Ditto.
2783         (WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
2784         (WebCore::FrameLoader::loadPostRequest): Ditto.
2785         * loader/PolicyChecker.cpp:
2786         (WebCore::PolicyChecker::checkNavigationPolicy): Revise to use WeakPtr for
2787         FormState passed to the completion handler. Remove some extraneous WTFMove()
2788         calls on bare pointers.
2789         (WebCore::PolicyChecker::checkNewWindowPolicy): Ditto.
2790         * loader/PolicyChecker.h:
2791
2792 2018-05-22  Sihui Liu  <sihui_liu@apple.com>
2793
2794         Conversion between SecurityOriginData and DatabaseIdentifier is asymmetric when port is null
2795         https://bugs.webkit.org/show_bug.cgi?id=185715
2796
2797         Reviewed by Geoffrey Garen.
2798
2799         Fixed the issue of null port when converting between SecurityOriginData and DatabaseIdentifier.
2800
2801         Test: WKWebView.LocalStorageFetchDataRecords.
2802
2803         * page/SecurityOriginData.cpp:
2804         (WebCore::SecurityOriginData::fromDatabaseIdentifier):
2805
2806 2018-05-22  Keith Miller  <keith_miller@apple.com>
2807
2808         We should have a CoW storage for NewArrayBuffer arrays.
2809         https://bugs.webkit.org/show_bug.cgi?id=185003
2810
2811         Reviewed by Filip Pizlo.
2812
2813         * bindings/js/JSDOMConvertSequences.h:
2814         (WebCore::Detail::NumericSequenceConverter::convertArray):
2815         (WebCore::Detail::SequenceConverter::convertArray):
2816
2817 2018-05-22  Ryan Haddad  <ryanhaddad@apple.com>
2818
2819         Unreviewed, rolling out r232052.
2820
2821         Breaks internal builds.
2822
2823         Reverted changeset:
2824
2825         "Use more C++17"
2826         https://bugs.webkit.org/show_bug.cgi?id=185176
2827         https://trac.webkit.org/changeset/232052
2828
2829 2018-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2830
2831         [GTK] WebDriver: Network process crash when running imported/w3c/webdriver/tests/delete_cookie/delete.py::test_unknown_cookie
2832         https://bugs.webkit.org/show_bug.cgi?id=185867
2833
2834         Reviewed by Michael Catanzaro.
2835
2836         We need to null check the value returned by URL::createSoupURI() before passing it to soup.
2837
2838         * platform/network/soup/CookieJarSoup.cpp:
2839         (WebCore::setCookiesFromDOM):
2840         (WebCore::cookiesForSession):
2841         (WebCore::getRawCookies):
2842         (WebCore::deleteCookie):
2843         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2844         (WebCore::NetworkStorageSession::getCookies):
2845
2846 2018-05-22  Zalan Bujtas  <zalan@apple.com>
2847
2848         [LFC] Implement positioning for non-replaced out-of-flow elements.
2849         https://bugs.webkit.org/show_bug.cgi?id=185858
2850
2851         Reviewed by Antti Koivisto.
2852
2853         In certain cases, the out-of-flow element's final position depends on the element's size.
2854         Call computeOutOfFlowPosition() after width/height are resolved.
2855
2856         * layout/FormattingContext.cpp:
2857         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
2858         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
2859         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedPosition const):
2860         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedPosition const):
2861         * layout/FormattingContext.h:
2862
2863 2018-05-22  Olivier Blin  <olivier.blin@softathome.com>
2864
2865         Fix build without MathML
2866         https://bugs.webkit.org/show_bug.cgi?id=185865
2867
2868         Reviewed by Frédéric Wang.
2869
2870         Regression(r226654): [RenderTreeBuilder] Move MathML addChild logic to RenderTreeBuilder
2871         https://bugs.webkit.org/show_bug.cgi?id=181443
2872
2873         Regression(r229694): Put the DOM in IsoHeaps
2874         https://bugs.webkit.org/show_bug.cgi?id=183546
2875
2876         No new tests, build fix.
2877
2878         * mathml/MathMLUnknownElement.cpp:
2879         * mathml/MathMLUnknownElement.h:
2880         * rendering/updating/RenderTreeBuilder.cpp:
2881         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
2882         (WebCore::RenderTreeBuilder::attach):
2883         * rendering/updating/RenderTreeBuilder.h:
2884         * rendering/updating/RenderTreeBuilderMathML.cpp:
2885         * rendering/updating/RenderTreeBuilderMathML.h:
2886
2887 2018-05-22  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2888
2889         [GStreamer] Don't set the ReadyState to HaveNothing when an error occurs in playback pipeline
2890         https://bugs.webkit.org/show_bug.cgi?id=185725
2891
2892         Reviewed by Philippe Normand.
2893
2894         The ReadyState should not be set to HaveNothing when an error occurs in playback pipeline, because
2895         at least we should have the metadata in order to have an error in pipeline.
2896
2897         Here is the definition of HaveNothing state in W3C spec https://dev.w3.org/html5/spec-preview/media-elements.html#ready-states
2898         "HAVE_NOTHING (numeric value 0): No information regarding the media resource is available. No data for the current
2899         playback position is available. Media elements whose networkState attribute is NETWORK_EMPTY are always in the HAVE_NOTHING state."
2900
2901         In MSE case, this patch fixes the crashes of the followings WPT encrypted-media tests:
2902         - clearkey-mp4-playback-temporary-clear-encrypted.https.html
2903         - clearkey-mp4-playback-temporary-multikey-sequential.https.html
2904         - clearkey-mp4-playback-temporary-multikey-sequential-readyState.https.html
2905
2906         Here is the cause of the crashes: When an error occurs in playback pipeline like no decipher key, in case of encrypted content,
2907         the MediaPlayerPrivateGstreamer sets NetworkState to FormatError which causes the detachment of MediaElement from MediaSource,
2908         then MediaPlayerPrivateGstreamer sets the ReadyState to HaveNothing which causes a trying again to play the same URI,
2909         thus the crash occurs because the MediaElement is detached from MediaSource, see bugzilla for more details.
2910         Note: these crashes should be fixed in 185242 but unfortunately it isn't the case. See bug 185242 for more details.
2911
2912         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2913         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2914
2915 2018-05-22  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2916
2917         [MSE][GStreamer] Fix the deadlock caused by bug 185242 (r231351)
2918         https://bugs.webkit.org/show_bug.cgi?id=185723
2919
2920         Reviewed by Xabier Rodriguez-Calvar.
2921
2922         After a detailed investigation, we found that, the patch r231351 doesn't fix the crash that expected to fix,
2923         it just replaces it by a deadlock. Now the crash is fixed in the bug 185725.
2924
2925         This Patch will remove a part of r231351 that causes the deadlock.
2926
2927         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
2928         (webKitMediaSrcFreeStream):
2929
2930 2018-05-21  Yusuke Suzuki  <utatane.tea@gmail.com>
2931
2932         Use more C++17
2933         https://bugs.webkit.org/show_bug.cgi?id=185176
2934
2935         Reviewed by JF Bastien.
2936
2937         * Configurations/Base.xcconfig:
2938         * DerivedSources.make:
2939         * platform/ios/LegacyTileGrid.mm:
2940         (WebCore::LegacyTileGrid::dropDistantTiles):
2941
2942 2018-05-21  Zalan Bujtas  <zalan@apple.com>
2943
2944         [LFC] Box::isDescendantOf() should work with out-of-flow elements.
2945         https://bugs.webkit.org/show_bug.cgi?id=185812
2946
2947         Reviewed by Antti Koivisto.
2948
2949         Use the containing block chain instead of the parent chain to check for isDescendantOf().
2950         (containing block is not always the direct parent)
2951
2952         * layout/layouttree/LayoutBox.cpp:
2953         (WebCore::Layout::Box::isDescendantOf const):
2954
2955 2018-05-21  Chris Nardi  <cnardi@chromium.org>
2956
2957         Remove dead exception in MediaList.appendMedium
2958         https://bugs.webkit.org/show_bug.cgi?id=185278
2959
2960         Reviewed by Chris Dumez.
2961
2962         MediaList.appendMedium was able to throw an exception, but MediaQuerySet::add() always
2963         returned true, making it impossible for that exception to be thrown. This matched the
2964         spec, as |appendMedium| is not specified to throw an exception. Remove the dead code
2965         surrounding the exception, and make MediaQuerySet::add() return false if the medium is
2966         not added.
2967
2968         No new/modified tests as there should be no functional changes.
2969
2970         * css/MediaList.cpp:
2971         (WebCore::MediaQuerySet::add):
2972         (WebCore::MediaList::appendMedium):
2973         * css/MediaList.h:
2974         * css/MediaList.idl:
2975
2976 2018-05-21  Chris Dumez  <cdumez@apple.com>
2977
2978         File's structured serialization should serialize lastModified attribute
2979         https://bugs.webkit.org/show_bug.cgi?id=185773
2980
2981         Reviewed by Youenn Fablet.
2982
2983         Update our implementation for the stuctured serialization of a File to include
2984         its lastModified attribute, as per:
2985         - https://w3c.github.io/FileAPI/#file-section
2986
2987         No new tests, rebaselined existing test.
2988
2989         * bindings/js/SerializedScriptValue.cpp:
2990         (WebCore::CloneSerializer::write):
2991         (WebCore::CloneDeserializer::readFile):
2992         * fileapi/File.cpp:
2993         (WebCore::File::File):
2994         * fileapi/File.h:
2995
2996 2018-05-21  Zalan Bujtas  <zalan@apple.com>
2997
2998         [LFC] Add FormattingContext::validateGeometryConstraintsAfterLayout
2999         https://bugs.webkit.org/show_bug.cgi?id=185811
3000
3001         Reviewed by Antti Koivisto.
3002
3003         Also implement LayoutDescendantIterator and fix LayoutIterator.
3004
3005         * WebCore.xcodeproj/project.pbxproj:
3006         * layout/FormattingContext.cpp:
3007         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
3008         * layout/FormattingContext.h:
3009         * layout/blockformatting/BlockFormattingContext.cpp:
3010         (WebCore::Layout::BlockFormattingContext::layout const):
3011         * layout/layouttree/LayoutDescendantIterator.h: Added.
3012         (WebCore::Layout::LayoutDescendantIterator<T>::LayoutDescendantIterator):
3013         (WebCore::Layout::LayoutDescendantIterator<T>::operator):
3014         (WebCore::Layout::LayoutDescendantIteratorAdapter<T>::LayoutDescendantIteratorAdapter):
3015         (WebCore::Layout::LayoutDescendantIteratorAdapter<T>::begin):
3016         (WebCore::Layout::LayoutDescendantIteratorAdapter<T>::end):
3017         (WebCore::Layout::LayoutDescendantIteratorAdapter<T>::at):
3018         (WebCore::Layout::descendantsOfType):
3019         * layout/layouttree/LayoutIterator.h:
3020         (WebCore::Layout::LayoutBoxTraversal::firstChild):
3021         (WebCore::Layout::LayoutBoxTraversal::nextAncestorSibling):
3022         (WebCore::Layout::LayoutBoxTraversal::next):
3023         (WebCore::Layout::LayoutBoxTraversal::nextSkippingChildren):
3024         (WebCore::Layout::Traversal::firstChild):
3025         (WebCore::Layout::Traversal::nextSibling):
3026         (WebCore::Layout::Traversal::previousSibling):
3027         (WebCore::Layout::Traversal::findAncestorOfType):
3028         (WebCore::Layout::Traversal::firstWithin):
3029         (WebCore::Layout::Traversal::next):
3030         (WebCore::Layout::LayoutIterator<T>::traversePreviousSibling):
3031         (WebCore::Layout::LayoutIterator<T>::traverseAncestor):
3032         (WebCore::Layout::Traversal::nextAncestorSibling): Deleted.
3033         (WebCore::Layout::Traversal::nextWithin): Deleted.
3034
3035 2018-05-21  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3036
3037         [Curl] Bugfix for r231968, Suspend/Resume with WK2
3038         https://bugs.webkit.org/show_bug.cgi?id=185830
3039
3040         The flags are needed to be updated even if it is cancelled or finished to cleanup correctly.
3041         Also fixed trivial bug for very rare case (hard to produce the situation).
3042
3043         Reviewed by Youenn Fablet.
3044
3045         No new tests because WK2 is not ready for WinCairo yet in public., tested internaly.
3046
3047         * platform/network/curl/CurlRequest.cpp:
3048         (WebCore::CurlRequest::suspend):
3049         (WebCore::CurlRequest::resume):
3050         (WebCore::CurlRequest::pausedStatusChanged):
3051
3052 2018-05-21  Commit Queue  <commit-queue@webkit.org>
3053
3054         Unreviewed, rolling out r232030.
3055         https://bugs.webkit.org/show_bug.cgi?id=185850
3056
3057         "Caused
3058         TestWebKitAPI.IndexedDB.StructuredCloneBackwardCompatibility
3059         API test to fail" (Requested by cdumez on #webkit).
3060
3061         Reverted changeset:
3062
3063         "File's structured serialization should serialize lastModified
3064         attribute"
3065         https://bugs.webkit.org/show_bug.cgi?id=185773
3066         https://trac.webkit.org/changeset/232030
3067
3068 2018-05-21  Daniel Bates  <dabates@apple.com>
3069
3070         REGRESSION (r231107): CSP report-only policies are ignored for beacon, importScripts, fetch(), EventSource, and XHR
3071         https://bugs.webkit.org/show_bug.cgi?id=185789
3072         <rdar://problem/40380175>
3073
3074         Reviewed by Andy Estes.
3075
3076         Fixes an issue where CSP report-only policies were ignored for DocumentThreadableLoader and
3077         PingLoad initiated loads as a result of moving CSP processing to NetworkProcess.
3078
3079         Have NetworkLoadChecker implement the ContentSecurityPolicyClient interface and support logging
3080         console messages, sending CSP reports, and dispatching SecurityPolicyViolation events. To support
3081         the latter we introduce a new WebPage message, EnqueueSecurityPolicyViolationEvent, to enqueue
3082         a SecurityPolicyViolationEvent created from an event init dictionary on the document's event
3083         dispatch queue.
3084
3085         Additionally, shorten the description for a ResourceError caused by CSP to "Blocked by Content Security Policy"
3086         because the CSP code run in NetworkProcess can now log its more detailed error description to
3087         Web Inspector.
3088
3089         Tests: http/tests/security/contentSecurityPolicy/connect-src-beacon-allowed.html
3090                http/tests/security/contentSecurityPolicy/connect-src-beacon-blocked.html
3091                http/tests/security/contentSecurityPolicy/report-only-connect-src-beacon-redirect-blocked.php
3092                http/tests/security/contentSecurityPolicy/report-only-connect-src-xmlhttprequest-redirect-to-blocked.php
3093
3094         * WebCore.xcodeproj/project.pbxproj: Change SecurityPolicyViolationEvent.h from a project header to
3095         a private header so that we can include it in WebKit code.
3096         * dom/Document.cpp:
3097         (WebCore::Document::enqueueSecurityPolicyViolationEvent): Added.
3098         * dom/Document.h:
3099
3100         * dom/EventInit.h:
3101         (WebCore::EventInit::encode const):
3102         (WebCore::EventInit::decode
3103         * dom/SecurityPolicyViolationEvent.h:
3104         (WebCore::SecurityPolicyViolationEvent::Init::encode const):
3105         (WebCore::SecurityPolicyViolationEvent::Init::decode):
3106         Support encoding and decoding for the event.
3107
3108         * loader/DocumentLoader.cpp:
3109         (WebCore::DocumentLoader::enqueueSecurityPolicyViolationEvent): Formerly named "dispatchSecurityPolicyViolationEvent".
3110         (WebCore::DocumentLoader::dispatchSecurityPolicyViolationEvent): Deleted; renamed to "enqueueSecurityPolicyViolationEvent".
3111         * loader/DocumentLoader.h:
3112
3113         * loader/DocumentThreadableLoader.cpp:
3114         (WebCore::DocumentThreadableLoader::redirectReceived): While I am here, move the check for whether the loader
3115         strategy took responsibility for performing security checks to be before we perform the CSP check to avoid doing
3116         such CSP checks twice in the case that the loader strategy already did them.
3117         (WebCore::DocumentThreadableLoader::didFail): Remove code that checked the CSP policy if the load failed. When
3118         the loader strategy (NetworkProcess) is responsible for performing security checks then this code would never
3119         be executed for a violation of a CSP report-only policy because the loader does not and should not fail the load
3120         for a report-only violations. As the name implies, a report-only violation is only reported. That is, it is not
3121         enforced such that the load is blocked; => fail the load.
3122         (WebCore::DocumentThreadableLoader::reportContentSecurityPolicyError): Update the error description to more
3123         accurately describe the error and be consistent with the error message used in NetworkProcess. This error
3124         message is shown for a redirect blocked by CSP regardless of whether the redirect was to a same-origin or
3125         cross-origin resource. I chose to make the error message more vague than necessary for simplicity because
3126         the CSP code will log a more detailed message for this error than could ever be captured by error message
3127         for the ResourceError. Also use ASCIILiteral to efficiently construct the String object for the error
3128         message.
3129
3130         * page/csp/ContentSecurityPolicy.cpp:
3131         (WebCore::ContentSecurityPolicy::reportViolation const): Build up a SecurityPolicyViolationEvent::Init and
3132         pass that to the delegate to dispatch.
3133         * page/csp/ContentSecurityPolicy.h: Export allowScriptFromSource() and allowChildContextFromSource() so that
3134         we can call them from WebKit.
3135         * page/csp/ContentSecurityPolicyClient.h: Update for renaming.
3136         * platform/network/ResourceRequestBase.h: Define a new requester type to be able to differentiate a request
3137         initiated by importScripts() from other requests. We use this to perform the appropriate CSP checks in NetworkProcess.
3138         * workers/WorkerScriptLoader.cpp:
3139         (WebCore::WorkerScriptLoader::loadSynchronously): Set the requester on the ResourceRequest to ResourceRequest::Requester::ImportScripts
3140         so that we can differentiate this request from other requests. See remark for file ResourceRequestBase.h for
3141         more details.
3142
3143 2018-05-21  Chris Dumez  <cdumez@apple.com>
3144
3145         File's structured serialization should serialize lastModified attribute
3146         https://bugs.webkit.org/show_bug.cgi?id=185773
3147
3148         Reviewed by Youenn Fablet.
3149
3150         Update our implementation for the stuctured serialization of a File to include
3151         its lastModified attribute, as per:
3152         - https://w3c.github.io/FileAPI/#file-section
3153
3154         No new tests, rebaselined existing test.
3155
3156         * bindings/js/SerializedScriptValue.cpp:
3157         (WebCore::CloneSerializer::write):
3158         (WebCore::CloneDeserializer::readFile):
3159         * fileapi/File.cpp:
3160         (WebCore::File::File):
3161         * fileapi/File.h:
3162
3163 2018-05-21  Jer Noble  <jer.noble@apple.com>
3164
3165         Complete fix for enabling modern EME by default
3166         https://bugs.webkit.org/show_bug.cgi?id=185770
3167         <rdar://problem/40368220>
3168
3169         Reviewed by Eric Carlson.
3170
3171         * Configurations/FeatureDefines.xcconfig:
3172
3173 2018-05-21  Olivier Blin  <olivier.blin@softathome.com>
3174
3175         [CMake][WebCore] fix sqlite include dir variable
3176         https://bugs.webkit.org/show_bug.cgi?id=185825
3177
3178         Reviewed by Konstantin Tokarev.
3179
3180         WebCore's CMakeLists.txt used SQLITE_INCLUDE_DIRS, but only SQLITE_INCLUDE_DIR is defined.
3181
3182         No new tests, build fix only.
3183
3184         * CMakeLists.txt: Use SQLITE_INCLUDE_DIR instead of SQLITE_INCLUDE_DIRS.
3185
3186 2018-05-21  Olivier Blin  <olivier.blin@softathome.com>
3187
3188         Propagate WebCore system include dirs in WebCoreHeaderInterface
3189         https://bugs.webkit.org/show_bug.cgi?id=185822
3190
3191         Reviewed by Michael Catanzaro.
3192
3193         System include directories from WebCore are not propagated anymore to its users.
3194         For example gcrypt, sqlite and ICU system headers defined in PAL are not properly passed to WebKit build.
3195
3196         This may have been caused partly by the fix in r230385:
3197         [CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static library
3198         https://bugs.webkit.org/show_bug.cgi?id=184127
3199
3200         No new tests, build fix.
3201
3202         * CMakeLists.txt:
3203
3204 2018-05-21  Olivier Blin  <olivier.blin@softathome.com>
3205
3206         Fix FrameLoader build without video
3207         https://bugs.webkit.org/show_bug.cgi?id=185821
3208
3209         Reviewed by Michael Catanzaro.
3210
3211         Regression(r231392): Release assert in ScriptController::canExecuteScripts via HTMLMediaElement::~HTMLMediaElement()
3212         https://bugs.webkit.org/show_bug.cgi?id=185288
3213
3214         No new tests, build fix only.
3215
3216         * loader/FrameLoader.cpp:
3217         (WebCore::FrameLoader::checkCompleted): Flag HTMLMediaElement::isRunningDestructor() usage.
3218
3219 2018-05-21  Sam Weinig  <sam@webkit.org>
3220
3221         Modernize RenderStyleConstants.h - Part 1
3222         https://bugs.webkit.org/show_bug.cgi?id=185809
3223
3224         Reviewed by Yusuke Suzuki.
3225             
3226         Modernized the first set of enums in RenderStyleConstants.h by:
3227             - Converting them to enum classes
3228             - Renaming them to remove unnecessary prefix 'E's
3229             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
3230             - Renaming to match modern conventions (e.g BNONE -> None)
3231             - Reformatting them so that each value is on its own line.
3232
3233         Modernizes the following enums:
3234             PrintColorAdjust
3235             StyleDifference
3236             StyleDifferenceContextSensitiveProperty
3237             ColumnFill
3238             ColumnSpan
3239             BorderCollapse (renamed from EBorderCollapse)
3240             BorderStyle (renamed from EBorderStyle)
3241             BorderPrecedence (renamed from EBorderPrecedence)
3242             OutlineIsAuto
3243             PositionType (renamed from EPosition)
3244             Float (renamed from EFloat)
3245             MarginCollapse (renamed from EMarginCollapse)
3246             BoxDecorationBreak (renamed from EBoxDecorationBreak)
3247             BoxSizing (renamed from EBoxSizing)
3248             Overflow (renamed from EOverflow)
3249             VerticalAlign (renamed from EVerticalAlign)
3250             Clear (renamed from EClear)
3251             TableLayoutType (renamed from ETableLayout)
3252             TextCombine
3253             FillAttachment (renamed from EFillAttachment)
3254             FillBox (renamed from EFillBox)
3255             FillRepeat (renamed from EFillRepeat)
3256             FillLayerType (renamed from EFillLayerType)
3257             FillSizeType (renamed from EFillSizeType)
3258             MaskSourceType (renamed from EMaskSourceType)
3259             BoxPack (renamed from EBoxPack)
3260             BoxAlignment (renamed from EBoxAlignment)
3261             BoxOrient (renamed from EBoxOrient)
3262             BoxLines (renamed from EBoxLines)
3263             BoxDirection (renamed from EBoxDirection)
3264             AlignContent (renamed from EAlignContent)
3265             FlexDirection (renamed from EFlexDirection)
3266             FlexWrap (renamed from EFlexWrap)
3267             ItemPosition
3268             OverflowAlignment
3269             ItemPositionType
3270             ContentPosition
3271             ContentDistribution (renamed from ContentDistributionType)
3272             TextSecurity (renamed from ETextSecurity)
3273             UserModify (renamed from EUserModify)
3274             UserDrag (renamed from EUserDrag)
3275             UserSelect (renamed from EUserSelect)
3276             ObjectFit
3277             AspectRatioType
3278             WordBreak (renamed from EWordBreak)
3279             OverflowWrap (renamed from EOverflowWrap)
3280             NBSPMode (renamed from ENBSPMode)
3281             LineBreak
3282             Resize (renamed from EResize)
3283             QuoteType
3284             TransformStyle3D (renamed from ETransformStyle3D)
3285             BackfaceVisibility (renamed from EBackfaceVisibility)
3286             LineClamp (renamed from ELineClamp)
3287             TextOverflow
3288             ImageRendering (renamed from EImageRendering)
3289             TextIndentLine
3290             TextIndentType
3291             Isolation
3292
3293         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3294         (AXAttributeStringSetStyle):
3295         * css/BasicShapeFunctions.cpp:
3296         (WebCore::valueForCenterCoordinate):
3297         (WebCore::valueForBasicShape):
3298         * css/CSSComputedStyleDeclaration.cpp:
3299         (WebCore::sizingBox):
3300         (WebCore::fillRepeatToCSSValue):
3301         (WebCore::fillSourceTypeToCSSValue):
3302         (WebCore::fillSizeToCSSValue):
3303         (WebCore::valueForItemPositionWithOverflowAlignment):
3304         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
3305         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3306         * css/CSSPrimitiveValueMappings.h:
3307         (WebCore::CSSPrimitiveValue::operator LineClampValue const):
3308         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3309         (WebCore::CSSPrimitiveValue::operator ColumnFill const):
3310         (WebCore::CSSPrimitiveValue::operator ColumnSpan const):
3311         (WebCore::CSSPrimitiveValue::operator PrintColorAdjust const):
3312         (WebCore::CSSPrimitiveValue::operator BorderStyle const):
3313         (WebCore::CSSPrimitiveValue::operator OutlineIsAuto const):
3314         (WebCore::CSSPrimitiveValue::operator BackfaceVisibility const):
3315         (WebCore::CSSPrimitiveValue::operator FillAttachment const):
3316         (WebCore::CSSPrimitiveValue::operator FillBox const):
3317         (WebCore::CSSPrimitiveValue::operator FillRepeat const):
3318         (WebCore::CSSPrimitiveValue::operator BoxPack const):
3319         (WebCore::CSSPrimitiveValue::operator BoxAlignment const):
3320         (WebCore::CSSPrimitiveValue::operator BoxDecorationBreak const):
3321         (WebCore::CSSPrimitiveValue::operator BoxSizing const):
3322         (WebCore::CSSPrimitiveValue::operator BoxDirection const):
3323         (WebCore::CSSPrimitiveValue::operator BoxLines const):
3324         (WebCore::CSSPrimitiveValue::operator BoxOrient const):
3325         (WebCore::CSSPrimitiveValue::operator Clear const):
3326         (WebCore::CSSPrimitiveValue::operator FlexDirection const):
3327         (WebCore::CSSPrimitiveValue::operator AlignContent const):
3328         (WebCore::CSSPrimitiveValue::operator FlexWrap const):
3329         (WebCore::CSSPrimitiveValue::operator Float const):
3330         (WebCore::CSSPrimitiveValue::operator LineBreak const):
3331         (WebCore::CSSPrimitiveValue::operator MarginCollapse const):
3332         (WebCore::CSSPrimitiveValue::operator NBSPMode const):
3333         (WebCore::CSSPrimitiveValue::operator Overflow const):
3334         (WebCore::CSSPrimitiveValue::operator PositionType const):
3335         (WebCore::CSSPrimitiveValue::operator Resize const):
3336         (WebCore::CSSPrimitiveValue::operator TableLayoutType const):
3337         (WebCore::CSSPrimitiveValue::operator TextSecurity const):
3338         (WebCore::CSSPrimitiveValue::operator UserDrag const):
3339         (WebCore::CSSPrimitiveValue::operator UserModify const):
3340         (WebCore::CSSPrimitiveValue::operator UserSelect const):
3341         (WebCore::CSSPrimitiveValue::operator VerticalAlign const):
3342         (WebCore::CSSPrimitiveValue::operator WordBreak const):
3343         (WebCore::CSSPrimitiveValue::operator OverflowWrap const):
3344         (WebCore::CSSPrimitiveValue::operator TextCombine const):
3345         (WebCore::CSSPrimitiveValue::operator TextOverflow const):
3346         (WebCore::CSSPrimitiveValue::operator ObjectFit const):
3347         (WebCore::CSSPrimitiveValue::operator Isolation const):
3348         (WebCore::CSSPrimitiveValue::operator BorderCollapse const):
3349         (WebCore::CSSPrimitiveValue::operator ImageRendering const):
3350         (WebCore::CSSPrimitiveValue::operator TransformStyle3D const):
3351         (WebCore::CSSPrimitiveValue::operator ItemPosition const):
3352         (WebCore::CSSPrimitiveValue::operator OverflowAlignment const):
3353         (WebCore::CSSPrimitiveValue::operator ContentPosition const):
3354         (WebCore::CSSPrimitiveValue::operator ContentDistribution const):
3355         (WebCore::CSSPrimitiveValue::operator EBorderStyle const): Deleted.
3356         (WebCore::CSSPrimitiveValue::operator EBackfaceVisibility const): Deleted.
3357         (WebCore::CSSPrimitiveValue::operator EFillAttachment const): Deleted.
3358         (WebCore::CSSPrimitiveValue::operator EFillBox const): Deleted.
3359         (WebCore::CSSPrimitiveValue::operator EFillRepeat const): Deleted.
3360         (WebCore::CSSPrimitiveValue::operator EBoxPack const): Deleted.
3361         (WebCore::CSSPrimitiveValue::operator EBoxAlignment const): Deleted.
3362         (WebCore::CSSPrimitiveValue::operator EBoxDecorationBreak const): Deleted.
3363         (WebCore::CSSPrimitiveValue::operator EBoxSizing const): Deleted.
3364         (WebCore::CSSPrimitiveValue::operator EBoxDirection const): Deleted.
3365         (WebCore::CSSPrimitiveValue::operator EBoxLines const): Deleted.
3366         (WebCore::CSSPrimitiveValue::operator EBoxOrient const): Deleted.