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