d375e76a843d19eadabb263a3924394cbcbd0a83
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-09-29  Eric Carlson  <eric.carlson@apple.com>
2
3         [iOS] Remove obsolete playbackTargetAvailabilityChanged methods
4         https://bugs.webkit.org/show_bug.cgi?id=137179
5
6         Reviewed by Darin Adler.
7
8         No new tests, this just removes unused code.
9
10         * html/HTMLMediaElement.cpp:
11         (WebCore::HTMLMediaElement::mediaPlayerPlaybackTargetAvailabilityChanged): Deleted.
12         * html/HTMLMediaElement.h:
13
14         * platform/graphics/MediaPlayer.cpp:
15         (WebCore::MediaPlayer::playbackTargetAvailabilityChanged): Deleted.
16         * platform/graphics/MediaPlayer.h:
17         (WebCore::MediaPlayerClient::mediaPlayerPlaybackTargetAvailabilityChanged): Deleted.
18
19 2014-09-29  Christophe Dumez  <cdumez@apple.com>
20
21         Use the new is<>() / downcast<>() for ShadowRoot and StyledElement
22         https://bugs.webkit.org/show_bug.cgi?id=137199
23
24         Reviewed by Darin Adler.
25
26         Use the new is<>() / downcast<>() for ShadowRoot and StyledElement and
27         move towards getting rid of the NODE_TYPE_CASTS() macro.
28
29         No new tests, no behavior change.
30
31         * css/ElementRuleCollector.cpp:
32         (WebCore::ElementRuleCollector::matchAllRules):
33         * css/StyleResolver.cpp:
34         (WebCore::StyleResolver::State::initElement):
35         (WebCore::StyleResolver::State::initForStyleResolve):
36         (WebCore::StyleResolver::locateCousinList):
37         (WebCore::StyleResolver::findSiblingForStyleSharing):
38         * dom/Attr.cpp:
39         (WebCore::Attr::style):
40         * dom/Element.cpp:
41         (WebCore::Element::removeAttribute):
42         * dom/EventDispatcher.cpp:
43         (WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
44         (WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope):
45         (WebCore::eventTargetRespectingTargetRules):
46         (WebCore::EventPath::EventPath):
47         * dom/Node.cpp:
48         (WebCore::Node::containingShadowRoot):
49         (WebCore::Node::parentOrShadowHostElement):
50         (WebCore::Node::showNodePathForThis):
51         * dom/NodeRenderingTraversal.cpp:
52         (WebCore::NodeRenderingTraversal::traverseParent):
53         * dom/ShadowRoot.h:
54         (WebCore::isShadowRoot):
55         (WebCore::Node::shadowRoot):
56         (WebCore::Node::parentOrShadowHostNode):
57         * dom/StyledElement.h:
58         (WebCore::StyledElement::presentationAttributeStyle):
59         (WebCore::isStyledElement):
60         * dom/Text.cpp:
61         (WebCore::isSVGShadowText):
62         * dom/TreeScope.cpp:
63         (WebCore::TreeScope::focusedElement):
64         * dom/TreeScopeAdopter.cpp:
65         (WebCore::TreeScopeAdopter::moveNodeToNewDocument):
66         * editing/ApplyStyleCommand.cpp:
67         (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
68         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
69         * editing/EditingStyle.cpp:
70         (WebCore::EditingStyle::wrappingStyleForSerialization):
71         * editing/Editor.cpp:
72         (WebCore::Editor::applyEditingStyleToElement):
73         * editing/ReplaceSelectionCommand.cpp:
74         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
75         * editing/cocoa/HTMLConverter.mm:
76         (HTMLConverterCaches::inlineStylePropertyForElement):
77         * editing/markup.cpp:
78         (WebCore::StyledMarkupAccumulator::appendElement):
79         * inspector/InspectorCSSAgent.cpp:
80         (WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):
81         * inspector/InspectorOverlay.cpp:
82         (WebCore::buildObjectForElementInfo):
83         * page/DragController.cpp:
84         (WebCore::asFileInput):
85         * page/EventHandler.cpp:
86         (WebCore::EventHandler::handleMousePressEvent):
87         * page/FocusController.cpp:
88         (WebCore::FocusNavigationScope::owner):
89         * page/PageSerializer.cpp:
90         (WebCore::PageSerializer::serializeFrame):
91         * rendering/RenderLayer.cpp:
92         (WebCore::RenderLayer::resize):
93         * svg/SVGElement.cpp:
94         (WebCore::SVGElement::title):
95         * testing/Internals.cpp:
96         (WebCore::Internals::shadowRoot):
97         (WebCore::Internals::shadowRootType):
98         (WebCore::Internals::includerFor):
99
100 2014-09-29  Christophe Dumez  <cdumez@apple.com>
101
102         Use the new is<>() / downcast<>() for Text Nodes
103         https://bugs.webkit.org/show_bug.cgi?id=137188
104
105         Reviewed by Darin Adler.
106
107         Use the new is<>() / downcast<>() functions for Text Nodes instead of
108         isText() / toText().
109
110         No new tests, no behavior change.
111
112         * accessibility/AccessibilityNodeObject.cpp:
113         (WebCore::AccessibilityNodeObject::textUnderElement):
114         * bindings/gobject/WebKitDOMPrivate.cpp:
115         (WebKit::wrap):
116         * css/SelectorChecker.cpp:
117         (WebCore::SelectorChecker::checkOne):
118         * dom/CharacterData.cpp:
119         (WebCore::CharacterData::parserAppendData):
120         (WebCore::CharacterData::setDataAndUpdate):
121         * dom/ContainerNode.cpp:
122         (WebCore::destroyRenderTreeIfNeeded):
123         * dom/Node.cpp:
124         (WebCore::Node::normalize):
125         * dom/Position.cpp:
126         (WebCore::Position::containerNode):
127         (WebCore::Position::containerText):
128         (WebCore::Position::isRenderedCharacter):
129         (WebCore::Position::leadingWhitespacePosition):
130         * dom/Range.cpp:
131         (WebCore::Range::insertNode):
132         (WebCore::Range::getBorderAndTextQuads):
133         * dom/Text.cpp:
134         (WebCore::earliestLogicallyAdjacentTextNode):
135         (WebCore::latestLogicallyAdjacentTextNode):
136         * dom/Text.h:
137         (WebCore::isText):
138         * dom/TextNodeTraversal.cpp:
139         (WebCore::TextNodeTraversal::contentsAsString):
140         * dom/TextNodeTraversal.h:
141         (WebCore::TextNodeTraversal::firstTextChildTemplate):
142         (WebCore::TextNodeTraversal::firstTextWithinTemplate):
143         (WebCore::TextNodeTraversal::traverseNextTextTemplate):
144         (WebCore::TextNodeTraversal::nextSibling):
145         * editing/ApplyBlockElementCommand.cpp:
146         (WebCore::isNewLineAtPosition):
147         (WebCore::ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded):
148         * editing/ApplyStyleCommand.cpp:
149         (WebCore::ApplyStyleCommand::splitTextAtEnd):
150         (WebCore::ApplyStyleCommand::splitTextElementAtEnd):
151         (WebCore::ApplyStyleCommand::joinChildTextNodes):
152         * editing/BreakBlockquoteCommand.cpp:
153         (WebCore::BreakBlockquoteCommand::doApply):
154         * editing/CompositeEditCommand.cpp:
155         (WebCore::CompositeEditCommand::insertNodeAt):
156         (WebCore::CompositeEditCommand::positionOutsideTabSpan):
157         (WebCore::CompositeEditCommand::canRebalance):
158         (WebCore::CompositeEditCommand::rebalanceWhitespaceAt):
159         (WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
160         (WebCore::CompositeEditCommand::deleteInsignificantText):
161         (WebCore::CompositeEditCommand::removePlaceholderAt):
162         (WebCore::CompositeEditCommand::cleanupAfterDeletion):
163         (WebCore::CompositeEditCommand::moveParagraphs):
164         * editing/DeleteSelectionCommand.cpp:
165         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
166         (WebCore::DeleteSelectionCommand::fixupWhitespace):
167         (WebCore::DeleteSelectionCommand::doApply):
168         * editing/Editor.cpp:
169         (WebCore::Editor::setComposition):
170         * editing/InsertLineBreakCommand.cpp:
171         (WebCore::InsertLineBreakCommand::doApply):
172         * editing/InsertParagraphSeparatorCommand.cpp:
173         (WebCore::InsertParagraphSeparatorCommand::doApply):
174         * editing/InsertTextCommand.cpp:
175         (WebCore::InsertTextCommand::insertTab):
176         * editing/MarkupAccumulator.cpp:
177         (WebCore::MarkupAccumulator::appendStartMarkup):
178         * editing/ReplaceSelectionCommand.cpp:
179         (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
180         (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
181         (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
182         (WebCore::ReplaceSelectionCommand::insertAsListItems):
183         (WebCore::ReplaceSelectionCommand::performTrivialReplace):
184         * editing/TextIterator.cpp:
185         (WebCore::TextIterator::handleTextNode):
186         (WebCore::TextIterator::handleTextBox):
187         (WebCore::SimplifiedBackwardsTextIterator::handleTextNode):
188         * editing/VisibleUnits.cpp:
189         (WebCore::startPositionForLine):
190         (WebCore::endPositionForLine):
191         (WebCore::startOfParagraph):
192         (WebCore::endOfParagraph):
193         * editing/htmlediting.cpp:
194         (WebCore::lineBreakExistsAtPosition):
195         * editing/markup.cpp:
196         (WebCore::StyledMarkupAccumulator::renderedText):
197         (WebCore::replaceChildrenWithFragment):
198         (WebCore::replaceChildrenWithText):
199         * html/HTMLElement.cpp:
200         (WebCore::mergeWithNextTextNode):
201         (WebCore::HTMLElement::setOuterHTML):
202         (WebCore::HTMLElement::setOuterText):
203         * html/HTMLObjectElement.cpp:
204         (WebCore::HTMLObjectElement::hasFallbackContent):
205         (WebCore::HTMLObjectElement::updateDocNamedItem):
206         * html/HTMLOptionElement.cpp:
207         (WebCore::HTMLOptionElement::setText):
208         * html/HTMLScriptElement.cpp:
209         (WebCore::HTMLScriptElement::setText):
210         * html/HTMLTextFormControlElement.cpp:
211         (WebCore::HTMLTextFormControlElement::innerTextValue):
212         (WebCore::positionForIndex):
213         (WebCore::HTMLTextFormControlElement::indexForPosition):
214         (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks):
215         * html/HTMLTitleElement.cpp:
216         (WebCore::HTMLTitleElement::setText):
217         * html/parser/HTMLConstructionSite.cpp:
218         (WebCore::HTMLConstructionSite::insertTextNode):
219         * inspector/InspectorDOMAgent.cpp:
220         (WebCore::InspectorDOMAgent::setNodeValue):
221         * rendering/RenderCombineText.h:
222         * rendering/RenderNamedFlowThread.cpp:
223         (WebCore::RenderNamedFlowThread::getRanges):
224         * rendering/RenderText.cpp:
225         (WebCore::RenderText::textNode):
226         * rendering/svg/RenderSVGInlineText.h:
227         * style/StyleResolveTree.cpp:
228         (WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
229         (WebCore::Style::attachChildren):
230         (WebCore::Style::attachDistributedChildren):
231         (WebCore::Style::detachDistributedChildren):
232         (WebCore::Style::detachChildren):
233         (WebCore::Style::resolveShadowTree):
234         (WebCore::Style::resolveTree):
235
236 2014-09-29  Christophe Dumez  <cdumez@apple.com>
237
238         Remove remaining uses of NODE_TYPE_CASTS() from html/
239         https://bugs.webkit.org/show_bug.cgi?id=137172
240
241         Reviewed by Darin Adler.
242
243         Remove remaining uses of NODE_TYPE_CASTS() from html/ and use the new
244         SPECIALIZE_TYPE_TRAITS_*() macro instead so that is<>() / downcast<>()
245         works for those types.
246
247         No new tests, no behavior change.
248
249         * css/SelectorCheckerTestFunctions.h:
250         (WebCore::matchesLangPseudoClass):
251         (WebCore::matchesFutureCuePseudoClass):
252         (WebCore::matchesPastCuePseudoClass):
253         * css/StyleResolver.cpp:
254         (WebCore::StyleResolver::canShareStyleWithElement):
255         The new casting function found a bad cast from a StyledElement to VTTElement.
256         Those two types are unrelated as VTTElement inherits directly from Element.
257         Knowing that |element| in this method cannot be a VTTElement simplifies the
258         logic a bit.
259
260         * dom/NodeRenderingTraversal.cpp:
261         (WebCore::NodeRenderingTraversal::findFirstEnteringInsertionPoints):
262         (WebCore::NodeRenderingTraversal::findLastEnteringInsertionPoints):
263         (WebCore::NodeRenderingTraversal::traverseParent):
264         * html/HTMLLabelElement.cpp:
265         (WebCore::nodeAsSupportedLabelableElement):
266         * html/HTMLTextAreaElement.cpp:
267         (WebCore::HTMLTextAreaElement::innerTextElement):
268         * html/LabelableElement.h:
269         (WebCore::isLabelableElement):
270         * html/shadow/ContentDistributor.cpp:
271         (WebCore::ContentDistributor::ensureInsertionPointList):
272         * html/shadow/InsertionPoint.h:
273         (WebCore::isInsertionPoint):
274         (WebCore::isActiveInsertionPoint):
275         (WebCore::parentNodeForDistribution):
276         * html/shadow/TextControlInnerElements.h:
277         (WebCore::isTextControlInnerTextElement):
278         * html/track/VTTCue.cpp:
279         (WebCore::VTTCue::copyWebVTTNodeToDOMTree):
280         (WebCore::VTTCue::markFutureAndPastNodes):
281         * html/track/WebVTTElement.h:
282         (WebCore::isWebVTTElement):
283         * html/track/WebVTTParser.cpp:
284         (WebCore::WebVTTTreeBuilder::constructTreeFromToken):
285         * style/StyleResolveTree.cpp:
286         (WebCore::Style::attachRenderTree):
287         (WebCore::Style::detachChildren):
288
289 2014-09-29  Christophe Dumez  <cdumez@apple.com>
290
291         Make is<>() / downcast<>() work for HTMLDocument and its subclasses
292         https://bugs.webkit.org/show_bug.cgi?id=137169
293
294         Reviewed by Darin Adler.
295
296         Make is<>() / downcast<>() work for HTMLDocument and its subclasses by
297         using the SPECIALIZE_TYPE_TRAITS_*() macro. Drop the DOCUMENT_TYPE_CASTS()
298         macro as it is no longer needed.
299
300         No new tests, no behavior change.
301
302         * bindings/js/JSDOMWindowCustom.cpp:
303         (WebCore::namedItemGetter):
304         (WebCore::JSDOMWindow::getOwnPropertySlot):
305         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
306         * dom/Document.cpp:
307         (WebCore::Document::prepareForDestruction):
308         (WebCore::Document::processHttpEquiv):
309         (WebCore::eventTargetElementForDocument):
310         * dom/Document.h:
311         * dom/Element.cpp:
312         (WebCore::Element::insertedInto):
313         (WebCore::Element::removedFrom):
314         (WebCore::Element::updateName):
315         (WebCore::Element::updateId):
316         * html/HTMLDocument.h:
317         (WebCore::isHTMLDocument):
318         * html/HTMLElement.cpp:
319         (WebCore::HTMLElement::matchesReadWritePseudoClass):
320         * html/HTMLEmbedElement.cpp:
321         (WebCore::HTMLEmbedElement::updateWidget):
322         * html/HTMLImageElement.cpp:
323         (WebCore::HTMLImageElement::parseAttribute):
324         * html/HTMLMediaElement.cpp:
325         (WebCore::HTMLMediaElement::parseAttribute):
326         * html/HTMLObjectElement.cpp:
327         (WebCore::HTMLObjectElement::updateDocNamedItem):
328         * html/ImageDocument.cpp:
329         (WebCore::ImageDocumentParser::document):
330         * html/ImageDocument.h:
331         (WebCore::isImageDocument):
332         * html/MediaDocument.h:
333         (WebCore::isMediaDocument):
334         * html/PluginDocument.cpp:
335         (WebCore::PluginDocumentParser::createDocumentStructure):
336         * html/PluginDocument.h:
337         (WebCore::isPluginDocument):
338         * loader/SubframeLoader.cpp:
339         (WebCore::SubframeLoader::loadPlugin):
340         * page/DragController.cpp:
341         (WebCore::DragController::operationForLoad):
342         * page/FrameView.cpp:
343         (WebCore::determineLayerFlushThrottleState):
344
345 2014-09-29  Bruno de Oliveira Abinader  <bruno.d@partner.samsung.com>
346
347         Revert "Support for :enabled selector on Anchor & Area elements"
348         https://bugs.webkit.org/show_bug.cgi?id=134826
349
350         Reviewed by Darin Adler.
351
352         HTML spec has been modified [1] to disable support for :enabled CSS
353         selector on Anchor, Area & Link elements, after discussion on W3C
354         Bugzilla [2].
355
356         This reverts r171671.
357
358         [1] https://html5.org/r/8818
359         [2] https://www.w3.org/Bugs/Public/show_bug.cgi?id=26622
360
361         * css/SelectorCheckerTestFunctions.h:
362         (WebCore::isEnabled):
363         * html/HTMLAnchorElement.cpp:
364         (WebCore::HTMLAnchorElement::parseAttribute):
365
366 2014-09-29  Darin Adler  <darin@apple.com>
367
368         Tweak and tighten SVG font converter
369         https://bugs.webkit.org/show_bug.cgi?id=136956
370
371         Reviewed by Myles Maxfield.
372
373         * svg/SVGToOTFFontConversion.cpp: Fixed copyright date.
374         (WebCore::overwrite32): Changed to use normal subscripting for clarity.
375         (WebCore::overwrite16): Added.
376         (WebCore::SVGToOTFFontConverter::GlyphData::GlyphData): Added a move
377         to make constructing each GlyphData less expensive.
378         (WebCore::SVGToOTFFontConverter::KerningData): Removed the < operator
379         since it the struct contains more than what we want to sort it by, so it's
380         not elegant to build the sorting rule into the struct.
381         (WebCore::SVGToOTFFontConverter): Removed "k" prefix from some constants.
382         Replaced many function templates with non-template functions. Changed
383         key type for m_codepointToIndexMap to UChar32.
384         (WebCore::integralLog2): Tweaked formatting.
385         (WebCore::SVGToOTFFontConverter::appendCMAPTable): Removed a stray
386         cast that doesn't have any effect. Use the Glyph type to index m_glyphs.
387         (WebCore::SVGToOTFFontConverter::appendHEADTable): Append the magic
388         number in a more straightforward way.
389         (WebCore::clampTo): Tweak formatting of the template function.
390         (WebCore::SVGToOTFFontConverter::appendHHEATable): Made some minor
391         style changes and improved some comments.
392         (WebCore::SVGToOTFFontConverter::appendOS2Table): Made some minor
393         style changes and tightened up code that did parsing a bit, removing the
394         dynamically allocated array for the fixed length Panose number.
395         Also use first and last instead of hand-coded versions of those.
396         (WebCore::appendValidCFFString): Renamed.
397         (WebCore::SVGToOTFFontConverter::appendCFFTable): Made various tweaks,
398         including more specific of null for the "no weight" value instead of
399         either empty or null.
400         (WebCore::SVGToOTFFontConverter::appendVORGTable): Simplified some of
401         the numeric parsing, since toInt is guaranteed to return 0 when it also
402         would return "false" for ok. Also got rid of a local vector and instead
403         just fixed up the size of the table afterward.
404         (WebCore::SVGToOTFFontConverter::appendVHEATable): Tweaked comment.
405         (WebCore::SVGToOTFFontConverter::addCodepointRanges): Use isValidKey
406         instead of a local hardcoded rule to check hash table key validity.
407         Check for zero in the result of get rather than using find on the HashMap.
408         (WebCore::SVGToOTFFontConverter::addCodepointRanges): Ditto.
409         (WebCore::SVGToOTFFontConverter::addGlyphNames): Ditto.
410         (WebCore::SVGToOTFFontConverter::addKerningPair): Added. Factored out from
411         appendKERNSubtable to reduce template bloat and improve clarity.
412         (WebCore::SVGToOTFFontConverter::appendKERNSubtable): Tweaked formatting.
413         Moved the bulk of the function into non-template function.
414         (WebCore::SVGToOTFFontConverter::finishAppendingKERNSubtable): Added.
415         Non-template part of appendKERNSubtable. Also changed std::sort to supply
416         custom comparison function rather than trying to use the < operator directly
417         on KerningData.
418         (WebCore::writeCFFEncodedNumber): Don't use powf just to multiply by
419         2^16. It's pretty easy to do that with plain old multiplication.
420         (WebCore::CFFBuilder::CFFBuilder): Renamed m_firstPoint to
421         m_hasBoundingBox.
422         (WebCore::CFFBuilder::boundingBox): Made this public and const and made
423         the rest of the class private.
424         (WebCore::CFFBuilder::updateBoundingBox): Used early return and revised
425         to use m_hasBoundingBox.
426         (WebCore::CFFBuilder::writePoint): Added. Used to keep the other
427         functions below smaller.
428         (WebCore::CFFBuilder::moveTo): Marked virtual and simplified using writePoint.
429         Might find a way to simplify even further by teaching writePoint about
430         the PathCoordinateMode.
431         (WebCore::CFFBuilder::lineTo): Ditto.
432         (WebCore::CFFBuilder::curveToCubic): Ditto. Also removed comment that said
433         the function could be faster. Not sure that's important to state like this.
434         (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths): Changed into a
435         non-template function. Tweaked logic and formatting a bit.
436         (WebCore::SVGToOTFFontConverter::processGlyphElement): Changed into a
437         non-template function. Moved the code from appendGlyphData in here.
438         Use WTF::move so we don't copy the glyph paths when creating a GlyphData.
439         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Updated a bit for
440         function changes above. Changed code to use isValidKey to check if we can
441         add to m_codepointToIndexMap. Parse font-style rather than parsing
442         font-weight twice. Round weights instead of truncating them. Change rule
443         to "first wins" instead of "last wins" when there are multiple segments.
444         Removed one vague and non-helpful comment.
445         (WebCore::isFourByteAligned): Fixed minor formatting issue by making the
446         function non-abstract. No reason not to hard-code the number 3 when the
447         number four appears in the function name.
448         (WebCore::calculateChecksum): Removed unneeded comment about why the
449         checksum is little-endian; since this came from Windows documentation there
450         is no doubt that little-endian is correct, so we don't need a comment creating
451         fear, uncertainty, and doubt. If the checksum computation is wrong, it should
452         become obvious that we have a bad checksum. Also changed the for loop to use
453         its own loop variable instead of changing startingOffset, which is not logical.
454         (WebCore::SVGToOTFFontConverter::appendTable): Updated for name changes.
455         (WebCore::SVGToOTFFontConverter::convertSVGToOTFFont): Ditto. Also streamlined
456         the checksum code a little. The comment still is a little peculiar; I was
457         tempted to take it out.
458
459 2014-09-29  Carlos Garcia Campos  <cgarcia@igalia.com>
460
461         [GTK] Remove MainFrameScrollbarGtk.cpp
462         https://bugs.webkit.org/show_bug.cgi?id=137211
463
464         Reviewed by Philippe Normand.
465
466         This was only used by WebKit1.
467
468         * PlatformGTK.cmake:
469         * platform/gtk/MainFrameScrollbarGtk.cpp: Removed.
470         * platform/gtk/MainFrameScrollbarGtk.h: Removed.
471
472 2014-09-29  Carlos Garcia Campos  <cgarcia@igalia.com>
473
474         [GTK] Remove IntPointGtk.cpp and IntRectGtk.cpp
475         https://bugs.webkit.org/show_bug.cgi?id=137209
476
477         Reviewed by Philippe Normand.
478
479         IntPointGtk is unused and IntRectGtk is only required by GTK+2 and
480         only used when building with GTK+2 in GtkInputMethodFilter.cpp
481         that can be easily replaced.
482
483         * PlatformGTK.cmake:
484         * platform/graphics/IntPoint.h:
485         * platform/graphics/IntRect.h:
486         * platform/graphics/gtk/IntPointGtk.cpp: Removed.
487         * platform/graphics/gtk/IntRectGtk.cpp: Removed.
488         * platform/gtk/GtkInputMethodFilter.cpp:
489         (WebCore::GtkInputMethodFilter::setCursorRect):
490
491 2014-09-02  Sergio Villar Senin  <svillar@igalia.com>
492
493         [CSS Grid Layout] Handle percentages of indefinite sizes in minmax() and grid-auto-*
494         https://bugs.webkit.org/show_bug.cgi?id=136453
495
496         Reviewed by Darin Adler.
497
498         After r165048 percentages of indefinite sizes were correctly
499         computed to "auto". The problem is that we were not doing it when
500         the percentage was inside the minmax() function. In those cases it
501         should compute to min-content for the min track sizing function or
502         to max-content for the max track sizing function.
503
504         We were not doing it also for the track sizes specified in
505         grid-auto-{column|row} properties. Fixed as well as the code is
506         the same.
507
508         Tests: fast/css-grid-layout/percent-of-indefinite-track-size-in-auto.html
509                fast/css-grid-layout/percent-of-indefinite-track-size-in-minmax-crash.html
510                fast/css-grid-layout/percent-of-indefinite-track-size.html
511
512         * rendering/RenderGrid.cpp:
513         (WebCore::RenderGrid::gridTrackSize):
514         * rendering/RenderGrid.h:
515         * rendering/style/GridLength.h:
516         (WebCore::GridLength::isPercentage):
517         * rendering/style/GridTrackSize.h:
518         (WebCore::GridTrackSize::GridTrackSize):
519
520 2014-09-29  Carlos Garcia Campos  <cgarcia@igalia.com>
521
522         Unreviewed. Move sources not using GTK+ from WebCorePlatformGTK_SOURCES to WebCore_SOURCES.
523
524         * PlatformGTK.cmake:
525
526 2014-09-29  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
527
528         Use std::unique_ptr instead of PassOwnPtr|OwnPtr for NamedNodeMap
529         https://bugs.webkit.org/show_bug.cgi?id=137201
530
531         Reviewed by Darin Adler.
532
533         No new tests, just refactoring patch.
534
535         * dom/ElementRareData.h: Use std::unique_ptr instead of OwnPtr.
536         (WebCore::ElementRareData::setAttributeMap): Use std::unique_ptr. 
537         * dom/NamedNodeMap.h:
538         (WebCore::NamedNodeMap::create): ditto.
539
540 2014-09-28  Myles C. Maxfield  <mmaxfield@apple.com>
541
542         Replace wkGetGlyphsForCharacters() with CGFontGetGlyphsForUnichars()
543         https://bugs.webkit.org/show_bug.cgi?id=137197
544
545         Reviewed by Alexey Proskuryakov.
546
547         No new tests because there is no behavior change.
548
549         * WebCore.exp.in:
550         * WebCore.order:
551         * WebCore.xcodeproj/project.pbxproj:
552         * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
553         (WebCore::GlyphPage::fill): Use SPI call instead of WKSI call
554         * platform/mac/WebCoreSystemInterface.h:
555         * platform/mac/WebCoreSystemInterface.mm:
556         * platform/spi/cocoa/CGFontUnicodeSupport.h: Added for SPI call.
557
558 2014-09-28  Christophe Dumez  <cdumez@apple.com>
559
560         Automatically generate template specializations for most Elements
561         https://bugs.webkit.org/show_bug.cgi?id=137174
562
563         Reviewed by Darin Adler.
564
565         Previously, the template specializations to make is<>() / downcast<>()
566         work for HTML/SVG/MathML elements were only generated if
567         "generateTypeHelpers" parameter was explicitly specified for the
568         corresponding tag name in the *Tags.in file.
569
570         We are however able to generate the template specializations for most
571         types so this patch drops the "generateTypeHelpers" parameter and
572         generates those template specializations by default.
573
574         One case we cannot generate the specialization ifor is when a class is
575         associated to several tag names but this patch updates the
576         make_names.pl script to detect this and skip those classes.
577
578         No new tests, no behavior change.
579
580         * CMakeLists.txt:
581         * WebCore.xcodeproj/project.pbxproj:
582         * dom/make_names.pl:
583         (defaultTagPropertyHash):
584         (printTypeHelpers):
585         * html/HTMLTagNames.in:
586         * mathml/mathtags.in:
587         * svg/SVGAllInOne.cpp:
588         * svg/SVGAnimateColorElement.cpp:
589         (WebCore::SVGAnimateColorElement::SVGAnimateColorElement):
590         (WebCore::SVGAnimateColorElement::determinePropertyValueTypes):
591         * svg/SVGAnimateColorElement.h:
592         * svg/SVGAnimateElement.cpp:
593         (WebCore::SVGAnimateElement::SVGAnimateElement):
594         (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted.
595         (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted.
596         (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted.
597         (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted.
598         (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted.
599         (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted.
600         (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted.
601         (WebCore::propertyTypesAreConsistent): Deleted.
602         (WebCore::SVGAnimateElement::resetAnimatedType): Deleted.
603         (WebCore::applyCSSPropertyToTarget): Deleted.
604         (WebCore::removeCSSPropertyFromTarget): Deleted.
605         (WebCore::applyCSSPropertyToTargetAndInstances): Deleted.
606         (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted.
607         (WebCore::notifyTargetAboutAnimValChange): Deleted.
608         (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted.
609         (WebCore::SVGAnimateElement::clearAnimatedType): Deleted.
610         (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted.
611         (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted.
612         (WebCore::SVGAnimateElement::isAdditive): Deleted.
613         (WebCore::SVGAnimateElement::calculateDistance): Deleted.
614         (WebCore::SVGAnimateElement::setTargetElement): Deleted.
615         (WebCore::SVGAnimateElement::setAttributeName): Deleted.
616         (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted.
617         (WebCore::SVGAnimateElement::ensureAnimator): Deleted.
618         * svg/SVGAnimateElement.h:
619         (WebCore::isSVGAnimateElement): Deleted.
620         * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp.
621         (WebCore::SVGAnimateElementBase::SVGAnimateElementBase):
622         (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase):
623         (WebCore::SVGAnimateElementBase::hasValidAttributeType):
624         (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType):
625         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
626         (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
627         (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
628         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
629         (WebCore::propertyTypesAreConsistent):
630         (WebCore::SVGAnimateElementBase::resetAnimatedType):
631         (WebCore::applyCSSPropertyToTarget):
632         (WebCore::removeCSSPropertyFromTarget):
633         (WebCore::applyCSSPropertyToTargetAndInstances):
634         (WebCore::removeCSSPropertyFromTargetAndInstances):
635         (WebCore::notifyTargetAboutAnimValChange):
636         (WebCore::notifyTargetAndInstancesAboutAnimValChange):
637         (WebCore::SVGAnimateElementBase::clearAnimatedType):
638         (WebCore::SVGAnimateElementBase::applyResultsToTarget):
639         (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition):
640         (WebCore::SVGAnimateElementBase::isAdditive):
641         (WebCore::SVGAnimateElementBase::calculateDistance):
642         (WebCore::SVGAnimateElementBase::setTargetElement):
643         (WebCore::SVGAnimateElementBase::setAttributeName):
644         (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType):
645         (WebCore::SVGAnimateElementBase::ensureAnimator):
646         * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h.
647         (WebCore::isSVGAnimateElementBase):
648         * svg/SVGAnimateTransformElement.cpp:
649         (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement):
650         (WebCore::SVGAnimateTransformElement::parseAttribute):
651         * svg/SVGAnimateTransformElement.h:
652         * svg/SVGAnimatedAngle.cpp:
653         * svg/SVGAnimatedBoolean.cpp:
654         * svg/SVGAnimatedColor.cpp:
655         * svg/SVGAnimatedInteger.cpp:
656         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
657         * svg/SVGAnimatedLength.cpp:
658         * svg/SVGAnimatedLengthList.cpp:
659         * svg/SVGAnimatedNumber.cpp:
660         * svg/SVGAnimatedNumberList.cpp:
661         * svg/SVGAnimatedNumberOptionalNumber.cpp:
662         * svg/SVGAnimatedPath.cpp:
663         * svg/SVGAnimatedPointList.cpp:
664         * svg/SVGAnimatedPreserveAspectRatio.cpp:
665         * svg/SVGAnimatedRect.cpp:
666         * svg/SVGAnimatedString.cpp:
667         * svg/SVGAnimationElement.cpp:
668         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
669         * svg/SVGSetElement.cpp:
670         (WebCore::SVGSetElement::SVGSetElement):
671         * svg/SVGSetElement.h:
672         * svg/svgtags.in:
673
674 2014-09-28  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
675
676         Use std::unique_ptr for ContextMenuController
677         https://bugs.webkit.org/show_bug.cgi?id=137178
678
679         Reviewed by Darin Adler.
680
681         Switch to using std::unique_ptr instead of OwnPtr and PassOwnPtr
682         for ContextMenuController class. Inherited class is changed by this use as well.
683
684         No new tests, no behavior changes.
685
686         * loader/EmptyClients.cpp:
687         (WebCore::EmptyContextMenuClient::customizeMenu):
688         * loader/EmptyClients.h:
689         * page/ContextMenuClient.h:
690         * page/ContextMenuController.cpp:
691         (WebCore::ContextMenuController::clearContextMenu):
692         (WebCore::ContextMenuController::maybeCreateContextMenu):
693         (WebCore::ContextMenuController::showContextMenu):
694         * page/ContextMenuController.h:
695
696 2014-09-28  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
697
698         Move ColorInputType class to std::unique_ptr
699         https://bugs.webkit.org/show_bug.cgi?id=137173
700
701         Reviewed by Darin Adler.
702
703         Replace uses of PassOwnPtr in code under ColorInputType class with std::unique_ptr.
704         Child classes follow this change as well.
705
706         No new tests, no behavior changes.
707
708         * html/ColorInputType.cpp:
709         (WebCore::ColorInputType::didEndChooser):
710         * html/ColorInputType.h:
711         * loader/EmptyClients.cpp:
712         (WebCore::EmptyChromeClient::createColorChooser):
713         * loader/EmptyClients.h:
714         * page/Chrome.cpp:
715         (WebCore::Chrome::createColorChooser):
716         * page/Chrome.h:
717         * page/ChromeClient.h:
718
719 2014-09-28  Sungmann Cho  <sungmann.cho@navercorp.com>
720
721         Fix some minor typos: psuedo -> pseudo
722         https://bugs.webkit.org/show_bug.cgi?id=137192
723
724         Reviewed by Alexey Proskuryakov.
725
726         No new tests, no behavior change.
727
728         * css/CSSSelector.cpp:
729         (WebCore::CSSSelector::specificityForOneSelector):
730
731 2014-09-28  Carlos Garcia Campos  <cgarcia@igalia.com>
732
733         Unreviewed. Move RenderThemeGtk.h from platform/gtk to rendering.
734
735         I forgot to move this file in r173111.
736
737         * rendering/RenderThemeGtk.h: Renamed from Source/WebCore/platform/gtk/RenderThemeGtk.h.
738
739 2014-09-28  Carlos Garcia Campos  <cgarcia@igalia.com>
740
741         [ATK] WebKitAccessibleWrapperAtk should not depend on GTK
742         https://bugs.webkit.org/show_bug.cgi?id=137177
743
744         Reviewed by Martin Robinson.
745
746         It's used to get the web view widget, but there's no GtkWidget in
747         the web process and platformPageClient is always NULL.
748
749         * PlatformGTK.cmake: Move accessibility sources to the WebCore
750         sources list.
751         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
752         (atkParentOfRootObject): Remove code to get view GtkWidget.
753         * editing/atk/FrameSelectionAtk.cpp: Remove unneeded header include.
754
755 2014-09-28  Carlos Garcia Campos  <cgarcia@igalia.com>
756
757         [GTK] Remove unused GtkPluginWidget
758         https://bugs.webkit.org/show_bug.cgi?id=137176
759
760         Reviewed by Csaba Osztrogon√°c.
761
762         It was only used by WebKit1.
763
764         * PlatformGTK.cmake:
765         * platform/gtk/GtkPluginWidget.cpp: Removed.
766         * platform/gtk/GtkPluginWidget.h: Removed.
767
768 2014-09-28  Carlos Garcia Campos  <cgarcia@igalia.com>
769
770         [cairo] GraphicsContext should not depend on GTK+
771         https://bugs.webkit.org/show_bug.cgi?id=137175
772
773         Reviewed by Martin Robinson.
774
775         Remove the unused methods depending on GDK and simplify
776         GraphicsContext::drawFocusRing() using only cairo API.
777
778         * PlatformGTK.cmake: Move GraphicsContextCairo.cpp to the webcore sources.
779         * platform/graphics/GraphicsContext.h:
780         * platform/graphics/cairo/GraphicsContextCairo.cpp:
781         (WebCore::GraphicsContext::drawFocusRing): Iterate the rectangles
782         instead of creating a region for the rectangles and call gdk_cairo_region().
783         (WebCore::GraphicsContext::setGdkExposeEvent): Deleted.
784         (WebCore::GraphicsContext::gdkExposeEvent): Deleted.
785         (WebCore::GraphicsContext::gdkWindow): Deleted.
786         * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
787         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
788
789 2014-09-27  Chris Dumez  <cdumez@apple.com>
790
791         HTMLPlugInElement::isUserObservable() is causing layout
792         https://bugs.webkit.org/show_bug.cgi?id=137156
793
794         Reviewed by Ryosuke Niwa.
795
796         While profiling the page load of nytimes.com, I noticed that we were
797         spending ~4-5% of cpu time in HTMLPlugInElement::isUserObservable().
798         The reason is that the function calls pluginWidget(), which causes a
799         layout update in HTMLObjectElement::renderWidgetForJSBindings(), to
800         make sure the plugin is loaded and its renderer is created.
801
802         HTMLPlugInElement::isUserObservable() shouldn't need to do a layout.
803         This patch does the following to address the problem:
804         - Rename renderWidgetForJSBindings() to renderWidgetLoadingPlugin()
805           because this function is not always called from the JS Bindings
806           nowadays. The new name makes it clearer that this will load the
807           plugin if needed (to make sure the renderer is created, and by
808           doing a layout).
809         - Add a PluginLoadingPolicy argument to
810           HTMLPlugInElement::pluginWidget() to let the caller control if the
811           plugin should be loaded or not.
812         - Update the call to pluginWidget() in isUserObservable() so that
813           we do not attempt to load the plugin (thus not causing a layout).
814
815         No new tests, no behavior change.
816
817         * WebCore.exp.in:
818         * WebCore.order:
819         * html/HTMLAppletElement.cpp:
820         (WebCore::HTMLAppletElement::renderWidgetLoadingPlugin):
821         (WebCore::HTMLAppletElement::renderWidgetForJSBindings): Deleted.
822         * html/HTMLAppletElement.h:
823         * html/HTMLEmbedElement.cpp:
824         (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin):
825         (WebCore::HTMLEmbedElement::renderWidgetForJSBindings): Deleted.
826         * html/HTMLEmbedElement.h:
827         * html/HTMLObjectElement.cpp:
828         (WebCore::HTMLObjectElement::renderWidgetLoadingPlugin):
829         (WebCore::HTMLObjectElement::renderWidgetForJSBindings): Deleted.
830         * html/HTMLObjectElement.h:
831         * html/HTMLPlugInElement.cpp:
832         (WebCore::HTMLPlugInElement::pluginWidget):
833         (WebCore::HTMLPlugInElement::isUserObservable):
834         * html/HTMLPlugInElement.h:
835
836 2014-09-27  Christophe Dumez  <cdumez@apple.com>
837
838         Use the new is<>() / downcast<>() for more Node subclasses
839         https://bugs.webkit.org/show_bug.cgi?id=137184
840
841         Reviewed by Ryosuke Niwa.
842
843         Use the new is<>() / downcast<>() for more Node subclasses:
844         CDATASection, CharacterData, Comment, DocumentType,
845         ProcessingInstruction, and PseudoElement.
846
847         No new tests, no behavior change.
848
849         * dom/CDATASection.h:
850         (WebCore::isCDATASection):
851         * dom/CharacterData.cpp:
852         (WebCore::CharacterData::setDataAndUpdate):
853         * dom/CharacterData.h:
854         (WebCore::isCharacterData):
855         * dom/Comment.h:
856         (WebCore::isComment):
857         * dom/DocumentStyleSheetCollection.cpp:
858         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
859         * dom/DocumentType.h:
860         (WebCore::isDocumentType):
861         * dom/EventDispatcher.cpp:
862         (WebCore::eventTargetRespectingTargetRules):
863         (WebCore::nodeOrHostIfPseudoElement):
864         * dom/Node.cpp:
865         (WebCore::markAncestorsWithChildNeedsStyleRecalc):
866         (WebCore::Node::pseudoAwarePreviousSibling):
867         (WebCore::Node::pseudoAwareNextSibling):
868         * dom/NodeTraversal.cpp:
869         (WebCore::NodeTraversal::previousIncludingPseudo):
870         (WebCore::NodeTraversal::nextIncludingPseudo):
871         (WebCore::NodeTraversal::nextIncludingPseudoSkippingChildren):
872         * dom/ProcessingInstruction.h:
873         (WebCore::isProcessingInstruction):
874         * dom/PseudoElement.h:
875         (WebCore::isPseudoElement):
876         * dom/Range.cpp:
877         (WebCore::lengthOfContentsInNode):
878         (WebCore::Range::processContentsBetweenOffsets):
879         (WebCore::Range::checkNodeWOffset):
880         * editing/Editor.cpp:
881         (WebCore::Editor::shouldInsertFragment):
882         * editing/MarkupAccumulator.cpp:
883         (WebCore::MarkupAccumulator::appendStartMarkup):
884         * editing/cocoa/HTMLConverter.mm:
885         (HTMLConverter::_traverseNode):
886         * inspector/InspectorDOMAgent.cpp:
887         (WebCore::InspectorDOMAgent::buildObjectForNode):
888         * inspector/InspectorLayerTreeAgent.cpp:
889         (WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
890         * rendering/HitTestResult.cpp:
891         (WebCore::HitTestResult::setInnerNode):
892         (WebCore::HitTestResult::setInnerNonSharedNode):
893         * rendering/RenderListItem.cpp:
894         (WebCore::enclosingList):
895         * rendering/RenderObject.cpp:
896         (WebCore::RenderObject::generatingPseudoHostElement):
897         * xml/XPathFunctions.cpp:
898         (WebCore::XPath::expandedNameLocalPart):
899
900 2014-09-27  Christophe Dumez  <cdumez@apple.com>
901
902         Use the new is<>() / downcast<>() for Attr Nodes
903         https://bugs.webkit.org/show_bug.cgi?id=137183
904
905         Reviewed by Ryosuke Niwa.
906
907         Use the new is<>() / downcast<>() for Attr Nodes instead of isAttr() /
908         toAttr().
909
910         No new tests, no behavior change.
911
912         * dom/Attr.h:
913         (WebCore::isAttr):
914         * dom/Document.cpp:
915         (WebCore::Document::importNode):
916         (WebCore::Document::adoptNode):
917         * dom/NamedNodeMap.cpp:
918         (WebCore::NamedNodeMap::setNamedItem):
919         * dom/Node.cpp:
920         (WebCore::Node::compareDocumentPosition):
921         * inspector/InspectorDOMAgent.cpp:
922         (WebCore::InspectorDOMAgent::buildObjectForNode):
923         * inspector/InspectorNodeFinder.cpp:
924         (WebCore::InspectorNodeFinder::searchUsingXPath):
925         * xml/XPathNodeSet.cpp:
926         (WebCore::XPath::sortBlock):
927         (WebCore::XPath::NodeSet::sort):
928         (WebCore::XPath::findRootNode):
929
930 2014-09-27  Brian J. Burg  <burg@cs.washington.edu>
931
932         Web Replay: Playback position updates should be sent before the next event loop input is dispatched
933         https://bugs.webkit.org/show_bug.cgi?id=137162
934
935         Reviewed by Timothy Hatcher.
936
937         To drive playback position updates in the Inspector UI, we send playbackHitPosition protocol
938         messages as the replay backend dispatches inputs. However, right now the semantics of that
939         message are muddy. The update is sent *after* the input at the offset is dispatched. This leads
940         to unexpected results if the debugger pauses while the input is being dispatched: the frontend
941         will only know about the previous (stale) playback position when the debugger pauses.
942
943         With this patch, the backend sends the playbackHitPosition(segmentOffset=n, inputOffset=m)
944         message when backend is about to dispatch input m, but has not yet begun to do so. Thus, any
945         subsequent page execution events (profiling, debugger pauses, etc) until the next
946         playbackHitPosition are caused by input m's being dispatched.
947
948         * inspector/protocol/Replay.json: Clarify the message's semantics.
949         * replay/ReplayController.cpp:
950         (WebCore::ReplayController::willDispatchInput):
951         (WebCore::ReplayController::didDispatchInput):
952
953 2014-09-27  Benjamin Poulain  <bpoulain@apple.com>
954
955         Chaining multiple :nth-child() does not work properly
956         https://bugs.webkit.org/show_bug.cgi?id=137032
957
958         Reviewed by Gavin Barraclough.
959
960         When multiple :nth-child() are chained, the evaluation of each "An+B" could depend on
961         the execution of the previous "An+B". The reason is that the register holding the position
962         of the current element could be modified by the evaluation of "An+B".
963
964         There are two cases in which the register was used as the destination of an operation:
965         1) When A and B are positive, the counter would be the destination of "counter - B".
966         2) When A is not 1 or 2, the modulo operation was not preserving the input register.
967
968         For (1), we a copy of the counter in that case of generateElementIsNthChild().
969
970         For (2), we also preserve a copy of the input if it is used by the operation. In this case,
971         if the input register is one of the argument we need for idiv, we preserve it on the stack
972         or in a register depending on what is available.
973
974         This increases the register requirements by 2 in the worst case on x86. The extra registers
975         can push generateElementIsNthChild() above the 4 available registers. To accomodate for that,
976         minimumRegisterRequirements() reserve more registers on x86.
977
978         The extra register pressure has strictly no effect on performance, x86_64 has 9 registers
979         available without pushing anything. The extra allocation is only necessary for debugging.
980
981         Tests: fast/selectors/nth-child-basics.html
982                fast/selectors/nth-child-chained.html
983                fast/selectors/nth-child-of-basics-2.html
984                fast/selectors/nth-child-of-chained.html
985
986         * cssjit/SelectorCompiler.cpp:
987         (WebCore::SelectorCompiler::minimumRegisterRequirements):
988         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
989         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
990
991 2014-09-26  Christophe Dumez  <cdumez@apple.com>
992
993         Stop using legacy NODE_TYPE_CASTS() macro for HTML Elements
994         https://bugs.webkit.org/show_bug.cgi?id=137137
995
996         Reviewed by Benjamin Poulain.
997
998         Stop using legacy NODE_TYPE_CASTS() macro for HTML Elements and use the
999         new SPECIALIZE_TYPE_TRAITS_*() macro instead so that is<>() /
1000         downcast<>() works for those types.
1001
1002         No new tests, no behavior change.
1003
1004         * accessibility/AccessibilityNodeObject.cpp:
1005         (WebCore::AccessibilityNodeObject::labelForElement):
1006         (WebCore::AccessibilityNodeObject::text):
1007         * accessibility/AccessibilityTable.cpp:
1008         (WebCore::AccessibilityTable::isDataTable):
1009         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1010         (webkitAccessibleGetName):
1011         (webkitAccessibleGetDescription):
1012         * bindings/gobject/WebKitDOMPrivate.cpp:
1013         (WebKit::wrap):
1014         * bindings/js/JSElementCustom.cpp:
1015         (WebCore::toJSNewlyCreated):
1016         * bindings/js/JSNodeCustom.cpp:
1017         (WebCore::createWrapperInline):
1018         * bindings/js/JSPluginElementFunctions.cpp:
1019         (WebCore::pluginInstance):
1020         (WebCore::pluginScriptObjectFromPluginViewBase):
1021         (WebCore::pluginScriptObject):
1022         (WebCore::pluginElementCustomPut):
1023         (WebCore::isPluginElement): Deleted.
1024         * bindings/objc/DOM.mm:
1025         (kitClass):
1026         * css/ElementRuleCollector.cpp:
1027         (WebCore::ElementRuleCollector::matchAllRules):
1028         * css/SelectorChecker.cpp:
1029         (WebCore::SelectorChecker::checkOne):
1030         * css/StyleResolver.cpp:
1031         (WebCore::StyleResolver::locateCousinList):
1032         (WebCore::elementHasDirectionAuto):
1033         * cssjit/SelectorCompiler.cpp:
1034         (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
1035         (WebCore::SelectorCompiler::makeElementStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
1036         (WebCore::SelectorCompiler::isPlaceholderShown):
1037         * dom/ContainerNodeAlgorithms.cpp:
1038         (WebCore::assertConnectedSubrameCountIsConsistent):
1039         (WebCore::collectFrameOwners):
1040         (WebCore::disconnectSubframes):
1041         * dom/Document.cpp:
1042         (WebCore::Document::adoptNode):
1043         (WebCore::Document::setBody):
1044         (WebCore::Document::iconURLs):
1045         (WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
1046         (WebCore::Document::updateHoverActiveState):
1047         * dom/DocumentStyleSheetCollection.cpp:
1048         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
1049         * dom/Range.cpp:
1050         (WebCore::Range::createContextualFragment):
1051         * dom/make_names.pl:
1052         (printTypeHelpers):
1053         * editing/ApplyStyleCommand.cpp:
1054         (WebCore::isLegacyAppleStyleSpan):
1055         (WebCore::isStyleSpanOrSpanWithOnlyStyleAttribute):
1056         (WebCore::isSpanWithoutAttributesOrUnstyledStyleSpan):
1057         (WebCore::isEmptyFontTag):
1058         (WebCore::ApplyStyleCommand::applyBlockStyle):
1059         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
1060         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
1061         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
1062         (WebCore::ApplyStyleCommand::removeConflictingInlineStyleFromRun):
1063         (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
1064         (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
1065         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
1066         (WebCore::ApplyStyleCommand::removeInlineStyle):
1067         (WebCore::ApplyStyleCommand::shouldSplitTextElement):
1068         (WebCore::ApplyStyleCommand::applyInlineStyleChange):
1069         * editing/DeleteButtonController.cpp:
1070         (WebCore::enclosingDeletableElement):
1071         * editing/Editor.cpp:
1072         (WebCore::Editor::selectionForCommand):
1073         (WebCore::Editor::setBaseWritingDirection):
1074         (WebCore::findFirstMarkable):
1075         * editing/FrameSelection.cpp:
1076         (WebCore::FrameSelection::selectAll):
1077         (WebCore::scanForForm):
1078         * editing/InsertListCommand.cpp:
1079         (WebCore::InsertListCommand::mergeWithNeighboringLists):
1080         * editing/MarkupAccumulator.cpp:
1081         (WebCore::MarkupAccumulator::elementCannotHaveEndTag):
1082         * editing/ReplaceSelectionCommand.cpp:
1083         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
1084         (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
1085         (WebCore::ReplaceSelectionCommand::handleStyleSpans):
1086         (WebCore::ReplaceSelectionCommand::doApply):
1087         (WebCore::ReplaceSelectionCommand::insertAsListItems):
1088         * editing/TextIterator.cpp:
1089         (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
1090         (WebCore::shouldEmitExtraNewlineForNode):
1091         * editing/cocoa/HTMLConverter.mm:
1092         (HTMLConverter::_addTableCellForElement):
1093         (HTMLConverter::_processElement):
1094         * editing/htmlediting.cpp:
1095         (WebCore::enclosingList):
1096         (WebCore::embeddedSublist):
1097         (WebCore::appendedSublist):
1098         * editing/ios/EditorIOS.mm:
1099         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
1100         * editing/mac/EditorMac.mm:
1101         (WebCore::maybeCopyNodeAttributesToFragment):
1102         * editing/markup.cpp:
1103         (WebCore::StyledMarkupAccumulator::appendElement):
1104         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
1105         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
1106         * html/ColorInputType.cpp:
1107         (WebCore::ColorInputType::shadowColorSwatch):
1108         * html/HTMLBodyElement.cpp:
1109         (WebCore::HTMLBodyElement::insertedInto):
1110         * html/HTMLCollection.cpp:
1111         (WebCore::HTMLCollection::namedItem):
1112         (WebCore::HTMLCollection::updateNamedElementCache):
1113         * html/HTMLElement.cpp:
1114         (WebCore::HTMLElement::matchesReadWritePseudoClass):
1115         (WebCore::HTMLElement::setOuterHTML):
1116         (WebCore::elementAffectsDirectionality):
1117         (WebCore::HTMLElement::directionality):
1118         (WebCore::HTMLElement::dirAttributeChanged):
1119         * html/HTMLElement.h:
1120         (WebCore::isHTMLElement):
1121         (WebCore::Node::hasTagName):
1122         * html/HTMLFormElement.cpp:
1123         (WebCore::HTMLFormElement::getNamedElements):
1124         * html/HTMLFrameElementBase.h:
1125         (WebCore::isHTMLFrameElementBase):
1126         * html/HTMLFrameOwnerElement.h:
1127         (WebCore::isHTMLFrameOwnerElement):
1128         * html/HTMLMediaElement.h:
1129         (WebCore::isHTMLMediaElement):
1130         * html/HTMLOptionElement.cpp:
1131         (WebCore::HTMLOptionElement::isDisabledFormControl):
1132         * html/HTMLPlugInElement.h:
1133         (WebCore::isHTMLPlugInElement):
1134         * html/HTMLPlugInImageElement.cpp:
1135         (WebCore::addPlugInsFromNodeListMatchingPlugInOrigin):
1136         * html/HTMLPlugInImageElement.h:
1137         (WebCore::isHTMLPlugInImageElement):
1138         * html/HTMLSelectElement.cpp:
1139         (WebCore::HTMLSelectElement::setOption):
1140         (WebCore::HTMLSelectElement::setLength):
1141         (WebCore::HTMLSelectElement::recalcListItems):
1142         * html/HTMLSourceElement.cpp:
1143         (WebCore::HTMLSourceElement::insertedInto):
1144         (WebCore::HTMLSourceElement::removedFrom):
1145         * html/HTMLTableCellElement.cpp:
1146         (WebCore::HTMLTableCellElement::cellAbove):
1147         * html/HTMLTableCellElement.h:
1148         (WebCore::isHTMLTableCellElement):
1149         * html/HTMLTableElement.cpp:
1150         (WebCore::HTMLTableElement::tHead):
1151         (WebCore::HTMLTableElement::tFoot):
1152         (WebCore::HTMLTableElement::lastBody):
1153         * html/HTMLTableRowElement.cpp:
1154         (WebCore::HTMLTableRowElement::rowIndex):
1155         * html/HTMLTableRowsCollection.cpp:
1156         (WebCore::isInSection):
1157         * html/HTMLTableSectionElement.h:
1158         (WebCore::isHTMLTableSectionElement):
1159         * html/HTMLTagNames.in:
1160         * html/HTMLTextFormControlElement.cpp:
1161         (WebCore::enclosingTextFormControl):
1162         * html/HTMLTextFormControlElement.h:
1163         (WebCore::isHTMLTextFormControlElement):
1164         * html/HTMLTrackElement.cpp:
1165         (WebCore::HTMLTrackElement::removedFrom):
1166         (WebCore::HTMLTrackElement::mediaElement):
1167         * html/LabelableElement.h:
1168         (WebCore::isLabelableElement):
1169         * html/RangeInputType.cpp:
1170         (WebCore::RangeInputType::sliderTrackElement):
1171         * html/shadow/MediaControlElementTypes.cpp:
1172         (WebCore::parentMediaElement):
1173         (WebCore::mediaControlElementType):
1174         * html/shadow/TextControlInnerElements.h:
1175         (WebCore::isTextControlInnerTextElement):
1176         * inspector/InspectorDOMAgent.cpp:
1177         (WebCore::InspectorDOMAgent::buildObjectForNode):
1178         * inspector/InspectorNodeFinder.cpp:
1179         (WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
1180         * loader/SubframeLoader.cpp:
1181         (WebCore::SubframeLoader::loadSubframe):
1182         * loader/archive/cf/LegacyWebArchive.cpp:
1183         (WebCore::LegacyWebArchive::create):
1184         * mathml/MathMLElement.cpp:
1185         (WebCore::MathMLElement::isPhrasingContent):
1186         (WebCore::MathMLElement::isFlowContent):
1187         (WebCore::MathMLElement::childShouldCreateRenderer):
1188         * mathml/mathtags.in:
1189         * page/DragController.cpp:
1190         (WebCore::DragController::canProcessDrag):
1191         * page/EventHandler.cpp:
1192         (WebCore::targetIsFrame):
1193         * page/FocusController.cpp:
1194         (WebCore::hasCustomFocusLogic):
1195         (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
1196         (WebCore::FocusController::advanceFocusInDocumentOrder):
1197         * page/Frame.cpp:
1198         (WebCore::Frame::searchForLabelsBeforeElement):
1199         * page/FrameView.cpp:
1200         (WebCore::FrameView::init):
1201         (WebCore::FrameView::addEmbeddedObjectToUpdate):
1202         (WebCore::FrameView::updateEmbeddedObject):
1203         * page/PageSerializer.cpp:
1204         (WebCore::isCharsetSpecifyingNode):
1205         (WebCore::SerializerMarkupAccumulator::appendCustomAttributes):
1206         * page/SpatialNavigation.cpp:
1207         (WebCore::frameOwnerElement):
1208         * rendering/HitTestResult.cpp:
1209         (WebCore::HitTestResult::absolutePDFURL):
1210         (WebCore::HitTestResult::mediaElement):
1211         * rendering/RenderBlockFlow.cpp:
1212         (WebCore::resizeTextPermitted):
1213         * rendering/RenderEmbeddedObject.cpp:
1214         (WebCore::RenderEmbeddedObject::paintContents):
1215         (WebCore::RenderEmbeddedObject::layout):
1216         (WebCore::RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent):
1217         * rendering/RenderLayer.cpp:
1218         (WebCore::RenderLayer::scrollRectToVisible):
1219         (WebCore::RenderLayer::updateSnapOffsets):
1220         * rendering/RenderLayerBacking.cpp:
1221         (WebCore::RenderLayerBacking::updateConfiguration):
1222         (WebCore::isRestartedPlugin):
1223         * rendering/RenderMedia.h:
1224         (WebCore::RenderMedia::mediaElement):
1225         * rendering/RenderObject.cpp:
1226         (WebCore::RenderObject::offsetParent):
1227         * rendering/RenderSnapshottedPlugIn.cpp:
1228         (WebCore::RenderSnapshottedPlugIn::plugInImageElement):
1229         * rendering/RenderTableCell.cpp:
1230         (WebCore::RenderTableCell::parseColSpanFromDOM):
1231         (WebCore::RenderTableCell::parseRowSpanFromDOM):
1232         * rendering/RenderTextControl.cpp:
1233         (WebCore::RenderTextControl::textFormControlElement):
1234         * rendering/RenderThemeGtk.cpp:
1235         (WebCore::getMediaElementFromRenderObject):
1236         * rendering/RenderThemeMac.mm:
1237         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1238         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
1239         * rendering/RenderTreeAsText.cpp:
1240         (WebCore::isEmptyOrUnstyledAppleStyleSpan):
1241         * rendering/RenderWidget.h:
1242         (WebCore::RenderWidget::frameOwnerElement):
1243         * testing/Internals.cpp:
1244         (WebCore::Internals::visiblePlaceholder):
1245         (WebCore::Internals::simulateAudioInterruption):
1246         (WebCore::Internals::isPluginSnapshotted):
1247         * xml/XPathStep.cpp:
1248         (WebCore::XPath::nodeMatchesBasicTest):
1249
1250 2014-09-26  Joseph Pecoraro  <pecoraro@apple.com>
1251
1252         Web Inspector: Automatic Inspection should continue once all breakpoints are loaded
1253         https://bugs.webkit.org/show_bug.cgi?id=137038
1254
1255         Reviewed by Timothy Hatcher.
1256
1257         Handle frontend initialization messages even though pages cannot
1258         be automatically inspected yet.
1259
1260         * inspector/InspectorController.cpp:
1261         (WebCore::InspectorController::InspectorController):
1262         (WebCore::InspectorController::connectFrontend):
1263         (WebCore::InspectorController::disconnectFrontend):
1264         (WebCore::InspectorController::frontendInitialized):
1265         * inspector/InspectorController.h:
1266         * inspector/WorkerInspectorController.h:
1267         * page/Page.h:
1268         (WebCore::Page::inspectorDebuggable):
1269
1270 2014-09-26  David Kilzer  <ddkilzer@apple.com>
1271
1272         REGRESSION (r173988): Fix unused variable warning in PDFDocumentImage.cpp
1273
1274         Fixes the following build failure in release builds:
1275
1276             WebCore/platform/graphics/cg/PDFDocumentImage.cpp:230:12: error: unused variable 'pageCount' [-Werror,-Wunused-variable]
1277
1278         * platform/graphics/cg/PDFDocumentImage.cpp:
1279         (WebCore::PDFDocumentImage::computeBoundsForCurrentPage): Change
1280         ASSERT() to call pageCount().
1281
1282 2014-09-26  Brian J. Burg  <burg@cs.washington.edu>
1283
1284         StorageTracker::deleteOrigin being called off the main thread (ASSERTs in inspector/test-harness-trivially-works.html test)
1285         https://bugs.webkit.org/show_bug.cgi?id=129642
1286
1287         Apply post-review comments from Alexey Proskuryakov.
1288
1289         * storage/StorageAreaSync.cpp:
1290         (WebCore::StorageAreaSync::deleteEmptyDatabase): Make a thread-safe isolated copy of the string.
1291
1292 2014-09-26  Myles C. Maxfield  <mmaxfield@apple.com>
1293
1294         SVG -> OTF converter bug gardening
1295         https://bugs.webkit.org/show_bug.cgi?id=137088
1296
1297         Reviewed by Darin Adler.
1298
1299         This test fixes some (but not all) of the svg/ layout tests that never worked with the
1300         SVG -> OTF font converter. The actual list of tests this fixes is shown below. I will be
1301         filing bugs for the remaining issues along with the relevant tests that those issues
1302         cause to fail.
1303
1304         Tests: svg/W3C-SVG-1.1/fonts-elem-05-t.svg
1305                svg/W3C-SVG-1.1/fonts-kern-01-t.svg
1306                svg/custom/glyph-setting-d-attribute.svg
1307                svg/custom/scrolling-embedded-svg-file-image-repaint-problem.html
1308                svg/custom/skip-underline-missing-glyph.html
1309                svg/custom/svg-fonts-fallback.xhtml
1310                svg/custom/svg-fonts-in-text-controls.html
1311
1312         * svg/SVGToOTFFontConversion.cpp:
1313         (WebCore::SVGToOTFFontConverter::appendHEADTable): We use the font's minimum and maximum
1314         bounding box information to size <textarea>s and <input>s.
1315         (WebCore::SVGToOTFFontConverter::addCodepointRanges): Codepoint ranges are closed.
1316         (WebCore::SVGToOTFFontConverter::computeKerningData): Typo in appending glyphs to the
1317         wrong set.
1318         (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths): Use the font's horizontal
1319         origin if the glyph doesn't have one.
1320         (WebCore::SVGToOTFFontConverter::convertSVGToOTFFont): r173852 implemented vhea, vmtx,
1321         and kern.
1322         (WebCore::transcodeGlyphPaths): Moved inside SVGToOTFFontConverter.
1323
1324 2014-09-26  Dan Bernstein  <mitz@apple.com>
1325
1326         iOS build fix following r173989.
1327
1328         * page/ios/FrameIOS.mm:
1329         (WebCore::ancestorRespondingToClickEvents):
1330
1331 2014-09-26  Javier Fernandez  <jfernandez@igalia.com>
1332
1333         [CSS Grid Layout] Empty string case already covered by containesOnlyWhiteSpace.
1334         https://bugs.webkit.org/show_bug.cgi?id=137146
1335
1336         Reviewed by Sergio Villar Senin.
1337
1338         When checking out for white-space only strings in the grid-template-areas
1339         property values, it's not neccessary to check out for empty strings as
1340         such case is already covered.
1341
1342         No new tests, already covered by fast/css-grid-layout/grid-template-areas-empty-string-crash.html.
1343
1344         * css/CSSParser.cpp:
1345         (WebCore::CSSParser::parseGridTemplateAreasRow):
1346
1347 2014-09-23  Sergio Villar Senin  <svillar@igalia.com>
1348
1349         [CSS Grid Layout] Fix the handling of infinity in track growth limits
1350         https://bugs.webkit.org/show_bug.cgi?id=137019
1351
1352         Reviewed by Darin Adler.
1353
1354         The growth limit of content sized tracks is initialized to
1355         infinity which is internally represented as -1. We were not
1356         specialcasing this situation, and thus, -1 was used in the
1357         computations as any other value. This change makes the code aware
1358         of the existence of infinites (like when sorting tracks by growth
1359         potential or when initializing the track growth limits).
1360
1361         There was another bug related to infinities. The code that was
1362         replacing a infinite growth limit by a finite one was not using
1363         the proper indexes so the tracks that were being updated were the
1364         wrong ones.
1365
1366         Test: fast/css-grid-layout/grid-content-sized-columns-resolution.html
1367
1368         * rendering/RenderGrid.cpp:
1369         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
1370         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
1371         (WebCore::sortByGridTrackGrowthPotential):
1372         (WebCore::RenderGrid::distributeSpaceToTracks):
1373
1374 2014-09-26  Lorenzo Tilve  <ltilve@igalia.com>
1375
1376         [GTK] Fix support for the initial-letter CSS property to first-letter
1377         https://bugs.webkit.org/show_bug.cgi?id=137108
1378
1379         Reviewed by Alejandro G. Castro.
1380
1381         Add support for cap-height to the font system.
1382
1383         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1384         (WebCore::SimpleFontData::platformInit):
1385
1386 2014-09-25  Brian J. Burg  <burg@cs.washington.edu>
1387
1388         Web Inspector: FunctionCall timeline records omit profile data if the debugger has paused
1389         https://bugs.webkit.org/show_bug.cgi?id=136805
1390
1391         Reviewed by Timothy Hatcher.
1392
1393         TimelineAgent was mismanaging its call stack depth counter, which caused nested FunctionCall
1394         records to steal the parent FunctionCall's captured profile in the child's didCallFunction().
1395         Thus, the top FunctionCall node had no profile data and nested FunctionCall nodes each had
1396         their own profiles. The frontend expected just one profile, so it didn't show anything when
1397         it couldn't be found.
1398
1399         Test: inspector/timeline/debugger-paused-while-recording.html
1400
1401         * inspector/InspectorTimelineAgent.cpp: Rename m_recordingProfileDepth to m_callStackDepth.
1402         (WebCore::InspectorTimelineAgent::willCallFunction): Fix the call stack depth management.
1403         (WebCore::InspectorTimelineAgent::didCallFunction):
1404         (WebCore::InspectorTimelineAgent::willEvaluateScript):
1405         (WebCore::InspectorTimelineAgent::didEvaluateScript):
1406         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
1407         * inspector/InspectorTimelineAgent.h:
1408
1409 2014-09-25  Brian J. Burg  <burg@cs.washington.edu>
1410
1411         StorageTracker::deleteOrigin being called off the main thread (ASSERTs in inspector/test-harness-trivially-works.html test)
1412         https://bugs.webkit.org/show_bug.cgi?id=129642
1413
1414         Reviewed by Brady Eidson.
1415
1416         When tearing down the inspector frontend's page, we trigger a threading violation
1417         in StorageAreaSync's final sync code underneath StorageAreaSync::deleteEmptyDatabase().
1418
1419         No new tests. Regression is covered by inspector/test-harness-trivially-works.html.
1420
1421         * storage/StorageAreaSync.cpp:
1422         (WebCore::StorageAreaSync::deleteEmptyDatabase): add a missing callOnMainThread() when
1423         calling StorageTracker::deleteOriginWithIdentifier().
1424
1425 2014-09-25  Sungmann Cho  <sungmann.cho@navercorp.com>
1426
1427         Unprefix CSS cursor values zoom-in and zoom-out.
1428         https://bugs.webkit.org/show_bug.cgi?id=137061
1429
1430         Reviewed by Benjamin Poulain.
1431
1432         This patch unprefixes CSS cursor values zoom-in and zoom-out.
1433         -webkit-zoom-in and -webkit-zoom-out are kept as aliases.
1434         ECursor members use InterCaps with an initial capital letter for now.
1435
1436         * css/CSSParser.cpp:
1437         (WebCore::CSSParser::parseValue):
1438         * css/CSSPrimitiveValueMappings.h:
1439         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1440         (WebCore::CSSPrimitiveValue::operator ECursor):
1441         * css/CSSValueKeywords.in:
1442         * css/DeprecatedStyleBuilder.cpp:
1443         (WebCore::ApplyPropertyCursor::applyValue):
1444         * html/ImageDocument.cpp:
1445         (WebCore::ImageDocument::resizeImageToFit):
1446         (WebCore::ImageDocument::restoreImageSize):
1447         (WebCore::ImageDocument::windowSizeChanged):
1448         * page/EventHandler.cpp:
1449         (WebCore::EventHandler::selectCursor):
1450         * rendering/style/RenderStyle.h:
1451         * rendering/style/RenderStyleConstants.h:
1452
1453 2014-09-25  Brent Fulgham  <bfulgham@apple.com>
1454
1455         [Win] Debug builds of TestWebKitAPI are crashing.
1456         https://bugs.webkit.org/show_bug.cgi?id=133553
1457
1458         Reviewed by Dean Jackson.
1459
1460         Avoid crash on shutdown due to invalid mutex state in the
1461         HashMap debug implementation during a static destruction operation.
1462
1463         * dom/Node.cpp:
1464         (WebCore::ignoreSet): Convert static value into a NeverDestroyed.
1465         (WebCore::Node::trackForDebugging): Use new NeverDestroyed call.
1466         (WebCore::Node::~Node): Ditto.
1467
1468 2014-09-25  Christophe Dumez  <cdumez@apple.com>
1469
1470         Add support for is<SVGDocument>() / downcast<SVGDocument>()
1471         https://bugs.webkit.org/show_bug.cgi?id=137128
1472
1473         Reviewed by Ryosuke Niwa.
1474
1475         Add support for is<SVGDocument>() / downcast<SVGDocument>() by using
1476         the SPECIALIZE_TYPE_TRAITS_*() macro, instead of the
1477         DOCUMENT_TYPE_CASTS() one.
1478
1479         No new tests, no behavior change.
1480
1481         * accessibility/AccessibilityRenderObject.cpp:
1482         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
1483         * html/HTMLFrameOwnerElement.cpp:
1484         (WebCore::HTMLFrameOwnerElement::getSVGDocument):
1485         * page/EventHandler.cpp:
1486         (WebCore::EventHandler::handleMousePressEvent):
1487         (WebCore::EventHandler::handleMouseMoveEvent):
1488         (WebCore::EventHandler::handleMouseReleaseEvent):
1489         * page/Frame.cpp:
1490         (WebCore::Frame::setPageAndTextZoomFactors):
1491         * page/FrameView.cpp:
1492         (WebCore::FrameView::scrollToAnchor):
1493         * svg/SVGDocument.h:
1494         (WebCore::isSVGDocument):
1495         * svg/graphics/SVGImage.cpp:
1496         (WebCore::SVGImage::hasSingleSecurityOrigin):
1497         (WebCore::SVGImage::setContainerSize):
1498         (WebCore::SVGImage::containerSize):
1499         (WebCore::SVGImage::embeddedContentBox):
1500         (WebCore::SVGImage::hasRelativeWidth):
1501         (WebCore::SVGImage::hasRelativeHeight):
1502         (WebCore::SVGImage::computeIntrinsicDimensions):
1503         (WebCore::SVGImage::startAnimation):
1504         (WebCore::SVGImage::stopAnimation):
1505
1506 2014-09-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
1507
1508         Rename CSSKeyframesRule insertRule to appendRule (57910)
1509         https://bugs.webkit.org/show_bug.cgi?id=57910
1510
1511         Reviewed by Dean Jackson.
1512
1513         Tests: animations/change-keyframes.html
1514
1515         * css/WebKitCSSKeyframesRule.h:
1516         (WebCore::WebKitCSSKeyframesRule::appendRule):
1517         -- Make WebKitCSSKeyframesRule::appendRule to be an alias of WebKitCSSKeyframesRule::insertRule()
1518            to conform with CSS specs
1519         * css/WebKitCSSKeyframesRule.idl:
1520         -- Add the new method WebKitCSSKeyframesRule::appendRule() but keep the original method
1521            WebKitCSSKeyframesRule::appendRule() to not break exiting customers' pages.
1522
1523 2014-09-25  Tim Horton  <timothy_horton@apple.com>
1524
1525         Null deref in setStateScrollingNodeSnapOffsetsAsFloat
1526         https://bugs.webkit.org/show_bug.cgi?id=137133
1527         <rdar://problem/18447820>
1528
1529         Reviewed by Beth Dakin.
1530
1531         * page/scrolling/AsyncScrollingCoordinator.cpp:
1532         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1533         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
1534         Get the deviceScaleFactor from m_page instead of various other places,
1535         because scrolledContentsLayer can be null in the case of non-composited
1536         overflow scroll.
1537
1538 2014-09-25  Christophe Dumez  <cdumez@apple.com>
1539
1540         Use is<HTML*Element>() instead of isHTML*Element() - Part 2
1541         https://bugs.webkit.org/show_bug.cgi?id=137103
1542
1543         Reviewed by Benjamin Poulain.
1544
1545         Use is<HTML*Element>() instead of isHTML*Element() and drop support for
1546         the generated isHTML*Element() macros.
1547
1548         No new tests, no behavior change.
1549
1550         * accessibility/AXObjectCache.cpp:
1551         (WebCore::AXObjectCache::focusedUIElementForPage):
1552         (WebCore::AXObjectCache::getOrCreate):
1553         (WebCore::AXObjectCache::handleAttributeChanged):
1554         (WebCore::AXObjectCache::labelChanged):
1555         * accessibility/AccessibilityListBoxOption.cpp:
1556         (WebCore::AccessibilityListBoxOption::isEnabled):
1557         (WebCore::AccessibilityListBoxOption::stringValue):
1558         (WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
1559         * accessibility/AccessibilityNodeObject.cpp:
1560         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
1561         (WebCore::AccessibilityNodeObject::isNativeImage):
1562         (WebCore::AccessibilityNodeObject::anchorElement):
1563         (WebCore::AccessibilityNodeObject::alternativeText):
1564         * accessibility/AccessibilityRenderObject.cpp:
1565         (WebCore::AccessibilityRenderObject::anchorElement):
1566         (WebCore::AccessibilityRenderObject::labelElementContainer):
1567         (WebCore::AccessibilityRenderObject::internalLinkElement):
1568         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1569         (WebCore::AccessibilityRenderObject::url):
1570         (WebCore::AccessibilityRenderObject::getDocumentLinks):
1571         (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
1572         (WebCore::AccessibilityRenderObject::accessibilityHitTest):
1573         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1574         (WebCore::AccessibilityRenderObject::stringValueForMSAA):
1575         (WebCore::AccessibilityRenderObject::isLinked):
1576         * accessibility/AccessibilityTable.cpp:
1577         (WebCore::AccessibilityTable::tableElement):
1578         (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
1579         (WebCore::AccessibilityTable::title):
1580         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
1581         (webkitAccessibleTableGetCaption):
1582         * bindings/js/JSHTMLDocumentCustom.cpp:
1583         (WebCore::JSHTMLDocument::nameGetter):
1584         * bindings/js/JSNodeCustom.cpp:
1585         (WebCore::isReachableFromDOM):
1586         * css/CSSDefaultStyleSheets.cpp:
1587         (WebCore::elementCanUseSimpleDefaultStyle):
1588         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
1589         * css/CSSStyleSheet.cpp:
1590         (WebCore::isAcceptableCSSStyleSheetParent):
1591         * css/StyleResolver.cpp:
1592         (WebCore::StyleResolver::adjustRenderStyle):
1593         * css/StyleSheetList.cpp:
1594         (WebCore::StyleSheetList::getNamedItem):
1595         * dom/CurrentScriptIncrementer.h:
1596         (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
1597         * dom/DataTransfer.cpp:
1598         (WebCore::DataTransfer::setDragImage):
1599         * dom/DocumentOrderedMap.cpp:
1600         (WebCore::keyMatchesMapName):
1601         (WebCore::keyMatchesLowercasedMapName):
1602         (WebCore::keyMatchesLowercasedUsemap):
1603         (WebCore::keyMatchesLabelForAttribute):
1604         * dom/DocumentStyleSheetCollection.cpp:
1605         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
1606         * dom/Node.cpp:
1607         (WebCore::Node::enclosingLinkEventParentOrSelf):
1608         * dom/Position.cpp:
1609         (WebCore::endsOfNodeAreVisuallyDistinctPositions):
1610         * dom/ScriptElement.cpp:
1611         (WebCore::toScriptElementIfPossible):
1612         * dom/VisitedLinkState.cpp:
1613         (WebCore::linkHashForElement):
1614         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
1615         * dom/make_names.pl:
1616         (printTypeHelpers):
1617         * editing/DeleteSelectionCommand.cpp:
1618         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
1619         * editing/Editor.cpp:
1620         (WebCore::imageElementFromImageDocument):
1621         * editing/FrameSelection.cpp:
1622         (WebCore::scanForForm):
1623         * editing/InsertLineBreakCommand.cpp:
1624         (WebCore::InsertLineBreakCommand::doApply):
1625         * editing/InsertParagraphSeparatorCommand.cpp:
1626         (WebCore::InsertParagraphSeparatorCommand::doApply):
1627         * editing/ReplaceSelectionCommand.cpp:
1628         (WebCore::removeHeadContents):
1629         * editing/cocoa/HTMLConverter.mm:
1630         (HTMLConverter::_processElement):
1631         * editing/htmlediting.cpp:
1632         (WebCore::isNonTableCellHTMLBlockElement):
1633         * editing/markup.cpp:
1634         (WebCore::ancestorToRetainStructureAndAppearanceForBlock):
1635         (WebCore::collectElementsToRemoveFromFragment):
1636         * html/FTPDirectoryDocument.cpp:
1637         (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
1638         * html/FormAssociatedElement.cpp:
1639         (WebCore::FormAssociatedElement::findAssociatedForm):
1640         * html/HTMLAnchorElement.cpp:
1641         (WebCore::appendServerMapMousePosition):
1642         * html/HTMLAreaElement.cpp:
1643         (WebCore::HTMLAreaElement::imageElement):
1644         * html/HTMLDocument.cpp:
1645         (WebCore::HTMLDocument::bgColor):
1646         (WebCore::HTMLDocument::setBgColor):
1647         (WebCore::HTMLDocument::fgColor):
1648         (WebCore::HTMLDocument::setFgColor):
1649         (WebCore::HTMLDocument::alinkColor):
1650         (WebCore::HTMLDocument::setAlinkColor):
1651         (WebCore::HTMLDocument::linkColor):
1652         (WebCore::HTMLDocument::setLinkColor):
1653         (WebCore::HTMLDocument::vlinkColor):
1654         (WebCore::HTMLDocument::setVlinkColor):
1655         (WebCore::HTMLDocument::isFrameSet):
1656         * html/HTMLElement.cpp:
1657         (WebCore::HTMLElement::setInnerHTML):
1658         * html/HTMLFieldSetElement.cpp:
1659         (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
1660         (WebCore::HTMLFieldSetElement::disabledStateChanged):
1661         * html/HTMLFormControlElement.cpp:
1662         (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor):
1663         * html/HTMLFormControlsCollection.cpp:
1664         (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
1665         (WebCore::HTMLFormControlsCollection::formControlElements):
1666         (WebCore::HTMLFormControlsCollection::formImageElements):
1667         (WebCore::HTMLFormControlsCollection::namedItem):
1668         (WebCore::HTMLFormControlsCollection::updateNamedElementCache):
1669         * html/HTMLFormElement.cpp:
1670         (WebCore::HTMLFormElement::rendererIsNeeded):
1671         * html/HTMLFrameElementBase.h:
1672         (WebCore::isHTMLFrameElementBase):
1673         * html/HTMLImageLoader.cpp:
1674         (WebCore::HTMLImageLoader::dispatchLoadEvent):
1675         * html/HTMLInputElement.cpp:
1676         (WebCore::HTMLInputElement::dataList):
1677         * html/HTMLLegendElement.cpp:
1678         (WebCore::HTMLLegendElement::virtualForm):
1679         * html/HTMLMediaElement.cpp:
1680         (WebCore::HTMLMediaElement::parseAttribute):
1681         * html/HTMLNameCollection.cpp:
1682         (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch):
1683         (WebCore::DocumentNameCollection::elementMatches):
1684         * html/HTMLOptionElement.cpp:
1685         (WebCore::HTMLOptionElement::ownerDataListElement):
1686         (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel):
1687         (WebCore::HTMLOptionElement::isDisabledFormControl):
1688         * html/HTMLSelectElement.cpp:
1689         (WebCore::HTMLSelectElement::recalcListItems):
1690         * html/HTMLTableElement.cpp:
1691         (WebCore::HTMLTableElement::caption):
1692         * html/HTMLTablePartElement.cpp:
1693         (WebCore::HTMLTablePartElement::findParentTable):
1694         * html/HTMLTableRowElement.cpp:
1695         (WebCore::HTMLTableRowElement::rowIndex):
1696         * html/HTMLTableRowsCollection.cpp:
1697         (WebCore::HTMLTableRowsCollection::rowAfter):
1698         (WebCore::HTMLTableRowsCollection::lastRow):
1699         * html/HTMLTagNames.in:
1700         * html/LabelsNodeList.cpp:
1701         (WebCore::LabelsNodeList::elementMatches):
1702         * html/MediaDocument.cpp:
1703         (WebCore::descendentVideoElement):
1704         (WebCore::ancestorVideoElement):
1705         * html/RadioInputType.cpp:
1706         (WebCore::RadioInputType::handleKeydownEvent):
1707         * html/RadioNodeList.cpp:
1708         (WebCore::RadioNodeList::RadioNodeList):
1709         (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter):
1710         * html/parser/HTMLConstructionSite.cpp:
1711         (WebCore::hasImpliedEndTag):
1712         (WebCore::insert):
1713         (WebCore::HTMLConstructionSite::insertHTMLFormElement):
1714         (WebCore::HTMLConstructionSite::insertTextNode):
1715         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
1716         * html/parser/HTMLElementStack.cpp:
1717         (WebCore::HTMLNames::isScopeMarker):
1718         (WebCore::HTMLNames::isTableScopeMarker):
1719         * html/parser/HTMLTreeBuilder.cpp:
1720         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
1721         (WebCore::HTMLTreeBuilder::processStartTag):
1722         (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
1723         (WebCore::HTMLTreeBuilder::processEndTag):
1724         (WebCore::HTMLTreeBuilder::processCharacterBuffer):
1725         * inspector/InspectorDOMAgent.cpp:
1726         (WebCore::InspectorDOMAgent::buildObjectForNode):
1727         * inspector/InspectorStyleSheet.cpp:
1728         (WebCore::InspectorStyleSheet::inlineStyleSheetText):
1729         * page/DragController.cpp:
1730         (WebCore::DragController::draggableElement):
1731         * page/FocusController.cpp:
1732         (WebCore::FocusController::advanceFocusDirectionally):
1733         * page/PageSerializer.cpp:
1734         (WebCore::PageSerializer::serializeFrame):
1735         * page/SpatialNavigation.cpp:
1736         (WebCore::FocusCandidate::FocusCandidate):
1737         (WebCore::areElementsOnSameLine):
1738         * page/ios/FrameIOS.mm:
1739         (WebCore::ancestorRespondingToClickEvents):
1740         * rendering/HitTestResult.cpp:
1741         (WebCore::HitTestResult::altDisplayString):
1742         (WebCore::HitTestResult::mediaSupportsFullscreen):
1743         (WebCore::HitTestResult::mediaElement):
1744         (WebCore::HitTestResult::enterFullscreenForVideo):
1745         (WebCore::HitTestResult::mediaIsVideo):
1746         (WebCore::HitTestResult::isLiveLink):
1747         * rendering/RenderCounter.cpp:
1748         (WebCore::planCounter):
1749         * rendering/RenderImage.cpp:
1750         (WebCore::RenderImage::RenderImage):
1751         (WebCore::RenderImage::paintAreaElementFocusRing):
1752         (WebCore::RenderImage::paintIntoRect):
1753         (WebCore::RenderImage::imageMap):
1754         (WebCore::RenderImage::updateAltText):
1755         * rendering/RenderListBox.cpp:
1756         (WebCore::RenderListBox::updateFromElement):
1757         (WebCore::RenderListBox::paintItemForeground):
1758         * rendering/RenderMarquee.cpp:
1759         (WebCore::RenderMarquee::marqueeSpeed):
1760         * rendering/RenderMenuList.cpp:
1761         (RenderMenuList::itemText):
1762         (RenderMenuList::itemIsEnabled):
1763         (RenderMenuList::itemIsLabel):
1764         * rendering/RenderMeter.cpp:
1765         (WebCore::RenderMeter::meterElement):
1766         * rendering/RenderObject.cpp:
1767         (WebCore::RenderObject::shouldRespectImageOrientation):
1768         (WebCore::RenderObject::getTextDecorationColors):
1769         (WebCore::RenderObject::offsetParent):
1770         * rendering/RenderProgress.cpp:
1771         (WebCore::RenderProgress::progressElement):
1772         * rendering/RenderTable.cpp:
1773         (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
1774         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
1775         * svg/graphics/SVGImageCache.cpp:
1776         (WebCore::SVGImageCache::imageForRenderer):
1777         * testing/Internals.cpp:
1778         (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks):
1779         * xml/parser/XMLDocumentParserLibxml2.cpp:
1780         (WebCore::XMLDocumentParser::startElementNs):
1781
1782 2014-09-25  Brian J. Burg  <burg@cs.washington.edu>
1783
1784         Web Replay: Check event loop input extents during replay too
1785         https://bugs.webkit.org/show_bug.cgi?id=136316
1786
1787         Reviewed by Timothy Hatcher.
1788
1789         Sometimes we see different nondeterminism during capture and replay
1790         executions, so we should support determinism checks during replay too.
1791
1792         Move the withinEventLoopInputExtent flag to the base class.
1793
1794         No new tests, no behavior changed.
1795
1796         * replay/CapturingInputCursor.cpp:
1797         (WebCore::CapturingInputCursor::CapturingInputCursor):
1798         (WebCore::CapturingInputCursor::setWithinEventLoopInputExtent): Deleted.
1799         * replay/CapturingInputCursor.h:
1800         * replay/EventLoopInput.cpp:
1801         (WebCore::EventLoopInputExtent::EventLoopInputExtent):
1802         (WebCore::EventLoopInputExtent::~EventLoopInputExtent):
1803         Make m_cursor a pointer and add a new constructor so we can conditionally
1804         enter event loop input extents. This is useful in some network replay situations.
1805
1806         * replay/EventLoopInput.h:
1807         * replay/ReplayController.cpp:
1808         (WebCore::ReplayController::willDispatchEvent): Expand the assertion to include replaying.
1809
1810 2014-09-25  Jeremy Jones  <jeremyj@apple.com>
1811
1812         Race in ref pointer for WebVideoFullscreenInterfaceAVKit.
1813         https://bugs.webkit.org/show_bug.cgi?id=137123
1814
1815         Reviewed by Eric Carlson.
1816
1817         Add WebThreadRun to prevent race with RefPtr of WebVideoFullscreenInterfaceAVKit.
1818
1819         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1820         (-[WebVideoFullscreenController didSetupFullscreen]): add WebThreadRun
1821         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1822         (WebVideoFullscreenInterfaceAVKit::setDuration): ditto
1823         (WebVideoFullscreenInterfaceAVKit::setCurrentTime): ditto
1824         (WebVideoFullscreenInterfaceAVKit::setRate): ditto
1825         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions): ditto
1826         (WebVideoFullscreenInterfaceAVKit::setSeekableRanges): ditto
1827         (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): ditto
1828         (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): ditto
1829         (WebVideoFullscreenInterfaceAVKit::setExternalPlayback): ditto
1830         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): ditto
1831         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): ditto
1832         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): ditto
1833         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen): ditto
1834         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): ditto
1835
1836 2014-09-25  Chris Dumez  <cdumez@apple.com>
1837
1838         Unreviewed iOS build fix after r173944.
1839
1840         Add a missing header include.
1841         See <rdar://problem/18454708> for more details.
1842
1843         * html/parser/HTMLTreeBuilder.cpp:
1844
1845 2014-09-25  Christophe Dumez  <cdumez@apple.com>
1846
1847         Stop using legacy NODE_TYPE_CASTS() macro in svg/
1848         https://bugs.webkit.org/show_bug.cgi?id=137106
1849
1850         Reviewed by Ryosuke Niwa.
1851
1852         Stop using legacy NODE_TYPE_CASTS() in svg/ and use the new
1853         SPECIALIZE_TYPE_TRAITS_*() macro instead so that is<>() / downcast<>()
1854         can be used for those types.
1855
1856         No new tests, no behavior change.
1857
1858         * css/CSSComputedStyleDeclaration.cpp:
1859         (WebCore::ComputedStyleExtractor::propertyValue):
1860         * dom/Element.h:
1861         * dom/Node.h:
1862         (WebCore::is):
1863         * dom/make_names.pl:
1864         (printTypeHelpers):
1865         * html/HTMLElement.h:
1866         * html/HTMLMediaElement.h:
1867         * html/HTMLPlugInImageElement.h:
1868         * html/LabelableElement.h:
1869         * mathml/MathMLElement.h:
1870         Rename NodeTypeCastTraits::is() to NodeTypeCastTraits::isType() to
1871         avoid naming conflict with the global is<>() function. This was an
1872         issue when is<>() was called from one of the template specializations.
1873
1874         * rendering/svg/RenderSVGBlock.h:
1875         (WebCore::RenderSVGBlock::graphicsElement):
1876         * rendering/svg/RenderSVGGradientStop.cpp:
1877         (WebCore::RenderSVGGradientStop::gradientElement):
1878         * rendering/svg/RenderSVGInline.h:
1879         (WebCore::RenderSVGInline::graphicsElement):
1880         * rendering/svg/RenderSVGResourceClipper.cpp:
1881         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
1882         * rendering/svg/RenderSVGResourceContainer.cpp:
1883         (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke):
1884         * rendering/svg/RenderSVGShape.h:
1885         (WebCore::RenderSVGShape::graphicsElement):
1886         * rendering/svg/RenderSVGTransformableContainer.h:
1887         * rendering/svg/SVGRenderSupport.cpp:
1888         (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
1889         * rendering/svg/SVGRenderTreeAsText.cpp:
1890         (WebCore::operator<<):
1891         * rendering/svg/SVGRenderingContext.cpp:
1892         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1893         * rendering/svg/SVGResources.cpp:
1894         (WebCore::targetReferenceFromResource):
1895         * svg/SVGAElement.cpp:
1896         (WebCore::SVGAElement::defaultEventHandler):
1897         * svg/SVGAnimateElement.cpp:
1898         (WebCore::SVGAnimateElement::calculateAnimatedValue):
1899         (WebCore::isSVGAnimateElement): Deleted.
1900         Use is<>() / downcast<>() where appropriate.
1901
1902         * svg/SVGAnimateElement.h:
1903         (WebCore::isSVGAnimateElement):
1904         Use SPECIALIZE_TYPE_TRAITS_*() instead of NODE_TYPE_CASTS() and add
1905         overload for isSVGAnimateElement() taking an SVGElement in argument to
1906         bypass the is<SVGElement>() check when the input type is an SVGElement.
1907
1908         * svg/SVGAnimationElement.cpp:
1909         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
1910         * svg/SVGElement.cpp:
1911         (WebCore::SVGElement::getBoundingBox):
1912         Use is<>() / downcast<>() where appropriate.
1913
1914         * svg/SVGElement.h:
1915         * svg/SVGFilterPrimitiveStandardAttributes.h:
1916         Use SPECIALIZE_TYPE_TRAITS_*() instead of NODE_TYPE_CASTS() and drop
1917         the pre-existing NodeTypeCastTraits template specialization as it is
1918         now generated by the macro.
1919
1920         * svg/SVGGradientElement.cpp:
1921         (WebCore::isSVGGradientElement): Deleted.
1922         * svg/SVGGradientElement.h:
1923         (WebCore::isSVGGradientElement):
1924         Use SPECIALIZE_TYPE_TRAITS_*() instead of NODE_TYPE_CASTS() and add
1925         overload for isSVGAnimateElement() taking an SVGElement in argument to
1926         bypass the is<SVGElement>() check when the input type is an SVGElement.
1927
1928         * svg/SVGGraphicsElement.h:
1929         (WebCore::isSVGGraphicsElement):
1930         Use SPECIALIZE_TYPE_TRAITS_*() instead of NODE_TYPE_CASTS().
1931
1932         * svg/SVGLinearGradientElement.cpp:
1933         (WebCore::SVGLinearGradientElement::collectGradientAttributes):
1934         * svg/SVGLocatable.cpp:
1935         (WebCore::SVGLocatable::getTransformToElement):
1936         * svg/SVGPolyElement.cpp:
1937         (WebCore::SVGPolyElement::synchronizePoints):
1938         (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
1939         (WebCore::isSVGPolyElement): Deleted.
1940         Use is<>() / downcast<>() where appropriate.
1941
1942         * svg/SVGPolyElement.h:
1943         (WebCore::isSVGPolyElement):
1944         Use SPECIALIZE_TYPE_TRAITS_*() instead of NODE_TYPE_CASTS() and add
1945         overload for isPolyElement() taking an SVGElement in argument to
1946         bypass the is<SVGElement>() check when the input type is an SVGElement.
1947
1948         * svg/SVGRadialGradientElement.cpp:
1949         (WebCore::SVGRadialGradientElement::collectGradientAttributes):
1950         * svg/SVGTextContentElement.cpp:
1951         (WebCore::SVGTextContentElement::synchronizeTextLength):
1952         (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
1953         (WebCore::SVGTextContentElement::elementFromRenderer):
1954         Use is<>() / downcast<>() where appropriate.
1955
1956         * svg/SVGTextContentElement.h:
1957         WebCore::isSVGTextContentElement):
1958         Use SPECIALIZE_TYPE_TRAITS_*() instead of NODE_TYPE_CASTS().
1959
1960         * svg/SVGUseElement.cpp:
1961         (WebCore::SVGUseElement::toClipPath):
1962         Use is<>() / downcast<>() where appropriate. Also use tighter typing
1963         for value returned by shadowTreeElement().
1964
1965         * svg/animation/SVGSMILElement.cpp:
1966         (WebCore::SVGSMILElement::buildPendingResource):
1967         (WebCore::SVGSMILElement::connectConditions):
1968         (WebCore::SVGSMILElement::disconnectConditions):
1969         Use is<>() / downcast<>() where appropriate.
1970
1971         * svg/animation/SVGSMILElement.h:
1972         (WebCore::isSVGSMILElement):
1973         Use SPECIALIZE_TYPE_TRAITS_*() instead of NODE_TYPE_CASTS() and drop
1974         the pre-existing NodeTypeCastTraits template specialization as it is
1975         now generated by the macro.
1976
1977 2014-09-25  Brent Fulgham  <bfulgham@apple.com>
1978
1979         Minor refactoring to mediaType/presentationType
1980         https://bugs.webkit.org/show_bug.cgi?id=137085
1981
1982         Reviewed by Eric Carlson.
1983
1984         Add overloads for presentationType for the audio and video
1985         HTML elements so that we don't have to explicity check the
1986         tag name (via string comparison) to identify the type of
1987         element.
1988
1989         No new tests. Should create no change in behavior.
1990
1991         * html/HTMLAudioElement.h: Overload presentationType to always
1992         indicate audio type.
1993         * html/HTMLMediaElement.cpp:
1994         (WebCore::HTMLMediaElement::mediaType): Use the presentationType
1995         method implementation, rather than duplicating that code.
1996         * html/HTMLVideoElement.h: Overload presentationType to always
1997         return video type.
1998
1999 2014-09-25  Javier Fernandez  <jfernandez@igalia.com>
2000
2001         ASSERTION FAILED: columnCount in WebCore::CSSParser::parseGridTemplateAreasRow
2002         https://bugs.webkit.org/show_bug.cgi?id=136945
2003
2004         Reviewed by Sergio Villar Senin.
2005
2006         Checking out whether the grid-template-areas value contains a white-space only
2007         string, which is not valid as it does not produce a cell token.
2008
2009         Test: fast/css-grid-layout/grid-template-areas-empty-string-crash.html
2010
2011         * css/CSSParser.cpp:
2012         (WebCore::CSSParser::parseGridTemplateAreasRow):
2013
2014 2014-09-25  Csaba Osztrogon√°c  <ossy@webkit.org>
2015
2016         Remove WinCE port from trunk
2017         https://bugs.webkit.org/show_bug.cgi?id=136951
2018
2019         Reviewed by Alex Christensen.
2020
2021         * Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp:
2022         * PlatformWinCE.cmake: Removed.
2023         * accessibility/AXObjectCache.cpp:
2024         * editing/FrameSelection.cpp:
2025         (WebCore::FrameSelection::modifyMovingRight):
2026         * loader/icon/wince/IconDatabaseWinCE.cpp: Removed.
2027         * page/EventHandler.cpp:
2028         (WebCore::EventHandler::sendContextMenuEventForKey):
2029         * page/Settings.cpp:
2030         * page/win/EventHandlerWin.cpp:
2031         (WebCore::EventHandler::createDraggingDataTransfer):
2032         * platform/ContextMenu.h:
2033         * platform/DragImage.cpp:
2034         * platform/FileSystem.h:
2035         * platform/graphics/BitmapImage.cpp:
2036         (WebCore::BitmapImage::mayFillWithSolidColor):
2037         * platform/graphics/FontGlyphs.cpp:
2038         (WebCore::FontGlyphs::glyphDataAndPageForCharacter):
2039         * platform/graphics/FontPlatformData.h:
2040         * platform/graphics/ImageBufferData.h:
2041         * platform/graphics/MediaPlayer.cpp:
2042         * platform/graphics/SimpleFontData.h:
2043         * platform/graphics/opentype/OpenTypeUtilities.cpp:
2044         (WebCore::renameAndActivateFont):
2045         * platform/graphics/opentype/OpenTypeUtilities.h:
2046         * platform/graphics/win/DIBPixelData.cpp:
2047         (WebCore::DIBPixelData::setRGBABitmapAlpha):
2048         * platform/graphics/win/GDIExtras.cpp: Removed.
2049         * platform/graphics/win/GDIExtras.h:
2050         (WebCore::hasAlphaBlendSupport):
2051         (WebCore::alphaBlendIfSupported):
2052         * platform/graphics/win/IconWin.cpp:
2053         (WebCore::Icon::createIconForFiles):
2054         (WebCore::Icon::paint):
2055         * platform/graphics/win/SimpleFontDataWin.cpp:
2056         (WebCore::SimpleFontData::initGDIFont):
2057         (WebCore::SimpleFontData::platformDestroy):
2058         (WebCore::SimpleFontData::boundsForGDIGlyph):
2059         (WebCore::SimpleFontData::widthForGDIGlyph):
2060         (WebCore::SimpleFontData::scriptFontProperties):
2061         * platform/graphics/wince/FontCacheWinCE.cpp: Removed.
2062         * platform/graphics/wince/FontCustomPlatformData.cpp: Removed.
2063         * platform/graphics/wince/FontCustomPlatformData.h: Removed.
2064         * platform/graphics/wince/FontPlatformData.cpp: Removed.
2065         * platform/graphics/wince/FontPlatformData.h: Removed.
2066         * platform/graphics/wince/FontWinCE.cpp: Removed.
2067         * platform/graphics/wince/GlyphPageTreeNodeWinCE.cpp: Removed.
2068         * platform/graphics/wince/GradientWinCE.cpp: Removed.
2069         * platform/graphics/wince/GraphicsContextWinCE.cpp: Removed.
2070         * platform/graphics/wince/ImageBufferDataWince.h: Removed.
2071         * platform/graphics/wince/ImageBufferWinCE.cpp: Removed.
2072         * platform/graphics/wince/ImageWinCE.cpp: Removed.
2073         * platform/graphics/wince/MediaPlayerPrivateWinCE.h: Removed.
2074         * platform/graphics/wince/MediaPlayerProxy.cpp: Removed.
2075         * platform/graphics/wince/MediaPlayerProxy.h: Removed.
2076         * platform/graphics/wince/PathWinCE.cpp: Removed.
2077         * platform/graphics/wince/PlatformPathWinCE.cpp: Removed.
2078         * platform/graphics/wince/PlatformPathWinCE.h: Removed.
2079         * platform/graphics/wince/SharedBitmap.cpp: Removed.
2080         * platform/graphics/wince/SharedBitmap.h: Removed.
2081         * platform/graphics/wince/SimpleFontDataWinCE.cpp: Removed.
2082         * platform/graphics/wince/WinCEGraphicsExtras.h: Removed.
2083         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
2084         * platform/network/win/NetworkStateNotifierWin.cpp:
2085         (WebCore::NetworkStateNotifier::NetworkStateNotifier):
2086         * platform/win/COMPtr.h:
2087         * platform/win/ClipboardUtilitiesWin.cpp:
2088         * platform/win/ContextMenuItemWin.cpp:
2089         * platform/win/ContextMenuWin.cpp:
2090         (WebCore::ContextMenu::getContextMenuItems):
2091         (WebCore::ContextMenu::createPlatformContextMenuFromItems):
2092         * platform/win/DragImageWin.cpp:
2093         (WebCore::dragLabelFont):
2094         * platform/win/FileSystemWin.cpp:
2095         (WebCore::pathByAppendingComponent):
2096         (WebCore::pathGetFileName):
2097         (WebCore::storageDirectory):
2098         * platform/win/LoggingWin.cpp:
2099         (WebCore::logLevelString):
2100         * platform/win/PasteboardWin.cpp:
2101         (WebCore::PasteboardOwnerWndProc):
2102         (WebCore::Pasteboard::createForCopyAndPaste):
2103         (WebCore::pathRemoveBadFSCharacters):
2104         (WebCore::filesystemPathFromUrlOrTitle):
2105         (WebCore::createGlobalHDropContent):
2106         * platform/win/PlatformMouseEventWin.cpp:
2107         (WebCore::messageToEventType):
2108         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
2109         * platform/win/PlatformScreenWin.cpp:
2110         (WebCore::deviceInfoForWidget):
2111         (WebCore::screenIsMonochrome):
2112         * platform/win/PopupMenuWin.cpp:
2113         (WebCore::PopupMenuWin::show):
2114         (WebCore::PopupMenuWin::paint):
2115         (WebCore::PopupMenuWin::registerClass):
2116         (WebCore::PopupMenuWin::wndProc):
2117         * platform/win/ScrollbarThemeWin.cpp:
2118         (WebCore::ScrollbarThemeWin::paintButton):
2119         * platform/win/SharedBufferWin.cpp:
2120         * platform/win/SharedTimerWin.cpp:
2121         (WebCore::TimerWindowWndProc):
2122         (WebCore::initializeOffScreenTimerWindow):
2123         (WebCore::queueTimerProc):
2124         (WebCore::setSharedTimerFireInterval):
2125         (WebCore::stopSharedTimer):
2126         * platform/win/SoftLinking.h:
2127         * platform/win/SystemInfo.cpp:
2128         (WebCore::windowsVersion):
2129         (WebCore::processorArchitecture):
2130         (WebCore::architectureTokenForUAString):
2131         * platform/win/WCDataObject.cpp:
2132         (WebCore::WCDataObject::CopyMedium):
2133         * plugins/PluginDatabase.cpp:
2134         * plugins/PluginView.cpp:
2135         (WebCore::PluginView::stop):
2136         * plugins/PluginViewNone.cpp:
2137         * plugins/win/PluginDatabaseWin.cpp:
2138         (WebCore::addWindowsMediaPlayerPluginDirectory):
2139         (WebCore::addMacromediaPluginDirectories):
2140         * plugins/win/PluginPackageWin.cpp:
2141         (WebCore::PluginPackage::load):
2142         * plugins/win/PluginViewWin.cpp:
2143         (WebCore::setUpOffscreenPaintingHooks):
2144         (WebCore::registerPluginView):
2145         (WebCore::PluginView::wndProc):
2146         (WebCore::PluginView::updatePluginWidget):
2147         (WebCore::PluginView::paintIntoTransformedContext):
2148         (WebCore::PluginView::paint):
2149         (WebCore::PluginView::handleMouseEvent):
2150         (WebCore::PluginView::setParent):
2151         (WebCore::PluginView::setNPWindowRect):
2152         (WebCore::PluginView::platformStart):
2153         * rendering/RenderThemeWinCE.cpp: Removed.
2154         * rendering/RenderThemeWinCE.h: Removed.
2155         * storage/wince/DatabaseThreadWinCE.cpp: Removed.
2156         * storage/wince/DatabaseThreadWinCE.h: Removed.
2157         * storage/wince/StorageThreadWinCE.cpp: Removed.
2158         * storage/wince/StorageThreadWinCE.h: Removed.
2159
2160 2014-09-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2161
2162         Unreviewed. Fix GTK+ build after r173944.
2163
2164         * page/ContextMenuController.cpp: Add missing include.
2165
2166 2014-09-24  Christophe Dumez  <cdumez@apple.com>
2167
2168         Use tighter typing for render objects in RenderGeometryMap
2169         https://bugs.webkit.org/show_bug.cgi?id=137102
2170
2171         Reviewed by Ryosuke Niwa.
2172
2173         Use tighter typing for render objects in RenderGeometryMap for clarity
2174         and efficiency.
2175
2176         In particular, using RenderElement type instead of RenderObject
2177         in canMapBetweenRenderers() allows us to call the faster
2178         RenderElement::style() instead of RenderObject::style().
2179
2180         No new tests, no behavior change.
2181
2182         * rendering/RenderGeometryMap.cpp:
2183         (WebCore::canMapBetweenRenderers):
2184         (WebCore::RenderGeometryMap::pushMappingsToAncestor):
2185
2186 2014-09-24  Christophe Dumez  <cdumez@apple.com>
2187
2188         Add initial is<>() / downcast<>() support for any type of Nodes
2189         https://bugs.webkit.org/show_bug.cgi?id=137056
2190
2191         Reviewed by Benjamin Poulain.
2192
2193         Add initial is<>() / downcast<>() support for any type of Nodes, not
2194         just Elements by:
2195         - Moving the is<>() / downcast<>() declarations from Element.h to
2196           Node.h
2197         - Introducing a SPECIALIZE_TYPE_TRAITS_*() macro that generates the
2198           needed template specializations for is<>() / downcast<>() to work.
2199           This macro will replace NODE_TYPE_CASTS() entirely once the code base
2200           is fully ported.
2201
2202         This patch makes use of SPECIALIZE_TYPE_TRAITS_*() macro for
2203         HTMLFormControlElement, that is an HTMLElement for which the template
2204         specializations cannot be automatically generated because it requires
2205         special handling.
2206
2207         This patch also makes use of SPECIALIZE_TYPE_TRAITS_*() macro for
2208         DocumentFragment to show that it can be used for non-Element Nodes.
2209
2210         No new tests, no behavior change.
2211
2212         * accessibility/AccessibilityNodeObject.cpp:
2213         (WebCore::AccessibilityNodeObject::isReadOnly):
2214         (WebCore::AccessibilityNodeObject::isRequired):
2215         (WebCore::AccessibilityNodeObject::isControl):
2216         * css/SelectorCheckerTestFunctions.h:
2217         (WebCore::isAutofilled):
2218         (WebCore::isDisabled):
2219         (WebCore::isEnabled):
2220         * css/StyleResolver.cpp:
2221         (WebCore::StyleResolver::canShareStyleWithElement):
2222         (WebCore::StyleResolver::adjustRenderStyle):
2223         * dom/Document.cpp:
2224         (WebCore::Document::importNode):
2225         (WebCore::Document::setFocusedElement):
2226         * dom/DocumentFragment.h:
2227         (WebCore::isDocumentFragment):
2228         * dom/Element.cpp:
2229         (WebCore::Element::focus):
2230         * dom/Element.h:
2231         (WebCore::is): Deleted.
2232         (WebCore::downcast): Deleted.
2233         * dom/Node.h:
2234         (WebCore::is):
2235         (WebCore::downcast):
2236         * dom/make_names.pl:
2237         (printTypeHelpers):
2238         * editing/FrameSelection.cpp:
2239         (WebCore::scanForForm):
2240         * editing/TextIterator.cpp:
2241         (WebCore::isRendererReplacedElement):
2242         * html/FormAssociatedElement.h:
2243         * html/HTMLElement.h:
2244         * html/HTMLFieldSetElement.cpp:
2245         (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
2246         (WebCore::HTMLFieldSetElement::refreshElementsIfNeeded):
2247         * html/HTMLFormControlElement.cpp:
2248         (WebCore::HTMLFormControlElement::enclosingFormControlElement):
2249         * html/HTMLFormControlElement.h:
2250         (WebCore::isHTMLFormControlElement):
2251         * html/HTMLFormElement.cpp:
2252         (WebCore::HTMLFormElement::submitImplicitly):
2253         (WebCore::submitElementFromEvent):
2254         (WebCore::HTMLFormElement::validateInteractively):
2255         (WebCore::HTMLFormElement::submit):
2256         (WebCore::HTMLFormElement::reset):
2257         (WebCore::HTMLFormElement::formElementIndex):
2258         (WebCore::HTMLFormElement::defaultButton):
2259         (WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
2260         (WebCore::HTMLFormElement::documentDidResumeFromPageCache):
2261         * html/HTMLMediaElement.h:
2262         * html/HTMLPlugInImageElement.h:
2263         * html/HTMLSummaryElement.cpp:
2264         (WebCore::isClickableControl):
2265         * html/LabelableElement.h:
2266         * html/RadioNodeList.cpp:
2267         (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter):
2268         (WebCore::RadioNodeList::elementMatches):
2269         * html/parser/HTMLConstructionSite.cpp:
2270         (WebCore::HTMLConstructionSite::findFosterSite):
2271         * html/parser/HTMLTreeBuilder.cpp:
2272         (WebCore::disallowTelephoneNumberParsing):
2273         * loader/FormSubmission.cpp:
2274         (WebCore::FormSubmission::create):
2275         * mathml/MathMLElement.h:
2276         * page/ContextMenuController.cpp:
2277         (WebCore::ContextMenuController::populate):
2278         * page/Frame.cpp:
2279         (WebCore::Frame::searchForLabelsBeforeElement):
2280         * rendering/RenderButton.cpp:
2281         (WebCore::RenderButton::formControlElement):
2282         * rendering/RenderLayer.cpp:
2283         (WebCore::RenderLayer::resize):
2284         * rendering/RenderTheme.cpp:
2285         (WebCore::RenderTheme::isReadOnlyControl):
2286         * svg/SVGElement.h:
2287         * svg/SVGFilterPrimitiveStandardAttributes.h:
2288         * svg/animation/SVGSMILElement.h:
2289
2290 2014-09-24  Darin Adler  <darin@apple.com>
2291
2292         Old Turkic characters behave as left-to-right instead of right-to-left, because they are encoded as surrogate pairs.
2293         https://bugs.webkit.org/show_bug.cgi?id=70029
2294
2295         Reviewed by Dan Bernstein.
2296
2297         Test: fast/text/international/old-turkic-direction.html
2298
2299         * CMakeLists.txt: Added InlineIterator.cpp.
2300         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
2301         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2302         * WebCore.xcodeproj/project.pbxproj: Ditto.
2303         * rendering/RenderingAllInOne.cpp: Ditto.
2304
2305         * rendering/InlineIterator.cpp: Added.
2306         (WebCore::InlineIterator::surrogateTextDirection): New function used to compute the direction
2307         when a surrogate pair is involved.
2308         * rendering/InlineIterator.h: Made the characterAt function private.
2309         (WebCore::InlineIterator::previousInSameNode): Took out unneeded range check. A zero will underflow
2310         and become a large number and the characterAt function will return 0 in that case.
2311         (WebCore::InlineIterator::direction): Added code to check U16_IS_SINGLE before calling
2312         u_charDirection, and call surrogateTextDirection instead.
2313
2314 2014-09-24  Christophe Dumez  <cdumez@apple.com>
2315
2316         Unreviewed build fix after r173941.
2317
2318         Rename shadow to m_shadow.
2319
2320         * rendering/TextPainter.h:
2321         (WebCore::ShadowApplier::shadowIsCompletelyCoveredByText):
2322
2323 2014-09-22  Myles C. Maxfield  <mmaxfield@apple.com>
2324
2325         REGRESSION: Text with a zero offset, zero blur shadow vanishes
2326         https://bugs.webkit.org/show_bug.cgi?id=136801
2327
2328         Reviewed by Darin Adler.
2329
2330         This patch performs some cleanup regarding TextPainter's shadow logic and handles an
2331         additional case of empty shadows. Previously, there was tight coupling between
2332         applyShadowToGraphicalContext() and paintTextWithShadows(), as they both used a
2333         collection of variables to determine how shadows are to be drawn. This complexity has
2334         been moved into a helper class, ShadowApplier, which performs what
2335         applyShadowToGraphicsContext() used to do, and cleans up correctly in its destructor.
2336         This removes the tight coupling mentioned earlier.
2337
2338         Test: fast/text/empty-shadow.html
2339
2340         * rendering/InlineTextBox.cpp:
2341         (WebCore::InlineTextBox::applyShadowToGraphicsContext): Moved to ShadowApplier.
2342         * rendering/InlineTextBox.h: Deleted applyShadowToGraphicsContext signature.
2343         * rendering/TextPainter.cpp:
2344         (WebCore::ShadowApplier::ShadowApplier): Perform the contents of applyShadowToGraphicsContext()
2345         (WebCore::ShadowApplier::~ShadowApplier): Undo the work done previously
2346         (WebCore::paintTextWithShadows): Create a ShadowApplier to do the relevant shadow work. In addition,
2347         refactor some boolean flags to more meaningful ones with relation to the computation at hand.
2348         (WebCore::isEmptyShadow): Moved to TextPainter.h, named shadowIsCompletelyCoveredByText()
2349         * rendering/TextPainter.h:
2350         (WebCore::ShadowApplier::ShadowApplier): Moved from InlineTextBox::applyShadowToGraphicsContext().
2351         (WebCore::ShadowApplier::extraOffset): Getter.
2352         (WebCore::ShadowApplier::~ShadowApplier): Moved from TextPainter::paintTextWithShadows().
2353         (WebCore::isLastShadowIteration): Helper function.
2354         (WebCore::shadowIsCompletelyCoveredByText): Determines whether or not we should not draw the shadow.
2355         * rendering/svg/SVGInlineTextBox.cpp:
2356         (WebCore::SVGInlineTextBox::paintTextWithShadows): Update to use ShadowApplier.
2357
2358 2014-09-24  Brian J. Burg  <burg@cs.washington.edu>
2359
2360         Web Inspector: subtract elapsed time while debugger is paused from profile nodes
2361         https://bugs.webkit.org/show_bug.cgi?id=136796
2362
2363         Reviewed by Timothy Hatcher.
2364
2365         * inspector/TimelineRecordFactory.cpp:
2366         (WebCore::buildInspectorObject):
2367
2368 2014-09-24  Christophe Dumez  <cdumez@apple.com>
2369
2370         Use is<HTML*Element>() instead of isHTML*Element() - Part 1
2371         https://bugs.webkit.org/show_bug.cgi?id=137068
2372
2373         Reviewed by Ryosuke Niwa.
2374
2375         Start using is<HTML*Element>() instead of isHTML*Element().
2376         Remaining usages will be updated in a follow-up patch to
2377         reduce the size of the change.
2378
2379         No new tests, no behavior change.
2380
2381         * accessibility/AccessibilityListBoxOption.cpp:
2382         (WebCore::AccessibilityListBoxOption::isSelected):
2383         (WebCore::AccessibilityListBoxOption::canSetSelectedAttribute):
2384         (WebCore::AccessibilityListBoxOption::stringValue):
2385         (WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
2386         * accessibility/AccessibilityMediaControls.cpp:
2387         (WebCore::AccessibilityMediaTimeline::valueDescription):
2388         * accessibility/AccessibilityMenuListOption.cpp:
2389         (WebCore::AccessibilityMenuListOption::setElement):
2390         * accessibility/AccessibilityMenuListPopup.cpp:
2391         (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject):
2392         * accessibility/AccessibilityNodeObject.cpp:
2393         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
2394         (WebCore::AccessibilityNodeObject::isNativeTextControl):
2395         (WebCore::AccessibilityNodeObject::isNativeImage):
2396         (WebCore::AccessibilityNodeObject::isInputImage):
2397         (WebCore::AccessibilityNodeObject::isReadOnly):
2398         (WebCore::AccessibilityNodeObject::valueForRange):
2399         (WebCore::AccessibilityNodeObject::maxValueForRange):
2400         (WebCore::AccessibilityNodeObject::minValueForRange):
2401         (WebCore::isNodeActionElement):
2402         (WebCore::AccessibilityNodeObject::titleElementText):
2403         (WebCore::AccessibilityNodeObject::visibleText):
2404         (WebCore::AccessibilityNodeObject::title):
2405         (WebCore::AccessibilityNodeObject::colorValue):
2406         (WebCore::accessibleNameForNode):
2407         * accessibility/AccessibilityRenderObject.cpp:
2408         (WebCore::AccessibilityRenderObject::isFileUploadButton):
2409         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
2410         (WebCore::AccessibilityRenderObject::setValue):
2411         (WebCore::AccessibilityRenderObject::accessibilityHitTest):
2412         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2413         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
2414         * accessibility/atk/AXObjectCacheAtk.cpp:
2415         (WebCore::notifyChildrenSelectionChange):
2416         * css/SelectorCheckerTestFunctions.h:
2417         (WebCore::isDisabled):
2418         (WebCore::isEnabled):
2419         (WebCore::isChecked):
2420         * css/StyleResolver.cpp:
2421         (WebCore::StyleResolver::adjustRenderStyle):
2422         * dom/EventDispatcher.cpp:
2423         (WebCore::EventDispatcher::dispatchEvent):
2424         * editing/FrameSelection.cpp:
2425         (WebCore::FrameSelection::selectAll):
2426         * editing/ReplaceSelectionCommand.cpp:
2427         (WebCore::ReplaceSelectionCommand::shouldPerformSmartReplace):
2428         * editing/VisibleSelection.cpp:
2429         (WebCore::VisibleSelection::isInPasswordField):
2430         * editing/cocoa/HTMLConverter.mm:
2431         (HTMLConverter::_processElement):
2432         * editing/gtk/EditorGtk.cpp:
2433         (WebCore::elementURL):
2434         * editing/ios/EditorIOS.mm:
2435         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
2436         * editing/markup.cpp:
2437         (WebCore::StyledMarkupAccumulator::appendText):
2438         (WebCore::isPlainTextMarkup):
2439         (WebCore::collectElementsToRemoveFromFragment):
2440         * html/HTMLCollection.cpp:
2441         (WebCore::isMatchingElement):
2442         * html/HTMLEmbedElement.cpp:
2443         (WebCore::HTMLEmbedElement::rendererIsNeeded):
2444         * html/HTMLFormControlElement.cpp:
2445         (WebCore::shouldAutofocus):
2446         * html/HTMLFormElement.cpp:
2447         (WebCore::HTMLFormElement::getTextFieldValues):
2448         (WebCore::HTMLFormElement::formElementIndex):
2449         * html/HTMLImageLoader.cpp:
2450         (WebCore::HTMLImageLoader::dispatchLoadEvent):
2451         (WebCore::HTMLImageLoader::notifyFinished):
2452         * html/HTMLNameCollection.cpp:
2453         (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
2454         (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
2455         (WebCore::DocumentNameCollection::elementMatches):
2456         * html/HTMLOptGroupElement.cpp:
2457         (WebCore::HTMLOptGroupElement::recalcSelectOptions):
2458         (WebCore::HTMLOptGroupElement::ownerSelectElement):
2459         * html/HTMLOptionElement.cpp:
2460         (WebCore::HTMLOptionElement::index):
2461         (WebCore::HTMLOptionElement::ownerSelectElement):
2462         * html/HTMLSelectElement.cpp:
2463         (WebCore::HTMLSelectElement::add):
2464         (WebCore::HTMLSelectElement::value):
2465         (WebCore::HTMLSelectElement::setValue):
2466         (WebCore::HTMLSelectElement::childShouldCreateRenderer):
2467         (WebCore::HTMLSelectElement::setLength):
2468         (WebCore::HTMLSelectElement::nextValidIndex):
2469         (WebCore::HTMLSelectElement::saveLastSelection):
2470         (WebCore::HTMLSelectElement::setActiveSelectionAnchorIndex):
2471         (WebCore::HTMLSelectElement::updateListBoxSelection):
2472         (WebCore::HTMLSelectElement::listBoxOnChange):
2473         (WebCore::HTMLSelectElement::recalcListItems):
2474         (WebCore::HTMLSelectElement::selectedIndex):
2475         (WebCore::HTMLSelectElement::selectOption):
2476         (WebCore::HTMLSelectElement::optionToListIndex):
2477         (WebCore::HTMLSelectElement::listToOptionIndex):
2478         (WebCore::HTMLSelectElement::deselectItemsWithoutValidation):
2479         (WebCore::HTMLSelectElement::saveFormControlState):
2480         (WebCore::HTMLSelectElement::searchOptionsForValue):
2481         (WebCore::HTMLSelectElement::restoreFormControlState):
2482         (WebCore::HTMLSelectElement::appendFormData):
2483         (WebCore::HTMLSelectElement::reset):
2484         (WebCore::HTMLSelectElement::updateSelectedState):
2485         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
2486         (WebCore::HTMLSelectElement::lastSelectedListIndex):
2487         (WebCore::HTMLSelectElement::optionAtIndex):
2488         (WebCore::HTMLSelectElement::accessKeySetSelectedIndex):
2489         (WebCore::HTMLSelectElement::length):
2490         * html/HTMLTagNames.in:
2491         * html/RadioInputType.cpp:
2492         (WebCore::RadioInputType::handleKeydownEvent):
2493         (WebCore::RadioInputType::isKeyboardFocusable):
2494         * html/parser/HTMLConstructionSite.cpp:
2495         (WebCore::hasImpliedEndTag):
2496         * html/parser/HTMLElementStack.cpp:
2497         (WebCore::HTMLNames::isSelectScopeMarker):
2498         * html/parser/HTMLTreeBuilder.cpp:
2499         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
2500         (WebCore::HTMLTreeBuilder::processStartTag):
2501         (WebCore::HTMLTreeBuilder::processEndTag):
2502         * html/shadow/MediaControlElementTypes.cpp:
2503         (WebCore::mediaControlElementType):
2504         * loader/FormSubmission.cpp:
2505         (WebCore::FormSubmission::create):
2506         * loader/FrameLoader.cpp:
2507         (WebCore::FrameLoader::handleFallbackContent):
2508         * loader/ImageLoader.cpp:
2509         (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
2510         * loader/SubframeLoader.cpp:
2511         (WebCore::SubframeLoader::requestObject):
2512         * loader/archive/cf/LegacyWebArchive.cpp:
2513         (WebCore::LegacyWebArchive::create):
2514         * page/Chrome.cpp:
2515         (WebCore::Chrome::setToolTip):
2516         * page/EventHandler.cpp:
2517         (WebCore::isSubmitImage):
2518         (WebCore::EventHandler::handleMousePressEvent):
2519         * page/FocusController.cpp:
2520         (WebCore::clearSelectionIfNeeded):
2521         * page/FrameView.cpp:
2522         (WebCore::FrameView::addEmbeddedObjectToUpdate):
2523         (WebCore::FrameView::updateEmbeddedObject):
2524         * page/PageSerializer.cpp:
2525         (WebCore::frameOwnerURLAttributeName):
2526         * page/SpatialNavigation.cpp:
2527         (WebCore::canScrollInDirection):
2528         * rendering/HitTestResult.cpp:
2529         (WebCore::HitTestResult::altDisplayString):
2530         (WebCore::HitTestResult::absoluteImageURL):
2531         (WebCore::HitTestResult::absolutePDFURL):
2532         (WebCore::HitTestResult::isContentEditable):
2533         * rendering/RenderBlockFlow.cpp:
2534         (WebCore::resizeTextPermitted):
2535         * rendering/RenderBox.cpp:
2536         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
2537         * rendering/RenderButton.cpp:
2538         (WebCore::RenderButton::updateFromElement):
2539         (WebCore::RenderButton::canHaveGeneratedChildren):
2540         * rendering/RenderDetailsMarker.cpp:
2541         (WebCore::RenderDetailsMarker::isOpen):
2542         * rendering/RenderFileUploadControl.cpp:
2543         (WebCore::RenderFileUploadControl::uploadButton):
2544         * rendering/RenderImage.cpp:
2545         (WebCore::RenderImage::updateAltText):
2546         * rendering/RenderListBox.cpp:
2547         (WebCore::RenderListBox::updateFromElement):
2548         (WebCore::RenderListBox::addFocusRingRects):
2549         (WebCore::RenderListBox::paintItemForeground):
2550         (WebCore::RenderListBox::paintItemBackground):
2551         * rendering/RenderMenuList.cpp:
2552         (WebCore::selectedOptionCount):
2553         (RenderMenuList::updateOptionsWidth):
2554         (RenderMenuList::setTextFromOption):
2555         (RenderMenuList::itemText):
2556         (RenderMenuList::itemIsEnabled):
2557         (RenderMenuList::itemIsSelected):
2558         * rendering/RenderTheme.cpp:
2559         (WebCore::RenderTheme::paintSliderTicks):
2560         * testing/Internals.cpp:
2561         (WebCore::Internals::selectColorInColorChooser):
2562         (WebCore::Internals::wasLastChangeUserEdit):
2563         (WebCore::Internals::isSelectPopupVisible):
2564         * xml/parser/XMLDocumentParserLibxml2.cpp:
2565         (WebCore::XMLDocumentParser::startElementNs):
2566
2567 2014-09-24  Eric Carlson  <eric.carlson@apple.com>
2568
2569         [iOS] Remove MediaPlayer::setHasPlaybackTargetAvailabilityListeners
2570         https://bugs.webkit.org/show_bug.cgi?id=137075
2571
2572         Reviewed by Dean Jackson.
2573
2574         No new tests, this just removes unused code.
2575
2576         * platform/graphics/MediaPlayer.cpp:
2577         (WebCore::MediaPlayer::setHasPlaybackTargetAvailabilityListeners): Deleted.
2578         * platform/graphics/MediaPlayer.h:
2579         * platform/graphics/MediaPlayerPrivate.h:
2580         (WebCore::MediaPlayerPrivateInterface::setHasPlaybackTargetAvailabilityListeners): Deleted.
2581
2582 2014-09-21  Timothy Hatcher  <timothy@apple.com>
2583
2584         Make the Web Inspector use a separate web process.
2585
2586         https://bugs.webkit.org/show_bug.cgi?id=135120
2587
2588         Reviewed by Anders Carlsson.
2589
2590         * English.lproj/Localizable.strings: Updated.
2591
2592         * WebCore.exp.in:
2593         * WebCore.xcodeproj/project.pbxproj:
2594         * bindings/js/ScriptGlobalObject.h:
2595         * bindings/js/ScriptState.h:
2596         * inspector/InspectorFrontendHost.h:
2597         * inspector/InspectorPageAgent.h:
2598         * page/Chrome.h:
2599         Exported a few functions and private headers.
2600
2601         * inspector/InspectorController.cpp:
2602         (WebCore::InspectorController::InspectorController):
2603         (WebCore::InspectorController::setInspectorFrontendClient):
2604         (WebCore::InspectorController::hasInspectorFrontendClient):
2605         (WebCore::InspectorController::show):
2606         * inspector/InspectorController.h:
2607         Make InspectorFrontendClient a pointer instead of a std::unique_ptr.
2608         This makes it easier to implement InspectorFrontendClient as
2609         part of an existing object that is externally owned.
2610
2611         * testing/Internals.cpp:
2612         (WebCore::Internals::openDummyInspectorFrontend):
2613         (WebCore::Internals::closeDummyInspectorFrontend):
2614         * testing/Internals.h:
2615         Change InspectorFrontendClientDummy from being moved to owned.
2616
2617 2014-09-23  Dean Jackson  <dino@apple.com>
2618
2619         [Yosemite] Button text doesn't go white while pushing the button, like it does for real buttons
2620         https://bugs.webkit.org/show_bug.cgi?id=137054
2621         rdar://problem/17559038
2622
2623         Reviewed by Sam Weinig.
2624
2625         On Yosemite and above, system buttons paint with white-ish text when they
2626         are pressed. Since this isn't exposed by API, I've hardcoded the value
2627         into RenderThemeMac.
2628
2629         The actual state is exposed by adding a :active rule to html.css that
2630         uses a new CSSValueKeyword: ActiveButtonText.
2631
2632         Unfortunately I can't find a way to test this, because the active state isn't
2633         testable. We should really expose the Inspector's forcePseudoState function into
2634         window.internals.
2635
2636         * css/CSSValueKeywords.in: Add "activebuttontext".
2637         * css/html.css:
2638         (input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]::-webkit-file-upload-button:active, button:active): New rule for active
2639         button elements.
2640         * rendering/RenderTheme.cpp:
2641         (WebCore::RenderTheme::systemColor): Handle CSSValueActivebuttontext as black.
2642         * rendering/RenderThemeMac.mm:
2643         (WebCore::RenderThemeMac::systemColor): Handle CSSValueActivebuttontext as
2644         white with 75% opacity.
2645
2646 2014-09-24  Christophe Dumez  <cdumez@apple.com>
2647
2648         Use is<SVG*Element>() instead of isSVG*Element()
2649         https://bugs.webkit.org/show_bug.cgi?id=137058
2650
2651         Reviewed by Dirk Schulze.
2652
2653         Use is<SVG*Element>() instead of isSVG*Element() and drop support for
2654         generated isSVG*Element().
2655
2656         No new tests, no behavior change.
2657
2658         * css/CSSCursorImageValue.cpp:
2659         (WebCore::resourceReferencedByCursorElement):
2660         * css/StyleResolver.cpp:
2661         (WebCore::StyleResolver::useSVGZoomRulesForLength):
2662         * dom/DocumentStyleSheetCollection.cpp:
2663         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
2664         * dom/ScriptElement.cpp:
2665         (WebCore::toScriptElementIfPossible):
2666         * dom/make_names.pl:
2667         (printTypeHelpers):
2668         * editing/gtk/EditorGtk.cpp:
2669         (WebCore::elementURL):
2670         * rendering/HitTestResult.cpp:
2671         (WebCore::HitTestResult::absoluteImageURL):
2672         (WebCore::HitTestResult::isLiveLink):
2673         * rendering/svg/RenderSVGEllipse.cpp:
2674         (WebCore::RenderSVGEllipse::calculateRadiiAndCenter):
2675         * rendering/svg/RenderSVGTransformableContainer.cpp:
2676         (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
2677         * rendering/svg/SVGPathData.cpp:
2678         (WebCore::updatePathFromCircleElement):
2679         * rendering/svg/SVGRenderTreeAsText.cpp:
2680         (WebCore::operator<<):
2681         * rendering/svg/SVGResources.cpp:
2682         (WebCore::targetReferenceFromResource):
2683         * svg/SVGAltGlyphDefElement.cpp:
2684         (WebCore::SVGAltGlyphDefElement::hasValidGlyphElements):
2685         * svg/SVGAltGlyphElement.cpp:
2686         (WebCore::SVGAltGlyphElement::hasValidGlyphElements):
2687         * svg/SVGAnimateMotionElement.cpp:
2688         (WebCore::SVGAnimateMotionElement::hasValidAttributeType):
2689         * svg/SVGDocument.cpp:
2690         (WebCore::SVGDocument::rootElement):
2691         * svg/SVGElement.cpp:
2692         (WebCore::SVGElement::isOutermostSVGSVGElement):
2693         (WebCore::SVGElement::ownerSVGElement):
2694         (WebCore::SVGElement::viewportElement):
2695         * svg/SVGFEComponentTransferElement.cpp:
2696         (WebCore::SVGFEComponentTransferElement::build):
2697         * svg/SVGFELightElement.cpp:
2698         (WebCore::SVGFELightElement::findLightElement):
2699         * svg/SVGFontData.cpp:
2700         (WebCore::SVGFontData::applySVGGlyphSelection):
2701         * svg/SVGFontElement.cpp:
2702         (WebCore::SVGFontElement::ensureGlyphCache):
2703         * svg/SVGFontFaceElement.cpp:
2704         (WebCore::SVGFontFaceElement::associatedFontElement):
2705         (WebCore::SVGFontFaceElement::rebuildFontFace):
2706         * svg/SVGFontFaceSrcElement.cpp:
2707         (WebCore::SVGFontFaceSrcElement::srcValue):
2708         (WebCore::SVGFontFaceSrcElement::childrenChanged):
2709         * svg/SVGGlyphElement.cpp:
2710         (WebCore::SVGGlyphElement::invalidateGlyphCache):
2711         * svg/SVGHKernElement.cpp:
2712         (WebCore::SVGHKernElement::insertedInto):
2713         (WebCore::SVGHKernElement::removedFrom):
2714         * svg/SVGLengthContext.cpp:
2715         (WebCore::SVGLengthContext::determineViewport):
2716         * svg/SVGLocatable.cpp:
2717         (WebCore::isViewportElement):
2718         * svg/SVGMPathElement.cpp:
2719         (WebCore::SVGMPathElement::pathElement):
2720         (WebCore::SVGMPathElement::notifyParentOfPathChange):
2721         * svg/SVGPathElement.cpp:
2722         (WebCore::SVGPathElement::invalidateMPathDependencies):
2723         * svg/SVGPatternElement.cpp:
2724         (WebCore::SVGPatternElement::collectPatternAttributes):
2725         * svg/SVGSVGElement.cpp:
2726         (WebCore::SVGSVGElement::setupInitialView):
2727         * svg/SVGUseElement.cpp:
2728         (WebCore::dumpInstanceTree):
2729         (WebCore::SVGUseElement::expandUseElementsInShadowTree):
2730         * svg/SVGVKernElement.cpp:
2731         (WebCore::SVGVKernElement::insertedInto):
2732         (WebCore::SVGVKernElement::removedFrom):
2733
2734 2014-09-24  Benjamin Poulain  <bpoulain@apple.com>
2735
2736         Remove the style marking from :nth-child()
2737         https://bugs.webkit.org/show_bug.cgi?id=137055
2738
2739         Reviewed by Andreas Kling.
2740
2741         Previously, :nth-child() had to mark the RenderStyle as unique in order
2742         to prevent it from being used for style sharing.
2743
2744         After r173229, :nth-child() use the more generic element marking
2745         "StyleIsAffectedByPreviousSibling".
2746
2747         In StyleResolver::canShareStyleWithElement(), StyleIsAffectedByPreviousSibling
2748         is already used to prevent style sharing of those elements, making the "Unique"
2749         flag redundant.
2750
2751         Since it is now useless, remove the style marking from SelectorChecker and the CSS JIT.
2752
2753         Tests: fast/css/nth-child-style-sharing-even.html
2754                fast/css/nth-child-style-sharing-fixed-integer.html
2755                fast/css/nth-child-style-sharing-odd.html
2756
2757         * css/SelectorChecker.cpp:
2758         (WebCore::SelectorChecker::checkOne):
2759         * cssjit/SelectorCompiler.cpp:
2760         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
2761         (WebCore::SelectorCompiler::setElementChildIndexAndUpdateStyle): Deleted.
2762         * rendering/style/RenderStyle.h:
2763
2764 2014-09-23  Chris Dumez  <cdumez@apple.com>
2765
2766         Add support for is<HTML*Element>() for type checking
2767         https://bugs.webkit.org/show_bug.cgi?id=137015
2768
2769         Reviewed by Benjamin Poulain.
2770
2771         Add support for is<HTML*Element>() for type checking while keeping
2772         support for the legacy toHTML*Element() form until the code base is
2773         ported.
2774
2775         toHTML*Element() helpers are now macros to the new is<HTML*Element>()
2776         type checking helpers.
2777
2778         No new tests, no behavior change.
2779
2780         * dom/Document.cpp:
2781         (WebCore::Document::setTitle):
2782         * dom/Element.cpp:
2783         (WebCore::Element::childShouldCreateRenderer):
2784         * dom/Element.h:
2785         (WebCore::is):
2786         (WebCore::downcast):
2787         (WebCore::isElementOfType): Deleted.
2788         * dom/ElementAncestorIterator.h:
2789         (WebCore::lineageOfType):
2790         * dom/ElementIterator.h:
2791         (WebCore::findElementAncestorOfType):
2792         * dom/ElementTraversal.h:
2793         (WebCore::Traversal<ElementType>::firstChildTemplate):
2794         (WebCore::Traversal<ElementType>::lastChildTemplate):
2795         (WebCore::Traversal<ElementType>::firstWithinTemplate):
2796         (WebCore::Traversal<ElementType>::lastWithinTemplate):
2797         (WebCore::Traversal<ElementType>::nextTemplate):
2798         (WebCore::Traversal<ElementType>::previous):
2799         (WebCore::Traversal<ElementType>::nextSibling):
2800         (WebCore::Traversal<ElementType>::previousSibling):
2801         (WebCore::Traversal<ElementType>::nextSkippingChildren):
2802         * dom/TypedElementDescendantIterator.h:
2803         (WebCore::TypedElementDescendantIteratorAdapter<ElementType>::from):
2804         (WebCore::TypedElementDescendantConstIteratorAdapter<ElementType>::from):
2805         * dom/make_names.pl:
2806         (printTypeHelpers):
2807
2808 2014-09-23  Benjamin Poulain  <bpoulain@apple.com>
2809
2810         The style resolution cache applies properties incorrectly whenever direction != ltr
2811         https://bugs.webkit.org/show_bug.cgi?id=137052
2812
2813         Reviewed by Andreas Kling.
2814
2815         The optimization r135021 introduced a bug whenever the direction of subtree is not
2816         uniform in the whole page.
2817
2818         When StyleResolver::applyMatchedProperties() resolves the style, some properties are
2819         resolved differently based on the writing-mode and the direction.
2820
2821         In isCacheableInMatchedPropertiesCache(), the cases for writing-mode are already handled
2822         by not caching any style with anything else than the default.
2823         The direction was ignored, causing the bugs solved here.
2824
2825         Tests: css3/flexbox/flex-flow-2.html
2826                fast/css/style-resolver-cache-direction-1.html
2827                fast/css/style-resolver-cache-direction-2.html
2828                fast/css/style-resolver-cache-direction-3.html
2829
2830         * css/StyleResolver.cpp:
2831         (WebCore::isCacheableInMatchedPropertiesCache):
2832
2833 2014-09-23  Chris Dumez  <cdumez@apple.com>
2834
2835         Have CSS classes' methods return more references
2836         https://bugs.webkit.org/show_bug.cgi?id=137036
2837
2838         Reviewed by Ryosuke Niwa.
2839
2840         Have CSS classes' methods return more references instead of pointers
2841         when possible.
2842
2843         No new tests, no behavior change.
2844
2845         * css/CSSFontFaceRule.cpp:
2846         (WebCore::CSSFontFaceRule::style):
2847         * css/CSSFontFaceRule.h:
2848         * css/CSSGroupingRule.cpp:
2849         (WebCore::CSSGroupingRule::cssRules):
2850         * css/CSSGroupingRule.h:
2851         * css/CSSImportRule.cpp:
2852         (WebCore::CSSImportRule::media):
2853         * css/CSSImportRule.h:
2854         * css/CSSPageRule.cpp:
2855         (WebCore::CSSPageRule::style):
2856         * css/CSSPageRule.h:
2857         * css/CSSStyleRule.cpp:
2858         (WebCore::CSSStyleRule::style):
2859         * css/CSSStyleRule.h:
2860         * css/WebKitCSSKeyframeRule.cpp:
2861         (WebCore::WebKitCSSKeyframeRule::style):
2862         * css/WebKitCSSKeyframeRule.h:
2863         * css/WebKitCSSKeyframesRule.cpp:
2864         (WebCore::WebKitCSSKeyframesRule::cssRules):
2865         * css/WebKitCSSKeyframesRule.h:
2866         * css/WebKitCSSViewportRule.cpp:
2867         (WebCore::WebKitCSSViewportRule::style):
2868         * css/WebKitCSSViewportRule.h:
2869         * inspector/InspectorStyleSheet.cpp:
2870         (WebCore::asCSSRuleList):
2871         (WebCore::fillMediaListChain):
2872         (WebCore::InspectorStyleSheet::setRuleSelector):
2873         (WebCore::InspectorStyleSheet::deleteRule):
2874         (WebCore::InspectorStyleSheet::buildObjectForSelectorList):
2875         (WebCore::InspectorStyleSheet::buildObjectForRule):
2876         (WebCore::InspectorStyleSheet::styleForId):
2877         (WebCore::InspectorStyleSheet::ruleIndexByStyle):
2878         (WebCore::InspectorStyleSheet::ruleId):
2879         (WebCore::InspectorStyleSheet::revalidateStyle):
2880
2881 2014-09-23  Roger Fong  <roger_fong@apple.com>
2882
2883         [Windows] Enable CSS Supports Rule on Windows.
2884
2885         * css/CSSAllInOne.cpp:
2886
2887 2014-09-23  Christophe Dumez  <cdumez@apple.com>
2888
2889         Unreviewed build fix after r173893.
2890
2891         Partial revert of r173893 to fix debug builds.
2892
2893         * accessibility/AccessibilityNodeObject.cpp:
2894         (WebCore::AccessibilityNodeObject::text):
2895         * bindings/js/JSDOMWindowCustom.cpp:
2896         (WebCore::namedItemGetter):
2897         (WebCore::JSDOMWindow::getOwnPropertySlot):
2898         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2899         * css/SelectorChecker.cpp:
2900         (WebCore::SelectorChecker::checkOne):
2901         * cssjit/SelectorCompiler.cpp:
2902         (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
2903         (WebCore::SelectorCompiler::makeElementStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
2904         (WebCore::SelectorCompiler::isPlaceholderShown):
2905         * dom/Document.cpp:
2906         (WebCore::Document::processHttpEquiv):
2907         * dom/Element.cpp:
2908         (WebCore::Element::insertedInto):
2909         (WebCore::Element::removedFrom):
2910         (WebCore::Element::updateName):
2911         (WebCore::Element::updateId):
2912         * editing/Editor.cpp:
2913         (WebCore::Editor::selectionForCommand):
2914         (WebCore::findFirstMarkable):
2915         * editing/FrameSelection.cpp:
2916         (WebCore::FrameSelection::selectAll):
2917         * html/HTMLElement.cpp:
2918         (WebCore::HTMLElement::matchesReadWritePseudoClass):
2919         (WebCore::HTMLElement::directionality):
2920         * html/HTMLImageElement.cpp:
2921         (WebCore::HTMLImageElement::parseAttribute):
2922         * html/HTMLObjectElement.cpp:
2923         (WebCore::HTMLObjectElement::updateDocNamedItem):
2924         * html/HTMLPlugInImageElement.cpp:
2925         (WebCore::addPlugInsFromNodeListMatchingPlugInOrigin):
2926         * html/HTMLTextFormControlElement.cpp:
2927         (WebCore::enclosingTextFormControl):
2928         * page/FrameView.cpp:
2929         (WebCore::FrameView::addEmbeddedObjectToUpdate):
2930         (WebCore::FrameView::updateEmbeddedObject):
2931         * rendering/HitTestResult.cpp:
2932         (WebCore::HitTestResult::absolutePDFURL):
2933         * rendering/RenderEmbeddedObject.cpp:
2934         (WebCore::RenderEmbeddedObject::paintContents):
2935         (WebCore::RenderEmbeddedObject::layout):
2936         * rendering/RenderSnapshottedPlugIn.cpp:
2937         (WebCore::RenderSnapshottedPlugIn::plugInImageElement):
2938         * rendering/RenderTextControl.cpp:
2939         (WebCore::RenderTextControl::textFormControlElement):
2940         * rendering/RenderThemeMac.mm:
2941         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2942         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
2943         * testing/Internals.cpp:
2944         (WebCore::Internals::visiblePlaceholder):
2945
2946 2014-09-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2947
2948         Implement snapping behavior for Mac overflow scrolling
2949         https://bugs.webkit.org/show_bug.cgi?id=135774
2950
2951         Reviewed by Beth Dakin.
2952
2953         Hooks into AxisScrollSnapAnimator to implement overflow scroll snapping on Mac.
2954
2955         We need to find a way to test this!
2956
2957         * dom/Element.cpp:
2958         (WebCore::Element::dispatchWheelEvent):
2959         * page/EventHandler.cpp:
2960         (WebCore::handleWheelEventInAppropriateEnclosingBoxForSingleAxis):
2961         * platform/ScrollAnimator.cpp:
2962         (WebCore::ScrollAnimator::handleWheelEvent):
2963         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers):
2964         (WebCore::ScrollAnimator::scrollOffsetInAxis):
2965         (WebCore::ScrollAnimator::immediateScrollInAxis):
2966         (WebCore::ScrollAnimator::startScrollSnapTimer):
2967         (WebCore::ScrollAnimator::stopScrollSnapTimer):
2968         (WebCore::ScrollAnimator::horizontalScrollSnapTimerFired):
2969         (WebCore::ScrollAnimator::verticalScrollSnapTimerFired):
2970         * platform/ScrollAnimator.h:
2971         * platform/mac/AxisScrollSnapAnimator.h:
2972         * platform/mac/AxisScrollSnapAnimator.mm:
2973         (WebCore::AxisScrollSnapAnimator::AxisScrollSnapAnimator):
2974         (WebCore::AxisScrollSnapAnimator::beginScrollSnapAnimation):
2975         (WebCore::AxisScrollSnapAnimator::endScrollSnapAnimation):
2976         (WebCore::AxisScrollSnapAnimator::initializeGlideParameters):
2977         * rendering/RenderLayer.cpp:
2978         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
2979
2980 2014-09-23  Chris Dumez  <cdumez@apple.com>
2981
2982         Use downcast<HTML*Element>() instead of toHTML*Element()
2983         https://bugs.webkit.org/show_bug.cgi?id=137007
2984
2985         Reviewed by Benjamin Poulain.
2986
2987         Use downcast<HTML*Element>() instead of toHTML*Element() and drop
2988         transition macros for toHTML*Element().
2989
2990         This patch also cleans up the surrounding code.
2991
2992         No new tests, no behavior change.
2993
2994         * accessibility/AXObjectCache.cpp:
2995         (WebCore::AXObjectCache::focusedUIElementForPage):
2996         (WebCore::AXObjectCache::labelChanged):
2997         * accessibility/AccessibilityListBox.cpp:
2998         (WebCore::AccessibilityListBox::canSetSelectedChildrenAttribute):
2999         (WebCore::AccessibilityListBox::addChildren):
3000         * accessibility/AccessibilityListBoxOption.cpp:
3001         (WebCore::AccessibilityListBoxOption::isSelected):
3002         (WebCore::AccessibilityListBoxOption::stringValue):
3003         (WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
3004         * accessibility/AccessibilityMediaControls.cpp:
3005         (WebCore::AccessibilityMediaTimeline::valueDescription):
3006         * accessibility/AccessibilityMenuListOption.cpp:
3007         (WebCore::AccessibilityMenuListOption::isEnabled):
3008         (WebCore::AccessibilityMenuListOption::isSelected):
3009         (WebCore::AccessibilityMenuListOption::setSelected):
3010         (WebCore::AccessibilityMenuListOption::stringValue):
3011         * accessibility/AccessibilityMenuListPopup.cpp:
3012         (WebCore::AccessibilityMenuListPopup::addChildren):
3013         * accessibility/AccessibilityNodeObject.cpp:
3014         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
3015         (WebCore::AccessibilityNodeObject::isNativeTextControl):
3016         (WebCore::AccessibilityNodeObject::isNativeImage):
3017         (WebCore::AccessibilityNodeObject::isInputImage):
3018         (WebCore::AccessibilityNodeObject::isMultiSelectable):
3019         (WebCore::AccessibilityNodeObject::isReadOnly):
3020         (WebCore::AccessibilityNodeObject::valueForRange):
3021         (WebCore::AccessibilityNodeObject::maxValueForRange):
3022         (WebCore::AccessibilityNodeObject::minValueForRange):
3023         (WebCore::isNodeActionElement):
3024         (WebCore::AccessibilityNodeObject::alternativeText):
3025         (WebCore::AccessibilityNodeObject::visibleText):
3026         (WebCore::AccessibilityNodeObject::title):
3027         (WebCore::AccessibilityNodeObject::text):
3028         (WebCore::AccessibilityNodeObject::stringValue):
3029         (WebCore::AccessibilityNodeObject::colorValue):
3030         (WebCore::accessibleNameForNode):
3031         * accessibility/AccessibilityRenderObject.cpp:
3032         (WebCore::AccessibilityRenderObject::isFileUploadButton):
3033         (WebCore::AccessibilityRenderObject::stringValue):
3034         (WebCore::AccessibilityRenderObject::labelElementContainer):
3035         (WebCore::AccessibilityRenderObject::internalLinkElement):
3036         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
3037         (WebCore::AccessibilityRenderObject::url):
3038         (WebCore::AccessibilityRenderObject::setValue):
3039         (WebCore::AccessibilityRenderObject::getDocumentLinks):
3040         (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
3041         (WebCore::AccessibilityRenderObject::accessibilityHitTest):
3042         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3043         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
3044         (WebCore::AccessibilityRenderObject::stringValueForMSAA):
3045         (WebCore::AccessibilityRenderObject::isLinked):
3046         * accessibility/AccessibilitySlider.cpp:
3047         (WebCore::AccessibilitySlider::inputElement):
3048         (WebCore::AccessibilitySliderThumb::elementRect):
3049         * accessibility/AccessibilityTable.cpp:
3050         (WebCore::AccessibilityTable::tableElement):
3051         (WebCore::AccessibilityTable::title):
3052         * accessibility/atk/AXObjectCacheAtk.cpp:
3053         (WebCore::notifyChildrenSelectionChange):
3054         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
3055         (optionFromSelection):
3056         (webkitAccessibleSelectionGetSelectionCount):
3057         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
3058         (webkitAccessibleTableGetCaption):
3059         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3060         (webkitAccessibleGetDescription):
3061         * accessibility/ios/AccessibilityObjectIOS.mm:
3062         (WebCore::AccessibilityObject::accessibilityPasswordFieldLength):
3063         * bindings/js/JSDOMWindowCustom.cpp:
3064         (WebCore::namedItemGetter):
3065         (WebCore::JSDOMWindow::getOwnPropertySlot):
3066         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
3067         * bindings/js/JSHTMLDocumentCustom.cpp:
3068         (WebCore::JSHTMLDocument::nameGetter):
3069         * bindings/js/JSHTMLFrameSetElementCustom.cpp:
3070         (WebCore::JSHTMLFrameSetElement::nameGetter):
3071         * bindings/js/JSNodeCustom.cpp:
3072         (WebCore::isReachableFromDOM):
3073         * css/SelectorChecker.cpp:
3074         (WebCore::SelectorChecker::checkOne):
3075         * css/SelectorCheckerTestFunctions.h:
3076         (WebCore::isChecked):
3077         * css/StyleResolver.cpp:
3078         (WebCore::StyleResolver::adjustRenderStyle):
3079         * css/StyleSheetList.cpp:
3080         (WebCore::StyleSheetList::getNamedItem):
3081         * cssjit/SelectorCompiler.cpp:
3082         (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
3083         (WebCore::SelectorCompiler::makeElementStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
3084         (WebCore::SelectorCompiler::isPlaceholderShown):
3085         * dom/CurrentScriptIncrementer.h:
3086         (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
3087         * dom/DataTransfer.cpp:
3088         (WebCore::DataTransfer::setDragImage):
3089         * dom/Document.cpp:
3090         (WebCore::Document::setTitle):
3091         (WebCore::Document::processHttpEquiv):
3092         (WebCore::Document::iconURLs):
3093         * dom/DocumentOrderedMap.cpp:
3094         (WebCore::keyMatchesMapName):
3095         (WebCore::keyMatchesLowercasedMapName):
3096         (WebCore::keyMatchesLowercasedUsemap):
3097         (WebCore::DocumentOrderedMap::getElementByMapName):
3098         (WebCore::DocumentOrderedMap::getElementByLowercasedMapName):
3099         (WebCore::DocumentOrderedMap::getElementByLowercasedUsemap):
3100         (WebCore::DocumentOrderedMap::getElementByLabelForAttribute):
3101         * dom/DocumentStyleSheetCollection.cpp:
3102         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
3103         * dom/Element.cpp:
3104         (WebCore::Element::insertedInto):
3105         (WebCore::Element::removedFrom):
3106         (WebCore::Element::updateName):
3107         (WebCore::Element::updateId):
3108         (WebCore::Element::updateLabel):
3109         (WebCore::Element::ensureCachedHTMLCollection):
3110         * dom/EventDispatcher.cpp:
3111         (WebCore::EventDispatcher::dispatchEvent):
3112         * dom/ScriptElement.cpp:
3113         (WebCore::toScriptElementIfPossible):
3114         * dom/VisitedLinkState.cpp:
3115         (WebCore::linkHashForElement):
3116         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
3117         * dom/make_names.pl:
3118         (printTypeHelpers):
3119         * editing/Editor.cpp:
3120         (WebCore::Editor::selectionForCommand):
3121         (WebCore::imageElementFromImageDocument):
3122         (WebCore::findFirstMarkable):
3123         * editing/FrameSelection.cpp:
3124         (WebCore::FrameSelection::selectAll):
3125         (WebCore::scanForForm):
3126         * editing/MarkupAccumulator.cpp:
3127         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
3128         * editing/ReplaceSelectionCommand.cpp:
3129         (WebCore::ReplaceSelectionCommand::shouldPerformSmartReplace):
3130         * editing/VisibleSelection.cpp:
3131         (WebCore::VisibleSelection::nonBoundaryShadowTreeRootNode):
3132         (WebCore::VisibleSelection::isInPasswordField):
3133         * editing/cocoa/HTMLConverter.mm:
3134         (HTMLConverter::_processElement):
3135         * editing/ios/EditorIOS.mm:
3136         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
3137         * editing/markup.cpp:
3138         (WebCore::isPlainTextMarkup):
3139         * html/ColorInputType.cpp:
3140         (WebCore::ColorInputType::suggestions):
3141         * html/FTPDirectoryDocument.cpp:
3142         (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
3143         (WebCore::FTPDirectoryDocumentParser::createBasicDocument):
3144         * html/FormAssociatedElement.cpp:
3145         (WebCore::FormAssociatedElement::findAssociatedForm):
3146         * html/HTMLAnchorElement.cpp:
3147         (WebCore::appendServerMapMousePosition):
3148         * html/HTMLAreaElement.cpp:
3149         (WebCore::HTMLAreaElement::imageElement):
3150         * html/HTMLCollection.cpp:
3151         (WebCore::isMatchingElement):
3152         * html/HTMLElement.cpp:
3153         (WebCore::HTMLElement::matchesReadWritePseudoClass):
3154         (WebCore::HTMLElement::setInnerHTML):
3155         (WebCore::HTMLElement::directionality):
3156         * html/HTMLEmbedElement.cpp:
3157         (WebCore::HTMLEmbedElement::rendererIsNeeded):
3158         * html/HTMLFieldSetElement.cpp:
3159         (WebCore::HTMLFieldSetElement::refreshElementsIfNeeded):
3160         * html/HTMLFormControlElement.cpp:
3161         (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor):
3162         (WebCore::shouldAutofocus):
3163         * html/HTMLFormControlsCollection.cpp:
3164         (WebCore::HTMLFormControlsCollection::formControlElements):
3165         (WebCore::HTMLFormControlsCollection::formImageElements):
3166         * html/HTMLFormElement.cpp:
3167         (WebCore::HTMLFormElement::getTextFieldValues):
3168         (WebCore::HTMLFormElement::assertItemCanBeInPastNamesMap):
3169         * html/HTMLImageElement.cpp:
3170         (WebCore::HTMLImageElement::parseAttribute):
3171         * html/HTMLImageLoader.cpp:
3172         (WebCore::HTMLImageLoader::notifyFinished):
3173         * html/HTMLInputElement.cpp:
3174         (WebCore::HTMLInputElement::dataList):
3175         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
3176         * html/HTMLKeygenElement.cpp:
3177         (WebCore::HTMLKeygenElement::shadowSelect):
3178         * html/HTMLLegendElement.cpp:
3179         (WebCore::HTMLLegendElement::virtualForm):
3180         * html/HTMLMediaElement.cpp:
3181         (WebCore::HTMLMediaElement::parseAttribute):
3182         * html/HTMLNameCollection.cpp:
3183         (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
3184         (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
3185         (WebCore::DocumentNameCollection::elementMatches):
3186         * html/HTMLObjectElement.cpp:
3187         (WebCore::HTMLObjectElement::updateDocNamedItem):
3188         (WebCore::HTMLObjectElement::containsJavaApplet):
3189         * html/HTMLOptGroupElement.cpp:
3190         (WebCore::HTMLOptGroupElement::recalcSelectOptions):
3191         (WebCore::HTMLOptGroupElement::ownerSelectElement):
3192         * html/HTMLOptionElement.cpp:
3193         (WebCore::HTMLOptionElement::ownerDataListElement):
3194         (WebCore::HTMLOptionElement::ownerSelectElement):
3195         * html/HTMLOptionsCollection.cpp:
3196         (WebCore::HTMLOptionsCollection::add):
3197         * html/HTMLOptionsCollection.h:
3198         * html/HTMLPlugInImageElement.cpp:
3199         (WebCore::addPlugInsFromNodeListMatchingPlugInOrigin):
3200         * html/HTMLSelectElement.cpp:
3201         (WebCore::HTMLSelectElement::hasPlaceholderLabelOption):
3202         (WebCore::HTMLSelectElement::value):
3203         (WebCore::HTMLSelectElement::setValue):
3204         (WebCore::HTMLSelectElement::saveLastSelection):
3205         (WebCore::HTMLSelectElement::setActiveSelectionAnchorIndex):
3206         (WebCore::HTMLSelectElement::updateListBoxSelection):
3207         (WebCore::HTMLSelectElement::listBoxOnChange):
3208         (WebCore::HTMLSelectElement::recalcListItems):
3209         (WebCore::HTMLSelectElement::selectedIndex):
3210         (WebCore::HTMLSelectElement::selectOption):
3211         (WebCore::HTMLSelectElement::deselectItemsWithoutValidation):
3212         (WebCore::HTMLSelectElement::saveFormControlState):
3213         (WebCore::HTMLSelectElement::searchOptionsForValue):
3214         (WebCore::HTMLSelectElement::restoreFormControlState):
3215         (WebCore::HTMLSelectElement::appendFormData):
3216         (WebCore::HTMLSelectElement::reset):
3217         (WebCore::HTMLSelectElement::updateSelectedState):
3218         (WebCore::HTMLSelectElement::lastSelectedListIndex):
3219         (WebCore::HTMLSelectElement::optionAtIndex):
3220         (WebCore::HTMLSelectElement::accessKeySetSelectedIndex):
3221         * html/HTMLSummaryElement.cpp:
3222         (WebCore::HTMLSummaryElement::detailsElement):
3223         * html/HTMLTableElement.cpp:
3224         (WebCore::HTMLTableElement::caption):
3225         * html/HTMLTablePartElement.cpp:
3226         (WebCore::HTMLTablePartElement::findParentTable):
3227         * html/HTMLTableRowElement.cpp:
3228         (WebCore::HTMLTableRowElement::rowIndex):
3229         * html/HTMLTableRowsCollection.cpp:
3230         (WebCore::HTMLTableRowsCollection::rowAfter):
3231         (WebCore::HTMLTableRowsCollection::lastRow):
3232         (WebCore::HTMLTableRowsCollection::customElementAfter):
3233         * html/HTMLTableRowsCollection.h:
3234         * html/HTMLTemplateElement.cpp:
3235         (WebCore::HTMLTemplateElement::cloneNode):
3236         * html/HTMLTextFormControlElement.cpp:
3237         (WebCore::enclosingTextFormControl):
3238         * html/ImageDocument.cpp:
3239         (WebCore::ImageDocument::createDocumentStructure):
3240         * html/LabelsNodeList.cpp:
3241         (WebCore::LabelsNodeList::elementMatches):
3242         * html/MediaDocument.cpp:
3243         (WebCore::MediaDocumentParser::createDocumentStructure):
3244         (WebCore::descendentVideoElement):
3245         (WebCore::ancestorVideoElement):
3246         (WebCore::MediaDocument::replaceMediaElementTimerFired):
3247         * html/PluginDocument.cpp:
3248         (WebCore::PluginDocumentParser::createDocumentStructure):
3249         * html/RadioInputType.cpp:
3250         (WebCore::RadioInputType::handleKeydownEvent):
3251         (WebCore::RadioInputType::isKeyboardFocusable):
3252         * html/RadioNodeList.cpp:
3253         (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter):
3254         * html/RangeInputType.cpp:
3255         (WebCore::RangeInputType::updateTickMarkValues):
3256         * html/parser/HTMLConstructionSite.cpp:
3257         (WebCore::insert):
3258         (WebCore::HTMLConstructionSite::insertTextNode):
3259         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
3260         * html/parser/HTMLTreeBuilder.cpp:
3261         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
3262         * html/shadow/DetailsMarkerControl.cpp:
3263         (WebCore::DetailsMarkerControl::rendererIsNeeded):
3264         * html/shadow/MediaControlElements.cpp:
3265         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
3266         * html/shadow/MeterShadowElement.cpp:
3267         (WebCore::MeterShadowElement::meterElement):
3268         * html/shadow/ProgressShadowElement.cpp:
3269         (WebCore::ProgressShadowElement::progressElement):
3270         * html/shadow/TextControlInnerElements.cpp:
3271         (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
3272         (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
3273         (WebCore::SearchFieldCancelButtonElement::willRespondToMouseClickEvents):
3274         * inspector/InspectorCSSAgent.cpp:
3275         (WebCore::InspectorCSSAgent::viaInspectorStyleSheet):
3276         * inspector/InspectorDOMAgent.cpp:
3277         (WebCore::InspectorDOMAgent::buildObjectForNode):
3278         * loader/FormSubmission.cpp:
3279         (WebCore::FormSubmission::create):
3280         * loader/FrameLoader.cpp:
3281         (WebCore::FrameLoader::handleFallbackContent):
3282         * loader/ImageLoader.cpp:
3283         (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
3284         * loader/SubframeLoader.cpp:
3285         (WebCore::SubframeLoader::requestObject):
3286         * page/Chrome.cpp:
3287         (WebCore::Chrome::setToolTip):
3288         * page/DragController.cpp:
3289         (WebCore::DragController::draggableElement):
3290         * page/EventHandler.cpp:
3291         (WebCore::isSubmitImage):
3292         * page/FocusController.cpp:
3293         (WebCore::FocusController::advanceFocusDirectionally):
3294         * page/FrameView.cpp:
3295         (WebCore::FrameView::addEmbeddedObjectToUpdate):
3296         (WebCore::FrameView::updateEmbeddedObject):
3297         * page/PageSerializer.cpp:
3298         (WebCore::PageSerializer::serializeFrame):
3299         * page/SpatialNavigation.cpp:
3300         (WebCore::FocusCandidate::FocusCandidate):
3301         * page/ios/FrameIOS.mm:
3302         (WebCore::ancestorRespondingToClickEvents):
3303         * rendering/HitTestResult.cpp:
3304         (WebCore::HitTestResult::altDisplayString):
3305         (WebCore::HitTestResult::absolutePDFURL):
3306         (WebCore::HitTestResult::enterFullscreenForVideo):
3307         (WebCore::HitTestResult::mediaControlsEnabled):
3308         (WebCore::HitTestResult::isLiveLink):
3309         (WebCore::HitTestResult::isContentEditable):
3310         * rendering/RenderButton.cpp:
3311         (WebCore::RenderButton::updateFromElement):
3312         * rendering/RenderCounter.cpp:
3313         (WebCore::planCounter):
3314         * rendering/RenderEmbeddedObject.cpp:
3315         (WebCore::RenderEmbeddedObject::paintContents):
3316         (WebCore::RenderEmbeddedObject::layout):
3317         * rendering/RenderFieldset.h:
3318         * rendering/RenderFileUploadControl.cpp:
3319         (WebCore::RenderFileUploadControl::inputElement):
3320         (WebCore::RenderFileUploadControl::uploadButton):
3321         * rendering/RenderFrame.cpp:
3322         (WebCore::RenderFrame::frameElement):
3323         * rendering/RenderFrameSet.cpp:
3324         (WebCore::RenderFrameSet::frameSetElement):
3325         * rendering/RenderHTMLCanvas.cpp:
3326         (WebCore::RenderHTMLCanvas::canvasElement):
3327         * rendering/RenderIFrame.cpp:
3328         (WebCore::RenderIFrame::iframeElement):
3329         * rendering/RenderImage.cpp:
3330         (WebCore::RenderImage::RenderImage):
3331         (WebCore::RenderImage::paintAreaElementFocusRing):
3332         (WebCore::RenderImage::paintIntoRect):
3333         (WebCore::RenderImage::imageMap):
3334         (WebCore::RenderImage::updateAltText):
3335         * rendering/RenderLayerBacking.cpp:
3336         (WebCore::canvasCompositingStrategy):
3337         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
3338         (WebCore::RenderLayerBacking::updateConfiguration):
3339         * rendering/RenderLayerCompositor.cpp:
3340         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
3341         * rendering/RenderListBox.cpp:
3342         (WebCore::RenderListBox::selectElement):
3343         (WebCore::RenderListBox::updateFromElement):
3344         (WebCore::RenderListBox::paintItemForeground):
3345         (WebCore::RenderListBox::paintItemBackground):
3346         * rendering/RenderListItem.cpp:
3347         (WebCore::RenderListItem::calcValue):
3348         (WebCore::RenderListItem::updateListMarkerNumbers):
3349         * rendering/RenderMarquee.cpp:
3350         (WebCore::RenderMarquee::marqueeSpeed):
3351         * rendering/RenderMenuList.cpp:
3352         (WebCore::selectedOptionCount):
3353         (RenderMenuList::selectElement):
3354         (RenderMenuList::updateOptionsWidth):
3355         (RenderMenuList::setTextFromOption):
3356         (RenderMenuList::itemText):
3357         (RenderMenuList::itemIsSelected):
3358         * rendering/RenderMeter.cpp:
3359         (WebCore::RenderMeter::meterElement):
3360         * rendering/RenderProgress.cpp:
3361         (WebCore::RenderProgress::progressElement):
3362         * rendering/RenderSlider.cpp:
3363         (WebCore::RenderSlider::element):
3364         * rendering/RenderSnapshottedPlugIn.cpp:
3365         (WebCore::RenderSnapshottedPlugIn::plugInImageElement):
3366         * rendering/RenderTextControl.cpp:
3367         (WebCore::RenderTextControl::textFormControlElement):
3368         * rendering/RenderTextControlMultiLine.cpp:
3369         (WebCore::RenderTextControlMultiLine::textAreaElement):
3370         * rendering/RenderTextControlSingleLine.cpp:
3371         (WebCore::RenderTextControlSingleLine::inputElement):
3372         * rendering/RenderTheme.cpp:
3373         (WebCore::RenderTheme::paintSliderTicks):
3374         * rendering/RenderThemeIOS.mm:
3375         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
3376         * rendering/RenderThemeMac.mm:
3377         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
3378         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
3379         * rendering/RenderVideo.cpp:
3380         (WebCore::RenderVideo::videoElement):
3381         * svg/graphics/SVGImageCache.cpp:
3382         (WebCore::SVGImageCache::imageForRenderer):
3383         * svg/svgtags.in:
3384         Generate helpers to SVGAElement so that isSVGAElement() can be used
3385         instead of hasTagName(SVGNames::aTag). I did such update in this
3386         patch.
3387
3388         * testing/Internals.cpp:
3389         (WebCore::Internals::visiblePlaceholder):
3390         (WebCore::Internals::wasLastChangeUserEdit):
3391         (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks):
3392         (WebCore::Internals::isSelectPopupVisible):
3393         * xml/parser/XMLDocumentParserLibxml2.cpp:
3394         (WebCore::XMLDocumentParser::startElementNs):
3395
3396 2014-09-23  Chris Dumez  <cdumez@apple.com>
3397
3398         Have DataTransfer::files() return a reference
3399         https://bugs.webkit.org/show_bug.cgi?id=137039
3400
3401         Reviewed by Ryosuke Niwa.
3402
3403         Have DataTransfer::files() return a reference instead of a pointer as
3404         it can never return null.
3405
3406         No new tests, no behavior change.
3407
3408         * dom/DataTransfer.cpp:
3409         (WebCore::DataTransfer::files):
3410         * dom/DataTransfer.h:
3411
3412 2014-09-23  Chris Dumez  <cdumez@apple.com>
3413
3414         Have NamedNodeMap::element() and DOMStringMap::element() return a reference
3415         https://bugs.webkit.org/show_bug.cgi?id=137040
3416
3417         Reviewed by Ryosuke Niwa.
3418
3419         Have NamedNodeMap::element() and DOMStringMap::element() return a
3420         reference instead of a pointer as they can never return null.
3421
3422         No new tests, no behavior change.
3423
3424         * dom/DatasetDOMStringMap.h:
3425         * dom/NamedNodeMap.h:
3426         (WebCore::NamedNodeMap::element):
3427
3428 2014-09-23  Chris Dumez  <cdumez@apple.com>
3429
3430         Have DOMImplementation::document() and Element::attributes() return references
3431         https://bugs.webkit.org/show_bug.cgi?id=137035
3432
3433         Reviewed by Andreas Kling.
3434
3435         Have DOMImplementation::document() and Element::attributes() return
3436         references instead of pointers as they can never return null.
3437
3438         No new tests, no behavior change.
3439
3440         * bindings/scripts/CodeGeneratorJS.pm:
3441         (GenerateImplementation):
3442         Update the JS Bindings code generator to use WTF::getPtr() in a couple
3443         more places so that the implementation can return references instead
3444         of pointers even when [GenerateIsReachable=xxx] IDL extended attribute
3445         is used.
3446
3447         * dom/DOMImplementation.h:
3448         (WebCore::DOMImplementation::document):
3449         * dom/Element.cpp:
3450         (WebCore::Element::attributes):
3451         * dom/Element.h:
3452         (WebCore::Node::attributes):
3453
3454 2014-09-23  Chris Dumez  <cdumez@apple.com>
3455
3456         Have Document::ensureTemplateDocument() return a reference
3457         https://bugs.webkit.org/show_bug.cgi?id=137033
3458
3459         Reviewed by Ryosuke Niwa.
3460
3461         Have Document::ensureTemplateDocument() return a reference instead of
3462         a pointer as it can never return null.
3463
3464         No new tests, no behavior change.
3465
3466         * dom/Document.cpp:
3467         (WebCore::Document::ensureTemplateDocument):
3468         * dom/Document.h:
3469         * editing/markup.cpp:
3470         (WebCore::createFragmentForInnerOuterHTML):
3471         * html/HTMLTemplateElement.cpp:
3472         (WebCore::HTMLTemplateElement::content):
3473         (WebCore::HTMLTemplateElement::didMoveToNewDocument):
3474
3475 2014-09-23  Chris Dumez  <cdumez@apple.com>
3476
3477         Have Document::accessSVGExtensions() return a reference
3478         https://bugs.webkit.org/show_bug.cgi?id=137030
3479
3480         Reviewed by Ryosuke Niwa.
3481
3482         Have Document::accessSVGExtensions() return a reference instead of a
3483         pointer as it can never return null.
3484
3485         No new tests, no behavior change.
3486
3487         * dom/ContainerNode.cpp:
3488         (WebCore::ContainerNode::removeChild):
3489         (WebCore::ContainerNode::removeChildren):
3490         * dom/Document.cpp:
3491         (WebCore::Document::commonTeardown):
3492         (WebCore::Document::implicitClose):
3493         (WebCore::Document::accessSVGExtensions):
3494         * dom/Document.h:
3495         * dom/Element.cpp:
3496         (WebCore::Element::~Element):
3497         (WebCore::Element::removedFrom):
3498         * editing/markup.cpp:
3499         (WebCore::isPlainTextMarkup):
3500         * history/CachedFrame.cpp:
3501         (WebCore::CachedFrameBase::restore):
3502         * rendering/FilterEffectRenderer.cpp:
3503         (WebCore::FilterEffectRenderer::buildReferenceFilter):
3504         * rendering/svg/RenderSVGResource.cpp:
3505         (WebCore::removeFromCacheAndInvalidateDependencies):
3506         * rendering/svg/RenderSVGResourceContainer.cpp:
3507         (WebCore::svgExtensionsFromElement):
3508         * rendering/svg/RenderSVGResourceContainer.h:
3509         (WebCore::getRenderSVGResourceContainerById):
3510         (WebCore::getRenderSVGResourceById):
3511         * rendering/svg/SVGResources.cpp:
3512         (WebCore::registerPendingResource):
3513         (WebCore::SVGResources::buildCachedResources):
3514         * rendering/svg/SVGResourcesCache.cpp:
3515         (WebCore::resourcesCacheFromRenderer):
3516         (WebCore::SVGResourcesCache::resourceDestroyed):
3517         * svg/SVGElement.cpp:
3518         (WebCore::SVGElement::~SVGElement):
3519         (WebCore::SVGElement::reportAttributeParsingError):
3520         (WebCore::SVGElement::removedFrom):
3521         (WebCore::SVGElement::viewportElement):
3522         (WebCore::SVGElement::attributeChanged):
3523         (WebCore::SVGElement::buildPendingResourcesIfNeeded):
3524         (WebCore::SVGElement::accessDocumentSVGExtensions): Deleted.
3525         * svg/SVGElement.h:
3526         * svg/SVGFEConvolveMatrixElement.cpp:
3527         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
3528         * svg/SVGFEGaussianBlurElement.cpp:
3529         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
3530         * svg/SVGFEImageElement.cpp:
3531         (WebCore::SVGFEImageElement::clearResourceReferences):
3532         (WebCore::SVGFEImageElement::buildPendingResource):
3533         * svg/SVGFitToViewBox.cpp:
3534         (WebCore::SVGFitToViewBox::parseViewBox):
3535         * svg/SVGFontFaceElement.cpp:
3536         (WebCore::SVGFontFaceElement::insertedInto):
3537         (WebCore::SVGFontFaceElement::removedFrom):
3538         * svg/SVGMPathElement.cpp:
3539         (WebCore::SVGMPathElement::buildPendingResource):
3540         (WebCore::SVGMPathElement::clearResourceReferences):
3541         * svg/SVGPathElement.cpp:
3542         (WebCore::SVGPathElement::parseAttribute):
3543         (WebCore::SVGPathElement::invalidateMPathDependencies):
3544         * svg/SVGPolyElement.cpp:
3545         (WebCore::SVGPolyElement::parseAttribute):
3546         * svg/SVGSVGElement.cpp:
3547         (WebCore::SVGSVGElement::~SVGSVGElement):
3548         (WebCore::SVGSVGElement::insertedInto):
3549         (WebCore::SVGSVGElement::removedFrom):
3550         * svg/SVGTRefElement.cpp:
3551         (WebCore::SVGTRefElement::detachTarget):
3552         (WebCore::SVGTRefElement::buildPendingResource):
3553         * svg/SVGTextPathElement.cpp:
3554         (WebCore::SVGTextPathElement::clearResourceReferences):
3555         (WebCore::SVGTextPathElement::buildPendingResource):
3556         * svg/SVGUseElement.cpp:
3557         (WebCore::SVGUseElement::clearResourceReferences):
3558         (WebCore::SVGUseElement::buildPendingResource):
3559         (WebCore::SVGUseElement::toClipPath):
3560         (WebCore::SVGUseElement::buildInstanceTree):
3561         * svg/animation/SVGSMILElement.cpp:
3562         (WebCore::SVGSMILElement::clearResourceReferences):
3563         (WebCore::SVGSMILElement::buildPendingResource):
3564
3565 2014-09-23  Joseph Pecoraro  <pecoraro@apple.com>
3566
3567         Web Inspector: Should be able to attach a debugger to a JSContext before anything is executed
3568         https://bugs.webkit.org/show_bug.cgi?id=136893
3569
3570         Reviewed by Timothy Hatcher.
3571
3572         Automatic inspection is currently disabled for web pages.
3573         This just updates the interfaces that changed.
3574
3575         * WebCore.exp.in:
3576         * inspector/InspectorController.cpp:
3577         (WebCore::InspectorController::connectFrontend):
3578         (WebCore::InspectorController::show):
3579         * inspector/InspectorController.h:
3580         * page/PageDebuggable.cpp:
3581         (WebCore::PageDebuggable::connect):
3582         * page/PageDebuggable.h:
3583         * testing/Internals.cpp:
3584         (WebCore::Internals::openDummyInspectorFrontend):
3585
3586 2014-09-23  Eduardo Lima Mitev  <elima@igalia.com>
3587
3588         [GTK] Adds implementation of subtle crypto HMAC algorithm
3589         https://bugs.webkit.org/show_bug.cgi?id=133320
3590
3591         Reviewed by Philippe Normand.
3592
3593         Tests are already in place under crypto/subtle/hmac-*.html
3594
3595         * crypto/gtk/CryptoAlgorithmHMACGtk.cpp:
3596         (WebCore::getGnutlsDigestAlgorithm):
3597         (WebCore::calculateSignature):
3598         (WebCore::CryptoAlgorithmHMAC::platformSign):
3599         (WebCore::CryptoAlgorithmHMAC::platformVerify):
3600
3601 2014-09-23  Eduardo Lima Mitev  <elima@igalia.com>
3602
3603         [GTK] Adds implementation of Subtle Crypto digest algorithms
3604         https://bugs.webkit.org/show_bug.cgi?id=133319
3605
3606         Reviewed by Philippe Normand.
3607
3608         Tests are already in place under crypto/subtle/sha-*.html
3609
3610         * crypto/gtk/CryptoDigestGtk.cpp:
3611         (WebCore::CryptoDigest::CryptoDigest):
3612         (WebCore::CryptoDigest::~CryptoDigest):
3613         (WebCore::CryptoDigest::create):
3614         (WebCore::CryptoDigest::addBytes):
3615         (WebCore::CryptoDigest::computeHash):
3616
3617 2014-09-15  Sergio Villar Senin  <svillar@igalia.com>
3618
3619         [CSS Grid Layout] Do not grow tracks when the growth factor is 0
3620         https://bugs.webkit.org/show_bug.cgi?id=136575
3621
3622         Reviewed by Darin Adler.
3623
3624         A couple of performance optimizations for the track sizing
3625         algorithm. On the one hand we avoid the computation of the
3626         available logical space share if the track has no growth potential
3627         (the current breadth is the maximum breadth) and on the other
3628         hand, we avoid calling RenderGrid::distributeSpaceToTracks() if
3629         the available logical space is not greater than 0.
3630
3631         The combined effect of these two changes is an impressive +16%
3632         improvement in auto-grid-lots-of-data.html performance test.
3633
3634         No new tests as there is no change in the functionality.
3635
3636         * rendering/RenderGrid.cpp:
3637         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
3638         (WebCore::RenderGrid::distributeSpaceToTracks):
3639
3640 2014-09-23  Ion Rosca  <rosca@adobe.com>
3641
3642         [CSS Blending] The composited layers isolated by the page group should blend with the default white background color.
3643         https://bugs.webkit.org/show_bug.cgi?id=136563
3644
3645         Reviewed by Simon Fraser.
3646
3647         If a blending layer is not isolated, then it should blend with a white backdrop:
3648         http://dev.w3.org/fxtf/compositing-1/#pagebackdrop
3649
3650         Tests: css3/blending/blend-mode-body-composited-child-background-color.html
3651                css3/blending/blend-mode-body-composited-child.html
3652
3653         * rendering/RenderLayerBacking.cpp:
3654         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
3655         If the isolating composited layer is the root renderer, then it should have a backing store
3656         into which the initial white backdrop will be painted.
3657
3658 2014-09-22  Christophe Dumez  <cdumez@apple.com>
3659
3660         Unreviewed build fix after r173859.
3661
3662         Partial revert to fix debug build after r173859.
3663
3664         * accessibility/AccessibilityRenderObject.cpp:
3665         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
3666         * html/HTMLFrameOwnerElement.cpp:
3667         (WebCore::HTMLFrameOwnerElement::getSVGDocument):
3668         * page/EventHandler.cpp:
3669         (WebCore::EventHandler::handleMousePressEvent):
3670         (WebCore::EventHandler::handleMouseMoveEvent):
3671         (WebCore::EventHandler::handleMouseReleaseEvent):
3672         * page/Frame.cpp:
3673         (WebCore::Frame::setPageAndTextZoomFactors):
3674         * page/FrameView.cpp:
3675         (WebCore::FrameView::scrollToAnchor):
3676         * rendering/svg/RenderSVGBlock.h:
3677         (WebCore::RenderSVGBlock::graphicsElement):
3678         * rendering/svg/RenderSVGGradientStop.cpp:
3679         (WebCore::RenderSVGGradientStop::gradientElement):
3680         * rendering/svg/RenderSVGInline.h:
3681         (WebCore::RenderSVGInline::graphicsElement):
3682         * rendering/svg/RenderSVGResourceClipper.cpp:
3683         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
3684         * rendering/svg/RenderSVGResourceContainer.cpp:
3685         (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke):
3686         * rendering/svg/RenderSVGShape.h:
3687         (WebCore::RenderSVGShape::graphicsElement):
3688         * rendering/svg/RenderSVGTransformableContainer.h:
3689         * rendering/svg/SVGRenderSupport.cpp:
3690         (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
3691         * rendering/svg/SVGRenderTreeAsText.cpp:
3692         (WebCore::operator<<):
3693         * rendering/svg/SVGRenderingContext.cpp:
3694         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
3695         * rendering/svg/SVGResources.cpp:
3696         (WebCore::targetReferenceFromResource):
3697         * svg/SVGAElement.cpp:
3698         (WebCore::SVGAElement::defaultEventHandler):
3699         * svg/SVGAnimateElement.cpp:
3700         (WebCore::SVGAnimateElement::calculateAnimatedValue):
3701         * svg/SVGAnimationElement.cpp:
3702         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
3703         * svg/SVGElement.cpp:
3704         (WebCore::SVGElement::getBoundingBox):
3705         * svg/SVGLinearGradientElement.cpp:
3706         (WebCore::SVGLinearGradientElement::collectGradientAttributes):
3707         * svg/SVGLocatable.cpp:
3708         (WebCore::SVGLocatable::getTransformToElement):
3709         * svg/SVGPolyElement.cpp:
3710         (WebCore::SVGPolyElement::synchronizePoints):
3711         (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
3712         * svg/SVGRadialGradientElement.cpp:
3713         (WebCore::SVGRadialGradientElement::collectGradientAttributes):
3714         * svg/SVGTextContentElement.cpp:
3715         (WebCore::SVGTextContentElement::synchronizeTextLength):
3716         (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
3717         (WebCore::SVGTextContentElement::elementFromRenderer):
3718         * svg/SVGUseElement.cpp:
3719         (WebCore::SVGUseElement::toClipPath):
3720         * svg/animation/SVGSMILElement.cpp:
3721         (WebCore::SVGSMILElement::connectConditions):
3722         (WebCore::SVGSMILElement::disconnectConditions):
3723         * svg/graphics/SVGImage.cpp:
3724         (WebCore::SVGImage::hasSingleSecurityOrigin):
3725         (WebCore::SVGImage::setContainerSize):
3726         (WebCore::SVGImage::containerSize):
3727         (WebCore::SVGImage::embeddedContentBox):
3728         (WebCore::SVGImage::hasRelativeWidth):
3729         (WebCore::SVGImage::hasRelativeHeight):
3730         (WebCore::SVGImage::computeIntrinsicDimensions):
3731         (WebCore::SVGImage::startAnimation):
3732         (WebCore::SVGImage::stopAnimation):
3733
3734 2014-09-22  Simon Fraser  <simon.fraser@apple.com>
3735
3736         Ensure that layout is up-to-date before hit-testing via RenderView
3737         https://bugs.webkit.org/show_bug.cgi?id=136651
3738
3739         Reviewed by David Hyatt.
3740
3741         Ensure that layout is up-to-date before we do hit-testing via the RenderView.
3742         Previously, RenderLayer::hitTest() called updateLayout(), but it's better
3743         to push that responsibility onto RenderView before entering the RenderLayer
3744         tree.
3745         
3746         Make callers a little more consistent in getting the RenderView via
3747         Frame::contentRenderer(), though perhaps we should remove that and just
3748         call Document::renderView() everywhere.
3749
3750         * accessibility/AccessibilityObject.cpp:
3751         (WebCore::AccessibilityObject::press): Hit test via the RenderView, rather
3752         than doing so on the RenderView's layer, to ensure that we updateLayout().
3753         * accessibility/AccessibilityRenderObject.cpp:
3754         (WebCore::AccessibilityRenderObject::accessibilityHitTest): This code calls
3755         hitTest() on arbitrary layers, so needs to explicitly update layout.
3756         * editing/FrameSelection.cpp:
3757         (WebCore::FrameSelection::contains):
3758         * page/EventHandler.cpp:
3759         (WebCore::EventHandler::eventMayStartDrag):
3760         (WebCore::EventHandler::updateSelectionForMouseDrag):
3761         (WebCore::EventHandler::hitTestResultAtPoint): The explicit updateLayout() is
3762         no longer needed.
3763         (WebCore::EventHandler::updateCursor):
3764         (WebCore::EventHandler::handleWheelEvent):
3765         (WebCore::EventHandler::hoverTimerFired):
3766         (WebCore::hitTestResultInFrame):
3767         * page/Frame.cpp:
3768         (WebCore::Frame::contentRenderer):
3769         * rendering/RenderLayer.cpp:
3770         (WebCore::RenderLayer::hitTest):
3771         * rendering/RenderView.cpp:
3772         (WebCore::RenderView::hitTest): Here's where we ensure that layout is up-to-date.
3773
3774 2014-09-22  Christophe Dumez  <cdumez@apple.com>
3775
3776         Use downcast<SVG*Element>() instead of toSVG*Element()
3777         https://bugs.webkit.org/show_bug.cgi?id=137004
3778
3779         Reviewed by Benjamin Poulain.
3780
3781         Use downcast<SVG*Element>() instead of toSVG*Element() for casting SVG
3782         Elements and get rid of the transition toSVG*Element() macros.
3783
3784         Also use downcast<MathML*Element>() instead of toMathML*Element() for
3785         casting MathML Elements.
3786
3787         The HTML Elements casting counterparts will be taken care of in a
3788         separate patch.
3789
3790         No new tests, no behavior change.
3791
3792         * accessibility/AccessibilityNodeObject.cpp:
3793         (WebCore::AccessibilityNodeObject::alternativeText):
3794         (WebCore::AccessibilityNodeObject::accessibilityDescription):
3795         * accessibility/AccessibilityRenderObject.cpp:
3796         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
3797         * bindings/js/JSElementCustom.cpp:
3798         (WebCore::toJSNewlyCreated):
3799         * bindings/js/JSNodeCustom.cpp:
3800         (WebCore::createWrapperInline):
3801         * css/CSSComputedStyleDeclaration.cpp:
3802         (WebCore::ComputedStyleExtractor::propertyValue):
3803         * css/CSSCursorImageValue.cpp:
3804         (WebCore::resourceReferencedByCursorElement):
3805         (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
3806         * css/ElementRuleCollector.cpp:
3807         (WebCore::ElementRuleCollector::matchAllRules):
3808         * css/StyleResolver.cpp:
3809         (WebCore::StyleResolver::locateCousinList):
3810         (WebCore::StyleResolver::canShareStyleWithElement):
3811         (WebCore::StyleResolver::locateSharedStyle):
3812         * dom/DocumentStyleSheetCollection.cpp:
3813         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
3814         * dom/Element.cpp:
3815         (WebCore::Element::synchronizeAllAttributes):
3816         (WebCore::Element::synchronizeAttribute):
3817         (WebCore::Element::boundsInRootViewSpace):
3818         (WebCore::Element::getBoundingClientRect):
3819         (WebCore::Element::childShouldCreateRenderer):
3820         (WebCore::Element::fastAttributeLookupAllowed):
3821         * dom/EventDispatcher.cpp:
3822         (WebCore::eventTargetRespectingTargetRules):
3823         * dom/ScriptElement.cpp:
3824         (WebCore::toScriptElementIfPossible):
3825         * dom/make_names.pl:
3826         (printTypeHelpers):
3827         * html/HTMLFrameOwnerElement.cpp:
3828         (WebCore::HTMLFrameOwnerElement::getSVGDocument):
3829         * inspector/InspectorCSSAgent.cpp:
3830         (WebCore::InspectorCSSAgent::viaInspectorStyleSheet):
3831         * mathml/MathMLElement.cpp:
3832         (WebCore::MathMLElement::isPhrasingContent):
3833         (WebCore::MathMLElement::childShouldCreateRenderer):
3834         (WebCore::MathMLElement::attributeChanged):
3835         * mathml/MathMLElement.h:
3836         (WebCore::Node::hasTagName):
3837         * mathml/MathMLSelectElement.cpp:
3838         (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
3839         * page/EventHandler.cpp:
3840         (WebCore::EventHandler::handleMousePressEvent):
3841         (WebCore::EventHandler::handleMouseMoveEvent):
3842         (WebCore::EventHandler::handleMouseReleaseEvent):
3843         (WebCore::instanceAssociatedWithShadowTreeElement):
3844         * page/Frame.cpp:
3845         (WebCore::Frame::setPageAndTextZoomFactors):
3846         * page/FrameView.cpp:
3847         (WebCore::FrameView::scrollToAnchor):
3848         * rendering/RenderTableCell.cpp:
3849         (WebCore::RenderTableCell::parseColSpanFromDOM):
3850         (WebCore::RenderTableCell::parseRowSpanFromDOM):
3851         (WebCore::RenderTableCell::computePreferredLogicalWidths):
3852         * rendering/mathml/RenderMathMLMenclose.cpp:
3853         (WebCore::RenderMathMLMenclose::addChild):
3854         (WebCore::RenderMathMLMenclose::computePreferredLogicalWidths):
3855         (WebCore::RenderMathMLMenclose::updateLogicalHeight):
3856         (WebCore::RenderMathMLMenclose::paint):
3857         * rendering/svg/RenderSVGBlock.h:
3858         (WebCore::RenderSVGBlock::graphicsElement):
3859         * rendering/svg/RenderSVGForeignObject.cpp:
3860         (WebCore::RenderSVGForeignObject::foreignObjectElement):
3861         * rendering/svg/RenderSVGGradientStop.cpp:
3862         (WebCore::RenderSVGGradientStop::gradientElement):
3863         * rendering/svg/RenderSVGGradientStop.h:
3864         * rendering/svg/RenderSVGImage.cpp:
3865         (WebCore::RenderSVGImage::imageElement):
3866         * rendering/svg/RenderSVGInline.h:
3867         (WebCore::RenderSVGInline::graphicsElement):
3868         * rendering/svg/RenderSVGModelObject.cpp:
3869         (WebCore::getElementCTM):
3870         (WebCore::RenderSVGModelObject::checkIntersection):
3871         (WebCore::RenderSVGModelObject::checkEnclosure):
3872         * rendering/svg/RenderSVGModelObject.h:
3873         (WebCore::RenderSVGModelObject::element):
3874         * rendering/svg/RenderSVGRect.cpp:
3875         (WebCore::RenderSVGRect::rectElement):
3876         * rendering/svg/RenderSVGResource.cpp:
3877         (WebCore::removeFromCacheAndInvalidateDependencies):
3878         * rendering/svg/RenderSVGResourceClipper.cpp:
3879         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
3880         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
3881         * rendering/svg/RenderSVGResourceClipper.h:
3882         * rendering/svg/RenderSVGResourceContainer.cpp:
3883         (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke):
3884         * rendering/svg/RenderSVGResourceFilter.h:
3885         * rendering/svg/RenderSVGResourceLinearGradient.h:
3886         * rendering/svg/RenderSVGResourceMarker.h:
3887         * rendering/svg/RenderSVGResourceMasker.h:
3888         * rendering/svg/RenderSVGResourcePattern.cpp:
3889         (WebCore::RenderSVGResourcePattern::patternElement):
3890         * rendering/svg/RenderSVGResourceRadialGradient.h:
3891         * rendering/svg/RenderSVGRoot.cpp:
3892         (WebCore::RenderSVGRoot::svgSVGElement):
3893         * rendering/svg/RenderSVGShape.h:
3894         (WebCore::RenderSVGShape::graphicsElement):
3895         * rendering/svg/RenderSVGText.cpp:
3896         (WebCore::RenderSVGText::textElement):
3897         * rendering/svg/RenderSVGTextPath.cpp:
3898         (WebCore::RenderSVGTextPath::textPathElement):
3899         (WebCore::RenderSVGTextPath::layoutPath):
3900         * rendering/svg/RenderSVGTransformableContainer.cpp:
3901         (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
3902         * rendering/svg/RenderSVGTransformableContainer.h:
3903         * rendering/svg/RenderSVGViewportContainer.cpp:
3904         (WebCore::RenderSVGViewportContainer::svgSVGElement):
3905         * rendering/svg/SVGPathData.cpp:
3906         (WebCore::updatePathFromLineElement):
3907         (WebCore::updatePathFromPathElement):
3908         (WebCore::updatePathFromPolygonElement):
3909         (WebCore::updatePathFromPolylineElement):
3910         * rendering/svg/SVGRenderSupport.cpp:
3911         (WebCore::SVGRenderSupport::layoutChildren):
3912         (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
3913         (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
3914         * rendering/svg/SVGRenderTreeAsText.cpp:
3915         (WebCore::operator<<):
3916         * rendering/svg/SVGRenderingContext.cpp:
3917         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
3918         * rendering/svg/SVGResources.cpp:
3919         (WebCore::targetReferenceFromResource):
3920         (WebCore::SVGResources::buildCachedResources):
3921         * rendering/svg/SVGTextLayoutEngine.cpp:
3922         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath):
3923         * svg/SVGAElement.cpp:
3924         (WebCore::SVGAElement::createElementRenderer):
3925         (WebCore::SVGAElement::defaultEventHandler):
3926         * svg/SVGAltGlyphDefElement.cpp:
3927         (WebCore::SVGAltGlyphDefElement::hasValidGlyphElements):
3928         * svg/SVGAltGlyphElement.cpp:
3929         (WebCore::SVGAltGlyphElement::hasValidGlyphElements):
3930         * svg/SVGAnimateElement.cpp:
3931         (WebCore::SVGAnimateElement::calculateAnimatedValue):
3932         * svg/SVGAnimatedTransformList.cpp:
3933         (WebCore::SVGAnimatedTransformListAnimator::SVGAnimatedTransformListAnimator):
3934         * svg/SVGAnimationElement.cpp:
3935         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
3936         (WebCore::SVGAnimationElement::adjustForInheritance):
3937         * svg/SVGDocument.cpp:
3938         (WebCore::SVGDocument::rootElement):
3939         * svg/SVGElement.cpp:
3940         (WebCore::SVGElement::ownerSVGElement):
3941         (WebCore::SVGElement::viewportElement):
3942         (WebCore::SVGElement::getBoundingBox):
3943         (WebCore::SVGElement::childShouldCreateRenderer):
3944         (WebCore::SVGElement::title):
3945         (WebCore::SVGElement::updateRelativeLengthsInformation):
3946         * svg/SVGElement.h:
3947         (WebCore::Node::hasTagName):
3948         * svg/SVGFEComponentTransferElement.cpp:
3949         (WebCore::SVGFEComponentTransferElement::build):
3950         * svg/SVGFEImageElement.cpp:
3951         (WebCore::SVGFEImageElement::buildPendingResource):
3952         * svg/SVGFilterElement.cpp:
3953         (WebCore::SVGFilterElement::childShouldCreateRenderer):
3954         * svg/SVGFilterPrimitiveStandardAttributes.h:
3955         (WebCore::isSVGFilterPrimitiveStandardAttributes):
3956         * svg/SVGFontData.cpp:
3957         (WebCore::SVGFontData::applySVGGlyphSelection):
3958         * svg/SVGFontElement.cpp:
3959         (WebCore::SVGFontElement::ensureGlyphCache):
3960         * svg/SVGFontFaceElement.cpp:
3961         (WebCore::SVGFontFaceElement::rebuildFontFace):
3962         * svg/SVGFontFaceFormatElement.cpp:
3963         (WebCore::SVGFontFaceFormatElement::childrenChanged):
3964         * svg/SVGFontFaceSrcElement.cpp:
3965         (WebCore::SVGFontFaceSrcElement::srcValue):
3966         (WebCore::SVGFontFaceSrcElement::childrenChanged):
3967         * svg/SVGFontFaceUriElement.cpp:
3968         (WebCore::SVGFontFaceUriElement::childrenChanged):
3969         * svg/SVGGlyphElement.cpp:
3970         (WebCore::SVGGlyphElement::invalidateGlyphCache):
3971         * svg/SVGGraphicsElement.h:
3972         (WebCore::isSVGGraphicsElement):
3973         * svg/SVGHKernElement.cpp:
3974         (WebCore::SVGHKernElement::insertedInto):
3975         (WebCore::SVGHKernElement::removedFrom):
3976         * svg/SVGImageLoader.cpp:
3977         (WebCore::SVGImageLoader::dispatchLoadEvent):
3978         * svg/SVGLengthContext.cpp:
3979         (WebCore::SVGLengthContext::determineViewport):
3980         * svg/SVGLinearGradientElement.cpp:
3981         (WebCore::setGradientAttributes):
3982         (WebCore::SVGLinearGradientElement::collectGradientAttributes):
3983         * svg/SVGLocatable.cpp:
3984         (WebCore::SVGLocatable::nearestViewportElement):
3985         (WebCore::SVGLocatable::farthestViewportElement):
3986         (WebCore::SVGLocatable::computeCTM):
3987         (WebCore::SVGLocatable::getTransformToElement):
3988         * svg/SVGMPathElement.cpp:
3989         (WebCore::SVGMPathElement::buildPendingResource):
3990         (WebCore::SVGMPathElement::pathElement):
3991         (WebCore::SVGMPathElement::notifyParentOfPathChange):
3992         * svg/SVGMarkerElement.cpp:
3993         (WebCore::SVGMarkerElement::synchronizeOrientType):
3994         (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper):
3995         * svg/SVGPathElement.cpp:
3996         (WebCore::SVGPathElement::invalidateMPathDependencies):
3997         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
3998         (WebCore::SVGPathElement::synchronizeD):
3999         * svg/SVGPathSegList.cpp:
4000         (WebCore::SVGPathSegList::commitChange):
4001         * svg/SVGPatternElement.cpp:
4002         (WebCore::SVGPatternElement::collectPatternAttributes):
4003         * svg/SVGPolyElement.cpp:
4004         (WebCore::SVGPolyElement::synchronizePoints):
4005         (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
4006         * svg/SVGRadialGradientElement.cpp:
4007         (WebCore::setGradientAttributes):
4008         (WebCore::SVGRadialGradientElement::collectGradientAttributes):
4009         * svg/SVGSVGElement.cpp:
4010         (WebCore::SVGSVGElement::setupInitialView):
4011         * svg/SVGTextContentElement.cpp:
4012         (WebCore::SVGTextContentElement::synchronizeTextLength):
4013         (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
4014         (WebCore::SVGTextContentElement::elementFromRenderer):
4015         * svg/SVGTextContentElement.h:
4016         (WebCore::isSVGTextContentElement):
4017         * svg/SVGTextPathElement.cpp:
4018         (WebCore::SVGTextPathElement::buildPendingResource):
4019         * svg/SVGUseElement.cpp:
4020         (WebCore::dumpInstanceTree):
4021         (WebCore::SVGUseElement::buildPendingResource):
4022         (WebCore::SVGUseElement::toClipPath):
4023         (WebCore::SVGUseElement::buildInstanceTree):
4024         (WebCore::SVGUseElement::hasCycleUseReferencing):
4025         (WebCore::SVGUseElement::expandUseElementsInShadowTree):
4026         (WebCore::SVGUseElement::associateInstancesWithShadowTreeElements):
4027         * svg/SVGVKernElement.cpp:
4028         (WebCore::SVGVKernElement::insertedInto):
4029         (WebCore::SVGVKernElement::removedFrom):
4030         * svg/SVGViewSpec.cpp: