2015-09-09 Geoffrey Garen <ggaren@apple.com>
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-09-09  Chris Dumez  <cdumez@apple.com>
2
3         Setting document.title when there is no title and no head element should no nothing
4         https://bugs.webkit.org/show_bug.cgi?id=149005
5         <rdar://problem/22567524>
6
7         Reviewed by Ryosuke Niwa.
8
9         Setting document.title when there is no title element and no head
10         element should no nothing:
11         - https://html.spec.whatwg.org/multipage/dom.html#document.title
12
13         Firefox and Chrome comply with the specification. However, WebKit
14         was returning the updated title when querying document.title after
15         setting it.
16
17         No new tests, covered by existing tests.
18
19         * dom/Document.cpp:
20         (WebCore::Document::setTitle):
21
22 2015-09-09  Manuel Rego Casasnovas  <rego@igalia.com>
23
24         [css-grid] Percentage columns shouldn't include border and padding
25         https://bugs.webkit.org/show_bug.cgi?id=148978
26
27         Reviewed by Sergio Villar Senin.
28
29         Subtract border and padding when we're calculating the breadth of the
30         columns in LayoutGrid::computeUsedBreadthOfSpecifiedLength().
31
32         Added test to check the behavior for both columns and rows.
33
34         Test: fast/css-grid-layout/grid-percent-track-margin-border-padding.html
35
36         * rendering/RenderGrid.cpp:
37         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
38
39 2015-09-09  Commit Queue  <commit-queue@webkit.org>
40
41         Unreviewed, rolling out r189536 and r189538.
42         https://bugs.webkit.org/show_bug.cgi?id=149002
43
44         broke tests on mac (Requested by alexchristensen on #webkit).
45
46         Reverted changesets:
47
48         "min-width/height should default to auto for flexbox items"
49         https://bugs.webkit.org/show_bug.cgi?id=146020
50         http://trac.webkit.org/changeset/189536
51
52         "[css-grid] Percentage columns shouldn't include border and
53         padding"
54         https://bugs.webkit.org/show_bug.cgi?id=148978
55         http://trac.webkit.org/changeset/189538
56
57 2015-09-08  David Hyatt  <hyatt@apple.com>
58
59         REGRESSION: Inline-block baseline is wrong when zero-width replaced child is present
60         https://bugs.webkit.org/show_bug.cgi?id=147452
61         rdar://problem/21943074
62
63         Reviewed by Myles Maxfield.
64
65         Added new test in fast/inline-block
66
67         Treat zero width replaced elements the same as replaced elements with width. Instead of
68         clearing floats based off having no committed width, we instead track both committed
69         width and committed replaced objects. We do this with two new booleans in LineWidth
70         so that we know when we have uncomitted and committed replaced objects.
71
72         * rendering/line/BreakingContext.h:
73         (WebCore::BreakingContext::handleReplaced):
74         (WebCore::BreakingContext::handleText):
75         (WebCore::BreakingContext::canBreakAtThisPosition):
76         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
77         * rendering/line/LineWidth.cpp:
78         (WebCore::LineWidth::LineWidth):
79         (WebCore::LineWidth::commit):
80         (WebCore::LineWidth::applyOverhang):
81         * rendering/line/LineWidth.h:
82         (WebCore::LineWidth::committedWidth):
83         (WebCore::LineWidth::availableWidth):
84         (WebCore::LineWidth::logicalLeftOffset):
85         (WebCore::LineWidth::hasCommitted):
86         (WebCore::LineWidth::addUncommittedWidth):
87         (WebCore::LineWidth::addUncommittedReplacedWidth):
88
89 2015-09-09  Antti Koivisto  <antti@apple.com>
90
91         Split mixed font GlyphPage functionality to separate class
92         https://bugs.webkit.org/show_bug.cgi?id=148965
93
94         Reviewed by Myles Maxfield.
95
96         Currently GlyphPage class is used for both immutable single font case (in Font) and
97         for caching mixed font mappings (in FontCascadeFonts). It is cleaner to use separate
98         classed for these cases. This will also make future improvements easier.
99
100         * platform/graphics/Font.cpp:
101         (WebCore::Font::~Font):
102         (WebCore::fillGlyphPage):
103         (WebCore::createAndFillGlyphPage):
104         (WebCore::Font::glyphPage):
105         (WebCore::Font::glyphForCharacter):
106         (WebCore::Font::glyphDataForCharacter):
107         * platform/graphics/Font.h:
108         * platform/graphics/FontCascadeFonts.cpp:
109         (WebCore::MixedFontGlyphPage::MixedFontGlyphPage):
110         (WebCore::MixedFontGlyphPage::glyphDataForCharacter):
111         (WebCore::MixedFontGlyphPage::setGlyphDataForCharacter):
112         (WebCore::MixedFontGlyphPage::setGlyphDataForIndex):
113
114             Mixed font pages are now an implementation detail of FontCascadeFonts.
115
116         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::glyphDataForCharacter):
117         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::setGlyphDataForCharacter):
118         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::setSingleFontPage):
119
120             Cache entry is either shared single font GlyphPage or mutable MixedFontGlyphPage.
121
122         (WebCore::FontCascadeFonts::FontCascadeFonts):
123         (WebCore::FontCascadeFonts::glyphDataForCharacter):
124         (WebCore::FontCascadeFonts::pruneSystemFallbacks):
125         * platform/graphics/FontCascadeFonts.h:
126         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::isNull):
127         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::isMixedFont):
128         * platform/graphics/GlyphPage.h:
129
130             GlyphPage is now for single font mappings only.
131             Use regular allocation instead of variable size tricks.
132             It is always immutable after initialization (though currently a setter is still needed).
133
134         (WebCore::GlyphPage::create):
135         (WebCore::GlyphPage::~GlyphPage):
136         (WebCore::GlyphPage::count):
137         (WebCore::GlyphPage::indexForCharacter):
138         (WebCore::GlyphPage::glyphDataForCharacter):
139         (WebCore::GlyphPage::glyphForCharacter):
140         (WebCore::GlyphPage::glyphDataForIndex):
141         (WebCore::GlyphPage::glyphForIndex):
142         (WebCore::GlyphPage::setGlyphForIndex):
143         (WebCore::GlyphPage::font):
144         (WebCore::GlyphPage::GlyphPage):
145         (WebCore::GlyphPage::createForMixedFonts): Deleted.
146         (WebCore::GlyphPage::createCopyForMixedFonts): Deleted.
147         (WebCore::GlyphPage::createForSingleFont): Deleted.
148         (WebCore::GlyphPage::isImmutable): Deleted.
149         (WebCore::GlyphPage::setImmutable): Deleted.
150         (WebCore::GlyphPage::glyphAt): Deleted.
151         (WebCore::GlyphPage::fontForCharacter): Deleted.
152         (WebCore::GlyphPage::setGlyphDataForCharacter): Deleted.
153         (WebCore::GlyphPage::setGlyphDataForIndex): Deleted.
154         (WebCore::GlyphPage::hasPerGlyphFontData): Deleted.
155         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
156         (WebCore::GlyphPage::fill):
157         * platform/graphics/mac/GlyphPageMac.cpp:
158         (WebCore::GlyphPage::fill):
159         * platform/graphics/opentype/OpenTypeVerticalData.cpp:
160         (WebCore::OpenTypeVerticalData::substituteWithVerticalGlyphs):
161         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
162         (WebCore::GlyphPage::fill):
163         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
164         (WebCore::GlyphPage::fill):
165         * svg/SVGFontData.cpp:
166         (WebCore::SVGFontData::applySVGGlyphSelection):
167         (WebCore::SVGFontData::fillSVGGlyphPage):
168         (WebCore::SVGFontData::fillBMPGlyphs):
169         (WebCore::SVGFontData::fillNonBMPGlyphs):
170         * svg/SVGFontData.h:
171         (WebCore::SVGFontData::verticalAdvanceY):
172
173 2015-09-09  Manuel Rego Casasnovas  <rego@igalia.com>
174
175         [css-grid] Percentage columns shouldn't include border and padding
176         https://bugs.webkit.org/show_bug.cgi?id=148978
177
178         Reviewed by Sergio Villar Senin.
179
180         Subtract border and padding when we're calculating the breadth of the
181         columns in LayoutGrid::computeUsedBreadthOfSpecifiedLength().
182
183         Added test to check the behavior for both columns and rows.
184
185         Test: fast/css-grid-layout/grid-percent-track-margin-border-padding.html
186
187         * rendering/RenderGrid.cpp:
188         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
189
190 2015-09-09  Chris Dumez  <cdumez@apple.com>
191
192         HTMLTableElement.tHead / tFoot / caption should be nullable
193         https://bugs.webkit.org/show_bug.cgi?id=148991
194
195         Reviewed by Ryosuke Niwa.
196
197         According to the specification, HTMLTableElement.tHead / tFoot / caption
198         should be nullable:
199         https://html.spec.whatwg.org/multipage/tables.html#htmltableelement
200
201         Upon assigning null, we are supposed to remove the existing tHead / tFoot
202         / caption element. However, we had a bug causing us to throw an exception
203         after removing the element. This is because we would try to insert a null
204         element and ContainerNode::insertBefore() throws when doing so.
205
206         Also, as per the specification, setting tHead / tFoot to something else
207         than a thead / tfoot element should throw a HierarchyRequestError:
208         https://html.spec.whatwg.org/multipage/tables.html#dom-table-thead
209         https://html.spec.whatwg.org/multipage/tables.html#dom-table-tfoot
210
211         Previously, WebKit did not check the tag and was happy inserting the
212         element as long as it was an HTMLTableSectionElement. This means that
213         you could set a tfoot by assigning table.tHead.
214
215         This patch corrects both bugs and adds test coverage for it.
216
217         Test: fast/dom/HTMLTableElement/nullable-attributes.html
218
219         * html/HTMLTableElement.cpp:
220         (WebCore::HTMLTableElement::setCaption):
221         Only call insertBefore() if newCaption is not null as insertBefore()
222         will throw an exception otherwise.
223
224         (WebCore::HTMLTableElement::setTHead):
225         - Throw a HierarchyRequestError if the HTMLTableSectionElement is not
226           null or a <thead> element, as per the specification.
227         - Only call insertBefore() if newHead is not null as insertBefore()
228           will throw an exception otherwise.
229
230         (WebCore::HTMLTableElement::setTFoot):
231         - Throw a HierarchyRequestError if the HTMLTableSectionElement is not
232           null or a <tfoot> element, as per the specification.
233         - Only call insertBefore() if newFoot is not null as insertBefore()
234           will throw an exception otherwise.
235
236         * html/HTMLTableElement.idl:
237         Use [StrictTypeChecking] for these 3 attributes so that the bindings
238         will throw a TypeError if the JS tries to assign a value with the
239         wrong type. When the implementation is called with null, we now know
240         this is because the JS assigned null (and not an invalid value).
241         This is important as assigning null is valid since those attributes
242         are nullable.
243
244 2015-06-26  Sergio Villar Senin  <svillar@igalia.com>
245
246         min-width/height should default to auto for flexbox items
247         https://bugs.webkit.org/show_bug.cgi?id=146020
248
249         Reviewed by David Hyatt.
250
251         Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
252
253         As specified here
254         http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
255         value of min-{width|height} is auto for flex items.
256
257         In case this patch breaks any website (as it's changing the
258         default value of those properties) the fix is likely to add:
259
260         min-width: 0;
261         min-height: 0;
262
263         to any relevant flexitems.
264
265         Test: css3/flexbox/min-size-auto.html
266
267         * css/CSSComputedStyleDeclaration.cpp:
268         (WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
269         (WebCore::ComputedStyleExtractor::propertyValue): Return auto
270         for flex items if min-width/height is auto.
271         * css/CSSParser.cpp:
272         (WebCore::CSSParser::parseValue):
273         * html/shadow/SliderThumbElement.cpp:
274         * rendering/RenderBox.cpp:
275         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
276         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
277         (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
278         (WebCore::RenderBox::computeLogicalHeight):
279         (WebCore::RenderBox::computeLogicalHeightUsing):
280         (WebCore::RenderBox::computeContentLogicalHeight):
281         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
282         (WebCore::RenderBox::computeReplacedLogicalWidth):
283         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
284         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
285         (WebCore::RenderBox::computeReplacedLogicalHeight):
286         (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
287         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
288         (WebCore::RenderBox::availableLogicalHeightUsing):
289         (WebCore::RenderBox::computePositionedLogicalWidth):
290         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
291         (WebCore::RenderBox::computePositionedLogicalHeight):
292         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
293         * rendering/RenderBox.h:
294         * rendering/RenderButton.h:
295         * rendering/RenderFlexibleBox.cpp:
296         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
297         (WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite):
298         (WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite):
299         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
300         (WebCore::RenderFlexibleBox::mainAxisOverflowForChild):
301         * rendering/RenderFlexibleBox.h:
302         (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
303         * rendering/RenderFullScreen.h:
304         * rendering/RenderGrid.cpp:
305         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
306         * rendering/RenderMediaControlElements.h:
307         * rendering/RenderMenuList.cpp:
308         (WebCore::RenderMenuList::adjustInnerStyle): Do not longer set
309         the min-width explicitly.
310         * rendering/RenderMenuList.h:
311         * rendering/RenderMultiColumnSet.cpp:
312         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
313         * rendering/RenderNamedFlowFragment.cpp:
314         (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
315         * rendering/RenderReplaced.cpp:
316         (WebCore::RenderReplaced::computeReplacedLogicalWidth):
317         (WebCore::RenderReplaced::computeReplacedLogicalHeight):
318         * rendering/RenderSlider.h:
319         * rendering/RenderTextControl.h:
320         * rendering/RenderTextControlSingleLine.cpp:
321         (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Do not longer set
322         the min-width explicitly.
323         * rendering/mathml/RenderMathMLBlock.h:
324         * rendering/style/RenderStyle.h:
325
326 2015-09-08  Joseph Pecoraro  <pecoraro@apple.com>
327
328         Web Inspector: No need for [Custom] Implementation of some InspectorFrontendHost methods
329         https://bugs.webkit.org/show_bug.cgi?id=148990
330
331         Reviewed by Timothy Hatcher.
332
333         * bindings/js/JSInspectorFrontendHostCustom.cpp:
334         (WebCore::JSInspectorFrontendHost::platform): Deleted.
335         (WebCore::JSInspectorFrontendHost::port): Deleted.
336         * inspector/InspectorFrontendHost.cpp:
337         (WebCore::InspectorFrontendHost::platform):
338         (WebCore::InspectorFrontendHost::port):
339         * inspector/InspectorFrontendHost.h:
340         * inspector/InspectorFrontendHost.idl:
341         Uncustomize a few basic functions.
342
343 2015-09-08  Michael Catanzaro  <mcatanzaro@igalia.com>
344
345         Crash when WebCore::SQLiteFileSystem::openDatabase is called from multiple threads
346         https://bugs.webkit.org/show_bug.cgi?id=143245
347
348         Reviewed by Darin Adler.
349
350         sqlite3_initialize is documented to be thread-safe, and to be called automatically by the
351         library when needed, so applications should never need to call it directly. The problem is,
352         it's not thread-safe: we have documented instances of GNOME Builder, Devhelp, Epiphany, and
353         cinnamon-screensaver crashing when sqlite3_initialize is called simultaneously in separate
354         threads (usually inside sqlite3_open). So call it manually, guarded using std::call_once, to
355         make sure that the library is fully initialized before the first call to sqlite3_open. It's
356         a good idea to do this regardless, because the documentation says it could be required in
357         a future release of SQLite. (Though the use of std::call_once should not be needed, and is
358         only used to attempt to work around the crashes.)
359
360         This is a workaround for an SQLite bug that might have been fixed upstream, but the SQLite
361         developers are not really confident in the thread-safety of this function, and have advised
362         that we carry the workaround. Seems like a good idea.
363
364         * platform/sql/SQLiteDatabase.cpp:
365         (WebCore::SQLiteDatabase::SQLiteDatabase):
366
367 2015-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>
368
369         Unify symbolTablePut in JSLexicalEnvironment and JSSymbolTableObject
370         https://bugs.webkit.org/show_bug.cgi?id=148783
371
372         Reviewed by Geoffrey Garen.
373
374         No behavior change.
375
376         * bindings/js/JSDOMWindowBase.cpp:
377         (WebCore::JSDOMWindowBase::updateDocument):
378
379 2015-09-08  Brian Burg  <bburg@apple.com>
380
381         Several inspector-protocol tests are flaky with GuardMalloc
382         https://bugs.webkit.org/show_bug.cgi?id=136715
383
384         Reviewed by Joseph Pecoraro.
385
386         Sometimes, the async dispatch task can outlive its owning frontend client.
387         To avoid problems, make it refcounted instead and add a protector reference.
388
389         No new tests, covered by existing tests.
390
391         * inspector/InspectorFrontendClientLocal.cpp:
392         (WebCore::InspectorBackendDispatchTask::create):
393         (WebCore::InspectorBackendDispatchTask::dispatch):
394         (WebCore::InspectorBackendDispatchTask::reset):
395         (WebCore::InspectorBackendDispatchTask::timerFired):
396         (WebCore::InspectorBackendDispatchTask::InspectorBackendDispatchTask):
397         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
398         (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
399         * inspector/InspectorFrontendClientLocal.h:
400
401 2015-09-08  Chris Dumez  <cdumez@apple.com>
402
403         new Comment(undefined) / new Text(undefined) should use default's empty string
404         https://bugs.webkit.org/show_bug.cgi?id=148973
405         <rdar://problem/22548042>
406
407         Reviewed by Ryosuke Niwa.
408
409         new Comment(undefined) / new Text(undefined) should use default's empty string instead of converting
410         undefined to the "undefined" string:
411         - https://dom.spec.whatwg.org/#interface-comment (parameter is optional, default value is empty String)
412         - https://dom.spec.whatwg.org/#text (ditto)
413
414         undefined should be treated as if the parameter is missing, in the case the parameter is optional, as
415         per the Web IDL specification. This patch aligns WebKit's behavior with the specification and the
416         behavior of Firefox and Chrome.
417
418         No new tests, already covered by existing tests.
419
420         * bindings/scripts/CodeGeneratorJS.pm:
421         (GenerateParametersCheck):
422         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
423         (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
424         * bindings/scripts/test/JS/JSTestObj.cpp:
425         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):
426
427 2015-09-08  Chris Dumez  <cdumez@apple.com>
428
429         document.importNode(node, deep): deep's default value should be false
430         https://bugs.webkit.org/show_bug.cgi?id=148959
431         <rdar://problem/22558915>
432
433         Reviewed by Alexey Proskuryakov.
434
435         Switch deep parameter's default value for document.importNode() to
436         false, as per the latest DOM specification:
437         - https://dom.spec.whatwg.org/#interface-document
438         - https://dom.spec.whatwg.org/#dom-document-importnode
439
440         Firefox and Chrome follow the specification. However, WebKit was using
441         "true" for deep's default value.
442
443         No new tests, already covered by:
444         imported/w3c/web-platform-tests/dom/nodes/Document-importNode.html
445
446         * dom/Document.h:
447         (WebCore::Document::importNode):
448
449 2015-09-08  Per Arne Vollan  <peavo@outlook.com>
450
451         [Win][HighDPI] Video window placement is incorrect.
452         https://bugs.webkit.org/show_bug.cgi?id=148954
453
454         Reviewed by Alex Christensen.
455
456         We need to scale window dimensions with device scale factor.
457
458         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
459         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
460
461 2015-09-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
462
463         Reduce uses of PassRefPtr in fileapi
464         https://bugs.webkit.org/show_bug.cgi?id=148952
465
466         Reviewed by Andreas Kling.
467
468         Remove all uses of PassRefPtr in return type. Argument uses of PassRefPtr will be
469         removed in near future.
470
471         * fileapi/FileError.h:
472         (WebCore::FileError::create):
473         * fileapi/FileReader.cpp:
474         (WebCore::FileReader::arrayBufferResult):
475         * fileapi/FileReader.h:
476         * fileapi/FileReaderLoader.cpp:
477         (WebCore::FileReaderLoader::arrayBufferResult):
478         * fileapi/FileReaderLoader.h:
479         * fileapi/FileReaderSync.cpp:
480         (WebCore::FileReaderSync::readAsArrayBuffer):
481         * fileapi/FileReaderSync.h:
482         * fileapi/ThreadableBlobRegistry.cpp:
483         (WebCore::ThreadableBlobRegistry::getCachedOrigin):
484         * fileapi/ThreadableBlobRegistry.h:
485
486 2015-09-07  Chris Fleizach  <cfleizach@apple.com>
487
488         AX: Mavericks: Text cursor does not move along with VoiceOver cursor for text fields
489         https://bugs.webkit.org/show_bug.cgi?id=148891
490
491         Reviewed by Mario Sanchez Prada.
492
493         Undo the asynchronous dispatch of accessibility setting values on pre El Capitan machines
494         because it causes focus to not sync correctly.
495
496         Test: accessibility/mac/focus-moves-cursor.html
497
498         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
499         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
500         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
501
502 2015-09-07  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
503
504         [CoordinatedGraphics] Remove ScrollingStateScrollingNodeCoordinatedGraphics.cpp
505         https://bugs.webkit.org/show_bug.cgi?id=148931
506
507         Reviewed by Csaba Osztrogonác.
508
509         ScrollingStateScrollingNodeCoordinatedGraphics.cpp implements nothing. Removed it.
510
511         * PlatformEfl.cmake:
512         * PlatformGTK.cmake:
513         * WebCore.vcxproj/WebCore.vcxproj:
514         * WebCore.vcxproj/WebCore.vcxproj.filters:
515         * page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp: Removed.
516
517 2015-09-07  Daniel Bates  <dabates@apple.com>
518
519         ASSERT_WITH_SECURITY_IMPLICATION in WebCore::DocumentOrderedMap::get(); update form
520         association after subtree insertion
521         https://bugs.webkit.org/show_bug.cgi?id=148919
522         <rdar://problem/21868036>
523
524         Reviewed by Andy Estes.
525
526         Currently we update the form association of a form control upon insertion into
527         the document. Instead we should update the form association of a form control
528         after its containing subtree is inserted into the document to avoid an assertion
529         failure when the containing subtree has an element whose id is identical to both
530         the id of some other element in the document and the name of the form referenced
531         by the inserted form control.
532
533         Tests: fast/forms/update-form-owner-in-moved-subtree-assertion-failure-2.html
534                fast/forms/update-form-owner-in-moved-subtree-assertion-failure-3.html
535                fast/forms/update-form-owner-in-moved-subtree-assertion-failure-4.html
536                fast/forms/update-form-owner-in-moved-subtree-assertion-failure.html
537
538         * html/FormAssociatedElement.cpp:
539         (WebCore::FormAssociatedElement::insertedInto): Moved resetFormOwner() from here
540         to {HTMLFormControlElement, HTMLObjectElement}::finishedInsertingSubtree().
541         * html/HTMLFormControlElement.cpp:
542         (WebCore::HTMLFormControlElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree
543         so that HTMLFormControlElement::finishedInsertingSubtree() is called.
544         (WebCore::HTMLFormControlElement::finishedInsertingSubtree): Added; turn around and
545         call FormAssociatedElement::resetFormOwner().
546         * html/HTMLFormControlElement.h:
547         * html/HTMLInputElement.cpp:
548         (WebCore::HTMLInputElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree so
549         that HTMLInputElement::finishedInsertingSubtree() is called and move logic to update radio button
550         group from here...
551         (WebCore::HTMLInputElement::finishedInsertingSubtree): to here.
552         * html/HTMLInputElement.h:
553         * html/HTMLObjectElement.cpp:
554         (WebCore::HTMLObjectElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree so
555         that HTMLObjectElement::finishedInsertingSubtree() is called.
556         (WebCore::HTMLObjectElement::finishedInsertingSubtree): Added; turn around and
557         call FormAssociatedElement::resetFormOwner().
558         * html/HTMLObjectElement.h:
559         * html/HTMLSelectElement.cpp:
560         (WebCore::HTMLSelectElement::insertedInto): Modified to return the result of
561         HTMLFormControlElementWithState::insertedInto(), which may schedule a callback after subtree
562         insertion.
563         * html/HTMLTextFormControlElement.cpp:
564         (WebCore::HTMLTextFormControlElement::insertedInto): Ditto.
565
566 2015-09-07  Antti Koivisto  <antti@apple.com>
567
568         Remove GlyphPage::mayUseMixedFontsWhenFilling
569         https://bugs.webkit.org/show_bug.cgi?id=148928
570
571         Reviewed by Dan Bernstein.
572
573         http://trac.webkit.org/188566 removed support for composite fonts. We never need to use mixed
574         glyph pages for fonts anymore.
575
576         * platform/graphics/Font.cpp:
577         (WebCore::createAndFillGlyphPage):
578         * platform/graphics/GlyphPage.h:
579         (WebCore::GlyphPage::GlyphPage):
580         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling): Deleted.
581         * platform/graphics/mac/GlyphPageMac.cpp:
582         (WebCore::shouldUseCoreText):
583         (WebCore::GlyphPage::fill):
584         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling): Deleted.
585
586 2015-09-07  Antti Koivisto  <antti@apple.com>
587
588         Remove unneeded offset and length arguments from glyph page filling functions
589         https://bugs.webkit.org/show_bug.cgi?id=148929
590
591         Reviewed by Andreas Kling.
592
593         They are always passed 0/GlyphPage::size.
594
595         * platform/graphics/Font.cpp:
596         (WebCore::Font::~Font):
597         (WebCore::fillGlyphPage):
598         (WebCore::createAndFillGlyphPage):
599         * platform/graphics/Font.h:
600         * platform/graphics/GlyphPage.h:
601         (WebCore::GlyphPage::setGlyphDataForIndex):
602         * platform/graphics/mac/GlyphPageMac.cpp:
603         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling):
604         (WebCore::GlyphPage::fill):
605         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
606         (WebCore::GlyphPage::fill):
607         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
608         (WebCore::GlyphPage::fill):
609         * svg/SVGFontData.cpp:
610         (WebCore::SVGFontData::applySVGGlyphSelection):
611         (WebCore::SVGFontData::fillSVGGlyphPage):
612         (WebCore::SVGFontData::fillBMPGlyphs):
613         (WebCore::SVGFontData::fillNonBMPGlyphs):
614         * svg/SVGFontData.h:
615         (WebCore::SVGFontData::verticalAdvanceY):
616
617 2015-09-06  Chris Dumez  <cdumez@apple.com>
618
619         dispatchEvent() should throw an InvalidStateError if the event's initialized flag is not set
620         https://bugs.webkit.org/show_bug.cgi?id=148800
621         <rdar://problem/22565782>
622         <rdar://problem/22565485>
623
624         Reviewed by Geoffrey Garen.
625
626         dispatchEvent() should throw an InvalidStateError if the event's
627         initialized flag is not set or its dispatch flag is set, and should
628         allow dispatching events with an empty type as long as it is
629         initialized:
630         https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent (step 1)
631
632         Previously, WebKit relied on the event type being empty to throw a
633         UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0. However, this
634         exception type is outdated and initializing Event.type to an empty
635         string is legal.
636
637         No new tests, already covered by existing tests that were rebaselined.
638
639         * dom/Event.cpp:
640         (WebCore::Event::Event):
641         (WebCore::Event::initEvent):
642         * dom/Event.h:
643         (WebCore::Event::isInitialized):
644         * dom/EventTarget.cpp:
645         (WebCore::EventTarget::dispatchEvent):
646
647 2015-09-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
648
649         XHR2 timeout property should allow late updates
650         https://bugs.webkit.org/show_bug.cgi?id=98156
651
652         Reviewed by Darin Adler.
653
654         Adding a timer within XMLHttpRequest to handle timeouts for asynchronous requests.
655         This allows easy update of the timeout even after request is sent.
656         Timeout is still handled by the network backend for synchronous requests (Web worker context).
657
658         Covered by updated tests.
659
660         * xml/XMLHttpRequest.cpp:
661         (WebCore::XMLHttpRequest::XMLHttpRequest): Adding timeout timer initialization.
662         (WebCore::XMLHttpRequest::setTimeout): Updating timeout timer state if request is sent.
663         (WebCore::XMLHttpRequest::createRequest): Starting timeout timer if needed.
664         (WebCore::XMLHttpRequest::internalAbort): Stopping timeout timer if needed.
665         (WebCore::XMLHttpRequest::didFail): Adding comment.
666         (WebCore::XMLHttpRequest::didFinishLoading): Stopping timeout timer if needed.
667         * xml/XMLHttpRequest.h:
668
669 2015-09-05  Jaehun Lim  <ljaehun.lim@samsung.com>
670
671         Remove unused macros from StyleResolver.cpp
672         https://bugs.webkit.org/show_bug.cgi?id=148163
673
674         Reviewed by Andreas Kling.
675
676         HANDLE_INHERIT and HANDLE_INHERIT_AND_INITIAL are not used after
677         StyleBuilder refactoring.
678
679         No new tests because there is no behavior change.
680
681         * css/StyleResolver.cpp:
682         Remove HANDLE_INHERIT and HANDLE_INHERIT_AND_INITIAL.
683
684 2015-09-05  Brian Burg  <bburg@apple.com>
685
686         Web Inspector: tighten up lifetimes for Agent-owned objects, and initialize agents using contexts
687         https://bugs.webkit.org/show_bug.cgi?id=148625
688
689         Reviewed by Joseph Pecoraro.
690
691         All agents own their domain-specific frontend and backend dispatchers. Change so that
692         they are initialized in constructors rather than when a frontend connects or disconnects.
693         This may cause additional memory use, but this can be counteracted by lazily creating
694         some agents that are not required for other agents to function (i.e., runtime and page agents).
695
696         To avoid adding frontend/backend dispatcher arguments to every single agent constructor,
697         change agent construction to take a AgentContext or a subclass of it. This provides agents with
698         references to objects in the owning InspectorEnvironment subclass that are guaranteed to
699         outlive all agents. AgentContext and its subclasses follow the existing Agent class hierarchy.
700
701         No new tests, no behavior changed.
702
703         * bindings/js/WorkerScriptDebugServer.cpp:
704         (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
705         (WebCore::WorkerScriptDebugServer::addListener):
706         (WebCore::WorkerScriptDebugServer::removeListener):
707         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
708         * bindings/js/WorkerScriptDebugServer.h:
709         * inspector/InspectorApplicationCacheAgent.cpp:
710         (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
711         (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend):
712         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
713         (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
714         * inspector/InspectorApplicationCacheAgent.h:
715         * inspector/InspectorCSSAgent.cpp:
716         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
717         (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend):
718         (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
719         * inspector/InspectorCSSAgent.h:
720         * inspector/InspectorController.cpp:
721         (WebCore::InspectorController::InspectorController):
722         * inspector/InspectorDOMAgent.cpp:
723         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
724         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
725         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
726         * inspector/InspectorDOMAgent.h:
727         * inspector/InspectorDOMDebuggerAgent.cpp:
728         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
729         (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend):
730         (WebCore::InspectorDOMDebuggerAgent::willDestroyFrontendAndBackend):
731         * inspector/InspectorDOMDebuggerAgent.h:
732         * inspector/InspectorDOMStorageAgent.cpp:
733         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
734         (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend):
735         (WebCore::InspectorDOMStorageAgent::findStorageArea):
736         (WebCore::InspectorDOMStorageAgent::willDestroyFrontendAndBackend):
737         * inspector/InspectorDOMStorageAgent.h:
738         * inspector/InspectorDatabaseAgent.cpp:
739         (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
740         (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend):
741         (WebCore::InspectorDatabaseAgent::willDestroyFrontendAndBackend):
742         * inspector/InspectorDatabaseAgent.h:
743         * inspector/InspectorIndexedDBAgent.cpp:
744         (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
745         (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend):
746         (WebCore::InspectorIndexedDBAgent::willDestroyFrontendAndBackend):
747         * inspector/InspectorIndexedDBAgent.h:
748         * inspector/InspectorInstrumentation.cpp:
749         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
750         * inspector/InspectorLayerTreeAgent.cpp:
751         (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
752         (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend):
753         (WebCore::InspectorLayerTreeAgent::willDestroyFrontendAndBackend):
754         * inspector/InspectorLayerTreeAgent.h:
755         * inspector/InspectorPageAgent.cpp:
756         (WebCore::InspectorPageAgent::InspectorPageAgent):
757         (WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
758         (WebCore::InspectorPageAgent::enable):
759         (WebCore::InspectorPageAgent::reload):
760         (WebCore::InspectorPageAgent::navigate):
761         (WebCore::InspectorPageAgent::getCookies):
762         (WebCore::InspectorPageAgent::deleteCookie):
763         (WebCore::InspectorPageAgent::getResourceTree):
764         (WebCore::InspectorPageAgent::searchInResources):
765         (WebCore::InspectorPageAgent::getScriptExecutionStatus):
766         (WebCore::InspectorPageAgent::setScriptExecutionDisabled):
767         (WebCore::InspectorPageAgent::mainFrame):
768         (WebCore::InspectorPageAgent::findFrameWithSecurityOrigin):
769         (WebCore::InspectorPageAgent::buildObjectForFrame):
770         (WebCore::InspectorPageAgent::buildObjectForFrameTree):
771         (WebCore::InspectorPageAgent::setEmulatedMedia):
772         (WebCore::InspectorPageAgent::getCompositingBordersVisible):
773         (WebCore::InspectorPageAgent::setCompositingBordersVisible):
774         (WebCore::InspectorPageAgent::snapshotNode):
775         (WebCore::InspectorPageAgent::snapshotRect):
776         (WebCore::InspectorPageAgent::archive):
777         (WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
778         * inspector/InspectorPageAgent.h:
779         * inspector/InspectorReplayAgent.cpp:
780         (WebCore::InspectorReplayAgent::InspectorReplayAgent):
781         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
782         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
783         * inspector/InspectorReplayAgent.h:
784         * inspector/InspectorResourceAgent.cpp:
785         (WebCore::InspectorResourceAgent::InspectorResourceAgent):
786         (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend):
787         (WebCore::InspectorResourceAgent::willDestroyFrontendAndBackend):
788         * inspector/InspectorResourceAgent.h:
789         * inspector/InspectorTimelineAgent.cpp:
790         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
791         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
792         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
793         (WebCore::InspectorTimelineAgent::page):
794         * inspector/InspectorTimelineAgent.h:
795         * inspector/InspectorWebAgentBase.h:
796         (WebCore::WebAgentContext::WebAgentContext):
797         (WebCore::PageAgentContext::PageAgentContext):
798         (WebCore::WorkerAgentContext::WorkerAgentContext):
799         (WebCore::InspectorAgentBase::InspectorAgentBase):
800         * inspector/InspectorWorkerAgent.cpp:
801         (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
802         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
803         (WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend):
804         * inspector/InspectorWorkerAgent.h:
805         * inspector/PageConsoleAgent.cpp:
806         (WebCore::PageConsoleAgent::PageConsoleAgent):
807         * inspector/PageConsoleAgent.h:
808         * inspector/PageDebuggerAgent.cpp:
809         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
810         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
811         (WebCore::PageDebuggerAgent::breakpointActionLog):
812         (WebCore::PageDebuggerAgent::injectedScriptForEval):
813         * inspector/PageDebuggerAgent.h:
814         * inspector/PageRuntimeAgent.cpp:
815         (WebCore::PageRuntimeAgent::PageRuntimeAgent):
816         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend):
817         (WebCore::PageRuntimeAgent::injectedScriptForEval):
818         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
819         (WebCore::PageRuntimeAgent::willDestroyFrontendAndBackend):
820         * inspector/PageRuntimeAgent.h:
821         * inspector/WebConsoleAgent.cpp:
822         (WebCore::WebConsoleAgent::WebConsoleAgent):
823         * inspector/WebConsoleAgent.h:
824         * inspector/WebDebuggerAgent.cpp:
825         (WebCore::WebDebuggerAgent::WebDebuggerAgent):
826         * inspector/WebDebuggerAgent.h:
827         * inspector/WorkerConsoleAgent.cpp:
828         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
829         * inspector/WorkerConsoleAgent.h:
830         * inspector/WorkerDebuggerAgent.cpp:
831         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
832         (WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
833         (WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands):
834         (WebCore::WorkerDebuggerAgent::breakpointActionLog):
835         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
836         * inspector/WorkerDebuggerAgent.h:
837         * inspector/WorkerInspectorController.cpp:
838         (WebCore::WorkerInspectorController::WorkerInspectorController):
839         * inspector/WorkerRuntimeAgent.cpp:
840         (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
841         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
842         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
843         (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend):
844         * inspector/WorkerRuntimeAgent.h:
845
846 2015-09-04  Brian Burg  <bburg@apple.com>
847
848         Web Inspector: agents should send messages through FrontendRouter instead of FrontendChannel
849         https://bugs.webkit.org/show_bug.cgi?id=148492
850
851         Reviewed by Joseph Pecoraro.
852
853         Replace uses of FrontendChannel with FrontendRouter. Minor code cleanup along the way.
854
855         No new tests, no behavior changed.
856
857         * WebCore.vcxproj/WebCore.vcxproj:
858         * WebCore.vcxproj/WebCore.vcxproj.filters:
859         * WebCore.xcodeproj/project.pbxproj:
860         * inspector/InspectorApplicationCacheAgent.cpp:
861         (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend):
862         * inspector/InspectorApplicationCacheAgent.h:
863         * inspector/InspectorCSSAgent.cpp:
864         (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend):
865         * inspector/InspectorCSSAgent.h:
866         * inspector/InspectorController.cpp:
867         (WebCore::InspectorController::connectFrontend):
868         (WebCore::InspectorController::~InspectorController): No need to call discardAgents().
869         * inspector/InspectorDOMAgent.cpp:
870         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
871         * inspector/InspectorDOMAgent.h:
872         * inspector/InspectorDOMDebuggerAgent.cpp:
873         (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend):
874         * inspector/InspectorDOMDebuggerAgent.h:
875         * inspector/InspectorDOMStorageAgent.cpp:
876         (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend):
877         * inspector/InspectorDOMStorageAgent.h:
878         * inspector/InspectorDatabaseAgent.cpp:
879         (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend):
880         * inspector/InspectorDatabaseAgent.h:
881         * inspector/InspectorForwarding.h: Removed.
882         * inspector/InspectorIndexedDBAgent.cpp:
883         (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend):
884         * inspector/InspectorIndexedDBAgent.h:
885         * inspector/InspectorLayerTreeAgent.cpp:
886         (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend):
887         * inspector/InspectorLayerTreeAgent.h:
888         * inspector/InspectorPageAgent.cpp:
889         (WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
890         * inspector/InspectorPageAgent.h:
891         * inspector/InspectorReplayAgent.cpp:
892         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
893         * inspector/InspectorReplayAgent.h:
894         * inspector/InspectorResourceAgent.cpp:
895         (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend):
896         * inspector/InspectorResourceAgent.h:
897         * inspector/InspectorTimelineAgent.cpp:
898         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
899         * inspector/InspectorTimelineAgent.h:
900         * inspector/InspectorWebAgentBase.h:
901         * inspector/InspectorWorkerAgent.cpp:
902         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
903         * inspector/InspectorWorkerAgent.h:
904         * inspector/PageRuntimeAgent.cpp:
905         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend):
906         * inspector/PageRuntimeAgent.h:
907         * inspector/WorkerInspectorController.cpp:
908         (WebCore::WorkerInspectorController::connectFrontend):
909         * inspector/WorkerInspectorController.h:
910         * inspector/WorkerRuntimeAgent.cpp:
911         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
912         * inspector/WorkerRuntimeAgent.h:
913         * page/PageDebuggable.cpp:
914         * testing/Internals.cpp:
915
916 2015-09-05  Joseph Pecoraro  <pecoraro@apple.com>
917
918         Add a new ResourceLoaderOption to avoid page defers loading mechanisms for inspector
919         https://bugs.webkit.org/show_bug.cgi?id=148727
920
921         Reviewed by Antti Koivisto.
922
923         This will be tested shortly by inspector tests.
924
925         * loader/ResourceLoaderOptions.h:
926         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
927         (WebCore::ResourceLoaderOptions::defersLoadingPolicy):
928         (WebCore::ResourceLoaderOptions::setDefersLoadingPolicy):
929         Add a new policy for defers loading. The default is to allow defers loading.
930
931         * loader/ResourceLoader.cpp:
932         (WebCore::ResourceLoader::ResourceLoader):
933         (WebCore::ResourceLoader::init):
934         (WebCore::ResourceLoader::setDefersLoading):
935         Respect the defers loading policy whenever we would set defers loading status.
936
937         * inspector/InspectorResourceAgent.cpp:
938         (WebCore::InspectorResourceAgent::loadResource):
939         Switch from incorrectly changing the defersLoading state of the loader
940         to setting an option to disallow defers loading entirely for the loader.
941
942         * loader/DocumentLoader.cpp:
943         (WebCore::DocumentLoader::startLoadingMainResource):
944         * loader/MediaResourceLoader.cpp:
945         (WebCore::MediaResourceLoader::start):
946         * loader/NetscapePlugInStreamLoader.cpp:
947         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
948         * loader/cache/CachedResourceLoader.cpp:
949         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
950         (WebCore::CachedResourceLoader::defaultCachedResourceOptions):
951         * loader/icon/IconLoader.cpp:
952         (WebCore::IconLoader::startLoading):
953         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
954         (WebCore::WebCoreAVCFResourceLoader::startLoading):
955         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
956         (WebCore::WebCoreAVFResourceLoader::startLoading):
957         Add the new value to instance of the longhand ResourceLoaderOptions constructor.
958
959 2015-09-04  Myles C. Maxfield  <mmaxfield@apple.com>
960
961         Rename members of CanvasRenderingContext2D::State
962         https://bugs.webkit.org/show_bug.cgi?id=148889
963
964         Reviewed by Tim Horton.
965
966         CanvasRenderingContext2D::State is a struct, so its members should not start with m_.
967
968         No new tests because there is no behavior change.
969
970         * html/canvas/CanvasRenderingContext2D.cpp:
971         (WebCore::CanvasRenderingContext2D::State::State):
972         (WebCore::CanvasRenderingContext2D::State::operator=):
973         (WebCore::CanvasRenderingContext2D::restore):
974         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
975         (WebCore::CanvasRenderingContext2D::setFillStyle):
976         (WebCore::CanvasRenderingContext2D::lineWidth):
977         (WebCore::CanvasRenderingContext2D::setLineWidth):
978         (WebCore::CanvasRenderingContext2D::lineCap):
979         (WebCore::CanvasRenderingContext2D::setLineCap):
980         (WebCore::CanvasRenderingContext2D::lineJoin):
981         (WebCore::CanvasRenderingContext2D::setLineJoin):
982         (WebCore::CanvasRenderingContext2D::miterLimit):
983         (WebCore::CanvasRenderingContext2D::setMiterLimit):
984         (WebCore::CanvasRenderingContext2D::shadowOffsetX):
985         (WebCore::CanvasRenderingContext2D::setShadowOffsetX):
986         (WebCore::CanvasRenderingContext2D::shadowOffsetY):
987         (WebCore::CanvasRenderingContext2D::setShadowOffsetY):
988         (WebCore::CanvasRenderingContext2D::shadowBlur):
989         (WebCore::CanvasRenderingContext2D::setShadowBlur):
990         (WebCore::CanvasRenderingContext2D::shadowColor):
991         (WebCore::CanvasRenderingContext2D::setShadowColor):
992         (WebCore::CanvasRenderingContext2D::getLineDash):
993         (WebCore::CanvasRenderingContext2D::setLineDash):
994         (WebCore::CanvasRenderingContext2D::setWebkitLineDash):
995         (WebCore::CanvasRenderingContext2D::lineDashOffset):
996         (WebCore::CanvasRenderingContext2D::setLineDashOffset):
997         (WebCore::CanvasRenderingContext2D::applyLineDash):
998         (WebCore::CanvasRenderingContext2D::globalAlpha):
999         (WebCore::CanvasRenderingContext2D::setGlobalAlpha):
1000         (WebCore::CanvasRenderingContext2D::globalCompositeOperation):
1001         (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation):
1002         (WebCore::CanvasRenderingContext2D::scale):
1003         (WebCore::CanvasRenderingContext2D::rotate):
1004         (WebCore::CanvasRenderingContext2D::translate):
1005         (WebCore::CanvasRenderingContext2D::transform):
1006         (WebCore::CanvasRenderingContext2D::setTransform):
1007         (WebCore::CanvasRenderingContext2D::setStrokeColor):
1008         (WebCore::CanvasRenderingContext2D::setFillColor):
1009         (WebCore::CanvasRenderingContext2D::fillInternal):
1010         (WebCore::CanvasRenderingContext2D::strokeInternal):
1011         (WebCore::CanvasRenderingContext2D::clipInternal):
1012         (WebCore::CanvasRenderingContext2D::isPointInPathInternal):
1013         (WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
1014         (WebCore::CanvasRenderingContext2D::clearRect):
1015         (WebCore::CanvasRenderingContext2D::fillRect):
1016         (WebCore::CanvasRenderingContext2D::strokeRect):
1017         (WebCore::CanvasRenderingContext2D::setShadow):
1018         (WebCore::CanvasRenderingContext2D::applyShadow):
1019         (WebCore::CanvasRenderingContext2D::shouldDrawShadows):
1020         (WebCore::CanvasRenderingContext2D::drawImage):
1021         (WebCore::CanvasRenderingContext2D::transformAreaToDevice):
1022         (WebCore::CanvasRenderingContext2D::rectContainsCanvas):
1023         (WebCore::CanvasRenderingContext2D::compositeBuffer):
1024         (WebCore::CanvasRenderingContext2D::didDraw):
1025         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
1026         (WebCore::CanvasRenderingContext2D::font):
1027         (WebCore::CanvasRenderingContext2D::setFont):
1028         (WebCore::CanvasRenderingContext2D::textAlign):
1029         (WebCore::CanvasRenderingContext2D::setTextAlign):
1030         (WebCore::CanvasRenderingContext2D::textBaseline):
1031         (WebCore::CanvasRenderingContext2D::setTextBaseline):
1032         (WebCore::CanvasRenderingContext2D::direction):
1033         (WebCore::CanvasRenderingContext2D::setDirection):
1034         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1035         (WebCore::CanvasRenderingContext2D::inflateStrokeRect):
1036         (WebCore::CanvasRenderingContext2D::imageSmoothingEnabled):
1037         (WebCore::CanvasRenderingContext2D::setImageSmoothingEnabled):
1038         * html/canvas/CanvasRenderingContext2D.h:
1039
1040 2015-09-04  Myles C. Maxfield  <mmaxfield@apple.com>
1041
1042         Crash when font completes downloading after calling 2D canvas setText() multiple times
1043         https://bugs.webkit.org/show_bug.cgi?id=148789
1044
1045         Reviewed by Darin Adler.
1046
1047         The CSSFontSelector has a list of clients, and when fonts complete downloading, these
1048         clients get a call back. CanvasRenderingContext2D::State is one such of these clients. However,
1049         the CSSFontSelector may be destroyed and recreated at any time. We were getting into a case
1050         where multiple CSSFontSelectors were thinking that the same CanvasRenderingContext2D::State were
1051         their client. When the CanvasRenderingContext2D::State was destroyed, it only unregistered
1052         itself from one of the CSSFontSelectors, which means the CSSFontSelector left over has a dangling
1053         pointer to it.
1054
1055         The solution is to implement a new helper class, FontProxy, to hold the
1056         CanvasRenderingContext2D::State's font, and maintain the invariant that this object is always
1057         registered to exactly one CSSFontSelector, and this CSSFontSelector is the one which is associated
1058         with the FontProxy's FontCascade object. This patch maintains this invariant, as well as protecting
1059         all access to the State's FontCascade object so no one can reach in and change it without going
1060         through functions which maintain the invariant.
1061
1062         Test: fast/canvas/font-selector-crash.html
1063
1064         * css/CSSFontSelector.cpp:
1065         (WebCore::CSSFontSelector::registerForInvalidationCallbacks):
1066         (WebCore::CSSFontSelector::unregisterForInvalidationCallbacks):
1067         (WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
1068         * css/CSSFontSelector.h:
1069         * dom/Document.cpp:
1070         (WebCore::Document::fontsNeedUpdate):
1071         (WebCore::Document::fontSelector):
1072         (WebCore::Document::clearStyleResolver):
1073         * dom/Document.h:
1074         * html/canvas/CanvasRenderingContext2D.cpp:
1075         (WebCore::CanvasRenderingContext2D::State::State):
1076         (WebCore::CanvasRenderingContext2D::State::operator=):
1077         (WebCore::CanvasRenderingContext2D::FontProxy::~FontProxy):
1078         (WebCore::CanvasRenderingContext2D::FontProxy::FontProxy):
1079         (WebCore::CanvasRenderingContext2D::FontProxy::update):
1080         (WebCore::CanvasRenderingContext2D::FontProxy::fontsNeedUpdate):
1081         (WebCore::CanvasRenderingContext2D::FontProxy::initialize):
1082         (WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics):
1083         (WebCore::CanvasRenderingContext2D::FontProxy::fontDescription):
1084         (WebCore::CanvasRenderingContext2D::FontProxy::width):
1085         (WebCore::CanvasRenderingContext2D::FontProxy::drawBidiText):
1086         (WebCore::CanvasRenderingContext2D::font):
1087         (WebCore::CanvasRenderingContext2D::setFont):
1088         (WebCore::CanvasRenderingContext2D::measureText):
1089         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1090         (WebCore::CanvasRenderingContext2D::State::~State): Deleted.
1091         (WebCore::CanvasRenderingContext2D::State::fontsNeedUpdate): Deleted.
1092         (WebCore::CanvasRenderingContext2D::accessFont): Deleted.
1093         * html/canvas/CanvasRenderingContext2D.h:
1094         * platform/graphics/FontSelector.h:
1095
1096 2015-09-04  Commit Queue  <commit-queue@webkit.org>
1097
1098         Unreviewed, rolling out r189386.
1099         https://bugs.webkit.org/show_bug.cgi?id=148883
1100
1101         Made several event dispatch tests assert (Requested by ap on
1102         #webkit).
1103
1104         Reverted changeset:
1105
1106         "dispatchEvent() should throw an InvalidStateError if the
1107         event's initialized flag is not set"
1108         https://bugs.webkit.org/show_bug.cgi?id=148800
1109         http://trac.webkit.org/changeset/189386
1110
1111 2015-09-04  Joseph Pecoraro  <pecoraro@apple.com>
1112
1113         Web Inspector: Add tests for DOM highlight commands
1114         https://bugs.webkit.org/show_bug.cgi?id=148786
1115
1116         Reviewed by Timothy Hatcher.
1117
1118         Tests: inspector/dom/hideHighlight.html
1119                inspector/dom/highlightFrame.html
1120                inspector/dom/highlightNode.html
1121                inspector/dom/highlightQuad.html
1122                inspector/dom/highlightRect.html
1123
1124         * inspector/InspectorDOMAgent.cpp:
1125         (WebCore::InspectorDOMAgent::highlightNode):
1126         (WebCore::InspectorDOMAgent::highlightFrame):
1127         Include an error if a frame is not found.
1128
1129         * inspector/InspectorOverlay.cpp:
1130         (WebCore::InspectorOverlay::highlightQuad):
1131         Should have been checking the usePageCoordinates state of the incoming
1132         highlight configuration, not the one that will be replaced.
1133
1134 2015-09-04  Csaba Osztrogonác  <ossy@webkit.org>
1135
1136         Remove unnecessary compiler guards from mm files
1137         https://bugs.webkit.org/show_bug.cgi?id=148797
1138
1139         Reviewed by Dan Bernstein.
1140
1141         * bindings/objc/DOMInternal.mm:
1142         * bridge/objc/objc_instance.mm:
1143
1144 2015-09-04  Eric Carlson  <eric.carlson@apple.com>
1145
1146         [mediacontrols] Test AirPlay picker button
1147         https://bugs.webkit.org/show_bug.cgi?id=148836
1148
1149         Reviewed by Dean Jackson.
1150
1151         Test: media/controls/airplay-picker.html
1152
1153         * Modules/mediacontrols/mediaControlsApple.js:
1154         (Controller.prototype.getCurrentControlsStatus.elements.forEach.):
1155         (Controller.prototype.getCurrentControlsStatus):
1156
1157 2015-09-04  Chris Dumez  <cdumez@apple.com>
1158
1159         dispatchEvent() should throw an InvalidStateError if the event's initialized flag is not set
1160         https://bugs.webkit.org/show_bug.cgi?id=148800
1161         <rdar://problem/22565782>
1162         <rdar://problem/22565485>
1163
1164         Reviewed by Geoffrey Garen.
1165
1166         dispatchEvent() should throw an InvalidStateError if the event's
1167         initialized flag is not set or its dispatch flag is set, and should
1168         allow dispatching events with an empty type as long as it is
1169         initialized:
1170         https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent (step 1)
1171
1172         Previously, WebKit relied on the event type being empty to throw a
1173         UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0. However, this
1174         exception type is outdated and initializing Event.type to an empty
1175         string is legal.
1176
1177         No new tests, already covered by existing tests that were rebaselined.
1178
1179         * dom/Event.cpp:
1180         (WebCore::Event::Event):
1181         (WebCore::Event::initEvent):
1182         * dom/Event.h:
1183         (WebCore::Event::isInitialized):
1184         * dom/EventTarget.cpp:
1185         (WebCore::EventTarget::dispatchEvent):
1186
1187 2015-09-04  Beth Dakin  <bdakin@apple.com>
1188
1189         Speculative build fix.
1190
1191         * platform/spi/mac/NSEventSPI.h:
1192
1193 2015-09-04  Brian Burg  <bburg@apple.com>
1194
1195         Web Inspector: InspectorController should support multiple frontend channels
1196         https://bugs.webkit.org/show_bug.cgi?id=148538
1197
1198         Reviewed by Joseph Pecoraro.
1199
1200         No new tests, no behavior change from this patch. Teardown scenarios are
1201         covered by existing protocol and inspector tests running under DRT and WKTR.
1202
1203         * ForwardingHeaders/inspector/InspectorFrontendRouter.h: Added.
1204         * WebCore.vcxproj/WebCore.vcxproj:
1205         * inspector/InspectorClient.h: Stop using forwarded types.
1206         * inspector/InspectorController.cpp:
1207         (WebCore::InspectorController::InspectorController):
1208         (WebCore::InspectorController::inspectedPageDestroyed):
1209         (WebCore::InspectorController::hasLocalFrontend):
1210         (WebCore::InspectorController::hasRemoteFrontend):
1211         (WebCore::InspectorController::connectFrontend):
1212         (WebCore::InspectorController::disconnectFrontend):
1213         (WebCore::InspectorController::disconnectAllFrontends): Added. Disconnects all
1214         frontends and signals DisconnectReason::InspectedTargetDestroyed.
1215
1216         (WebCore::InspectorController::show):
1217         (WebCore::InspectorController::close):
1218         (WebCore::InspectorController::dispatchMessageFromFrontend):
1219         * inspector/InspectorController.h: Add default value for isAutomaticInspection.
1220         * inspector/InspectorDatabaseAgent.cpp:
1221         * inspector/InspectorIndexedDBAgent.cpp:
1222         * inspector/InspectorResourceAgent.cpp:
1223         * inspector/WorkerInspectorController.cpp: Use a router with a singleton channel
1224         that forwards messages over to the main page.
1225
1226         (WebCore::WorkerInspectorController::WorkerInspectorController):
1227         (WebCore::WorkerInspectorController::connectFrontend):
1228         (WebCore::WorkerInspectorController::disconnectFrontend):
1229         (WebCore::WorkerInspectorController::dispatchMessageFromFrontend):
1230         * inspector/WorkerInspectorController.h:
1231         * page/PageDebuggable.cpp:
1232         (WebCore::PageDebuggable::disconnect):
1233         * page/PageDebuggable.h:
1234         * testing/Internals.cpp: Clear the frontend client before disconnecting frontend channel.
1235         (WebCore::Internals::openDummyInspectorFrontend):
1236         (WebCore::Internals::closeDummyInspectorFrontend):
1237
1238 2015-09-04  Jer Noble  <jer.noble@apple.com>
1239
1240         [iOS] Enable media layout tests to run simultaneously by ignoring system-level interruptions
1241         https://bugs.webkit.org/show_bug.cgi?id=148807
1242
1243         Reviewed by Eric Carlson.
1244
1245         Add an internal property that, when set, will cause system-level interruption notifications
1246         (e.g., due to simultaneous media playback in separate processes) to be ignored by the
1247         PlatformMediaSessionManager, and cause the media playback sessions to continue normally, if
1248         inaudibly.
1249
1250         * platform/audio/PlatformMediaSessionManager.h:
1251         (WebCore::PlatformMediaSessionManager::willIgnoreSystemInterruptions):
1252         (WebCore::PlatformMediaSessionManager::setWillIgnoreSystemInterruptions):
1253         * platform/audio/ios/MediaSessionManagerIOS.mm:
1254         (-[WebMediaSessionHelper interruption:]):
1255         (-[WebMediaSessionHelper applicationWillEnterForeground:]):
1256         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
1257         (-[WebMediaSessionHelper applicationWillResignActive:]):
1258         (-[WebMediaSessionHelper applicationDidEnterBackground:]):
1259         * testing/Internals.cpp:
1260         (WebCore::Internals::resetToConsistentState):
1261
1262 2015-09-04  Beth Dakin  <bdakin@apple.com>
1263
1264         Need to be able to test default behaviors on force click
1265         https://bugs.webkit.org/show_bug.cgi?id=148758
1266
1267         Reviewed by Tim Horton.
1268
1269         WKTR needs access to this.
1270         * platform/spi/mac/NSEventSPI.h:
1271
1272 2015-09-04  Dean Jackson  <dino@apple.com>
1273
1274         [mediacontrols] Test the ordering of elements in the controls panel
1275         https://bugs.webkit.org/show_bug.cgi?id=148804
1276         <rdar://problem/22579232>
1277
1278         Reviewed by Eric Carlson.
1279
1280         Add information about various controls elements to the status object.
1281
1282         Test: media/controls/elementOrder.html
1283
1284         * Modules/mediacontrols/mediaControlsApple.js:
1285
1286 2015-09-03  Dean Jackson  <dino@apple.com>
1287
1288         [mediacontrols] Expose bounding rectangles and computed style to testing
1289         https://bugs.webkit.org/show_bug.cgi?id=148755
1290         <rdar://problems/22567757>
1291
1292         Reviewed by Eric Carlson.
1293
1294         Expose more information on the internal objects to the testing
1295         framework, in particular the bounding client rectangle for an
1296         element as well as its computed style.
1297
1298         These new features are tested by media/controls/statusDisplay*.
1299
1300         * Modules/mediacontrols/mediaControlsApple.js:
1301         (Controller.prototype.getCurrentControlsStatus): Rearrage things so
1302         that it iterates over a list of objects, adding the common things
1303         as well as any extra property values.
1304
1305 2015-09-04  Chris Dumez  <cdumez@apple.com>
1306
1307         Document.body should return the first body / frameset child of the html element
1308         https://bugs.webkit.org/show_bug.cgi?id=148787
1309         <rdar://problem/22566850>
1310
1311         Reviewed by Ryosuke Niwa.
1312
1313         Document.body should return the *first* body / frameset child of the html
1314         element as per the specification:
1315         https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2
1316
1317         Chrome and Firefox both behave correctly. However, WebKit was prioritizing
1318         frameset over body. This patch fixes this.
1319
1320         No new tests, already covered by existing test.
1321
1322         * dom/Document.cpp:
1323         (WebCore::Document::bodyOrFrameset):
1324
1325 2015-09-04  Csaba Osztrogonác  <ossy@webkit.org>
1326
1327         Fix the !ENABLE(VIDEO) build after r189023
1328         https://bugs.webkit.org/show_bug.cgi?id=148796
1329
1330         Reviewed by Eric Carlson.
1331
1332         * testing/Internals.idl:
1333
1334 2015-09-04  Ryosuke Niwa  <rniwa@webkit.org>
1335
1336         Range.isPointInRange check root node before verifying offset
1337         https://bugs.webkit.org/show_bug.cgi?id=148776
1338
1339         isPointInRange should never throw WrongDocumentError
1340         https://bugs.webkit.org/show_bug.cgi?id=148779
1341
1342         Reviewed by Darin Adler.
1343
1344         Fixed two bugs since they were inter-dependent on each other.
1345
1346         We use the same trick we used for comparePoint in r189327 to avoid O(n) operation in common cases
1347         and return false when either calls to compareBoundaryPoints yields a WrongDocumentError.
1348
1349         No new tests since this is covered by an existing W3C test.
1350
1351         * dom/Range.cpp:
1352         (WebCore::Range::isPointInRange):
1353         (WebCore::Range::comparePoint):
1354
1355 2015-09-03  Commit Queue  <commit-queue@webkit.org>
1356
1357         Unreviewed, rolling out r189338.
1358         https://bugs.webkit.org/show_bug.cgi?id=148785
1359
1360         Caused tons of crashes (Requested by cdumez on #webkit).
1361
1362         Reverted changeset:
1363
1364         "Web Inspector: InspectorController should support multiple
1365         frontend channels"
1366         https://bugs.webkit.org/show_bug.cgi?id=148538
1367         http://trac.webkit.org/changeset/189338
1368
1369 2015-09-03  Brian Burg  <bburg@apple.com>
1370
1371         Web Inspector: InspectorController should support multiple frontend channels
1372         https://bugs.webkit.org/show_bug.cgi?id=148538
1373
1374         Reviewed by Joseph Pecoraro.
1375
1376         No new tests, no behavior change from this patch. Teardown scenarios are
1377         covered by existing protocol and inspector tests running under DRT and WKTR.
1378
1379         * ForwardingHeaders/inspector/InspectorFrontendRouter.h: Added.
1380         * WebCore.vcxproj/WebCore.vcxproj:
1381         * inspector/InspectorClient.h: Stop using forwarded types.
1382         * inspector/InspectorController.cpp:
1383         (WebCore::InspectorController::InspectorController):
1384         (WebCore::InspectorController::inspectedPageDestroyed):
1385         (WebCore::InspectorController::hasLocalFrontend):
1386         (WebCore::InspectorController::hasRemoteFrontend):
1387         (WebCore::InspectorController::connectFrontend):
1388         (WebCore::InspectorController::disconnectFrontend):
1389         (WebCore::InspectorController::disconnectAllFrontends): Added. Disconnects all
1390         frontends and signals DisconnectReason::InspectedTargetDestroyed.
1391
1392         (WebCore::InspectorController::show):
1393         (WebCore::InspectorController::close):
1394         (WebCore::InspectorController::dispatchMessageFromFrontend):
1395         * inspector/InspectorController.h: Add default value for isAutomaticInspection.
1396         * inspector/InspectorDatabaseAgent.cpp:
1397         * inspector/InspectorIndexedDBAgent.cpp:
1398         * inspector/InspectorResourceAgent.cpp:
1399         * inspector/WorkerInspectorController.cpp: Use a router with a singleton channel
1400         that forwards messages over to the main page.
1401
1402         (WebCore::WorkerInspectorController::WorkerInspectorController):
1403         (WebCore::WorkerInspectorController::connectFrontend):
1404         (WebCore::WorkerInspectorController::disconnectFrontend):
1405         (WebCore::WorkerInspectorController::dispatchMessageFromFrontend):
1406         * inspector/WorkerInspectorController.h:
1407         * page/PageDebuggable.cpp:
1408         (WebCore::PageDebuggable::disconnect):
1409         * page/PageDebuggable.h:
1410         * testing/Internals.cpp: Clear the frontend client before disconnecting frontend channel.
1411         (WebCore::Internals::openDummyInspectorFrontend):
1412         (WebCore::Internals::closeDummyInspectorFrontend):
1413
1414 2015-09-03  Jinyoung Hur  <hur.ims@navercorp.com>
1415
1416         [Texmap] highp precision should be used conditionally for fragment shaders on OpenGL ES
1417         https://bugs.webkit.org/show_bug.cgi?id=143993
1418
1419         Reviewed by Martin Robinson.
1420
1421         There are some GPUs that do not support the GL_OES_fragment_precision_high extension. (e.g., Mali-T624)
1422         Therefore, highp precision should be used in shader fragments conditionally using a proper preprocessor,
1423         GL_FRAGMENT_PRECISION_HIGH.
1424         Without this patch, nothing will be displayed on the screen if the running platform doesn't support the
1425         GL_OES_fragment_precision_high extension.
1426
1427         No new tests, covered by existing tests.
1428
1429         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
1430
1431 2015-09-03  Ryosuke Niwa  <rniwa@webkit.org>
1432
1433         Range.comparePoint shouldn't throw an exception if the range and the node are in the same detached tree
1434         https://bugs.webkit.org/show_bug.cgi?id=148733
1435
1436         Reviewed by Chris Dumez.
1437
1438         Don't throw WRONG_DOCUMENT_ERR when refNode is not in the document. The new behavior matches DOM4 as well
1439         as the behavior of Firefox. See https://dom.spec.whatwg.org/#dom-range-comparepoint
1440
1441         WRONG_DOCUMENT_ERR is still thrown by compareBoundaryPoints later in the function when the root nodes of
1442         refNode and boundary points are different.
1443
1444         There is one subtlety here that we need to throw WRONG_DOCUMENT_ERR instead of INDEX_SIZE_ERR when refNode
1445         and the boundary points don't share the same root node even if (refNode, offset) pair is invalid since
1446         DOM4 spec checks the former condition first. We implement this behavior by first validating the offset
1447         and then explicitly checking for the root node difference if the former check failed to avoid the latter
1448         O(n) check in common cases.
1449
1450         Test: fast/dom/Range/range-comparePoint-detached-nodes.html
1451
1452         * dom/Range.cpp:
1453         (WebCore::Range::comparePoint):
1454
1455 2015-09-03  Jer Noble  <jer.noble@apple.com>
1456
1457         [iOS] Playback does not pause when deselecting route and locking screen.
1458         https://bugs.webkit.org/show_bug.cgi?id=148724
1459
1460         Reviewed by Eric Carlson.
1461
1462         When deselecting a route, the route change notification can be delayed for some amount
1463         of time. If the screen is locked before the notification is fired, the PlatformMediaSessionManager
1464         can refuse to pause the video when entering the background due to a wireless playback route
1465         still being active.
1466
1467         When the media element transitions from having an active route to not having one (or vice versa),
1468         re-run the interruption check. In order to correctly determine, when that occurs, whether
1469         we are in an 'application background' state, cache that value to an ivar when handling
1470         application{Will,Did}Enter{Background,Foreground}.
1471
1472         Because we only want to run this step during an actual transition between playing to a route ->
1473         playing locally, cache the value of isPlayingToWirelessPlayback to another ivar, and only
1474         inform the PlatformMediaSessionManager when that value actually changes.
1475
1476         * html/HTMLMediaElement.cpp:
1477         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
1478         * platform/audio/PlatformMediaSession.cpp:
1479         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTargetChanged): Set or clear m_isPlayingToWirelessPlaybackTarget.
1480         * platform/audio/PlatformMediaSession.h:
1481         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTarget): Simple getter.
1482         * platform/audio/PlatformMediaSessionManager.cpp:
1483         (WebCore::PlatformMediaSessionManager::applicationWillEnterBackground): Set m_isApplicationInBackground.
1484         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground): Ditto.
1485         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground): Clear m_isApplicationInBackground.
1486         (WebCore::PlatformMediaSessionManager::sessionIsPlayingToWirelessPlaybackTargetChanged): Run interruption
1487             if application is in background.
1488
1489 2015-09-03  Brady Eidson  <beidson@apple.com>
1490
1491         Move SecurityOriginData from WK2 to WebCore.
1492         https://bugs.webkit.org/show_bug.cgi?id=148739
1493
1494         Reviewed by Tim Horton.
1495
1496         This will be needed for upcoming IndexedDB work.
1497
1498         No new tests (No behavior change.)
1499
1500         * CMakeLists.txt:
1501         * WebCore.xcodeproj/project.pbxproj:
1502         
1503         * page/SecurityOriginData.cpp: Renamed from Source/WebKit2/Shared/SecurityOriginData.cpp.
1504         (WebCore::SecurityOriginData::fromSecurityOrigin):
1505         (WebCore::SecurityOriginData::fromFrame):
1506         (WebCore::SecurityOriginData::securityOrigin):
1507         (WebCore::SecurityOriginData::isolatedCopy):
1508         (WebCore::operator==):
1509         * page/SecurityOriginData.h: Renamed from Source/WebKit2/Shared/SecurityOriginData.h.
1510         (WebCore::SecurityOriginData::encode):
1511         (WebCore::SecurityOriginData::decode):
1512
1513 2015-09-03  Zalan Bujtas  <zalan@apple.com>
1514
1515         New clang warns about boolean checks for |this| pointer in RenderObject debug methods
1516         https://bugs.webkit.org/show_bug.cgi?id=136599
1517
1518         Remove unnecessary null checking.
1519
1520         Reviewed by David Kilzer.
1521
1522         Not testable.
1523
1524         * rendering/RenderObject.cpp:
1525         (WebCore::RenderObject::showRenderObject): Deleted.
1526         (WebCore::RenderObject::showRenderSubTreeAndMark): Deleted.
1527
1528 2015-09-03  Adenilson Cavalcanti  <cavalcantii@gmail.com>
1529
1530         Improve access specifier use in RenderObject
1531         https://bugs.webkit.org/show_bug.cgi?id=148745
1532
1533         Reviewed by Myles C. Maxfield.
1534
1535         No new tests, no change in behavior.
1536
1537         * rendering/RenderObject.h:
1538         (WebCore::RenderObject::setPreviousSibling):
1539         (WebCore::RenderObject::setNextSibling):
1540         (WebCore::RenderObject::isSetNeedsLayoutForbidden):
1541         (WebCore::RenderObject::setNeedsLayoutIsForbidden):
1542
1543 2015-09-03  Alexey Proskuryakov  <ap@apple.com>
1544
1545         Test Russian ".рф" domain support
1546         https://bugs.webkit.org/show_bug.cgi?id=148721
1547
1548         Reviewed by Darin Adler.
1549
1550         Test: fast/url/user-visible/rf.html
1551
1552         * html/URLUtils.h: Made this header file work with Objective-C.
1553
1554         * WebCore.xcodeproj/project.pbxproj:
1555         * bindings/scripts/CodeGeneratorJS.pm:
1556         * testing/Internals.cpp:
1557         (WebCore::Internals::getCurrentMediaControlsStatusForElement):
1558         (WebCore::Internals::userVisibleString):
1559         * testing/Internals.h:
1560         * testing/Internals.idl:
1561         * testing/Internals.mm: Added.
1562         (WebCore::Internals::userVisibleString):
1563
1564 2015-09-03  Chris Dumez  <cdumez@apple.com>
1565
1566         document.createEvent("eventname") should do a case-insensitive match on the event name
1567         https://bugs.webkit.org/show_bug.cgi?id=148738
1568         <rdar://problem/22558709>
1569
1570         Reviewed by Andreas Kling.
1571
1572         document.createEvent("eventname") should do a case-insensitive match on the event name:
1573         https://dom.spec.whatwg.org/#dom-document-createevent
1574
1575         WebKit was doing a case-sensitive match. Firefox and Chrome match the specification.
1576
1577         No new tests, already covered by:
1578         http/tests/w3c/dom/nodes/Document-createEvent.html (rebaselined)
1579
1580         * dom/make_event_factory.pl:
1581         (generateImplementation):
1582
1583 2015-09-02  Ryosuke Niwa  <rniwa@webkit.org>
1584
1585         MutationObserver should accept attributeFilter, attributeOldValue, and characterDataOldValue on their own
1586         https://bugs.webkit.org/show_bug.cgi?id=148716
1587
1588         Reviewed by Chris Dumez.
1589
1590         According to DOM4 [1], MutationObserver accepts characterDataOldValue, attributeOldValue and attributeFilter options
1591         on their own when characterData and attributes options are omitted. It throws only when characterData and attributes
1592         options are explicitly set to false.
1593
1594         Fixed our implementation accordingly. Existing tests as well as ones imported from W3C covers this.
1595
1596         [1] http://www.w3.org/TR/2015/WD-dom-20150618/#interface-mutationobserver
1597
1598         * dom/MutationObserver.cpp:
1599         (WebCore::MutationObserver::observe):
1600
1601 2015-09-02  Andreas Kling  <akling@apple.com>
1602
1603         ScrollbarThemes should be returned by reference.
1604         <https://webkit.org/b/147551>
1605
1606         Reviewed by Zalan Bujtas.
1607
1608         There's always a ScrollbarTheme of some type, so have ScrollbarTheme getters
1609         return references all around.
1610
1611         * css/SelectorCheckerTestFunctions.h:
1612         (WebCore::scrollbarMatchesDoubleButtonPseudoClass):
1613         (WebCore::scrollbarMatchesSingleButtonPseudoClass):
1614         (WebCore::scrollbarMatchesNoButtonPseudoClass):
1615         * html/shadow/SpinButtonElement.cpp:
1616         (WebCore::SpinButtonElement::startRepeatingTimer):
1617         * page/PageOverlay.cpp:
1618         (WebCore::PageOverlay::bounds):
1619         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
1620         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
1621         * platform/ScrollView.cpp:
1622         (WebCore::ScrollView::paintScrollCorner):
1623         (WebCore::ScrollView::paintOverhangAreas):
1624         * platform/ScrollableArea.cpp:
1625         (WebCore::ScrollableArea::setScrollbarOverlayStyle):
1626         * platform/Scrollbar.cpp:
1627         (WebCore::Scrollbar::maxOverlapBetweenPages):
1628         (WebCore::Scrollbar::Scrollbar):
1629         (WebCore::Scrollbar::~Scrollbar):
1630         (WebCore::Scrollbar::offsetDidChange):
1631         (WebCore::Scrollbar::updateThumb):
1632         (WebCore::Scrollbar::paint):
1633         (WebCore::Scrollbar::autoscrollTimerFired):
1634         (WebCore::thumbUnderMouse):
1635         (WebCore::Scrollbar::autoscrollPressedPart):
1636         (WebCore::Scrollbar::startTimerIfNeeded):
1637         (WebCore::Scrollbar::moveThumb):
1638         (WebCore::Scrollbar::setHoveredPart):
1639         (WebCore::Scrollbar::setPressedPart):
1640         (WebCore::Scrollbar::mouseMoved):
1641         (WebCore::Scrollbar::mouseUp):
1642         (WebCore::Scrollbar::mouseDown):
1643         (WebCore::Scrollbar::setEnabled):
1644         (WebCore::Scrollbar::isOverlayScrollbar):
1645         * platform/Scrollbar.h:
1646         (WebCore::Scrollbar::theme):
1647         * platform/ScrollbarTheme.cpp:
1648         (WebCore::ScrollbarTheme::theme):
1649         * platform/ScrollbarTheme.h:
1650         * platform/efl/ScrollbarThemeEfl.cpp:
1651         (WebCore::ScrollbarTheme::nativeTheme):
1652         * platform/gtk/ScrollbarThemeGtk.cpp:
1653         (WebCore::ScrollbarTheme::nativeTheme):
1654         * platform/ios/ScrollbarThemeIOS.mm:
1655         (WebCore::ScrollbarTheme::nativeTheme):
1656         * platform/mac/ScrollAnimatorMac.mm:
1657         (macScrollbarTheme):
1658         * platform/mac/ScrollbarThemeMac.mm:
1659         (+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
1660         (+[WebScrollbarPrefsObserver behaviorPrefsChanged:]):
1661         (WebCore::ScrollbarTheme::nativeTheme):
1662         * platform/win/PopupMenuWin.cpp:
1663         (WebCore::PopupMenuWin::calculatePositionAndSize):
1664         (WebCore::AccessiblePopupMenu::accLocation):
1665         (WebCore::AccessiblePopupMenu::accHitTest):
1666         * platform/win/ScrollbarThemeSafari.cpp:
1667         (WebCore::ScrollbarTheme::nativeTheme):
1668         * platform/win/ScrollbarThemeWin.cpp:
1669         (WebCore::ScrollbarTheme::nativeTheme):
1670         * rendering/RenderBox.cpp:
1671         (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior):
1672         (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior):
1673         * rendering/RenderLayer.cpp:
1674         (WebCore::cornerRect):
1675         (WebCore::styleRequiresScrollbar):
1676         (WebCore::styleDefinesAutomaticScrollbar):
1677         * rendering/RenderScrollbar.cpp:
1678         (WebCore::RenderScrollbar::updateScrollbarPart):
1679         * rendering/RenderScrollbarPart.cpp:
1680         (WebCore::calcScrollbarThicknessUsing):
1681         (WebCore::RenderScrollbarPart::styleDidChange):
1682         (WebCore::RenderScrollbarPart::imageChanged):
1683         * rendering/RenderScrollbarTheme.cpp:
1684         (WebCore::RenderScrollbarTheme::paintTickmarks):
1685         * rendering/RenderScrollbarTheme.h:
1686         * rendering/RenderTextControl.cpp:
1687         (WebCore::RenderTextControl::scrollbarThickness):
1688
1689 2015-09-02  Ryosuke Niwa  <rniwa@webkit.org>
1690
1691         Node.textContent = undefined should be equivalent to textContent = ""
1692         https://bugs.webkit.org/show_bug.cgi?id=148729
1693
1694         Reviewed by Darin Adler.
1695
1696         Assigning undefined to textContent should be equivalent to assigning an empty string to it like innerHTML.
1697         This is because textContent is defined as an DOMString? attribute in DOM4 [1] and WebIDL defines ECMAScript
1698         undefined to be treated as null for nullable types [2].
1699
1700         The new behavior matches that of Firefox and Chrome.
1701
1702         [1] https://dom.spec.whatwg.org/#node
1703         [2] https://heycam.github.io/webidl/#es-nullable-type
1704         
1705         * dom/Node.idl:
1706
1707 2015-09-02  Alex Christensen  <achristensen@webkit.org>
1708
1709         Make bison grammar compatible with bison 2.1
1710         https://bugs.webkit.org/show_bug.cgi?id=148731
1711
1712         Reviewed by Tim Horton.
1713
1714         * css/CSSGrammar.y.in:
1715         * xml/XPathGrammar.y:
1716         Move all union fields to one union so bison 2.1 generates equivalent output.
1717
1718 2015-09-02  Dean Jackson  <dino@apple.com>
1719
1720         Add some Houdini specs to the features list
1721         https://bugs.webkit.org/show_bug.cgi?id=148722
1722         <rdar://problem/22545319>
1723
1724         Reviewed by Eric Carlson.
1725
1726         Add the two CSS Houdini specs that have some actual
1727         content to the features list: custom painting and
1728         custom property registration.
1729
1730         * features.json:
1731
1732 2015-09-02  Brady Eidson  <beidson@apple.com>
1733
1734         Import W3C IndexedDB tests.
1735         https://bugs.webkit.org/show_bug.cgi?id=148713
1736
1737         Reviewed by Tim Horton' rubber stamp.
1738
1739         Tests: imported/w3c/indexeddb/*
1740
1741         * Modules/indexeddb/IDBDatabase.cpp:
1742         (WebCore::IDBDatabase::onVersionChange): Remove invalid assert - version goes back to 0 when initial
1743           versionChange transaction is aborted.
1744
1745 2015-09-02  Dean Jackson  <dino@apple.com>
1746
1747         Separate WebGL 1 and WebGL 2 in the features file.
1748
1749         Unreviewed.
1750
1751         * features.json:
1752
1753 2015-09-02  Dean Jackson  <dino@apple.com>
1754
1755         Reset the status label when the media is playable
1756         https://bugs.webkit.org/show_bug.cgi?id=148704
1757         <rdar://problem/22541939>
1758
1759         Reviewed by Eric Carlson.
1760
1761         Flakiness on the bots uncovered a situation where we
1762         hide the status label but left it with incorrect content.
1763
1764         Covered by the existing statusDisplay test.
1765
1766         * Modules/mediacontrols/mediaControlsApple.js:
1767         (Controller.prototype.updateStatusDisplay): Only set to loading if we're not yet playable.
1768
1769 2015-09-02  Chris Fleizach  <cfleizach@apple.com>
1770
1771         AX: WebKit does not expose max/min value of <progress> element
1772         https://bugs.webkit.org/show_bug.cgi?id=148707
1773
1774         Reviewed by Mario Sanchez Prada.
1775
1776         Allow native progress indicator elements to report min/max values by rewriting special
1777         case code for ARIA progress bars.
1778
1779         Test: accessibility/mac/progress-element-min-max.html
1780
1781         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1782         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1783
1784 2015-09-02  Hyemi Shin  <hyemi.sin@samsung.com>
1785
1786         [GStreamer] Simplify linking pads in AudioDestination and correct old comment.
1787         https://bugs.webkit.org/show_bug.cgi?id=148702
1788
1789         Reviewed by Philippe Normand.
1790
1791         Simplify linking src pad of webkitAudioSrc and sink pad of audioConvert
1792         to one line because implementation changed not to use seperate function
1793         to complete building rest of pipelines.
1794         Correct old comment also there is no more wavparse element.
1795
1796         No new tests, no behavior change.
1797
1798         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
1799         (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
1800
1801 2015-09-02  Chris Dumez  <cdumez@apple.com>
1802
1803         document.createProcessingInstruction() does not behave according to specification
1804         https://bugs.webkit.org/show_bug.cgi?id=148710
1805
1806         Reviewed by Ryosuke Niwa.
1807
1808         document.createProcessingInstruction() does not behave according to
1809         specification:
1810         https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction
1811
1812         The following changes were made in this patch to match the specification
1813         and the behavior of Firefox / Chrome:
1814         1. document.createProcessingInstruction() now works for HTML documents.
1815         2. Throw an InvalidCharacterError if the data contains "?>" (step 2 of spec)
1816
1817         No new tests, already covered by existing tests that are rebaselined in
1818         this patch.
1819
1820         * dom/Document.cpp:
1821         (WebCore::Document::createProcessingInstruction):
1822
1823 2015-09-02  Chris Dumez  <cdumez@apple.com>
1824
1825         http/tests/w3c/dom/nodes/Element-matches.html is flaky
1826         https://bugs.webkit.org/show_bug.cgi?id=148615
1827
1828         Reviewed by Ryosuke Niwa.
1829
1830         Several newly-imported w3c tests were flaky due to the :target
1831         pseudo-class selectors sometimes giving different results. The
1832         issue seems to be that this type of selector relies on the
1833         Document::cssTarget() element to do the matching. We update
1834         this cssTarget Element in FrameView's scrollToFragment() /
1835         scrollToAnchor(). This is called from
1836         scrollToFragmentWithParentBoundary() which is called by
1837         FrameLoader's finishedParsing() and loadInSameDocument().
1838
1839         In the first one, it is called *after* calling checkComplete()
1840         which fires the onload event. However, in the second method,
1841         it is called *before*. This patch updates finishedParsing()
1842         so that scrollToFragmentWithParentBoundary() is called *before*
1843         firing the onload event, consistently with loadInSameDocument().
1844         This makes sure that JavaScript executed in an onload event
1845         handler will get accurate results for :target pseudo-class
1846         selectors.
1847
1848         No new tests, covered by:
1849         http/tests/w3c/dom/nodes/Element-matches.html
1850         http/tests/w3c/dom/nodes/ParentNode-querySelector-All-xhtml.xhtml
1851
1852         * loader/FrameLoader.cpp:
1853         (WebCore::FrameLoader::finishedParsing):
1854
1855 2015-09-02  Zan Dobersek  <zdobersek@igalia.com>
1856
1857         Construct default winding string arguments in CanvasRenderingContext2D from ASCIILiteral objects
1858         https://bugs.webkit.org/show_bug.cgi?id=148441
1859
1860         Reviewed by Darin Adler.
1861
1862         * html/canvas/CanvasRenderingContext2D.h: Use ASCIILiteral objects to construct
1863         the default values for the winding arguments. This will avoid copying the string
1864         data every time the methods are invoked with the default argument value.
1865
1866 2015-09-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1867
1868         Unreviewed. Fix GObject DOM bindings API breaks after r189182.
1869
1870         Several methods are no longer raising exceptions after
1871         r189182. Add them to the list, but also handle the case where the
1872         methods are called inside the class, to add the nullptr parameter
1873         for the GError.
1874
1875         * bindings/scripts/CodeGeneratorGObject.pm:
1876         (GenerateProperty):
1877         (FunctionUsedToRaiseException):
1878
1879 2015-09-01  Ryosuke Niwa  <rniwa@webkit.org>
1880
1881         Rename ShadowRoot::hostElement to shadowRoot::host to match the latest spec
1882         https://bugs.webkit.org/show_bug.cgi?id=148694
1883
1884         Address the review comments by Chris.
1885
1886         * dom/Element.cpp:
1887         (WebCore::Element::removeShadowRoot):
1888         * dom/Node.cpp:
1889         (WebCore::Node::shadowHost):
1890         * dom/ShadowRoot.cpp:
1891         (WebCore::ShadowRoot::ShadowRoot):
1892         * dom/ShadowRoot.h:
1893
1894 2015-09-01  Zalan Bujtas  <zalan@apple.com>
1895
1896         Recompute maximum outline size only when outline changes.
1897         https://bugs.webkit.org/show_bug.cgi?id=148576
1898
1899         Reviewed by Andreas Kling.
1900
1901         We should only recompute the cached maximum outline size when
1902         either the outline size (offset/width) or the style (from or to
1903         auto) changes.
1904         Setting 'outline-style: auto' can change the final outline width as 'auto' triggers
1905         the focus ring mode. In this mode, we ignore outline-width and use the platform default value instead.  
1906
1907         Covered by existing test cases.
1908
1909         * rendering/RenderElement.cpp:
1910         (WebCore::RenderElement::computeMaxOutlineSize):
1911         (WebCore::RenderElement::styleWillChange):
1912         (WebCore::RenderElement::initializeStyle): Deleted.
1913         (WebCore::RenderElement::setStyle): Deleted.
1914         * rendering/RenderElement.h:
1915
1916 2015-09-01  Chris Dumez  <cdumez@apple.com>
1917
1918         Range API should throw a TypeError for null Node parameters
1919         https://bugs.webkit.org/show_bug.cgi?id=148692
1920
1921         Reviewed by Ryosuke Niwa.
1922
1923         Range API should throw a TypeError for null Node parameters. We currently
1924         throw a NotFoundError.
1925
1926         As per the DOM specification, the Node arguments are not optional nor
1927         nullable [1]:
1928         https://dom.spec.whatwg.org/#range
1929
1930         Therefore, as per the Web IDL specification, we should throw a TypeError
1931         if the Node parameter is null or missing:
1932         https://heycam.github.io/webidl/#es-interface (step 1).
1933
1934         [1] https://heycam.github.io/webidl/#es-nullable-type
1935
1936         No new tests, covered by existing tests which have been
1937         rebaselined.
1938
1939         * dom/Range.cpp:
1940         (WebCore::Range::setStart):
1941         (WebCore::Range::setEnd):
1942         (WebCore::Range::isPointInRange):
1943         (WebCore::Range::comparePoint):
1944         (WebCore::Range::compareNode):
1945         (WebCore::Range::compareBoundaryPoints):
1946         (WebCore::Range::intersectsNode):
1947         (WebCore::Range::insertNode):
1948         (WebCore::Range::setStartAfter):
1949         (WebCore::Range::setEndBefore):
1950         (WebCore::Range::setEndAfter):
1951         (WebCore::Range::selectNode):
1952         (WebCore::Range::selectNodeContents):
1953         (WebCore::Range::surroundContents):
1954         (WebCore::Range::setStartBefore):
1955         Set the Exception code to TypeError instead of NOT_FOUND_ERR if
1956         the Node parameter is null.
1957
1958         * dom/Range.idl:
1959         Stop marking the Node parameters as optional. They are not optional in
1960         the specification and they are not really optional in our implementation.
1961         Previously, if the Node parameter was missing, we would call the
1962         implementation with a null pointer and the implementation would throw a
1963         NotFoundError. Now that they are mandatory, the bindings will directly
1964         throw a TypeError (as per the Web IDL spec) if the Node parameter is
1965         missing. However, if the JavaScript explicitely passes null or undefined,
1966         the implementation will still be called with a null pointer (because
1967         our bindings generator does not distinguish nullable / non-nullable
1968         parameters). For this reason, we still need to handle null pointers on
1969         the implementation side.
1970
1971 2015-09-01  Ryosuke Niwa  <rniwa@webkit.org>
1972
1973         Rename ShadowRoot::hostElement to shadowRoot::host to match the latest spec
1974         https://bugs.webkit.org/show_bug.cgi?id=148694
1975
1976         Reviewed by Chris Dumez.
1977
1978         Renamed ShadowRoot::hostElement to ShadowRoot::host to match the latest shadow DOM spec.
1979         This will help us implementing shadow DOM in near future.
1980
1981         * dom/ContainerNodeAlgorithms.cpp:
1982         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument):
1983         (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument):
1984         * dom/Element.cpp:
1985         (WebCore::Element::addShadowRoot):
1986         (WebCore::Element::removeShadowRoot):
1987         * dom/EventDispatcher.cpp:
1988         (WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
1989         (WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope):
1990         (WebCore::shouldEventCrossShadowBoundary):
1991         (WebCore::EventPath::EventPath):
1992         * dom/Node.cpp:
1993         (WebCore::Node::shadowHost):
1994         (WebCore::Node::deprecatedShadowAncestorNode):
1995         (WebCore::Node::parentOrShadowHostElement):
1996         * dom/NodeRenderingTraversal.cpp:
1997         (WebCore::NodeRenderingTraversal::traverseParent):
1998         * dom/ShadowRoot.cpp:
1999         (WebCore::ShadowRoot::setInnerHTML):
2000         (WebCore::ShadowRoot::setResetStyleInheritance):
2001         * dom/ShadowRoot.h:
2002         (WebCore::Node::parentOrShadowHostNode):
2003         * dom/Text.cpp:
2004         (WebCore::isSVGShadowText):
2005         * dom/TreeScope.cpp:
2006         (WebCore::TreeScope::focusedElement):
2007         * html/shadow/ContentDistributor.cpp:
2008         (WebCore::ContentDistributor::ensureDistribution):
2009         * html/shadow/InsertionPoint.cpp:
2010         (WebCore::InsertionPoint::insertedInto):
2011         (WebCore::InsertionPoint::removedFrom):
2012         * page/DragController.cpp:
2013         (WebCore::asFileInput):
2014         * page/EventHandler.cpp:
2015         (WebCore::EventHandler::handleMousePressEvent):
2016         * page/FocusController.cpp:
2017         (WebCore::FocusNavigationScope::owner):
2018         * rendering/RenderLayer.cpp:
2019         (WebCore::rendererForScrollbar):
2020         * style/StyleResolveTree.cpp:
2021         (WebCore::Style::attachShadowRoot):
2022         (WebCore::Style::resolveShadowTree):
2023         * svg/SVGElement.cpp:
2024         (WebCore::SVGElement::correspondingUseElement):
2025
2026 2015-09-01  Chris Dumez  <cdumez@apple.com>
2027
2028         NodeFilter should be a callback interface
2029         https://bugs.webkit.org/show_bug.cgi?id=148415
2030
2031         Reviewed by Geoffrey Garen.
2032
2033         NodeFilter is now a callback interface, instead of a regular interface,
2034         as per the DOM specification:
2035         https://dom.spec.whatwg.org/#interface-nodefilter
2036
2037         One major difference is that TreeWalker.filter / NodeIterator is
2038         supposed to be a Function / Object (passed by JavaScript), but it was a
2039         JSNodeFilter wrapper in WebKit. Also, window.NodeFilter is not supposed
2040         to have a prototype property.
2041
2042         This behavior is consistent with Firefox. However, Chrome still has its
2043         own NodeFilter wrapper.
2044
2045         Tests:
2046         http/tests/w3c/dom/traversal/NodeIterator-expected.html (rebaselined)
2047         http/tests/w3c/dom/traversal/TreeWalker.html (rebaselined)
2048
2049         * CMakeLists.txt:
2050         * WebCore.vcxproj/WebCore.vcxproj:
2051         * WebCore.vcxproj/WebCore.vcxproj.filters:
2052         * WebCore.xcodeproj/project.pbxproj:
2053         Add / Remove files to the project files.
2054
2055         * dom/NodeFilterCondition.cpp:
2056         (WebCore::NodeFilterCondition::acceptNode):
2057         * dom/NodeFilterCondition.h:
2058         * bindings/gobject/GObjectNodeFilterCondition.cpp:
2059         (WebCore::GObjectNodeFilterCondition::acceptNode):
2060         * bindings/gobject/GObjectNodeFilterCondition.h:
2061         * bindings/objc/ObjCNodeFilterCondition.h:
2062         * bindings/objc/ObjCNodeFilterCondition.mm:
2063         (WebCore::ObjCNodeFilterCondition::acceptNode):
2064         Drop ExecState parameter as it is not used.
2065
2066         * bindings/gobject/WebKitDOMNodeFilter.cpp:
2067         (WebKit::core):
2068         Use NativeNodeFilter type instead of NodeFilter. NodeFilter is now
2069         a pure interface with 2 subclasses: NativeNodeFilter for the native
2070         bindings and JSNodeFilter for the JS bindings.
2071
2072         * bindings/js/JSBindingsAllInOne.cpp:
2073         Drop JSNodeFilterCondition.cpp as it was removed.
2074
2075         * bindings/js/JSCallbackData.cpp:
2076         (WebCore::JSCallbackData::invokeCallback):
2077         Throw a TypeError if the callback object being invoked is not callable
2078         and does not have a callable property with the expected name. There
2079         are several layout tests covering this (including w3c ones). Previously,
2080         NodeFilter was not using the generic JSCallbackData and the exception
2081         throwing was in JSNodeFilterCondition::acceptNode() instead.
2082
2083         * bindings/js/JSNodeFilterCondition.cpp: Removed.
2084         * bindings/js/JSNodeFilterCondition.h: Removed.
2085         Drop this class. JSNodeFilter / JSNodeFilterCustom now basically take
2086         care of all this.
2087
2088         * bindings/js/JSNodeFilterCustom.cpp:
2089         (WebCore::JSNodeFilter::acceptNode):
2090         Complete rewrite. This file is now only used to provide a custom
2091         implementation for JSNodeFilter::acceptNode(). The code is similar to
2092         what was previously done in JSNodeFilterCondition::acceptNode().
2093         There are several reasons we need custom bindings here:
2094         - The bindings generator does not handle yet callback functions
2095           returning anything else than a boolean.
2096         - The specification clearly states that we need to rethrow exceptions
2097           thrown by the callback function. However, the default behavior of
2098           our bindings is to simply report the exception.
2099
2100         * bindings/scripts/CodeGeneratorGObject.pm:
2101         Only skip functions that have parameters that are callback *functions*,
2102         not callback *interfaces*. Callback interfaces are very similar to
2103         interfaces and the generator is able to handle them. This change was
2104         needed for the GTK bindings generator would no longer generate bindings
2105         for Document.createNodeIterator() / Document.createTreeWalker(), now
2106         that NodeFilter is a callback interface instead of a regular interface.
2107
2108         * bindings/scripts/CodeGeneratorJS.pm:
2109         (GenerateCallbackHeader):
2110         (GenerateCallbackImplementation):
2111         Generate a toJS() function for callback interfaces as well. Previously,
2112         we would only generate those for regular interfaces. This is needed
2113         because NodeFilter is now a callback interface and it is exposed to
2114         JS via NodeIterator.filter / TreeWalker.filter. The implementation
2115         merely returns the callback object / function inside the JSCalbackData
2116         so the JS gets back the object / function it passed in.
2117
2118         * bindings/scripts/CodeGeneratorObjC.pm:
2119         Tweak the ObjC bindings generator to use NativeNodeFilter class instead
2120         of NodeFilter as NodeFilter is now a pure interfaces. Native bindings
2121         are now expected to use the NativeNodeFilter subclass instead.
2122
2123         * bindings/scripts/test/JS/JSTestCallback.cpp:
2124         * bindings/scripts/test/JS/JSTestCallback.h:
2125         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
2126         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
2127         Rebaseline bindings tests now that we generate toJS() functions for
2128         callback functions / interfaces.
2129
2130         * dom/DOMAllInOne.cpp:
2131         Drop NodeFilter.cpp as it was removed.
2132
2133         * dom/NativeNodeFilter.cpp: Added.
2134         * dom/NativeNodeFilter.h: Added.
2135         Introduce new NativeNodeFilter class which subclasses the NodeFilter
2136         interface and is used by native bindings. Its accept() implementation
2137         uses NodeFilterCondition object internally to filter the nodes instead
2138         of a JS callback.
2139
2140         * dom/NodeFilter.cpp: Removed.
2141         * dom/NodeFilter.h:
2142         Make NodeFilter a pure interface. Its previous code is now either in
2143         NativeNodeFilter of JSNodeFilter.
2144
2145         * dom/NodeFilter.idl:
2146         Make NodeFilter a callback interface instead of a regular interface,
2147         as per the DOM specification. Also have its accept() operation return
2148         an unsigned short instead of a short to match the specification.
2149         The ObjC version still returns a short though for backward
2150         compatibility.
2151
2152         * dom/NodeFilterCondition.cpp:
2153         (WebCore::NodeFilterCondition::acceptNode):
2154         * dom/NodeFilterCondition.h:
2155
2156         * dom/NodeIterator.cpp:
2157         * dom/NodeIterator.h:
2158         * dom/NodeIterator.idl:
2159         * dom/Traversal.cpp:
2160         * dom/Traversal.h:
2161         * dom/TreeWalker.cpp:
2162         * dom/TreeWalker.h:
2163         * dom/TreeWalker.idl:
2164         Stop passing ExecState to TreeWalker / NodeIterator functions. It no
2165         longer seems to be needed as we now use the JSCallbackData abstraction
2166         for invoking JS.
2167
2168 2015-09-01  Chris Dumez  <cdumez@apple.com>
2169
2170         Range.insersectsNode(node) is supposed to return true if node.parent is null
2171         https://bugs.webkit.org/show_bug.cgi?id=148687
2172
2173         Reviewed by Ryosuke Niwa.
2174
2175         Range.insersectsNode(node) is supposed to return true if node.parent is
2176         null:
2177         https://dom.spec.whatwg.org/#dom-range-intersectsnode (step 3)
2178
2179         Previously, WebKit would throw a NotFoundError, apparently to match
2180         Firefox's behavior. However, these days, Firefox complies with the
2181         specification and returns true here.
2182
2183         No new tests, already covered by:
2184         http/tests/w3c/dom/ranges/Range-intersectsNode.html (rebaselined)
2185
2186         * dom/Range.cpp:
2187         (WebCore::Range::intersectsNode):
2188
2189 2015-09-01  Brian Burg  <bburg@apple.com>
2190
2191         Web Inspector: tighten up lifetimes for InspectorController-owned objects; add brace initializers to agents
2192         https://bugs.webkit.org/show_bug.cgi?id=148612
2193
2194         Reviewed by Joseph Pecoraro.
2195
2196         Both InjectedScriptManager and AgentRegistry (thus all agents) are
2197         owned by [Worker]InspectorController. So, use references.
2198
2199         InstrumentingAgents is morally owned by InspectorController as well, but
2200         must be a Ref for now since instrumentation cookies take a strong reference.
2201
2202         Add brace initalizers for scalar and pointer members in agent classes.
2203
2204         No new tests, no behavior change.
2205
2206         * inspector/InspectorApplicationCacheAgent.cpp:
2207         (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
2208         (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
2209         (WebCore::InspectorApplicationCacheAgent::enable):
2210         * inspector/InspectorApplicationCacheAgent.h:
2211         * inspector/InspectorCSSAgent.cpp:
2212         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
2213         (WebCore::InspectorCSSAgent::enable):
2214         (WebCore::InspectorCSSAgent::disable):
2215         * inspector/InspectorCSSAgent.h:
2216         * inspector/InspectorConsoleInstrumentation.h:
2217         (WebCore::InspectorInstrumentation::addMessageToConsole):
2218         (WebCore::InspectorInstrumentation::consoleCount):
2219         (WebCore::InspectorInstrumentation::startProfiling):
2220         (WebCore::InspectorInstrumentation::stopProfiling):
2221         * inspector/InspectorController.cpp:
2222         (WebCore::InspectorController::InspectorController):
2223         (WebCore::InspectorController::connectFrontend):
2224         (WebCore::InspectorController::disconnectFrontend):
2225         (WebCore::InspectorController::disconnectAllFrontends):
2226         * inspector/InspectorController.h:
2227         * inspector/InspectorDOMAgent.cpp:
2228         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
2229         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
2230         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
2231         (WebCore::InspectorDOMAgent::focusNode):
2232         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2233         (WebCore::InspectorDOMAgent::nodeForObjectId):
2234         (WebCore::InspectorDOMAgent::resolveNode):
2235         * inspector/InspectorDOMAgent.h:
2236         * inspector/InspectorDOMDebuggerAgent.cpp:
2237         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
2238         (WebCore::InspectorDOMDebuggerAgent::~InspectorDOMDebuggerAgent):
2239         (WebCore::InspectorDOMDebuggerAgent::debuggerWasEnabled):
2240         (WebCore::InspectorDOMDebuggerAgent::disable):
2241         * inspector/InspectorDOMDebuggerAgent.h:
2242         * inspector/InspectorDOMStorageAgent.cpp:
2243         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
2244         (WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent):
2245         * inspector/InspectorDOMStorageAgent.h:
2246         * inspector/InspectorDatabaseAgent.cpp:
2247         (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
2248         (WebCore::InspectorDatabaseAgent::~InspectorDatabaseAgent):
2249         * inspector/InspectorDatabaseAgent.h:
2250         * inspector/InspectorIndexedDBAgent.cpp:
2251         (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
2252         (WebCore::InspectorIndexedDBAgent::requestData):
2253         * inspector/InspectorIndexedDBAgent.h:
2254         * inspector/InspectorInstrumentation.cpp:
2255         (WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
2256         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
2257         * inspector/InspectorInstrumentation.h:
2258         (WebCore::InspectorInstrumentation::mouseDidMoveOverElement):
2259         (WebCore::InspectorInstrumentation::scriptsEnabled):
2260         (WebCore::InspectorInstrumentation::didScroll):
2261         (WebCore::InspectorInstrumentation::markResourceAsCached):
2262         (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache):
2263         (WebCore::InspectorInstrumentation::willRunJavaScriptDialog):
2264         (WebCore::InspectorInstrumentation::sessionCreated):
2265         (WebCore::InspectorInstrumentation::sessionLoaded):
2266         (WebCore::InspectorInstrumentation::sessionModified):
2267         (WebCore::InspectorInstrumentation::segmentCreated):
2268         (WebCore::InspectorInstrumentation::segmentCompleted):
2269         (WebCore::InspectorInstrumentation::segmentLoaded):
2270         (WebCore::InspectorInstrumentation::segmentUnloaded):
2271         (WebCore::InspectorInstrumentation::captureStarted):
2272         (WebCore::InspectorInstrumentation::captureStopped):
2273         (WebCore::InspectorInstrumentation::playbackStarted):
2274         (WebCore::InspectorInstrumentation::playbackPaused):
2275         (WebCore::InspectorInstrumentation::playbackFinished):
2276         (WebCore::InspectorInstrumentation::playbackHitPosition):
2277         * inspector/InspectorLayerTreeAgent.cpp:
2278         (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
2279         (WebCore::InspectorLayerTreeAgent::enable):
2280         (WebCore::InspectorLayerTreeAgent::disable):
2281         (WebCore::InspectorLayerTreeAgent::layersForNode):
2282         (WebCore::InspectorLayerTreeAgent::idForNode):
2283         * inspector/InspectorLayerTreeAgent.h:
2284         * inspector/InspectorPageAgent.cpp:
2285         (WebCore::InspectorPageAgent::InspectorPageAgent):
2286         (WebCore::InspectorPageAgent::timestamp):
2287         (WebCore::InspectorPageAgent::enable):
2288         (WebCore::InspectorPageAgent::disable):
2289         (WebCore::InspectorPageAgent::frameStartedLoading):
2290         (WebCore::InspectorPageAgent::snapshotNode):
2291         * inspector/InspectorPageAgent.h:
2292         * inspector/InspectorReplayAgent.cpp:
2293         (WebCore::InspectorReplayAgent::InspectorReplayAgent):
2294         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
2295         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
2296         * inspector/InspectorReplayAgent.h:
2297         * inspector/InspectorResourceAgent.cpp:
2298         (WebCore::InspectorResourceAgent::InspectorResourceAgent):
2299         (WebCore::InspectorResourceAgent::~InspectorResourceAgent):
2300         (WebCore::InspectorResourceAgent::timestamp):
2301         (WebCore::InspectorResourceAgent::enable):
2302         (WebCore::InspectorResourceAgent::disable):
2303         * inspector/InspectorResourceAgent.h:
2304         * inspector/InspectorTimelineAgent.cpp:
2305         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
2306         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
2307         (WebCore::InspectorTimelineAgent::internalStart):
2308         (WebCore::InspectorTimelineAgent::internalStop):
2309         (WebCore::InspectorTimelineAgent::timestamp):
2310         (WebCore::InspectorTimelineAgent::startFromConsole):
2311         (WebCore::InspectorTimelineAgent::willCallFunction):
2312         (WebCore::InspectorTimelineAgent::willEvaluateScript):
2313         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
2314         * inspector/InspectorTimelineAgent.h:
2315         * inspector/InspectorWebAgentBase.h:
2316         (WebCore::InspectorAgentBase::InspectorAgentBase):
2317         * inspector/InspectorWorkerAgent.cpp:
2318         (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
2319         (WebCore::InspectorWorkerAgent::~InspectorWorkerAgent):
2320         * inspector/InspectorWorkerAgent.h:
2321         * inspector/InstrumentingAgents.cpp:
2322         (WebCore::InstrumentingAgents::InstrumentingAgents): Deleted.
2323         * inspector/InstrumentingAgents.h:
2324         (WebCore::InstrumentingAgents::create):
2325         * inspector/PageConsoleAgent.cpp:
2326         (WebCore::PageConsoleAgent::PageConsoleAgent):
2327         (WebCore::PageConsoleAgent::addInspectedNode):
2328         * inspector/PageConsoleAgent.h:
2329         * inspector/PageDebuggerAgent.cpp:
2330         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
2331         (WebCore::PageDebuggerAgent::enable):
2332         (WebCore::PageDebuggerAgent::disable):
2333         (WebCore::PageDebuggerAgent::injectedScriptForEval):
2334         * inspector/PageDebuggerAgent.h:
2335         * inspector/PageRuntimeAgent.cpp:
2336         (WebCore::PageRuntimeAgent::PageRuntimeAgent):
2337         (WebCore::PageRuntimeAgent::injectedScriptForEval):
2338         (WebCore::PageRuntimeAgent::notifyContextCreated):
2339         * inspector/PageRuntimeAgent.h:
2340         * inspector/WebConsoleAgent.cpp:
2341         (WebCore::WebConsoleAgent::WebConsoleAgent):
2342         (WebCore::WebConsoleAgent::frameWindowDiscarded):
2343         (WebCore::WebConsoleAgent::didFinishXHRLoading):
2344         (WebCore::WebConsoleAgent::didReceiveResponse):
2345         (WebCore::WebConsoleAgent::didFailLoading):
2346         * inspector/WebConsoleAgent.h:
2347         * inspector/WebDebuggerAgent.cpp:
2348         (WebCore::WebDebuggerAgent::WebDebuggerAgent):
2349         (WebCore::WebDebuggerAgent::enable):
2350         (WebCore::WebDebuggerAgent::disable):
2351         * inspector/WebDebuggerAgent.h:
2352         * inspector/WorkerConsoleAgent.cpp:
2353         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
2354         * inspector/WorkerConsoleAgent.h:
2355         * inspector/WorkerDebuggerAgent.cpp:
2356         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
2357         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
2358         * inspector/WorkerDebuggerAgent.h:
2359         * inspector/WorkerInspectorController.cpp:
2360         (WebCore::WorkerInspectorController::WorkerInspectorController):
2361         * inspector/WorkerInspectorController.h:
2362         * inspector/WorkerRuntimeAgent.cpp:
2363         (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
2364         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
2365         * inspector/WorkerRuntimeAgent.h:
2366
2367 2015-09-01  Jinyoung Hur  <hur.ims@navercorp.com>
2368
2369         [Cairo][WebGL] Upload the accelerated canvas as a texture by copying via GPU directly
2370         https://bugs.webkit.org/show_bug.cgi?id=148631
2371
2372         Reviewed by Dean Jackson.
2373
2374         When an accelerated canvas needs to be uploaded as a gl texture, it would be better to copy it to 
2375         texture directly via GPU using glCopyTexImage2D. 
2376         Note that GPU copy can not always be enabled because, with premultiplyAlpha and flipY unpack option,
2377         it seems hard to be implemented in a way of direct GPU copy.
2378
2379         No new tests because there is no behavior change.
2380
2381         * html/canvas/WebGLRenderingContextBase.cpp:
2382         (WebCore::WebGLRenderingContextBase::texImage2D):
2383         * platform/graphics/ImageBuffer.cpp:
2384         (WebCore::ImageBuffer::copyToPlatformTexture):
2385         * platform/graphics/ImageBuffer.h:
2386         * platform/graphics/cairo/ImageBufferCairo.cpp:
2387         (WebCore::ImageBuffer::copyToPlatformTexture):
2388
2389 2015-08-31  Dean Jackson  <dino@apple.com>
2390
2391         [mediacontrols] Add tests for the status display label
2392         https://bugs.webkit.org/show_bug.cgi?id=148656
2393         <rdar://problem/22509779>
2394
2395         Reviewed by Eric Carlson.
2396
2397         Export the StatusDisplay element and its current content.
2398
2399         Tests: media/controls/statusDisplay.html
2400                media/controls/statusDisplayBad.html
2401
2402         * Modules/mediacontrols/mediaControlsApple.js:
2403         (Controller.prototype.getCurrentControlsStatus):
2404
2405 2015-08-31  Dean Jackson  <dino@apple.com>
2406
2407         [mediacontrols] Add a test for the show controls button
2408         https://bugs.webkit.org/show_bug.cgi?id=148655
2409         <rdar://problem/22509688>
2410
2411         Reviewed by Eric Carlson.
2412
2413         We'll add a list of control elements to the status object,
2414         so we can query the state of buttons, etc. Begin with the
2415         Show Controls button (used for accessibility).
2416
2417         There are also some drive-by whitespace changes.
2418
2419         Test: media/controls/showControlsButton.html
2420
2421         * Modules/mediacontrols/mediaControlsApple.js:
2422         (Controller.prototype.get idiom): Differentiate between iOS and
2423         OS X. This isn't necessary at the moment, but will come in
2424         handy later.
2425         (Controller.prototype.createControls): Whitespace.
2426         (Controller.prototype.getCurrentControlsStatus): Add the information
2427         on the Show Controls button.
2428         * Modules/mediacontrols/mediaControlsiOS.js:
2429         (ControllerIOS.prototype.get idiom):
2430
2431 2015-09-01  Joseph Pecoraro  <pecoraro@apple.com>
2432
2433         Possible CFArray leak in MediaPlayerPrivateAVFoundationCF.cpp
2434         https://bugs.webkit.org/show_bug.cgi?id=148668
2435
2436         Reviewed by Eric Carlson.
2437
2438         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2439         (WebCore::mimeTypeCache): Deleted.
2440         (WebCore::avfMIMETypes):
2441         Fix the leak in avfMIMETypes. Consolidate on the single implementation.
2442         Note that avfMIMETypes lowercased the inputs and mimeTypeCache did not,
2443         but we now match MediaPlayerPrivateAVFoundationObjC which has one version
2444         that lowercased inputs as well.
2445
2446         (WebCore::MediaPlayerPrivateAVFoundationCF::getSupportedTypes):
2447         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsType):
2448         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem):
2449         Convert to th enew verison.
2450
2451 2015-09-01  Javier Fernandez  <jfernandez@igalia.com>
2452
2453         [CSS Grid Layout] Layout is wrong for flex factor sum between 0 and 1
2454         https://bugs.webkit.org/show_bug.cgi?id=148645
2455
2456         Reviewed by Darin Adler.
2457
2458         This patch ensures that we don't normalize the individual tracks
2459         to fill the space. More precisely, when we sum up the flexes, that
2460         tells us how many "units" of flex need to fit into the free
2461         space. We then figure out what size to assign to the flex unit
2462         based on that, and send that back to the individual items, sizing
2463         them appropriately to their flex value.
2464
2465         This way we get flex fraction values applied correctly so they fill
2466         the available space in the indicated proportion. This approach has
2467         an additional advantage of dealing with division by 0 when reducing
2468         automatically the flex value.
2469
2470         Test: fast/css-grid-layout/flex-factor-sum-less-than-1.html
2471
2472         * rendering/RenderGrid.cpp:
2473         (WebCore::RenderGrid::computeNormalizedFractionBreadth):
2474
2475 2015-08-31  Commit Queue  <commit-queue@webkit.org>
2476
2477         Unreviewed, rolling out r189198.
2478         https://bugs.webkit.org/show_bug.cgi?id=148670
2479
2480         "Caused http/tests/navigation/anchor-frames-same-origin.html
2481         to fail on WebKit1" (Requested by cdumez on #webkit).
2482
2483         Reverted changeset:
2484
2485         "http/tests/w3c/dom/nodes/Element-matches.html is flaky"
2486         https://bugs.webkit.org/show_bug.cgi?id=148615
2487         http://trac.webkit.org/changeset/189198
2488
2489 2015-08-31  Joseph Pecoraro  <pecoraro@apple.com>
2490
2491         Remove unused #define
2492         https://bugs.webkit.org/show_bug.cgi?id=148667
2493
2494         Reviewed by Benjamin Poulain.
2495
2496         * platform/network/cf/ResourceResponseCFNet.cpp:
2497
2498 2015-08-31  Chris Dumez  <cdumez@apple.com>
2499
2500         Range API is throwing wrong exception type
2501         https://bugs.webkit.org/show_bug.cgi?id=148648
2502
2503         Reviewed by Ryosuke Niwa.
2504
2505         The RangeException type does not exist in the latest DOM specification.
2506         Instead, the Range API is throwing regular DOMExceptions [1]:
2507         https://dom.spec.whatwg.org/#range
2508
2509         The error codes also differ. RangeException.INVALID_NODE_TYPE_ERR (2)
2510         is replaced with DOMException.INVALID_NODE_TYPE_ERR (24).
2511         RangeException.BAD_BOUNDARYPOINTS_ERR (1) is replaced by
2512         DOMException.INVALID_STATE_ERR (11), as per:
2513         https://dom.spec.whatwg.org/#dom-range-surroundcontents (step 1).
2514
2515         This patch aligns WebKit's behavior with the specification and with
2516         other browsers (tested Firefox and Chrome).
2517
2518         [1] https://heycam.github.io/webidl/#dfn-DOMException
2519
2520         No new tests, covered by existing tests (rebaselined):
2521         http/tests/w3c/dom/ranges/Range-comparePoint.html
2522         http/tests/w3c/dom/ranges/Range-isPointInRange.html
2523         http/tests/w3c/dom/ranges/Range-selectNode.html
2524         http/tests/w3c/dom/ranges/Range-set.html
2525         http/tests/w3c/dom/ranges/Range-surroundContents.html
2526
2527         * CMakeLists.txt:
2528         * DerivedSources.cpp:
2529         * DerivedSources.make:
2530         * WebCore.vcxproj/WebCore.vcxproj:
2531         * WebCore.vcxproj/WebCore.vcxproj.filters:
2532         * WebCore.xcodeproj/project.pbxproj:
2533         * bindings/js/JSExceptionBase.cpp:
2534         (WebCore::toExceptionBase): Deleted.
2535         * dom/DOMAllInOne.cpp:
2536         * dom/DOMExceptions.in:
2537         * dom/Range.cpp:
2538         (WebCore::Range::insertNode):
2539         (WebCore::Range::checkNodeWOffset):
2540         (WebCore::Range::checkNodeBA):
2541         (WebCore::Range::selectNode):
2542         (WebCore::Range::selectNodeContents):
2543         (WebCore::Range::surroundContents):
2544         * dom/RangeException.cpp: Removed.
2545         * dom/RangeException.h: Removed.
2546         * dom/RangeException.idl: Removed.
2547
2548 2015-08-31  Yusuke Suzuki  <utatane.tea@gmail.com>
2549
2550         [ES6] Introduce ModuleProgramExecutable families and compile Module code to bytecode
2551         https://bugs.webkit.org/show_bug.cgi?id=148581
2552
2553         Reviewed by Saam Barati.
2554
2555         Add the ModuleProgramExecutable case.
2556
2557         * testing/Internals.cpp:
2558         (WebCore::Internals::parserMetaData):
2559
2560 2015-08-31  Brent Fulgham  <bfulgham@apple.com>
2561
2562         [Win] WebKit cannot load pages based on "file://" URLs
2563         https://bugs.webkit.org/show_bug.cgi?id=148596
2564         <rdar://problem/22432585>
2565
2566         Reviewed by Dean Jackson.
2567
2568         * platform/URL.cpp:
2569         (WebCore::URL::URL): Work around bug that causes this assertion to fire on
2570         the Apple Windows build.
2571         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2572         (WebCore::adjustMIMETypeIfNecessary): Added. If the URL is for a local file,
2573         determine the MIME type based on extension. Otherwise use the default MIME type.
2574         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): If
2575         the CFURLResponse has no MIME type, call 'adjustMIMETypeIfNecessary'.
2576
2577 2015-08-31  Chris Dumez  <cdumez@apple.com>
2578
2579         http/tests/w3c/dom/nodes/Element-matches.html is flaky
2580         https://bugs.webkit.org/show_bug.cgi?id=148615
2581
2582         Reviewed by Ryosuke Niwa.
2583
2584         Several newly-imported w3c tests were flaky due to the :target
2585         pseudo-class selectors sometimes giving different results. The
2586         issue seems to be that this type of selector relies on the
2587         Document::cssTarget() element to do the matching. We update
2588         this cssTarget Element in FrameView's scrollToFragment() /
2589         scrollToAnchor(). This is called from
2590         scrollToFragmentWithParentBoundary() which is called by
2591         FrameLoader's finishedParsing() and loadInSameDocument().
2592
2593         In the first one, it is called *after* calling checkComplete()
2594         which fires the onload event. However, in the second method,
2595         it is called *before*. This patch updates finishedParsing()
2596         so that scrollToFragmentWithParentBoundary() is called *before*
2597         firing the onload event, consistently with loadInSameDocument().
2598         This makes sure that JavaScript executed in an onload event
2599         handler will get accurate results for :target pseudo-class
2600         selectors.
2601
2602         No new tests, covered by:
2603         http/tests/w3c/dom/nodes/Element-matches.html
2604         http/tests/w3c/dom/nodes/ParentNode-querySelector-All-xhtml.xhtml
2605
2606         * loader/FrameLoader.cpp:
2607         (WebCore::FrameLoader::finishedParsing):
2608
2609 2015-08-31  Yusuke Suzuki  <utatane.tea@gmail.com>
2610
2611         The error handler of ReadableJSStream should own stream object
2612         https://bugs.webkit.org/show_bug.cgi?id=148653
2613
2614         Reviewed by Sam Weinig.
2615
2616         ReadableJSStream's m_errorFunction does not own the readable stream.
2617         So when this error callback is executed asynchronously through Promises,
2618         the stream could be already destroyed.
2619         The fulfill callback which is jointly configured with this error callback
2620         owns the stream. However, when the promise is rejected, the following things
2621         occur.
2622
2623         1. Promise clears the fulfill handlers immediately.
2624         2. queue the reject handlers to the microtask queue.
2625         3. When draining the microtasks, the rejected handler will be executed.
2626
2627         At the time of 2 or 3, the references to the fulfill handlers are already discarded.
2628         So when GC occurs at the time of 2 or 3, it will collect the fulfill handlers and the
2629         stream object owned by the fulfill handlers even if the error callback will touch the
2630         stream object later.
2631
2632         Before r189124, this fault does not occur. This is because the std::function in the
2633         fulfill handler is not destroyed before that patch. Since the std::function owns the
2634         stream object, the std::function and the stream object were leaked and never destroyed.
2635         After that patch, the std::function in the fulfill handler becomes destroyed. And it
2636         makes this fault happen.
2637
2638         In this patch, we separate the error callback from the stream object. Previously, the
2639         error callback resides in the stream object as the member. To avoid the cyclic references,
2640         this error callback did not own the stream object. But this causes this fault.
2641         Instead of caching the error callback in the stream object, we always create the error
2642         callback, when it is needed. The created error callback owns the stream object as well as
2643         the fulfill callbacks owns the stream object.
2644
2645         No behavior change.
2646
2647         * bindings/js/ReadableJSStream.cpp:
2648         (WebCore::createGenericErrorRejectedFunction):
2649         (WebCore::ReadableJSStream::doStart):
2650         (WebCore::ReadableJSStream::doPull):
2651         (WebCore::ReadableJSStream::ReadableJSStream): Deleted.
2652         * bindings/js/ReadableJSStream.h:
2653
2654 2015-08-26  Andy Estes  <aestes@apple.com>
2655
2656         [Content Filtering] Determine navigation and content policy before continuing to filter a load
2657         https://bugs.webkit.org/show_bug.cgi?id=148506
2658
2659         Reviewed by Brady Eidson.
2660
2661         Prior to this change, ContentFilter would hide from DocumentLoader all CachedRawResourceClient callbacks until
2662         a decision was made, then replay the missed callbacks. This approach interacted poorly with some features of
2663         the loader, notably appcache and downloads. In the case of appcache, DocumentLoader might not have a chance to
2664         check for substitute data until the original load has finished, wasting bandwidth, and might receive duplicate
2665         or out-of-order callbacks. In the case of downloads, it would often be too late to convert the existing
2666         connection to a download, leading to restarted downloads or outright failures.
2667
2668         Bandaids were put in place for these issues in r188150, r188486, and r188851 to fix crashes or serious
2669         regressions in behavior, but these weren't complete fixes. They did not solve any of the duplicate data loading
2670         problems, and they did not make downloads work reliably in all cases.
2671
2672         This patch rolls out the bandaids (but keeps their tests) and replaces them with a more robust fix. Instead of
2673         hiding callbacks from DocumentLoader, ContentFilter now delivers willSendRequest(), redirectReceived(), and
2674         responseReceived() to DocumentLoader immediately, and cancels filtering if DocumentLoader decides to ignore the
2675         load, download it, or load substitute data. ContentFilter continues to buffer incoming data to prevent partial
2676         rendering of blocked content.
2677
2678         The existing tests for r188150 and r188851 were kept, the test for r188486 was rewritten to be specific to
2679         content filtering, and new tests were added to cover the case where ContentFilter is still undecided after a
2680         load finishes.
2681
2682         Tests: contentfiltering/allow-never.html
2683                contentfiltering/block-never.html
2684                ContentFiltering.AllowDownloadAfterAddData
2685                ContentFiltering.AllowDownloadAfterFinishedAddingData
2686                ContentFiltering.AllowDownloadAfterRedirect
2687                ContentFiltering.AllowDownloadAfterResponse
2688                ContentFiltering.AllowDownloadAfterWillSendRequest
2689                ContentFiltering.AllowDownloadNever
2690                ContentFiltering.BlockDownloadAfterAddData
2691                ContentFiltering.BlockDownloadAfterFinishedAddingData
2692                ContentFiltering.BlockDownloadAfterRedirect
2693                ContentFiltering.BlockDownloadAfterResponse
2694                ContentFiltering.BlockDownloadAfterWillSendRequest
2695                ContentFiltering.BlockDownloadNever
2696
2697         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
2698         (WebCore::JSMockContentFilterSettings::decisionPoint): Taught to handle DecisionPoint::Never, and rewrote to
2699         not need a set of const uint8_ts that mirror the DecisionPoint enum.
2700         (WebCore::JSMockContentFilterSettings::setDecisionPoint): Ditto.
2701         (WebCore::toJSValue): Rewrote to not need a set of const uint8_ts that mirror the Decision enum.
2702         (WebCore::toDecision): Ditto.
2703         * loader/ContentFilter.cpp:
2704         (WebCore::ContentFilter::createIfEnabled): Renamed from createIfNeeded, and changed to take a DocumentLoader&
2705         instead of a DecisionFunction.
2706         (WebCore::ContentFilter::ContentFilter):
2707         (WebCore::ContentFilter::responseReceived): If m_state != Blocked after filtering, call DocumentLoader::responseReceived().
2708         (WebCore::ContentFilter::dataReceived): If m_state == Allowed after filtering, deliver buffered data to DocumentLoader.
2709         If no filtering was necessary, call DocumentLoader::dataReceived() directly.
2710         (WebCore::ContentFilter::redirectReceived): If m_state != Blocked after filtering, call DocumentLoader::redirectReceived().
2711         (WebCore::ContentFilter::notifyFinished): If an error occured, call DocumentLoader::notifyFinished() immediately and return.
2712         If m_state != Blocked after filtering, deliver buffered data to DocumentLoader and call DocumentLoader::notifyFinished().
2713         If no filtering was necessary and m_state != Blocked, call DocumentLoader::notifyFinished() directly.
2714         (WebCore::ContentFilter::didDecide): Called DocumentLoader::contentFilterDidDecide() instead of m_decisionFunction().
2715         (WebCore::ContentFilter::deliverResourceData): Added a helper function to deliver buffered data to DocumentLoader.
2716         (WebCore::ContentFilter::createIfNeeded): Renamed to createIfEnabled().
2717         * loader/ContentFilter.h:
2718         * loader/DocumentLoader.cpp:
2719         (WebCore::DocumentLoader::DocumentLoader):
2720         (WebCore::DocumentLoader::willSendRequest): Stopped asserting that redirectResponse is null and made it part of
2721         the if condition instead, since willSendRequest() will now be called on redirects when there is an active ContentFilter.
2722         (WebCore::DocumentLoader::startLoadingMainResource): Called becomeMainResourceClient() instead of becomeMainResourceClientIfFilterAllows().
2723         (WebCore::DocumentLoader::becomeMainResourceClient): Renamed from becomeMainResourceClientIfFilterAllows().
2724         Only called ContentFilter::startFilteringMainResource() if the filter state is Initialized, since ContentFilter
2725         might have already made a decision in willSendRequest().
2726         (WebCore::DocumentLoader::contentFilterDidDecide): Stopped deleting m_contentFilter, since it will continue to deliver callbacks
2727         even after making a decision. Fixed a bug where we were creating two copies of ContentFilter's replacement data.
2728         (WebCore::DocumentLoader::syntheticRedirectReceived): Deleted.
2729         (WebCore::DocumentLoader::becomeMainResourceClientIfFilterAllows): Renamed to becomeMainResourceClient().
2730         * loader/DocumentLoader.h:
2731         * loader/EmptyClients.h:
2732         * loader/FrameLoaderClient.h:
2733         * loader/ResourceLoader.cpp:
2734         (WebCore::ResourceLoader::willSendRequestInternal): Removed part of r188851.
2735         * loader/SubresourceLoader.cpp:
2736         (WebCore::SubresourceLoader::didReceiveResponse): Removed part of r188486.
2737         * loader/SubresourceLoader.h:
2738         * loader/cache/CachedRawResource.cpp:
2739         (WebCore::CachedRawResource::didAddClient): Removed part of r188150.
2740         * loader/cache/CachedRawResourceClient.h:
2741         (WebCore::CachedRawResourceClient::syntheticRedirectReceived): Removed part of r188150.
2742         * testing/MockContentFilterSettings.h: Defined DecisionPoint::Never.
2743         * testing/MockContentFilterSettings.idl: Defined DECISION_POINT_NEVER.
2744
2745 2015-08-31  Chris Dumez  <cdumez@apple.com>
2746
2747         Unreviewed, rebaseline bindings tests after r189184.
2748
2749 2015-08-31  Chris Dumez  <cdumez@apple.com>
2750
2751         NodeFilter.SHOW_ALL has wrong value on 32-bit
2752         https://bugs.webkit.org/show_bug.cgi?id=148602
2753
2754         Reviewed by Geoffrey Garen.
2755
2756         NodeFilter.SHOW_ALL has wrong value on 32-bit. This is because
2757         NodeFilter.SHOW_ALL is an unsigned long whose value is 0xFFFFFFFF but
2758         our bindings code is casting it to an intptr_t type which is not wide
2759         enough on 32-bit.
2760
2761         No new tests, already covered by fast/dom/node-filter-interface.html
2762         which is now unskipped on Windows / 32bit.
2763
2764         * bindings/scripts/CodeGeneratorJS.pm:
2765         (GenerateHashTableValueArray):
2766         Generate extra curly brackets to initialize the new union member.
2767         Also cast to long long the constant instead of intptr_t.
2768
2769         * dom/NodeFilter.h:
2770         Explicitly mark the enum underlying type to be an unsigned long
2771         to make sure it can hold the value for SHOW_ALL on all platforms.
2772         On Windows, it seems the default underlying type is an int for
2773         e.g.
2774
2775 2015-08-31  Chris Dumez  <cdumez@apple.com>
2776
2777         Range.detach() / NodeIterator.detach() should be no-ops as per the latest DOM specification
2778         https://bugs.webkit.org/show_bug.cgi?id=148454
2779
2780         Reviewed by Ryosuke Niwa.
2781
2782         Range.detach() / NodeIterator.detach() should be no-ops as per the
2783         latest DOM specification:
2784         - https://dom.spec.whatwg.org/#dom-range-detach
2785         - https://dom.spec.whatwg.org/#dom-nodeiterator-detach
2786
2787         These are already no-ops in Firefox:
2788         - https://bugzilla.mozilla.org/show_bug.cgi?id=702948
2789         - https://bugzilla.mozilla.org/show_bug.cgi?id=823549
2790
2791         and Chrome:
2792         - https://src.chromium.org/viewvc/blink?revision=173010&view=revision
2793         - https://src.chromium.org/viewvc/blink?revision=172768&view=revision
2794
2795         Tests: fast/dom/Range/range-detach-noop.html
2796                fast/dom/node-iterator-detach-noop.html
2797
2798         * accessibility/AccessibilityObject.cpp:
2799         (WebCore::AccessibilityObject::selectText):
2800         (WebCore::AccessibilityObject::stringForVisiblePositionRange):
2801         (WebCore::AccessibilityObject::lengthForVisiblePositionRange):
2802         * accessibility/atk/WebKitAccessibleUtil.cpp:
2803         (selectionBelongsToObject):
2804         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2805         (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]):
2806         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
2807         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2808         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]):
2809         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
2810         * bindings/scripts/CodeGeneratorGObject.pm:
2811         (FunctionUsedToRaiseException):
2812         * dom/DocumentMarkerController.cpp:
2813         (WebCore::DocumentMarkerController::addMarker):
2814         (WebCore::DocumentMarkerController::addTextMatchMarker):
2815         (WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker):
2816         (WebCore::DocumentMarkerController::addDictationResultMarker):
2817         (WebCore::DocumentMarkerController::removeMarkers):
2818         (WebCore::DocumentMarkerController::markersInRange):
2819         (DocumentMarkerController::setMarkersActive):
2820         (DocumentMarkerController::hasMarkers):
2821         (DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange):
2822         * dom/NodeIterator.cpp:
2823         (WebCore::NodeIterator::nextNode):
2824         (WebCore::NodeIterator::previousNode):
2825         (WebCore::NodeIterator::detach):
2826         (WebCore::NodeIterator::NodeIterator): Deleted.
2827         (WebCore::NodeIterator::nodeWillBeRemoved): Deleted.
2828         (WebCore::NodeIterator::updateForNodeRemoval): Deleted.
2829         * dom/NodeIterator.h:
2830         (WebCore::NodeIterator::nextNode):
2831         (WebCore::NodeIterator::previousNode):
2832         * dom/NodeIterator.idl:
2833         * dom/Range.cpp:
2834         (WebCore::Range::commonAncestorContainer):
2835         (WebCore::Range::setStart):
2836         (WebCore::Range::setEnd):
2837         (WebCore::Range::collapse):
2838         (WebCore::Range::isPointInRange):
2839         (WebCore::Range::comparePoint):
2840         (WebCore::Range::compareNode):
2841         (WebCore::Range::compareBoundaryPoints):
2842         (WebCore::Range::boundaryPointsValid):
2843         (WebCore::Range::deleteContents):
2844         (WebCore::Range::processContents):
2845         (WebCore::Range::processContentsBetweenOffsets):
2846         (WebCore::Range::processAncestorsAndTheirSiblings):
2847         (WebCore::Range::extractContents):
2848         (WebCore::Range::cloneContents):
2849         (WebCore::Range::insertNode):
2850         (WebCore::Range::toString):
2851         (WebCore::Range::text):
2852         (WebCore::Range::createContextualFragment):
2853         (WebCore::Range::detach):
2854         (WebCore::Range::cloneRange):
2855         (WebCore::Range::surroundContents):
2856         (WebCore::Range::checkDeleteExtract):
2857         (WebCore::Range::containedByReadOnly):
2858         (WebCore::Range::firstNode):
2859         (WebCore::Range::shadowRoot):
2860         (WebCore::Range::pastLastNode):
2861         (WebCore::Range::absoluteTextRects):
2862         (WebCore::Range::absoluteTextQuads):
2863         (WebCore::Range::collectSelectionRects):
2864         (WebCore::Range::formatForDebugger):
2865         (WebCore::Range::contains):
2866         (WebCore::rangesOverlap):
2867         (WebCore::Range::getBorderAndTextQuads):
2868         (WebCore::Range::boundingRectInternal):
2869         (showTree):
2870         (WebCore::checkForDifferentRootContainer): Deleted.
2871         (WebCore::lengthOfContentsInNode): Deleted.
2872         (WebCore::Range::processNodes): Deleted.
2873         (WebCore::Range::checkNodeWOffset): Deleted.
2874         (WebCore::Range::checkNodeBA): Deleted.
2875         (WebCore::Range::setStartAfter): Deleted.
2876         (WebCore::Range::setEndBefore): Deleted.
2877         (WebCore::Range::setEndAfter): Deleted.
2878         (WebCore::Range::selectNode): Deleted.
2879         (WebCore::intervalsSufficientlyOverlap): Deleted.
2880         (WebCore::coalesceSelectionRects): Deleted.
2881         (WebCore::areRangesEqual): Deleted.
2882         (WebCore::boundaryTextNodesSplit): Deleted.
2883         (WebCore::Range::textNodeSplit): Deleted.
2884         (WebCore::Range::expand): Deleted.
2885         * dom/Range.h:
2886         (WebCore::Range::startContainer):
2887         (WebCore::Range::endContainer):
2888         (WebCore::Range::collapsed):
2889         (WebCore::Range::commonAncestorContainer):
2890         * dom/Range.idl:
2891         * editing/AlternativeTextController.cpp:
2892         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2893         (WebCore::AlternativeTextController::handleAlternativeTextUIResult):
2894         (WebCore::AlternativeTextController::markReversed):
2895         (WebCore::AlternativeTextController::markCorrection):
2896         (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection):
2897         (WebCore::AlternativeTextController::applyDictationAlternative):
2898         * editing/EditingStyle.cpp:
2899         (WebCore::EditingStyle::styleAtSelectionStart):
2900         * editing/Editor.cpp:
2901         (WebCore::Editor::canDeleteRange):
2902         (WebCore::Editor::shouldDeleteRange):
2903         (WebCore::Editor::advanceToNextMisspelling):
2904         (WebCore::Editor::markMisspellingsOrBadGrammar):
2905         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
2906         (WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
2907         (WebCore::Editor::markAndReplaceFor):
2908         (WebCore::Editor::changeBackToReplacedString):
2909         (WebCore::Editor::firstRectForRange):
2910         (WebCore::Editor::rangeOfString):
2911         (WebCore::Editor::countMatchesForText):
2912         (WebCore::Editor::scanRangeForTelephoneNumbers):
2913         (WebCore::isFrameInRange): Deleted.
2914         * editing/EditorCommand.cpp:
2915         (WebCore::expandSelectionToGranularity):
2916         (WebCore::unionDOMRanges):
2917         * editing/FormatBlockCommand.cpp:
2918         (WebCore::FormatBlockCommand::elementForFormatBlockCommand):
2919         * editing/FrameSelection.cpp:
2920         (WebCore::FrameSelection::setSelectedRange):
2921         (WebCore::FrameSelection::wordOffsetInRange):
2922         (WebCore::FrameSelection::spaceFollowsWordInRange):
2923         (WebCore::FrameSelection::selectionAtDocumentStart): Deleted.
2924         * editing/MarkupAccumulator.cpp:
2925         (WebCore::MarkupAccumulator::appendText):
2926         * editing/SpellChecker.cpp:
2927         (WebCore::SpellCheckRequest::SpellCheckRequest):
2928         (WebCore::SpellChecker::isCheckable):
2929         * editing/SpellingCorrectionCommand.cpp:
2930         (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
2931         * editing/TextCheckingHelper.cpp:
2932         (WebCore::expandToParagraphBoundary):
2933         (WebCore::TextCheckingParagraph::offsetTo):
2934         (WebCore::TextCheckingParagraph::offsetAsRange):
2935         (WebCore::TextCheckingHelper::findFirstMisspelling):
2936         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
2937         (WebCore::TextCheckingHelper::findFirstGrammarDetail):
2938         (WebCore::TextCheckingHelper::isUngrammatical):
2939         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
2940         * editing/TextIterator.cpp:
2941         (WebCore::TextIterator::TextIterator):
2942         (WebCore::TextIterator::node):
2943         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
2944         (WebCore::CharacterIterator::range):
2945         (WebCore::characterSubrange):
2946         (WebCore::BackwardsCharacterIterator::range):
2947         (WebCore::TextIterator::rangeFromLocationAndLength):
2948         (WebCore::TextIterator::getLocationAndLengthFromRange):
2949         (WebCore::collapsedToBoundary):
2950         (WebCore::findPlainText):
2951         (WebCore::BackwardsCharacterIterator::BackwardsCharacterIterator): Deleted.
2952         (WebCore::BackwardsCharacterIterator::advance): Deleted.
2953         (WebCore::plainText): Deleted.
2954         * editing/VisibleUnits.cpp:
2955         (WebCore::previousBoundary):
2956         * editing/cocoa/HTMLConverter.mm:
2957         (HTMLConverter::_processText):
2958         (HTMLConverter::_traverseNode):
2959         (HTMLConverter::_traverseFooterNode):
2960         (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted):
2961         (WebCore::editingAttributedStringFromRange):
2962         * editing/mac/EditorMac.mm:
2963         (WebCore::Editor::adjustedSelectionRange):
2964         * editing/markup.cpp:
2965         (WebCore::StyledMarkupAccumulator::renderedText):
2966         (WebCore::StyledMarkupAccumulator::stringValueForRange):
2967         (WebCore::highestAncestorToWrapMarkup):
2968         (WebCore::createMarkupInternal):
2969         (WebCore::createFullMarkup):
2970         (WebCore::urlToMarkup): Deleted.
2971         * loader/archive/cf/LegacyWebArchive.cpp:
2972         (WebCore::LegacyWebArchive::create):
2973         * page/ContextMenuController.cpp:
2974         (WebCore::ContextMenuController::contextMenuItemSelected):
2975         * page/DOMSelection.cpp:
2976         (WebCore::DOMSelection::deleteFromDocument):
2977         (WebCore::DOMSelection::containsNode):
2978         * page/TextIndicator.cpp:
2979         (WebCore::TextIndicator::createWithRange):
2980         * page/ios/FrameIOS.mm:
2981         (WebCore::Frame::indexCountOfWordPrecedingSelection):
2982         (WebCore::Frame::wordsInCurrentParagraph):
2983         * platform/win/PasteboardWin.cpp:
2984         (WebCore::Pasteboard::writeRangeToDataObject):
2985         (WebCore::Pasteboard::writeSelection):
2986         * rendering/RenderNamedFlowThread.cpp:
2987         (WebCore::RenderNamedFlowThread::getRanges):
2988         * rendering/RenderObject.cpp:
2989         (WebCore::RenderObject::absoluteBoundingBoxRectForRange):
2990
2991 2015-08-31  Myles C. Maxfield  <mmaxfield@apple.com>
2992
2993         [Cocoa] Unify showGlyphsWithAdvances
2994         https://bugs.webkit.org/show_bug.cgi?id=148565
2995
2996         Reviewed by Dean Jackson.
2997
2998         None of the fonts created for WebKit have the renderingMode of
2999         NSFontAntialiasedIntegerAdvancementsRenderingMode and are already printer fonts.
3000
3001         No new tests because there is no behavior change.
3002
3003         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3004         (WebCore::setCGFontRenderingMode):
3005         (WebCore::FontCascade::drawGlyphs):
3006
3007 2015-08-31  Tim Horton  <timothy_horton@apple.com>
3008
3009         iOS WebKit2 find-in-page doesn't support multi-line results, is often blank
3010         https://bugs.webkit.org/show_bug.cgi?id=148599
3011         <rdar://problem/17914031>
3012
3013         Reviewed by Beth Dakin.
3014
3015         * editing/FrameSelection.cpp:
3016         (WebCore::FrameSelection::getClippedVisibleTextRectangles):
3017         (WebCore::FrameSelection::getTextRectangles):
3018         * editing/FrameSelection.h:
3019         * page/TextIndicator.cpp:
3020         (WebCore::initializeIndicator):
3021         * page/TextIndicator.h:
3022         Make it possible to create a TextIndicator that isn't clipped to the visible rect,
3023         because iOS find-in-page TextIndicators persist while scrolling the page,
3024         and are already constrained to the document rect anyway.
3025
3026 2015-08-31  Michael Catanzaro  <mcatanzaro@igalia.com>
3027
3028         [Freetype] FontCache::strengthOfFirstAlias leaks an FcPattern
3029         https://bugs.webkit.org/show_bug.cgi?id=148624
3030
3031         Reviewed by Martin Robinson.
3032
3033         Using the normal RefPtr constructor causes the FcPattern to be reffed one extra time. Even
3034         though the FcPattern is intentionally leaked to FcFontSetAdd down below, the FcPattern has
3035         its own refcount and now it's screwed up. Just completely stop using RefPtr for these
3036         FcPatterns, since the potential for confusion regarding leakRef combined with Fontconfig
3037         refcounting far outweighs the benefit of using a smart pointer.
3038
3039         * platform/graphics/freetype/FontCacheFreeType.cpp:
3040         (WebCore::strengthOfFirstAlias):
3041
3042 2015-08-31  Javier Fernandez  <jfernandez@igalia.com>
3043
3044         [CSS Grid Layout] auto-margins alignment does not work for heights
3045         https://bugs.webkit.org/show_bug.cgi?id=148071
3046
3047         Reviewed by Sergio Villar Senin.
3048
3049         We still had pending to align grid items horizontally via auto-margins
3050         alignment. We already landed a patch in r188582 to implement the
3051         column-axis alignment and this patch implements the expected behavior in
3052         the row-axis.
3053
3054         This patch also removes the logic in RenderBox, so we reduce grid related
3055         code dependencies in the general layout logic. We can do that because this
3056         patch manages that in the layoutGridItems function by resetting grid item's
3057         margin and logicalTop (if it does not need to perform a layout, which it
3058         would do the job anyway).
3059
3060         No new tests, we just need to adapt some cases of the ones we already have.
3061
3062         * rendering/RenderBox.cpp:
3063         (WebCore::RenderBox::styleDidChange): Deleted.
3064         (WebCore::RenderBox::willBeRemovedFromTree): Deleted.
3065         (WebCore::RenderBox::updateFromStyle): Deleted.
3066         * rendering/RenderGrid.cpp:
3067         (WebCore::RenderGrid::layoutGridItems):
3068         (WebCore::RenderGrid::resetAutoMarginsAndLogicalTopInColumnAxis):
3069         (WebCore::RenderGrid::updateAutoMarginsInRowAxisIfNeeded):
3070         (WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded):
3071         (WebCore::RenderGrid::hasAutoMarginsInRowAxis): Deleted.
3072         * rendering/RenderGrid.h:
3073
3074 2015-08-31  Alexey Proskuryakov  <ap@apple.com>
3075
3076         Build fix.
3077
3078         * page/EventHandler.h:
3079         (WebCore::EventHandler::immediateActionStage): Don't export an inline function,
3080         to avoid "weak external symbol" errors.
3081
3082 2015-08-31  Enrica Casucci  <enrica@apple.com>
3083
3084         Incorrect cursor movement for U+26F9, U+1F3CB with variations.
3085         https://bugs.webkit.org/show_bug.cgi?id=148629
3086         rdar://problem/22492366
3087
3088         Reviewed by Ryosuke Niwa.
3089
3090         Updating text break iterator rules to correctly handle those two emoji with variations.
3091
3092         * platform/text/TextBreakIterator.cpp:
3093         (WebCore::cursorMovementIterator):
3094
3095 2015-07-31  Sergio Villar Senin  <svillar@igalia.com>
3096
3097         [css-grid] Grid containers reporting wrong preferred widths
3098         https://bugs.webkit.org/show_bug.cgi?id=147486
3099
3100         Reviewed by Darin Adler.
3101
3102         RenderGrid used to have its own overwritten version of
3103         computePreferredLogicalWidths() because we didn't have an
3104         implementation of computeIntrinsicLogicalWidths(). That
3105         implementation was not as complete as RenderBlock's because it
3106         was not taking into account min/max-width restrictions.
3107
3108         Provided that computeIntrinsicLogicalWidths() has been there
3109         for some time we can safelly kill our overwrite and use
3110         RenderBlock's version which addresses all the FIXMEs we had in
3111         our code.
3112
3113         * rendering/RenderGrid.cpp:
3114         * rendering/RenderGrid.h:
3115
3116 2015-08-31  Sungmann Cho  <sungmann.cho@navercorp.com>
3117
3118         Fix the WinCairo build after landing of webkit.org/b/148561.
3119         https://bugs.webkit.org/show_bug.cgi?id=148627
3120
3121         Reviewed by Myles C. Maxfield.
3122
3123         No new tests, no behavior change.
3124
3125         * platform/graphics/win/ImageCairoWin.cpp:
3126         (WebCore::BitmapImage::getHBITMAPOfSize):
3127         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3128         (WebCore::MediaPlayerPrivateMediaFoundation::paint):
3129         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3130
3131 2015-08-31  Antti Koivisto  <antti@apple.com>
3132
3133         REGRESSION (r188820): fast/dom/HTMLObjectElement/object-as-frame.html is flaky
3134         https://bugs.webkit.org/show_bug.cgi?id=148533
3135
3136         Reviewed by Chris Dumez.
3137
3138         <object> element may cause document load event fire too early. By making data URL
3139         loading faster r188820 made this condition more likely to trigger in this test.
3140
3141         * loader/SubframeLoader.cpp:
3142         (WebCore::SubframeLoader::loadSubframe):
3143
3144             Post-parsing style recalc may trigger loads for <object> elements. If all other loads have already
3145             completed this may cause load event to fire synchronously from the initial empty document construction.
3146
3147             Fix by preventing load events during subframe initialization. They will be fired if needed by the
3148             subsequent explicit call to FrameLoader::checkCompleted.
3149
3150 2015-08-30  Ryuan Choi  <ryuan.choi@navercorp.com>
3151
3152         [CoordinatedGraphics] Remove unnecessary two virtual methods from TiledBackingStoreClient
3153         https://bugs.webkit.org/show_bug.cgi?id=147137
3154
3155         Reviewed by Gyuyoung Kim.
3156
3157         tiledBackingStoreContentsRect() and tiledBackingStoreVisibleRect() are not
3158         necessary because CoordinatedGraphicsLayer can pass them directly if needed.
3159         This patch removes them in order to simplify code flow between TiledBackingStore
3160         and CoordinatedGraphicsLayer.
3161
3162         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3163         (WebCore::CoordinatedGraphicsLayer::imageBackingVisible):
3164         (WebCore::CoordinatedGraphicsLayer::adjustContentsScale):
3165         (WebCore::clampToContentsRectIfRectIsInfinite):
3166         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
3167         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
3168         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreContentsRect): Deleted.
3169         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreVisibleRect): Deleted.
3170         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3171         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
3172         (WebCore::TiledBackingStore::createTilesIfNeeded):
3173         (WebCore::TiledBackingStore::coverageRatio):
3174         (WebCore::TiledBackingStore::visibleAreaIsCovered):
3175         Used TiledBackingStore's m_visibleRect and m_rect, cached and scaled values for
3176         visibleRect, contentsRect.
3177         (WebCore::TiledBackingStore::createTiles):
3178         (WebCore::TiledBackingStore::removeAllNonVisibleTiles):
3179         (WebCore::TiledBackingStore::coverWithTilesIfNeeded): Renamed to createTilesIfNeeded.
3180         (WebCore::TiledBackingStore::visibleRect): Deleted. nobody used.
3181         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
3182         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
3183         (WebCore::TiledBackingStoreClient::tiledBackingStoreHasPendingTileCreation):
3184         Removed default implementation.
3185
3186 2015-08-29  Jessie Berlin  <berlin@apple.com>
3187
3188         El Capitan build fix.
3189
3190         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3191         (WebCore::FontCascade::drawGlyphs):
3192
3193 2015-08-29  Chris Fleizach  <cfleizach@apple.com>
3194
3195         AX: When navigating the elements of a scrollable element with VoiceOver, the scrollTop() position of the element does not permanently change
3196         https://bugs.webkit.org/show_bug.cgi?id=125720
3197
3198         Reviewed by Daniel Bates.
3199
3200         The scrollToVisible code did not account for scrollable elements that are larger than their viewports.
3201         First, we need to pass the sub-focus up the scroll chain (otherwise we'll scroll some parent to y=0).
3202         Second, we should try to center the focus within the viewport, rather than positioning at the bottom for a 
3203         better experience.
3204
3205         This change was adapted from Blink r183926:
3206         https://src.chromium.org/viewvc/blink?view=rev&revision=183926
3207
3208         Tests: accessibility/scroll-to-global-point-iframe-nested.html
3209                accessibility/scroll-to-global-point-iframe.html
3210                accessibility/scroll-to-global-point-main-window.html
3211                accessibility/scroll-to-global-point-nested.html
3212                accessibility/scroll-to-make-visible-div-overflow.html
3213                accessibility/scroll-to-make-visible-iframe.html
3214                accessibility/scroll-to-make-visible-nested-2.html
3215                accessibility/scroll-to-make-visible-nested.html
3216                accessibility/scroll-to-make-visible-with-subfocus.html
3217
3218         * accessibility/AccessibilityObject.cpp:
3219         (WebCore::computeBestScrollOffset):
3220         (WebCore::AccessibilityObject::isOnscreen):
3221         (WebCore::AccessibilityObject::scrollToMakeVisibleWithSubFocus):
3222         (WebCore::AccessibilityObject::scrollToGlobalPoint):
3223         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3224         (-[WebAccessibilityObjectWrapper accessibilityScrollToVisible]):
3225         (-[WebAccessibilityObjectWrapper _accessibilityScrollToMakeVisibleWithSubFocus:]):
3226         (-[WebAccessibilityObjectWrapper _accessibilityScrollToGlobalPoint:]):
3227         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
3228
3229 2015-08-28  Myles C. Maxfield  <mmaxfield@apple.com>
3230
3231         Migrate GraphicsContexts from pointers to references
3232         https://bugs.webkit.org/show_bug.cgi?id=148561
3233
3234         Reviewed by Tim Horton.
3235
3236         We were using GraphicsContext*s throughout our rendering code. However,
3237         these contexts can't be nullptr. This patch migrates users to
3238         GraphicsContext&s.
3239
3240         This is a purely mechanical change.
3241
3242         No new tests because there is no behavior change.
3243
3244         * css/CSSFilterImageValue.cpp:
3245         (WebCore::CSSFilterImageValue::image):
3246         * editing/Editor.cpp:
3247         (WebCore::Editor::countMatchesForText):
3248         * editing/FrameSelection.cpp:
3249         (WebCore::FrameSelection::paintCaret):
3250         (WebCore::CaretBase::paintCaret):
3251         (WebCore::DragCaretController::paintDragCaret):
3252         * editing/FrameSelection.h:
3253         * html/HTMLCanvasElement.cpp:
3254         (WebCore::HTMLCanvasElement::paint):
3255         (WebCore::HTMLCanvasElement::createImageBuffer):
3256         (WebCore::HTMLCanvasElement::drawingContext):
3257         * html/HTMLCanvasElement.h:
3258         * html/HTMLVideoElement.cpp:
3259         (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
3260         * html/HTMLVideoElement.h:
3261         * html/canvas/CanvasRenderingContext2D.cpp:
3262         (WebCore::CanvasRenderingContext2D::drawImage):
3263         (WebCore::drawImageToContext):
3264         (WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
3265         (WebCore::CanvasRenderingContext2D::drawTextInternal):
3266         * html/canvas/WebGLRenderingContextBase.cpp:
3267         (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
3268         * inspector/InspectorOverlay.cpp:
3269         (WebCore::InspectorOverlay::paint):
3270         * page/FrameSnapshotting.cpp:
3271         (WebCore::snapshotFrameRect):
3272         * page/FrameView.cpp:
3273         (WebCore::FrameView::paintScrollCorner):
3274         (WebCore::FrameView::paintScrollbar):
3275         (WebCore::FrameView::paintControlTints):
3276         (WebCore::FrameView::willPaintContents):
3277         (WebCore::FrameView::didPaintContents):
3278         (WebCore::FrameView::paintContents):
3279         (WebCore::FrameView::paintContentsForSnapshot):
3280         (WebCore::FrameView::paintOverhangAreas):
3281         (WebCore::FrameView::adjustPageHeightDeprecated):
3282         * page/FrameView.h:
3283         * page/PrintContext.cpp:
3284         (WebCore::PrintContext::spoolPage):
3285         (WebCore::PrintContext::spoolRect):
3286         * page/win/FrameCGWin.cpp:
3287         (WebCore::drawRectIntoContext):
3288         (WebCore::imageFromRect):
3289         * platform/ScrollView.cpp:
3290         (WebCore::ScrollView::paintScrollCorner):
3291         (WebCore::ScrollView::paintScrollbar):
3292         (WebCore::ScrollView::paintScrollbars):
3293         (WebCore::ScrollView::paintPanScrollIcon):
3294         (WebCore::ScrollView::paint):
3295         (WebCore::ScrollView::paintOverhangAreas):
3296         (WebCore::ScrollView::calculateAndPaintOverhangAreas):
3297         * platform/ScrollView.h:
3298         * platform/Scrollbar.cpp:
3299         (WebCore::Scrollbar::paint):
3300         * platform/Scrollbar.h:
3301         * platform/ScrollbarTheme.h:
3302         (WebCore::ScrollbarTheme::paintScrollCorner):
3303         (WebCore::ScrollbarTheme::defaultPaintScrollCorner):
3304         (WebCore::ScrollbarTheme::paintOverhangAreas):
3305         * platform/ScrollbarThemeComposite.cpp:
3306         (WebCore::ScrollbarThemeComposite::paintScrollCorner):
3307         (WebCore::ScrollbarThemeComposite::paintOverhangAreas):
3308         * platform/ScrollbarThemeComposite.h:
3309         * platform/Theme.cpp:
3310         (WebCore::Theme::drawNamedImage):
3311         * platform/Theme.h:
3312         (WebCore::Theme::paint):
3313         * platform/Widget.h:
3314         * platform/cocoa/ThemeCocoa.cpp:
3315         (WebCore::fitContextToBox):
3316         (WebCore::ThemeCocoa::drawNamedImage):
3317         * platform/cocoa/ThemeCocoa.h:
3318         * platform/efl/WidgetEfl.cpp:
3319         (WebCore::Widget::paint):
3320         * platform/graphics/BitmapImage.cpp:
3321         (WebCore::BitmapImage::drawPattern):
3322         * platform/graphics/BitmapImage.h:
3323         * platform/graphics/CrossfadeGeneratedImage.cpp:
3324         (WebCore::drawCrossfadeSubimage):
3325         (WebCore::CrossfadeGeneratedImage::drawCrossfade):
3326         (WebCore::CrossfadeGeneratedImage::draw):
3327         (WebCore::CrossfadeGeneratedImage::drawPattern):
3328         * platform/graphics/CrossfadeGeneratedImage.h:
3329         * platform/graphics/FontCascade.cpp:
3330         (WebCore::FontCascade::drawText):
3331         (WebCore::FontCascade::drawEmphasisMarks):
3332         (WebCore::FontCascade::drawSimpleText):
3333         (WebCore::FontCascade::drawEmphasisMarksForSimpleText):
3334         (WebCore::FontCascade::drawGlyphBuffer):
3335         * platform/graphics/FontCascade.h:
3336         * platform/graphics/GeneratedImage.h:
3337         * platform/graphics/GradientImage.cpp:
3338         (WebCore::GradientImage::draw):
3339         (WebCore::GradientImage::drawPattern):
3340         * platform/graphics/GradientImage.h:
3341         * platform/graphics/GraphicsContext.cpp:
3342         (WebCore::GraphicsContext::drawText):
3343         (WebCore::GraphicsContext::drawGlyphs):
3344         (WebCore::GraphicsContext::drawEmphasisMarks):
3345         (WebCore::GraphicsContext::drawBidiText):
3346         (WebCore::GraphicsContext::drawImage):
3347         (WebCore::GraphicsContext::drawTiledImage):
3348         (WebCore::GraphicsContext::drawImageBuffer):
3349         (WebCore::GraphicsContext::clipToImageBuffer):
3350         (WebCore::GraphicsContext::createCompatibleBuffer):
3351         (WebCore::GraphicsContext::isCompatibleWithBuffer):
3352         * platform/graphics/GraphicsContext.h:
3353         * platform/graphics/GraphicsContext3D.h:
3354         * platform/graphics/Image.cpp:
3355         (WebCore::Image::fillWithSolidColor):
3356         (WebCore::Image::draw):
3357         (WebCore::Image::drawTiled):
3358         * platform/graphics/Image.h:
3359         (WebCore::Image::drawFrameMatchingSourceSize):
3360         * platform/graphics/ImageBuffer.cpp:
3361         (WebCore::ImageBuffer::createCompatibleBuffer):
3362         * platform/graphics/ImageBuffer.h:
3363         * platform/graphics/MediaPlayer.cpp:
3364         (WebCore::MediaPlayer::paint):
3365         (WebCore::MediaPlayer::paintCurrentFrameInContext):
3366         * platform/graphics/MediaPlayer.h:
3367         * platform/graphics/MediaPlayerPrivate.h:
3368         (WebCore::MediaPlayerPrivateInterface::paintCurrentFrameInContext):
3369         * platform/graphics/NamedImageGeneratedImage.cpp:
3370         (WebCore::NamedImageGeneratedImage::draw):
3371         (WebCore::NamedImageGeneratedImage::drawPattern):
3372         * platform/graphics/NamedImageGeneratedImage.h:
3373         * platform/graphics/ShadowBlur.cpp:
3374         (WebCore::ShadowBlur::adjustBlurRadius):
3375         (WebCore::ShadowBlur::calculateLayerBoundingRect):
3376         (WebCore::ShadowBlur::drawShadowBuffer):
3377         (WebCore::ShadowBlur::drawRectShadow):
3378         (WebCore::ShadowBlur::drawInsetShadow):
3379         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
3380         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
3381         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
3382         (WebCore::ShadowBlur::drawRectShadowWithTiling):
3383         (WebCore::ShadowBlur::drawLayerPieces):
3384         (WebCore::ShadowBlur::blurAndColorShadowBuffer):
3385         (WebCore::ShadowBlur::beginShadowLayer):
3386         (WebCore::ShadowBlur::endShadowLayer):
3387         * platform/graphics/ShadowBlur.h:
3388         * platform/graphics/TextRun.h:
3389         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3390         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3391         (WebCore::MediaPlayerPrivateAVFoundationCF::paintCurrentFrameInContext):
3392         (WebCore::MediaPlayerPrivateAVFoundationCF::paint):
3393         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
3394         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3395         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3396         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
3397         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint):
3398         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
3399         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
3400         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3401         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3402         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
3403         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
3404         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
3405         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3406         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paint):
3407         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
3408         * platform/graphics/cairo/BitmapImageCairo.cpp:
3409         (WebCore::BitmapImage::draw):
3410         * platform/graphics/cairo/FontCairo.cpp:
3411         (WebCore::drawGlyphsToContext):
3412         (WebCore::drawGlyphsShadow):
3413         (WebCore::FontCascade::drawGlyphs):
3414         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
3415         (WebCore::FontCascade::drawComplexText):
3416         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
3417         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3418         (WebCore::drawPathShadow):
3419         (WebCore::fillCurrentCairoPath):
3420         (WebCore::shadowAndFillCurrentCairoPath):
3421         (WebCore::shadowAndStrokeCurrentCairoPath):