[LFC][Floating] Remove redundant LayoutContext member variable.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-08-02  Zalan Bujtas  <zalan@apple.com>
2
3         [LFC][Floating] Remove redundant LayoutContext member variable.
4         https://bugs.webkit.org/show_bug.cgi?id=188286
5
6         Reviewed by Simon Fraser.
7
8         * layout/FloatingContext.cpp:
9         (WebCore::Layout::begin):
10         (WebCore::Layout::end):
11         (WebCore::Layout::FloatingContext::floatingPosition const):
12         (WebCore::Layout::FloatingPair::FloatingPair):
13         (WebCore::Layout::Iterator::Iterator):
14
15 2018-08-02  Ryosuke Niwa  <rniwa@webkit.org>
16
17         Move queue processing logic from CustomElementReactionStack to CustomElementReactionQueue
18         https://bugs.webkit.org/show_bug.cgi?id=188277
19
20         Reviewed by Wenson Hsieh.
21
22         Moved ensureCurrentQueue, processBackupQueue, ElementQueue, ensureBackupQueue, and backupElementQueue
23         from CustomElementReactionStack to CustomElementReactionQueue to simplify CustomElementReactionStack.
24
25         No new tests since there is no behavior change.
26
27         * dom/CustomElementReactionQueue.cpp:
28         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
29         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
30         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
31         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
32         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
33         (WebCore::CustomElementReactionQueue::ElementQueue::add): Moved from CustomElementReactionStack.
34         (WebCore::CustomElementReactionQueue::ElementQueue::invokeAll): Ditto.
35         (WebCore::CustomElementReactionQueue::ensureCurrentQueue): Ditto.
36         (WebCore::CustomElementReactionQueue::ensureBackupQueue): Ditto.
37         (WebCore::CustomElementReactionQueue::processBackupQueue): Ditto.
38         (WebCore::CustomElementReactionQueue::backupElementQueue): Ditto.
39         * dom/CustomElementReactionQueue.h:
40         (WebCore::CustomElementReactionStack::hasCurrentProcessingStack): Deleted. It was never called.
41
42 2018-08-02  Timothy Hatcher  <timothy@apple.com>
43
44         Text selection color is hard to see in dark mode web views.
45         https://bugs.webkit.org/show_bug.cgi?id=188260
46         rdar://problem/42721294
47
48         Reviewed by Simon Fraser.
49
50         Stop using blendWithWhite() to transform the AppKit selection color in dark mode.
51         Using an alpha of 80% gives good contrast, and still works good for selections over images.
52
53         * platform/graphics/Color.cpp:
54         (WebCore::Color::blendWithWhite const): Mark new colors as semantic if the original is.
55         (WebCore::Color::colorWithAlpha const): Ditto.
56         * rendering/RenderElement.cpp:
57         (WebCore::RenderElement::selectionBackgroundColor const): Use transformSelectionBackgroundColor.
58         * rendering/RenderTheme.cpp:
59         (WebCore::RenderTheme::activeSelectionBackgroundColor const): Use transformSelectionBackgroundColor.
60         (WebCore::RenderTheme::inactiveSelectionBackgroundColor const): Ditto.
61         (WebCore::RenderTheme::transformSelectionBackgroundColor const): Added. Just blend with white.
62         * rendering/RenderTheme.h:
63         * rendering/RenderThemeMac.h:
64         * rendering/RenderThemeMac.mm:
65         (WebCore::RenderThemeMac::transformSelectionBackgroundColor const): Added. Use an alpha with the color
66         in dark mode, otherwise fallback to RenderTheme.
67         (WebCore::RenderThemeMac::systemColor const): Use activeListBoxSelectionBackgroundColor()
68         and activeSelectionBackgroundColor() instead of caching the colors again. Update hardcoded color.
69
70 2018-08-02  Zalan Bujtas  <zalan@apple.com>
71
72         [LFC][Floating] Use displayBox.rectWithMargin().bottom instead of displayBox.bottom() to where applicable.
73         https://bugs.webkit.org/show_bug.cgi?id=188274
74
75         Reviewed by Antti Koivisto.
76
77         Float placement uses the margin box.
78
79         * layout/FloatingContext.cpp:
80         (WebCore::Layout::FloatingPair::bottom const):
81         (WebCore::Layout::Iterator::operator++):
82         (WebCore::Layout::Iterator::set):
83
84 2018-08-02  Zalan Bujtas  <zalan@apple.com>
85
86         [LFC][Floating] Right aligned float's horizontal candidate position is miscomputed.
87         https://bugs.webkit.org/show_bug.cgi?id=188273
88
89         Reviewed by Antti Koivisto.
90
91         rightAlignedBoxLeft is already shifted with the size of the margin box.
92
93         * layout/FloatingContext.cpp:
94         (WebCore::Layout::FloatingContext::alignWithFloatings const):
95
96 2018-08-02  Zalan Bujtas  <zalan@apple.com>
97
98         [LFC] Display:Box::rectWithMargin()'s width and height don't include margin left/top.
99         https://bugs.webkit.org/show_bug.cgi?id=188272
100
101         Reviewed by Antti Koivisto.
102
103         * layout/displaytree/DisplayBox.h:
104         (WebCore::Display::Box::rectWithMargin const):
105
106 2018-08-02  Zalan Bujtas  <zalan@apple.com>
107
108         [LFC][Floating] Containing block of a float could push the candidate position beyond the current float.
109         https://bugs.webkit.org/show_bug.cgi?id=188264
110
111         Reviewed by Antti Koivisto.
112
113         <div id=first style="float: left; width: 100px; height: 10px;"></div>
114         <div id=second style="float: left; width: 10px; height: 10px;"></div>
115         <div style="width: 50px; height: 50px;>
116             <div id=third style="float: left; width: 10px; height: 10px;"></div>
117         </div>
118         In the example above by the time the "third" float comes in, we are already at 110px horizontally. However the containing block of the "third" float forces
119         the candidate position at 0px. In such cases intersecting won't work since the candidate position is beyond the last(second) float (horizontally).
120         We could either keep going back to the previous floats on this vertical position and eventually intersect with "first" or just compare the horizontal
121         positions and ensure that the left/right float is not going to be placed to the left/right of the last float on the current vertical position.
122
123         * layout/FloatingContext.cpp:
124         (WebCore::Layout::FloatingPair::intersects const):
125
126 2018-08-01  Ryosuke Niwa  <rniwa@webkit.org>
127
128         Implement customElements.upgrade()
129         https://bugs.webkit.org/show_bug.cgi?id=183397
130
131         Reviewed by Frédéric Wang.
132
133         Added the support to upgrade custom elements directly. Ordinarily, custom elements get upgraded as they are
134         inserted / connected into a document but some script libraries and authors want to be able to upgrade them before that.
135         Also see https://github.com/w3c/webcomponents/issues/710
136
137         Implemented the method as specified at:
138         https://html.spec.whatwg.org/multipage/custom-elements.html#dom-customelementregistry-upgrade
139
140             When invoked, the upgrade(root) method must run these steps:
141             1. Let candidates be a list of all of root's shadow-including inclusive descendant elements,
142                in shadow-including tree order.
143             2. For each candidate of candidates, try to upgrade candidate.
144
145         Tests: imported/w3c/web-platform-tests/custom-elements/custom-element-registry/upgrade.html
146
147         * dom/CustomElementReactionQueue.cpp:
148         (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined): Removed the assertion that the upgraded element
149         is connected since the whole point of this API is to upgrade a disconnected element.
150         * dom/CustomElementRegistry.cpp:
151         (WebCore::upgradeElementsInShadowIncludingdescendants): Added.
152         (WebCore::CustomElementRegistry::upgrade): Added.
153         * dom/CustomElementRegistry.h: Forward declare DeferredPromise instead of unnecessarily including JSDOMPromiseDeferred.h.
154         * dom/CustomElementRegistry.idl:
155         * dom/Element.cpp:
156         (WebCore::Element::insertedIntoAncestor): Moved the assertion here.
157
158 2018-08-02  Simon Fraser  <simon.fraser@apple.com>
159
160         Convert calc-related enums to 8-bit enum classes
161         https://bugs.webkit.org/show_bug.cgi?id=188215
162
163         Reviewed by Zalan Bujtas.
164
165         This shrinks CSSCalcOperation from 48 to 32 bytes.
166
167         * css/CSSCalculationValue.cpp:
168         (WebCore::unitCategory):
169         (WebCore::determineCategory):
170         (WebCore::resolvedTypeForMinOrMax):
171         (WebCore::isIntegerResult):
172         (WebCore::CSSCalcExpressionNodeParser::parseValue):
173         (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
174         (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
175         (WebCore::CSSCalcExpressionNodeParser::parseMinMaxExpression):
176         (WebCore::createBlendHalf):
177         (WebCore::createCSS):
178         * css/CSSCalculationValue.h:
179         * css/CSSPrimitiveValue.cpp:
180         (WebCore::CSSPrimitiveValue::primitiveType const):
181         * css/StyleBuilderConverter.h:
182         (WebCore::StyleBuilderConverter::convertTo100PercentMinusLength):
183         * css/parser/CSSPropertyParserHelpers.cpp:
184         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumberRaw):
185         (WebCore::CSSPropertyParserHelpers::CalcParser::consumePositiveIntegerRaw):
186         (WebCore::CSSPropertyParserHelpers::consumeInteger):
187         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
188         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
189         (WebCore::CSSPropertyParserHelpers::consumeNumber):
190         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
191         (WebCore::CSSPropertyParserHelpers::consumeLength):
192         (WebCore::CSSPropertyParserHelpers::consumePercent):
193         (WebCore::CSSPropertyParserHelpers::canConsumeCalcValue):
194         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
195         (WebCore::CSSPropertyParserHelpers::consumeAngle):
196         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
197         (WebCore::CSSPropertyParserHelpers::consumeTime):
198         * platform/CalculationValue.cpp:
199         (WebCore::CalcExpressionNumber::operator== const):
200         (WebCore::CalcExpressionOperation::evaluate const):
201         (WebCore::CalcExpressionOperation::operator== const):
202         (WebCore::CalcExpressionOperation::dump const):
203         (WebCore::CalcExpressionLength::operator== const):
204         (WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):
205         (WebCore::CalcExpressionBlendLength::operator== const):
206         (WebCore::operator<<):
207         * platform/CalculationValue.h:
208         (WebCore::CalcExpressionNumber::CalcExpressionNumber):
209         (WebCore::toCalcExpressionNumber):
210         (WebCore::CalcExpressionLength::CalcExpressionLength):
211         (WebCore::toCalcExpressionLength):
212         (WebCore::CalcExpressionOperation::CalcExpressionOperation):
213         (WebCore::toCalcExpressionOperation):
214         (WebCore::toCalcExpressionBlendLength):
215         * platform/Length.cpp:
216         (WebCore::convertTo100PercentMinusLength):
217
218 2018-08-02  Charlie Turner  <cturner@igalia.com>
219
220         Handle zero-sized ISOMP4 boxes appropriately
221         https://bugs.webkit.org/show_bug.cgi?id=188256
222
223         Reviewed by Jer Noble.
224
225         According to ISO/IEC 14496-12:2012(E), when the Box classes' size
226         field is zero, the implied size of the box extends to the end of
227         the file. If this detail is not taken into account, CENC
228         sanitization can incorrectly report an invalid box size, since 0
229         != the number of bytes in this box, specifically, the data layout
230         of Box is as follows,
231
232         aligned(8) class Box (unsigned int(32) boxtype,
233               optional unsigned int(8)[16] extended_type) {
234            unsigned int(32) size;
235            unsigned int(32) type = boxtype;
236            if (size==1) {
237              unsigned int(64) largesize;
238            } else if (size==0) { // This is the case now handled.
239              // box extends to end of file
240            }
241            if (boxtype==‘uuid’) {
242              unsigned int(8)[16] usertype = extended_type;
243            }
244         }
245
246         Tested by imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html
247
248         * platform/graphics/iso/ISOBox.cpp:
249         (WebCore::ISOBox::peekBox): Check if the parsed size is zero, and
250         if it is, the size is calculated as the total number of bytes in
251         the incoming DataView.
252         (WebCore::ISOBox::parse): Ditto.
253
254 2018-08-01  Dan Bernstein  <mitz@apple.com>
255
256         Optionally expose Attr::style to JavaScript
257         https://bugs.webkit.org/show_bug.cgi?id=188226
258         <rdar://problem/42818113>
259
260         Reviewed by Darin Adler.
261
262         Test: TestWebKitAPI/Tests/WebKitCocoa/AttrStyle.mm
263
264         * dom/Attr.cpp: Update comment.
265         * dom/Attr.idl: Define the style attribute, enabled at runtime by the AttrStyle feature.
266
267         * page/RuntimeEnabledFeatures.h:
268         (WebCore::RuntimeEnabledFeatures::setAttrStyleEnabled): Added this accessor.
269         (WebCore::RuntimeEnabledFeatures::attrStyleEnabled const): Ditto.
270
271 2018-08-02  David Fenton  <david_fenton@apple.com>
272
273         Unreviewed, rolling out r234489.
274
275         Caused 50+ crashes and 60+ API failures on iOS
276
277         Reverted changeset:
278
279         "[WTF] Rename String::format to String::deprecatedFormat"
280         https://bugs.webkit.org/show_bug.cgi?id=188191
281         https://trac.webkit.org/changeset/234489
282
283 2018-08-02  Zalan Bujtas  <zalan@apple.com>
284
285         [LFC][Floating] Do not pass formatting root to FloatingContext
286         https://bugs.webkit.org/show_bug.cgi?id=188257
287
288         Reviewed by Antti Koivisto.
289
290         If we ever need it, we can get it from FloatingState.
291
292         * layout/FloatingContext.cpp:
293         (WebCore::Layout::FloatingContext::FloatingContext):
294         * layout/FloatingContext.h:
295         * layout/blockformatting/BlockFormattingContext.cpp:
296         (WebCore::Layout::BlockFormattingContext::layout const):
297
298 2018-08-01  Zalan Bujtas  <zalan@apple.com>
299
300         [LFC][Floating] Convert all coordinates relative to the formatting context root.
301         https://bugs.webkit.org/show_bug.cgi?id=188249
302
303         Reviewed by Antti Koivisto.
304
305         The idea here is that all the float related computation should be happening in the same coordinate system.
306         FloatItem holds the transformed Display::Box for both the layout box and its containing block. 
307
308         * layout/FloatingContext.cpp:
309         (WebCore::Layout::begin):
310         (WebCore::Layout::end):
311         (WebCore::Layout::FloatingContext::computePosition const):
312         (WebCore::Layout::FloatingContext::floatingPosition const):
313         (WebCore::Layout::FloatingContext::initialVerticalPosition const):
314         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
315         (WebCore::Layout::FloatingContext::alignWithFloatings const):
316         (WebCore::Layout::FloatingContext::toContainingBlock const):
317         (WebCore::Layout::FloatingPair::FloatingPair):
318         (WebCore::Layout::FloatingPair::left const):
319         (WebCore::Layout::FloatingPair::right const):
320         (WebCore::Layout::Iterator::Iterator):
321         (WebCore::Layout::previousFloatingIndex):
322         (WebCore::Layout::Iterator::operator++):
323         (WebCore::Layout::Iterator::set):
324         * layout/FloatingContext.h:
325         * layout/FloatingState.cpp:
326         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
327         (WebCore::Layout::FloatingState::remove):
328         (WebCore::Layout::FloatingState::append):
329         * layout/FloatingState.h:
330         (WebCore::Layout::FloatingState::isEmpty const):
331         (WebCore::Layout::FloatingState::FloatItem::layoutBox const):
332         (WebCore::Layout::FloatingState::FloatItem::containingBlock const):
333         (WebCore::Layout::FloatingState::FloatItem::displayBox const):
334         (WebCore::Layout::FloatingState::FloatItem::containingBlockDisplayBox const):
335         (WebCore::Layout::FloatingState::floats const):
336         (WebCore::Layout::FloatingState::last const):
337         (WebCore::Layout::FloatingState::root const):
338         (WebCore::Layout::FloatingState::floatings const): Deleted.
339         * layout/displaytree/DisplayBox.h:
340
341 2018-08-02  Charlie Turner  <cturner@igalia.com>
342
343         [GStreamer] Dynamically adjust blocksize
344         https://bugs.webkit.org/show_bug.cgi?id=188194
345
346         Reviewed by Xabier Rodriguez-Calvar.
347
348         Update the blocksize depending on how much is obtained from a read
349         of the input stream. This avoids doing too many reads in small
350         chunks when larger amounts of data are available and also prevents
351         using a very large memory area to read a small chunk of data.
352
353         Adapted from https://bugzilla.gnome.org/show_bug.cgi?id=767833
354
355         No tests new tests since no change in functionality.
356
357         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
358         (webkit_web_src_init):
359         (CachedResourceStreamingClient::checkUpdateBlocksize):
360         (CachedResourceStreamingClient::dataReceived):
361
362 2018-08-02  Charlie Turner  <cturner@igalia.com>
363
364         [GStreamer] Stop pushing buffers when seeking status changes
365         https://bugs.webkit.org/show_bug.cgi?id=188193
366
367         Reviewed by Xabier Rodriguez-Calvar.
368
369         After switching to splitting buffers into smaller block sizes in
370
371             https://bugs.webkit.org/show_bug.cgi?id=182829
372
373         It was found that during the individual buffer pushes, the seeking
374         status could change behind our backs from another thread. When
375         this happens, buffers from incorrect offsets would find their way
376         into appsrc and eventually the demuxer itself, which would start
377         parsing from a random place and at best give a confusing error
378         message.
379
380         The solution here is break from pushing buffers when the seeking
381         status has been has changed. Flushes will clear out what we've
382         already delivered into the appsrc, then we must make sure to not
383         continue sending buffers in there after the flush.
384
385         No new tests since this is a timing bug.
386
387         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
388         (CachedResourceStreamingClient::dataReceived):
389
390 2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>
391
392         Unreviewed, revert TransformationMatrix::operator== change
393         https://bugs.webkit.org/show_bug.cgi?id=188197
394
395         This change partially revert cleaning up of TransformationMatrix since memcmp does not
396         follow double comparison algorithm. So semantics was accidentally changed.
397
398         * platform/graphics/transforms/TransformationMatrix.h:
399         (WebCore::TransformationMatrix::operator== const):
400
401 2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>
402
403         Unreviewed, rename TransformationMatrix::Identity to TransformationMatrix::identity
404         https://bugs.webkit.org/show_bug.cgi?id=188204
405
406         Follow the coding style.
407
408         * platform/graphics/GraphicsLayer.cpp:
409         (WebCore::GraphicsLayer::transform const):
410         (WebCore::GraphicsLayer::childrenTransform const):
411         * platform/graphics/transforms/TransformationMatrix.cpp:
412         * platform/graphics/transforms/TransformationMatrix.h:
413
414 2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>
415
416         Add self.queueMicrotask(f) on DOMWindow
417         https://bugs.webkit.org/show_bug.cgi?id=188212
418
419         Reviewed by Ryosuke Niwa.
420
421         This patch adds self.queueMicrotask(f) in DOMWindow, which takes a function and enqueue it into microtask queue.
422         We do not add this to Worker's global scope since our worker does not support microtasks correctly.
423
424         Tests: js/dom/queue-microtask-window.html
425
426         * bindings/js/JSDOMWindowCustom.cpp:
427         (WebCore::JSDOMWindow::queueMicrotask):
428         Post a microtask to JSC's microtask mechanism. This will eventually go to WebCore's MicrotaskQueue code.
429
430         * page/DOMWindow.idl:
431
432 2018-08-01  Tomas Popela  <tpopela@redhat.com>
433
434         [WTF] Rename String::format to String::deprecatedFormat
435         https://bugs.webkit.org/show_bug.cgi?id=188191
436
437         Reviewed by Darin Adler.
438
439         It should be replaced with string concatenation.
440
441         * Modules/indexeddb/IDBKeyData.cpp:
442         (WebCore::IDBKeyData::loggingString const):
443         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
444         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
445         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
446         (WebCore::IDBCursorInfo::loggingString const):
447         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
448         (WebCore::IDBGetAllRecordsData::loggingString const):
449         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
450         (WebCore::IDBGetRecordData::loggingString const):
451         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
452         (WebCore::IDBIndexInfo::loggingString const):
453         (WebCore::IDBIndexInfo::condensedLoggingString const):
454         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
455         (WebCore::IDBIterateCursorData::loggingString const):
456         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
457         (WebCore::IDBObjectStoreInfo::condensedLoggingString const):
458         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
459         (WebCore::IDBResourceIdentifier::loggingString const):
460         * Modules/webdatabase/Database.cpp:
461         (WebCore::formatErrorMessage):
462         * Modules/webdatabase/SQLError.h:
463         (WebCore::SQLError::create):
464         * Modules/websockets/WebSocket.cpp:
465         (WebCore::encodeProtocolString):
466         * accessibility/win/AccessibilityObjectWrapperWin.cpp:
467         (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue):
468         * css/CSSUnicodeRangeValue.cpp:
469         (WebCore::CSSUnicodeRangeValue::customCSSText const):
470         * css/MediaQueryEvaluator.cpp:
471         (WebCore::aspectRatioValueAsString):
472         * css/parser/CSSParserToken.cpp:
473         (WebCore::CSSParserToken::serialize const):
474         * css/parser/CSSPropertyParserHelpers.cpp:
475         (WebCore::CSSPropertyParserHelpers::parseHexColor):
476         * dom/Document.cpp:
477         (WebCore::Document::lastModified):
478         * html/FTPDirectoryDocument.cpp:
479         (WebCore::processFilesizeString):
480         (WebCore::processFileDateString):
481         * html/HTMLMediaElement.h:
482         (WTF::ValueToString<WebCore::TextTrackCue::string):
483         * html/HTMLSelectElement.cpp:
484         (WebCore::HTMLSelectElement::setLength):
485         * html/ImageDocument.cpp:
486         (WebCore::ImageDocument::imageUpdated):
487         * html/canvas/WebGLRenderingContextBase.cpp:
488         * html/parser/XSSAuditor.cpp:
489         (WebCore::XSSAuditor::init):
490         * html/track/VTTCue.cpp:
491         (WebCore::VTTCueBox::applyCSSProperties):
492         * inspector/InspectorFrontendClientLocal.cpp:
493         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable):
494         (WebCore::InspectorFrontendClientLocal::setAttachedWindow):
495         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled):
496         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled):
497         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
498         * inspector/agents/InspectorCSSAgent.cpp:
499         * inspector/agents/InspectorIndexedDBAgent.cpp:
500         * page/CaptionUserPreferencesMediaAF.cpp:
501         (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS const):
502         * page/History.cpp:
503         (WebCore::History::stateObjectAdded):
504         * page/MemoryRelease.cpp:
505         (WebCore::logMemoryStatisticsAtTimeOfDeath):
506         * page/cocoa/ResourceUsageOverlayCocoa.mm:
507         (WebCore::formatByteNumber):
508         (WebCore::gcTimerString):
509         (WebCore::ResourceUsageOverlay::platformDraw):
510         * page/cocoa/ResourceUsageThreadCocoa.mm:
511         (WebCore::logFootprintComparison):
512         * page/linux/ResourceUsageOverlayLinux.cpp:
513         (WebCore::cpuUsageString):
514         (WebCore::formatByteNumber):
515         (WebCore::gcTimerString):
516         * page/scrolling/AxisScrollSnapOffsets.cpp:
517         (WebCore::snapOffsetsToString):
518         (WebCore::snapOffsetRangesToString):
519         (WebCore::snapPortOrAreaToString):
520         * platform/DateComponents.cpp:
521         (WebCore::DateComponents::toStringForTime const):
522         (WebCore::DateComponents::toString const):
523         * platform/LocalizedStrings.cpp:
524         * platform/animation/TimingFunction.cpp:
525         (WebCore::TimingFunction::cssText const):
526         * platform/audio/HRTFElevation.cpp:
527         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
528         * platform/cocoa/KeyEventCocoa.mm:
529         (WebCore::keyIdentifierForCharCode):
530         * platform/gamepad/mac/HIDGamepad.cpp:
531         (WebCore::HIDGamepad::HIDGamepad):
532         * platform/glib/UserAgentGLib.cpp:
533         (WebCore::platformVersionForUAString):
534         * platform/graphics/Color.cpp:
535         (WebCore::Color::nameForRenderTreeAsText const):
536         * platform/graphics/FloatPolygon.h:
537         (WTF::ValueToString<WebCore::FloatPolygonEdge::string):
538         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
539         (WebCore::AVTrackPrivateAVFObjCImpl::id const):
540         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
541         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC):
542         * platform/graphics/ca/GraphicsLayerCA.cpp:
543         (WebCore::GraphicsLayerCA::setName):
544         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
545         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
546         (WebCore::GraphicsLayerCA::updateContentsImage):
547         (WebCore::GraphicsLayerCA::updateContentsRects):
548         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
549         * platform/graphics/gstreamer/GStreamerCommon.cpp:
550         (WebCore::simpleBusMessageCallback):
551         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
552         (WebCore::MediaPlayerPrivateGStreamer::load):
553         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
554         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
555         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
556         (WebCore::AppendPipeline::handleStateChangeMessage):
557         (WebCore::AppendPipeline::resetPipeline):
558         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
559         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
560         (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
561         * platform/graphics/gtk/ImageBufferGtk.cpp:
562         (WebCore::encodeImage):
563         * platform/gtk/PlatformKeyboardEventGtk.cpp:
564         (WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode):
565         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
566         (WebCore::GStreamerAudioCaptureSource::create):
567         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
568         (WebCore::webkitMediaStreamSrcAddPad):
569         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
570         (WebCore::GStreamerVideoCaptureSource::create):
571         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
572         (WebCore::GStreamerVideoEncoder::makeElement):
573         * platform/mock/MockRealtimeVideoSource.cpp:
574         (WebCore::MockRealtimeVideoSource::drawText):
575         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
576         * platform/network/ParsedContentRange.cpp:
577         (WebCore::ParsedContentRange::headerValue const):
578         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
579         (WebCore::NetworkStorageSession::switchToNewTestingSession):
580         * platform/sql/SQLiteDatabase.cpp:
581         (WebCore::unauthorizedSQLFunction):
582         * platform/text/PlatformLocale.cpp:
583         (WebCore::DateTimeStringBuilder::visitField):
584         * platform/win/GDIObjectCounter.cpp:
585         (WebCore::GDIObjectCounter::GDIObjectCounter):
586         * platform/win/KeyEventWin.cpp:
587         (WebCore::keyIdentifierForWindowsKeyCode):
588         * rendering/FloatingObjects.h:
589         (WTF::ValueToString<WebCore::FloatingObject::string):
590         * rendering/RenderFragmentedFlow.h:
591         (WTF::ValueToString<WebCore::RenderFragmentContainer::string):
592         * rendering/RenderLayerCompositor.cpp:
593         (WebCore::RenderLayerCompositor::logLayerInfo):
594         * rendering/RenderTheme.cpp:
595         (WebCore::RenderTheme::formatMediaControlsTime const):
596         * testing/Internals.cpp:
597         (WebCore::Internals::address):
598         * workers/service/server/RegistrationDatabase.cpp:
599         (WebCore::RegistrationDatabase::ensureValidRecordsTable):
600         (WebCore::RegistrationDatabase::importRecords):
601
602 2018-08-01  Alex Christensen  <achristensen@webkit.org>
603
604         Move all calls to ResourceLoader::start to WebKitLegacy
605         https://bugs.webkit.org/show_bug.cgi?id=184946
606
607         Reviewed by Andy Estes.
608
609         This is in preparation for moving ResourceLoader::start to WebKitLegacy along with all ResourceHandle code.
610         I move the code that moves m_deferredRequest into m_request into WebKitLegacy, which won't change behavior for
611         modern WebKit because modern WebKit never calls ResourceLoader::start, the only place where m_deferredRequest
612         is ever set.  This won't change behavior for WebKitLegacy because the same operations happen in the same order.
613
614         * loader/LoaderStrategy.h:
615         * loader/ResourceLoader.cpp:
616         (WebCore::ResourceLoader::setDefersLoading):
617         * loader/ResourceLoader.h:
618         (WebCore::ResourceLoader::setRequest):
619         (WebCore::ResourceLoader::deferredRequest const):
620         (WebCore::ResourceLoader::takeDeferredRequest):
621
622 2018-08-01  Nan Wang  <n_wang@apple.com>
623
624         AX: AOM: Add ARIA IDL Attribute Reflection
625         https://bugs.webkit.org/show_bug.cgi?id=184676
626         <rdar://problem/39476882>
627
628         Reviewed by Chris Fleizach.
629
630         Test: accessibility/ARIA-reflection.html
631
632         * CMakeLists.txt:
633         * DerivedSources.make:
634         * WebCore.xcodeproj/project.pbxproj:
635         * accessibility/AccessibilityRole.idl: Added.
636         * accessibility/AriaAttributes.idl: Added.
637         * dom/Element.idl:
638         * page/RuntimeEnabledFeatures.h:
639         (WebCore::RuntimeEnabledFeatures::setAriaReflectionEnabled):
640         (WebCore::RuntimeEnabledFeatures::ariaReflectionEnabled const):
641
642 2018-08-01  Zalan Bujtas  <zalan@apple.com>
643
644         [LFC][Floating] Revert back to only one list for the all the floatings.
645         https://bugs.webkit.org/show_bug.cgi?id=188232
646
647         Reviewed by Antti Koivisto.
648
649         If the combined floating list turns out to be a performance bottleneck, we can still split it into left and right. However at this point
650         having 2 dedicated lists just makes the implementation more complicated.
651
652         * layout/FloatingContext.cpp:
653         (WebCore::Layout::begin):
654         (WebCore::Layout::end):
655         (WebCore::Layout::FloatingPair::FloatingPair):
656         (WebCore::Layout::FloatingPair::left const):
657         (WebCore::Layout::FloatingPair::right const):
658         (WebCore::Layout::Iterator::Iterator):
659         (WebCore::Layout::previousFloatingIndex):
660         (WebCore::Layout::Iterator::operator++):
661         (WebCore::Layout::Iterator::set):
662         (WebCore::Layout::floatingDisplayBox): Deleted.
663         * layout/FloatingState.cpp:
664         (WebCore::Layout::FloatingState::remove):
665         (WebCore::Layout::FloatingState::append):
666         * layout/FloatingState.h:
667         (WebCore::Layout::FloatingState::isEmpty const):
668         (WebCore::Layout::FloatingState::floatings const):
669         (WebCore::Layout::FloatingState::last const):
670
671 2018-08-01  Basuke Suzuki  <Basuke.Suzuki@sony.com>
672
673         [Curl] Change synchronous request logic using MessageQueue to match with Mac port.
674         https://bugs.webkit.org/show_bug.cgi?id=188206
675
676         Reviewed by Alex Christensen.
677
678         Port synchronous request logic from ResourceHandleMac to use MessageQueue for
679         client callback invocation. This makes simplify the logic of CurlRequest because
680         now every requests are handled in Curl thread and there's no difference between
681         sync and async requests.
682
683         Test: Covered by these tests:
684         - http\tests\xmlhttprequest\simple-sync.html
685         - http\tests\xmlhttprequest\xmlhttprequest-unsafe-redirect.html
686
687         * platform/network/ResourceHandleInternal.h:
688         * platform/network/curl/CurlRequest.cpp: Remove synchronous request logics.
689         (WebCore::CurlRequest::CurlRequest):
690         (WebCore::CurlRequest::invalidateClient):
691         (WebCore::CurlRequest::start):
692         (WebCore::CurlRequest::cancel):
693         (WebCore::CurlRequest::runOnMainThread): Added message queue handling.
694         (WebCore::CurlRequest::runOnWorkerThreadIfRequired):
695         (WebCore::CurlRequest::didReceiveData):
696         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
697         (WebCore::CurlRequest::completeDidReceiveResponse):
698         (WebCore::CurlRequest::updateHandlePauseState):
699         (WebCore::CurlRequest::isHandlePaused const):
700         * platform/network/curl/CurlRequest.h:
701         (WebCore::CurlRequest::create):
702         (WebCore::CurlRequest::resourceRequest const):
703         * platform/network/curl/ResourceHandleCurl.cpp:
704         (WebCore::ResourceHandle::createCurlRequest):
705         (WebCore::ResourceHandle::restartRequestWithCredential):
706         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
707         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
708         (WebCore::ResourceHandle::continueAfterDidReceiveResponse):
709         (WebCore::ResourceHandle::continueAfterWillSendRequest):
710         (WebCore::ResourceHandle::handleDataURL):
711
712 2018-08-01  Zalan Bujtas  <zalan@apple.com>
713
714         [LFC][Floating] Use margin box consistently while placing a floating.
715         https://bugs.webkit.org/show_bug.cgi?id=188222
716
717         Reviewed by Antti Koivisto.
718
719         The floating box fits when its margin box fits.
720
721         * layout/FloatingContext.cpp:
722         (WebCore::Layout::FloatingContext::computePosition const):
723         (WebCore::Layout::FloatingContext::floatingPosition const):
724         (WebCore::Layout::FloatingContext::initialVerticalPosition const):
725         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
726         (WebCore::Layout::FloatingContext::alignWithFloatings const):
727         (WebCore::Layout::FloatingPair::intersects const):
728         * layout/displaytree/DisplayBox.h:
729         (WebCore::Display::Box::rectWithMargin const):
730
731 2018-08-01  Zalan Bujtas  <zalan@apple.com>
732
733         [LFC] Add FormattingContext::mapToAncestor geometry mapping function
734         https://bugs.webkit.org/show_bug.cgi?id=188188
735
736         Reviewed by Antti Koivisto.
737
738         * layout/FormattingContext.cpp:
739         (WebCore::Layout::FormattingContext::mapToAncestor):
740         * layout/FormattingContext.h:
741         * layout/displaytree/DisplayBox.cpp:
742         (WebCore::Display::Box::clone const):
743         * layout/displaytree/DisplayBox.h:
744
745 2018-08-01  Basuke Suzuki  <Basuke.Suzuki@sony.com>
746
747         [Curl] Bugfix on ResourceHandle::cancel()
748         https://bugs.webkit.org/show_bug.cgi?id=188234
749
750         Reviewed by Darin Adler.
751         Trivial bug. The actual request was not cancelled correctly.
752
753         * platform/network/curl/ResourceHandleCurl.cpp:
754         (WebCore::ResourceHandle::cancel):
755
756 2018-08-01  Zalan Bujtas  <zalan@apple.com>
757
758         [LFC][Floating] FloatingState should take the formatting root box.
759         https://bugs.webkit.org/show_bug.cgi?id=188214
760
761         Reviewed by Antti Koivisto.
762
763         This will be taken into use when FormattingContext takes all boxes in the coordinate system of the formatting root.
764
765         * layout/FloatingState.cpp:
766         (WebCore::Layout::FloatingState::FloatingState):
767         (WebCore::Layout::belongsToThisFloatingContext):
768         (WebCore::Layout::FloatingState::append):
769         * layout/FloatingState.h:
770         (WebCore::Layout::FloatingState::create):
771         * layout/LayoutContext.cpp:
772         (WebCore::Layout::LayoutContext::establishedFormattingState):
773
774 2018-08-01  Zalan Bujtas  <zalan@apple.com>
775
776         [LFC][Floating] Align new floating with the bottom of the existing floatings.
777         https://bugs.webkit.org/show_bug.cgi?id=188213
778
779         Reviewed by Antti Koivisto.
780
781         When the incoming floating does not fit at all, align its top with the bottom of the existing floatings.
782
783         * layout/FloatingContext.cpp:
784         (WebCore::Layout::FloatingContext::floatingPosition const):
785         (WebCore::Layout::FloatingPair::bottom const):
786
787 2018-08-01  Eric Carlson  <eric.carlson@apple.com>
788
789         Always use MediaPlayback audio category when playing to AppleTV
790         https://bugs.webkit.org/show_bug.cgi?id=188230
791         <rdar://problem/42497809>
792
793         Reviewed by Jer Noble.
794
795         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
796         (PlatformMediaSessionManager::updateSessionState): Check session.isPlayingToWirelessPlaybackTarget().
797
798 2018-08-01  Timothy Hatcher  <timothy@apple.com>
799
800         Hardcode some system colors to avoid fingerprinting exposure.
801         https://bugs.webkit.org/show_bug.cgi?id=188203
802         rdar://problem/42781630
803
804         Reviewed by Tim Horton.
805
806         Passes existing tests with the hardcoded blue system appearance.
807
808         * rendering/RenderTheme.h:
809         * rendering/RenderThemeMac.mm:
810         (WebCore::RenderThemeMac::systemColor const):
811         Adds special handling for some system colors. Fixes -apple-system-selected-text-background
812         to match the real selection color by using blendWithWhite().
813
814 2018-08-01  Eric Carlson  <eric.carlson@apple.com>
815
816         [iOS] Remove the delay before setting audio session category added in r233535
817         https://bugs.webkit.org/show_bug.cgi?id=188225
818
819         Reviewed by Jer Noble.
820
821         * platform/audio/PlatformMediaSessionManager.cpp:
822         (WebCore::PlatformMediaSessionManager::beginInterruption): scheduleUpdateSessionState -> updateSessionState.
823         (WebCore::PlatformMediaSessionManager::addSession): Ditto.
824         (WebCore::PlatformMediaSessionManager::removeSession): Ditto.
825         (WebCore::PlatformMediaSessionManager::sessionStateChanged): Ditto.
826         (WebCore::PlatformMediaSessionManager::sessionCanProduceAudioChanged): Ditto.
827         (WebCore::PlatformMediaSessionManager::updateSessionState): Ditto.
828         (WebCore::PlatformMediaSessionManager::audioOutputDeviceChanged): Ditto.
829         (WebCore::PlatformMediaSessionManager::scheduleUpdateSessionState): Deleted.
830         * platform/audio/PlatformMediaSessionManager.h:
831
832         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
833         (PlatformMediaSessionManager::updateSessionState):
834         (PlatformMediaSessionManager::scheduleUpdateSessionState): Deleted.
835         * rendering/RenderLayer.cpp:
836         (WebCore::RenderLayer::updateClipRects):
837
838 2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>
839
840         Add TransformationMatrix::Identity
841         https://bugs.webkit.org/show_bug.cgi?id=188204
842
843         Reviewed by Simon Fraser.
844
845         This patch adds TransformationMatrix::Identity, which is a static const variable holding an identity matrix.
846
847         No behavior change.
848
849         * platform/graphics/GraphicsLayer.cpp:
850         (WebCore::GraphicsLayer::transform const):
851         (WebCore::GraphicsLayer::childrenTransform const):
852         (): Deleted.
853         * platform/graphics/transforms/TransformationMatrix.cpp:
854         * platform/graphics/transforms/TransformationMatrix.h:
855
856 2018-08-01  Thibault Saunier  <tsaunier@igalia.com>
857
858         [GStreamer] Make sure that first buffer running time is 0 in GStreamerMediaStreamSource
859         https://bugs.webkit.org/show_bug.cgi?id=188210
860
861         This is a live source and the first frame is the beginning of the stream,
862         but that doesn't mean that the incoming stream from the camera didn't start
863         before. We need to set a pad offset on each srcpad of the source to compensate
864         for that. This is the exact same logic as in webrtc GStreamerVideo/Enc/Dec/oder.
865
866         Reviewed by Alejandro G. Castro.
867
868         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
869         (WebCore::webkit_media_stream_src_init):
870         (WebCore::webkitMediaStreamSrcPushVideoSample):
871         (WebCore::webkitMediaStreamSrcPushAudioSample):
872
873 2018-08-01  Zan Dobersek  <zdobersek@igalia.com>
874
875         [CoordGraphics] Move CoordinatedBackingStore to WebCore
876         https://bugs.webkit.org/show_bug.cgi?id=188158
877
878         Reviewed by Carlos Garcia Campos.
879
880         Move the CoordinatedBackingStore class from WebKit to WebCore. It has no
881         dependency on anything in the WebKit layer, and it's more suitable to
882         future needs to keep it in the WebCore layer.
883
884         * platform/TextureMapper.cmake:
885         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp: Renamed from Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp.
886         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h: Renamed from Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.h.
887         (WebCore::CoordinatedBackingStoreTile::CoordinatedBackingStoreTile):
888         (WebCore::CoordinatedBackingStore::rect const):
889
890 2018-07-31  Myles C. Maxfield  <mmaxfield@apple.com>
891
892         [WIN] Fix tests for text with initial advances
893         https://bugs.webkit.org/show_bug.cgi?id=188099
894
895         Reviewed by Darin Adler.
896
897         Fixup after r234318.
898
899         Tests: fast/text/complex-first-glyph-with-initial-advance.html
900                fast/text/initial-advance-in-intermediate-run-complex.html
901
902         * platform/graphics/ComplexTextController.cpp:
903         * platform/graphics/FontCascade.cpp:
904         (WebCore::FontCascade::drawGlyphBuffer const):
905
906 2018-07-31  Alex Christensen  <achristensen@webkit.org>
907
908         REGRESSION (r231107): MoviStar+ launches to a blank black screen
909         https://bugs.webkit.org/show_bug.cgi?id=188139
910
911         Reviewed by Brent Fulgham.
912
913         For this app, revert behavior to how it was before r231107 with a linked-on-or-before check.
914         r231107 increased our fetch spec conformance, which we intend to keep.  This makes a low-risk
915         targeted fix that will fix the affected app until they update.  
916
917         I manually verified this fixes the app.
918
919         * loader/DocumentThreadableLoader.cpp:
920         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
921         * platform/RuntimeApplicationChecks.h:
922         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
923         (WebCore::applicationSDKVersionOverride):
924         (WebCore::setApplicationSDKVersion):
925         (WebCore::applicationSDKVersion):
926         (WebCore::IOSApplication::isMoviStarPlus):
927
928 2018-07-31  Myles C. Maxfield  <mmaxfield@apple.com>
929
930         [Cocoa] Addressing post-review comments on r234158
931         https://bugs.webkit.org/show_bug.cgi?id=188202
932
933         Reviewed by Darin Adler.
934
935         * platform/graphics/cocoa/FontCacheCoreText.cpp:
936         (WebCore::FontCache::lastResortFallbackFont):
937
938 2018-07-31  John Wilander  <wilander@apple.com>
939
940         Resource Load Statistics: Remove partitioned cookies for reduced complexity, lower memory footprint, and ability to support more platforms
941         https://bugs.webkit.org/show_bug.cgi?id=188109
942         <rdar://problem/42664391>
943
944         Reviewed by Brent Fulgham, Chris Dumez, and Alex Christensen.
945
946         Tests: http/tests/resourceLoadStatistics/cookie-deletion.html
947                http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction.html
948                http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-user-interaction.html
949                http/tests/storageAccess/request-and-grant-access-cross-origin-non-sandboxed-iframe-pop-window.html
950                http/tests/storageAccess/request-and-grant-access-cross-origin-non-sandboxed-iframe.html
951                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-and-access-from-right-frame.html
952                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-but-access-from-wrong-frame.html
953                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction.html
954                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-without-user-interaction.html
955                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe.html
956                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-nested-iframe.html
957
958         This patch removes cookie partitioning which reduces the model to just
959         blocked cookies (in third-party contexts) and first-party cookie access.
960
961         Several of the changes are renaming to reflect that there are no more
962         cookie partitions. However, the compile-time check remains for now since
963         this change is not ready to ship.
964
965         The test cases mentioned about are not new. They are just renamed to
966         reflect the code changes and to shorten their names (as requested by
967         non-Cocoa platforms).
968
969         * loader/ResourceLoadStatistics.cpp:
970         (WebCore::ResourceLoadStatistics::toString const):
971         (WebCore::ResourceLoadStatistics::merge):
972             Removed the use of isMarkedForCookiePartitioning.
973         * loader/ResourceLoadStatistics.h:
974             Removed isMarkedForCookiePartitioning.
975         * platform/network/NetworkStorageSession.h:
976         * platform/network/ResourceHandle.h:
977             Renamed applySniffingPoliciesAndStoragePartitionIfNeeded() to
978             applySniffingPoliciesIfNeeded().
979         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
980         (WebCore::getPartitioningDomain):
981         (WebCore::NetworkStorageSession::shouldBlockCookies const):
982             Now takes a frame ID and a page ID to be able to support
983             the Storage Access API. This was previously handled by
984             shouldPartitionCookies() which is now deleted.
985         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
986             Renamed from setPrevalentDomainsToPartitionOrBlockCookies().
987         (WebCore::NetworkStorageSession::removePrevalentDomains):
988             No longer needs to clear the member variable for partitioned cookie domains.
989         (WebCore::NetworkStorageSession::setCookieStoragePartitioningEnabled): Deleted.
990         (WebCore::NetworkStorageSession::cookieStoragePartition const): Deleted.
991         (WebCore::NetworkStorageSession::shouldPartitionCookies const): Deleted.
992         (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies): Deleted.
993             Renamed to setPrevalentDomainsToBlockCookiesFor().
994         * platform/network/mac/CookieJarMac.mm:
995         (WebCore::cookiesForURL):
996             Now calls session.shouldBlockCookies() instead of the
997             wrapper cookiesAreBlockedForURL().
998         (WebCore::setCookiesFromDOM):
999             No longer checks for partition.
1000         (WebCore::applyPartitionToCookies): Deleted.
1001         (WebCore::cookiesAreBlockedForURL): Deleted.
1002             This was just a wrapper for session.shouldBlockCookies().
1003         (WebCore::cookiesInPartitionForURL): Deleted.
1004         * platform/network/mac/ResourceHandleMac.mm:
1005         (WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):
1006             Renamed from applySniffingPoliciesAndStoragePartitionIfNeeded().
1007         (WebCore::ResourceHandle::createNSURLConnection):
1008             Consequence of function name change.
1009         (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded): Deleted.
1010             Renamed to applySniffingPoliciesIfNeeded().
1011
1012 2018-07-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1013
1014         [iOS] Spelling suggestions cannot be selected in focused form controls when zoomed in
1015         https://bugs.webkit.org/show_bug.cgi?id=188107
1016         <rdar://problem/42354250>
1017
1018         Reviewed by Tim Horton.
1019
1020         After r232040, the synthetic click gesture recognizer was enabled when tapping inside of the focused element,
1021         which allows the page to handle click events inside editable content. However, this means that codepaths in
1022         EventHandler that are responsible for changing selection due to default click event behaviors on macOS are now
1023         active on iOS; this conflicts with selection changes due to text interaction gestures, which are the existing
1024         mechanism for modifying the selection on iOS.
1025
1026         To address this, we defer selection changes when clicking to text interaction gestures on iOS by tweaking the
1027         default behavior of a click on iOS to /not/ change selection when moving within the same editable root. This is
1028         similar to r233311, but in a different codepath that specifically handles selection changes when clicking on
1029         content that is already selected.
1030
1031         Test: fast/forms/ios/click-should-not-suppress-misspelling.html
1032
1033         * page/EventHandler.cpp:
1034         (WebCore::EventHandler::handleMouseReleaseEvent):
1035
1036 2018-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1037
1038         Clean up TransformationMatrix implementation
1039         https://bugs.webkit.org/show_bug.cgi?id=188197
1040
1041         Reviewed by Simon Fraser.
1042
1043         We perform cleaning up of TransformationMatrix.
1044
1045         1. We drop user-defined operator= and copy constructor. Default ones works well for TransformationMatrix.
1046         2. Remove unused setMatrix. We explicitly use memcpy in TransformationMatrix.cpp (only one place).
1047         3. Use memcmp for implementing operator==.
1048
1049         In (2) and (3), we use `memcpy(&matrix[0][0], &tmp[0][0], sizeof(Matrix4))` instead of `memcpy(matrix, tmp, sizeof(Matrix4))`,
1050         since they both are non nullptr and the former is easier to understand.
1051
1052         * platform/graphics/transforms/TransformationMatrix.cpp:
1053         (WebCore::TransformationMatrix::multiply):
1054         * platform/graphics/transforms/TransformationMatrix.h:
1055         (WebCore::TransformationMatrix::setMatrix):
1056         (WebCore::TransformationMatrix::operator== const):
1057         (WebCore::TransformationMatrix::operator =): Deleted.
1058
1059 2018-07-31  Timothy Hatcher  <timothy@apple.com>
1060
1061         Don't call RenderTheme::platformColorsDidChange() during printing.
1062         https://bugs.webkit.org/show_bug.cgi?id=188181
1063         rdar://problem/42360070
1064
1065         Reviewed by Tim Horton.
1066
1067         * inspector/agents/InspectorPageAgent.cpp:
1068         (WebCore::InspectorPageAgent::setEmulatedMedia): Call m_page.updateStyleAfterChangeInEnvironment()
1069         instead of going to styleStope() and remove call to RenderTheme::platformColorsDidChange().
1070         * page/FrameView.cpp:
1071         (WebCore::FrameView::adjustMediaTypeForPrinting): Remove call RenderTheme::platformColorsDidChange().
1072
1073 2018-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1074
1075         Use static const global variable for TransformationMatrix instead of NeverDestroyed
1076         https://bugs.webkit.org/show_bug.cgi?id=188195
1077
1078         Reviewed by Darin Adler.
1079
1080         Since TransformationMatrix does not have a non-trivial destructor, we can put it
1081         as static const global variable if its constructor is constexpr. This patch makes
1082         some of constructors constexpr and makes identityTransform static const global variable
1083         instead of NeverDestroyed<> + static function. This removes unnecessary static function
1084         and lazy initialization.
1085
1086         No behavior change.
1087
1088         * platform/graphics/GraphicsLayer.cpp:
1089         (WebCore::GraphicsLayer::transform const):
1090         (WebCore::GraphicsLayer::childrenTransform const):
1091         (WebCore::identityTransform): Deleted.
1092         * platform/graphics/transforms/TransformationMatrix.h:
1093         (WebCore::TransformationMatrix::TransformationMatrix):
1094
1095 2018-07-31  Zalan Bujtas  <zalan@apple.com>
1096
1097         [LFC][Floating] Add basic left/right floating positioning.
1098         https://bugs.webkit.org/show_bug.cgi?id=188148
1099
1100         Reviewed by Antti Koivisto.
1101
1102         This patch implements simple floating positioning.
1103         (Floatings with different containing blocks do not work yet.)
1104
1105         * layout/FloatingContext.cpp:
1106         (WebCore::Layout::FloatingPair::isEmpty const):
1107         (WebCore::Layout::Iterator::current const):
1108         (WebCore::Layout::Iterator::verticalPosition const):
1109         (WebCore::Layout::FloatingContext::FloatingContext):
1110         (WebCore::Layout::FloatingContext::computePosition const):
1111         (WebCore::Layout::FloatingContext::floatingPosition const):
1112         (WebCore::Layout::FloatingContext::initialVerticalPosition const):
1113         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
1114         (WebCore::Layout::FloatingContext::alignWithFloatings const):
1115         (WebCore::Layout::floatingDisplayBox):
1116         (WebCore::Layout::FloatingPair::FloatingPair):
1117         (WebCore::Layout::FloatingPair::left const):
1118         (WebCore::Layout::FloatingPair::right const):
1119         (WebCore::Layout::FloatingPair::intersects const):
1120         (WebCore::Layout::Iterator::Iterator):
1121         (WebCore::Layout::Iterator::operator++):
1122         (WebCore::Layout::Iterator::set):
1123         (WebCore::Layout::FloatingContext::computePosition): Deleted.
1124         * layout/FloatingContext.h:
1125         * layout/FloatingState.cpp:
1126         (WebCore::Layout::FloatingState::append):
1127         * layout/FloatingState.h:
1128         (WebCore::Layout::FloatingState::floatings const):
1129         (WebCore::Layout::FloatingState::last const):
1130         * layout/blockformatting/BlockFormattingContext.cpp:
1131         (WebCore::Layout::BlockFormattingContext::layout const):
1132         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1133         * layout/displaytree/DisplayBox.cpp:
1134         (WebCore::Display::Box::Rect::Rect):
1135         * layout/displaytree/DisplayBox.h:
1136         (WebCore::Display::Box::Rect::intersects const):
1137         (WebCore::Display::Box::rect const):
1138
1139 2018-07-31  Rob Buis  <rbuis@igalia.com>
1140
1141         Remove ResourceResponse::cacheBodyKey API
1142         https://bugs.webkit.org/show_bug.cgi?id=188192
1143
1144         Reviewed by Frédéric Wang.
1145
1146         Removed unused API.
1147
1148         No new tests needed since this API is not used.
1149
1150         * platform/network/ResourceResponseBase.h:
1151         (WebCore::ResourceResponseBase::encode const):
1152         (WebCore::ResourceResponseBase::decode):
1153         (WebCore::ResourceResponseBase::cacheBodyKey const): Deleted.
1154         (WebCore::ResourceResponseBase::setCacheBodyKey): Deleted.
1155
1156 2018-07-30  Simon Fraser  <simon.fraser@apple.com>
1157
1158         Shrink GraphicsLayerCA
1159         https://bugs.webkit.org/show_bug.cgi?id=188141
1160
1161         Reviewed by Zalan Bujtas.
1162         
1163         Shrink GraphicsLayerCA from 1040 to 880 bytes by:
1164         * moving all the clone-related stuff into the lazily-allocated m_layerClones
1165         * moving all the animation-related stuff into the lazily-allocated m_animations
1166         * making enums be 8-bit
1167         * re-ordering data members
1168
1169         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1170         (WebCore::ResourceUsageOverlay::platformInitialize):
1171         * platform/graphics/GraphicsLayer.cpp:
1172         (WebCore::GraphicsLayer::GraphicsLayer):
1173         (WebCore::operator<<):
1174         * platform/graphics/GraphicsLayer.h:
1175         * platform/graphics/GraphicsLayerClient.h:
1176         * platform/graphics/WindRule.h:
1177         * platform/graphics/ca/GraphicsLayerCA.cpp:
1178         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
1179         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
1180         (WebCore::GraphicsLayerCA::addProcessingActionForAnimation):
1181         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
1182         (WebCore::GraphicsLayerCA::setContentsToImage):
1183         (WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
1184         (WebCore::GraphicsLayerCA::contentsLayerForMedia const):
1185         (WebCore::GraphicsLayerCA::layerDidDisplay):
1186         (WebCore::layerTypeForCustomBackdropAppearance):
1187         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1188         (WebCore::GraphicsLayerCA::updateGeometry):
1189         (WebCore::GraphicsLayerCA::updateMasksToBounds):
1190         (WebCore::GraphicsLayerCA::updateContentsVisibility):
1191         (WebCore::GraphicsLayerCA::updateContentsOpaque):
1192         (WebCore::GraphicsLayerCA::updateBackfaceVisibility):
1193         (WebCore::GraphicsLayerCA::updateFilters):
1194         (WebCore::GraphicsLayerCA::updateBackdropFilters):
1195         (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
1196         (WebCore::GraphicsLayerCA::ensureStructuralLayer):
1197         (WebCore::GraphicsLayerCA::updateDrawsContent):
1198         (WebCore::GraphicsLayerCA::updateCoverage):
1199         (WebCore::GraphicsLayerCA::updateDebugIndicators):
1200         (WebCore::GraphicsLayerCA::updateContentsImage):
1201         (WebCore::GraphicsLayerCA::updateContentsPlatformLayer):
1202         (WebCore::GraphicsLayerCA::updateContentsColorLayer):
1203         (WebCore::GraphicsLayerCA::updateContentsRects):
1204         (WebCore::GraphicsLayerCA::updateMasksToBoundsRect):
1205         (WebCore::GraphicsLayerCA::updateMaskLayer):
1206         (WebCore::GraphicsLayerCA::updateAnimations):
1207         (WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
1208         (WebCore::GraphicsLayerCA::ensureLayerAnimations):
1209         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1210         * platform/graphics/ca/GraphicsLayerCA.h:
1211         (WebCore::GraphicsLayerCA::animationIsRunning const):
1212         (WebCore::GraphicsLayerCA::primaryLayerClones const): Deleted.
1213         * platform/graphics/ca/PlatformCALayerClient.h:
1214         (WebCore::PlatformCALayerClient::platformCALayerContentsOrientation const):
1215         * platform/graphics/ca/TileCoverageMap.h:
1216         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
1217         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1218         (PlatformCALayerCocoa::PlatformCALayerCocoa):
1219         (PlatformCALayerCocoa::requiresCustomAppearanceUpdateOnBoundsChange const):
1220         (PlatformCALayerCocoa::updateCustomAppearance):
1221         (PlatformCALayer::drawLayerContents):
1222         * rendering/RenderLayerBacking.cpp:
1223         (WebCore::RenderLayerBacking::updateCustomAppearance):
1224         (WebCore::RenderLayerBacking::updateConfiguration):
1225         * rendering/RenderLayerCompositor.cpp:
1226         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
1227         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1228
1229 2018-07-30  Justin Fan  <justin_fan@apple.com>
1230
1231         [WebGL2] Support compilation of GLSL ES version 300 shaders
1232         https://bugs.webkit.org/show_bug.cgi?id=187982
1233         <rdar://problem/42564229>
1234
1235         Reviewed by Dean Jackson.
1236
1237         Test: fast/canvas/webgl/webgl2-glsl3-compile.html
1238
1239         * html/canvas/WebGLRenderingContextBase.cpp:
1240         (WebCore::WebGLRenderingContextBase::create): Rename 'useGLES3' to 'isWebGL2' (everywhere) to make more sense.
1241         * platform/graphics/GraphicsContext3DAttributes.h: Rename 'useGLES3' to 'isWebGL2'.
1242         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1243         (WebCore::setPixelFormat): Back WebGL2 contexts with OpenGL 4 for full OpenGL ES 3 support. 
1244         (WebCore::GraphicsContext3D::GraphicsContext3D): Request correct GLSL output version and WebGL 2 for ANGLE shader compilation.
1245         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1246         (WebCore::GraphicsContext3D::checkVaryingsPacking const): MAX_VARYING_FLOATS is deprecated in OpenGL 3+.
1247         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: Rename 'useGLES3' to 'isWebGL2'.
1248         (WebCore::GraphicsContext3D::create):
1249         (WebCore::GraphicsContext3D::GraphicsContext3D):
1250
1251 2018-07-30  Justin Fan  <justin_fan@apple.com>
1252
1253         Match GraphicsContext3D with correct virtual screen using registryID
1254         https://bugs.webkit.org/show_bug.cgi?id=188072
1255         <rdar://problem/42634940>
1256
1257         Reviewed by Dean Jackson.
1258
1259         Follow up to https://bugs.webkit.org/show_bug.cgi?id=187750. Rather than matching rendererIDs, 
1260         which can vary between processes, match GPU to display using registryID that is unique to a GPU, 
1261         which was added to CGL in MacOS 10.13. 
1262
1263         No new tests. Manually tested on MacBookPro13,3 and iMacPro1,1 with Apple DisplayPort Cinema Display
1264         and RX 580 external GPU. 
1265
1266         * platform/PlatformScreen.h:
1267         * platform/ScreenProperties.h:
1268         (WebCore::ScreenData::encode const):
1269         (WebCore::ScreenData::decode):
1270         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1271         (WebCore::setGPUByRegistryID):
1272         (WebCore::setGPUByDisplayMask):
1273         (WebCore::GraphicsContext3D::GraphicsContext3D):
1274         (WebCore::GraphicsContext3D::screenDidChange):
1275         (WebCore::identifyAndSetCurrentGPU): Deleted.
1276         * platform/mac/PlatformScreenMac.mm:
1277         (WebCore::collectScreenProperties):
1278         (WebCore::primaryRegistryID):
1279         (WebCore::registryIDForDisplay):
1280         (WebCore::registryIDForDisplayMask):
1281         (WebCore::rendererIDForDisplayMask): Deleted.
1282         (WebCore::rendererIDForDisplay): Deleted.
1283         (WebCore::primaryRendererID): Deleted.
1284
1285 2018-07-30  Rob Buis  <rbuis@igalia.com>
1286
1287         Merge PlatformCookieJar functions into NetworkStorageSession
1288         https://bugs.webkit.org/show_bug.cgi?id=188137
1289
1290         Reviewed by Alex Christensen.
1291
1292         No new tests -- no change in WebKit functionality.
1293
1294         * PlatformMac.cmake: Remove CookieJarMac.mm reference
1295         * SourcesCocoa.txt: Remove CookieJarMac.mm reference
1296         * WebCore.xcodeproj/project.pbxproj:
1297         * loader/CookieJar.cpp: Remove PlatformCookieJar.h reference.
1298         * platform/Curl.cmake: Remove CookieJarCurl.cpp reference.
1299         * platform/SourcesSoup.txt: Remove CookieJarSoup.cpp reference.
1300         * platform/network/CacheValidation.cpp: Adapt callsites to use
1301         NetworkStorageSession instead of CookieJar functions.
1302
1303         (WebCore::headerValueForVary):
1304         * platform/network/NetworkStorageSession.h: Add PlatformCookieJar
1305         functions.
1306
1307         * platform/network/PlatformCookieJar.h: Removed.
1308         * platform/network/SocketStreamHandleImpl.cpp: Adapt callsites to
1309         use NetworkStorageSession instead of CookieJar functions.
1310         (WebCore::cookieDataForHandshake):
1311         * platform/network/cf/CookieJarCFNet.cpp: Removed.
1312         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Move functions
1313         from CookieJarCFNet.cpp.
1314         (WebCore::cookieDomain):
1315         (WebCore::canonicalCookieTime):
1316         (WebCore::cookieCreatedTime):
1317         (WebCore::cookieExpirationTime):
1318         (WebCore::cookieName):
1319         (WebCore::cookiePath):
1320         (WebCore::cookieValue):
1321         (WebCore::filterCookies):
1322         (WebCore::copyCookiesForURLWithFirstPartyURL):
1323         (WebCore::createCookies):
1324         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
1325         (WebCore::containsSecureCookies):
1326         (WebCore::NetworkStorageSession::cookiesForDOM const):
1327         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
1328         (WebCore::NetworkStorageSession::cookiesEnabled const):
1329         (WebCore::NetworkStorageSession::getRawCookies const):
1330         (WebCore::NetworkStorageSession::deleteCookie const):
1331         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
1332         (WebCore::NetworkStorageSession::deleteAllCookies):
1333         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
1334         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
1335         * platform/network/cocoa/NetworkStorageSessionCocoa.mm: Move functions
1336         from CookieJarMac.mm.
1337         (WebCore::httpCookies):
1338         (WebCore::deleteHTTPCookie):
1339         (WebCore::policyProperties):
1340         (WebCore::cookiesForURL):
1341         (WebCore::setHTTPCookiesForURL):
1342         (WebCore::httpCookiesForURL):
1343         (WebCore::filterCookies):
1344         (WebCore::applyPartitionToCookies):
1345         (WebCore::cookiesAreBlockedForURL):
1346         (WebCore::cookiesInPartitionForURL):
1347         (WebCore::cookiesForSession):
1348         (WebCore::deleteAllHTTPCookies):
1349         (WebCore::NetworkStorageSession::cookiesForDOM const):
1350         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
1351         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
1352         (WebCore::httpCookieAcceptPolicy):
1353         (WebCore::NetworkStorageSession::cookiesEnabled const):
1354         (WebCore::NetworkStorageSession::getRawCookies const):
1355         (WebCore::NetworkStorageSession::deleteCookie const):
1356         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
1357         (WebCore::NetworkStorageSession::deleteAllCookies):
1358         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
1359         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
1360         * platform/network/curl/CookieJarCurl.cpp: Removed.
1361         * platform/network/curl/CookieJarCurl.h:
1362         * platform/network/curl/NetworkStorageSessionCurl.cpp: Merge functions
1363         from CookieJarCurl.cpp.
1364         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
1365         (WebCore::NetworkStorageSession::cookiesEnabled const):
1366         (WebCore::NetworkStorageSession::cookiesForDOM const):
1367         (WebCore::NetworkStorageSession::deleteCookie const):
1368         (WebCore::NetworkStorageSession::deleteAllCookies):
1369         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
1370         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
1371         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
1372         (WebCore::NetworkStorageSession::getRawCookies const):
1373         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
1374         * platform/network/mac/CookieJarMac.mm: Removed.
1375         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1376         * platform/network/soup/CookieJarSoup.cpp: Removed.
1377         * platform/network/soup/NetworkStorageSessionSoup.cpp: Merge functions
1378         from CookieJarSoup.cpp.
1379         (WebCore::NetworkStorageSession::cookiesEnabled const):
1380         (WebCore::httpOnlyCookieExists):
1381         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
1382         (WebCore::NetworkStorageSession::deleteCookie const):
1383         (WebCore::NetworkStorageSession::deleteAllCookies):
1384         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
1385         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
1386         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
1387         (WebCore::NetworkStorageSession::getRawCookies const):
1388         (WebCore::cookiesForSession):
1389         (WebCore::NetworkStorageSession::cookiesForDOM const):
1390         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
1391
1392 2018-07-30  Chris Dumez  <cdumez@apple.com>
1393
1394         Nullptr crash accessing Document in GenericEventQueue::dispatchOneEvent()
1395         https://bugs.webkit.org/show_bug.cgi?id=187284
1396
1397         Unreviewed, roll r233496 and r233571 now that all known issues have been fixed via
1398         dependency bugs.
1399
1400         Test: media/track/video-track-addition-and-frame-removal.html
1401
1402         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1403         (WebCore::WebKitMediaKeySession::suspend):
1404         (WebCore::WebKitMediaKeySession::resume):
1405         (WebCore::WebKitMediaKeySession::stop):
1406         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
1407         * Modules/mediasource/MediaSource.cpp:
1408         (WebCore::MediaSource::removeSourceBuffer):
1409         (WebCore::MediaSource::suspend):
1410         (WebCore::MediaSource::resume):
1411         * Modules/mediasource/MediaSource.h:
1412         * Modules/mediasource/SourceBuffer.cpp:
1413         (WebCore::SourceBuffer::suspend):
1414         (WebCore::SourceBuffer::resume):
1415         (WebCore::SourceBuffer::stop):
1416         * Modules/mediasource/SourceBuffer.h:
1417         * Modules/mediasource/SourceBufferList.cpp:
1418         (WebCore::SourceBufferList::SourceBufferList):
1419         (WebCore::SourceBufferList::canSuspendForDocumentSuspension const):
1420         (WebCore::SourceBufferList::suspend):
1421         (WebCore::SourceBufferList::resume):
1422         (WebCore::SourceBufferList::stop):
1423         (WebCore::SourceBufferList::activeDOMObjectName const):
1424         * Modules/mediasource/SourceBufferList.h:
1425         * Modules/mediasource/SourceBufferList.idl:
1426         * dom/Document.h:
1427         (WebCore::Document::hasBrowsingContext const):
1428         * dom/GenericEventQueue.cpp:
1429         (WebCore::GenericEventQueue::dispatchOneEvent):
1430         * html/HTMLMediaElement.cpp:
1431         (WebCore::HTMLMediaElement::prepareForLoad):
1432         (WebCore::HTMLMediaElement::selectMediaResource):
1433         (WebCore::HTMLMediaElement::prepareToPlay):
1434         (WebCore::HTMLMediaElement::playInternal):
1435         (WebCore::HTMLMediaElement::pauseInternal):
1436         (WebCore::HTMLMediaElement::sourceWasAdded):
1437         * html/track/AudioTrackList.cpp:
1438         (AudioTrackList::activeDOMObjectName const):
1439         * html/track/AudioTrackList.h:
1440         * html/track/AudioTrackList.idl:
1441         * html/track/TextTrackList.cpp:
1442         (TextTrackList::activeDOMObjectName const):
1443         * html/track/TextTrackList.h:
1444         * html/track/TextTrackList.idl:
1445         * html/track/TrackListBase.cpp:
1446         (WebCore::TrackListBase::TrackListBase):
1447         (WebCore::TrackListBase::canSuspendForDocumentSuspension const):
1448         (WebCore::TrackListBase::suspend):
1449         (WebCore::TrackListBase::resume):
1450         (WebCore::TrackListBase::stop):
1451         * html/track/TrackListBase.h:
1452         * html/track/VideoTrackList.cpp:
1453         (VideoTrackList::activeDOMObjectName const):
1454         * html/track/VideoTrackList.h:
1455         * html/track/VideoTrackList.idl:
1456
1457 2018-07-30  Chris Dumez  <cdumez@apple.com>
1458
1459         Unreviewed internal build fix after r234347.
1460
1461         * html/StepRange.cpp:
1462         (WebCore::StepRange::StepRange):
1463
1464 2018-07-29  Simon Fraser  <simon.fraser@apple.com>
1465
1466         Shrink GraphicsLayer by making m_transform and m_childrenTransform be unique_ptrs
1467         https://bugs.webkit.org/show_bug.cgi?id=188143
1468
1469         Reviewed by Zalan Bujtas.
1470
1471         m_transform and m_childrenTransform are usually identity; save space by making
1472         these unique_ptrs. The getters still return references by returning a reference
1473         to a NeverDestroyed<TransformationMatrix> if necessary.
1474         
1475         Shrinks GraphicsLayerCA from 840 to 640 bytes.
1476
1477         * platform/graphics/GraphicsLayer.cpp:
1478         (WebCore::identityTransform):
1479         (WebCore::GraphicsLayer::transform const):
1480         (WebCore::GraphicsLayer::setTransform):
1481         (WebCore::GraphicsLayer::childrenTransform const):
1482         (WebCore::GraphicsLayer::setChildrenTransform):
1483         (WebCore::GraphicsLayer::dumpProperties const):
1484         * platform/graphics/GraphicsLayer.h:
1485         (WebCore::GraphicsLayer::hasNonIdentityTransform const):
1486         (WebCore::GraphicsLayer::hasNonIdentityChildrenTransform const):
1487         (WebCore::GraphicsLayer::transform const): Deleted.
1488         (WebCore::GraphicsLayer::setTransform): Deleted.
1489         (WebCore::GraphicsLayer::childrenTransform const): Deleted.
1490         (WebCore::GraphicsLayer::setChildrenTransform): Deleted.
1491         (WebCore::GraphicsLayer::hasFlattenedPerspectiveTransform): Deleted. It was unused.
1492         * platform/graphics/ca/GraphicsLayerCA.cpp:
1493         (WebCore::GraphicsLayerCA::setTransform):
1494         (WebCore::GraphicsLayerCA::setChildrenTransform):
1495         (WebCore::GraphicsLayerCA::layerTransform const):
1496         (WebCore::GraphicsLayerCA::updateTransform):
1497         (WebCore::GraphicsLayerCA::updateChildrenTransform):
1498         (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer):
1499
1500 2018-07-30  Thibault Saunier  <tsaunier@igalia.com>
1501
1502         [GStreamer] Make codecparsers optionnal
1503         https://bugs.webkit.org/show_bug.cgi?id=188010
1504
1505         And avoid building libWebRTC if it won't be used. While there is no other
1506         WebRTC backend, it makes no sense to expose an option.
1507
1508         Error out when WEBRTC or MEDIA_STREAM is enabled but GStreamer < 1.10
1509
1510         Reviewed by Alejandro G. Castro.
1511
1512         * platform/GStreamer.cmake:
1513
1514 2018-07-28  Darin Adler  <darin@apple.com>
1515
1516         [Cocoa] Update more WebCore Objective-C code to be ARC compatible
1517         https://bugs.webkit.org/show_bug.cgi?id=188140
1518
1519         Reviewed by Sam Weinig.
1520
1521         This make sure we don't put any Objective-C objects into HashMap/Set
1522         data structures, which doesn't work under ARC at this time. We could
1523         fix that some day, but it's pretty simple to change code not to rely
1524         on it, for now, and not as simple to support it in HashMap/Set.
1525
1526         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1527         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
1528         Use CFRetain/CFAutorelease instead of retain/autorelease.
1529
1530         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1531         (createAccessibilityRoleMap): Use CFStringRef in a HashMap rather than
1532         NSString * for string constants.
1533         (roleValueToNSString): Updated for above change.
1534
1535         * bridge/objc/WebScriptObject.mm:
1536         (-[WebScriptObject stringRepresentation]): Updated since objectValue
1537         is now CFTypeRef rather than NSObject *.
1538
1539         * bridge/objc/objc_instance.mm:
1540         (ObjcInstance::create): Use CFTypeRef instead of id for the key types
1541         in a HashMap.
1542         (ObjcInstance::~ObjcInstance): Updated for the above change.
1543         (ObjcInstance::invokeObjcMethod): Updated since objectValue is now
1544         CFTypeRef.
1545         (ObjcInstance::invokeDefaultMethod): Ditto.
1546         (ObjcInstance::setValueOfUndefinedField): Ditto.
1547         * bridge/objc/objc_runtime.mm:
1548         (JSC::Bindings::ObjcArray::setValueAt const): Ditto.
1549
1550         * bridge/objc/objc_utility.h: Use #pragma once. Use CFTypeRef instead
1551         of NSObject * for objectValue, since it's in a union and ARC does not
1552         support strong Objective-C object pointers in a union.
1553
1554         * bridge/objc/objc_utility.mm:
1555         (JSC::Bindings::convertValueToObjcValue): Updated since objectValue is
1556         now CFTypeRef.
1557
1558         * editing/cocoa/HTMLConverter.mm:
1559         (HTMLConverter::_processElement): Use CFTypeRef rather than NSTextTable
1560         for a HashMap.
1561         (HTMLConverter::_exitElement): Ditto.
1562
1563         * editing/cocoa/WebContentReaderCocoa.mm:
1564         (WebCore::attributesForAttributedStringConversion): Use CFRetain rather
1565         than -[NSObject retain] in a workaround for an overrelease.
1566
1567         * editing/mac/DictionaryLookup.h: Removed code to make this usable from
1568         non-Objective-C source files. Use tuples rather than out arguments
1569         for the results of the various functions.
1570
1571         * editing/mac/DictionaryLookup.mm:
1572         (WebCore::DictionaryLookup::rangeForSelection): Return a tuple rather
1573         than using an out argument for options.
1574         (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto.
1575         (WebCore::DictionaryLookup::stringForPDFSelection): Ditto.
1576         (WebCore::showPopupOrCreateAnimationController): Removed use of typedef
1577         PlatformAnimationController.
1578         (WebCore::DictionaryLookup::animationControllerForPopup): Ditto.
1579
1580         * html/HTMLMediaElement.h: Put the videoFullscreenLayer function inside
1581         an __OBJC__ ifdef since we can't do the type conversion without the
1582         full Objective-C type.
1583
1584         * page/mac/EventHandlerMac.mm:
1585         (WebCore::selfRetainingNSScrollViewScrollWheel): Use CFRetain/CFRelease
1586         instead of retain/release.
1587         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
1588         Updated to use tuple return value from DictionaryLookup.
1589
1590         * page/scrolling/ScrollingStateNode.h: Replaced direct use of PlatformLayer*
1591         in a union with use of a "typless" void* pointer and added helper functions
1592         to convert in both directions.
1593         * page/scrolling/cocoa/ScrollingStateNode.mm:
1594         (WebCore::LayerRepresentation::retainPlatformLayer): Use CFRetain instead
1595         of retain.
1596         (WebCore::LayerRepresentation::releasePlatformLayer): Use CFRelease instead
1597         of release.
1598         (WebCore::LayerRepresentation::makePlatformLayerTyped): Added.
1599         (WebCore::LayerRepresentation::makePlatformLayerTypeless): Ditto.
1600         * page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp:
1601         (WebCore::LayerRepresentation::retainPlatformLayer): Updated argument type.
1602         (WebCore::LayerRepresentation::releasePlatformLayer): Ditto.
1603         (WebCore::LayerRepresentation::makePlatformLayerTyped): Added.
1604         (WebCore::LayerRepresentation::makePlatformLayerTypeless): Ditto.
1605
1606         * platform/gamepad/cocoa/GameControllerGamepadProvider.h: Use CFTypeRef
1607         instad of GCController * for key type of HashMap.
1608         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
1609         (WebCore::GameControllerGamepadProvider::controllerDidConnect): Updated
1610         for the above change.
1611         (WebCore::GameControllerGamepadProvider::controllerDidDisconnect): Ditto.
1612
1613         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1614         Use SOFT_LINK_CONSTANT_MAY_FAIL instead of SOFT_LINK_POINTER_OPTIONAL for
1615         strings, since SOFT_LINK_POINTER_OPTIONAL does not work for Objective-C
1616         types under ARC.
1617         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const): Added checks
1618         for the constants.
1619         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const): Ditto.
1620         (WebCore::AVTrackPrivateAVFObjCImpl::label const): Ditto.
1621
1622         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
1623         Use #pragma once and use CFTypeRef instead of AVMediaSelectionOption *
1624         in the key to a HashMap.
1625         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
1626         (WebCore::MediaSelectionGroupAVFObjC::updateOptions): Updated for
1627         the above change.
1628
1629         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1630         Use SOFT_LINK_CONSTANT_MAY_FAIL instead of SOFT_LINK_POINTER_OPTIONAL for
1631         strings, since SOFT_LINK_POINTER_OPTIONAL does not work for Objective-C
1632         types under ARC.
1633         (WebCore::customSchemeURL): Removed unnecessary use of
1634         NeverDestroyed<RetainPtr>. Can just use a straight pointer without calling
1635         release, and that works with or without ARC.
1636         (WebCore::imageDecoderAssetOptions): Ditto. Here, had to add a retain,
1637         which we'll remove when we turn on ARC. Added canLoad checks, needed
1638         because of SOFT_LINK_CONSTANT_MAY_FAIL.
1639         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack): Added canLoad check,
1640         needed because of SOFT_LINK_CONSTANT_MAY_FAIL.
1641
1642         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1643         Use CFTypeRef instead of AVAssetResourceLoadingRequest in HashMap.
1644         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1645         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1646         Updated for above.
1647         (WebCore::MediaPlayerPrivateAVFoundationObjC::didCancelLoadingRequest): Ditto.
1648         (WebCore::MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest): Ditto.
1649
1650         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1651         Use CFTypeRef instead of AVSampleBufferAudioRenderer in HashMap.
1652         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1653         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume): Updated for above.
1654         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted): Ditto.
1655         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch): Ditto.
1656         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample): Ditto.
1657         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): Ditto.
1658         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer): Ditto.
1659
1660         * platform/graphics/metal/GPUDrawableMetal.mm: Updated include; under ARC, it's
1661         not safe to call a method on a class without seeing its interface.
1662
1663         * platform/mac/VideoFullscreenInterfaceMac.mm: Added an explicit
1664         __unsafe_unretained for a delegate. Could consider moving to weak, but for now
1665         this preserves the current behavior and compiles under ARC.
1666
1667         * platform/mac/WebCoreFullScreenPlaceholderView.h: Use strong for the contents,
1668         weak for the target, and changed the action to be hard-coded instead of an
1669         arbitrary selector. If we find we need the flexibility again later, we can do
1670         it with a block, which is more ARC-friendly than calling an arbitrary selector.
1671         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
1672         (-[WebCoreFullScreenPlaceholderView initWithFrame:]): Call function directly
1673         instead of taking advantage of "using".
1674         (-[WebCoreFullScreenPlaceholderView mouseDown:]): Call cancelOperation: on the
1675         target rather than performing an arbitrary selector.
1676
1677         * platform/mac/WebCoreObjCExtras.mm:
1678         (WebCoreObjCScheduleDeallocateOnMainThread): Use sel_registerName instead of
1679         @selector, since @selector is not supported under ARC.
1680
1681         * platform/network/ResourceHandle.h: Use a return value rather than using an
1682         inout argument in applySniffingPoliciesAndStoragePartitionIfNeeded.
1683
1684         * platform/network/cocoa/CookieStorageObserver.mm:
1685         (WebCore::CookieStorageObserver::startObserving): Removed unnecessary
1686         assertion of repondsToSelector since we are about to dispatch it immediately
1687         after. Call the selector in the conventional way instead of using performSelector.
1688
1689         * platform/network/cocoa/WebCoreNSURLSession.h: Use #pragma once and use
1690         CFTypeRef instead of an Objective-C type. Also use an explicit __unsafe_unretained
1691         for the session in the data task.
1692         * platform/network/cocoa/WebCoreNSURLSession.mm:
1693         (-[WebCoreNSURLSession dealloc]): Updated for the above.
1694         (-[WebCoreNSURLSession taskCompleted:]): Ditto.
1695         (-[WebCoreNSURLSession invalidateAndCancel]): Ditto.
1696         (-[WebCoreNSURLSession getTasksWithCompletionHandler:]): Ditto.
1697         (-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]): Ditto.
1698         (-[WebCoreNSURLSession dataTaskWithRequest:]): Ditto.
1699         (-[WebCoreNSURLSession dataTaskWithURL:]): Ditto.
1700
1701         * platform/network/mac/ResourceHandleMac.mm:
1702         (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded):
1703         Use a return value instead of an inout argument. Also use bridging casts.
1704         (WebCore::ResourceHandle::createNSURLConnection): Updated for the change above.
1705         Also use a bridging cast.
1706         (WebCore::ResourceHandle::schedule): Use a bridging cast.
1707         (WebCore::ResourceHandle::unschedule): Ditto.
1708
1709         * platform/network/mac/WebCoreURLResponse.mm:
1710         (WebCore::adjustMIMETypeIfNecessary): Use a bridging cast.
1711
1712         * testing/Internals.cpp:
1713         (WebCore::Internals::rangeForDictionaryLookupAtLocation): Moved the macOS
1714         version of this function out of this file ...
1715         * testing/Internals.mm:
1716         (WebCore::Internals::rangeForDictionaryLookupAtLocation): ... to here.
1717
1718 2018-07-29  Yusuke Suzuki  <utatane.tea@gmail.com>
1719
1720         Use static global variables instead of static NeverDestroyed inside function if possible
1721         https://bugs.webkit.org/show_bug.cgi?id=188146
1722
1723         Reviewed by Darin Adler.
1724
1725         This patch leverages constexpr constructors / trivial destructors more to remove unnecessary `static NeverDestroyed`
1726         inside a function. It simplifies the code, removes the unnecessary function, and ensures the initialization at
1727         a program loader phase.
1728
1729         We make StepRange::StepDescription constructor constexpr to remove bunch of `static NeverDestroyed<const StepRange::StepDescription>`.
1730         And we use `static Lock` since WTF::Lock has constexpr constructor.
1731
1732         No behavior change.
1733
1734         * dom/MessagePort.cpp:
1735         (WebCore::MessagePort::deref const):
1736         (WebCore::MessagePort::isExistingMessagePortLocallyReachable):
1737         (WebCore::MessagePort::notifyMessageAvailable):
1738         (WebCore::MessagePort::MessagePort):
1739         (WebCore::MessagePort::~MessagePort):
1740         (WebCore::allMessagePortsLock): Deleted.
1741         * dom/ScriptExecutionContext.cpp:
1742         (WebCore::ScriptExecutionContext::contextIdentifier const):
1743         (WebCore::ScriptExecutionContext::removeFromContextsMap):
1744         (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
1745         (WebCore::ScriptExecutionContext::postTaskTo):
1746         (WebCore::allScriptExecutionContextsMapLock): Deleted.
1747         * html/DateInputType.cpp:
1748         (WebCore::DateInputType::createStepRange const):
1749         * html/DateTimeInputType.cpp:
1750         (WebCore::DateTimeInputType::createStepRange const):
1751         * html/DateTimeLocalInputType.cpp:
1752         (WebCore::DateTimeLocalInputType::createStepRange const):
1753         * html/MonthInputType.cpp:
1754         (WebCore::MonthInputType::createStepRange const):
1755         * html/RangeInputType.cpp:
1756         (WebCore::RangeInputType::createStepRange const):
1757         * html/StepRange.h:
1758         (WebCore::StepRange::StepDescription::StepDescription):
1759         * html/TimeInputType.cpp:
1760         (WebCore::TimeInputType::createStepRange const):
1761         * html/WeekInputType.cpp:
1762         (WebCore::WeekInputType::createStepRange const):
1763         * page/SecurityPolicy.cpp:
1764         (WebCore::originAccessMap):
1765         (WebCore::SecurityPolicy::isAccessWhiteListed):
1766         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
1767         (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
1768         (WebCore::SecurityPolicy::resetOriginAccessWhitelists):
1769         (WebCore::originAccessMapLock): Deleted.
1770         * platform/SchemeRegistry.cpp:
1771         (WebCore::allBuiltinSchemes):
1772         (WebCore::builtinLocalURLSchemes):
1773         (WebCore::localURLSchemes):
1774         (WebCore::displayIsolatedURLSchemes):
1775         (WebCore::builtinSecureSchemes):
1776         (WebCore::secureSchemes):
1777         (WebCore::builtinSchemesWithUniqueOrigins):
1778         (WebCore::schemesWithUniqueOrigins):
1779         (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
1780         (WebCore::canDisplayOnlyIfCanRequestSchemes):
1781         (WebCore::SchemeRegistry::registerURLSchemeAsLocal):
1782         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
1783         (WebCore::ContentSecurityPolicyBypassingSchemes):
1784         (WebCore::cachePartitioningSchemes):
1785         (WebCore::serviceWorkerSchemes):
1786         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
1787         (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess):
1788         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess):
1789         (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated):
1790         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
1791         (WebCore::SchemeRegistry::registerURLSchemeAsSecure):
1792         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
1793         (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest):
1794         (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
1795         (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
1796         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
1797         (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy):
1798         (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned):
1799         (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
1800         (WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
1801         (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme):
1802         (WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme):
1803         (WebCore::schemeRegistryLock): Deleted.
1804
1805 2018-07-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1806
1807         [Curl] Fix the bug when client reject the redirect on WebKitLegacy.
1808         https://bugs.webkit.org/show_bug.cgi?id=188130
1809
1810         Reviewed by Darin Adler.
1811
1812         ResourceHandle for Curl port has a bug when a client returns en empty request which
1813         indicates the redirecti is rejected by the client. It should be quit the task immediately,
1814         but it kept doing the job. Fixed.
1815         NetworkDataTask implementation did the right thing and there's no bug for them. 
1816
1817         Test: http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt
1818
1819         * platform/network/curl/ResourceHandleCurl.cpp:
1820         (WebCore::ResourceHandle::continueAfterWillSendRequest):
1821
1822 2018-07-28  Simon Fraser  <simon.fraser@apple.com>
1823
1824         Reset CompositingPolicyOverride between tests
1825         https://bugs.webkit.org/show_bug.cgi?id=188138
1826
1827         Reviewed by Zalan Bujtas.
1828
1829         WK1 tests were failing after r234330 because the compositing policy override optional
1830         was left set on the Page (WK1 has injected bundle SPI to clear it). Fix by having 
1831         Internals::resetToConsistentState clear this state.
1832
1833         * testing/Internals.cpp:
1834         (WebCore::Internals::resetToConsistentState):
1835
1836 2018-07-24  Simon Fraser  <simon.fraser@apple.com>
1837
1838         Animation stops with object-fit:contain on an animated 2d canvas
1839         https://bugs.webkit.org/show_bug.cgi?id=187840
1840
1841         Reviewed by Zalan Bujtas.
1842         
1843         If a canvas has object-fit: cover or contain, repaints need to mapped through
1844         the rect that is used to position the canvas in the element bounds, which is replacedContentRect().
1845         
1846         Add a version of replacedContentRect() that doesn't require passing the intrinsicSize() since
1847         all but RenderVideo just pass the RenderReplaced's intrinsicSize.
1848
1849         Test: fast/repaint/canvas-object-fit.html
1850
1851         * html/HTMLCanvasElement.cpp:
1852         (WebCore::HTMLCanvasElement::didDraw):
1853         * rendering/RenderHTMLCanvas.cpp:
1854         (WebCore::RenderHTMLCanvas::paintReplaced):
1855         * rendering/RenderImage.cpp:
1856         (WebCore::RenderImage::updateInnerContentRect):
1857         (WebCore::RenderImage::paintReplaced):
1858         * rendering/RenderLayerBacking.cpp:
1859         (WebCore::RenderLayerBacking::contentsBox const):
1860         * rendering/RenderReplaced.h:
1861         (WebCore::RenderReplaced::replacedContentRect const):
1862         * rendering/shapes/ShapeOutsideInfo.cpp:
1863         (WebCore::ShapeOutsideInfo::createShapeForImage const):
1864
1865 2018-07-27  Simon Fraser  <simon.fraser@apple.com>
1866
1867         Adjust the color matrix for the inverse apple-invert-lightness() transformation
1868         https://bugs.webkit.org/show_bug.cgi?id=188131
1869         rdar://problem/42673070
1870
1871         Reviewed by Zalan Bujtas.
1872
1873         Use the correct inverse matrix values.
1874
1875         Test: editing/style/inverse-color-filter.html
1876
1877         * platform/graphics/filters/FilterOperation.cpp:
1878         (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
1879
1880 2018-07-27  Eric Carlson  <eric.carlson@apple.com>
1881
1882         [iOS] Don't deactivate audio session
1883         https://bugs.webkit.org/show_bug.cgi?id=188127
1884         <rdar://problem/42544143>
1885
1886         Reviewed by Jon Lee.
1887         
1888         r233435 includes a change that deactivates the shared audio session when there are no more
1889         active media sessions. This is a good in WK2 because it allows other applications to resume
1890         playing audio when WebKit stops playing, but it is potentially bad in WK1 where the host
1891         app may also be playing audio.
1892
1893         * platform/audio/PlatformMediaSessionManager.cpp:
1894         (WebCore::PlatformMediaSessionManager::removeSession): Don't deactivate the audio session.
1895
1896 2018-07-27  Chris Dumez  <cdumez@apple.com>
1897
1898         Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable()
1899         https://bugs.webkit.org/show_bug.cgi?id=188097
1900         <rdar://problem/42558823>
1901
1902         Reviewed by Eric Carlson.
1903
1904         Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable(). RealtimeMediaSource::audioSamplesAvailable()
1905         is called on a background thread but iterates over observers that may get destroyed concurrently on the main thread.
1906
1907         To address the issue:
1908         - Introduce a Lock to protect m_observer accesses
1909         - Copy observers to a Vector before iterating over them
1910
1911         * platform/mediastream/MediaStreamTrackPrivate.cpp:
1912         (WebCore::MediaStreamTrackPrivate::forEachObserver const):
1913         (WebCore::MediaStreamTrackPrivate::addObserver):
1914         (WebCore::MediaStreamTrackPrivate::removeObserver):
1915         (WebCore::MediaStreamTrackPrivate::setEnabled):
1916         (WebCore::MediaStreamTrackPrivate::endTrack):
1917         (WebCore::MediaStreamTrackPrivate::sourceStarted):
1918         (WebCore::MediaStreamTrackPrivate::sourceStopped):
1919         (WebCore::MediaStreamTrackPrivate::sourceMutedChanged):
1920         (WebCore::MediaStreamTrackPrivate::sourceSettingsChanged):
1921         (WebCore::MediaStreamTrackPrivate::videoSampleAvailable):
1922         (WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
1923         (WebCore::MediaStreamTrackPrivate::updateReadyState):
1924         * platform/mediastream/MediaStreamTrackPrivate.h:
1925         (WebCore::MediaStreamTrackPrivate::Observer::sampleBufferUpdated):
1926         (WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable):
1927         * platform/mediastream/RealtimeMediaSource.cpp:
1928         (WebCore::RealtimeMediaSource::addObserver):
1929         (WebCore::RealtimeMediaSource::removeObserver):
1930         (WebCore::RealtimeMediaSource::forEachObserver const):
1931         (WebCore::RealtimeMediaSource::notifyMutedObservers const):
1932         (WebCore::RealtimeMediaSource::settingsDidChange):
1933         (WebCore::RealtimeMediaSource::videoSampleAvailable):
1934         (WebCore::RealtimeMediaSource::audioSamplesAvailable):
1935         (WebCore::RealtimeMediaSource::start):
1936         (WebCore::RealtimeMediaSource::requestStop):
1937         (WebCore::RealtimeMediaSource::captureFailed):
1938         * platform/mediastream/RealtimeMediaSource.h:
1939         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1940         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
1941         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
1942         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1943
1944 2018-07-27  Alex Christensen  <achristensen@webkit.org>
1945
1946         Don't include WebPageProxy.h just for UndoOrRedo
1947         https://bugs.webkit.org/show_bug.cgi?id=188086
1948
1949         Reviewed by Saam Barati.
1950
1951         * platform/DragItem.h:
1952
1953 2018-07-27  Alex Christensen  <achristensen@webkit.org>
1954
1955         Make CompletionHandler more const correct
1956         https://bugs.webkit.org/show_bug.cgi?id=186543
1957
1958         Reviewed by Saam Barati.
1959
1960         * dom/messageports/MessagePortChannel.cpp:
1961         (WebCore::MessagePortChannel::checkRemotePortForActivity):
1962         * dom/messageports/MessagePortChannelProviderImpl.cpp:
1963         (WebCore::MessagePortChannelProviderImpl::checkRemotePortForActivity):
1964         * loader/DocumentLoader.cpp:
1965         (WebCore::DocumentLoader::responseReceived):
1966         * loader/FrameLoader.cpp:
1967         (WebCore::FrameLoader::loadURL):
1968         (WebCore::FrameLoader::loadWithDocumentLoader):
1969         (WebCore::FrameLoader::loadPostRequest):
1970         * platform/network/cocoa/WebCoreNSURLSession.mm:
1971         (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
1972         * workers/service/server/RegistrationDatabase.cpp:
1973         (WebCore::RegistrationDatabase::pushChanges):
1974         (WebCore::RegistrationDatabase::clearAll):
1975         * workers/service/server/SWServer.cpp:
1976         (WebCore::SWServer::matchAll):
1977         * workers/service/server/SWServer.h:
1978         * workers/service/server/SWServerWorker.cpp:
1979         (WebCore::SWServerWorker::matchAll):
1980         * workers/service/server/SWServerWorker.h:
1981
1982 2018-07-27  Simon Fraser  <simon.fraser@apple.com>
1983
1984         Be more conservative with compositing layer creation when memory is low
1985         https://bugs.webkit.org/show_bug.cgi?id=187866
1986         rdar://problem/42366345
1987
1988         Reviewed by Zalan Bujtas.
1989         
1990         When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
1991         compositing layers. We avoid compositing for these situations:
1992         1. Layers with 3D transforms which are affine (like translateZ(0)).
1993         2. Layers with will-change
1994         3. Layers for canvases (other than WebGL/WebGPU)
1995         
1996         We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
1997         falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
1998         Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
1999         
2000         Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
2001         flakily falling into a different mode, and so that we can impose the conservative
2002         mode for testing.
2003
2004         Test: compositing/layer-creation/compositing-policy.html
2005
2006         * page/Page.h:
2007         (WebCore::Page::compositingPolicyOverride const):
2008         (WebCore::Page::setCompositingPolicyOverride):
2009         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
2010         (WebCore::Matrix3DTransformOperation::isRepresentableIn2D const):
2011         * platform/graphics/transforms/Matrix3DTransformOperation.h:
2012         * platform/graphics/transforms/PerspectiveTransformOperation.h:
2013         * platform/graphics/transforms/RotateTransformOperation.h:
2014         * platform/graphics/transforms/ScaleTransformOperation.h:
2015         * platform/graphics/transforms/TransformOperation.h:
2016         (WebCore::TransformOperation::isRepresentableIn2D const):
2017         * platform/graphics/transforms/TransformOperations.h:
2018         (WebCore::TransformOperations::has3DOperation const):
2019         (WebCore::TransformOperations::isRepresentableIn2D const):
2020         * platform/graphics/transforms/TranslateTransformOperation.h:
2021         * rendering/RenderLayerBacking.cpp:
2022         (WebCore::RenderLayerBacking::updateGeometry):
2023         * rendering/RenderLayerCompositor.cpp:
2024         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
2025         (WebCore::RenderLayerCompositor::updateCompositingPolicy):
2026         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2027         (WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
2028         (WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
2029         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
2030         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
2031         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
2032         (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
2033         (WebCore::operator<<):
2034         * rendering/RenderLayerCompositor.h:
2035         * testing/Internals.cpp:
2036         (WebCore::Internals::setCompositingPolicyOverride):
2037         (WebCore::Internals::compositingPolicyOverride const):
2038         * testing/Internals.h:
2039         * testing/Internals.idl:
2040
2041 2018-07-27  Zalan Bujtas  <zalan@apple.com>
2042
2043         [WK1] ASSERTION FAILED: renderer().repaintLayoutRects().m_repaintRect == renderer().clippedOverflowRectForRepaint(renderer().containerForRepaint()) in WebCore::RenderLayer::updateLayerPositionsAfterScroll
2044         https://bugs.webkit.org/show_bug.cgi?id=188122
2045         <rdar://problem/42584790>
2046
2047         Reviewed by Simon Fraser.
2048
2049         When ScrollView's m_paintsEntireContents flag flips due to layer backing changes, the repaint area transitions from
2050         visual to layout overflow. When this happens the cached repaint rects become invalid and they need to be recomputed.
2051         Currently there's no mechanism to trigger repaint cache invalidation from ScrollView.
2052         Skip assertion for now on WK1 (see webkit.org/b/188121)
2053
2054         * rendering/RenderLayer.cpp:
2055         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
2056
2057 2018-07-27  Myles C. Maxfield  <mmaxfield@apple.com>
2058
2059         [WIN] Crash when trying to access store pages
2060         https://bugs.webkit.org/show_bug.cgi?id=188032
2061         <rdar://problem/42467016>
2062
2063         Reviewed by Brent Fulgham.
2064
2065         The Windows implementation of GlyphBuffer has an additional member, m_offsets, which represents
2066         an additional offset to the position to paint each glyph. It also has two add() functions, one
2067         which appends to this vector, and one which doesn't. The one that doesn't append to the vector
2068         should never be called on Windows (because Windows requires this vector to be full).
2069
2070         There were two situations where it was getting called:
2071         1) Inside ComplexTextController
2072         2) Inside display list playback
2073
2074         Windows shouldn't be using ComplexTextController because the Windows implementation of this 
2075         class isn't ready yet; instead it should be using UniscribeController. The display list playback
2076         code should be used on Windows.
2077
2078         Rather than fix the function to append an offset, we actually don't need the m_offsets vector
2079         in the first place. Instead, we can do it the same way that the Cocoa ports do it, which is to
2080         bake the offsets into the glyph advances. This is possible because the GlyphBuffer doesn't need
2081         to distinguish between layout advances and paint advances, so we can bake them together and
2082         just put paint advances in the GlyphBuffer. This should be a small (probably within-the-noise)
2083         performance and memory improvement.
2084
2085         * platform/graphics/ComplexTextController.cpp:
2086         (WebCore::ComplexTextController::ComplexTextController): Make sure that ComplexTextController
2087         isn't used on Windows.
2088         * platform/graphics/FontCascade.cpp:
2089         (WebCore::FontCascade::widthOfTextRange const): Switch from ComplexTextController to
2090         UniscribeController on Windows.
2091         (WebCore::FontCascade::drawGlyphBuffer const): After deleting the m_offsets vector, there's
2092         no reason to consult it when drawing.
2093         * platform/graphics/GlyphBuffer.h: Remove m_offsets
2094         (WebCore::GlyphBuffer::clear):
2095         (WebCore::GlyphBuffer::advanceAt const):
2096         (WebCore::GlyphBuffer::add):
2097         (WebCore::GlyphBuffer::expandLastAdvance):
2098         (WebCore::GlyphBuffer::shrink):
2099         (WebCore::GlyphBuffer::swap):
2100         (WebCore::GlyphBuffer::offsetAt const): Deleted.
2101         * platform/graphics/win/FontCGWin.cpp:
2102         (WebCore::FontCascade::drawGlyphs): After deleting the m_offsets vector, there's no reason
2103         to consult it when drawing.
2104         * platform/graphics/win/FontCascadeDirect2D.cpp:
2105         (WebCore::FontCascade::drawGlyphs): Ditto.
2106         * platform/graphics/win/UniscribeController.cpp:
2107         (WebCore::UniscribeController::shapeAndPlaceItem): Bake in the offsets into the glyph advances.
2108
2109 2018-07-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2110
2111         [Curl] Crash on synchronous request via ResourceHandle.
2112         https://bugs.webkit.org/show_bug.cgi?id=188033
2113
2114         Reviewed by Alex Christensen.
2115
2116         The timing of instantiation of delegate was wrong. Move it inside `delegate` getter().
2117         This bug was introduced at r228577.
2118
2119         Test: http/tests/xmlhttprequest/simple-sync.html
2120
2121         * platform/network/curl/ResourceHandleCurl.cpp:
2122         (WebCore::ResourceHandle::start):
2123         (WebCore::ResourceHandle::delegate):
2124
2125 2018-07-03  David Fenton  <david_fenton@apple.com>
2126
2127         Unreviewed, rolling out r233461.
2128
2129         assertions triggered on ios11 Debug wk2
2130
2131         Reverted changeset:
2132
2133         "[iOS] Add assert to catch improper use of WebCore::Timer in
2134         UI Process"
2135         https://bugs.webkit.org/show_bug.cgi?id=185330
2136         https://trac.webkit.org/changeset/233461
2137
2138 2018-07-27  Chris Dumez  <cdumez@apple.com>
2139
2140         [Media] Avoid unnecessarily constructing *TrackList objects
2141         https://bugs.webkit.org/show_bug.cgi?id=188094
2142
2143         Reviewed by Eric Carlson.
2144
2145         Avoid unnecessarily constructing *TrackList objects as this is preventing us from making them
2146         ActiveDOMObjects.
2147
2148         * Modules/mediasource/MediaSource.cpp:
2149         (WebCore::MediaSource::removeSourceBuffer):
2150         * Modules/mediasource/SourceBuffer.cpp:
2151         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
2152         * html/HTMLMediaElement.cpp:
2153         (WebCore::HTMLMediaElement::addAudioTrack):
2154         (WebCore::HTMLMediaElement::addTextTrack):
2155         (WebCore::HTMLMediaElement::addVideoTrack):
2156         (WebCore::HTMLMediaElement::ensureAudioTracks):
2157         (WebCore::HTMLMediaElement::ensureTextTracks):
2158         (WebCore::HTMLMediaElement::ensureVideoTracks):
2159         (WebCore::HTMLMediaElement::setSelectedTextTrack):
2160         (WebCore::HTMLMediaElement::audioTracks): Deleted.
2161         (WebCore::HTMLMediaElement::textTracks): Deleted.
2162         (WebCore::HTMLMediaElement::videoTracks): Deleted.
2163         * html/HTMLMediaElement.h:
2164         (WebCore::HTMLMediaElement::audioTracks const):
2165         (WebCore::HTMLMediaElement::textTracks const):
2166         (WebCore::HTMLMediaElement::videoTracks const):
2167         * html/HTMLMediaElement.idl:
2168         * html/shadow/MediaControlElements.cpp:
2169         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
2170         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
2171         (WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
2172         * html/track/TextTrack.cpp:
2173         (WebCore::TextTrack::setKind):
2174         (WebCore::TextTrack::trackIndex):
2175         (WebCore::TextTrack::trackIndexRelativeToRenderedTracks):
2176         (WebCore::TextTrack::setLanguage):
2177         * html/track/VideoTrack.cpp:
2178         (WebCore::VideoTrack::setKind):
2179         (WebCore::VideoTrack::setLanguage):
2180         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
2181         (WebCore::PlaybackSessionModelMediaElement::setMediaElement):
2182         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
2183
2184 2018-07-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2185
2186         [Curl] Set correct source info to ResourceResponse.
2187         https://bugs.webkit.org/show_bug.cgi?id=188069
2188
2189         Reviewed by Fujii Hironori.
2190
2191         ResourceResponseBase::Source::Network must be set by each ports. Curl port
2192         didn't set this.
2193
2194         Test: http/tests/cache/disk-cache/disk-cache-302-status-code.html
2195
2196         * platform/network/curl/ResourceResponseCurl.cpp:
2197         (WebCore::ResourceResponse::ResourceResponse):
2198
2199 2018-07-26  Andy VanWagoner  <andy@vanwagoner.family>
2200
2201         [INTL] Remove INTL sub-feature compile flags
2202         https://bugs.webkit.org/show_bug.cgi?id=188081
2203
2204         Reviewed by Michael Catanzaro.
2205
2206         Compile time feature flags for INTL sub features were removed, and are covered by existing tests.
2207
2208         * Configurations/FeatureDefines.xcconfig:
2209
2210 2018-07-26  Zalan Bujtas  <zalan@apple.com>
2211
2212         [Fullscreen] Do not create composited layers for renderers unless they are part of the fullscreen subtree.
2213         https://bugs.webkit.org/show_bug.cgi?id=188087
2214         <rdar://problem/42632124>
2215
2216         Reviewed by Simon Fraser.
2217
2218         Sibling composited layers prevent battery lifetime optimizations when in fullscreen.
2219
2220         Test: compositing/no-compositing-when-fulll-screen-is-present.html
2221
2222         * rendering/RenderLayer.cpp:
2223         (WebCore::RenderLayer::isDescendantOf const):
2224         * rendering/RenderLayer.h:
2225         * rendering/RenderLayerCompositor.cpp:
2226         (WebCore::isDescendantOfFullScreenLayer):
2227         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
2228         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
2229
2230 2018-07-26  Ryan Haddad  <ryanhaddad@apple.com>
2231
2232         Unreviewed, rolling out r234281.
2233
2234         Broke internal builds.
2235
2236         Reverted changeset:
2237
2238         "[Datalist] Add button to TextFieldInputs with a datalist"
2239         https://bugs.webkit.org/show_bug.cgi?id=187741
2240         https://trac.webkit.org/changeset/234281
2241
2242 2018-07-26  Aditya Keerthi  <akeerthi@apple.com>
2243
2244         [Datalist] Add button to TextFieldInputs with a datalist
2245         https://bugs.webkit.org/show_bug.cgi?id=187741
2246
2247         Reviewed by Tim Horton.
2248
2249         TextFieldInputs that have an associated datalist element should be drawn as
2250         combo boxes. However, we cannot use NSComboBox for this control, as NSComboBox
2251         is not height-resizable. Furthermore, the input should also be able to contain
2252         additional elements, such as the stepper for type=number and the cancel button
2253         for type=search. For these reasons, we draw a button at the end of the input,
2254         mimicking appearance of a combo box.
2255
2256         The list-button -webkit-appearance value was added to display the new button.
2257
2258         Tests: fast/forms/datalist/datalist-searchinput-appearance.html
2259                fast/forms/datalist/datalist-textinput-appearance.html
2260
2261         * Resources/ListButtonArrow.png: Added.
2262         * Resources/ListButtonArrow@2x.png: Added.
2263         * WebCore.xcodeproj/project.pbxproj:
2264         * css/CSSPrimitiveValueMappings.h:
2265         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2266         * css/CSSProperties.json:
2267         * css/CSSValueKeywords.in:
2268         * css/html.css:
2269         (input::-webkit-list-button):
2270         * html/HTMLInputElement.cpp:
2271         (WebCore::HTMLInputElement::dataListButtonElement const):
2272         (WebCore::HTMLInputElement::isShowingList const):
2273         * html/HTMLInputElement.h:
2274         * html/InputType.h:
2275         (WebCore::InputType::dataListButtonElement const):
2276         (WebCore::InputType::isShowingList const):
2277         * html/TextFieldInputType.cpp:
2278         (WebCore::TextFieldInputType::needsContainer const):
2279         (WebCore::TextFieldInputType::createShadowSubtree):
2280         (WebCore::TextFieldInputType::destroyShadowSubtree):
2281         (WebCore::TextFieldInputType::listAttributeTargetChanged):
2282         (WebCore::TextFieldInputType::dataListButtonElement const):
2283         (WebCore::TextFieldInputType::dataListButtonElementWasClicked):
2284         (WebCore::TextFieldInputType::didCloseSuggestions):
2285         (WebCore::TextFieldInputType::isShowingList const):
2286         * html/TextFieldInputType.h:
2287         * html/shadow/DataListButtonElement.cpp: Added.
2288         (WebCore::DataListButtonElement::create):
2289         (WebCore::DataListButtonElement::DataListButtonElement):
2290         (WebCore::DataListButtonElement::~DataListButtonElement):
2291         (WebCore::DataListButtonElement::defaultEventHandler):
2292         * html/shadow/DataListButtonElement.h: Added.
2293         * platform/ThemeTypes.h:
2294         * rendering/RenderTheme.cpp:
2295         (WebCore::RenderTheme::adjustStyle):
2296         (WebCore::RenderTheme::adjustListButtonStyle const):
2297         * rendering/RenderTheme.h:
2298         * rendering/RenderThemeMac.h:
2299         * rendering/RenderThemeMac.mm:
2300         (-[WebListButtonCell drawWithFrame:inView:]):
2301         (WebCore::RenderThemeMac::paintListButtonForInput):
2302         (WebCore::RenderThemeMac::adjustListButtonStyle const):
2303         (WebCore::RenderThemeMac::paintTextField):
2304         (WebCore::RenderThemeMac::paintSearchField):
2305         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2306         (WebCore::RenderThemeMac::listButton const):
2307
2308 2018-07-26  Antoine Quint  <graouts@apple.com>
2309
2310         [Web Animations] Accelerated animations don't respect a positive delay value
2311         https://bugs.webkit.org/show_bug.cgi?id=186930
2312         <rdar://problem/41393393>
2313
2314         Reviewed by Dean Jackson.
2315
2316         Test: webanimations/accelerated-animation-with-delay.html
2317
2318         We would mistakenly clear the list of pending accelerated actions in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
2319         even if we failed to proceed because of the target element's renderer not being composited yet. Now, we clear the list after
2320         we've established we can apply them, and if we can't we inform the animation with a call to acceleratedStateDidChange() which
2321         will in turn call into the document timeline so that we may consider these animations on the next tick.
2322
2323         For this to work correctly we must make a change to DocumentTimeline::applyPendingAcceleratedAnimations() which only cleared
2324         its list of pending accelerated animations _after_ iterating through them, which would be problematic since we would now add
2325         animations to this list. That list is now copied and cleared prior to iterating through its members.
2326
2327         We also fix the naming of the m_pendingAcceleratedActions copy in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
2328         to have a more similar name.
2329
2330         * animation/DocumentTimeline.cpp:
2331         (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations):
2332         * animation/KeyframeEffectReadOnly.cpp:
2333         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
2334
2335 2018-07-26  Ross Kirsling  <ross.kirsling@sony.com>
2336
2337         String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
2338         https://bugs.webkit.org/show_bug.cgi?id=187963
2339
2340         Reviewed by Alex Christensen.
2341
2342         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
2343         (WebCore::convert):
2344         * Modules/cache/DOMCache.cpp:
2345         (WebCore::hasResponseVaryStarHeaderValue):
2346         * Modules/cache/DOMCacheEngine.cpp:
2347         (WebCore::DOMCacheEngine::queryCacheMatch):
2348         * Modules/mediastream/PeerConnectionBackend.cpp:
2349         (WebCore::filterICECandidate):
2350         (WebCore::PeerConnectionBackend::filterSDP const):
2351         * Modules/websockets/WebSocketHandshake.cpp:
2352         (WebCore::WebSocketHandshake::checkResponseHeaders):
2353         * accessibility/AccessibilityObject.h:
2354         (WebCore::AccessibilityObject::determineARIADropEffects):
2355         * accessibility/AccessibilityRenderObject.cpp:
2356         (WebCore::AccessibilityRenderObject::determineARIADropEffects):
2357         * accessibility/AccessibilityRenderObject.h:
2358         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2359         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2360         * editing/cocoa/DataDetection.mm:
2361         (WebCore::DataDetection::shouldCancelDefaultAction):
2362         * editing/markup.cpp:
2363         (WebCore::fillContainerFromString):
2364         (WebCore::createFragmentFromText):
2365         * html/EmailInputType.cpp:
2366         (WebCore::EmailInputType::typeMismatchFor const):
2367         (WebCore::EmailInputType::sanitizeValue const):
2368         * html/HTMLInputElement.cpp:
2369         (WebCore::parseAcceptAttribute):
2370         * html/ValidationMessage.cpp:
2371         (WebCore::ValidationMessage::setMessageDOMAndStartTimer):
2372         * html/canvas/WebGLRenderingContextBase.cpp:
2373         (WebCore::WebGLRenderingContextBase::compileShader):
2374         * inspector/agents/InspectorDOMAgent.cpp:
2375         (WebCore::InspectorDOMAgent::nodeForPath):
2376         * loader/FormSubmission.cpp:
2377         (WebCore::encodingFromAcceptCharset):
2378         * loader/ResourceTiming.cpp:
2379         (WebCore::passesTimingAllowCheck):
2380         * page/WindowFeatures.cpp:
2381         (WebCore::parseDisabledAdaptations):
2382         (WebCore::parseDialogFeaturesMap):
2383         * platform/URL.cpp:
2384         (WebCore::isIPv4Address):
2385         (WebCore::isIPv6Address):
2386         * platform/graphics/GLContext.cpp:
2387         (WebCore::GLContext::version):
2388         * platform/graphics/freetype/FontCacheFreeType.cpp:
2389         (WebCore::patternToFamilies):
2390         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2391         (WebCore::extractGStreamerOptionsFromCommandLine):
2392         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2393         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
2394         (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
2395         * platform/gtk/PasteboardHelper.cpp:
2396         (WebCore::PasteboardHelper::fillSelectionData):
2397         * platform/gtk/SelectionData.cpp:
2398         (WebCore::SelectionData::setURIList):
2399         * platform/network/CacheValidation.cpp:
2400         (WebCore::collectVaryingRequestHeaders):
2401         * platform/network/HTTPParsers.cpp:
2402         (WebCore::filenameFromHTTPContentDisposition):
2403         (WebCore::parseXFrameOptionsHeader):
2404         (WebCore::parseAccessControlExposeHeadersAllowList):
2405         * platform/network/curl/CookieUtil.cpp:
2406         (WebCore::CookieUtil::parseCookieHeader):
2407         * platform/network/curl/CurlCacheEntry.cpp:
2408         (WebCore::CurlCacheEntry::loadResponseHeaders):
2409         * platform/network/curl/CurlCacheManager.cpp:
2410         (WebCore::CurlCacheManager::loadIndex):
2411         * platform/network/soup/CookieJarSoup.cpp:
2412         (WebCore::setCookiesFromDOM):
2413         * svg/SVGAnimationElement.cpp:
2414         (WebCore::SVGAnimationElement::parseAttribute):
2415         * svg/SVGToOTFFontConversion.cpp:
2416         (WebCore::SVGToOTFFontConverter::appendOS2Table):
2417         * svg/animation/SVGSMILElement.cpp:
2418         (WebCore::SVGSMILElement::parseBeginOrEnd):
2419         * testing/MockCDMFactory.cpp:
2420         (WebCore::MockCDM::sanitizeResponse const):
2421         (WebCore::MockCDMInstance::updateLicense):
2422         Update split/splitAllowingEmptyEntries usage.
2423
2424 2018-07-26  Nan Wang  <n_wang@apple.com>
2425
2426         AX: nothing returned for various previous text marker APIs from one div/p node to another
2427         https://bugs.webkit.org/show_bug.cgi?id=188071
2428
2429         Reviewed by Chris Fleizach.
2430
2431         TextIterator is emitting an extra '\n' at the end of the <p> node and there's no
2432         corresponding text node in the DOM tree, so we are not able to handle that for 
2433         text markers. Fixed it by ignoring the extra '\n' and anchor the text marker to 
2434         the previous child text node.
2435
2436         Test: accessibility/mac/text-marker-p-tags.html
2437
2438         * accessibility/AXObjectCache.cpp:
2439         (WebCore::AXObjectCache::traverseToOffsetInRange):
2440
2441 2018-07-26  Commit Queue  <commit-queue@webkit.org>
2442
2443         Unreviewed, rolling out r234181 and r234189.
2444         https://bugs.webkit.org/show_bug.cgi?id=188075
2445
2446         These are not needed right now (Requested by thorton on
2447         #webkit).
2448
2449         Reverted changesets:
2450
2451         "Enable Web Content Filtering on watchOS"
2452         https://bugs.webkit.org/show_bug.cgi?id=187979
2453         https://trac.webkit.org/changeset/234181
2454
2455         "HAVE(PARENTAL_CONTROLS) should be true on watchOS"
2456         https://bugs.webkit.org/show_bug.cgi?id=187985
2457         https://trac.webkit.org/changeset/234189
2458
2459 2018-07-26  Timothy Hatcher  <timothy@apple.com>
2460
2461         Use the Page's appearance when converting pasteboard attributed strings.
2462         https://bugs.webkit.org/show_bug.cgi?id=188067
2463         rdar://problem/42632246
2464
2465         Reviewed by Wenson Hsieh.
2466
2467         * editing/cocoa/WebContentReaderCocoa.mm:
2468         (WebCore::createFragment): Create a LocalDefaultSystemAppearance based on the Page.
2469
2470 2018-07-26  Eric Carlson  <eric.carlson@apple.com>
2471
2472         Switching tabs should not close PiP window
2473         https://bugs.webkit.org/show_bug.cgi?id=188054
2474         <rdar://problem/41212379>
2475
2476         Reviewed by Jon Lee.
2477
2478         No new tests, fixes an existing test.
2479         
2480         Prior to r233926, calling VideoFullscreenInterfaceMac::requestHideAndExitFullscreen was a noop.
2481         In r233926 it was updated to close the PiP window and was called from the PIPViewControllerDelegate
2482         selectors to close the PiP window. requestHideAndExitFullscreen is also called from 
2483         WebPageProxy::viewDidLeaveWindow when the web view is removed from it window, so switching
2484         tabs also closed the PiP window. Revert the changes to requestHideAndExitFullscreen, and add
2485         a new method that is only used by the delegate to exit PiP.
2486
2487         * platform/mac/VideoFullscreenInterfaceMac.h:
2488         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Make this an empty,
2489         do-nothing method.
2490         * platform/mac/VideoFullscreenInterfaceMac.mm:
2491         (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]): Call requestHideAndExitPiP.
2492         (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]): Ditto.
2493         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP): Renamed from requestHideAndExitFullscreen.
2494         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
2495
2496 2018-07-04  Darin Adler  <darin@apple.com>
2497
2498         Improve WebGPU implementation, including using Metal Objective-C protocols more simply and correctly
2499         https://bugs.webkit.org/show_bug.cgi?id=187333
2500
2501         Reviewed by Sam Weinig.
2502
2503         - Used a new OBJC_PROTOCOL macro to handle things in the Metal API that are protocols.
2504           The code previously had used OBJC_CLASS, but that created unrelated classes.
2505           Fixing this allows removing many typecasts that were in the existing code, makes it
2506           ARC-compatible, and also allowed the compiler to detect a couple mistakes where we
2507           were calling methods that don't exist.
2508
2509         - Eliminated use of separate heap-allocated, reference-counted objects to
2510           hold pointers to Metal objects.
2511
2512         - Reduced the use of the WebGPU wrappers to pass around arguments inside the code.
2513           They are now used only as part of the DOM binding; the inner GPU objects are used
2514           whenever possible. This cuts down the number of separate functions needed a bit,
2515           since we don't always need accessors for the things inside the wrappers.
2516
2517         - Used references rather than pointers in many cases.
2518
2519         - Took out three kinds of null checks: 1) Unneeded ones since Objective-C has the
2520           "do nothing and return 0" behavior for methods without return values and that return
2521           integer scalars. 2) Checks that aren't needed because the code has clear, invariant
2522           guarantees that the pointer won't be null. 3) The simplest variant of (2), checks
2523           that can be obviated by using reference types instead of pointer types.
2524
2525         - For Metal-specific functions and data members, used the function name metal() and
2526           the data member name m_metal rather than longer wordier names with the word "platform"
2527           in them. We could use "platform" if these objects were platform-specific objects used
2528           in a cross-platform way that needed a common name. But in this case it's clearer to
2529           call them "metal" since we are dropping down to the metal with Metal API, and
2530           shared platform-independent code will not be accessing these.
2531
2532         - Fixed the common mistake of using "unsigned long" in our C++ code to match IDL.
2533           The "unsigned long" type in IDL correponds to the "unsigned" type in WebKit code.
2534
2535         - Used "const" more in the GPU functions that are wrappers around Metal objects to
2536           reflect the fact that these have semantics of smart pointers; most operations can be
2537           done without changing which object is pointed to. This allows us to use const
2538           references to pass things around without reference count churn.
2539
2540         - Reduced includes.
2541
2542         - Added "explicit" keywords where appropriate.
2543
2544         - Removed unused functions. In particular, removed non-Metal stub versions of the
2545           functions in the GPU classes: the right way to start a new port is to clone the
2546           Metal-specific files and turn the into stubs if needed, it does not make it
2547           significantly more convenient to have stubs in the platform independent files,
2548           especially ones that are not compiled for any platform.
2549
2550         - Removed most the WEBCORE_EXPORT in the GPU headers; left only what's needed to
2551           support testing with TestWebKitAPI.
2552
2553         - Fixed two storage leaks in GPUDevice by adding missing adoptNS.
2554
2555         * PlatformMac.cmake: Moved files from platform/graphics/cocoa to platform/graphics/metal.
2556         * SourcesCocoa.txt: Ditto.
2557         * WebCore.xcodeproj/project.pbxproj: Ditto. Fixed paths on some files and groups/directories.
2558         Made the platform files that abstract GPU all be "project" visible, not "private", since
2559         they don't need to be visible outside WebCore. Removed reference to FontSelectionKeywordValues.h,
2560         which does not seem to be a source file, a derived source file, or mentioned in any change log.
2561
2562         * bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp:
2563         (WebCore::toJSNewlyCreated): Create the correct wrapper for a
2564         WebGPURenderPassDepthAttachmentDescriptor. The old code would instead
2565         create a WebGPURenderPassAttachmentDescriptor wrapper, which can't be
2566         used to access the clearDepth attribute.
2567
2568         * html/canvas/WebGPUBuffer.cpp:
2569         (WebCore::WebGPUBuffer::create): Use more references rather than pointers for things
2570         that are never null. Added comment about possibly returning null on failure in future.
2571         (WebCore::WebGPUBuffer::WebGPUBuffer): Updated to store the GPUBuffer inside the class
2572         instead of in a separate reference counted object.
2573         * html/canvas/WebGPUBuffer.h: Ditto.
2574
2575         * html/canvas/WebGPUCommandBuffer.cpp:
2576         (WebCore::WebGPUCommandBuffer::create): Use references and lower level types.
2577         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer): Store the GPUCommandBuffer
2578         inside the class.
2579         (WebCore::WebGPUCommandBuffer::commit): Removed unneeded null checks.
2580         (WebCore::WebGPUCommandBuffer::presentDrawable): Ditto.
2581         (WebCore::WebGPUCommandBuffer::createRenderCommandEncoderWithDescriptor):
2582         Removed unneeded local variable.
2583         (WebCore::WebGPUCommandBuffer::createComputeCommandEncoder): Ditto.
2584         (WebCore::WebGPUCommandBuffer::completed): Store the DOMPromiseProxy in this
2585         class, not in GPUCommandBuffer.
2586         * html/canvas/WebGPUCommandBuffer.h: Ditto.
2587
2588         * html/canvas/WebGPUCommandQueue.cpp:
2589         (WebCore::WebGPUCommandQueue::create): Use references and lower level types.
2590         (WebCore::WebGPUCommandQueue::WebGPUCommandQueue): Store the GPUCommandQueue
2591         inside the class.
2592         (WebCore::WebGPUCommandQueue::createCommandBuffer): Ditto.
2593         * html/canvas/WebGPUCommandQueue.h: Ditto.
2594         * html/canvas/WebGPUCommandQueue.idl: The return value of createCommandBuffer
2595         is no longer nullable.
2596
2597         * html/canvas/WebGPUComputeCommandEncoder.cpp:
2598         (WebCore::WebGPUComputeCommandEncoder::create): More of the same.
2599         (WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder): Ditto.
2600         (WebCore::WebGPUComputeCommandEncoder::setComputePipelineState): Ditto.
2601         (WebCore::WebGPUComputeCommandEncoder::setBuffer): Ditto.
2602         (WebCore::WebGPUComputeCommandEncoder::dispatch): Ditto.
2603         (WebCore::WebGPUComputeCommandEncoder::endEncoding): Ditto.
2604         * html/canvas/WebGPUComputeCommandEncoder.h: Ditto.
2605
2606         * html/canvas/WebGPUComputePipelineState.cpp:
2607         (WebCore::WebGPUComputePipelineState::create): More of the same.
2608         (WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState): Ditto.
2609         * html/canvas/WebGPUComputePipelineState.h: Ditto.
2610
2611         * html/canvas/WebGPUDepthStencilDescriptor.cpp:
2612         (WebCore::WebGPUDepthStencilDescriptor::create): More of the same.
2613         (WebCore::WebGPUDepthStencilDescriptor::depthWriteEnabled const): Ditto.
2614         (WebCore::WebGPUDepthStencilDescriptor::setDepthWriteEnabled): Ditto.
2615         (WebCore::WebGPUDepthStencilDescriptor::depthCompareFunction const): Ditto.
2616         (WebCore::WebGPUDepthStencilDescriptor::setDepthCompareFunction): Ditto.
2617         * html/canvas/WebGPUDepthStencilDescriptor.h: Ditto. Also fixed a bug
2618         where m_depthCompareFunction was uninitialized in newly created objects.
2619
2620         * html/canvas/WebGPUDepthStencilState.cpp:
2621         (WebCore::WebGPUDepthStencilState::create): More of the same.
2622         (WebCore::WebGPUDepthStencilState::WebGPUDepthStencilState): Ditto.
2623         (WebCore::WebGPUDepthStencilState::label const): Ditto.
2624         (WebCore::WebGPUDepthStencilState::setLabel): Ditto.
2625         * html/canvas/WebGPUDepthStencilState.h: Ditto.
2626
2627         * html/canvas/WebGPUDrawable.cpp:
2628         (WebCore::WebGPUDrawable::create): More of the same.
2629         (WebCore::WebGPUDrawable::WebGPUDrawable): Ditto.
2630         * html/canvas/WebGPUDrawable.h: Ditto.
2631
2632         * html/canvas/WebGPUEnums.cpp: Removed some stray const.
2633         * html/canvas/WebGPUEnums.h: Ditto.
2634
2635         * html/canvas/WebGPUFunction.cpp:
2636         (WebCore::WebGPUFunction::create): More of the same.
2637         (WebCore::WebGPUFunction::WebGPUFunction): Ditto.
2638         * html/canvas/WebGPUFunction.h: Ditto.
2639
2640         * html/canvas/WebGPULibrary.cpp:
2641         (WebCore::WebGPULibrary::create): More of the same.
2642         (WebCore::WebGPULibrary::WebGPULibrary): Ditto.
2643         (WebCore::WebGPULibrary::functionNames const): Ditto.
2644         (WebCore::WebGPULibrary::functionWithName const): Ditto.
2645         * html/canvas/WebGPULibrary.h: Ditto.
2646
2647         * html/canvas/WebGPUObject.cpp:
2648         (WebCore::WebGPUObject::WebGPUObject):
2649         (WebCore::WebGPUObject::deleteObject): Deleted this unused function.
2650         We can bring it back later if we find we need it the way we did with the
2651         WebGL implementation, but currently it's a never-called stub. Also
2652         deleted the isDeleted and m_deleted for the same reason.
2653         * html/canvas/WebGPUObject.h: Ditto.
2654
2655         * html/canvas/WebGPURenderCommandEncoder.cpp:
2656         (WebCore::WebGPURenderCommandEncoder::create): More of the same.
2657         (WebCore::WebGPURenderCommandEncoder::WebGPURenderCommandEncoder): Ditto.
2658         (WebCore::WebGPURenderCommandEncoder::setRenderPipelineState): Ditto.
2659         (WebCore::WebGPURenderCommandEncoder::setDepthStencilState): Ditto.
2660         (WebCore::WebGPURenderCommandEncoder::setVertexBuffer): Ditto.
2661         (WebCore::WebGPURenderCommandEncoder::setFragmentBuffer): Ditto.
2662         (WebCore::WebGPURenderCommandEncoder::drawPrimitives): Ditto.
2663         (WebCore::WebGPURenderCommandEncoder::endEncoding): Ditto.
2664         * html/canvas/WebGPURenderCommandEncoder.h: Ditto.
2665
2666         * html/canvas/WebGPURenderPassAttachmentDescriptor.cpp:
2667         (WebCore::WebGPURenderPassAttachmentDescriptor::WebGPURenderPassAttachmentDescriptor):
2668         More of the same.
2669         (WebCore::WebGPURenderPassAttachmentDescriptor::loadAction const): Ditto.
2670         (WebCore::WebGPURenderPassAttachmentDescriptor::setLoadAction): Ditto.
2671         (WebCore::WebGPURenderPassAttachmentDescriptor::storeAction const): Ditto.
2672         (WebCore::WebGPURenderPassAttachmentDescriptor::setStoreAction): Ditto.
2673         (WebCore::WebGPURenderPassAttachmentDescriptor::texture const): Ditto.
2674         (WebCore::WebGPURenderPassAttachmentDescriptor::setTexture): Ditto.
2675         * html/canvas/WebGPURenderPassAttachmentDescriptor.h: Ditto.
2676
2677         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
2678         (WebCore::WebGPURenderPassColorAttachmentDescriptor::create): More of the same.
2679         (WebCore::WebGPURenderPassColorAttachmentDescriptor::WebGPURenderPassColorAttachmentDescriptor): Ditto.
2680         (WebCore::WebGPURenderPassColorAttachmentDescriptor::descriptor const): Ditto.
2681         (WebCore::WebGPURenderPassColorAttachmentDescriptor::clearColor const): Ditto.
2682         (WebCore::WebGPURenderPassColorAttachmentDescriptor::setClearColor): Ditto.
2683         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.h: Ditto.
2684
2685         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
2686         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::create): More of the same.
2687         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::WebGPURenderPassDepthAttachmentDescriptor): Ditto.
2688         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::clearDepth const): Ditto.
2689         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::setClearDepth): Ditto.
2690         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::descriptor const): Ditto.
2691         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h: Ditto.
2692
2693         * html/canvas/WebGPURenderPassDescriptor.cpp:
2694         (WebCore::WebGPURenderPassDescriptor::create): More of the same.
2695         (WebCore::WebGPURenderPassDescriptor::depthAttachment): Ditto.
2696         (WebCore::WebGPURenderPassDescriptor::colorAttachments): Ditto.
2697         * html/canvas/WebGPURenderPassDescriptor.h: Ditto.
2698
2699         * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp:
2700         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::create): More of the same.
2701         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::WebGPURenderPipelineColorAttachmentDescriptor): Ditto.
2702         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::pixelFormat const): Ditto.
2703         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::setPixelFormat): Ditto.
2704         * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h: Ditto.
2705
2706         * html/canvas/WebGPURenderPipelineDescriptor.cpp:
2707         (WebCore::WebGPURenderPipelineDescriptor::create): More of the same.
2708         (WebCore::WebGPURenderPipelineDescriptor::vertexFunction const): Ditto.
2709         (WebCore::WebGPURenderPipelineDescriptor::setVertexFunction): Ditto.
2710         (WebCore::WebGPURenderPipelineDescriptor::fragmentFunction const): Ditto.
2711         (WebCore::WebGPURenderPipelineDescriptor::setFragmentFunction): Ditto.
2712         (WebCore::WebGPURenderPipelineDescriptor::colorAttachments): Ditto.
2713         (WebCore::WebGPURenderPipelineDescriptor::depthAttachmentPixelFormat const): Ditto.
2714         (WebCore::WebGPURenderPipelineDescriptor::setDepthAttachmentPixelFormat): Ditto.
2715         (WebCore::WebGPURenderPipelineDescriptor::reset): Ditto.
2716         * html/canvas/WebGPURenderPipelineDescriptor.h: Ditto.
2717
2718         * html/canvas/WebGPURenderPipelineState.cpp:
2719         (WebCore::WebGPURenderPipelineState::create): More of the same.
2720         (WebCore::WebGPURenderPipelineState::WebGPURenderPipelineState): Ditto.
2721         (WebCore::WebGPURenderPipelineState::label const): Ditto.
2722         (WebCore::WebGPURenderPipelineState::setLabel): Ditto.
2723         * html/canvas/WebGPURenderPipelineState.h: Ditto.
2724
2725         * html/canvas/WebGPURenderingContext.cpp:
2726         (WebCore::WebGPURenderingContext::create): More of the same.
2727         (WebCore::WebGPURenderingContext::WebGPURenderingContext): Ditto.
2728         (WebCore::WebGPURenderingContext::initializeNewContext): Ditto.
2729         (WebCore::WebGPURenderingContext::platformLayer const): Ditto.
2730         (WebCore::WebGPURenderingContext::markLayerComposited): Ditto.
2731         (WebCore::WebGPURenderingContext::reshape): Ditto.
2732         (WebCore::WebGPURenderingContext::createLibrary): Ditto.
2733         (WebCore::WebGPURenderingContext::createRenderPipelineState): Ditto.
2734         (WebCore::WebGPURenderingContext::createDepthStencilState): Ditto.
2735         (WebCore::WebGPURenderingContext::createComputePipelineState): Ditto.
2736         (WebCore::WebGPURenderingContext::createCommandQueue): Ditto.
2737         (WebCore::WebGPURenderingContext::nextDrawable): Ditto.
2738         (WebCore::WebGPURenderingContext::createBuffer): Ditto.
2739         (WebCore::WebGPURenderingContext::createTexture): Ditto.
2740         * html/canvas/WebGPURenderingContext.h: Made many functions final and
2741         private.
2742         * html/canvas/WebGPURenderingContext.idl: The return value of most of
2743         the create functions are no longer nullable.
2744
2745         * html/canvas/WebGPUSize.h: Use "unsigned" instead of "unsigned long".
2746
2747         * html/canvas/WebGPUTexture.cpp:
2748         (WebCore::WebGPUTexture::createFromDrawableTexture): More of the same.
2749         (WebCore::WebGPUTexture::create): Ditto.
2750         (WebCore::WebGPUTexture::WebGPUTexture): Ditto.
2751         * html/canvas/WebGPUTexture.h: Ditto.
2752
2753         * html/canvas/WebGPUTextureDescriptor.cpp:
2754         (WebCore::WebGPUTextureDescriptor::create): More of the same.
2755         (WebCore::WebGPUTextureDescriptor::WebGPUTextureDescriptor): Ditto.
2756         (WebCore::WebGPUTextureDescriptor::width const): Ditto.
2757         (WebCore::WebGPUTextureDescriptor::setWidth): Ditto.
2758         (WebCore::WebGPUTextureDescriptor::height const): Ditto.
2759         (WebCore::WebGPUTextureDescriptor::setHeight): Ditto.
2760         (WebCore::WebGPUTextureDescriptor::sampleCount const): Ditto.
2761         (WebCore::WebGPUTextureDescriptor::setSampleCount): Ditto.
2762         (WebCore::WebGPUTextureDescriptor::textureType const): Ditto.
2763         (WebCore::WebGPUTextureDescriptor::setTextureType): Ditto.
2764         (WebCore::WebGPUTextureDescriptor::storageMode const): Ditto.
2765         (WebCore::WebGPUTextureDescriptor::setStorageMode): Ditto.
2766         (WebCore::WebGPUTextureDescriptor::usage const): Ditto.
2767         (WebCore::WebGPUTextureDescriptor::setUsage): Ditto.
2768         * html/canvas/WebGPUTextureDescriptor.h: Ditto.
2769
2770         * platform/graphics/metal/GPUBufferMetal.mm: Moved from "cocoa" directory.
2771         (WebCore::GPUBuffer::GPUBuffer): Simplify code using references and the
2772         "metal" naming.
2773
2774         * platform/graphics/metal/GPUCommandBufferMetal.mm:
2775         (WebCore::GPUCommandBuffer::GPUCommandBuffer): Take a function to be called as the
2776         completed handler and set it up.
2777         (WebCore::GPUCommandBuffer::presentDrawable const): Ditto.
2778         (WebCore::GPUCommandBuffer::commit const): Ditto.
2779         (WebCore::GPUCommandBuffer::addCompletedHandler): Deleted.
2780
2781         * platform/graphics/metal/GPUCommandQueueMetal.mm:
2782         (WebCore::GPUCommandQueue::GPUCommandQueue): Ditto. Also rewrote label handling a bit.
2783         (WebCore::GPUCommandQueue::label const): Ditto.
2784         (WebCore::GPUCommandQueue::setLabel const): Ditto.
2785
2786         * platform/graphics/metal/GPUComputeCommandEncoderMetal.mm:
2787         (WebCore::GPUComputeCommandEncoder::GPUComputeCommandEncoder): Ditto.
2788         (WebCore::GPUComputeCommandEncoder::setComputePipelineState const): Ditto.
2789         (WebCore::GPUComputeCommandEncoder::setBuffer const): Ditto.
2790         (WebCore::GPUComputeCommandEncoder::dispatch const): Ditto.
2791         (WebCore::GPUComputeCommandEncoder::endEncoding const): Ditto.
2792
2793         * platform/graphics/metal/GPUComputePipelineStateMetal.mm:
2794         (WebCore::GPUComputePipelineState::GPUComputePipelineState): Ditto.
2795
2796         * platform/graphics/metal/GPUDepthStencilDescriptorMetal.mm:
2797         (WebCore::GPUDepthStencilDescriptor::GPUDepthStencilDescriptor): Ditto.
2798         (WebCore::GPUDepthStencilDescriptor::depthWriteEnabled const): Ditto.
2799         (WebCore::GPUDepthStencilDescriptor::setDepthWriteEnabled const): Ditto.
2800         (WebCore::GPUDepthStencilDescriptor::depthCompareFunction const): Ditto.
2801         (WebCore::GPUDepthStencilDescriptor::setDepthCompareFunction const): Ditto.
2802
2803         * platform/graphics/metal/GPUDepthStencilStateMetal.mm:
2804         (WebCore::GPUDepthStencilState::GPUDepthStencilState): Ditto.
2805         (WebCore::GPUDepthStencilState::label const): Ditto.
2806         (WebCore::GPUDepthStencilState::setLabel const): Ditto. This is one of the
2807         functions that was calling a method that does not exist. Added a comment.
2808
2809         * platform/graphics/metal/GPUDeviceMetal.mm:
2810         (WebCore::GPUDevice::GPUDevice): Ditto. Also fixed two storage leaks where
2811         we neglected to do adoptNS on the result of MTLCreateSystemDefaultDevice and
2812         on the result of -[[WebGPULayer alloc] initWithGPUDevice:].
2813         (WebCore::GPUDevice::reshape const): Ditto.
2814         (WebCore::GPUDevice::platformLayer const): Ditto.
2815         (WebCore::GPUDevice::operator! const): Ditto.
2816
2817         * platform/graphics/metal/GPUDrawableMetal.mm:
2818         (WebCore::GPUDrawable::GPUDrawable): Ditto.
2819         (WebCore::GPUDrawable::release): Ditto.
2820         (WebCore::GPUDrawable::metal const): Ditto.
2821         (WebCore::GPUDrawable::texture const): Ditto.
2822
2823         * platform/graphics/metal/GPUFunctionMetal.mm:
2824         (WebCore::GPUFunction::GPUFunction): Ditto.
2825         (WebCore::GPUFunction::name const): Ditto.
2826         (WebCore::GPUFunction::metal const): Ditto.
2827         (WebCore::GPUFunction::operator! const): Ditto.
2828
2829         * platform/graphics/metal/GPULibraryMetal.mm:
2830         (WebCore::GPULibrary::GPULibrary): Ditto.
2831         (WebCore::GPULibrary::label const): Ditto.
2832         (WebCore::GPULibrary::setLabel const): Ditto.
2833         (WebCore::GPULibrary::functionNames const): Ditto.
2834         (WebCore::GPULibrary::metal const): Ditto.
2835
2836         * platform/graphics/metal/GPURenderCommandEncoderMetal.mm:
2837         (WebCore::GPURenderCommandEncoder::GPURenderCommandEncoder): Ditto.
2838         (WebCore::GPURenderCommandEncoder::setRenderPipelineState const): Ditto.
2839         (WebCore::GPURenderCommandEncoder::setDepthStencilState const): Ditto.
2840         (WebCore::GPURenderCommandEncoder::setVertexBuffer const): Ditto.
2841         (WebCore::GPURenderCommandEncoder::setFragmentBuffer const): Ditto.
2842         (WebCore::GPURenderCommandEncoder::drawPrimitives const): Ditto.
2843         (WebCore::GPURenderCommandEncoder::endEncoding const): Ditto.
2844
2845         * platform/graphics/metal/GPURenderPassAttachmentDescriptorMetal.mm:
2846         (WebCore::GPURenderPassAttachmentDescriptor::GPURenderPassAttachmentDescriptor): Ditto.
2847         (WebCore::GPURenderPassAttachmentDescriptor::loadAction const): Ditto.
2848         (WebCore::GPURenderPassAttachmentDescriptor::setLoadAction const): Ditto.
2849         (WebCore::GPURenderPassAttachmentDescriptor::storeAction const): Ditto.
2850         (WebCore::GPURenderPassAttachmentDescriptor::setStoreAction const): Ditto.
2851         (WebCore::GPURenderPassAttachmentDescriptor::setTexture const): Ditto.
2852
2853         * platform/graphics/metal/GPURenderPassColorAttachmentDescriptorMetal.mm:
2854         (WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor): Ditto.
2855         (WebCore::GPURenderPassColorAttachmentDescriptor::clearColor const): Ditto.
2856         (WebCore::GPURenderPassColorAttachmentDescriptor::setClearColor const): Ditto.
2857         (WebCore::GPURenderPassColorAttachmentDescriptor::metal const): Ditto.
2858
2859         * platform/graphics/metal/GPURenderPassDepthAttachmentDescriptorMetal.mm:
2860         (WebCore::GPURenderPassDepthAttachmentDescriptor::GPURenderPassDepthAttachmentDescriptor): Ditto.
2861         (WebCore::GPURenderPassDepthAttachmentDescriptor::clearDepth const): Ditto.
2862         (WebCore::GPURenderPassDepthAttachmentDescriptor::setClearDepth const): Ditto.
2863         (WebCore::GPURenderPassDepthAttachmentDescriptor::metal const): Ditto.
2864
2865         * platform/graphics/metal/GPURenderPassDescriptorMetal.mm:
2866         (WebCore::GPURenderPassDescriptor::GPURenderPassDescriptor): Ditto.
2867         (WebCore::GPURenderPassDescriptor::colorAttachments const): Ditto.
2868         (WebCore::GPURenderPassDescriptor::depthAttachment const): Ditto.
2869         (WebCore::GPURenderPassDescriptor::metal const): Ditto.
2870
2871         * platform/graphics/metal/GPURenderPipelineColorAttachmentDescriptorMetal.mm:
2872         (WebCore::GPURenderPipelineColorAttachmentDescriptor::GPURenderPipelineColorAttachmentDescriptor): Ditto.
2873         (WebCore::GPURenderPipelineColorAttachmentDescriptor::pixelFormat const): Ditto.
2874         (WebCore::GPURenderPipelineColorAttachmentDescriptor::setPixelFormat const): Ditto.
2875         (WebCore::GPURenderPipelineColorAttachmentDescriptor::metal const): Ditto.
2876
2877         * platform/graphics/metal/GPURenderPipelineDescriptorMetal.mm:
2878         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Ditto.
2879         (WebCore::GPURenderPipelineDescriptor::depthAttachmentPixelFormat const): Ditto.
2880         (WebCore::GPURenderPipelineDescriptor::setDepthAttachmentPixelFormat const): Ditto.
2881         (WebCore::GPURenderPipelineDescriptor::setVertexFunction const): Ditto.
2882         (WebCore::GPURenderPipelineDescriptor::setFragmentFunction const): Ditto.
2883         (WebCore::GPURenderPipelineDescriptor::colorAttachments const): Ditto.
2884         (WebCore::GPURenderPipelineDescriptor::reset const): Ditto.
2885         (WebCore::GPURenderPipelineDescriptor::metal const): Ditto.
2886
2887         * platform/graphics/metal/GPURenderPipelineStateMetal.mm:
2888         (WebCore::GPURenderPipelineState::GPURenderPipelineState): Ditto.
2889         (WebCore::GPURenderPipelineState::label const): Ditto.
2890         (WebCore::GPURenderPipelineState::setLabel const): Ditto. This is one of the
2891         functions that was calling a method that does not exist. Added a comment.
2892         (WebCore::GPURenderPipelineState::metal const): Ditto.
2893
2894         * platform/graphics/metal/GPUTextureDescriptorMetal.mm:
2895         (WebCore::GPUTextureDescriptor::GPUTextureDescriptor): Ditto.
2896         (WebCore::GPUTextureDescriptor::width const): Ditto.
2897         (WebCore::GPUTextureDescriptor::setWidth const): Ditto.
2898         (WebCore::GPUTextureDescriptor::height const): Ditto.
2899         (WebCore::GPUTextureDescriptor::setHeight const): Ditto.
2900         (WebCore::GPUTextureDescriptor::sampleCount const): Ditto.
2901         (WebCore::GPUTextureDescriptor::setSampleCount const): Ditto.
2902         (WebCore::GPUTextureDescriptor::textureType const): Ditto.
2903         (WebCore::GPUTextureDescriptor::setTextureType const): Ditto.
2904         (WebCore::GPUTextureDescriptor::storageMode const): Ditto.
2905         (WebCore::GPUTextureDescriptor::setStorageMode const): Ditto.
2906         (WebCore::GPUTextureDescriptor::usage const): Ditto.
2907         (WebCore::GPUTextureDescriptor::setUsage const): Ditto.
2908         (WebCore::GPUTextureDescriptor::metal const): Ditto.
2909
2910         * platform/graphics/metal/GPUTextureMetal.mm:
2911         (WebCore::GPUTexture::GPUTexture): Ditto.
2912         (WebCore::GPUTexture::width const): Ditto.
2913         (WebCore::GPUTexture::height const): Ditto.
2914         (WebCore::GPUTexture::metal const): Ditto.
2915
2916         * platform/graphics/gpu/GPUBuffer.cpp: Removed unused stubs.
2917         (WebCore::GPUBuffer::length const): Moved this function here since it has
2918         a useful platform-independent implementation.
2919
2920         * platform/graphics/gpu/GPUBuffer.h: Use OBJC_PROTOCOL for MTLBuffer.
2921         Did the other thigs mentioned above: USE(METAL), remove WEBCORE_EXPORT,
2922         no longer be RefCounted, etc.
2923
2924         * platform/graphics/gpu/GPUCommandBuffer.cpp: Ditto.
2925         * platform/graphics/gpu/GPUCommandBuffer.h: Ditto. Use OBJC_PROTOCOL
2926         for MTLCommandBuffer.
2927
2928         * platform/graphics/gpu/GPUCommandQueue.cpp: Ditto.
2929         * platform/graphics/gpu/GPUCommandQueue.h: Ditto. Use OBJC_PROTOCOL for
2930         MTLCommandQueue.
2931
2932         * platform/graphics/gpu/GPUComputeCommandEncoder.cpp: Ditto.
2933         * platform/graphics/gpu/GPUComputeCommandEncoder.h: Ditto. Use OBJC_PROTOCOL for
2934         MTLComputeCommandEncoder.
2935
2936         * platform/graphics/gpu/GPUComputePipelineState.cpp: Ditto.
2937         * platform/graphics/gpu/GPUComputePipelineState.h: Ditto. Use OBJC_PROTOCOL for
2938         MTLComputePipelineState.
2939
2940         * platform/graphics/gpu/GPUDepthStencilDescriptor.cpp: Ditto.
2941         * platform/graphics/gpu/GPUDepthStencilDescriptor.h: Ditto.
2942
2943         * platform/graphics/gpu/GPUDepthStencilState.cpp: Ditto.
2944         * platform/graphics/gpu/GPUDepthStencilState.h: Ditto. Use OBJC_PROTOCOL for
2945         MTLDepthStencilState.
2946
2947         * platform/graphics/gpu/GPUDevice.cpp: Ditto.
2948         * platform/graphics/gpu/GPUDevice.h: Ditto. Use OBJC_PROTOCOL for MTLDevice.
2949
2950         * platform/graphics/gpu/GPUDrawable.cpp: Ditto.
2951         * platform/graphics/gpu/GPUDrawable.h: Ditto. Use OBJC_PROTOCOL for
2952         MTLDrawable and MTLTexture.
2953
2954         * platform/graphics/gpu/GPUEnums.h: Tweaked formatting.
2955
2956         * platform/graphics/gpu/GPUFunction.cpp: Ditto.
2957         * platform/graphics/gpu/GPUFunction.h: Ditto. Use OBJC_PROTOCOL for
2958         MTLFunction.
2959
2960         * platform/graphics/gpu/GPULibrary.cpp: Ditto.
2961         * platform/graphics/gpu/GPULibrary.h: Ditto. Use OBJC_PROTOCOL for
2962         MTLLibrary.
2963
2964         * platform/graphics/gpu/GPURenderCommandEncoder.cpp: Ditto.
2965         * platform/graphics/gpu/GPURenderCommandEncoder.h: Ditto.
2966         Use OBJC_PROTOCOL for MTLRenderCommandEncoder.
2967
2968         * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp: Ditto.
2969         * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.h: Ditto.
2970
2971         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp: Ditto.
2972         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Ditto.
2973
2974         * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp: Ditto.
2975         * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.h: Ditto.
2976
2977         * platform/graphics/gpu/GPURenderPassDescriptor.cpp: Ditto.
2978         * platform/graphics/gpu/GPURenderPassDescriptor.h: Ditto.
2979
2980         * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp: Ditto.
2981         * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.h: Ditto.
2982
2983         * platform/graphics/gpu/GPURenderPipelineDescriptor.cpp: Ditto.
2984         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Ditto.
2985
2986         * platform/graphics/gpu/GPURenderPipelineState.cpp: Ditto.
2987         * platform/graphics/gpu/GPURenderPipelineState.h: Ditto. Use OBJC_PROTOCOL
2988         for MTLRenderPipelineState.
2989
2990         * platform/graphics/gpu/GPUSize.h: Use "unsigned" instead of "unsigned long".
2991
2992         * platform/graphics/gpu/GPUTexture.cpp: Ditto.
2993         * platform/graphics/gpu/GPUTexture.h: Ditto. Use OBJC_PROTOCOL for
2994         MTLTexture.
2995
2996         * platform/graphics/gpu/GPUTextureDescriptor.cpp: Ditto.
2997         * platform/graphics/gpu/GPUTextureDescriptor.h: Ditto.
2998
2999 2018-07-26  Zalan Bujtas  <zalan@apple.com>
3000
3001         [LFC][Floating] Add skeleton for basic positioning.
3002         https://bugs.webkit.org/show_bug.cgi?id=187974
3003
3004         Reviewed by Antti Koivisto.
3005
3006         Add floating boxes to an empty floating context.
3007
3008         * layout/FloatingContext.cpp:
3009         (WebCore::Layout::FloatingContext::FloatingContext):
3010         (WebCore::Layout::FloatingContext::computePosition):
3011         * layout/FloatingContext.h:
3012         (WebCore::Layout::FloatingContext::floatingState const):
3013         (WebCore::Layout::FloatingContext::layoutContext const):
3014         * layout/FloatingState.cpp:
3015         (WebCore::Layout::FloatingState::FloatingState):
3016         (WebCore::Layout::FloatingState::append):
3017         * layout/FloatingState.h:
3018         (WebCore::Layout::FloatingState::create):
3019         (WebCore::Layout::FloatingState::isEmpty const):
3020         (WebCore::Layout::FloatingState::layoutContext const):
3021         * layout/FormattingState.h:
3022         * layout/LayoutContext.cpp:
3023         (WebCore::Layout::LayoutContext::establishedFormattingState):
3024         * layout/LayoutContext.h:
3025         * layout/blockformatting/BlockFormattingContext.cpp:
3026         (WebCore::Layout::BlockFormattingContext::layout const):
3027         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3028         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
3029         * layout/blockformatting/BlockFormattingContext.h:
3030         * layout/blockformatting/BlockInvalidation.cpp:
3031         (WebCore::Layout::invalidationStopsAtFormattingContextBoundary):
3032         * layout/layouttree/LayoutBox.cpp:
3033         (WebCore::Layout::Box::isLeftFloatingPositioned const):
3034         (WebCore::Layout::Box::isRightFloatingPositioned const):
3035         * layout/layouttree/LayoutBox.h:
3036
3037 2018-07-26  Zalan Bujtas  <zalan@apple.com>
3038
3039         [LFC][BFC] Do not try to access containing block's height during descendant height computation
3040         https://bugs.webkit.org/show_bug.cgi?id=187970
3041
3042         Reviewed by Antti Koivisto.
3043
3044         Mostly becasue in BFC, we compute the descendents' height first so the containing block's height is probably not computed yet.
3045
3046         * layout/FormattingContextGeometry.cpp:
3047         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
3048         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
3049         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3050
3051 2018-07-26  Frederic Wang  <fwang@igalia.com>
3052
3053         Unreviewed, add bug references into FIXME comments for CSSOM View API
3054
3055         * dom/Element.idl:
3056         * page/ScrollToOptions.idl:
3057
3058 2018-07-26  Zalan Bujtas  <zalan@apple.com>
3059
3060         [LFC][BFC] assert-not-implemented-yet on inflow non-replaced height when style is not fixed/auto.
3061         https://bugs.webkit.org/show_bug.cgi?id=187969
3062
3063         Reviewed by Antti Koivisto.
3064
3065         Assert on unsupported height types when computing inflow non-replaced height.
3066
3067         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3068         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3069
3070 2018-07-26  Antoine Quint  <graouts@apple.com>
3071
3072         [Web Animations] REGRESSION: transition added immediately after element creation doesn't work
3073         https://bugs.webkit.org/show_bug.cgi?id=187942
3074
3075         Reviewed by Dean Jackson.
3076
3077         Tests: webanimations/accelerated-transition-by-removing-property.html
3078                webanimations/partly-accelerated-transition-by-removing-property.html
3079
3080         The Style::TreeResolver::createAnimatedElementUpdate() function expected a flag to be set that indicates that
3081         running animations on an element should yield a change in composited state for that element's layer. We did not
3082         have code accounting for this flag in the Web Animations engine. We now have a resolveAnimationsForElement()
3083         method on DocumentTimeline which looks at all animations resolved on the element and see if all of them are
3084         running accelerated and whether at least one of them is pending. In that case, we set the shouldRecompositeLayer
3085         flag in createAnimatedElementUpdate() to true which guarantees the element's layer will have a backing when
3086         we attempt to start the animation in KeyframeEffectReadOnly::applyPendingAcceleratedActions() where we would
3087         have previously failed to have layer-backed renderer to perform an accelerated animation on (under certain
3088         circumstances, see test).
3089
3090         * animation/DocumentTimeline.cpp:
3091         (WebCore::DocumentTimeline::resolveAnimationsForElement):
3092         * animation/DocumentTimeline.h:
3093         * animation/KeyframeEffectReadOnly.h:
3094         (WebCore::KeyframeEffectReadOnly::hasPendingAcceleratedAction const):
3095         * style/StyleTreeResolver.cpp:
3096         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
3097
3098 2018-07-25  Chris Dumez  <cdumez@apple.com>
3099
3100         Allow ActiveDOMObject's canSuspend / suspend / resume overrides to destroy ActiveDOMObjects
3101         https://bugs.webkit.org/show_bug.cgi?id=188025
3102
3103         Reviewed by Alex Christensen.
3104
3105         Apply the same logic as in ScriptExecutionContext::stopActiveDOMObjects() to support destruction of
3106         ActiveDOMObjects while we're calling ActiveDOMObject's canSuspend / suspend / resume overrides.
3107
3108         We copy m_activeDOMObjects into a Vector and iterate over the copy instead of m_activeDOMObjects.
3109         Since ActiveDOMObject is not RefCounted or CanMakeWeakPtr, we verify that the raw pointer is still
3110         valid by checking if m_activeDOMObjects still contains it, as we iterate. This is safe as the
3111         ActiveDOMObject destructor removes the object from ScriptExecutionContext::m_activeDOMObjects.
3112         New ActiveDOMObjects with the same pointer value cannot be created while we iterate as we already
3113         prevent the construction of new ActiveDOMObjects while we iterate via RELEASE_ASSERT().
3114
3115         * dom/ScriptExecutionContext.cpp:
3116         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
3117         (WebCore::ScriptExecutionContext::forEachActiveDOMObject const):
3118         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
3119         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
3120         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
3121         (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
3122         * dom/ScriptExecutionContext.h:
3123
3124 2018-07-25  Justin Fan  <justin_fan@apple.com>
3125
3126         Systems with no NSScreens hitting assertion in rendererIDForDisplay when creating WebGL context
3127         https://bugs.webkit.org/show_bug.cgi?id=188023
3128         <rdar://problem/42476622>
3129
3130         Reviewed by Simon Fraser.
3131
3132         On systems with no NSScreens, PlatformScreenMac's screenData map is not populated; rendererIDForDisplay
3133         will thus hit an assertion rather than returning 0. Removing the assertion for now. 
3134
3135         Covered by existing tests.
3136
3137         * platform/mac/PlatformScreenMac.mm:
3138         (WebCore::rendererIDForDisplay):
3139
3140 2018-07-25  Zalan Bujtas  <zalan@apple.com>
3141
3142         Build fix after r234215. Unreviewed.
3143
3144         * rendering/RenderTheme.cpp:
3145
3146 2018-07-25  Zalan Bujtas  <zalan@apple.com>
3147
3148         REGRESSION(r227577) Text on TV & Movies page doesn't wrap properly in iTunes
3149         https://bugs.webkit.org/show_bug.cgi?id=188018
3150         <rdar://problem/42517520>
3151
3152         Reviewed by Dean Jackson.
3153
3154         Manual rollout of r227577.
3155
3156         Test: fast/overflow/line-clamp-with-text-shadow.html
3157
3158         * Sources.txt:
3159         * WebCore.xcodeproj/project.pbxproj:
3160         * css/CSSComputedStyleDeclaration.cpp:
3161         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3162         * css/CSSProperties.json:
3163         * css/StyleBuilderCustom.h:
3164         (WebCore::StyleBuilderCustom::applyValueWebkitLinesClamp): Deleted.
3165         * css/parser/CSSParserContext.cpp:
3166         (WebCore::CSSParserContext::CSSParserContext):
3167         * css/parser/CSSParserContext.h:
3168         (WebCore::CSSParserContextHash::hash):
3169         * css/parser/CSSPropertyParser.cpp:
3170         (WebCore::CSSPropertyParser::parseSingleValue):
3171         (WebCore::consumeLinesClamp): Deleted.
3172         * page/Settings.yaml:
3173         * rendering/RenderBlockFlow.cpp:
3174         (WebCore::RenderBlockFlow::willCreateColumns const):
3175         (WebCore::getHeightForLineCount):
3176         (WebCore::RenderBlockFlow::heightForLineCount):
3177         (WebCore::RenderBlockFlow::layoutExcludedChildren):
3178         (WebCore::RenderBlockFlow::logicalHeightForLineCount): Deleted.
3179         (WebCore::RenderBlockFlow::logicalHeightExcludingLineCount): Deleted.
3180         * rendering/RenderBlockFlow.h:
3181         * rendering/RenderDeprecatedFlexibleBox.cpp:
3182         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
3183         * rendering/RenderFragmentContainer.cpp:
3184         (WebCore::RenderFragmentContainer::pageLogicalHeightForOffset const): Deleted.
3185         * rendering/RenderFragmentContainer.h:
3186         * rendering/RenderFragmentedFlow.cpp:
3187         (WebCore::RenderFragmentedFlow::validateFragments):
3188         (WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
3189         (WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
3190         * rendering/RenderFragmentedFlow.h:
3191         * rendering/RenderLinesClampFlow.cpp: Removed.
3192         * rendering/RenderLinesClampFlow.h: Removed.
3193         * rendering/RenderLinesClampSet.cpp: Removed.
3194         * rendering/RenderLinesClampSet.h: Removed.
3195         * rendering/RenderMultiColumnFlow.cpp:
3196         (WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const): Deleted.
3197         (WebCore::RenderMultiColumnFlow::createMultiColumnSet): Deleted.
3198         * rendering/RenderMultiColumnFlow.h:
3199         (WebCore::RenderMultiColumnFlow::multiColumnBlockFlow const): Deleted.
3200         (WebCore::RenderMultiColumnFlow::hasColumnSpanner const): Deleted.
3201         (WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const): Deleted.
3202         (WebCore::RenderMultiColumnFlow::columnCount const): Deleted.
3203         (WebCore::RenderMultiColumnFlow::columnWidth const): Deleted.
3204         (WebCore::RenderMultiColumnFlow::columnHeightAvailable const): Deleted.
3205         (WebCore::RenderMultiColumnFlow::setColumnHeightAvailable): Deleted.
3206         (WebCore::RenderMultiColumnFlow::inBalancingPass const): Deleted.
3207         (WebCore::RenderMultiColumnFlow::setInBalancingPass): Deleted.
3208         (WebCore::RenderMultiColumnFlow::needsHeightsRecalculation const): Deleted.
3209         (WebCore::RenderMultiColumnFlow::setNeedsHeightsRecalculation): Deleted.
3210         (WebCore::RenderMultiColumnFlow::shouldRelayoutForPagination const): Deleted.
3211         (WebCore::RenderMultiColumnFlow::setColumnCountAndWidth): Deleted.
3212         (WebCore::RenderMultiColumnFlow::progressionIsInline const): Deleted.
3213         (WebCore::RenderMultiColumnFlow::setProgressionIsInline): Deleted.
3214         (WebCore::RenderMultiColumnFlow::progressionIsReversed const): Deleted.
3215         (WebCore::RenderMultiColumnFlow::setProgressionIsReversed): Deleted.
3216         (WebCore::RenderMultiColumnFlow::spannerMap): Deleted.
3217         * rendering/RenderMultiColumnSet.cpp:
3218         (WebCore::RenderMultiColumnSet::collectLayerFragments):
3219         (WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
3220         * rendering/RenderMultiColumnSet.h:
3221         (WebCore::RenderMultiColumnSet::multiColumnBlockFlow const): Deleted.
3222         (WebCore::RenderMultiColumnSet::multiColumnFlow const): Deleted.
3223         (WebCore::RenderMultiColumnSet::logicalTopInFragmentedFlow const): Deleted.
3224         (WebCore::RenderMultiColumnSet::logicalBottomInFragmentedFlow const): Deleted.
3225         (WebCore::RenderMultiColumnSet::logicalHeightInFragmentedFlow const): Deleted.
3226         (WebCore::RenderMultiColumnSet::computedColumnCount const): Deleted.
3227         (WebCore::RenderMultiColumnSet::computedColumnWidth const): Deleted.
3228         (WebCore::RenderMultiColumnSet::computedColumnHeight const): Deleted.
3229         (WebCore::RenderMultiColumnSet::columnHeightComputed const): Deleted.
3230         (WebCore::RenderMultiColumnSet::setComputedColumnWidthAndCount): Deleted.
3231         (WebCore::RenderMultiColumnSet::updateMinimumColumnHeight): Deleted.
3232         (WebCore::RenderMultiColumnSet::minimumColumnHeight const): Deleted.
3233         (WebCore::RenderMultiColumnSet::forcedBreaksCount const): Deleted.
3234         (WebCore::RenderMultiColumnSet::hasBeenFlowed const): Deleted.
3235         (WebCore::RenderMultiColumnSet::skipLayerFragmentCollectionForColumn const): Deleted.
3236         (WebCore::RenderMultiColumnSet::customBlockProgressionAdjustmentForColumn const): Deleted.
3237         (WebCore::RenderMultiColumnSet::ContentRun::ContentRun): Deleted.
3238         (WebCore::RenderMultiColumnSet::ContentRun::assumedImplicitBreaks const): Deleted.
3239         (WebCore::RenderMultiColumnSet::ContentRun::assumeAnotherImplicitBreak): Deleted.
3240         (WebCore::RenderMultiColumnSet::ContentRun::breakOffset const): Deleted.
3241         (WebCore::RenderMultiColumnSet::ContentRun::columnLogicalHeight const): Deleted.
3242         * rendering/RenderObject.h:
3243         (WebCore::RenderObject::isRenderLinesClampFlow const): Deleted.
3244         (WebCore::RenderObject::isRenderLinesClampSet const): Deleted.
3245         * rendering/style/LineClampValue.h:
3246         (WebCore::LinesClampValue::LinesClampValue): Deleted.
3247         (WebCore::LinesClampValue::isNone const): Deleted.
3248         (WebCore::LinesClampValue::operator== const): Deleted.
3249         (WebCore::LinesClampValue::operator!= const): Deleted.
3250         (WebCore::LinesClampValue::start const): Deleted.
3251         (WebCore::LinesClampValue::end const): Deleted.
3252         (WebCore::LinesClampValue::center const): Deleted.
3253         * rendering/style/RenderStyle.h:
3254         (WebCore::RenderStyle::lineClamp const):
3255         (WebCore::RenderStyle::setLineClamp):
3256         (WebCore::RenderStyle::initialLineClamp):
3257         (WebCore::RenderStyle::hasInlineColumnAxis const):
3258         (WebCore::RenderStyle::linesClamp const): Deleted.
3259         (WebCore::RenderStyle::hasLinesClamp const): Deleted.
3260         (WebCore::RenderStyle::setLinesClamp): Deleted.
3261         (WebCore::RenderStyle::initialLinesClamp): Deleted.
3262         * rendering/style/StyleRareNonInheritedData.cpp:
3263         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3264         (WebCore::StyleRareNonInheritedData::operator== const):
3265         * rendering/style/StyleRareNonInheritedData.h:
3266         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
3267         (WebCore::isValidColumnSpanner):
3268         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
3269         (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
3270
3271 2018-07-25  Chris Dumez  <cdumez@apple.com>
3272
3273         navigator.userAgent may return outdated value after webView.customUserAgent is set
3274         https://bugs.webkit.org/show_bug.cgi?id=188009
3275         <rdar://problem/42566456>
3276
3277         Reviewed by Alex Christensen.
3278
3279         Invalidate the navigator.userAgent cache whenever the user agent gets changed to avoid exposing
3280         outdated values to JavaScript.
3281
3282         * page/Navigator.cpp:
3283         (WebCore::Navigator::userAgentChanged):
3284         * page/Navigator.h:
3285         * page/NavigatorID.idl:
3286         * page/Page.cpp:
3287         (WebCore::Page::userAgentChanged):
3288         * page/Page.h:
3289
3290 2018-07-25  David Fenton  <david_fenton@apple.com>
3291
3292         Unreviewed, rolling out r234187.
3293
3294         the layout test added with this change is flaky on the bots
3295
3296         Reverted changeset:
3297
3298         "Animation stops with object-fit:contain on an animated 2d
3299         canvas"
3300         https://bugs.webkit.org/show_bug.cgi?id=187840
3301         https://trac.webkit.org/changeset/234187
3302
3303 2018-07-25  Chris Dumez  <cdumez@apple.com>
3304
3305         Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT
3306         https://bugs.webkit.org/show_bug.cgi?id=187978
3307
3308         Reviewed by Eric Carlson.
3309
3310         Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT.
3311         If code does this, this leads to hard to investigate crashes such as rdar://problem/42160890. With a
3312         release assertion, we would find the culprits right away. The assertion guarding against addition of
3313         ActiveDOMObjects while we iterate is already a RELEASE_ASSERT.
3314
3315         * dom/ScriptExecutionContext.cpp:
3316         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
3317         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
3318         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
3319         (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
3320         * dom/ScriptExecutionContext.h:
3321
3322 2018-07-24  Chris Dumez  <cdumez@apple.com>
3323
3324         REGRESSION (r219757): Accessing response getter of XHR instance from IFRAME sets constructor to Object from the IFRAME
3325         https://bugs.webkit.org/show_bug.cgi?id=187411
3326         <rdar://problem/41920593>
3327
3328         Reviewed by Sam Weinig.
3329
3330         Update JSXMLHttpRequest::response() to use the XMLHttpRequest's global object exec when constructing a JSONObject
3331         for the response instead of the caller's exec.
3332
3333         Test: http/tests/xmlhttprequest/xhr-response-constructor-subframe.html
3334
3335         * bindings/js/JSXMLHttpRequestCustom.cpp:
3336         (WebCore::JSXMLHttpRequest::response const):
3337
3338 2018-07-24  Simon Fraser  <simon.fraser@apple.com>
3339
3340         Animation stops with object-fit:contain on an animated 2d canvas
3341         https://bugs.webkit.org/show_bug.cgi?id=187840
3342
3343         Reviewed by Zalan Bujtas.
3344         
3345         If a canvas has object-fit: cover or contain, repaints need to mapped through
3346         the rect that is used to position the canvas in the element bounds, which is replacedContentRect().
3347         
3348         Add a version of replacedContentRect() that doesn't require passing the intrinsicSize() since
3349         all but RenderVideo just pass the RenderReplaced's intrinsicSize.
3350
3351         Test: fast/repaint/canvas-object-fit.html
3352
3353         * html/HTMLCanvasElement.cpp:
3354         (WebCore::HTMLCanvasElement::didDraw):
3355         * rendering/RenderHTMLCanvas.cpp:
3356         (WebCore::RenderHTMLCanvas::paintReplaced):
3357         * rendering/RenderImage.cpp:
3358         (WebCore::RenderImage::updateInnerContentRect):
3359         (WebCore::RenderImage::paintReplaced):
3360         * rendering/RenderLayerBacking.cpp:
3361         (WebCore::RenderLayerBacking::contentsBox const):
3362         * rendering/RenderReplaced.h:
3363         (WebCore::RenderReplaced::replacedContentRect const):
3364         * rendering/shapes/ShapeOutsideInfo.cpp:
3365         (WebCore::ShapeOutsideInfo::createShapeForImage const):
3366
3367 2018-07-24  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3368
3369         [Curl] Add support for wss:// websockets
3370         https://bugs.webkit.org/show_bug.cgi?id=172630
3371
3372         Reviewed by Fujii Hironori.
3373
3374         To support secure WebSocket connection, it is almost rewritten by using existing
3375         backend for CurlHandle to handle TLS connection and proxy support.
3376
3377         Test: http/tests/websocket/tests/hybi/simple-wss.html
3378