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