Get rid of the m_premultiplyAlpha flag of the ImageFrame class
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-09-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
2
3         Get rid of the m_premultiplyAlpha flag of the ImageFrame class
4         https://bugs.webkit.org/show_bug.cgi?id=159721
5
6         Reviewed by Simon Fraser.
7
8         This flag was only needed when calling ImageBackingStore::create() in 
9         ImageFrame::setSize(). Instead we can pass ImageDecoder::m_premultiplyAlpha 
10         to ImageFrame::setSize(), which is renamed ImageFrame::initializeBackingStore().
11         The passed premultiplyAlpha can then be passed to ImageBackingStore::create().
12
13         * platform/image-decoders/ImageDecoder.cpp:
14         (WebCore::ImageFrame::ImageFrame):
15         (WebCore::ImageFrame::operator=):
16         (WebCore::ImageFrame::initializeBackingStore):
17         (WebCore::ImageFrame::copyBitmapData): Deleted.
18         (WebCore::ImageFrame::setSize): Deleted.
19         * platform/image-decoders/ImageDecoder.h:
20         (WebCore::ImageFrame::disposalMethod):
21         (WebCore::ImageFrame::setDisposalMethod):
22         (WebCore::ImageDecoder::premultiplyAlpha):
23         (WebCore::ImageFrame::premultiplyAlpha): Deleted.
24         (WebCore::ImageFrame::setPremultiplyAlpha): Deleted.
25         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
26         (WebCore::BMPImageDecoder::frameBufferAtIndex):
27         * platform/image-decoders/bmp/BMPImageReader.cpp:
28         (WebCore::BMPImageReader::decodeBMP):
29         * platform/image-decoders/gif/GIFImageDecoder.cpp:
30         (WebCore::GIFImageDecoder::decode):
31         (WebCore::GIFImageDecoder::initFrameBuffer):
32         * platform/image-decoders/ico/ICOImageDecoder.cpp:
33         (WebCore::ICOImageDecoder::frameCount):
34         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
35         (WebCore::JPEGImageDecoder::frameBufferAtIndex):
36         (WebCore::JPEGImageDecoder::outputScanlines):
37         * platform/image-decoders/png/PNGImageDecoder.cpp:
38         (WebCore::PNGImageDecoder::frameBufferAtIndex):
39         (WebCore::PNGImageDecoder::rowAvailable):
40         (WebCore::PNGImageDecoder::readChunks):
41         (WebCore::PNGImageDecoder::initFrameBuffer):
42         (WebCore::setPixelRGB): Deleted.
43         (WebCore::setPixelRGBA): Deleted.
44         (WebCore::setPixelPremultipliedRGBA): Deleted.
45         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
46         (WebCore::WEBPImageDecoder::frameBufferAtIndex):
47         (WebCore::WEBPImageDecoder::decode):
48
49 2016-09-12  Brent Fulgham  <bfulgham@apple.com>
50
51         [Win][Direct2D] Provide Direct2D-based geometry and transform cast operations
52         https://bugs.webkit.org/show_bug.cgi?id=161818
53
54         Reviewed by Dean Jackson.
55
56         Tested by new TestWebKitAPI tests.
57
58         Add new casting operators to and from various Direct2D data types.
59
60         * PlatformWin.cmake:
61         * platform/graphics/FloatPoint.h:
62         (WebCore::FloatPoint::FloatPoint):
63         * platform/graphics/FloatRect.h:
64         * platform/graphics/FloatSize.h:
65         (WebCore::FloatSize::FloatSize):
66         * platform/graphics/IntPoint.h:
67         * platform/graphics/IntRect.h:
68         * platform/graphics/IntSize.h:
69         * platform/graphics/transforms/AffineTransform.h:
70         * platform/graphics/transforms/TransformationMatrix.h:
71         * platform/graphics/win/FloatPointDirect2D.cpp:
72         * platform/graphics/win/FloatRectDirect2D.cpp:
73         * platform/graphics/win/FloatSizeDirect2D.cpp:
74         * platform/graphics/win/IntPointWin.cpp:
75         (WebCore::IntPoint::IntPoint):
76         (WebCore::IntPoint::operator D2D1_POINT_2F):
77         (WebCore::IntPoint::operator D2D1_POINT_2U):
78         * platform/graphics/win/IntRectWin.cpp:
79         (WebCore::IntRect::IntRect):
80         (WebCore::IntRect::operator D2D1_RECT_F):
81         (WebCore::IntRect::operator D2D1_RECT_U):
82         * platform/graphics/win/IntSizeWin.cpp:
83         (WebCore::IntSize::IntSize):
84         (WebCore::IntSize::operator D2D1_SIZE_U):
85         (WebCore::IntSize::operator D2D1_SIZE_F):
86         * platform/graphics/win/TransformationMatrixDirect2D.cpp: Added.
87         (WebCore::TransformationMatrix::TransformationMatrix):
88         (WebCore::TransformationMatrix::operator D2D1_MATRIX_3X2_F):
89         (WebCore::AffineTransform::AffineTransform):
90         (WebCore::AffineTransform::operator D2D1_MATRIX_3X2_F):
91
92 2016-09-13  Tim Horton  <timothy_horton@apple.com>
93
94         Undoing a candidate insertion results in the replaced text being selected
95         https://bugs.webkit.org/show_bug.cgi?id=161894
96         <rdar://problem/28225774>
97
98         Reviewed by Simon Fraser.
99
100         Test: editing/mac/spelling/accept-candidate-undo-does-not-select.html
101
102         * WebCore.xcodeproj/project.pbxproj:
103         * editing/ReplaceRangeWithTextCommand.cpp: Added.
104         (WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand):
105         (WebCore::ReplaceRangeWithTextCommand::doApply):
106         * editing/ReplaceRangeWithTextCommand.h: Added.
107         (WebCore::ReplaceRangeWithTextCommand::create):
108         Add a editor command that replaces a range with the given text.
109
110         * editing/Editor.cpp:
111         (WebCore::Editor::rangeForTextCheckingResult):
112         (WebCore::Editor::handleAcceptedCandidate):
113         (WebCore::Editor::selectTextCheckingResult): Deleted.
114         * editing/Editor.h:
115         Make use of the new editor command to do candidate insertion as a single
116         composite operation, so that it is undone as a unit. Otherwise, undo ends up
117         undoing the insertion, but not the selection, and we are left with the old
118         text, selected, which is undesirable.
119
120 2016-09-13  Dave Hyatt  <hyatt@apple.com>
121
122         [CSS Parser] Add CSS Variable Parsing support
123         https://bugs.webkit.org/show_bug.cgi?id=161916
124
125         Reviewed by Dean Jackson.
126
127         This patch not only adds the parser for CSS variables (from Blink), but it also brings in
128         all of the data structures used to store variables and custom property declarations. We
129         will be abandoning our old data structures eventually in favor of these new ones. They
130         are not significantly different other than operating on the CSSParserTokenRanges rather
131         than the soon-to-be-removed parser value lists.
132
133         * CMakeLists.txt:
134         * WebCore.xcodeproj/project.pbxproj:
135         * css/CSSCustomIdentValue.cpp: Added.
136         (WebCore::CSSCustomIdentValue::CSSCustomIdentValue):
137         (WebCore::CSSCustomIdentValue::customCSSText):
138         * css/CSSCustomIdentValue.h: Added.
139         (WebCore::CSSCustomIdentValue::create):
140         (WebCore::CSSCustomIdentValue::value):
141         (WebCore::CSSCustomIdentValue::isKnownPropertyID):
142         (WebCore::CSSCustomIdentValue::valueAsPropertyID):
143         (WebCore::CSSCustomIdentValue::equals):
144         * css/CSSCustomPropertyDeclaration.cpp: Added.
145         (WebCore::CSSCustomPropertyDeclaration::customCSSText):
146         * css/CSSCustomPropertyDeclaration.h: Added.
147         (WebCore::CSSCustomPropertyDeclaration::create):
148         (WebCore::CSSCustomPropertyDeclaration::name):
149         (WebCore::CSSCustomPropertyDeclaration::value):
150         (WebCore::CSSCustomPropertyDeclaration::id):
151         (WebCore::CSSCustomPropertyDeclaration::equals):
152         (WebCore::CSSCustomPropertyDeclaration::CSSCustomPropertyDeclaration):
153         * css/CSSCustomPropertyValue.h:
154         * css/CSSValue.cpp:
155         (WebCore::CSSValue::cssText):
156         (WebCore::CSSValue::destroy):
157         * css/CSSValue.h:
158         (WebCore::CSSValue::isCustomPropertyDeclaration):
159         (WebCore::CSSValue::isCustomIdentValue):
160         (WebCore::CSSValue::isVariableReferenceValue):
161         * css/CSSValueKeywords.in:
162         * css/CSSVariableData.cpp: Added.
163         (WebCore::CSSVariableData::updateTokens):
164         (WebCore::CSSVariableData::operator==):
165         (WebCore::CSSVariableData::consumeAndUpdateTokens):
166         (WebCore::CSSVariableData::CSSVariableData):
167         * css/CSSVariableData.h: Added.
168         (WebCore::CSSVariableData::create):
169         (WebCore::CSSVariableData::createResolved):
170         (WebCore::CSSVariableData::tokenRange):
171         (WebCore::CSSVariableData::tokens):
172         (WebCore::CSSVariableData::needsVariableResolution):
173         (WebCore::CSSVariableData::CSSVariableData):
174         * css/CSSVariableDependentValue.h:
175         * css/CSSVariableReferenceValue.cpp: Added.
176         (WebCore::CSSVariableReferenceValue::customCSSText):
177         * css/CSSVariableReferenceValue.h: Added.
178         (WebCore::CSSVariableReferenceValue::create):
179         (WebCore::CSSVariableReferenceValue::variableDataValue):
180         (WebCore::CSSVariableReferenceValue::equals):
181         (WebCore::CSSVariableReferenceValue::CSSVariableReferenceValue):
182         * css/CSSVariableValue.h:
183         * css/parser/CSSParserImpl.cpp:
184         (WebCore::filterProperties):
185         (WebCore::CSSParserImpl::consumeDeclaration):
186         (WebCore::CSSParserImpl::consumeVariableValue):
187         * css/parser/CSSVariableParser.cpp: Added.
188         (WebCore::CSSVariableParser::isValidVariableName):
189         (WebCore::classifyBlock):
190         (WebCore::isValidVariableReference):
191         (WebCore::classifyVariableRange):
192         (WebCore::CSSVariableParser::containsValidVariableReferences):
193         (WebCore::CSSVariableParser::parseDeclarationValue):
194         * css/parser/CSSVariableParser.h: Added.
195
196 2016-09-13  Daniel Bates  <dabates@apple.com>
197
198         Remove CSS keyword properties from CSSParser::parseValue(CSSPropertyID, bool)
199         https://bugs.webkit.org/show_bug.cgi?id=161918
200
201         Reviewed by Simon Fraser.
202
203         CSSParser::parseValue(CSSPropertyID, bool) calls ASSERT_NOT_REACHED() when processing a CSS property
204         that is known to accept only keyword values as a means to guide a person to add such a CSS property
205         to the switch block in WebCore::isValidKeywordPropertyAndValue(). In theory this sounds good, but
206         in practice it does not work out and the list of such properties is stale. We should remove the
207         case statements for such properties and the maintenance burden they required, which was manual and
208         error prone. We should think about a better way to enforce that all CSS properties are parsed/validated.
209
210         The approach of calling ASSERT_NOT_REACHED is not beneficial to catching coding mistakes because
211         CSSParser::parseValue() has a default case statement to parse/validate SVG CSS properties and hence
212         does not allow the C++ compiler to validate that the switch block covers all CSSPropertyIDs.
213
214         * css/parser/CSSParser.cpp:
215         (WebCore::CSSParser::parseValue):
216
217 2016-09-13  Daniel Bates  <dabates@apple.com>
218
219         Organize CSS keyword properties in WebCore::isKeywordPropertyID()
220         https://bugs.webkit.org/show_bug.cgi?id=161917
221
222         Reviewed by Simon Fraser.
223
224         Group and sort compile-time feature keywords and move them to the end of the switch block
225         to avoid the distraction of preprocessor statements scattered throughout the list. Sort
226         all the other keyword properties to make it straightforward to find a property by name.
227
228         * css/parser/CSSParser.cpp:
229         (WebCore::isKeywordPropertyID):
230
231 2016-09-13  Nan Wang  <n_wang@apple.com>
232
233         AX: Crash at AccessibilityRenderObject::computeAccessibilityIsIgnored const  + 552
234         https://bugs.webkit.org/show_bug.cgi?id=161276
235
236         Reviewed by Chris Fleizach.
237
238         Sometimes when calling JavaScript removeChild or setAttribute on a node, it seems like
239         the renderer is deallocated during the process of computeAccessibilityIsIgnored. It's 
240         causing a crash when we are accessing the renderer after that. Since RenderObject is not ref
241         counted and we cannot hold onto it for the duration of the function, fixed it by adding
242         more nil checks.
243
244         Despite my best efforts, I couldn't make a layout test that destroys the renderer within
245         the computeAccessibilityIsIgnored function. 
246
247         * accessibility/AccessibilityRenderObject.cpp:
248         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
249
250 2016-09-12  Jer Noble  <jer.noble@apple.com>
251
252         Media-source backed elements block load event; cause web-platform-test flakiness
253         https://bugs.webkit.org/show_bug.cgi?id=161881
254
255         Reviewed by Eric Carlson.
256
257         Test: media/media-source/media-source-delaying-load-event.html
258
259         The MSE specification has added an explicit step to their "attaching to media element"
260         algorithm which tells the media element to stop delaying the load event. And indeed,
261         the HTMLMediaElement blocks the load event when a MediaSource is attached but its data
262         is never loaded.
263
264         * Modules/mediasource/MediaSource.cpp:
265         (WebCore::MediaSource::setPrivateAndOpen):
266         * html/HTMLMediaElement.h:
267
268 2016-09-12  Zalan Bujtas  <zalan@apple.com>
269
270         Input type object and the associated render can go out of sync.
271         https://bugs.webkit.org/show_bug.cgi?id=161871
272         <rdar://problem/28178094>
273
274         Reviewed by Antti Koivisto.
275
276         Bail out when we've got a mismatched renderer.
277
278         Test: fast/forms/assert-on-input-type-change.html
279
280         * html/ImageInputType.cpp:
281         (WebCore::ImageInputType::altAttributeChanged):
282
283 2016-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>
284
285         [GTK] Get rid of DataObjectGtk::forClipboard and cleanup pasteboard code
286         https://bugs.webkit.org/show_bug.cgi?id=161907
287
288         Reviewed by Michael Catanzaro.
289
290         We don't really need to keep a DataObjectGtk for every clipboard, we could simply pass the DataObjectGtk to read
291         and write methods of PasteboardHelper.
292
293         * editing/gtk/EditorGtk.cpp:
294         (WebCore::createFragmentFromPasteboardData): Update for DataObjectGtk API changes.
295         * platform/Pasteboard.h:
296         * platform/gtk/DataObjectGtk.cpp: Remove forClipboard() static method.
297         * platform/gtk/DataObjectGtk.h: Ditto.
298         * platform/gtk/PasteboardGtk.cpp:
299         (WebCore::Pasteboard::Pasteboard): Always create a new DataObjectGtk.
300         (WebCore::Pasteboard::dataObject): Return a const reference instead of a pointer.
301         (WebCore::Pasteboard::writePlainText): Pass the DataObjectGtk to PasteboardHelper.
302         (WebCore::Pasteboard::write): Ditto.
303         (WebCore::Pasteboard::writePasteboard): Ditto.
304         (WebCore::Pasteboard::clear): Ditto.
305         (WebCore::Pasteboard::read): Ditto.
306         (WebCore::Pasteboard::hasData): Ditto.
307         (WebCore::Pasteboard::types): Ditto.
308         (WebCore::Pasteboard::readString): Ditto.
309         (WebCore::Pasteboard::readFilenames): Ditto.
310         * platform/gtk/PasteboardHelper.cpp:
311         (WebCore::PasteboardHelper::getClipboardContents): Update the given DataObjectGtk.
312         (WebCore::PasteboardHelper::fillSelectionData): Use a const reference to DataObjectGtk instead of a pointer.
313         (WebCore::PasteboardHelper::targetListForDataObject): Ditto.
314         (WebCore::PasteboardHelper::fillDataObjectFromDropData): Use a reference to DataObjectGtk instead of a pointer.
315         (WebCore::ClipboardSetData::ClipboardSetData): Helper struct to pass DataObjectGtk and callback to clipboard callbacks.
316         (WebCore::ClipboardSetData::~ClipboardSetData):
317         (WebCore::getClipboardContentsCallback): Get the DataObjectGtk from ClipboardSetData struct passed as user data.
318         (WebCore::clearClipboardContentsCallback): Get the DataObjectGtk and callback from ClipboardSetData struct
319         passed as user data.
320         (WebCore::PasteboardHelper::writeClipboardContents): Write the given DataObjectGtk.
321         * platform/gtk/PasteboardHelper.h:
322
323 2016-09-13  Chris Dumez  <cdumez@apple.com>
324
325         Drop support for <isindex>
326         https://bugs.webkit.org/show_bug.cgi?id=7139
327
328         Reviewed by Ryosuke Niwa.
329
330         Drop support for <isindex> and <input name=isindex>. Those are no longer
331         in the HTML specification and Chrome / Edge have already dropped their
332         support. Firefox is also planning on dropping this.
333
334         Test: imported/w3c/web-platform-tests/html/semantics/forms/historical.html
335
336         * css/StyleResolver.cpp:
337         (WebCore::elementTypeHasAppearanceFromUAStyle):
338         * css/html.css:
339         (input, textarea, keygen, select, button, meter, progress):
340         (input, textarea, keygen, select, button):
341         (#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS):
342         (input::placeholder):
343         (input:focus, textarea:focus, keygen:focus, select:focus):
344         * dom/Element.cpp:
345         (WebCore::Element::ieForbidsInsertHTML):
346         * html/HTMLInputElement.cpp:
347         (WebCore::HTMLInputElement::HTMLInputElement):
348         * html/HTMLTagNames.in:
349         * html/parser/HTMLStackItem.h:
350         (WebCore::isSpecialNode):
351         * html/parser/HTMLTreeBuilder.cpp:
352         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
353         (WebCore::HTMLTreeBuilder::processCloseWhenNestedTag): Deleted.
354         (WebCore::createCaseMap): Deleted.
355         * html/parser/HTMLTreeBuilder.h:
356         * platform/network/FormData.cpp:
357         (WebCore::FormData::appendKeyValuePairItems):
358
359 2016-09-12  Per Arne Vollan  <pvollan@apple.com>
360
361         [Win] Warning fix.
362         https://bugs.webkit.org/show_bug.cgi?id=161858
363
364         Reviewed by Brent Fulgham.
365
366         Use exported constants from CoreText.dll, instead of creating copies.
367
368         * PlatformAppleWin.cmake:
369         * platform/spi/win/CoreTextSPIWin.cpp: Removed.
370         * platform/spi/win/CoreTextSPIWin.h:
371
372 2016-09-12  Youenn Fablet  <youenn@apple.com>
373
374         ScriptElement should use FetchOptions::mode according its crossOrigin attribute
375         https://bugs.webkit.org/show_bug.cgi?id=161686
376
377         Reviewed by Darin Adler.
378
379         Setting ScriptElement fetch mode according its crossOrigin attribute.
380         Removing LoadableClassicScriptchecking of CORS since this is now done at ResourceLoader/CachedResource level.
381
382         Updating CachedResourceLoader to ensure that a resource that matches an on-going resource load but with different fetch mode/origin,
383         always gets its loading started if the resource state is not Cached.
384
385         Tests: fast/dom/script-crossorigin-loads-fail-origin.html
386                http/tests/security/cross-origin-cached-images-parallel.html
387                http/tests/security/cross-origin-cached-images.html
388                http/tests/security/cross-origin-cached-scripts-parallel.html
389                http/tests/security/cross-origin-cached-scripts.html
390                http/tests/security/script-crossorigin-loads-correctly-credentials.html
391                http/tests/security/script-with-dataurl.html
392
393         * dom/LoadableClassicScript.cpp:
394         (WebCore::LoadableClassicScript::create):
395         (WebCore::LoadableClassicScript::notifyFinished): Checking CORS failures using the resource state.
396         (WebCore::LoadableClassicScript::~LoadableClassicScript): Deleted.
397         (WebCore::LoadableClassicScript::isLoaded): Deleted.
398         * dom/LoadableClassicScript.h:
399         * dom/ScriptElement.cpp:
400         (WebCore::ScriptElement::requestClassicScript):
401         (WebCore::ScriptElement::requestScriptWithCache): Using CachedResourceRequest::setAsPotentiallyCrossOrigin to set fetch mode according crossOrigin attribute.
402         * dom/ScriptElement.h:
403         * loader/cache/CachedImage.cpp:
404         (WebCore::CachedImage::setBodyDataFrom):
405         * loader/cache/CachedResourceLoader.cpp:
406         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Adding support for script resources.
407         (WebCore::CachedResourceLoader::requestResource): Ensuring that 'updated' resources gets actually loaded.
408         * loader/cache/CachedScript.cpp:
409         (WebCore::CachedScript::setBodyDataFrom): Implementing specific data copy from another CachedScript.
410         * loader/cache/CachedScript.h:
411
412 2016-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>
413
414         [GTK] Scrollbar  too large
415         https://bugs.webkit.org/show_bug.cgi?id=161735
416
417         Reviewed by Michael Catanzaro.
418
419         We were not calculating the total scrollbar size correctly when the theme defines a minimum width/height. In
420         that case we need to take the extra size into account (border, margin, padding), but not adding the minimum
421         size. We were also adjusting the thumb position when rendering in indicator mode, but we really need to adjust
422         the whole rectangle. This worked in Adwaita because it uses a transparent track when in indicator mode. We are
423         also now taking into account the text direction when doing this adjustment for the indicator mode.
424
425         * platform/gtk/ScrollbarThemeGtk.cpp:
426         (WebCore::ScrollbarThemeGtk::paint):
427         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
428
429 2016-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>
430
431         [GTK] Crash of WebProcess on the last WebView disconnect (take two)
432         https://bugs.webkit.org/show_bug.cgi?id=161842
433
434         Reviewed by Michael Catanzaro.
435
436         The problem is that when PlatformDisplayX11 is destroyed, the sharing GL context is deleted and its destructor
437         makes a downcast of PlatformDisplay to get the native X11 display. We could simply keep a pointer to the native
438         X11 display in GLContextGLX, got at construction time from the PlatformDisplay, and ensure the sharing GL
439         context is deleted before the native X11 display is closed.
440
441         * platform/graphics/PlatformDisplay.h: Make m_sharingGLContext protected.
442         * platform/graphics/glx/GLContextGLX.cpp:
443         (WebCore::GLContextGLX::GLContextGLX): Initialize m_x11Display.
444         (WebCore::GLContextGLX::~GLContextGLX): Use m_x11Display and remove confusing comment about possible crash with
445         nviedia closed drivers.
446         (WebCore::GLContextGLX::defaultFrameBufferSize): Use m_x11Display.
447         (WebCore::GLContextGLX::makeContextCurrent): Ditto.
448         (WebCore::GLContextGLX::swapBuffers): Ditto.
449         (WebCore::GLContextGLX::swapInterval): Ditto.
450         (WebCore::GLContextGLX::cairoDevice): Ditto.
451         * platform/graphics/glx/GLContextGLX.h:
452         * platform/graphics/x11/PlatformDisplayX11.cpp:
453         (WebCore::PlatformDisplayX11::~PlatformDisplayX11): Delete the sharing GL context before closing the display.
454
455 2016-09-12  Chris Dumez  <cdumez@apple.com>
456
457         Fix post-landing review comments after r205787
458         https://bugs.webkit.org/show_bug.cgi?id=161885
459
460         Reviewed by Darin Adler.
461
462         Leverage new StringBuilder::append(CFStringRef) overload.
463
464         * html/parser/HTMLParserIdioms.cpp:
465         (WebCore::parseHTTPRefreshInternal):
466         * page/CaptionUserPreferencesMediaAF.cpp:
467         (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):
468         (WebCore::buildDisplayStringForTrackBase):
469         * platform/network/mac/CookieJarMac.mm:
470         (WebCore::cookiesForSession):
471         * rendering/RenderThemeIOS.mm:
472         (WebCore::RenderThemeIOS::mediaControlsStyleSheet):
473         (WebCore::RenderThemeIOS::mediaControlsScript):
474         * rendering/RenderThemeMac.mm:
475         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
476         (WebCore::RenderThemeMac::mediaControlsScript):
477
478 2016-09-12  Alex Christensen  <achristensen@webkit.org>
479
480         URLParser: Correctly ignore spaces before relative URLs with no scheme
481         https://bugs.webkit.org/show_bug.cgi?id=161889
482
483         Reviewed by Daniel Bates.
484
485         Covered by new API tests.
486
487         * platform/URLParser.cpp:
488         (WebCore::URLParser::parse):
489
490 2016-09-12  Nan Wang  <n_wang@apple.com>
491
492         AX: Crash at WebCore::Range::compareBoundaryPoints(WebCore::Range::CompareHow, WebCore::Range const&, int&) const + 23
493         https://bugs.webkit.org/show_bug.cgi?id=161878
494
495         Reviewed by Chris Fleizach.
496
497         In function characterOffsetsInOrder(const CharacterOffset&, const CharacterOffset&), we are creating two
498         ranges based on the nodes that are associated to the passed in CharacterOffsets. When the first node is a doctype
499         node, the first range will be a nullptr, and dereferencing it leads to a crash. Fixed this by adding a 
500         NULL check.
501
502         Test: accessibility/mac/doctype-node-in-text-marker-crash.html
503
504         * accessibility/AXObjectCache.cpp:
505         (WebCore::characterOffsetsInOrder):
506         (WebCore::resetNodeAndOffsetForReplacedNode):
507
508 2016-09-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
509
510         Move the pixel data of ImageFrame to a separate class named ImageBackingStore
511         https://bugs.webkit.org/show_bug.cgi?id=159679
512
513         Reviewed by Simon Fraser.
514
515         Move the pixel data manipulation part in ImageFrame into a separate class
516         and allocate it on demand.
517
518         * PlatformEfl.cmake:
519         * PlatformGTK.cmake:
520         * PlatformWinCairo.cmake:
521         * WebCore.xcodeproj/project.pbxproj:
522         Add ImageBackingStoreCairo.cpp and remove ImageDecoderCairo.cpp from the
523         WebKit projects.
524
525         * platform/graphics/Color.cpp:
526         (WebCore::premultipliedChannel): channel = channel * alpha / 255.
527         (WebCore::unpremultipliedChannel): channel = channel * 255 / alpha.
528         (WebCore::makePremultipliedRGBA): Un-premultiplied channels to premultiplied RGBA32.
529         (WebCore::makeUnPremultipliedRGBA): Premultiplied channels to un-premultiplied RGBA32.
530         (WebCore::colorFromPremultipliedARGB): Use makeUnPremultipliedRGBA.
531         (WebCore::premultipliedARGBFromColor): Use makePremultipliedRGBA.
532         * platform/graphics/Color.h:
533         (WebCore::fastMultiplyBy255): x * 255 = x * 256 - x = x << 8 - x.
534
535         * platform/graphics/ImageBackingStore.h: Added.
536         (WebCore::ImageBackingStore::create): Creates a new ImageBackingStore.
537         (WebCore::ImageBackingStore::setSize): Changes the pixels size.
538         (WebCore::ImageBackingStore::setFrameRect): This will always just be the entire buffer except for GIF and PNG frames.
539         (WebCore::ImageBackingStore::size): Returns the pixels size.
540         (WebCore::ImageBackingStore::frameRect): Returns the pixels frame rectangle.
541         (WebCore::ImageBackingStore::clear): Clears the entire image.
542         (WebCore::ImageBackingStore::clearRect): Clears a rectangle in the image.
543         (WebCore::ImageBackingStore::repeatFirstRow): Repeats the first row in a rectangle in the image.
544         (WebCore::ImageBackingStore::pixelAt): Returns a pointer to a pixel data.
545         (WebCore::ImageBackingStore::setPixel): Sets the color of a pixel in the image.
546         (WebCore::ImageBackingStore::blendPixel): Blend a color with a pixel in the image.
547         (WebCore::ImageBackingStore::inBounds): Checks if a rectangle is in the bounds of the image.
548         (WebCore::ImageBackingStore::isOverSize): Checks whether a size could not be allocated for an image.
549         (WebCore::ImageBackingStore::ImageBackingStore):
550
551         * platform/graphics/cg/NativeImageCG.cpp:
552         (WebCore::nativeImageHasAlpha): Implement this function. See comments in https://bugs.webkit.org/show_bug.cgi?id=158684.
553
554         * platform/image-decoders/ImageDecoder.cpp:
555         (WebCore::ImageFrame::operator=): copyBitmapData() now copies the frameRect of the ImageBackingStore.
556         (WebCore::ImageFrame::clearPixelData): The pixels data and the pointer to these pixels are now included in the ImageBackingStore.
557         (WebCore::ImageFrame::zeroFillPixelData): Clearing the image pixels are now in ImageBackingStore::clear().
558         (WebCore::ImageFrame::zeroFillFrameRect): Clearing the image pixels are now in ImageBackingStore::clearRect().
559         (WebCore::ImageFrame::copyBitmapData): We either need to create a new ImageBackingStore or nullify the current one.
560         (WebCore::ImageFrame::setSize): ImageFrame::setSize() is supposed to be called once and to create the ImageBackingStore.
561         (WebCore::ImageFrame::setOriginalFrameRect): Delegate this call to ImageBackingStore::setFrameRect().
562         (WebCore::ImageDecoder::frameBytesAtIndex): ImageFrame::PixelData can be replaced by RGBA32.
563
564         * platform/image-decoders/ImageDecoder.h:
565         (WebCore::ImageFrame::copyRowNTimes): The implementation was moved to ImageBackingStore::repeatFirstRow().
566         (WebCore::ImageFrame::size): Gets the size of an image from its ImageBackingStore.
567         (WebCore::ImageFrame::asNewNativeImage): Gets a NtaiveImagePtr from the ImageBackingStore.
568         (WebCore::ImageFrame::backingStore): Returns a raw pointer to the ImageBackingStore.
569         (WebCore::ImageFrame::hasBackingStore): Returns whether the ImageFrame has an ImageBackingStore.
570         (WebCore::ImageFrame::originalFrameRect): Returns the frameRect of the image from its ImageBackingStore.
571         (WebCore::ImageFrame::pixelAt): Delegates the call to the ImageBackingStore.
572         (WebCore::ImageFrame::setPixel): Delegates the call to the ImageBackingStore.
573         (WebCore::ImageFrame::blendPixel): Delegates the call to the ImageBackingStore.
574         
575         (WebCore::ImageDecoder::setSize): setSize() now takes an IntSize.
576         (WebCore::ImageFrame::setOriginalFrameRect): Deleted. Moved to ImageDecoder.cpp.
577         (WebCore::ImageFrame::setRGBA): Deleted. Renamed to ImageFrame::setPixel().
578         (WebCore::ImageFrame::getAddr): Deleted. Renamed to ImageFrame::pixelAt().
579         (WebCore::ImageFrame::hasPixelData): Deleted. Renamed to ImageFrame::hasBackingStore().
580         (WebCore::ImageFrame::fixPointUnsignedMultiply): Deleted.
581         (WebCore::ImageFrame::divide255): Deleted. Replaced by fastDivideBy255() from Color.h.
582         (WebCore::ImageFrame::overRGBA): Deleted. Renamed to ImageFrame::blendPixel().
583         (WebCore::ImageFrame::width): Deleted.
584         (WebCore::ImageFrame::height): Deleted.
585         (WebCore::ImageDecoder::isOverSize): Deleted. Moved to ImageBackingStore::isOverSize().
586
587         * platform/image-decoders/bmp/BMPImageReader.cpp:
588         (WebCore::BMPImageReader::decodeBMP):
589         (WebCore::BMPImageReader::processInfoHeader):
590         (WebCore::BMPImageReader::processNonRLEData):
591         * platform/image-decoders/bmp/BMPImageReader.h:
592         (WebCore::BMPImageReader::setI):
593         (WebCore::BMPImageReader::setPixel):
594         (WebCore::BMPImageReader::fillRGBA):
595         (WebCore::BMPImageReader::setRGBA): Deleted.
596         * platform/image-decoders/cairo/ImageBackingStoreCairo.cpp: Added.
597         (WebCore::ImageBackingStore::image):
598         * platform/image-decoders/cairo/ImageDecoderCairo.cpp: Removed.
599         * platform/image-decoders/gif/GIFImageDecoder.cpp:
600         (WebCore::GIFImageDecoder::setSize):
601         (WebCore::GIFImageDecoder::haveDecodedRow):
602         (WebCore::GIFImageDecoder::initFrameBuffer):
603         * platform/image-decoders/gif/GIFImageDecoder.h:
604         * platform/image-decoders/gif/GIFImageReader.cpp:
605         (GIFImageReader::parse):
606         * platform/image-decoders/ico/ICOImageDecoder.cpp:
607         (WebCore::ICOImageDecoder::setSize):
608         (WebCore::ICOImageDecoder::processDirectoryEntries):
609         * platform/image-decoders/ico/ICOImageDecoder.h:
610         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
611         (WebCore::JPEGImageReader::decode):
612         (WebCore::JPEGImageDecoder::setSize):
613         (WebCore::setPixel):
614         (WebCore::JPEGImageDecoder::outputScanlines):
615         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
616         * platform/image-decoders/png/PNGImageDecoder.cpp:
617         (WebCore::PNGImageDecoder::setSize):
618         (WebCore::PNGImageDecoder::headerAvailable):
619         (WebCore::setPixelRGB):
620         (WebCore::setPixelRGBA):
621         (WebCore::setPixelPremultipliedRGBA):
622         (WebCore::PNGImageDecoder::rowAvailable):
623         (WebCore::PNGImageDecoder::initFrameBuffer):
624         (WebCore::PNGImageDecoder::frameComplete):
625         * platform/image-decoders/png/PNGImageDecoder.h:
626         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
627         (WebCore::WEBPImageDecoder::decode):
628         - Send an IntSize to ImageFrame::setSize() and ImageDecoder::setSize().
629         - Replace ImageFrame::PixelData by RGBA32.
630         - No need to call ImageFrame::setOriginalFrameRect() if this sets the
631           frameRect to the entire image rectangle since this is done by default
632           in ImageBackingStore::setSize().
633         - ImageBackingStore::image() now replaces ImageFrame::asNewNativeImage().
634         - ImageFrame::setPixel() now replaces ImageFrame::setRGBA().
635         - ImageFrame::blendPixel() now replaces ImageFrame::overRGBA().
636         - ImageFrame::pixelAt() now replaces ImageFrame::getAddr().
637
638 2016-09-12  Joseph Pecoraro  <pecoraro@apple.com>
639
640         HTMLButtonElement.prototype.click should be HTMLElement.prototype.click
641         https://bugs.webkit.org/show_bug.cgi?id=161874
642
643         Reviewed by Chris Dumez.
644
645         Test: fast/dom/HTMLButtonElement/click.html
646
647         * html/HTMLButtonElement.idl:
648         Remove the unnecessary 'click' definition. It already exists in HTMLElement.
649         If this was needed for ObjC code generation on DOMHTMLButtonElement, then
650         the extra definition is no longer needed now that ObjC bindings have moved.
651
652 2016-09-12  Alex Christensen  <achristensen@webkit.org>
653
654         URLParser: Fix relative URLs containing only fragments
655         https://bugs.webkit.org/show_bug.cgi?id=161882
656
657         Reviewed by Brady Eidson.
658
659         Covered by new API tests.
660
661         * platform/URLParser.cpp:
662         (WebCore::URLParser::parse):
663
664 2016-09-12  Alex Christensen  <achristensen@webkit.org>
665
666         URLParser: Correctly handle relative URLs that are just a scheme and a colon
667         https://bugs.webkit.org/show_bug.cgi?id=161876
668
669         Reviewed by Brady Eidson.
670
671         Covered by new API tests.
672
673         * platform/URLParser.cpp:
674         (WebCore::URLParser::parse):
675
676 2016-09-12  Dean Jackson  <dino@apple.com>
677
678         Remove OptionalColor
679         https://bugs.webkit.org/show_bug.cgi?id=161853
680         <rdar://problem/28252385>
681
682         Reviewed by Alex Christensen.
683
684         OptionalColor isn't used. The concept will be implemented
685         in a different manner.
686
687         * platform/graphics/Color.h:
688
689 2016-09-12  Simon Fraser  <simon.fraser@apple.com>
690
691         Add Intersection Observer to the features.json file.
692
693         * features.json:
694
695 2016-09-12  Myles C. Maxfield  <mmaxfield@apple.com>
696
697         [Cocoa] Reduce uses of CGFonts in favor of CTFonts
698         https://bugs.webkit.org/show_bug.cgi?id=161809
699
700         Reviewed by Daniel Bates.
701
702         Eventually, we want to remove the cgFont() member of PlatformFontData for both memory
703         savings and conceptual clarity. Because there is no performance loss from moving from
704         CGFontGetGlyphsForUnichars() to CTFontGetGlyphsForCharacters(), making this switch
705         gets us closer to reducing the uses of cgFont().
706
707         No new tests because there is no behavior change.
708
709         * platform/graphics/Font.cpp:
710         (WebCore::createAndFillGlyphPage):
711         * platform/graphics/GlyphPage.h:
712         (WebCore::GlyphData::GlyphData):
713         * platform/graphics/mac/GlyphPageMac.cpp:
714         (WebCore::shouldFillWithVerticalGlyphs):
715         (WebCore::GlyphPage::fill):
716         (WebCore::shouldUseCoreText): Deleted.
717
718 2016-09-12  Alex Christensen  <achristensen@webkit.org>
719
720         Remove trailing control characters and spaces before parsing a URL
721         https://bugs.webkit.org/show_bug.cgi?id=161870
722
723         Reviewed by Tim Horton.
724
725         Covered by new API tests.
726
727         * platform/URLParser.cpp:
728         (WebCore::bufferView):
729         (WebCore::URLParser::parse):
730
731 2016-09-12  Chris Dumez  <cdumez@apple.com>
732
733         window.performance object resets script-applied properties
734         https://bugs.webkit.org/show_bug.cgi?id=137407
735
736         Reviewed by Darin Adler.
737
738         Make sure the window.performance wrapper stays alive for as long as the
739         associated frame, similarly to what we do for window.screen.
740
741         Test: fast/performance/performance-object-gc.html
742
743         * page/Performance.idl:
744
745 2016-09-12  Saam Barati  <sbarati@apple.com>
746
747         Add WebKit support for an option in Safari's debug menu similar to "Get Bytecode Profile" but for the Sampling Profiler's data
748         https://bugs.webkit.org/show_bug.cgi?id=161785
749
750         Reviewed by Tim Horton.
751
752         * ForwardingHeaders/runtime/SamplingProfiler.h: Added.
753
754 2016-09-12  Dave Hyatt  <hyatt@apple.com>
755
756         [CSS Parser] Add support for the parsing of the HTML sizes attribute
757         https://bugs.webkit.org/show_bug.cgi?id=161868
758
759         Reviewed by Dean Jackson.
760
761         This patch adds the parsers for the sizes attribute. This code is heavily modified
762         from Blink, and it really only makes use of the tokenization/parsing code. What is done
763         with the results involves the same original code that we used over in SourceSizeList.cpp.
764
765         * CMakeLists.txt:
766         * WebCore.xcodeproj/project.pbxproj:
767         * css/parser/SizesAttributeParser.cpp: Added.
768         (WebCore::SizesAttributeParser::computeLength):
769         (WebCore::SizesAttributeParser::SizesAttributeParser):
770         (WebCore::SizesAttributeParser::length):
771         (WebCore::SizesAttributeParser::calculateLengthInPixels):
772         (WebCore::SizesAttributeParser::mediaConditionMatches):
773         (WebCore::SizesAttributeParser::parse):
774         (WebCore::SizesAttributeParser::effectiveSize):
775         (WebCore::SizesAttributeParser::effectiveSizeDefaultValue):
776         * css/parser/SizesAttributeParser.h: Added.
777         * css/parser/SizesCalcParser.cpp: Added.
778         (WebCore::SizesCalcParser::SizesCalcParser):
779         (WebCore::SizesCalcParser::result):
780         (WebCore::operatorPriority):
781         (WebCore::SizesCalcParser::handleOperator):
782         (WebCore::SizesCalcParser::appendNumber):
783         (WebCore::SizesCalcParser::appendLength):
784         (WebCore::SizesCalcParser::appendOperator):
785         (WebCore::SizesCalcParser::calcToReversePolishNotation):
786         (WebCore::operateOnStack):
787         (WebCore::SizesCalcParser::calculate):
788         * css/parser/SizesCalcParser.h: Added.
789         (WebCore::SizesCalcValue::SizesCalcValue):
790         (WebCore::SizesCalcParser::isValid):
791
792 2016-09-12  Jer Noble  <jer.noble@apple.com>
793
794         Fix failing mediasource-play.html and mediasource-config-change-mp4-v-bitrate.html tests
795         https://bugs.webkit.org/show_bug.cgi?id=161819
796
797         Reviewed by Eric Carlson.
798
799         Fixes tests: imported/w3c/web-platform-tests/media-source/mediasource-play.html
800                      imported/w3c/web-platform-tests/media-source/mediasource-sourcebuffer-mode.html
801
802         The newest revision of the web-platform-test suite for Media Source tests new behavior
803         added to the MSE specification. Specifically, setting a MediaSource's duration will no
804         longer implicitly truncate the source's active SourceBuffer objects.
805
806         * Modules/mediasource/MediaSource.cpp:
807         (WebCore::MediaSource::setDuration): Return exception if issued by setDurationInternal.
808         (WebCore::MediaSource::setDurationInternal): Bring "duration change" algorithm up to spec.
809         * Modules/mediasource/MediaSource.h:
810         * Modules/mediasource/SampleMap.h:
811         (WebCore::PresentationOrderSampleMap::begin): Add const accessor.
812         (WebCore::PresentationOrderSampleMap::end): Ditto.
813         (WebCore::PresentationOrderSampleMap::rbegin): Ditto.
814         (WebCore::PresentationOrderSampleMap::rend): DItto.
815         (WebCore::DecodeOrderSampleMap::begin): Ditto.
816         (WebCore::DecodeOrderSampleMap::end): Ditto.
817         (WebCore::DecodeOrderSampleMap::rbegin): Ditto.
818         (WebCore::DecodeOrderSampleMap::rend): Ditto.
819         * Modules/mediasource/SourceBuffer.cpp:
820         (WebCore::SourceBuffer::highestPresentationTimestamp): Added convenience method.
821         (WebCore::SourceBuffer::removeCodedFrames): Drive-by fix; use .values() rather than
822             pulling the value out of each HashMap iterator.
823         * Modules/mediasource/SourceBuffer.h:
824
825 2016-09-12  Chris Dumez  <cdumez@apple.com>
826
827         Switch remaining users of Document::inPageCache() to pageCacheState()
828         https://bugs.webkit.org/show_bug.cgi?id=161865
829
830         Reviewed by Darin Adler.
831
832         Switch remaining users of Document::inPageCache() to pageCacheState() as
833         the former one is confusing (given that it returns true while the
834         pagehide event is being fired).
835
836         * dom/Document.cpp:
837         (WebCore::Document::scheduleStyleRecalc):
838         (WebCore::Document::fontsNeedUpdate):
839         (WebCore::Document::removeFocusedNodeOfSubtree):
840         (WebCore::Document::setFocusedElement):
841         (WebCore::Document::takeDOMWindowFrom):
842         (WebCore::Document::topDocument):
843         (WebCore::Document::webkitWillEnterFullScreenForElement):
844         (WebCore::Document::webkitDidEnterFullScreenForElement):
845         (WebCore::Document::webkitWillExitFullScreenForElement):
846         (WebCore::Document::webkitDidExitFullScreenForElement):
847         * dom/Document.h:
848         (WebCore::Document::needsStyleRecalc):
849         (WebCore::Document::inPageCache): Deleted.
850         * history/CachedFrame.cpp:
851         (WebCore::CachedFrame::CachedFrame):
852         (WebCore::CachedFrame::clear):
853         (WebCore::CachedFrame::destroy):
854         * html/HTMLMediaElement.cpp:
855         (WebCore::mediaElementIsAllowedToAutoplay):
856         * html/HTMLPlugInImageElement.cpp:
857         (WebCore::HTMLPlugInImageElement::createElementRenderer):
858         * loader/DocumentLoader.cpp:
859         (WebCore::DocumentLoader::addSubresourceLoader):
860         * loader/HistoryController.cpp:
861         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
862         * page/DOMWindow.cpp:
863         (WebCore::DOMWindow::decrementScrollEventListenersCount):
864         * page/FrameView.cpp:
865         (WebCore::FrameView::layout):
866         * page/animation/AnimationBase.cpp:
867         (WebCore::AnimationBase::setNeedsStyleRecalc):
868         * page/animation/AnimationController.cpp:
869         (WebCore::AnimationControllerPrivate::updateAnimations):
870         (WebCore::AnimationControllerPrivate::addElementChangeToDispatch):
871         (WebCore::AnimationController::cancelAnimations):
872         (WebCore::AnimationController::updateAnimations):
873         * page/animation/ImplicitAnimation.cpp:
874         (WebCore::ImplicitAnimation::sendTransitionEvent):
875         * page/animation/KeyframeAnimation.cpp:
876         (WebCore::KeyframeAnimation::sendAnimationEvent):
877         * page/scrolling/AsyncScrollingCoordinator.cpp:
878         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
879         * rendering/RenderElement.cpp:
880         (WebCore::shouldRepaintForImageAnimation):
881         (WebCore::RenderElement::newImageAnimationFrameAvailable):
882         * rendering/RenderImage.cpp:
883         (WebCore::RenderImage::imageChanged):
884         * rendering/RenderLayerCompositor.cpp:
885         (WebCore::RenderLayerCompositor::updateCompositingLayers):
886         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
887         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
888         * rendering/RenderObject.cpp:
889         (WebCore::printRenderTreeForLiveDocuments):
890         (WebCore::printLayerTreeForLiveDocuments):
891         * rendering/RenderView.cpp:
892         (WebCore::RenderView::lazyRepaintTimerFired):
893         * rendering/SimpleLineLayout.cpp:
894         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
895
896 2016-09-12  Keith Rollin  <krollin@apple.com>
897
898         Enhance Network logging
899         https://bugs.webkit.org/show_bug.cgi?id=161771
900
901         Reviewed by Antti Koivisto.
902
903         Modify current logging statements to follow a consistent pattern in
904         order to enhance readability and parsing.
905
906         No new tests -- there are no tests for logging.
907
908         * loader/FrameLoader.cpp:
909         (WebCore::FrameLoader::prepareForLoadStart):
910         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
911
912 2016-09-12  Brady Eidson  <beidson@apple.com>
913
914         Crash in com.apple.WebCore: WebCore::NavigatorGamepad::gamepadFromPlatformGamepad.
915         <rdar://problem/28018073> and https://bugs.webkit.org/show_bug.cgi?id=161694
916
917         Reviewed by Alex Christensen.
918
919         No new tests (Caught by existing tests in some configurations).
920
921         * Modules/gamepad/GamepadManager.cpp:
922         (WebCore::GamepadManager::platformGamepadInputActivity): Null check.
923
924 2016-09-12  Alex Christensen  <achristensen@webkit.org>
925
926         Fix more URLParser quirks
927         https://bugs.webkit.org/show_bug.cgi?id=161834
928
929         Reviewed by Brady Eidson.
930
931         Added new API tests.
932
933         * platform/URLParser.cpp:
934         (WebCore::URLParser::parse):
935         Skip some tabs and newlines.  The spec says to remove them before processing the String,
936         but to reduce allocations I am skipping them whenever we increment an iterator.
937         Fix a few other quirks to be more web platform conformant.
938
939 2016-09-09  Alex Christensen  <achristensen@webkit.org>
940
941         Optimize URLParser performance
942         https://bugs.webkit.org/show_bug.cgi?id=161837
943
944         Reviewed by Brady Eidson.
945
946         No change in behavior.  Existing behavior covered by API tests and added a new API test.
947
948         * platform/URLParser.cpp:
949         (WebCore::isDefaultPort):
950         Use switch statements instead of HashMap lookups.
951         (WebCore::isSpecialScheme):
952         Use switch statements instead of repeated String comparisons.
953         (WebCore::URLParser::parsePort):
954         Reduce String allocation.
955
956 2016-09-12  Simon Fraser  <simon.fraser@apple.com>
957
958         Make -webkit-transition-* and -webkit-animation-* properties be pure aliases of the unprefixed ones
959         https://bugs.webkit.org/show_bug.cgi?id=160478
960
961         Reviewed by Dean Jackson.
962         
963         Remove the custom -webkit prefixed transition and animation properties, and just make
964         them aliases of the unprefixed ones, as we do for transforms.
965         
966         -webkit-animation-trigger remains as the only prefixed-only animation property.
967         
968         This is mostly code deletion.
969
970         Test: fast/css/longhand-overrides-shorthand-prefixing.html
971
972         * css/CSSComputedStyleDeclaration.cpp:
973         (WebCore::ComputedStyleExtractor::propertyValue):
974         * css/CSSProperty.h:
975         (WebCore::prefixingVariantForPropertyId): Deleted.
976         * css/CSSPropertyNames.in:
977         * css/CSSToStyleMap.cpp:
978         (WebCore::CSSToStyleMap::mapAnimationDelay):
979         (WebCore::CSSToStyleMap::mapAnimationDirection):
980         (WebCore::CSSToStyleMap::mapAnimationDuration):
981         (WebCore::CSSToStyleMap::mapAnimationFillMode):
982         (WebCore::CSSToStyleMap::mapAnimationIterationCount):
983         (WebCore::CSSToStyleMap::mapAnimationName):
984         (WebCore::CSSToStyleMap::mapAnimationPlayState):
985         (WebCore::CSSToStyleMap::mapAnimationProperty):
986         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
987         * css/PropertySetCSSStyleDeclaration.cpp:
988         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
989         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
990         * css/StyleProperties.cpp:
991         (WebCore::StyleProperties::getPropertyValue):
992         (WebCore::MutableStyleProperties::removeShorthandProperty):
993         (WebCore::StyleProperties::asText):
994         * css/StylePropertyShorthand.cpp:
995         (WebCore::animationShorthandForParsing):
996         * css/StylePropertyShorthand.h:
997         * css/StyleResolver.cpp:
998         (WebCore::StyleResolver::styleForKeyframe):
999         * css/parser/CSSParser.cpp:
1000         (WebCore::CSSParser::parseValue):
1001         (WebCore::CSSParser::parseAnimationShorthand):
1002         (WebCore::CSSParser::parseTransitionShorthand):
1003         (WebCore::CSSParser::parseAnimationProperty):
1004         (WebCore::CSSParser::addPropertyWithPrefixingVariant): Deleted.
1005         * css/parser/CSSParser.h:
1006         * html/shadow/MediaControlElements.cpp:
1007         (WebCore::MediaControlPanelElement::makeOpaque):
1008         (WebCore::MediaControlPanelElement::makeTransparent):
1009
1010 2016-09-12  Per Arne Vollan  <pvollan@apple.com>
1011
1012         Unreviewed build fix after r205090.
1013
1014         * platform/cf/MediaAccessibilitySoftLink.cpp:
1015
1016 2016-09-12  Javier Fernandez  <jfernandez@igalia.com>
1017
1018         [css-align] Initial values are parsed as invalid for some Alignment properties
1019         https://bugs.webkit.org/show_bug.cgi?id=161303
1020
1021         Reviewed by Darin Adler.
1022
1023         Due to the implementation of the new CSS Box Alignment specification,
1024         some properties have now new values allowed, which are not valid
1025         according to the Flexible Box Layout specification.
1026
1027         In r205102 we have get back the keywordID parsing, originally implemented for
1028         the Flexbible Box Layout specification. Even though the new valued would be
1029         parsed as invalid when they are set, the 'initial' values will be assigned
1030         in any case.
1031
1032         This patch verifies that the 'initial' values depend on whether the Grid
1033         Layout is enabled or not and verifying such values are parsed as valid.
1034
1035         Additionally, it gets back as well they keywordID parsing for the Content
1036         Alignment properties (align-content and justify-content). This required to
1037         touch a bit the StyleBuilderConverter logic, since we will have to deal with
1038         either the complex CSSContentDistributionValue complex or the  simpler
1039         CSSPrimitiveValue.
1040
1041         Test: fast/css/ensure-flexbox-compatibility-with-initial-values.html
1042
1043         * css/StyleBuilderConverter.h:
1044         (WebCore::StyleBuilderConverter::convertContentAlignmentData): Handling a primitive value if Grid Layout is not enabled.
1045         * css/parser/CSSParser.cpp:
1046         (WebCore::isValidKeywordPropertyAndValue): Simpler parsing of alignment properties if Grid Layout is not enabled.
1047         (WebCore::isKeywordPropertyID): Alignment properties are defined as keyword if Grid Layout is no enabled.
1048         (WebCore::CSSParser::parseValue): Assert Grid Layout is enabled when using the complex parsing.
1049         * rendering/style/RenderStyle.cpp:
1050         (WebCore::RenderStyle::isCSSGridLayoutEnabled): Checking out the Grid Layout runtime flags.
1051         * rendering/style/RenderStyle.h:
1052         (WebCore::RenderStyle::initialDefaultAlignment): Initial value will depend on whether Grid Layout is enabled or not.
1053         (WebCore::RenderStyle::initialContentAlignment): Initial value will depend on whether Grid Layout is enabled or not.
1054
1055 2016-09-12  Chris Dumez  <cdumez@apple.com>
1056
1057         ol.start may return incorrect value for reversed lists when not explicitly set
1058         https://bugs.webkit.org/show_bug.cgi?id=161713
1059
1060         Reviewed by Ryosuke Niwa.
1061
1062         Fix style nit after r205689.
1063
1064         * html/HTMLOListElement.cpp:
1065         (WebCore::HTMLOListElement::itemCount):
1066         (WebCore::HTMLOListElement::itemCountAfterLayout):
1067         * html/HTMLOListElement.h:
1068
1069 2016-09-12  Chris Dumez  <cdumez@apple.com>
1070
1071         Start using Document::pageCacheState() instead of Document::inPageCache()
1072         https://bugs.webkit.org/show_bug.cgi?id=161851
1073
1074         Reviewed by Ryosuke Niwa.
1075
1076         Start using Document::pageCacheState() instead of Document::inPageCache()
1077         as the latter one is confusing (given that it is true when firing the
1078         pagehide event, when the document is about to enter page cache).
1079
1080         * loader/FrameLoader.cpp:
1081         (WebCore::FrameLoader::closeURL):
1082         (WebCore::FrameLoader::clear):
1083         (WebCore::FrameLoader::dispatchUnloadEvents):
1084         * loader/cache/CachedResource.cpp:
1085         (WebCore::CachedResource::load):
1086         * page/Page.cpp:
1087         (WebCore::incrementFrame): Deleted.
1088         * page/Page.h:
1089
1090 2016-09-11  Chris Dumez  <cdumez@apple.com>
1091
1092         HTMLTrackElement.kind's invalid value default should be the metadata state
1093         https://bugs.webkit.org/show_bug.cgi?id=161840
1094
1095         Reviewed by Eric Carlson.
1096
1097         HTMLTrackElement.kind's invalid value default should be the metadata state,
1098         not the subtitles state:
1099         - https://html.spec.whatwg.org/#attr-track-kind
1100
1101         Chrome agrees with the specification.
1102
1103         No new tests, rebaselined existing tests.
1104
1105         * html/track/TextTrack.cpp:
1106         (WebCore::TextTrack::setKindKeywordIgnoringASCIICase):
1107
1108 2016-09-11  Dave Hyatt  <hyatt@apple.com>
1109
1110         [CSS Parser] Add the main parser implementation
1111         https://bugs.webkit.org/show_bug.cgi?id=161813
1112
1113         Reviewed by Dean Jackson.
1114
1115         This patch adds the main CSSParserImpl that handles stylesheet and rule parsing. All parsing starts with this
1116         class (it will eventually be invoked from the CSSParser). This patch also adds @supports parsing.
1117
1118         * WebCore.xcodeproj/project.pbxproj:
1119         * css/CSSKeyframeRule.cpp:
1120         (WebCore::StyleKeyframe::StyleKeyframe):
1121         * css/CSSKeyframeRule.h:
1122         * css/StyleRule.cpp:
1123         (WebCore::StyleRuleBase::destroy):
1124         (WebCore::StyleRuleBase::copy):
1125         (WebCore::StyleRuleBase::createCSSOMWrapper):
1126         (WebCore::StyleRuleCharset::StyleRuleCharset):
1127         (WebCore::StyleRuleCharset::~StyleRuleCharset):
1128         (WebCore::StyleRuleNamespace::StyleRuleNamespace):
1129         (WebCore::StyleRuleNamespace::~StyleRuleNamespace):
1130         * css/StyleRule.h:
1131         (WebCore::StyleRuleBase::isNamespaceRule):
1132         (isType):
1133         (WebCore::StyleRuleBase::isKeyframesRule): Deleted.
1134         * css/StyleSheetContents.cpp:
1135         (WebCore::traverseSubresourcesInRules):
1136         * css/parser/CSSParserImpl.cpp: Added.
1137         (WebCore::CSSParserImpl::CSSParserImpl):
1138         (WebCore::CSSParserImpl::parseValue):
1139         (WebCore::CSSParserImpl::parseVariableValue):
1140         (WebCore::filterProperties):
1141         (WebCore::createStyleProperties):
1142         (WebCore::CSSParserImpl::parseInlineStyleDeclaration):
1143         (WebCore::CSSParserImpl::parseDeclarationList):
1144         (WebCore::CSSParserImpl::parseRule):
1145         (WebCore::CSSParserImpl::parseStyleSheet):
1146         (WebCore::CSSParserImpl::parsePageSelector):
1147         (WebCore::CSSParserImpl::parseCustomPropertySet):
1148         (WebCore::CSSParserImpl::parseKeyframeKeyList):
1149         (WebCore::CSSParserImpl::supportsDeclaration):
1150         (WebCore::CSSParserImpl::parseDeclarationListForInspector):
1151         (WebCore::CSSParserImpl::parseStyleSheetForInspector):
1152         (WebCore::computeNewAllowedRules):
1153         (WebCore::CSSParserImpl::consumeRuleList):
1154         (WebCore::CSSParserImpl::consumeAtRule):
1155         (WebCore::CSSParserImpl::consumeQualifiedRule):
1156         (WebCore::consumeStringOrURI):
1157         (WebCore::CSSParserImpl::consumeCharsetRule):
1158         (WebCore::CSSParserImpl::consumeImportRule):
1159         (WebCore::CSSParserImpl::consumeNamespaceRule):
1160         (WebCore::CSSParserImpl::consumeMediaRule):
1161         (WebCore::CSSParserImpl::consumeSupportsRule):
1162         (WebCore::CSSParserImpl::consumeViewportRule):
1163         (WebCore::CSSParserImpl::consumeFontFaceRule):
1164         (WebCore::CSSParserImpl::consumeKeyframesRule):
1165         (WebCore::CSSParserImpl::consumePageRule):
1166         (WebCore::CSSParserImpl::consumeKeyframeStyleRule):
1167         (WebCore::observeSelectors):
1168         (WebCore::CSSParserImpl::consumeStyleRule):
1169         (WebCore::CSSParserImpl::consumeDeclarationList):
1170         (WebCore::CSSParserImpl::consumeDeclaration):
1171         (WebCore::CSSParserImpl::consumeVariableValue):
1172         (WebCore::CSSParserImpl::consumeDeclarationValue):
1173         (WebCore::CSSParserImpl::consumeKeyframeKeyList):
1174         * css/parser/CSSParserImpl.h: Added.
1175         * css/parser/CSSParserValues.cpp:
1176         (WebCore::CSSParserSelector::parsePagePseudoSelector):
1177         * css/parser/CSSParserValues.h:
1178         * css/parser/CSSPropertyParser.cpp:
1179         (WebCore::CSSPropertyParser::parseValue):
1180         * css/parser/CSSSupportsParser.cpp: Added.
1181         (WebCore::CSSSupportsParser::supportsCondition):
1182         (WebCore::CSSSupportsParser::consumeCondition):
1183         (WebCore::CSSSupportsParser::consumeNegation):
1184         (WebCore::CSSSupportsParser::consumeConditionInParenthesis):
1185         * css/parser/CSSSupportsParser.h: Added.
1186         (WebCore::CSSSupportsParser::CSSSupportsParser):
1187
1188 2016-09-11  Tim Horton  <timothy_horton@apple.com>
1189
1190         Candidates that don't end in spaces shouldn't have spaces arbitrarily appended to them
1191         https://bugs.webkit.org/show_bug.cgi?id=161846
1192         <rdar://problem/28245097>
1193
1194         Reviewed by Beth Dakin.
1195
1196         Tests: editing/mac/spelling/accept-candidate-without-adding-space.html,
1197                editing/mac/spelling/accept-candidate-allows-autocorrect-on-next-word.html
1198
1199         * editing/Editor.cpp:
1200         (WebCore::Editor::handleAcceptedCandidate):
1201         Stop appending a space just because the candidate doesn't end in a space.
1202         There are languages where that doesn't make sense, and the platform
1203         guarantees that candidates will always have spaces if they need them.
1204
1205         Also, adjust the way we compute the AcceptedCandidate document marker range.
1206         There were two problems with the existing code: it expanded outward from
1207         the post-insertion cursor in *both* directions, instead of just backwards,
1208         and it used the length of the replaced text, not the length of the newly
1209         inserted text (more of the confusion mentioned in r205765).
1210
1211 2016-09-10  Chris Dumez  <cdumez@apple.com>
1212
1213         parseHTMLInteger() should take a StringView in parameter
1214         https://bugs.webkit.org/show_bug.cgi?id=161669
1215
1216         Reviewed by Ryosuke Niwa.
1217
1218         parseHTMLInteger() should take a StringView in parameter instead of a
1219         const String&.
1220
1221         * css/parser/CSSParser.cpp:
1222         (WebCore::CSSParser::parseFontFaceSrcLocal):
1223         * css/parser/CSSParserValues.h:
1224         (WebCore::CSSParserString::toStringView):
1225         Add toStringView() to avoid unnecessarily constructing a String for
1226         calling StringBuilder::append().
1227
1228         * html/parser/HTMLParserIdioms.cpp:
1229         (WebCore::parseHTMLInteger):
1230         (WebCore::parseHTMLNonNegativeInteger):
1231         (WebCore::parseHTTPRefreshInternal):
1232         * html/parser/HTMLParserIdioms.h:
1233         (WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
1234         (WebCore::limitToOnlyHTMLNonNegative):
1235         Take a StringView in parameter instead of a const String&.
1236
1237         * platform/sql/SQLiteStatement.cpp:
1238         (WebCore::SQLiteStatement::isColumnDeclaredAsBlob):
1239         Avoid unnecessarily constructing a String to call equalLettersIgnoringASCIICase()
1240         by leveraging the StringView constructor taking a 'const char*' in parameter.
1241
1242         * rendering/RenderBlock.cpp:
1243         (WebCore::RenderBlock::constructTextRun):
1244         * rendering/RenderBlock.h:
1245         Add constructTextRun() overload taking an AtomicString. It was otherwise ambiguous
1246         because both a String or a StringView could be constructed from an AtomicString.
1247
1248         * page/CaptionUserPreferencesMediaAF.cpp:
1249         (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):
1250         (WebCore::buildDisplayStringForTrackBase):
1251         * rendering/RenderThemeMac.mm:
1252         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
1253         (WebCore::RenderThemeMac::mediaControlsScript):
1254         Explicitly construct a String from NSString / CFStringRef types as such calls are
1255         now ambiguous.
1256
1257 2016-09-10  Chris Dumez  <cdumez@apple.com>
1258
1259         It is possible for Document::m_frame pointer to become stale
1260         https://bugs.webkit.org/show_bug.cgi?id=161812
1261         <rdar://problem/27745023>
1262
1263         Reviewed by Ryosuke Niwa.
1264
1265         Document::m_frame is supposed to get cleared by Document::prepareForDestruction().
1266         The Frame destructor calls Frame::setView(nullptr) which is supposed to call the
1267         prepareForDestruction() on the Frame's associated document. However,
1268         Frame::setView(nullptr) was calling prepareForDestruction() only if
1269         Document::inPageCache() returned true. This is because, we allow Documents to
1270         stay alive in the PageCache even though they don't have a frame.
1271
1272         The issue is that Document::m_inPageCache flag was set to true right before
1273         firing the pagehide event, so technically before really entering PageCache.
1274         Therefore, we can run into problems if a Frame gets destroyed by a pagehide
1275         EventHandler because ~Frame() will not call Document::prepareForDestruction()
1276         due to Document::m_inPageCache being true. After the frame is destroyed,
1277         Document::m_frame becomes stale and any action on the document will likely
1278         lead to crashes (such as the one in the layout test and the radar which
1279         happens when trying to unregister event listeners from the document).
1280
1281         The solution adopted in this patch is to replace the m_inPageCache boolean
1282         with a m_pageCacheState enumeration that has 3 states:
1283         - NotInPageCache
1284         - AboutToEnterPageCache
1285         - InPageCache
1286
1287         Frame::setView() / Frame::setDocument() were then updated to call
1288         Document::prepareForDestruction() on the associated document whenever
1289         the document's pageCacheState is not InPageCache. This means that we
1290         will now call Document::prepareForDestruction() when the document is
1291         being detached from its frame while firing the pagehide event.
1292
1293         Note that I tried to keep this patch minimal. Therefore, I kept
1294         the Document::inPageCache() getter for now. I plan to switch all its
1295         calls sites to the new Document::pageCacheState() getter in a follow-up
1296         patch so that we can finally drop the confusing Document::inPageCache().
1297
1298         Test: fast/history/pagehide-remove-iframe-crash.html
1299
1300         * dom/Document.cpp:
1301         (WebCore::Document::Document):
1302         (WebCore::Document::~Document):
1303         (WebCore::Document::createRenderTree):
1304         (WebCore::Document::destroyRenderTree):
1305         (WebCore::Document::setFocusedElement):
1306         (WebCore::Document::setPageCacheState):
1307         (WebCore::Document::topDocument):
1308         * dom/Document.h:
1309         (WebCore::Document::pageCacheState):
1310         (WebCore::Document::inPageCache):
1311         * history/CachedFrame.cpp:
1312         (WebCore::CachedFrame::destroy):
1313         * history/PageCache.cpp:
1314         (WebCore::setPageCacheState):
1315         (WebCore::PageCache::addIfCacheable):
1316         * loader/FrameLoader.cpp:
1317         (WebCore::FrameLoader::stopAllLoaders):
1318         (WebCore::FrameLoader::open):
1319         * loader/HistoryController.cpp:
1320         (WebCore::HistoryController::invalidateCurrentItemCachedPage):
1321         * page/Frame.cpp:
1322         (WebCore::Frame::setView):
1323
1324 2016-09-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1325
1326         Apple.com keynote does not display media controls
1327         https://bugs.webkit.org/show_bug.cgi?id=161833
1328         <rdar://problem/28230123>
1329
1330         Reviewed by Tim Horton.
1331
1332         Tweaks the main content check so that we can distinguish between main content for the purposes of determining
1333         autoplay policy vs. main content for the purposes of showing media controls. Namely, we make the latter less
1334         restrictive than the former in terms of the maximum aspect ratio a video can have to be considered the right
1335         size for main content.
1336
1337         New unit test in TestWebKitAPI.
1338
1339         * html/HTMLMediaElement.cpp:
1340         (WebCore::mediaElementSessionInfoForSession):
1341         * html/MediaElementSession.cpp:
1342         (WebCore::MediaElementSession::canShowControlsManager):
1343         (WebCore::MediaElementSession::isLargeEnoughForMainContent):
1344         (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForMediaControls):
1345         (WebCore::isMainContentForPurposesOfAutoplay):
1346         (WebCore::isElementLargeEnoughForMainContent):
1347         (WebCore::MediaElementSession::updateIsMainContent):
1348         (WebCore::isMainContent): Deleted.
1349         * html/MediaElementSession.h:
1350
1351 2016-09-09  Alex Christensen  <achristensen@webkit.org>
1352
1353         URLParser: Keep track of cannot-be-a-base-url according to spec
1354         https://bugs.webkit.org/show_bug.cgi?id=161830
1355
1356         Reviewed by Tim Horton.
1357
1358         Covered by new API tests.
1359
1360         * platform/URL.cpp:
1361         (WebCore::URL::invalidate):
1362         * platform/URL.h:
1363         Add a boolean required by the spec.
1364         This will not add to sizeof(URL) because we already have some bit fields.
1365         * platform/URLParser.cpp:
1366         (WebCore::URLParser::parse):
1367         (WebCore::URLParser::allValuesEqual):
1368
1369 2016-09-09  Commit Queue  <commit-queue@webkit.org>
1370
1371         Unreviewed, rolling out r205771.
1372         https://bugs.webkit.org/show_bug.cgi?id=161823
1373
1374         Broke Windows build (Requested by litherum on #webkit).
1375
1376         Reverted changeset:
1377
1378         "Remove unused member of GlyphBuffer"
1379         https://bugs.webkit.org/show_bug.cgi?id=161814
1380         http://trac.webkit.org/changeset/205771
1381
1382 2016-09-09  Alex Christensen  <achristensen@webkit.org>
1383
1384         URLParser should convert ASCII hosts to lowercase
1385         https://bugs.webkit.org/show_bug.cgi?id=161820
1386
1387         Reviewed by Geoffrey Garen.
1388
1389         Covered by new API tests.
1390
1391         * platform/URLParser.cpp:
1392         (WebCore::domainToASCII):
1393         The fast path for domains that are already ASCII and do not need punycode encoding
1394         should convert the domain to lowercase.
1395         This matches behavior in URL::parse if isCanonicalHostnameLowercaseForScheme is true,
1396         and RFC 5890.
1397
1398 2016-09-09  Myles C. Maxfield  <mmaxfield@apple.com>
1399
1400         Remove unused member of GlyphBuffer
1401         https://bugs.webkit.org/show_bug.cgi?id=161814
1402
1403         Reviewed by Simon Fraser.
1404
1405         This m_offsets member never actually affected anything. It just made
1406         FontCascade::drawGlyphBuffer() slower.
1407
1408         No new tests because there is no behavior change.
1409
1410         * platform/graphics/FontCascade.cpp:
1411         (WebCore::FontCascade::drawGlyphBuffer):
1412         * platform/graphics/GlyphBuffer.h:
1413         (WebCore::GlyphBuffer::clear):
1414         (WebCore::GlyphBuffer::advanceAt):
1415         (WebCore::GlyphBuffer::add):
1416         (WebCore::GlyphBuffer::shrink):
1417         (WebCore::GlyphBuffer::swap):
1418         (WebCore::GlyphBuffer::offsetAt): Deleted.
1419         * platform/graphics/win/UniscribeController.cpp:
1420         (WebCore::UniscribeController::shapeAndPlaceItem):
1421
1422 2016-09-09  Tim Horton  <timothy_horton@apple.com>
1423
1424         Text replacement candidates don't always overwrite the entire original string
1425         https://bugs.webkit.org/show_bug.cgi?id=161779
1426         <rdar://problem/28033492>
1427
1428         Reviewed by Simon Fraser.
1429
1430         New test: editing/mac/spelling/accept-candidate-replacing-multiple-words.html.
1431
1432         * editing/Editor.cpp:
1433         (WebCore::Editor::contextRangeForCandidateRequest):
1434         Factor contextRangeForCandidateRequest out of the WebKits, into Editor.
1435         This just expands to paragraph boundaries from the cursor.
1436
1437         (WebCore::Editor::selectTextCheckingResult):
1438         Add selectTextCheckingResult, which, given a TextCheckingResult,
1439         selects the range represented by the result's location and length, which
1440         indicate the portion of the context string that the result refers to.
1441         In the case of accepting a candidate, we want to select that range
1442         so that our insertion will overwrite it.
1443
1444         (WebCore::Editor::handleAcceptedCandidate):
1445         Make use of selectTextCheckingResult instead of just assuming that we want
1446         to replace the word to the left of the insertion point.
1447
1448         (WebCore::Editor::stringForCandidateRequest): Deleted.
1449         * editing/Editor.h:
1450
1451         * testing/Internals.cpp:
1452         (WebCore::Internals::handleAcceptedCandidate):
1453         * testing/Internals.h:
1454         * testing/Internals.idl:
1455         Internals' handleAcceptedCandidate assumed (wrongly) that the length
1456         of a TextCheckerResult was the length of the candidate, when really it is
1457         the length of the text that the candidate would replace. Adjust this,
1458         and expose the replacement range to JavaScript, so we can test this.
1459
1460 2016-09-09  Brady Eidson  <beidson@apple.com>
1461
1462         Soft-link GameController.framework.
1463         <rdar://problem/28219953> and https://bugs.webkit.org/show_bug.cgi?id=161802
1464
1465         Reviewed by Brian Burg.
1466
1467         No new tests (No change in behavior).
1468
1469         * Configurations/WebCore.xcconfig:
1470         * WebCore.xcodeproj/project.pbxproj:
1471         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
1472         (WebCore::GameControllerGamepadProvider::startMonitoringGamepads):
1473
1474 2016-09-09  Jiewen Tan  <jiewen_tan@apple.com>
1475
1476         Rename Key to CryptoKey
1477         https://bugs.webkit.org/show_bug.cgi?id=161665
1478         <rdar://problem/28083391>
1479
1480         Reviewed by Brent Fulgham.
1481
1482         A link to the spec: https://www.w3.org/TR/WebCryptoAPI/#cryptokey-interface
1483
1484         * crypto/CryptoKey.idl:
1485         Remove some unnecessary IDL attributes and reorder KeyType enum to match the spec.
1486         * crypto/CryptoKeyType.h:
1487
1488 2016-09-09  Alex Christensen  <achristensen@webkit.org>
1489
1490         URLParser: Fix and optimize parsing file URLs ending with a host but no slash
1491         https://bugs.webkit.org/show_bug.cgi?id=161815
1492
1493         Reviewed by Geoffrey Garen.
1494
1495         Covered by new API tests.
1496
1497         * platform/URLParser.cpp:
1498         (WebCore::bufferView):
1499         (WebCore::URLParser::copyURLPartsUntil):
1500         (WebCore::URLParser::parse):
1501
1502 2016-09-09  Alex Christensen  <achristensen@webkit.org>
1503
1504         URLParser: Handle \ in path according to spec
1505         https://bugs.webkit.org/show_bug.cgi?id=161805
1506
1507         Reviewed by Andy Estes.
1508
1509         Covered by new API tests.
1510
1511         * platform/URLParser.cpp:
1512         (WebCore::URLParser::parse):
1513
1514 2016-09-09  Youenn Fablet  <youenn@apple.com>
1515
1516         TextTrackLoader should use FetchOptions::mode according its crossOrigin attribute
1517         https://bugs.webkit.org/show_bug.cgi?id=161792
1518
1519         Reviewed by Eric Carlson.
1520
1521         Covered by existing and updated tests.
1522
1523         Updating text track loader to use fetch mode according crossOrigin value.
1524
1525         Removed the check done in the case the crossOrigin value is not set.
1526         Previously cross-origin loads were forbidden, now this is authorized.
1527         This change allows aligning with the spec.
1528         Also, this check could be bypassed in the case of a same-origin URL redirecting to a cross-origin one.
1529
1530         * loader/TextTrackLoader.cpp:
1531         (WebCore::TextTrackLoader::notifyFinished): Checking resource error in lieu of doing CORS checks on its own.
1532         (WebCore::TextTrackLoader::load): Using CachedResourceRequest::setAsPotentiallyCrossOrigin
1533         * loader/TextTrackLoader.h:
1534         * loader/cache/CachedResource.cpp:
1535         (WebCore::CachedResource::loadFrom): Setting loading and status values as would be done when load is finished.
1536         (WebCore::CachedResource::setBodyDataFrom): Default implementation is to copy the shared buffer.
1537         * loader/cache/CachedResource.h:
1538         * loader/cache/CachedResourceLoader.cpp:
1539         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Enabling resource update when mode or origin is different for TextTrack resources.
1540
1541 2016-09-09  Alex Christensen  <achristensen@webkit.org>
1542
1543         URLParser should parse URLs with non-special schemes
1544         https://bugs.webkit.org/show_bug.cgi?id=161786
1545
1546         Reviewed by Andy Estes.
1547
1548         Covered by new API tests.
1549
1550         * platform/URLParser.cpp:
1551         (WebCore::URLParser::parse):
1552         There's no reason for a SchemeEndCheckForSlashes state now that we can copy iterators.
1553         It's not in the spec and not needed.
1554         Also, move things around a little so parsing special or non-special schemes
1555         followed by one or two slashes works correctly.
1556
1557 2016-09-09  Chris Dumez  <cdumez@apple.com>
1558
1559         Regression(r186020): Null dereference in getStartDate()
1560         https://bugs.webkit.org/show_bug.cgi?id=161733
1561
1562         Reviewed by Eric Carlson.
1563
1564         Update HTMLMediaElement::getStartDate() to return NaN if m_player is null,
1565         instead of crashing.
1566
1567         Test: fast/media/getStartDate-NaN.html
1568
1569         * bindings/js/IDBBindingUtilities.cpp:
1570         (WebCore::toJS):
1571         Add a FIXME comment as this code is using jsDateOrNull() but should
1572         probably be using jsDate() as per:
1573         - http://w3c.github.io/IndexedDB/#request-convert-a-key-to-a-value
1574
1575         * bindings/js/JSDOMBinding.cpp:
1576         (WebCore::jsDate):
1577         (WebCore::jsDateOrNull):
1578         * bindings/js/JSDOMBinding.h:
1579         - Rename jsDateOrNaN() to jsDate() as this is the default behavior. Also,
1580           return new Date(NaN) instead of NaN if the implementation returns NaN.
1581           The IDL says we should return a Date, not a number.
1582         - Update jsDateOrNull() to only return jsNull() if the native value is
1583           NaN, instead of doing so for every value that is not finite. Our
1584           convention is to use NaN as special value to represent null in JS.
1585
1586         * bindings/scripts/CodeGeneratorJS.pm:
1587         (NativeToJSValue):
1588         When converting a native value (double) into a Date, rely on the fact
1589         that the type is nullable when deciding if we should call jsDate() or
1590         jsDateOrNull() to convert. This way, we no longe need a WebKit specific
1591         [TreatReturnedDateAs=Null|NaN] IDL extended attribute.
1592
1593         * bindings/scripts/IDLAttributes.txt:
1594         * html/HTMLInputElement.idl:
1595         Mark valueAsDate attribute as nullable, as per the specification:
1596         - https://html.spec.whatwg.org/#htmlinputelement
1597
1598         * html/HTMLMediaElement.cpp:
1599         (WebCore::HTMLMediaElement::getStartDate):
1600         Return NaN if m_player is null instead of crashing. The reason I decided
1601         to return NaN is because the specification [1] says to return a new Date
1602         object representing the current timeline offset. The spec of timeline
1603         offset [2] says that the initial timeline offset value is NaN.
1604         [1] https://html.spec.whatwg.org/#dom-media-getstartdate
1605         [2] https://html.spec.whatwg.org/#timeline-offset
1606
1607         * bindings/scripts/IDLAttributes.txt:
1608         * html/HTMLMediaElement.idl:
1609         Drop [TreatReturnedDateAs] attribute as it is no longer supported.
1610
1611 2016-09-09  Youenn Fablet  <youenn@apple.com>
1612
1613         ASSERTION FAILED: promise.inherits(JSPromise::info())
1614         https://bugs.webkit.org/show_bug.cgi?id=161632
1615         <rdar://problem/28184743>
1616
1617         Reviewed by Mark Lam.
1618
1619         Test: fetch/fetch-worker-crash.html
1620
1621         * bindings/js/JSDOMPromise.h:
1622         (WebCore::callPromiseFunction): Returning early if created promise is null.
1623         Passing directly a DeferredWrapper to the generated code.
1624         * bindings/scripts/CodeGeneratorJS.pm: Updated to take a DeferredWrapper.
1625         (GenerateImplementation):
1626         (GenerateReturnParameters):
1627         * bindings/scripts/test/JS/JSTestObj.cpp: Rebasing expectations.
1628         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
1629         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
1630         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
1631         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
1632         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
1633         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
1634         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
1635         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
1636
1637 2016-09-09  Myles C. Maxfield  <mmaxfield@apple.com>
1638
1639         [Cocoa] Improve performance of glyph advance metrics gathering
1640         https://bugs.webkit.org/show_bug.cgi?id=161119
1641
1642         Reviewed by Simon Fraser.
1643
1644         Most of the glyphs in a GlyphPage are never read from. Therefore, we can get a performance boost
1645         by not populating as many items in the GlyphPage. Because of the performance characteristics of
1646         CTFontGetGlyphsForCharacters(), a better size for a GlyphPage is 16 items. This, coupled with
1647         using CTFontGetUnsummedAdvancesForGlyphsAndStyle(), causes between a 0.01%-0.5% speedup on PLT.
1648
1649         No new tests because there is no behavior change.
1650
1651         * platform/graphics/Font.cpp:
1652         (WebCore::Font::initCharWidths):
1653         (WebCore::Font::platformGlyphInit):
1654         (WebCore::createAndFillGlyphPage):
1655         * platform/graphics/Font.h:
1656         (WebCore::Font::widthForGlyph):
1657         * platform/graphics/GlyphMetricsMap.h:
1658         * platform/graphics/GlyphPage.h:
1659         * platform/graphics/cocoa/FontCocoa.mm:
1660         * platform/spi/cocoa/CoreTextSPI.h:
1661         (WebCore::Font::platformWidthForGlyph):
1662         (WebCore::canUseFastGlyphAdvanceGetter): Deleted.
1663
1664 2016-09-09  Antti Koivisto  <antti@apple.com>
1665
1666         v3: WebContent crash due to RELEASE_ASSERT in WebCore: WebCore::StyleResolver::styleForElement
1667         https://bugs.webkit.org/show_bug.cgi?id=161689
1668
1669         Reviewed by Andreas Kling.
1670
1671         These crashes happen because synchronously triggered resource loads generate callbacks that may end up
1672         deleting the resource loader.
1673
1674         Stop triggering resource loads from StyleResolver. Instead trigger them when applying style to render tree.
1675
1676         * css/StyleResolver.cpp:
1677         (WebCore::StyleResolver::~StyleResolver):
1678
1679             Replace the RELEASE_ASSERT against deletion during resource loads by a general isDeleted assert.
1680
1681         (WebCore::StyleResolver::styleForElement):
1682         (WebCore::StyleResolver::styleForKeyframe):
1683         (WebCore::StyleResolver::pseudoStyleForElement):
1684         (WebCore::StyleResolver::styleForPage):
1685         (WebCore::StyleResolver::applyMatchedProperties):
1686         (WebCore::StyleResolver::loadPendingResources): Deleted.
1687         * css/StyleResolver.h:
1688         * page/animation/KeyframeAnimation.cpp:
1689         (WebCore::KeyframeAnimation::KeyframeAnimation):
1690         (WebCore::KeyframeAnimation::resolveKeyframeStyles):
1691
1692             Ensure resource load for all animation frames.
1693
1694         * page/animation/KeyframeAnimation.h:
1695         * rendering/RenderElement.cpp:
1696         (WebCore::RenderElement::createFor):
1697         (WebCore::RenderElement::initializeStyle):
1698
1699             Load resources when renderer initializes a style.
1700
1701         (WebCore::RenderElement::setStyle):
1702         (WebCore::RenderElement::getUncachedPseudoStyle):
1703
1704             Load resources for pseudo styles.
1705
1706         * rendering/RenderImage.cpp:
1707         (WebCore::RenderImage::RenderImage):
1708         (WebCore::RenderImage::styleWillChange):
1709
1710             Shuffle image resource initialization out from constructor so initializeStyle gets called before.
1711
1712         * rendering/RenderImage.h:
1713         * rendering/style/StyleCachedImage.cpp:
1714         (WebCore::StyleCachedImage::StyleCachedImage):
1715
1716             Track pending status with a bit instead of implicitly by the existence of CachedResource.
1717             This is useful for asserts.
1718
1719         (WebCore::StyleCachedImage::load):
1720         (WebCore::StyleCachedImage::isPending):
1721         (WebCore::StyleCachedImage::addClient):
1722         (WebCore::StyleCachedImage::removeClient):
1723         (WebCore::StyleCachedImage::image):
1724         * rendering/style/StyleCachedImage.h:
1725
1726 2016-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>
1727
1728         ScriptRunner should be driven by PendingScript rather than ScriptElement
1729         https://bugs.webkit.org/show_bug.cgi?id=161726
1730
1731         Reviewed by Ryosuke Niwa.
1732
1733         Tests: js/dom/document-write-in-error-event.html
1734                js/dom/document-write-in-load-event.html
1735
1736         ScriptRunner is driven by ScriptElement::notifyFinished. While ScriptRunner is driven by this,
1737         HTMLScriptRunner does not use it. Instead, HTMLScriptRunner uses PendingScriptClient. As a result,
1738         ScriptElement::notifyFinished is used only when the script is annotated with "defer" or "async"
1739         while all the external script will load the LoadableScript. It is confusing.
1740         This patch removes ScriptElement::notifyFinished and use PendingScript's observability
1741         in ScriptRunner instead.
1742
1743         This patch also fixes the behavior about ignore-destructive-writes counter[1]. When dispatching
1744         the load and error events, this ignore-destructive-writes counter should not be incremeneted by
1745         this execution. The added tests ensure this behavior.
1746
1747         [1]: https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block
1748
1749         * dom/ScriptElement.cpp: Drop LoadableScriptClient interface.
1750         (WebCore::ScriptElement::prepareScript): Do not use addClient. ScriptRunner use PendingScript::{setClient,clearClient} instead.
1751         (WebCore::ScriptElement::executeScriptForScriptRunner): IgnoreDestructiveWriteCountIncrementer will be done in ScriptElement::executeScript.
1752         So no need to do it here, that's duplicated.
1753         (WebCore::ScriptElement::~ScriptElement): Deleted. ScriptElement does not use addClient/removeClient.
1754         (WebCore::ScriptElement::stopLoadRequest): Deleted.
1755         (WebCore::ScriptElement::executeScriptForHTMLScriptRunner): Deleted. executeScriptForHTMLScriptRunner and executeScriptForScriptRunner are
1756         merged into executeScriptForRunner.
1757         (WebCore::ScriptElement::notifyFinished): Deleted.
1758         * dom/ScriptElement.h:
1759         (WebCore::ScriptElement::~ScriptElement):
1760         (WebCore::ScriptElement::willExecuteInOrder): Used in ScriptRunner to determine whether the script is async or defer.
1761         (WebCore::ScriptElement::willExecuteWhenDocumentFinishedParsing): Deleted.
1762         * dom/ScriptRunner.cpp:
1763         (WebCore::ScriptRunner::~ScriptRunner): HashSet's iterator will return `const PendingScript&`.
1764         Another option is using HashSet<RefPtr<PendingScript>>. Here, we use a little bit weired const_cast.
1765         (WebCore::ScriptRunner::queueScriptForExecution): Use PendingScript::setClient to wait loading.
1766         (WebCore::ScriptRunner::notifyFinished): Notify the script ready here.
1767         (WebCore::ScriptRunner::timerFired): Use executeScriptForScriptRunner.
1768         (WebCore::ScriptRunner::notifyScriptReady): Deleted.
1769         * dom/ScriptRunner.h:
1770         * html/parser/HTMLScriptRunner.cpp:
1771         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): Use executeScriptForScriptRunner.
1772
1773 2016-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>
1774
1775         [WTF] HashTable's rehash is not compatible to Ref<T> and ASan
1776         https://bugs.webkit.org/show_bug.cgi?id=161763
1777
1778         Reviewed by Mark Lam.
1779
1780         Include wtf/text/StringHash.h to avoid linking errors in EFL port.
1781
1782         * loader/ResourceLoadStatistics.h:
1783
1784 2016-09-08  Chris Dumez  <cdumez@apple.com>
1785
1786         HTMLObjectElement.hspace / vspace attributes should be unsigned
1787         https://bugs.webkit.org/show_bug.cgi?id=161766
1788
1789         Reviewed by Ryosuke Niwa.
1790
1791         HTMLObjectElement.hspace / vspace attributes should be unsigned:
1792         - https://html.spec.whatwg.org/#HTMLObjectElement-partial
1793
1794         Firefox agrees with the specification but those were signed in WebKit.
1795
1796         No new tests, rebaselined existing test.
1797
1798         * html/HTMLObjectElement.idl:
1799
1800 2016-09-08  Chris Dumez  <cdumez@apple.com>
1801
1802         HTMLObjectElement.codebase attribute should reflect as a URL
1803         https://bugs.webkit.org/show_bug.cgi?id=161768
1804
1805         Reviewed by Alex Christensen.
1806
1807         HTMLObjectElement.codebase attribute should reflect as a URL:
1808         - https://html.spec.whatwg.org/#dom-applet-codebase
1809
1810         Chrome and Firefox agree with the specification.
1811
1812         No new test, rebaselined existing test.
1813
1814         * html/HTMLObjectElement.idl:
1815
1816 2016-09-08  Chris Dumez  <cdumez@apple.com>
1817
1818         ol.start may return incorrect value for reversed lists when not explicitly set
1819         https://bugs.webkit.org/show_bug.cgi?id=161713
1820
1821         Reviewed by Zalan Bujtas.
1822
1823         ol.start may return incorrect value for reversed lists when not explicitly set.
1824         This is because we're supposed to return the number of rendered <li> child
1825         elements, which relies on layout. However, we did not make sure the layout is
1826         up-to-date before counting the number of li child elements. This patch fixes
1827         the issue.
1828
1829         No new tests, rebaselined existing tests.
1830
1831         * html/HTMLOListElement.h:
1832
1833 2016-09-08  Chris Dumez  <cdumez@apple.com>
1834
1835         Add support for HTMLIframeElement.allowFullscreen attribute
1836         https://bugs.webkit.org/show_bug.cgi?id=161757
1837
1838         Reviewed by Sam Weinig.
1839
1840         Add support for HTMLIframeElement.allowFullscreen attribute:
1841         - https://html.spec.whatwg.org/#dom-iframe-allowfullscreen
1842
1843         Firefox and Chrome already support it, unprefixed.
1844
1845         Note that the HTMLIframeElement.allowFullscreen attribute reflects the
1846         allowfullscreen content attribute which we already support.
1847
1848         Test: fullscreen/full-screen-iframe-allowFullscreen.html
1849
1850         * html/HTMLIFrameElement.idl:
1851
1852 2016-09-08  Chris Dumez  <cdumez@apple.com>
1853
1854         frame.longDesc / iframe.longDesc should reflect as a URL
1855         https://bugs.webkit.org/show_bug.cgi?id=161764
1856
1857         Reviewed by Alex Christensen.
1858
1859         frame.longDesc / iframe.longDesc should reflect as a URL:
1860         - https://html.spec.whatwg.org/#dom-iframe-longdesc
1861         - https://html.spec.whatwg.org/#dom-frame-longdesc
1862
1863         They already do in Chrome and Firefox.
1864
1865         No new tests, rebaselined existing tests.
1866
1867         * html/HTMLFrameElement.idl:
1868         * html/HTMLIFrameElement.idl:
1869
1870 2016-09-08  Alex Christensen  <achristensen@webkit.org>
1871
1872         URLParser: Handle \ in paths of special URLs according to spec
1873         https://bugs.webkit.org/show_bug.cgi?id=161781
1874
1875         Reviewed by Tim Horton.
1876
1877         Covered by new API tests.
1878
1879         * platform/URLParser.cpp:
1880         (WebCore::bufferView):
1881         (WebCore::URLParser::copyURLPartsUntil):
1882         (WebCore::URLParser::parse):
1883         * platform/URLParser.h:
1884
1885 2016-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
1886
1887         Move the BitmapImage platform dependent code to a new file named NativeImage[CG|Cairo].cpp
1888         https://bugs.webkit.org/show_bug.cgi?id=158684
1889
1890         Reviewed by Simon Fraser.
1891
1892         This is a refactoring patch. It moves the BitmapImage platform dependent
1893         code from BitmapImage to NativeImage[CG|Cairo].cpp. The new APIs are
1894         responsible of drawing a NativeImagePtr and answering some metadata queries.
1895
1896         No new tests -- Code refactoring, no behavior change.
1897
1898         * PlatformAppleWin.cmake:
1899         * PlatformEfl.cmake:
1900         * PlatformGTK.cmake:
1901         * PlatformMac.cmake:
1902         * PlatformWinCairo.cmake:
1903         * WebCore.xcodeproj/project.pbxproj:
1904         * loader/cache/MemoryCache.h:
1905         * loader/icon/IconDatabaseBase.h:
1906         * page/mac/TextIndicatorWindow.mm:
1907         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
1908         (createContentCrossfadeAnimation):
1909         * platform/graphics/BitmapImage.cpp:
1910         (WebCore::BitmapImage::BitmapImage):
1911         (WebCore::BitmapImage::destroyDecodedData):
1912         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
1913         (WebCore::BitmapImage::dataChanged):
1914         (WebCore::BitmapImage::ensureFrameAtIndexIsCached):
1915         (WebCore::BitmapImage::frameImageAtIndex):
1916         (WebCore::BitmapImage::nativeImage):
1917         (WebCore::BitmapImage::nativeImageForCurrentFrame):
1918         (WebCore::BitmapImage::nativeImageOfSize):
1919         (WebCore::BitmapImage::framesNativeImages):
1920         (WebCore::BitmapImage::frameIsCompleteAtIndex):
1921         (WebCore::BitmapImage::frameDurationAtIndex):
1922         (WebCore::BitmapImage::frameHasAlphaAtIndex):
1923         (WebCore::BitmapImage::frameOrientationAtIndex):
1924         (WebCore::BitmapImage::singlePixelSolidColor):
1925         (WebCore::BitmapImage::draw):
1926         (WebCore::BitmapImage::drawPattern):
1927         (WebCore::BitmapImage::canAnimate):
1928         (WebCore::BitmapImage::clearTimer):
1929         (WebCore::BitmapImage::startTimer):
1930         (WebCore::BitmapImage::stopAnimation):
1931         (WebCore::BitmapImage::resetAnimation):
1932         (WebCore::BitmapImage::hasSingleSecurityOrigin): Deleted.
1933         (WebCore::BitmapImage::filenameExtension): Deleted.
1934         (WebCore::BitmapImage::ensureFrameIsCached): Deleted.
1935         * platform/graphics/BitmapImage.h:
1936         (WebCore::FrameData::FrameData):
1937         m_hasAlpha can be initialized with false because it is accessed only in
1938         BitmapImage::frameHasAlphaAtIndex() and it is guarded by m_haveMetadata.
1939         Both m_haveMetadata and m_hasAlpha are set in BitmapImage constructor
1940         and in BitmapImage::cacheFrame().
1941         
1942         (WebCore::FrameData::~FrameData):
1943         (WebCore::FrameData::clear):
1944         * platform/graphics/Icon.h:
1945         * platform/graphics/Image.h:
1946         (WebCore::Image::nativeImage):
1947         (WebCore::Image::nativeImageOfSize):
1948         (WebCore::Image::framesNativeImages):
1949         (WebCore::Image::orientationForCurrentFrame): Deleted.
1950         (WebCore::Image::getCGImageRef): Deleted.
1951         (WebCore::Image::getFirstCGImageRefOfSize): Deleted.
1952         (WebCore::Image::getCGImageArray): Deleted.
1953         * platform/graphics/ImageSource.cpp:
1954         (WebCore::ImageSource::calculateMaximumSubsamplingLevel):
1955         (WebCore::ImageSource::size):
1956         (WebCore::ImageSource::sizeRespectingOrientation):
1957         * platform/graphics/ImageSource.h:
1958         * platform/graphics/MediaPlayer.h:
1959         * platform/graphics/NativeImage.h: Added.
1960         * platform/graphics/NativeImagePtr.h: Removed.
1961         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1962         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage):
1963         * platform/graphics/cairo/BitmapImageCairo.cpp: Removed.
1964         * platform/graphics/cairo/NativeImageCairo.cpp: Added.
1965         (WebCore::nativeImageSize):
1966         (WebCore::nativeImageHasAlpha):
1967         (WebCore::nativeImageSinglePixelSolidColor):
1968         (WebCore::subsamplingScale):
1969         (WebCore::drawNativeImage):
1970         (WebCore::clearNativeImageSubImages):
1971         * platform/graphics/cg/BitmapImageCG.cpp: Removed.
1972         * platform/graphics/cg/ImageDecoderCG.cpp:
1973         (WebCore::ImageDecoder::size):
1974         * platform/graphics/cg/ImageDecoderCG.h:
1975         * platform/graphics/cg/NativeImageCG.cpp: Added.
1976         (WebCore::nativeImageSize):
1977         (WebCore::nativeImageHasAlpha):
1978         (WebCore::nativeImageSinglePixelSolidColor):
1979         (WebCore::subsamplingScale):
1980         (WebCore::drawNativeImage):
1981         (WebCore::clearNativeImageSubImages):
1982         * platform/graphics/cg/PatternCG.cpp:
1983         (WebCore::Pattern::createPlatformPattern):
1984         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
1985         (TextTrackRepresentationCocoa::update):
1986         * platform/graphics/mac/ImageMac.mm:
1987         (WebCore::BitmapImage::getTIFFRepresentation):
1988         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
1989         (WebCore::MockRealtimeVideoSourceMac::updatePlatformLayer):
1990         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
1991         * platform/win/DragImageCGWin.cpp:
1992         (WebCore::createDragImageFromImage):
1993
1994 2016-09-08  Alex Christensen  <achristensen@webkit.org>
1995
1996         URLParser: Parsing empty URLs with a base URL should return the base URL
1997         https://bugs.webkit.org/show_bug.cgi?id=161777
1998
1999         Reviewed by Tim Horton.
2000
2001         Covered by an API test and progress towards passing all web platform tests when using URLParser.
2002
2003         * platform/URLParser.cpp:
2004         (WebCore::URLParser::parse):
2005
2006 2016-09-08  Alex Christensen  <achristensen@webkit.org>
2007
2008         URLParser failures should preserve the original input string
2009         https://bugs.webkit.org/show_bug.cgi?id=161769
2010
2011         Reviewed by Tim Horton.
2012
2013         No new tests, but covered by updates to API tests.
2014         This also represents many newly passing web platform tests when using URLParser.
2015
2016         * platform/URLParser.cpp:
2017         (WebCore::URLParser::failure):
2018         (WebCore::URLParser::parse):
2019         * platform/URLParser.h:
2020
2021 2016-09-08  Alex Christensen  <achristensen@webkit.org>
2022
2023         URLParser should parse URLs with a user but no password
2024         https://bugs.webkit.org/show_bug.cgi?id=161773
2025
2026         Reviewed by Brady Eidson.
2027
2028         Covered by new API tests.
2029
2030         * platform/URLParser.cpp:
2031         (WebCore::URLParser::parseAuthority):
2032
2033 2016-09-08  Alex Christensen  <achristensen@webkit.org>
2034
2035         Fix URLs after r205669.
2036         https://bugs.webkit.org/show_bug.cgi?id=161731
2037
2038         * platform/URLParser.cpp:
2039         (WebCore::URLParser::enabled):
2040         I accidentally committed enabling the URLParser by default.  Not ready yet.
2041
2042 2016-09-08  Chris Dumez  <cdumez@apple.com>
2043
2044         Align proto getter / setter behavior with other browsers
2045         https://bugs.webkit.org/show_bug.cgi?id=161455
2046
2047         Reviewed by Saam Barati.
2048
2049         Align cross-origin __proto__ getter / setter behavior with other
2050         browsers and the specification:
2051
2052         [[SetPrototypeOf]] should throw a TypeError:
2053         - https://html.spec.whatwg.org/#windowproxy-setprototypeof
2054         - https://html.spec.whatwg.org/#location-setprototypeof
2055         - https://tc39.github.io/ecma262/#sec-object.setprototypeof (step 5)
2056
2057         [[GetPrototypeOf]] should return null cross-origin:
2058         - https://html.spec.whatwg.org/#windowproxy-getprototypeof
2059         - https://html.spec.whatwg.org/#location-getprototypeof
2060
2061         Test: js/dom/setPrototypeOf-location-window.html
2062
2063         * bindings/js/JSDOMWindowBase.cpp:
2064         (WebCore::JSDOMWindowBase::JSDOMWindowBase): Deleted.
2065         * bindings/js/JSDOMWindowCustom.cpp:
2066         (WebCore::JSDOMWindow::setPrototype):
2067         (WebCore::JSDOMWindow::getPrototype):
2068         (WebCore::JSDOMWindow::preventExtensions):
2069         * bindings/js/JSLocationCustom.cpp:
2070         (WebCore::JSLocation::setPrototype):
2071         (WebCore::JSLocation::getPrototype):
2072         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2073         (WebCore::JSWorkerGlobalScopeBase::supportsRichSourceInfo): Deleted.
2074         * bindings/js/JSWorkerGlobalScopeBase.h:
2075         * bindings/scripts/CodeGeneratorJS.pm:
2076         (GenerateHeader):
2077         * bindings/scripts/IDLAttributes.txt:
2078         * page/DOMWindow.idl:
2079         * page/Location.idl:
2080
2081 2016-09-08  Alex Christensen  <achristensen@webkit.org>
2082
2083         URLParser should parse ports after IPv4 and IPv6 hosts
2084         https://bugs.webkit.org/show_bug.cgi?id=161731
2085
2086         Reviewed by Brady Eidson.
2087
2088         Covered by new API tests.
2089
2090         * platform/URLParser.cpp:
2091         (WebCore::URLParser::parsePort):
2092         (WebCore::URLParser::parseHost):
2093
2094 2016-09-08  Alex Christensen  <achristensen@webkit.org>
2095
2096         URLParser should correctly handle \ in path
2097         https://bugs.webkit.org/show_bug.cgi?id=161762
2098
2099         Reviewed by Brady Eidson.
2100
2101         Covered by new API tests.
2102
2103         * platform/URLParser.cpp:
2104         (WebCore::isSpecialScheme):
2105         (WebCore::bufferView):
2106         (WebCore::URLParser::parse):
2107         Treat \ as / in the path of special URLs as described in the spec and tested in web platform tests.
2108         Also a slight performance improvement using StringViews instead of copied Strings.
2109
2110 2016-09-08  Alex Christensen  <achristensen@webkit.org>
2111
2112         URLParser should handle URLs with empty authority
2113         https://bugs.webkit.org/show_bug.cgi?id=161711
2114
2115         Reviewed by Brady Eidson.
2116
2117         Covered by new API tests.
2118
2119         * platform/URLParser.cpp:
2120         (WebCore::URLParser::parse):
2121         (WebCore::URLParser::parseAuthority):
2122
2123 2016-09-08  Chris Dumez  <cdumez@apple.com>
2124
2125         HTMLImageElement.hspace / vspace attributes should be unsigned
2126         https://bugs.webkit.org/show_bug.cgi?id=161754
2127
2128         Reviewed by Alex Christensen.
2129
2130         HTMLImageElement.hspace / vspace attributes should be unsigned:
2131         - https://html.spec.whatwg.org/#HTMLImageElement-partial
2132
2133         Firefox agrees with the specification, however, those were signed in
2134         webKit.
2135
2136         No new tests, rebaselined existing test.
2137
2138         * html/HTMLImageElement.idl:
2139
2140 2016-09-08  Chris Dumez  <cdumez@apple.com>
2141
2142         Update parseHTMLNonNegativeInteger() to return an unsigned value
2143         https://bugs.webkit.org/show_bug.cgi?id=161759
2144
2145         Reviewed by Alex Christensen.
2146
2147         Update parseHTMLNonNegativeInteger() to return an unsigned value instead
2148         of a signed one as the value can never be negative.
2149
2150         * html/HTMLElement.cpp:
2151         (WebCore::HTMLElement::parseBorderWidthAttribute):
2152         * html/HTMLImageElement.cpp:
2153         (WebCore::HTMLImageElement::width):
2154         (WebCore::HTMLImageElement::height):
2155         * html/HTMLInputElement.cpp:
2156         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
2157         (WebCore::HTMLInputElement::minLengthAttributeChanged):
2158         * html/HTMLTextAreaElement.cpp:
2159         (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
2160         (WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
2161         * html/ImageInputType.cpp:
2162         (WebCore::ImageInputType::height):
2163         (WebCore::ImageInputType::width):
2164         * html/parser/HTMLParserIdioms.cpp:
2165         (WebCore::parseHTMLNonNegativeInteger):
2166         (WebCore::parseHTTPRefreshInternal):
2167         * html/parser/HTMLParserIdioms.h:
2168
2169 2016-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
2170
2171         Get rid of the color profile from ImageFrame and ImageDecoder
2172         https://bugs.webkit.org/show_bug.cgi?id=159699
2173
2174         Reviewed by Simon Fraser.
2175
2176         The color profile is set but it is never used.
2177
2178         * platform/image-decoders/ImageDecoder.cpp:
2179         (WebCore::ImageFrame::setColorProfile): Deleted.
2180         * platform/image-decoders/ImageDecoder.h:
2181         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
2182         (WebCore::JPEGImageReader::decode):
2183         (WebCore::JPEGImageDecoder::outputScanlines):
2184         (WebCore::readColorProfile): Deleted.
2185         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
2186         * platform/image-decoders/png/PNGImageDecoder.cpp:
2187         (WebCore::PNGImageDecoder::headerAvailable):
2188         (WebCore::PNGImageDecoder::rowAvailable):
2189         (WebCore::readColorProfile): Deleted.
2190
2191 2016-09-08  Dave Hyatt  <hyatt@apple.com>
2192
2193         [CSS Parser] Add support for new CSS selector parsing
2194         https://bugs.webkit.org/show_bug.cgi?id=161749
2195
2196         Reviewed by Dean Jackson.
2197
2198         * CMakeLists.txt:
2199         * WebCore.xcodeproj/project.pbxproj:
2200         * contentextensions/ContentExtensionParser.cpp:
2201         (WebCore::ContentExtensions::isValidSelector):
2202         * css/CSSDefaultStyleSheets.cpp:
2203         (WebCore::parseUASheet):
2204         * css/CSSFontFaceSet.cpp:
2205         (WebCore::CSSFontFaceSet::matchingFaces):
2206         * css/CSSGrammar.y.in:
2207         * css/CSSSelector.cpp:
2208         (WebCore::CSSSelector::selectorText):
2209         * css/CSSSelector.h:
2210         * css/DOMCSSNamespace.cpp:
2211         (WebCore::DOMCSSNamespace::supports):
2212         * css/FontFace.cpp:
2213         (WebCore::FontFace::parseString):
2214         (WebCore::FontFace::setVariant):
2215         * css/MediaList.cpp:
2216         (WebCore::MediaQuerySet::internalParse):
2217         (WebCore::MediaQuerySet::parse):
2218         * css/SelectorChecker.cpp:
2219         (WebCore::SelectorChecker::matchRecursively):
2220         * css/SelectorFilter.cpp:
2221         (WebCore::SelectorFilter::collectIdentifierHashes):
2222         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
2223         * css/SelectorPseudoTypeMap.h:
2224         * css/SourceSizeList.cpp:
2225         (WebCore::parseSizesAttribute):
2226         * css/StyleProperties.cpp:
2227         (WebCore::MutableStyleProperties::MutableStyleProperties):
2228         * css/StyleProperties.h:
2229         * css/StyleRuleImport.cpp:
2230         (WebCore::StyleRuleImport::setCSSStyleSheet):
2231         * css/StyleSheetContents.cpp:
2232         (WebCore::StyleSheetContents::StyleSheetContents):
2233         (WebCore::StyleSheetContents::parserAddNamespace):
2234         (WebCore::StyleSheetContents::namespaceURIFromPrefix):
2235         (WebCore::StyleSheetContents::determineNamespace): Deleted.
2236         * css/StyleSheetContents.h:
2237         * css/WebKitCSSMatrix.cpp:
2238         (WebCore::WebKitCSSMatrix::setMatrixValue):
2239         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
2240         * css/parser/CSSParser.cpp:
2241         (WebCore::strictCSSParserContext):
2242         (WebCore::CSSParserContext::CSSParserContext):
2243         (WebCore::CSSParser::parseColor):
2244         (WebCore::CSSParser::shouldAcceptUnitLessValues):
2245         (WebCore::CSSParser::parseValue):
2246         (WebCore::CSSParser::parseColumnWidth):
2247         (WebCore::CSSParser::parseColumnCount):
2248         (WebCore::CSSParser::parseFontWeight):
2249         (WebCore::CSSParser::parseColorParameters):
2250         (WebCore::CSSParser::parseHSLParameters):
2251         (WebCore::CSSParser::parseShadow):
2252         (WebCore::CSSParser::parseBorderImageSlice):
2253         (WebCore::CSSParser::parseBorderImageQuad):
2254         (WebCore::CSSParser::parseDeprecatedLinearGradient):
2255         (WebCore::CSSParser::parseLinearGradient):
2256         (WebCore::CSSParser::parseTransformValue):
2257         (WebCore::CSSParser::parseBuiltinFilterArguments):
2258         (WebCore::CSSParser::determineNameInNamespace):
2259         * css/parser/CSSParser.h:
2260         (WebCore::CSSParser::inStrictMode):
2261         (WebCore::CSSParser::inQuirksMode):
2262         * css/parser/CSSParserMode.h:
2263         (WebCore::isQuirksModeBehavior):
2264         (WebCore::isUASheetBehavior):
2265         (WebCore::isUnitLessLengthParsingEnabledForMode):
2266         (WebCore::isCSSViewportParsingEnabledForMode):
2267         (WebCore::strictToCSSParserMode):
2268         (WebCore::isStrictParserMode):
2269         * css/parser/CSSParserValues.cpp:
2270         (WebCore::CSSParserSelector::parsePseudoElementSelectorFromStringView):
2271         (WebCore::CSSParserSelector::parsePseudoClassSelectorFromStringView):
2272         (WebCore::CSSParserSelector::setSelectorList):
2273         (WebCore::CSSParserSelector::appendTagHistory):
2274         (WebCore::CSSParserSelector::releaseTagHistory):
2275         (WebCore::CSSParserSelector::isHostPseudoSelector):
2276         * css/parser/CSSParserValues.h:
2277         (WebCore::CSSParserSelector::match):
2278         (WebCore::CSSParserSelector::pseudoElementType):
2279         (WebCore::CSSParserSelector::selectorList):
2280         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
2281         * css/parser/CSSPropertyParser.h:
2282         (WebCore::CSSPropertyParser::inQuirksMode):
2283         * css/parser/CSSSelectorParser.cpp: Added.
2284         (WebCore::CSSSelectorParser::parseSelector):
2285         (WebCore::CSSSelectorParser::CSSSelectorParser):
2286         (WebCore::CSSSelectorParser::consumeComplexSelectorList):
2287         (WebCore::CSSSelectorParser::consumeCompoundSelectorList):
2288         (WebCore::CSSSelectorParser::consumeComplexSelector):
2289         (WebCore::CSSSelectorParser::consumeCompoundSelector):
2290         (WebCore::CSSSelectorParser::consumeSimpleSelector):
2291         (WebCore::CSSSelectorParser::consumeName):
2292         (WebCore::CSSSelectorParser::consumeId):
2293         (WebCore::CSSSelectorParser::consumeClass):
2294         (WebCore::CSSSelectorParser::consumeAttribute):
2295         (WebCore::CSSSelectorParser::consumePseudo):
2296         (WebCore::CSSSelectorParser::consumeCombinator):
2297         (WebCore::CSSSelectorParser::consumeAttributeMatch):
2298         (WebCore::CSSSelectorParser::consumeAttributeFlags):
2299         (WebCore::CSSSelectorParser::consumeANPlusB):
2300         (WebCore::CSSSelectorParser::defaultNamespace):
2301         (WebCore::CSSSelectorParser::determineNamespace):
2302         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
2303         (WebCore::CSSSelectorParser::addSimpleSelectorToCompound):
2304         (WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
2305         * css/parser/CSSSelectorParser.h: Added.
2306         (WebCore::CSSSelectorParser::DisallowPseudoElementsScope::DisallowPseudoElementsScope):
2307         (WebCore::CSSSelectorParser::DisallowPseudoElementsScope::~DisallowPseudoElementsScope):
2308         * cssjit/SelectorCompiler.cpp:
2309         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
2310         * dom/StyledElement.cpp:
2311         (WebCore::StyledElement::rebuildPresentationAttributeStyle):
2312         * svg/SVGFontFaceElement.cpp:
2313         (WebCore::SVGFontFaceElement::SVGFontFaceElement):
2314
2315 2016-09-08  Simon Fraser  <simon.fraser@apple.com>
2316
2317         Don't run transitions to or from undefined Lengths
2318         https://bugs.webkit.org/show_bug.cgi?id=161750
2319         rdar://problem/28170460
2320
2321         Reviewed by Zalan Bujtas.
2322
2323         For properties like max-height whose default value is 'none', we would erroneously
2324         attempt to run transitions/animations, and then assert when one of the endpoints
2325         was undefined.
2326
2327         So don't attempt to blend such Length values, just as do when they are auto.
2328
2329         Fixes some transitions on apple.com and developer.apple.com.
2330
2331         Test: transitions/transition-to-from-undefined.html
2332
2333         * page/animation/CSSPropertyAnimation.cpp:
2334         (WebCore::CSSPropertyAnimation::blendProperties):
2335         * platform/Length.cpp:
2336         (WebCore::blend):
2337
2338 2016-09-08  Myles C. Maxfield  <mmaxfield@apple.com>
2339
2340         Support new emoji group candidates
2341         https://bugs.webkit.org/show_bug.cgi?id=161664
2342         <rdar://problem/24802695>
2343         <rdar://problem/27666433>
2344
2345         Reviewed by Simon Fraser.
2346
2347         Support more emoji group candidates. This includes joining groups into a single glyph, as
2348         well as atomic deletions of the entire group when the backspace key is pressed.
2349
2350         Tests: editing/deleting/delete-emoji.html:
2351                fast/text/emoji-num-glyphs.html:
2352
2353         * platform/text/CharacterProperties.h:
2354         (WebCore::isEmojiGroupCandidate):
2355
2356 2016-09-08  Chris Dumez  <cdumez@apple.com>
2357
2358         HTMLImageElement.width / height attributes should be unsigned
2359         https://bugs.webkit.org/show_bug.cgi?id=161730
2360
2361         Reviewed by Alex Christensen.
2362
2363         HTMLImageElement.width / height attributes should be unsigned as per
2364         the HTML specification:
2365         - https://html.spec.whatwg.org/#htmlimageelement
2366
2367         However, they are signed in WebKit. Firefox agrees with the
2368         specification.
2369
2370         No new tests, rebaselined existing test.
2371
2372         * bindings/js/JSImageConstructor.cpp:
2373         (WebCore::JSImageConstructor::construct):
2374         (WebCore::createImageConstructor): Deleted.
2375         * html/HTMLImageElement.cpp:
2376         (WebCore::HTMLImageElement::createForJSConstructor):
2377         (WebCore::HTMLImageElement::width):
2378         (WebCore::HTMLImageElement::height):
2379         (WebCore::HTMLImageElement::setHeight):
2380         (WebCore::HTMLImageElement::setWidth):
2381         * html/HTMLImageElement.h:
2382         * html/HTMLImageElement.idl:
2383         * html/ImageDocument.cpp:
2384         (WebCore::ImageDocument::restoreImageSize):
2385
2386 2016-09-08  Filip Pizlo  <fpizlo@apple.com>
2387
2388         Move JSMap/JSSet over to Auxiliary MarkedSpace
2389         https://bugs.webkit.org/show_bug.cgi?id=161744
2390
2391         Reviewed by Saam Barati.
2392
2393         No new tests because no change in behavior.
2394
2395         * bindings/js/SerializedScriptValue.cpp:
2396
2397 2016-09-08  Commit Queue  <commit-queue@webkit.org>
2398
2399         Unreviewed, rolling out r205652.
2400         https://bugs.webkit.org/show_bug.cgi?id=161748
2401
2402         Crashing under ASan (Requested by yusukesuzuki on #webkit).
2403
2404         Reverted changeset:
2405
2406         "ScriptRunner should be driven by PendingScript rather than
2407         ScriptElement"
2408         https://bugs.webkit.org/show_bug.cgi?id=161726
2409         http://trac.webkit.org/changeset/205652
2410
2411 2016-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2412
2413         ScriptRunner should be driven by PendingScript rather than ScriptElement
2414         https://bugs.webkit.org/show_bug.cgi?id=161726
2415
2416         Reviewed by Ryosuke Niwa.
2417
2418         ScriptRunner is driven by ScriptElement::notifyFinished. While ScriptRunner is driven by this,
2419         HTMLScriptRunner does not use it. Instead, HTMLScriptRunner uses PendingScriptClient. As a result,
2420         ScriptElement::notifyFinished is used only when the script is annotated with "defer" or "async"
2421         while all the external script will load the LoadableScript. It is confusing.
2422         This patch removes ScriptElement::notifyFinished and use PendingScript's observability
2423         in ScriptRunner instead.
2424
2425         This patch also fixes the behavior about ignore-destructive-writes counter[1]. When dispatching
2426         the load and error events, this ignore-destructive-writes counter should not be incremeneted by
2427         this execution. The added tests ensure this behavior.
2428
2429         [1]: https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block
2430
2431         * dom/ScriptElement.cpp: Drop LoadableScriptClient interface.
2432         (WebCore::ScriptElement::prepareScript): Do not use addClient. ScriptRunner use PendingScript::{setClient,clearClient} instead.
2433         (WebCore::ScriptElement::executeScriptForScriptRunner): IgnoreDestructiveWriteCountIncrementer will be done in ScriptElement::executeScript.
2434         So no need to do it here, that's duplicated.
2435         (WebCore::ScriptElement::~ScriptElement): Deleted. ScriptElement does not use addClient/removeClient.
2436         (WebCore::ScriptElement::stopLoadRequest): Deleted.
2437         (WebCore::ScriptElement::executeScriptForHTMLScriptRunner): Deleted. executeScriptForHTMLScriptRunner and executeScriptForScriptRunner are
2438         merged into executeScriptForRunner.
2439         (WebCore::ScriptElement::notifyFinished): Deleted.
2440         * dom/ScriptElement.h:
2441         (WebCore::ScriptElement::~ScriptElement):
2442         (WebCore::ScriptElement::willExecuteInOrder): Used in ScriptRunner to determine whether the script is async or defer.
2443         (WebCore::ScriptElement::willExecuteWhenDocumentFinishedParsing): Deleted.
2444         * dom/ScriptRunner.cpp:
2445         (WebCore::ScriptRunner::~ScriptRunner): HashSet's iterator will return `const PendingScript&`.
2446         Another option is using HashSet<RefPtr<PendingScript>>. Here, we use a little bit weired const_cast.
2447         (WebCore::ScriptRunner::queueScriptForExecution): Use PendingScript::setClient to wait loading.
2448         (WebCore::ScriptRunner::notifyFinished): Notify the script ready here.
2449         (WebCore::ScriptRunner::timerFired): Use executeScriptForScriptRunner.
2450         (WebCore::ScriptRunner::notifyScriptReady): Deleted.
2451         * dom/ScriptRunner.h:
2452         * html/parser/HTMLScriptRunner.cpp:
2453         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): Use executeScriptForScriptRunner.
2454
2455 2016-09-08  Alex Christensen  <achristensen@webkit.org>
2456
2457         Re-land r205580 after r205649 fixed the test failures
2458         https://bugs.webkit.org/show_bug.cgi?id=161668
2459
2460         Re-landing changesets:
2461
2462         "Punycode encode non-ascii hosts in URLParser"
2463         https://bugs.webkit.org/show_bug.cgi?id=161655
2464         http://trac.webkit.org/changeset/205521
2465
2466         "Fix query-only and fragment-only relative URLs when using
2467         URLParser"
2468         https://bugs.webkit.org/show_bug.cgi?id=161657
2469         http://trac.webkit.org/changeset/205526
2470
2471         "URLParser should parse / as a relative URL"
2472         https://bugs.webkit.org/show_bug.cgi?id=161667
2473         http://trac.webkit.org/changeset/205532
2474
2475 2016-09-08  Alex Christensen  <achristensen@webkit.org>
2476
2477         Add range check in URLParser's serializeIPv6
2478         https://bugs.webkit.org/show_bug.cgi?id=161743
2479
2480         Reviewed by David Kilzer.
2481
2482         No new tests, but this fixes API tests in some release builds after
2483         the patch from https://bugs.webkit.org/show_bug.cgi?id=161668 is recommitted.
2484
2485         * platform/URLParser.cpp:
2486         (WebCore::serializeIPv6):
2487         Don't go out of bounds.  Don't assume that the memory immediately after the end of the array will be empty.
2488
2489 2016-09-07  Alex Christensen  <achristensen@webkit.org>
2490
2491         Roll out r205580 and r205582.
2492         https://bugs.webkit.org/show_bug.cgi?id=161668
2493
2494         I need to figure out why this is failing on the bots before landing any more URLParser progress.
2495
2496 2016-09-07  Yusuke Suzuki  <utatane.tea@gmail.com>
2497
2498         Unreviewed, EFL build fix after r205581
2499         https://bugs.webkit.org/show_bug.cgi?id=161674
2500
2501         * dom/LoadableClassicScript.cpp:
2502         (WebCore::LoadableClassicScript::notifyFinished):
2503
2504 2016-09-07  Alex Christensen  <achristensen@webkit.org>
2505
2506         Fix API tests after r205580
2507         https://bugs.webkit.org/show_bug.cgi?id=161668
2508
2509         No new tests, but this fixes API tests on bots.
2510
2511         * platform/URLParser.cpp:
2512         (WebCore::domainToASCII):
2513         This function seems to be appending characters to strings sometimes on some configurations.
2514         This definitely needs further investigation, but this will fix the bots, and nothing else
2515         will be affected because the URLParser is disabled by default.
2516
2517 2016-09-07  Yusuke Suzuki  <utatane.tea@gmail.com>
2518
2519         Introduce abstract class LoadableScript for classic script and module graph
2520         https://bugs.webkit.org/show_bug.cgi?id=161674
2521
2522         Reviewed by Ryosuke Niwa.
2523
2524         To prepare for ScriptModuleGraph, we introduce the abstract class over the classic script
2525         and the module script, LoadableScript.
2526
2527         No behavior change.
2528
2529         * CMakeLists.txt:
2530         * WebCore.xcodeproj/project.pbxproj:
2531         * dom/LoadableClassicScript.cpp: Added. LoadableClassicScript is the derived class from the
2532         LoadableScript. In the module patch, we will introduce LoadableScriptModuleGraph which is also
2533         the derived class from the LoadableScript. It is used for the external classic script.
2534         A CachedResourceHandle used here alone does not prevent the underlying CachedResource from purging its
2535         data buffer. This LoadableClassicScript holds a client until this class is destroyed in order to
2536         guarantee that the data buffer will not be purged.
2537         (WebCore::LoadableClassicScript::create):
2538         (WebCore::LoadableClassicScript::LoadableClassicScript):
2539         (WebCore::LoadableClassicScript::~LoadableClassicScript):
2540         (WebCore::LoadableClassicScript::isLoaded):
2541         (WebCore::LoadableClassicScript::wasErrored): Beyond the boolean value, this can return the detail
2542         of the error. This detailed information will be used to report it to the inspector in the ScriptElement.
2543         (WebCore::LoadableClassicScript::wasCanceled):
2544         (WebCore::LoadableClassicScript::notifyFinished): Nosniff and cross-origin loading errors are handled here,
2545         instead of exposing CachedScript*.
2546         (WebCore::LoadableClassicScript::execute): Execute the cached script by using the given ScriptElement.
2547         * dom/LoadableClassicScript.h: Copied from Source/WebCore/dom/PendingScript.h.
2548         (isType):
2549         * dom/LoadableScript.cpp: Copied from Source/WebCore/dom/ScriptRunner.h. New wrapper for CachedScript
2550         and ScriptModuleGraph. We introduce a new wrapper to handle the above 2 things in the same way.
2551         We take the way to introduce a new wrapper instead of introducing a new interface that is inherited by
2552         CachedScript and ScriptModuleGraph. This is because ScriptModuleGraph is ref-counted while CachedScript
2553         is managed by CachedResourceHandle. While this patch does not contain ScriptModuleGraph part, this
2554         should be added in the module patch and at that time, this should be managed by this LoadableScript's
2555         subclass. And we introduce TypeCasts traits for LoadableScript to allow `is<>` and `downcast<>`.
2556         (WebCore::LoadableScript::addClient):
2557         (WebCore::LoadableScript::removeClient):
2558         (WebCore::LoadableScript::notifyClientFinished):
2559         * dom/LoadableScript.h: Copied from Source/WebCore/dom/ScriptRunner.h.
2560         (WebCore::LoadableScript::~LoadableScript):
2561         (WebCore::LoadableScript::isClassicScript):
2562         (WebCore::LoadableScript::isModuleGraph):
2563         * dom/LoadableScriptClient.h: Copied from Source/WebCore/dom/ScriptRunner.h.
2564         (WebCore::LoadableScriptClient::~LoadableScriptClient):
2565         * dom/PendingScript.cpp: Use LoadableScript instead of CachedScript.
2566         (WebCore::PendingScript::create):
2567         (WebCore::PendingScript::PendingScript):
2568         (WebCore::PendingScript::~PendingScript):
2569         (WebCore::PendingScript::loadableScript):
2570         (WebCore::PendingScript::notifyFinished):
2571         (WebCore::PendingScript::isLoaded):
2572         (WebCore::PendingScript::wasErrored):
2573         (WebCore::PendingScript::cachedScript): Deleted.
2574         * dom/PendingScript.h:
2575         * dom/ScriptElement.cpp:
2576         (WebCore::ScriptElement::ScriptElement):
2577         (WebCore::ScriptElement::handleSourceAttribute): Change sourceUrl to sourceURL to be consistent.
2578         (WebCore::ScriptElement::prepareScript):
2579         (WebCore::ScriptElement::requestClassicScript): requestScript is renamed to requestClassicScript.
2580         (WebCore::ScriptElement::requestScriptWithCache): Extract the code requesting the
2581         CachedScript from requestScript. This will also be used by the module fetcher.
2582         (WebCore::ScriptElement::executeScript): Now inspector error reporting is also done in this function.
2583         When an error occurs, LoadableScript::wasErrored() returns the error which may include the information
2584         to report the error to the inspector. nosniff and cross-origin loading errors are now detected by the
2585         LoadableClassicScript and reported through this wasErrored().
2586         (WebCore::ScriptElement::stopLoadRequest):
2587         (WebCore::ScriptElement::executeScriptAndDispatchEvent):
2588         (WebCore::ScriptElement::executeScriptForScriptRunner): Move the code from ScriptRunner. This function
2589         calls removeClient(*this) because ScriptRunner is driven by the ScriptElement's notification. Only when using
2590         ScriptRunner, we call addClient(*this) for ScriptElement. This is tricky, we should refactor this in the separated
2591         bug (https://bugs.webkit.org/show_bug.cgi?id=161726).
2592         (WebCore::ScriptElement::executeScriptForHTMLScriptRunner): Move the code from HTMLScriptRunner.
2593         (WebCore::ScriptElement::notifyFinished):
2594         (WebCore::ScriptElement::requestScript): Deleted.
2595         (WebCore::ScriptElement::execute): Deleted.
2596         * dom/ScriptElement.h:
2597         (WebCore::ScriptElement::loadableScript):
2598         (WebCore::ScriptElement::cachedScript): Deleted.
2599         * dom/ScriptRunner.cpp:
2600         (WebCore::ScriptRunner::queueScriptForExecution):
2601         (WebCore::ScriptRunner::timerFired): Use ScriptElement::executeScriptForScriptRunner.
2602         * dom/ScriptRunner.h:
2603         * html/parser/HTMLScriptRunner.cpp:
2604         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
2605         (WebCore::requestPendingScript):
2606         (WebCore::HTMLScriptRunner::requestParsingBlockingScript):
2607         (WebCore::HTMLScriptRunner::sourceFromPendingScript): Deleted.
2608         * html/parser/HTMLScriptRunner.h: Use ScriptElement::executeScriptForHTMLScriptRunner.
2609         * xml/parser/XMLDocumentParserLibxml2.cpp: Currently, we do nothing about XMLDocument in this patch.
2610         We should support the module script, but before that, we should refactor this pending script handling.
2611         (WebCore::XMLDocumentParser::endElementNs):
2612
2613 2016-09-07  Alex Christensen  <achristensen@webkit.org>
2614
2615         Unreviewed, revert r205533.
2616         https://bugs.webkit.org/show_bug.cgi?id=161668
2617
2618         Re-landing changesets:
2619
2620         "Punycode encode non-ascii hosts in URLParser"
2621         https://bugs.webkit.org/show_bug.cgi?id=161655
2622         http://trac.webkit.org/changeset/205521
2623
2624         "Fix query-only and fragment-only relative URLs when using
2625         URLParser"
2626         https://bugs.webkit.org/show_bug.cgi?id=161657
2627         http://trac.webkit.org/changeset/205526
2628
2629         "URLParser should parse / as a relative URL"
2630         https://bugs.webkit.org/show_bug.cgi?id=161667
2631         http://trac.webkit.org/changeset/205532
2632
2633 2016-09-07  Simon Fraser  <simon.fraser@apple.com>
2634
2635         Enable the <meter> element on iOS
2636         https://bugs.webkit.org/show_bug.cgi?id=161714
2637         rdar://problem/8978410
2638
2639         Reviewed by Tim Horton.
2640
2641         Define ENABLE_METER_ELEMENT unconditionally now.
2642         
2643         Rendering falls back to html.css rendering, which makes <meter> looks similar between
2644         macOS and iOS.
2645
2646         Tested by enabling existing tests.
2647
2648         * Configurations/FeatureDefines.xcconfig:
2649
2650 2016-09-07  Eric Carlson  <eric.carlson@apple.com>
2651
2652         [MediaStream] applyConstraints pt. 2 - advanced constraints
2653         https://bugs.webkit.org/show_bug.cgi?id=161715
2654         <rdar://problem/28195461>
2655
2656         Reviewed by Dean Jackson.
2657
2658         Test: fast/mediastream/apply-constraints-advanced.html
2659
2660         * platform/mediastream/MediaConstraints.cpp:
2661         (WebCore::MediaConstraint::create): Return Ref<>, not RefPtr<>.
2662         (WebCore::MediaConstraint::copy): New
2663         (WebCore::IntConstraint::copy): Ditto.
2664         (WebCore::DoubleConstraint::copy): Ditto.
2665         (WebCore::BooleanConstraint::copy): Ditto.
2666         (WebCore::StringConstraint::copy): Ditto.
2667         (WebCore::StringConstraint::fitnessDistance): New, compute the fitness distance between the
2668           constraint and the specified value.
2669         (WebCore::StringConstraint::merge): New, merge value into constraint.
2670         (WebCore::FlattenedConstraint::set): New, add or replace a constraint.
2671         (WebCore::FlattenedConstraint::merge): New, merge or add a constraint.
2672         * platform/mediastream/MediaConstraints.h:
2673         (WebCore::MediaConstraint::fitnessDistance):
2674         (WebCore::MediaConstraint::merge):
2675         (WebCore::NumericConstraint::nearlyEqual):
2676         (WebCore::FlattenedConstraint::isEmpty):
2677         (WebCore::FlattenedConstraint::begin):
2678         (WebCore::FlattenedConstraint::end):
2679         (WebCore::MediaConstraint::~MediaConstraint): Deleted.
2680         (WebCore::MediaConstraint::find): Deleted.
2681         (WebCore::MediaConstraint::getIdeal): Deleted.
2682
2683         * platform/mediastream/RealtimeMediaSource.cpp:
2684         (WebCore::RealtimeMediaSource::fitnessDistance): Return the fitness distance between the source
2685           capabilities and a constraint.
2686         (WebCore::applyNumericConstraint): New, apply a numeric constraint.
2687         (WebCore::RealtimeMediaSource::applyConstraint): Use applyNumericConstraint.
2688         (WebCore::RealtimeMediaSource::selectSettings): New, implement the SelectSettings algorithm
2689         (WebCore::RealtimeMediaSource::applyConstraints):
2690         (WebCore::RealtimeMediaSource::supportsConstraint): Deleted.
2691         (WebCore::value): Deleted.
2692         * platform/mediastream/RealtimeMediaSource.h:
2693
2694 2016-09-07  Mark Lam  <mark.lam@apple.com>
2695
2696         Add CatchScope and force all exception checks to be via ThrowScope or CatchScope.
2697         https://bugs.webkit.org/show_bug.cgi?id=161498
2698
2699         Reviewed by Geoffrey Garen.
2700
2701         No new test because there is no behavior change in general except for 1 bug fix.
2702         That bug is already caught by existing tests with the introduction of the CatchScope.
2703
2704         Fixes a bug in JSEventListener::handleEvent() where the exception thrown from
2705         a failed attempt to get the handleEvent callback is not handled.
2706
2707         * ForwardingHeaders/runtime/CatchScope.h: Added.
2708         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
2709         (WebCore::CDMSessionClearKey::update):
2710         * Modules/indexeddb/IDBObjectStore.cpp:
2711         (WebCore::IDBObjectStore::putOrAdd):
2712         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2713         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
2714         * Modules/mediastream/SDPProcessor.cpp:
2715         (WebCore::SDPProcessor::callScript):
2716         * Modules/plugins/QuickTimePluginReplacement.mm:
2717         (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
2718         (WebCore::QuickTimePluginReplacement::installReplacement):
2719         * bindings/js/ArrayValue.cpp:
2720         (WebCore::ArrayValue::get):
2721         * bindings/js/Dictionary.cpp:
2722         (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
2723         * bindings/js/IDBBindingUtilities.cpp:
2724         (WebCore::toJS):
2725         * bindings/js/JSApplePaySessionCustom.cpp:
2726         (WebCore::JSApplePaySession::completeShippingMethodSelection):
2727         (WebCore::JSApplePaySession::completeShippingContactSelection):
2728         (WebCore::JSApplePaySession::completePaymentMethodSelection):
2729         * bindings/js/JSAudioTrackCustom.cpp:
2730         (WebCore::JSAudioTrack::setKind):
2731         (WebCore::JSAudioTrack::setLanguage):
2732         * bindings/js/JSBlobCustom.cpp:
2733         (WebCore::constructJSBlob):
2734         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2735         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
2736         * bindings/js/JSCommandLineAPIHostCustom.cpp:
2737         (WebCore::getJSListenerFunctions):
2738         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2739         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
2740         (WebCore::getHashAlgorithm):
2741         (WebCore::createAesCbcParams):
2742         (WebCore::createAesKeyGenParams):
2743         (WebCore::createHmacParams):
2744         (WebCore::createHmacKeyParams):
2745         (WebCore::createRsaKeyGenParams):
2746         (WebCore::createRsaOaepParams):
2747         (WebCore::createRsaSsaParams):
2748         * bindings/js/JSCryptoKeySerializationJWK.cpp:
2749         (WebCore::getJSArrayFromJSON):
2750         (WebCore::getStringFromJSON):
2751         (WebCore::getBooleanFromJSON):
2752         (WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
2753         (WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
2754         (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
2755         (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
2756         (WebCore::JSCryptoKeySerializationJWK::keyData):
2757         (WebCore::buildJSONForRSAComponents):
2758         (WebCore::addUsagesToJSON):
2759         (WebCore::JSCryptoKeySerializationJWK::serialize):
2760         * bindings/js/JSCustomElementInterface.cpp:
2761         (WebCore::JSCustomElementInterface::constructElement):
2762         (WebCore::constructCustomElementSynchronously):
2763         (WebCore::JSCustomElementInterface::upgradeElement):
2764         * bindings/js/JSCustomElementRegistryCustom.cpp:
2765         (WebCore::getCustomElementCallback):
2766         (WebCore::JSCustomElementRegistry::define):
2767         (WebCore::whenDefinedPromise):
2768         (WebCore::JSCustomElementRegistry::whenDefined):
2769         * bindings/js/JSDOMBinding.cpp:
2770         (WebCore::valueToUSVString):
2771         (WebCore::reportException):
2772         (WebCore::reportCurrentException):
2773         (WebCore::setDOMException):
2774         (WebCore::hasIteratorMethod):
2775         (WebCore::toSmallerInt):
2776         (WebCore::toSmallerUInt):
2777         (WebCore::toInt32EnforceRange):
2778         (WebCore::toUInt32EnforceRange):
2779         (WebCore::toInt64EnforceRange):
2780         (WebCore::toUInt64EnforceRange):
2781         (WebCore::throwNotSupportedError):
2782         (WebCore::throwInvalidStateError):
2783         (WebCore::throwSecurityError):
2784         * bindings/js/JSDOMBinding.h:
2785         (WebCore::toJSSequence):
2786         (WebCore::toJS):
2787         (WebCore::jsFrozenArray):
2788         (WebCore::NativeValueTraits<String>::nativeValue):
2789         (WebCore::NativeValueTraits<unsigned>::nativeValue):
2790         (WebCore::NativeValueTraits<float>::nativeValue):
2791         (WebCore::NativeValueTraits<double>::nativeValue):
2792         (WebCore::toNativeArray):
2793         * bindings/js/JSDOMGlobalObject.cpp:
2794         (WebCore::makeThisTypeErrorForBuiltins):
2795         (WebCore::makeGetterTypeErrorForBuiltins):
2796         * bindings/js/JSDOMGlobalObjectTask.cpp:
2797         * bindings/js/JSDOMIterator.h:
2798         (WebCore::iteratorForEach):
2799         * bindings/js/JSDOMPromise.cpp:
2800         (WebCore::rejectPromiseWithExceptionIfAny):
2801         * bindings/js/JSDOMPromise.h:
2802         (WebCore::callPromiseFunction):
2803         * bindings/js/JSDOMStringMapCustom.cpp:
2804         (WebCore::JSDOMStringMap::putDelegate):
2805         * bindings/js/JSDOMWindowBase.cpp:
2806         (WebCore::JSDOMWindowMicrotaskCallback::call):
2807         * bindings/js/JSDOMWindowCustom.cpp:
2808         (WebCore::JSDOMWindow::setLocation):
2809         (WebCore::JSDOMWindow::open):
2810         (WebCore::JSDOMWindow::showModalDialog):
2811         (WebCore::handlePostMessage):
2812         (WebCore::JSDOMWindow::setTimeout):
2813         (WebCore::JSDOMWindow::setInterval):
2814         * bindings/js/JSDataCueCustom.cpp:
2815         (WebCore::constructJSDataCue):
2816         * bindings/js/JSDeviceMotionEventCustom.cpp:
2817         (WebCore::readAccelerationArgument):
2818         (WebCore::readRotationRateArgument):
2819         (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
2820         * bindings/js/JSDictionary.cpp:
2821         (WebCore::JSDictionary::tryGetProperty):
2822         (WebCore::JSDictionary::convertValue):
2823         * bindings/js/JSDictionary.h:
2824         (WebCore::JSDictionary::tryGetPropertyAndResult):
2825         * bindings/js/JSDocumentCustom.cpp:
2826         (WebCore::JSDocument::getCSSCanvasContext):
2827         * bindings/js/JSEventListener.cpp:
2828         (WebCore::JSEventListener::handleEvent):
2829         * bindings/js/JSFileCustom.cpp:
2830         (WebCore::constructJSFile):
2831         * bindings/js/JSGeolocationCustom.cpp:
2832         (WebCore::createPositionOptions):
2833         (WebCore::JSGeolocation::getCurrentPosition):
2834         (WebCore::JSGeolocation::watchPosition):
2835         * bindings/js/JSHTMLAllCollectionCustom.cpp:
2836         (WebCore::callHTMLAllCollection):
2837         * bindings/js/JSHTMLCanvasElementCustom.cpp:
2838         (WebCore::get3DContextAttributes):
2839         (WebCore::JSHTMLCanvasElement::getContext):
2840         (WebCore::JSHTMLCanvasElement::probablySupportsContext):
2841         * bindings/js/JSHTMLElementCustom.cpp:
2842         (WebCore::constructJSHTMLElement):
2843         * bindings/js/JSHistoryCustom.cpp:
2844         (WebCore::JSHistory::pushState):
2845         (WebCore::JSHistory::replaceState):
2846         * bindings/js/JSIDBDatabaseCustom.cpp:
2847         (WebCore::JSIDBDatabase::createObjectStore):
2848         * bindings/js/JSLazyEventListener.cpp:
2849         (WebCore::JSLazyEventListener::initializeJSFunction):
2850         * bindings/js/JSMainThreadExecState.h:
2851         (WebCore::JSMainThreadExecState::linkAndEvaluateModule):
2852         (WebCore::JSMainThreadExecState::~JSMainThreadExecState):
2853         * bindings/js/JSMessageEventCustom.cpp:
2854         (WebCore::handleInitMessageEvent):
2855         * bindings/js/JSMessagePortCustom.cpp:
2856         (WebCore::fillMessagePortArray):
2857         * bindings/js/JSMessagePortCustom.h:
2858         (WebCore::handlePostMessage):
2859         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
2860         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
2861         (WebCore::toDecision):
2862         (WebCore::JSMockContentFilterSettings::setDecision):
2863         (WebCore::JSMockContentFilterSettings::setUnblockRequestDecision):
2864         * bindings/js/JSNodeFilterCustom.cpp:
2865         (WebCore::JSNodeFilter::acceptNode):
2866         * bindings/js/JSNodeOrString.cpp:
2867         (WebCore::toNodeOrStringVector):
2868         * bindings/js/JSSQLTransactionCustom.cpp:
2869         (WebCore::JSSQLTransaction::executeSql):
2870         * bindings/js/JSSVGLengthCustom.cpp:
2871         (WebCore::JSSVGLength::convertToSpecifiedUnits):
2872         * bindings/js/JSStorageCustom.cpp:
2873         (WebCore::JSStorage::getOwnPropertyNames):
2874         (WebCore::JSStorage::putDelegate):
2875         * bindings/js/JSTextTrackCustom.cpp:
2876         (WebCore::JSTextTrack::setLanguage):
2877         * bindings/js/JSVideoTrackCustom.cpp:
2878         (WebCore::JSVideoTrack::setKind):
2879         (WebCore::JSVideoTrack::setLanguage):
2880         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
2881         (WebCore::JSWebGL2RenderingContext::getIndexedParameter):
2882         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
2883         (WebCore::getObjectParameter):
2884         (WebCore::JSWebGLRenderingContextBase::getExtension):
2885         (WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
2886         (WebCore::JSWebGLRenderingContextBase::getParameter):
2887         (WebCore::JSWebGLRenderingContextBase::getProgramParameter):
2888         (WebCore::JSWebGLRenderingContextBase::getShaderParameter):
2889         (WebCore::toVector):
2890         (WebCore::dataFunctionf):
2891         (WebCore::dataFunctionMatrix):
2892         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
2893         (WebCore::createAlgorithmFromJSValue):
2894         (WebCore::cryptoKeyFormatFromJSValue):
2895         (WebCore::cryptoKeyUsagesFromJSValue):
2896         (WebCore::JSWebKitSubtleCrypto::encrypt):
2897         (WebCore::JSWebKitSubtleCrypto::decrypt):
2898         (WebCore::JSWebKitSubtleCrypto::sign):
2899         (WebCore::JSWebKitSubtleCrypto::verify):
2900         (WebCore::JSWebKitSubtleCrypto::digest):
2901         (WebCore::JSWebKitSubtleCrypto::generateKey):
2902         (WebCore::importKey):
2903         (WebCore::JSWebKitSubtleCrypto::importKey):
2904         (WebCore::exportKey):
2905         (WebCore::JSWebKitSubtleCrypto::exportKey):
2906         (WebCore::JSWebKitSubtleCrypto::wrapKey):
2907         (WebCore::JSWebKitSubtleCrypto::unwrapKey):
2908         * bindings/js/JSWorkerCustom.cpp:
2909         (WebCore::constructJSWorker):
2910         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2911         (WebCore::JSWorkerGlobalScope::importScripts):
2912         (WebCore::JSWorkerGlobalScope::setTimeout):
2913         (WebCore::JSWorkerGlobalScope::setInterval):
2914         * bindings/js/ReadableStreamDefaultController.cpp:
2915         (WebCore::ReadableStreamDefaultController::invoke):
2916         (WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked):
2917         * bindings/js/ReadableStreamDefaultController.h:
2918         (WebCore::ReadableStreamDefaultController::enqueue):
2919         * bindings/js/ScheduledAction.cpp:
2920         (WebCore::ScheduledAction::create):
2921         * bindings/js/ScriptGlobalObject.cpp:
2922         (WebCore::ScriptGlobalObject::set):
2923         * bindings/js/SerializedScriptValue.cpp:
2924         (WebCore::CloneBase::shouldTerminate):
2925         (WebCore::CloneDeserializer::deserialize):
2926         (WebCore::SerializedScriptValue::create):
2927         (WebCore::SerializedScriptValue::deserialize):
2928         * bindings/js/WorkerScriptController.cpp:
2929         (WebCore::WorkerScriptController::evaluate):
2930         * bindings/scripts/CodeGeneratorJS.pm:
2931         (GenerateDictionaryImplementationContent):
2932         (GenerateImplementation):
2933         (GenerateParametersCheck):
2934         (GenerateImplementationFunctionCall):
2935         (GenerateConstructorDefinition):
2936         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2937         (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
2938         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2939         (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
2940         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2941         (WebCore::JSTestEventConstructorConstructor::construct):
2942         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2943         (WebCore::jsTestEventTargetPrototypeFunctionItem):
2944         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2945         (WebCore::setJSTestGlobalObjectRegularAttribute):
2946         (WebCore::setJSTestGlobalObjectPublicAndPrivateAttribute):
2947         (WebCore::setJSTestGlobalObjectPublicAndPrivateConditionalAttribute):
2948         (WebCore::setJSTestGlobalObjectEnabledAtRuntimeAttribute):
2949         (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation):
2950         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1):
2951         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2):
2952         * bindings/scripts/test/JS/JSTestInterface.cpp:
2953         (WebCore::JSTestInterfaceConstructor::construct):
2954         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
2955         (WebCore::setJSTestInterfaceImplementsStr2):
2956         (WebCore::setJSTestInterfaceImplementsStr3):
2957         (WebCore::setJSTestInterfaceImplementsNode):
2958         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
2959         (WebCore::setJSTestInterfaceSupplementalStr2):
2960         (WebCore::setJSTestInterfaceSupplementalStr3):
2961         (WebCore::setJSTestInterfaceSupplementalNode):
2962         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
2963         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
2964         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2965         (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
2966         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2967         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
2968         * bindings/scripts/test/JS/JSTestNode.cpp:
2969         (WebCore::setJSTestNodeName):
2970         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2971         (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
2972         (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
2973         (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
2974         (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
2975         * bindings/scripts/test/JS/JSTestObj.cpp:
2976         (WebCore::convertDictionary<TestObj::Dictionary>):
2977         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
2978         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
2979         (WebCore::convertDictionary<AlternateDictionaryName>):
2980         (WebCore::setJSTestObjConstructorStaticStringAttr):
2981         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
2982         (WebCore::setJSTestObjEnumAttr):
2983         (WebCore::setJSTestObjByteAttr):
2984         (WebCore::setJSTestObjOctetAttr):
2985         (WebCore::setJSTestObjShortAttr):
2986         (WebCore::setJSTestObjClampedShortAttr):
2987         (WebCore::setJSTestObjEnforceRangeShortAttr):
2988         (WebCore::setJSTestObjUnsignedShortAttr):
2989         (WebCore::setJSTestObjLongAttr):
2990         (WebCore::setJSTestObjLongLongAttr):
2991         (WebCore::setJSTestObjUnsignedLongLongAttr):
2992         (WebCore::setJSTestObjStringAttr):
2993         (WebCore::setJSTestObjUsvstringAttr):
2994         (WebCore::setJSTestObjTestObjAttr):
2995         (WebCore::setJSTestObjTestNullableObjAttr):
2996         (WebCore::setJSTestObjLenientTestObjAttr):
2997         (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString):
2998         (WebCore::setJSTestObjUsvstringAttrTreatingNullAsEmptyString):
2999         (WebCore::setJSTestObjImplementationEnumAttr):
3000         (WebCore::setJSTestObjXMLObjAttr):
3001         (WebCore::setJSTestObjCreate):
3002         (WebCore::setJSTestObjReflectedStringAttr):
3003         (WebCore::setJSTestObjReflectedUSVStringAttr):
3004         (WebCore::setJSTestObjReflectedIntegralAttr):
3005         (WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
3006         (WebCore::setJSTestObjReflectedBooleanAttr):
3007         (WebCore::setJSTestObjReflectedURLAttr):
3008         (WebCore::setJSTestObjReflectedUSVURLAttr):
3009         (WebCore::setJSTestObjReflectedCustomIntegralAttr):
3010         (WebCore::setJSTestObjReflectedCustomBooleanAttr):
3011         (WebCore::setJSTestObjReflectedCustomURLAttr):
3012         (WebCore::setJSTestObjEnabledAtRuntimeAttribute):
3013         (WebCore::setJSTestObjTypedArrayAttr):
3014         (WebCore::setJSTestObjAttrWithGetterException):
3015         (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
3016         (WebCore::setJSTestObjAttrWithSetterException):
3017         (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
3018         (WebCore::setJSTestObjStringAttrWithGetterException):
3019         (WebCore::setJSTestObjStringAttrWithSetterException):
3020         (WebCore::setJSTestObjCustomAttr):
3021         (WebCore::setJSTestObjOnfoo):
3022         (WebCore::setJSTestObjOnwebkitfoo):
3023         (WebCore::setJSTestObjWithScriptStateAttribute):
3024         (WebCore::setJSTestObjWithCallWithAndSetterCallWithAttribute):
3025         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
3026         (WebCore::setJSTestObjWithScriptStateAttributeRaises):
3027         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
3028         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
3029         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
3030         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
3031         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
3032         (WebCore::setJSTestObjConditionalAttr1):
3033         (WebCore::setJSTestObjConditionalAttr2):
3034         (WebCore::setJSTestObjConditionalAttr3):
3035         (WebCore::setJSTestObjConditionalAttr4Constructor):
3036         (WebCore::setJSTestObjConditionalAttr5Constructor):
3037         (WebCore::setJSTestObjConditionalAttr6Constructor):
3038         (WebCore::setJSTestObjAnyAttribute):
3039         (WebCore::setJSTestObjMutablePoint):
3040         (WebCore::setJSTestObjImmutablePoint):
3041         (WebCore::setJSTestObjStrawberry):
3042         (WebCore::setJSTestObjId):
3043         (WebCore::setJSTestObjReplaceableAttribute):
3044         (WebCore::setJSTestObjNullableLongSettableAttribute):
3045         (WebCore::setJSTestObjNullableStringSettableAttribute):
3046         (WebCore::setJSTestObjNullableUSVStringSettableAttribute):
3047         (WebCore::setJSTestObjNullableStringValue):
3048         (WebCore::setJSTestObjAttributeWithReservedEnumType):
3049         (WebCore::setJSTestObjPutForwardsAttribute):
3050         (WebCore::setJSTestObjPutForwardsNullableAttribute):
3051         (WebCore::setJSTestObjStringifierAttribute):
3052         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1):
3053         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2):
3054         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
3055         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
3056         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
3057         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
3058         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
3059         (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString):
3060         (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
3061         (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
3062         (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg):
3063         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArg):
3064         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue):
3065         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
3066         (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg):
3067         (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg):
3068         (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString):
3069         (WebCore::jsTestObjPrototypeFunctionSerializedValue):
3070         (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
3071         (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod):
3072         (WebCore::jsTestObjPrototypeFunctionAddEventListener):
3073         (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
3074         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj):
3075         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
3076         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
3077         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
3078         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
3079         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
3080         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
3081         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
3082         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
3083         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVString):
3084         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicString):
3085         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
3086         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringAndDefaultValue):
3087         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNull):
3088         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
3089         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNull):
3090         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyString):
3091         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyString):
3092         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyString):
3093         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
3094         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
3095         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLong):
3096         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZero):
3097         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLong):
3098         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZero):
3099         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
3100         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
3101         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
3102         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
3103         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver):
3104         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
3105         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
3106         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
3107         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
3108         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
3109         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
3110         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
3111         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
3112         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
3113         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
3114         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
3115         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
3116         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
3117         (WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
3118         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
3119         (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
3120         (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
3121         (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
3122         (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
3123         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
3124         (WebCore::jsTestObjPrototypeFunctionGetElementById):
3125         (WebCore::jsTestObjPrototypeFunctionConvert3):
3126         (WebCore::jsTestObjPrototypeFunctionConvert4):
3127         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
3128         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
3129         (WebCore::jsTestObjPrototypeFunctionAny):
3130         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
3131         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
3132         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
3133         (WebCore::jsTestObjPrototypeFunctionConditionalOverload1):
3134         (WebCore::jsTestObjPrototypeFunctionConditionalOverload2):
3135         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
3136         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
3137         (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
3138         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3139         (WebCore::constructJSTestOverloadedConstructors1):
3140         (WebCore::constructJSTestOverloadedConstructors2):
3141         (WebCore::constructJSTestOverloadedConstructors4):
3142         (WebCore::constructJSTestOverloadedConstructors5):
3143         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3144         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
3145         (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
3146         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3147         (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
3148         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3149         (WebCore::setJSTestSerializedScriptValueInterfaceValue):
3150         (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
3151         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3152         (WebCore::JSTestTypedefsConstructor::construct):
3153         (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
3154         (WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
3155         (WebCore::setJSTestTypedefsAttrWithGetterException):
3156         (WebCore::setJSTestTypedefsAttrWithSetterException):
3157         (WebCore::setJSTestTypedefsStringAttrWithGetterException):
3158         (WebCore::setJSTestTypedefsStringAttrWithSetterException):
3159         (WebCore::jsTestTypedefsPrototypeFunctionFunc):
3160         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
3161         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
3162         (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg):
3163         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
3164         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
3165         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
3166         (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
3167         * bridge/NP_jsobject.cpp:
3168         (_NPN_InvokeDefault):
3169         (_NPN_Invoke):
3170         (_NPN_Evaluate):
3171         (_NPN_GetProperty):
3172         (_NPN_SetProperty):
3173         (_NPN_RemoveProperty):
3174         (_NPN_HasProperty):
3175         (_NPN_HasMethod):
3176         (_NPN_Enumerate):
3177         (_NPN_Construct):
3178         * bridge/c/c_instance.cpp:
3179         (JSC::Bindings::CInstance::moveGlobalExceptionToExecState):
3180         * bridge/objc/WebScriptObject.mm:
3181         (WebCore::addExceptionToConsole):
3182         (-[WebScriptObject callWebScriptMethod:withArguments:]):
3183         (-[WebScriptObject evaluateWebScript:]):
3184         (-[WebScriptObject setValue:forKey:]):
3185         (-[WebScriptObject valueForKey:]):
3186         (-[WebScriptObject removeWebScriptKey:]):
3187         (-[WebScriptObject hasWebScriptKey:]):
3188         (-[WebScriptObject webScriptValueAtIndex:]):
3189         (-[WebScriptObject setWebScriptValueAtIndex:value:]):
3190         * contentextensions/ContentExtensionParser.cpp:
3191         (WebCore::ContentExtensions::getDomainList):
3192         (WebCore::ContentExtensions::getTypeFlags):
3193         (WebCore::ContentExtensions::loadTrigger):
3194         (WebCore::ContentExtensions::loadAction):
3195         (WebCore::ContentExtensions::loadEncodedRules):
3196         * html/HTMLMediaElement.cpp:
3197         (WebCore::controllerJSValue):
3198         (WebCore::HTMLMediaElement::updateCaptionContainer):
3199         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
3200         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
3201         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
3202         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
3203         * html/HTMLPlugInImageElement.cpp:
3204         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
3205
3206 2016-09-07  Chris Dumez  <cdumez@apple.com>
3207
3208         Fix handling of negative radius in HTMLAreaElement's coords when in circle state
3209         https://bugs.webkit.org/show_bug.cgi?id=161690
3210
3211         Reviewed by Daniel Bates.
3212
3213         Fix handling of negative radius in HTMLAreaElement's coords when in
3214         circle state:
3215         - https://html.spec.whatwg.org/#attr-area-shape-circle
3216
3217         The radius must be non-negative as per the specification. However, our
3218         code fails to check.
3219
3220         Firefox and Chrome both reject negative radius.
3221
3222         No new tests, rebaselined existing test.
3223
3224         * html/HTMLAreaElement.cpp:
3225         (WebCore::HTMLAreaElement::getRegion):
3226
3227 2016-09-07  Chris Dumez  <cdumez@apple.com>
3228
3229         Align HTMLAreaElement shape parsing with the specification
3230         https://bugs.webkit.org/show_bug.cgi?id=161698
3231
3232         Reviewed by Daniel Bates.
3233
3234         Align HTMLAreaElement shape parsing with the specification:
3235         - https://html.spec.whatwg.org/#attr-area-shape
3236
3237         In particular, add support for circ / polygon non conforming shapes
3238         and use rectangle as default state.
3239
3240         This also aligns our behavior with Chrome.
3241
3242         No new tests, rebaselined existing test.
3243
3244         * html/HTMLAreaElement.cpp:
3245         (WebCore::HTMLAreaElement::parseAttribute):
3246
3247 2016-09-07  Daniel Bates  <dabates@apple.com>
3248
3249         Fix WebCore build when building for device with iOS 10 beta SDK
3250
3251         Define SPI macro kIOReturnSuccess.
3252
3253         * platform/spi/cocoa/IOReturnSPI.h:
3254
3255 2016-09-07  Michael Catanzaro  <mcatanzaro@igalia.com>
3256
3257         [EFL] Switch to ENABLE_NETWORK_CACHE
3258         https://bugs.webkit.org/show_bug.cgi?id=152676
3259
3260         Reviewed by Alex Christensen.
3261
3262         * PlatformEfl.cmake: Add GRefPtrSoup to build.
3263         * platform/network/soup/SoupNetworkSession.cpp:
3264         (WebCore::SoupNetworkSession::clearOldSoupCache): Renamed from clearCache.
3265         (WebCore::SoupNetworkSession::setCache): Deleted.
3266         (WebCore::SoupNetworkSession::cache): Deleted.
3267         (WebCore::SoupNetworkSession::clearCache): Deleted.
3268         * platform/network/soup/SoupNetworkSession.h:
3269
3270 2016-09-07  Chris Dumez  <cdumez@apple.com>
3271
3272         Drop legacy canvas.probablySupportsContext()
3273         https://bugs.webkit.org/show_bug.cgi?id=161692
3274
3275         Reviewed by Alex Christensen.
3276
3277         Drop legacy canvas.probablySupportsContext() as it is no longer in the specification:
3278         - https://html.spec.whatwg.org/#htmlcanvaselement
3279
3280         Firefox and Chrome do not support canvas.probablySupportsContext().
3281
3282         No new tests, rebaselined existing test.
3283
3284         * bindings/js/JSHTMLCanvasElementCustom.cpp:
3285         (WebCore::JSHTMLCanvasElement::probablySupportsContext): Deleted.
3286         * html/HTMLCanvasElement.cpp:
3287         (WebCore::HTMLCanvasElement::getContext):
3288         (WebCore::HTMLCanvasElement::probablySupportsContext): Deleted.
3289         * html/HTMLCanvasElement.h:
3290         * html/HTMLCanvasElement.idl:
3291
3292 2016-09-07  Simon Fraser  <simon.fraser@apple.com>
3293
3294         Rename ScrollBehavior to ScrollAlignment::Behavior
3295         https://bugs.webkit.org/show_bug.cgi?id=161677
3296
3297         Reviewed by Tim Horton.
3298
3299         Free up ScrollBehavior for future use with CSS OM View scrolling by renaming the
3300         existing ScrollBehavior, which is about alignment when scrolling into view.
3301
3302         Renamed ScrollBehavior* to ScrollAlignment.*, and made ScrollBehavior an enum class
3303         in the struct.
3304
3305         No behavior change.
3306
3307         * CMakeLists.txt:
3308         * WebCore.xcodeproj/project.pbxproj:
3309         * editing/FrameSelection.h:
3310         * rendering/RenderLayer.cpp:
3311         (WebCore::RenderLayer::getRectToExpose):
3312         * rendering/RenderObject.h:
3313         * rendering/RenderingAllInOne.cpp:
3314         * rendering/ScrollAlignment.cpp: Renamed from Source/WebCore/rendering/ScrollBehavior.cpp.
3315         * rendering/ScrollAlignment.h: Renamed from Source/WebCore/rendering/ScrollBehavior.h.
3316         (WebCore::ScrollAlignment::getVisibleBehavior):
3317         (WebCore::ScrollAlignment::getPartialBehavior):
3318         (WebCore::ScrollAlignment::getHiddenBehavior):
3319         * rendering/ScrollBehavior.h:
3320         (WebCore::ScrollAlignment::getVisibleBehavior): Deleted.
3321         (WebCore::ScrollAlignment::getPartialBehavior): Deleted.
3322         (WebCore::ScrollAlignment::getHiddenBehavior): Deleted.
3323
3324 2016-09-07  Dave Hyatt  <hyatt@apple.com>
3325
3326         Add CSSAtRule id info for new parser
3327         https://bugs.webkit.org/show_bug.cgi?id=161695
3328
3329         Reviewed by Sam Weinig.
3330
3331         * WebCore.xcodeproj/project.pbxproj:
3332         * css/parser/CSSAtRuleID.cpp: Added.
3333         (WebCore::cssAtRuleID):
3334         * css/parser/CSSAtRuleID.h: Added.
3335
3336 2016-09-07  Youenn Fablet  <youenn@apple.com>
3337
3338         [Streams API] Separate compile flag for ReadableStream and WritableStream
3339         https://bugs.webkit.org/show_bug.cgi?id=161044
3340
3341         Reviewed by Alex Christensen.
3342
3343         Moving from STREAMS_API to READABLE_STREAM_API and WRITABLE_STREAM_API compilation flags.
3344         No change of behavior.
3345
3346         * CMakeLists.txt: Triggering regeneration of builtin wrapper files based on individual builtin header file content change to cope with @conditional changes.
3347         * Configurations/FeatureDefines.xcconfig:
3348         * DerivedSources.cpp:
3349         * DerivedSources.make: Triggering regeneration of builtin wrapper files based on file content change to cope with @conditional changes.
3350         * Modules/fetch/FetchBody.cpp:
3351         * Modules/fetch/FetchBody.h:
3352         * Modules/fetch/FetchBodyOwner.cpp:
3353         (WebCore::FetchBodyOwner::isDisturbed):
3354         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
3355         (WebCore::FetchBodyOwner::blobLoadingFailed):
3356         (WebCore::FetchBodyOwner::blobChunk):
3357         * Modules/fetch/FetchBodyOwner.h:
3358         * Modules/fetch/FetchResponse.cpp:
3359         (WebCore::FetchResponse::BodyLoader::didSucceed):
3360         (WebCore::FetchResponse::BodyLoader::didFail):
3361         (WebCore::FetchResponse::BodyLoader::didReceiveData):
3362         * Modules/fetch/FetchResponse.h:
3363         * Modules/fetch/FetchResponse.idl:
3364         * Modules/fetch/FetchResponse.js:
3365         (initializeFetchResponse):
3366         * Modules/fetch/FetchResponseSource.cpp:
3367         * Modules/fetch/FetchResponseSource.h:
3368         * Modules/streams/ByteLengthQueuingStrategy.idl:
3369         * Modules/streams/ByteLengthQueuingStrategy.js:
3370         * Modules/streams/CountQueuingStrategy.idl:
3371         * Modules/streams/CountQueuingStrategy.js:
3372         * Modules/streams/ReadableStream.idl:
3373         * Modules/streams/ReadableStream.js:
3374         * Modules/streams/ReadableStreamDefaultController.idl:
3375         * Modules/streams/ReadableStreamDefaultController.js:
3376         * Modules/streams/ReadableStreamDefaultReader.idl:
3377         * Modules/streams/ReadableStreamDefaultReader.js:
3378         * Modules/streams/ReadableStreamInternals.js:
3379         * Modules/streams/ReadableStreamSource.h:
3380         * Modules/streams/ReadableStreamSource.idl:
3381         * Modules/streams/StreamInternals.js:
3382         * Modules/streams/WritableStream.idl:
3383         * Modules/streams/WritableStream.js:
3384         * Modules/streams/WritableStreamInternals.js:
3385         * bindings/js/JSDOMGlobalObject.cpp:
3386         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
3387         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
3388         * bindings/js/JSReadableStreamPrivateConstructors.h:
3389         * bindings/js/JSReadableStreamSourceCustom.cpp:
3390         * bindings/js/ReadableStreamDefaultController.cpp:
3391         * bindings/js/ReadableStreamDefaultController.h:
3392         * testing/Internals.cpp:
3393         * testing/Internals.h:
3394         * testing/Internals.idl:
3395
3396 2016-09-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3397
3398         [GTK] Crash of WebProcess on the last WebView disconnect
3399         https://bugs.webkit.org/show_bug.cgi?id=161605
3400
3401         Reviewed by Michael Catanzaro.
3402
3403         Stop tracking X11 GL contexts to be cleanered on an exit handler. This was added to work around bugs on drivers,
3404         and it's assuming that all GLContext not deleted when the exit handler is called are leaked, which is no longer
3405         true, because PlatformDisplay now owns a GLContext and is deleted after exit handlers.
3406
3407         * platform/graphics/GLContext.cpp:
3408         (WebCore::GLContext::GLContext):
3409         (WebCore::GLContext::~GLContext):
3410         (WebCore::activeContextList): Deleted.
3411         (WebCore::GLContext::addActiveContext): Deleted.
3412         (WebCore::GLContext::removeActiveContext): Deleted.
3413         (WebCore::GLContext::cleanupActiveContextsAtExit): Deleted.
3414
3415 2016-09-07  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
3416
3417         Templatize JS bindings code generator of functions with variadic parameters
3418         https://bugs.webkit.org/show_bug.cgi?id=158835
3419
3420         Reviewed by Darin Adler.
3421
3422         Add template functions to handle function with variadic parameter for DOM objects.
3423
3424         * Modules/mediastream/RTCPeerConnection.cpp:
3425         (WebCore::RTCPeerConnection::addTrack):
3426         * Modules/mediastream/RTCPeerConnection.h:
3427