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