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