Fix NULL de-refernce in HTMLAnchorElement::sendPings when settings doesn't exist
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-08-12  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Fix NULL de-refernce in HTMLAnchorElement::sendPings when settings doesn't exist
4         https://bugs.webkit.org/show_bug.cgi?id=119716
5
6         Reviewed by Darin Adler.
7
8         Merge https://chromium.googlesource.com/chromium/blink/+/d5783da353ab783e9994b8fbecd91880be5192a1
9
10         No new tests since the test in the Blink change doesn't reproduce crash on WebKit.
11
12         * html/HTMLAnchorElement.cpp:
13         (WebCore::HTMLAnchorElement::sendPings):
14
15 2013-08-12  Seokju Kwon  <seokju@webkit.org>
16
17         Use the correct preprocessor in shouldRepaintFixedBackgroundsOnScroll()
18         https://bugs.webkit.org/show_bug.cgi?id=119710
19
20         Reviewed by Darin Adler.
21
22         No behavior change, no new tests needed.
23
24         * rendering/RenderObject.cpp: Remove unused parameter warning.
25         (WebCore::shouldRepaintFixedBackgroundsOnScroll):
26
27 2013-08-12  Alexey Proskuryakov  <ap@apple.com>
28
29         http/tests/security/sandboxed-iframe-invalid.html is flaky on Mac
30         https://bugs.webkit.org/show_bug.cgi?id=85522
31
32         Reviewed by Andy Estes.
33
34         Drive-by FIXMEs and trivial fixes for WebCore issues I noticed while working
35         on this bug. No behavior change expected.
36
37         * loader/FrameLoader.cpp:
38         (WebCore::FrameLoader::submitForm):
39         (WebCore::FrameLoader::findFrameForNavigation):
40         * loader/NavigationScheduler.cpp:
41         (WebCore::ScheduledFormSubmission::fire):
42
43 2013-08-13  Ryosuke Niwa  <rniwa@webkit.org>
44
45         Fix variable name |end| -> |size| in EventTarget::fireEventListeners
46         https://bugs.webkit.org/show_bug.cgi?id=119715
47
48         Reviewed by Benjamin Poulain.
49
50         Merge https://chromium.googlesource.com/chromium/blink/+/f58b017539c48059bb2b88d18ee0ee3d14decb01
51         and also fix variable names in FiringEventIterator.
52
53         * dom/EventTarget.cpp:
54         (WebCore::EventTarget::removeEventListener):
55         (WebCore::EventTarget::fireEventListeners):
56         (WebCore::EventTarget::removeAllEventListeners):
57         * dom/EventTarget.h:
58         (WebCore::FiringEventIterator::FiringEventIterator):
59
60 2013-08-12  Ryosuke Niwa  <rniwa@webkit.org>
61
62         Encapsulate access to documentNamedItemMap and windowNamedItemMap
63         https://bugs.webkit.org/show_bug.cgi?id=119701
64
65         Reviewed by Darin Adler.
66
67         Encapsulate m_documentNamedItem and m_windowNamedItem by adding various methods on HTMLDocument.
68         This will help us doing more refactorings in the future.
69
70         * bindings/js/JSDOMWindowCustom.cpp:
71         (WebCore::namedItemGetter):
72         (WebCore::JSDOMWindow::getOwnPropertySlot):
73         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
74         (WebCore::JSDOMWindow::getOwnPropertyDescriptor):
75         * bindings/js/JSHTMLDocumentCustom.cpp:
76         (WebCore::JSHTMLDocument::canGetItemsForName):
77         (WebCore::JSHTMLDocument::nameGetter):
78         * dom/Element.cpp:
79         (WebCore::Element::updateNameForDocument):
80         (WebCore::Element::updateIdForDocument):
81         * html/HTMLDocument.cpp:
82         (WebCore::HTMLDocument::addDocumentNamedItem): Added.
83         (WebCore::HTMLDocument::removeDocumentNamedItem): Added.
84         (WebCore::HTMLDocument::addWindowNamedItem): Added.
85         (WebCore::HTMLDocument::removeWindowNamedItem): Added.
86         * html/HTMLDocument.h:
87         (WebCore::HTMLDocument::documentNamedItem): Added.
88         (WebCore::HTMLDocument::hasDocumentNamedItem): Added.
89         (WebCore::HTMLDocument::documentNamedItemContainsMultipleElements): Added.
90         (WebCore::HTMLDocument::windowNamedItem): Added.
91         (WebCore::HTMLDocument::hasWindowNamedItem): Added.
92         (WebCore::HTMLDocument::windowNamedItemContainsMultipleElements): Added.
93         * html/HTMLImageElement.cpp:
94         (WebCore::HTMLImageElement::parseAttribute):
95         * html/HTMLObjectElement.cpp:
96         (WebCore::HTMLObjectElement::updateDocNamedItem):
97
98 2013-08-12  Patrick Gansterer  <paroga@webkit.org>
99
100         [CMake] Use the correct list of files when compiling ANGLESupport on Windows
101         https://bugs.webkit.org/show_bug.cgi?id=119439
102
103         Reviewed by Gyuyoung Kim.
104
105         * CMakeLists.txt: Use ossource_win.cpp instead of ossource_posix.cpp on Windows platforms.
106
107 2013-08-12  Arnaud Renevier  <a.renevier@samsung.com>
108
109         [cairo] memory corruption with putImageData and accelerated canvas.
110         https://bugs.webkit.org/show_bug.cgi?id=118621
111
112         Reviewed by Martin Robinson.
113
114         When we have an accelerated imageBuffer, and we putByteArray with a
115         non zero destPoint, we create temporary surface of sourceSize. Then,
116         we write to image data with an offset. This results in an out of bound
117         write.
118
119         In order to avoid that, we use a 0 offset when writing data.
120
121         In addition, we also create image with the minimal needed size in
122         getImageData, and also use a 0 offset. This decrease data transfer
123         between cpu and gpu
124
125         Instead of the map/unmap mechanism, perform an explicit surface copy
126         when needed. This change also removes an unneeded glReadPixels at the
127         start of putByteArray
128
129         Add two parameters to copyRectFromOneSurfaceToAnother: destination
130         offset, and cairo drawing operator.
131
132         No new tests. Accelerated canvas is not enabled for testing yet.
133
134         * platform/graphics/cairo/CairoUtilities.cpp:
135         (WebCore::copyRectFromOneSurfaceToAnother):
136         * platform/graphics/cairo/CairoUtilities.h:
137         * platform/graphics/cairo/ImageBufferCairo.cpp:
138         (WebCore::copySurfaceToImageAndAdjustRect):
139         (WebCore::getImageData):
140         (WebCore::ImageBuffer::putByteArray):
141
142 2013-08-12  Ryosuke Niwa  <rniwa@webkit.org>
143
144         Use const AtomicStringImpl* in DocumentOrderedMap
145         https://bugs.webkit.org/show_bug.cgi?id=119700
146
147         Reviewed by Benjamin Poulain.
148
149         Use const AtomicStringImpl* in DocumentOrderedMap. It caught at least one bug that HTMLNameCollection'
150         subclasses' nodeMatches were taking const AtomicString& instead of AtomicStringImpl*. This was forcing
151         DocumentOrderedMap::getElementByWindowNamedItem and DocumentOrderedMap::getElementByDocumentNamedItem
152         to create temporary AtomicStrings.
153
154         * dom/DocumentOrderedMap.cpp:
155         (WebCore::keyMatchesId):
156         (WebCore::keyMatchesName):
157         (WebCore::keyMatchesMapName):
158         (WebCore::keyMatchesLowercasedMapName):
159         (WebCore::keyMatchesLabelForAttribute):
160         (WebCore::keyMatchesWindowNamedItem):
161         (WebCore::keyMatchesDocumentNamedItem):
162         (WebCore::DocumentOrderedMap::add):
163         (WebCore::DocumentOrderedMap::remove):
164         (WebCore::DocumentOrderedMap::get):
165         (WebCore::DocumentOrderedMap::getElementById):
166         (WebCore::DocumentOrderedMap::getElementByName):
167         (WebCore::DocumentOrderedMap::getElementByMapName):
168         (WebCore::DocumentOrderedMap::getElementByLowercasedMapName):
169         (WebCore::DocumentOrderedMap::getElementByLabelForAttribute):
170         (WebCore::DocumentOrderedMap::getElementByWindowNamedItem):
171         (WebCore::DocumentOrderedMap::getElementByDocumentNamedItem):
172         (WebCore::DocumentOrderedMap::getAllElementsById):
173         * dom/DocumentOrderedMap.h:
174         (WebCore::DocumentOrderedMap::containsSingle):
175         (WebCore::DocumentOrderedMap::contains):
176         (WebCore::DocumentOrderedMap::containsMultiple):
177         * html/HTMLNameCollection.cpp:
178         (WebCore::WindowNameCollection::nodeMatches):
179         (WebCore::DocumentNameCollection::nodeMatches):
180         * html/HTMLNameCollection.h:
181         (WebCore::WindowNameCollection::nodeMatches):
182         (WebCore::DocumentNameCollection::nodeMatches):
183
184 2013-08-12  Beth Dakin  <bdakin@apple.com>
185
186         The LayoutMilestones didLayout callback should only fire for the main frame
187         https://bugs.webkit.org/show_bug.cgi?id=119457
188
189         Reviewed by Sam Weinig.
190
191         This patch makes it so that FrameLoader::didLayout(LayoutMilestones) is only ever 
192         called for the main frame. Technically this will change existing API for 
193         didFirstVisuallyNonEmptyLayoutInFrame and didFirstLayoutInFrame. Clients used to 
194         be able to register for those callbacks for any frame they wanted, however, now 
195         they will only ever get the callback when it applies to the main frame. We think 
196         that this is acceptable since we don’t know of any clients that ever used those 
197         APIs for a non-main frame. This change also makes nothing but sense for the 
198         didLayout(LayoutMilestones) callback, since that is a Page-level concept, so it 
199         should only fire for the main frame.
200
201         Only call didLayout for the main frame.
202         * dom/Document.cpp:
203         (WebCore::Document::setVisualUpdatesAllowed):
204
205         Assert that this is the main frame.
206         * loader/FrameLoader.cpp:
207         (WebCore::FrameLoader::didLayout):
208
209         Only call didLayout for the main frame.
210         * page/FrameView.cpp:
211         (WebCore::FrameView::performPostLayoutTasks):
212
213 2013-08-12  Christophe Dumez  <ch.dumez@sisa.samsung.com>
214
215         Define DOM_KEY_LOCATION_* constants on KeyboardEvent
216         https://bugs.webkit.org/show_bug.cgi?id=119341
217
218         Reviewed by Ryosuke Niwa.
219
220         Add support for the DOM_KEY_LOCATION_* constants on KeyboardEvent as per
221         the specification:
222         http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent
223
224         Those constants are already supported by IE10, Firefox 22 and since
225         recently Blink.
226
227         Note that the following constants are not supported / exposed yet:
228         DOM_KEY_LOCATION_MOBILE and DOM_KEY_LOCATION_JOYSTICK.
229
230         Test: fast/events/keyboardevent-location-constants.html
231
232         * dom/KeyboardEvent.cpp:
233         (WebCore::keyLocationCode):
234         (WebCore::KeyboardEvent::KeyboardEvent):
235         * dom/KeyboardEvent.h:
236         * dom/KeyboardEvent.idl:
237
238 2013-08-12  Tim Horton  <timothy_horton@apple.com>
239
240         dataLog dumpers for WebCore's basic geometry types
241         https://bugs.webkit.org/show_bug.cgi?id=119636
242
243         Reviewed by Filip Pizlo.
244
245         * platform/graphics/FloatPoint.cpp:
246         (WebCore::FloatPoint::dump):
247         * platform/graphics/FloatPoint.h:
248         * platform/graphics/FloatRect.cpp:
249         (WebCore::FloatRect::dump):
250         * platform/graphics/FloatRect.h:
251         * platform/graphics/FloatSize.cpp:
252         (WebCore::FloatSize::dump):
253         * platform/graphics/FloatSize.h:
254         * platform/graphics/IntPoint.h:
255         (WebCore::IntPoint::dump):
256         * platform/graphics/IntRect.cpp:
257         (WebCore::IntRect::dump):
258         * platform/graphics/IntRect.h:
259         * platform/graphics/IntSize.h:
260         (WebCore::IntSize::dump):
261
262 2013-08-12  Dean Jackson  <dino@apple.com>
263
264         Shadows don't support viewport units
265         https://bugs.webkit.org/show_bug.cgi?id=119649
266
267         Reviewed by Darin Adler.
268
269         We don't yet support viewport units in shadows, so
270         fail parsing if we see one. The bug to fix this
271         completely is: https://webkit.org/b/119650
272
273         Test: fast/css/shadow-viewport-units.html
274
275         * css/CSSParser.cpp:
276         (WebCore::CSSParser::parseShadow): Fail if we get one of
277         vh, vw, vmin, vmax.
278
279 2013-08-12  peavo@outlook.com  <peavo@outlook.com>
280
281         [Curl] Cookie is not set when url string is unicode.
282         https://bugs.webkit.org/show_bug.cgi?id=119545
283
284         Reviewed by Brent Fulgham.
285
286         When the method setCookiesFromDOM is called with an unicode url parameter, the cookie is not correctly set.
287         We need to convert the cookie string to 8 bit, before passing it to the Curl api function.
288
289         * platform/network/curl/CookieJarCurl.cpp:
290         (WebCore::setCookiesFromDOM): Convert cookie string to 8 bit, if needed.
291
292 2013-08-12  Eric Carlson  <eric.carlson@apple.com>
293
294         Revert r153912 because it broke some track tests.
295
296         Rubber-stamped by Antti Koivisto.
297
298         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
299         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
300         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack):
301
302 2013-08-12  Antti Koivisto  <antti@apple.com>
303
304         Add ElementTraversal::next/previousSibling
305         https://bugs.webkit.org/show_bug.cgi?id=119681
306
307         Reviewed by Andreas Kling.
308
309         Add nextSibling/previousSibling/lastWithin to ElementTraversal namespace.
310         
311         - Use them to replace internal use of Element::next/previousElementSibling DOM API for traversal.
312         - Replace some Node::nextSibling() usage with ElementTraversal::nextSibling() for tighter code.
313         - Replace ElementTraversal::nextSkippingChildren where it is used to traverse over immediate children only.
314
315         * css/SelectorChecker.cpp:
316         (WebCore::isFirstChildElement):
317         (WebCore::isLastChildElement):
318         (WebCore::isFirstOfType):
319         (WebCore::isLastOfType):
320         (WebCore::countElementsBefore):
321         (WebCore::countElementsOfTypeBefore):
322         (WebCore::countElementsAfter):
323         (WebCore::countElementsOfTypeAfter):
324         * dom/Element.cpp:
325         (WebCore::Element::lastElementChild):
326         (WebCore::Element::previousElementSibling):
327         (WebCore::Element::nextElementSibling):
328         * dom/Element.h:
329         * dom/ElementTraversal.h:
330         (WebCore::ElementTraversal::lastElementWithinTemplate):
331         (WebCore::ElementTraversal::lastWithin):
332         (WebCore::ElementTraversal::traverseNextSiblingElementTemplate):
333         (WebCore::ElementTraversal::nextSibling):
334         (WebCore::ElementTraversal::traversePreviousSiblingElementTemplate):
335         (WebCore::ElementTraversal::previousSibling):
336         * editing/ApplyStyleCommand.cpp:
337         (WebCore::isSpanWithoutAttributesOrUnstyledStyleSpan):
338         (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
339         * editing/CompositeEditCommand.cpp:
340         (WebCore::CompositeEditCommand::breakOutOfEmptyListItem):
341         * editing/IndentOutdentCommand.cpp:
342         (WebCore::IndentOutdentCommand::tryIndentingAsListItem):
343         * editing/InsertListCommand.cpp:
344         (WebCore::InsertListCommand::mergeWithNeighboringLists):
345         * editing/markup.cpp:
346         (WebCore::createContextualFragment):
347         * html/HTMLCollection.cpp:
348         (WebCore::firstMatchingChildElement):
349         (WebCore::nextMatchingSiblingElement):
350         (WebCore::HTMLCollection::traverseNextElement):
351         (WebCore::HTMLCollection::traverseForwardToOffset):
352         * html/HTMLFieldSetElement.cpp:
353         (WebCore::HTMLFieldSetElement::childrenChanged):
354         (WebCore::HTMLFieldSetElement::legend):
355         * html/HTMLMediaElement.cpp:
356         (WebCore::HTMLMediaElement::finishParsingChildren):
357         * html/HTMLObjectElement.cpp:
358         (WebCore::HTMLObjectElement::containsJavaApplet):
359         * rendering/FilterEffectRenderer.cpp:
360         (WebCore::FilterEffectRenderer::buildReferenceFilter):
361         * style/StyleResolveTree.cpp:
362         (WebCore::Style::resolveTree):
363         * svg/SVGStyledElement.cpp:
364         (WebCore::SVGStyledElement::title):
365
366 2013-08-12  Allan Sandfeld Jensen  <allan.jensen@digia.com>
367
368         [Qt] Add Support for canvas blend modes
369         https://bugs.webkit.org/show_bug.cgi?id=100072
370
371         Reviewed by Jocelyn Turcotte.
372
373         Implement basic support for the blend-modes supported by QPainter.
374
375         Covered by existing tests.
376
377         * platform/graphics/qt/GraphicsContextQt.cpp:
378         (WebCore::toQtCompositionMode):
379         (WebCore::GraphicsContext::setPlatformCompositeOperation):
380         * platform/graphics/qt/ImageBufferQt.cpp:
381         (WebCore::ImageBuffer::draw):
382         * platform/graphics/qt/ImageQt.cpp:
383         (WebCore::BitmapImage::draw):
384         * platform/graphics/qt/StillImageQt.cpp:
385         (WebCore::StillImage::draw):
386
387 2013-08-12  Gabor Abraham  <abrhm@inf.u-szeged.hu>
388
389         Buildfix for !ENABLE(SVG). Fix warning by adding guard after r153901:
390         void WebCore::addString(WebCore::FeatureSet&, const char*)'
391         defined but not used [-Werror=unused-function]
392
393         Reviewed by Csaba Osztrogonác.
394
395         * dom/DOMImplementation.cpp:
396
397 2013-08-12  Antti Koivisto  <antti@apple.com>
398
399         Move ElementTraversal to ElementTraversal.h
400         https://bugs.webkit.org/show_bug.cgi?id=119678
401
402         Rubber-stamped by Andreas Kling.
403
404         Move ElementTraversal namespace from NodeTraversal.h to a correctly named file.
405
406         * GNUmakefile.list.am:
407         * Target.pri:
408         * WebCore.vcxproj/WebCore.vcxproj:
409         * WebCore.xcodeproj/project.pbxproj:
410         * accessibility/AccessibilityRenderObject.cpp:
411         * css/StyleInvalidationAnalysis.cpp:
412         * dom/Document.cpp:
413         * dom/DocumentOrderedMap.cpp:
414         * dom/Element.cpp:
415         * dom/ElementTraversal.h: Added.
416         (WebCore::ElementTraversal::firstElementWithinTemplate):
417         (WebCore::ElementTraversal::firstWithin):
418         (WebCore::ElementTraversal::traverseNextElementTemplate):
419         (WebCore::ElementTraversal::next):
420         (WebCore::ElementTraversal::traverseNextElementSkippingChildrenTemplate):
421         (WebCore::ElementTraversal::nextSkippingChildren):
422         (WebCore::ElementTraversal::previousIncludingPseudo):
423         (WebCore::ElementTraversal::nextIncludingPseudo):
424         (WebCore::ElementTraversal::nextIncludingPseudoSkippingChildren):
425         (WebCore::ElementTraversal::pseudoAwarePreviousSibling):
426         * dom/Node.cpp:
427         * dom/NodeTraversal.h:
428         * dom/SelectorQuery.cpp:
429         * dom/TreeScope.cpp:
430         * dom/VisitedLinkState.cpp:
431         * editing/FrameSelection.cpp:
432         * editing/markup.cpp:
433         * html/HTMLCollection.cpp:
434         * html/HTMLFieldSetElement.cpp:
435         * html/HTMLFormElement.cpp:
436         * html/HTMLLabelElement.cpp:
437         * html/HTMLLegendElement.cpp:
438         * html/HTMLMapElement.cpp:
439         * html/HTMLObjectElement.cpp:
440         * html/HTMLSelectElement.cpp:
441         * html/shadow/ContentDistributor.cpp:
442         * page/FocusController.cpp:
443         * rendering/RenderCounter.cpp:
444         * rendering/RenderListItem.cpp:
445         * svg/SVGSVGElement.cpp:
446         * svg/SVGStyledElement.cpp:
447         * svg/SVGUseElement.cpp:
448         * svg/animation/SMILTimeContainer.cpp:
449         * svg/graphics/SVGImage.cpp:
450
451 2013-08-12  Antti Koivisto  <antti@apple.com>
452
453         Move some Document recalcStyle code to StyleResolveTree
454         https://bugs.webkit.org/show_bug.cgi?id=119676
455
456         Reviewed by Andreas Kling.
457
458         Move the code that resolves the document and child styles to Style::resolveTree(Document*).
459
460         * dom/Document.cpp:
461         (WebCore::Document::recalcStyle):
462         * style/StyleResolveTree.cpp:
463         (WebCore::Style::resolveTree):
464         * style/StyleResolveTree.h:
465
466 2013-08-12  Allan Sandfeld Jensen  <allan.jensen@digia.com>
467
468         Resource leak related to gstreamer and videos
469         https://bugs.webkit.org/show_bug.cgi?id=109350
470
471         Reviewed by Eric Carlson.
472
473         Since active DOM object are only stopped once and can not be restarted, we can
474         unreference the media player there, instead of waiting for garbage collection.
475
476         If the r152778 is rolled back, this also breaks a circular reference between
477         GStreamer and WebKit which prevented garbage collecting from triggering.
478
479         * html/HTMLMediaElement.cpp:
480         (WebCore::HTMLMediaElement::stop):
481
482 2013-08-12  Gabor Rapcsanyi  <rgabor@webkit.org>
483
484         [Qt] Unreviewed buildfix for webaudio.
485
486         * Target.pri: Add missing files
487
488 2013-08-12  Andreas Kling  <akling@apple.com>
489
490         Some build juice for the Windows bots after r153926 + r153927.
491
492         * html/shadow/MediaControlElements.cpp:
493         * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
494         (WebCore::MediaPlayerPrivateQuickTimeVisualContext::supportsFullscreen):
495         (WebCore::MediaPlayerPrivateQuickTimeVisualContext::setUpCookiesForQuickTime):
496
497 2013-08-11  Sam Weinig  <sam@webkit.org>
498
499         Move RenderMathMLSpace.h/cpp to the right group in the Xcode project.
500
501         Reviewed by Dean Jackson.
502
503         * WebCore.xcodeproj/project.pbxproj:
504
505 2013-08-11  Andreas Kling  <akling@apple.com>
506
507         Make Page::settings() return a reference.
508         <http://webkit.org/b/119662>
509
510         Reviewed by Anders Carlsson.
511
512         ...and remove some pointless null checks that were exposed by doing this.
513
514 2013-08-11  Andreas Kling  <akling@apple.com>
515
516         Make some things that return never-null pointers return references instead.
517         <http://webkit.org/b/119660>
518
519         Reviewed by Antti Koivisto.
520
521         These functions never return null anyway, so remove any ambiguity by letting
522         them return references instead of pointers.
523
524         - Node::ensureRareData()
525         - Element::ensureUniqueElementData()
526         - Element::ensureShadow()
527         - Element::ensureUserAgentShadowRoot()
528         - StyledElement::ensureMutableInlineStyle()
529         - NodeRareData::ensureNodeLists()
530         - NodeRareData::ensureMutationObserverData()
531         - EventTarget::ensureEventTargetData()
532         - Document::ensureStyleResolver()
533         - Document::selectorQueryCache()
534         - Document::mediaQueryMatcher()
535         - FlowThreadController::ensureRenderFlowThreadWithName()
536         - HTMLTrackElement::ensureTrack()
537         - SVGElement::ensureSVGRareData()
538         - AnimationControllerPrivate::ensureCompositeAnimation()
539
540 2013-08-11  Sam Weinig  <sam@webkit.org>
541
542         Cleanup MediaQueryListListener
543         https://bugs.webkit.org/show_bug.cgi?id=119664
544
545         Reviewed by Andreas Kling.
546
547         Make MediaQueryListListener a proper WebIDL callback.
548
549         * CMakeLists.txt:
550         * DerivedSources.cpp:
551         * DerivedSources.make:
552         * DerivedSources.pri:
553         * GNUmakefile.list.am:
554         * Target.pri:
555         * WebCore.vcxproj/WebCore.vcxproj:
556         * WebCore.vcxproj/WebCore.vcxproj.filters:
557         * WebCore.xcodeproj/project.pbxproj:
558         Update project files.
559
560         * bindings/scripts/CodeGeneratorJS.pm:
561         (GenerateCallbackHeader):
562         (GenerateCallbackImplementation):
563         (JSValueToNative):
564         * bindings/scripts/IDLAttributes.txt:
565         Add support for CallbackNeedsOperatorEqual, which adds an operator==.
566
567         * css/MediaAllInOne.cpp:
568         Remove MediaQueryListListener.cpp.
569
570         * css/MediaQueryListListener.cpp:
571         Removed.
572
573         * css/MediaQueryListListener.h:
574         (WebCore::MediaQueryListListener::~MediaQueryListListener):
575         (WebCore::MediaQueryListListener::MediaQueryListListener):
576         * css/MediaQueryListListener.idl:
577         Convert to a proper WebIDL callback.
578
579         * css/MediaQueryMatcher.cpp:
580         (WebCore::MediaQueryMatcher::Listener::evaluate):
581         (WebCore::MediaQueryMatcher::styleResolverChanged):
582         * css/MediaQueryMatcher.h:
583         Remove all traces of the ScriptState.
584
585 2013-08-11  Carlos Garcia Campos  <cgarcia@igalia.com>
586
587         Unreviewed. Fix make distcheck.
588
589         * GNUmakefile.list.am: Remove unexistent header file.
590
591 2013-08-09  Gustavo Noronha Silva  <gns@gnome.org>
592
593         [GObject] Wrap KeyboardEvent
594         https://bugs.webkit.org/show_bug.cgi?id=119651
595
596         Reviewed by Christophe Dumez.
597
598         This exposes KeyboardEvent to our GObject API. It is required for handling
599         keyboard events, such as keydown, keypress, and so on.
600
601         * bindings/gobject/GNUmakefile.am:
602         * bindings/gobject/WebKitDOMPrivate.cpp:
603         (WebKit::wrap): make sure we create a WebKitDOMKeyboardEvent for a DOM event that
604         is a KeyboardEvent.
605         * bindings/scripts/CodeGeneratorGObject.pm:
606         (GetBaseClass): make WebKitDOMEvent be WebKitDOMKeyboardEvent's parent, like we do
607         for WebKitDOMMouseEvent.
608         * dom/KeyboardEvent.idl: generate a single initialization method.
609
610 2013-08-09  Jer Noble  <jer.noble@apple.com>
611
612         Crash in com.apple.WebKit.WebContent at com.apple.MediaToolbox.
613         https://bugs.webkit.org/show_bug.cgi?id=119645
614
615         Reviewed by Eric Carlson.
616
617         Work around crash caused by <rdar://problem/14688471> by releasing
618         m_request as soon as keys have been added to it.
619
620         * Modules/encryptedmedia/CDMPrivateAVFoundation.mm:
621         (WebCore::CDMSessionAVFoundation::update):
622
623 2013-08-09  Anders Carlsson  <andersca@apple.com>
624
625         Artifacts seen sometimes with layer backed WebKit1 plug-in
626         https://bugs.webkit.org/show_bug.cgi?id=119647
627         <rdar://problem/14002715>
628
629         Reviewed by Beth Dakin.
630
631         Don't try to paint layer backed views - they will be painted by Core Animation.
632
633         * platform/mac/WidgetMac.mm:
634         (WebCore::Widget::paint):
635
636 2013-08-09  Rob Buis  <rwlbuis@webkit.org>
637
638         ASSERTION FAILED: stroke->opacity != other->stroke->opacity in WebCore::SVGRenderStyle::diff
639         https://bugs.webkit.org/show_bug.cgi?id=119623
640
641         Reviewed by Dirk Schulze.
642
643         Include all the stroke attributes in the style diff comparison, the visited links ones were missing.
644
645         Test: svg/animations/animate-stroke-crasher.html
646
647         * rendering/style/SVGRenderStyle.cpp:
648         (WebCore::SVGRenderStyle::diff):
649
650 2013-08-09  Alexey Proskuryakov  <ap@apple.com>
651
652         REGRESSION (r142755): window.open creates an invisible window when width and height are 0
653         https://bugs.webkit.org/show_bug.cgi?id=119633
654
655         Reviewed by Darin Adler.
656
657         Test: fast/dom/Window/open-zero-size-as-default.html
658
659         Relying on each WebKit to refuse setting size to zero was fragile - because this
660         required each one to have the check, and because by the time the client was called,
661         the initially zero size was not necessarily zero.
662
663         * loader/FrameLoader.cpp: (WebCore::createWindow): When sizes are zero, keep the
664         size the window was created with, because that's the default one by definition.
665
666         * page/DOMWindow.cpp: (WebCore::DOMWindow::adjustWindowRect): It's too late to
667         check for zero size now, it's been mangled to adjust for the difference between
668         window and viewport size.
669
670 2013-08-09  Eric Carlson  <eric.carlson@apple.com>
671
672         [Mac] some track language tags are not recognized
673         https://bugs.webkit.org/show_bug.cgi?id=119643
674
675         Reviewed by Dean Jackson.
676
677         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
678         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Always call languageOfPrimaryAudioTrack(),
679             a track may have changed so we may have a new language.
680         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack): Call [AVAssetTrack languageCode]
681             if [AVAssetTrack extendedLanguageTag] returns NULL in case the media file has an old
682             QuickTime language code.
683
684 2013-08-09  Dean Jackson  <dino@apple.com>
685
686         Captions menu needs to reset text-align
687         https://bugs.webkit.org/show_bug.cgi?id=119637
688
689         Reviewed by Eric Carlson.
690
691         Reset the text-align property on the menu so that it
692         doesn't get the inherited value. The full fix for all
693         controls is http://webkit.org/b/116100.
694
695         * css/mediaControlsQuickTime.css:
696         (video::-webkit-media-controls-closed-captions-container):
697
698 2013-08-09  Beth Dakin  <bdakin@apple.com>
699
700         AX: Not able to use arrow keys to read text in a WK2 app
701         https://bugs.webkit.org/show_bug.cgi?id=119605
702         -and corresponding-
703         <rdar://problem/14281275>
704
705         Reviewed by Darin Adler.
706
707         This code from defaultKeyboardEventHandler() is the magic that makes this AX 
708         functionality work. This patch moves that into a separate function so that we can 
709         call it from WK2.
710         * WebCore.exp.in:
711         * page/EventHandler.cpp:
712         (WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
713         (WebCore::EventHandler::defaultKeyboardEventHandler):
714         * page/EventHandler.h:
715
716 2013-08-09  Antti Koivisto  <antti@apple.com>
717
718         Move static StyleResolver functions to Style namespace
719         https://bugs.webkit.org/show_bug.cgi?id=119629
720
721         Reviewed by Sam Weinig and Andreas Kling.
722
723         - Move static font size computation functions to StyleFontSizeFunctions.h/.cpp
724         - Move StyleResolver::styleForDocument to Style::resolveForDocument
725
726         * WebCore.xcodeproj/project.pbxproj:
727         * css/DeprecatedStyleBuilder.cpp:
728         (WebCore::ApplyPropertyFontFamily::applyInitialValue):
729         (WebCore::ApplyPropertyFontFamily::applyValue):
730         (WebCore::ApplyPropertyFontSize::applyInitialValue):
731         (WebCore::ApplyPropertyFontSize::applyValue):
732         * css/StyleResolver.cpp:
733         (WebCore::StyleResolver::adjustRenderStyle):
734         (WebCore::checkForOrientationChange):
735         (WebCore::StyleResolver::applyProperty):
736         (WebCore::StyleResolver::checkForGenericFamilyChange):
737         (WebCore::StyleResolver::initializeFontStyle):
738         (WebCore::StyleResolver::setFontSize):
739         * css/StyleResolver.h:
740         * dom/Document.cpp:
741         (WebCore::Document::recalcStyle):
742         * editing/EditingStyle.cpp:
743         (WebCore::legacyFontSizeFromCSSValue):
744         * html/HTMLLinkElement.cpp:
745         (WebCore::HTMLLinkElement::process):
746         * rendering/style/RenderStyle.cpp:
747         (WebCore::RenderStyle::getFontAndGlyphOrientation):
748         
749             Moved from StyleResolver.cpp so it can be used by Style::resolveForDocument().
750             This depends on RenderStyle only so it is a natural member function.
751
752         * rendering/style/RenderStyle.h:
753         * rendering/svg/RenderSVGInlineText.cpp:
754         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
755         * style/StyleFontSizeFunctions.cpp: Copied from Source/WebCore/css/StyleResolver.cpp.
756         (WebCore::Style::computedFontSizeFromSpecifiedSize):
757         (WebCore::Style::computedFontSizeFromSpecifiedSizeForSVGInlineText):
758         (WebCore::Style::fontSizeForKeyword):
759         (WebCore::Style::legacyFontSizeForPixelSize):
760         * style/StyleFontSizeFunctions.h: Added.
761         * style/StyleResolveForDocument.cpp: Added.
762         (WebCore::Style::resolveForDocument):
763         * style/StyleResolveForDocument.h: Added.
764
765 2013-08-09  Christophe Dumez  <ch.dumez@sisa.samsung.com>
766
767         Add support for KeyboardEvent.location attribute
768         https://bugs.webkit.org/show_bug.cgi?id=119326
769
770         Reviewed by Benjamin Poulain.
771
772         Add support for KeyboardEvent.location attribute as per the latest specification:
773         http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-KeyboardEvent
774
775         IE10, Firefox 22 and recently Blink all support KeyboardEvent.location already.
776
777         The deprecated 'keyLocation' attribute was not removed to maintain backward
778         compatibility.
779
780         No new tests, covered by existing tests.
781
782         * bindings/objc/PublicDOMInterfaces.h:
783         * bindings/scripts/CodeGeneratorJS.pm:
784         (GenerateConstructorDefinition):
785         * dom/KeyboardEvent.cpp:
786         (WebCore::KeyboardEventInit::KeyboardEventInit):
787         (WebCore::KeyboardEvent::KeyboardEvent):
788         (WebCore::KeyboardEvent::initKeyboardEvent):
789         * dom/KeyboardEvent.h:
790         (WebCore::KeyboardEvent::location):
791         * dom/KeyboardEvent.idl:
792
793 2013-08-09  Christophe Dumez  <ch.dumez@sisa.samsung.com>
794
795         Make atob() throw an InvalidCharacterError on excess padding characters
796         https://bugs.webkit.org/show_bug.cgi?id=118898
797
798         Reviewed by Darin Adler.
799
800         According to the latest specification, window.atob() should throw an
801         InvalidCharacterError on excess padding characters:
802         http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#dom-windowbase64-atob
803
804         This behavior is consistent with both Firefox, IE10 and recently Blink.
805
806         No new tests, already covered by:
807         fast/dom/Window/atob-btoa.html
808
809         * page/DOMWindow.cpp:
810         (WebCore::DOMWindow::atob):
811
812 2013-08-09  Christophe Dumez  <ch.dumez@sisa.samsung.com>
813
814         Make DOMImplementation::hasFeature() behave according to specification
815         https://bugs.webkit.org/show_bug.cgi?id=119329
816
817         Reviewed by Ryosuke Niwa.
818
819         Make DOMImplementation::hasFeature() behave according to the latest specification:
820         http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
821
822         Specifically, the function should now return true unconditionally for any non-SVG feature.
823         This behavior is consistent with Firefox and since recently Blink.
824
825         hasFeature() originally would report whether the user agent claimed to support a
826         given DOM feature, but experience proved it was not nearly as reliable or granular
827         as simply checking whether the desired interfaces, attributes, or methods existed.
828         As such, it should no longer be used, but continues to exist (and simply returns
829         true) so that old pages don't stop working.
830
831         No new tests, covered by existing tests.
832
833         * dom/DOMImplementation.cpp:
834         (WebCore::isSupportedSVG10Feature):
835         (WebCore::isSupportedSVG11Feature):
836         (WebCore::DOMImplementation::hasFeature):
837
838 2013-08-09  Alejandro G. Castro  <alex@igalia.com>
839
840         [GTK] [EFL] Enable tiled shadow blur for the inset shadows.
841         https://bugs.webkit.org/show_bug.cgi?id=119078
842
843         Reviewed by Martin Robinson.
844
845         Already covered in the tests.
846
847         * platform/graphics/GraphicsContext.cpp:
848         * platform/graphics/cairo/GraphicsContextCairo.cpp:
849         (WebCore::fillCurrentCairoPath): Added to allow fill the path
850         without the shadow.
851         (WebCore::shadowAndFillCurrentCairoPath):
852         (WebCore::GraphicsContext::fillRectWithRoundedHole): Added cairo
853         implementation.
854
855 2013-08-09  Jakob Petsovits  <jpetsovits@blackberry.com>
856
857         [BlackBerry] Don't release the canvas Drawable, flush it directly instead.
858         https://bugs.webkit.org/show_bug.cgi?id=119589
859         https://jira.bbqnx.net/browse/BRWSR-12531
860         JIRA 444857
861
862         Reviewed by George Staikos.
863
864         The previous code here used releaseBufferDrawable() to
865         flush painted ImageBuffer contents, but then proceeded
866         to use that released Drawable for further painting
867         without ever locking a new one.
868
869         In an implementation that actually releases the Drawable
870         rather than keeping it around and just flushing it,
871         this will wreak havoc as bad as black screens or crashes.
872
873         As a solution that doesn't require the ImageBuffer object
874         to swap out its m_canvas member for a new Drawable, we can
875         access the PlatformGraphicsContext::flush() method directly
876         to achieve the same effect as was previously intended by
877         calling releaseBufferDrawable(). All it needs is letting
878         the canvas layer know about the Drawable so it can call
879         that flush() method by itself.
880
881         No new tests, verified by not crashing with an aforementioned
882         implementation of releaseBufferDrawable().
883
884         * platform/graphics/blackberry/CanvasLayerWebKitThread.cpp:
885         (WebCore::CanvasLayerCompositingThreadClient::CanvasLayerCompositingThreadClient):
886         (WebCore::CanvasLayerCompositingThreadClient::commitPendingTextureUploads):
887         (WebCore::CanvasLayerWebKitThread::CanvasLayerWebKitThread):
888         * platform/graphics/blackberry/CanvasLayerWebKitThread.h:
889         (WebCore::CanvasLayerWebKitThread::create):
890         * platform/graphics/blackberry/ImageBufferBlackBerry.cpp:
891         (WebCore::ImageBuffer::ImageBuffer):
892         (WebCore::ImageBuffer::~ImageBuffer):
893
894 2013-08-08  Allan Sandfeld Jensen  <allan.jensen@digia.com>
895
896         [Qt][WK2] Composited and transformed links asserts in tap highlight
897         https://bugs.webkit.org/show_bug.cgi?id=94345
898
899         Reviewed by Jocelyn Turcotte.
900
901         Use a mapping that does not assert when hitting transforms. We still skip
902         transforms that produces non-rectangular areas.
903
904         * page/GestureTapHighlighter.cpp:
905
906 2013-08-09  Gabor Abraham  <abrhm@inf.u-szeged.hu>
907
908         Buildfix. Fix warning after r153887:
909         control reaches end of non-void function [-Werror=return-type]
910
911         Reviewed by Csaba Osztrogonác.
912
913         * svg/SVGAnimateElement.cpp:
914         (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition):
915
916 2013-08-09  Bruno de Oliveira Abinader  <bruno.d@partner.samsung.com>
917
918         Text decorations should be listed as non-inheritable
919         https://bugs.webkit.org/show_bug.cgi?id=119608
920
921         Reviewed by Andreas Kling.
922
923         Both "text-decoration" specs (CSS 2.1, CSS 3) and "text-decoration-line"
924         spec (CSS 3) states these properties are not inherited (w/ exceptions,
925         which are currently handled by -in-effect property), however those were
926         listed as inherited for no reason - thus preserving behavior as shown by
927         layout test results.
928
929         Backported from Blink: https://codereview.chromium.org/20751008
930
931         Updated getComputedStyle tests for both 'text-decoration' and
932         'text-decoration-line' properties to check that both are not implicitly
933         inherited.
934
935         * css/CSSProperty.cpp:
936         (WebCore::CSSProperty::isInheritedProperty):
937
938 2013-08-09  Andreas Kling  <akling@apple.com>
939
940         I wish we had a Windows EWS. :(
941
942         * css/ElementRuleCollector.cpp:
943         (WebCore::ElementRuleCollector::doCollectMatchingRulesForList): No range-based for today.
944
945 2013-08-09  Rob Buis  <rwlbuis@webkit.org>
946
947         ASSERT_NOT_REACHED() touched in WebCore::SVGAnimatedStringAnimator::addAnimatedTypes
948         https://bugs.webkit.org/show_bug.cgi?id=113224
949
950         Reviewed by Darin Adler.
951
952         Do not perform from-by animations for non-additive attributes.
953
954         Test: svg/animations/non-additive-type-from-by-animation.html
955
956         * svg/SVGAnimateElement.cpp:
957         (WebCore::SVGAnimateElement::calculateFromAndByValues):
958         (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition):
959         (WebCore::SVGAnimateElement::isAdditive):
960         * svg/SVGAnimateElement.h:
961
962 2013-08-09  Rob Buis  <rwlbuis@webkit.org>
963
964         ASSERT(m_type == toSVGTransform.type())
965         https://bugs.webkit.org/show_bug.cgi?id=113217
966
967         Reviewed by Darin Adler.
968
969         For to animations clear the transform list while animating and reset to it after the animation is done.
970         This matches Firefox and Opera 12 behavior.
971
972         Tests: svg/animations/animateTransform-to-scale-expected.svg
973                svg/animations/animateTransform-to-scale.svg
974
975         * svg/SVGAnimatedTransformList.cpp:
976         (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
977
978 2013-08-09  Arunprasad Rajkumar  <arurajku@cisco.com>
979
980         [Qt] QtWebKit should allow sending domain specific keycode to HTML applications
981         https://bugs.webkit.org/show_bug.cgi?id=118445
982
983         Reviewed by Allan Sandfeld Jensen.
984
985         No new test required, it is covered by QtWebKit API test.
986
987         This fix allows sending QKeyEvent::nativeVirtualKey as the DOM KeyboardEvent keyCode value instead
988         of Windows virtual key code. It can be enabled/disabled using "_q_useNativeVirtualKeyAsDOMKey"
989         dynamic property present in QWebPage.
990
991         * platform/PlatformKeyboardEvent.h:
992         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
993         * platform/qt/PlatformKeyboardEventQt.cpp:
994         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
995         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
996
997 2013-08-09  Renata Hodovan  <reni@webkit.org>
998
999         Missing NULL check in ApplyStyleCommand::applyInlineStyleToNodeRange()
1000         https://bugs.webkit.org/show_bug.cgi?id=119570
1001
1002         Reviewed by Ryosuke Niwa.
1003
1004         The m_mutableStyleSet of EditingStyle can be NULL in ApplyStyleCommand::applyInlineStyleToNodeRange but
1005         this scenario was not checked earlier.
1006
1007         Test: editing/execCommand/null-style-crash.html
1008
1009         * css/StylePropertySet.cpp:
1010         (WebCore::MutableStylePropertySet::mergeAndOverrideOnConflict):
1011         * css/StylePropertySet.h:
1012         * css/ViewportStyleResolver.cpp:
1013         (WebCore::ViewportStyleResolver::addViewportRule):
1014         * editing/ApplyStyleCommand.cpp:
1015         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
1016         * editing/EditingStyle.cpp:
1017         (WebCore::styleFromMatchedRulesForElement):
1018         (WebCore::EditingStyle::mergeStyleFromRules):
1019         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
1020
1021 2013-08-09  Andreas Kling  <akling@apple.com>
1022
1023         ElementRuleCollector: Use range-based for syntax in rule collection loop.
1024         <http://webkit.org/b/119617>
1025         <rdar://problem/14695311>
1026
1027         Reviewed by Antti Koivisto.
1028
1029         * css/ElementRuleCollector.cpp:
1030         (WebCore::ElementRuleCollector::doCollectMatchingRulesForList):
1031
1032 2013-08-09  Andreas Kling  <akling@apple.com>
1033
1034         StyleRule*::properties() should return const references.
1035         <http://webkit.org/b/119596>
1036
1037         Reviewed by Antti Koivisto.
1038
1039         Make StyleRule::properties() & friends return const-references instead of
1040         pointers. This exposed some pointless null checking, since rules should
1041         always have properties.
1042
1043         All rule objects that contain properties now require a StylePropertySet at
1044         the time of construction instead having you call setProperties() later.
1045
1046         The only rules that could ever have null properties were the default-inserted
1047         animation keyframe rules for 0% and 100% that we'd conjure up if the author
1048         didn't provide them. Now they just have an empty property set instead.
1049
1050         * css/CSSFontFaceRule.cpp:
1051         (WebCore::CSSFontFaceRule::cssText):
1052         * css/CSSFontSelector.cpp:
1053         (WebCore::CSSFontSelector::addFontFaceRule):
1054         * css/CSSPageRule.cpp:
1055         (WebCore::CSSPageRule::cssText):
1056         * css/CSSParser.cpp:
1057         (WebCore::CSSParser::createFilterRule):
1058         (WebCore::CSSParser::createStyleRule):
1059         (WebCore::CSSParser::createFontFaceRule):
1060         (WebCore::CSSParser::rewriteSpecifiers):
1061         * css/CSSStyleRule.cpp:
1062         (WebCore::CSSStyleRule::cssText):
1063         * css/ElementRuleCollector.cpp:
1064         (WebCore::leftToRightDeclaration):
1065         (WebCore::rightToLeftDeclaration):
1066         (WebCore::ElementRuleCollector::addElementStyleProperties):
1067         (WebCore::ElementRuleCollector::doCollectMatchingRulesForList):
1068         * css/PageRuleCollector.cpp:
1069         (WebCore::PageRuleCollector::matchPageRulesForList):
1070         * css/StylePropertySet.cpp:
1071         (WebCore::MutableStylePropertySet::mergeAndOverrideOnConflict):
1072         * css/StylePropertySet.h:
1073         * css/StyleResolver.cpp:
1074         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
1075         (WebCore::StyleResolver::styleForKeyframe):
1076         (WebCore::StyleResolver::keyframeStylesForAnimation):
1077         * css/StyleResolver.h:
1078         * css/StyleRule.cpp:
1079         (WebCore::StyleRule::StyleRule):
1080         (WebCore::StyleRule::create):
1081         (WebCore::StyleRulePage::StyleRulePage):
1082         (WebCore::StyleRuleFontFace::StyleRuleFontFace):
1083         (WebCore::StyleRuleViewport::StyleRuleViewport):
1084         (WebCore::StyleRuleViewport::mutableProperties):
1085         (WebCore::StyleRuleFilter::StyleRuleFilter):
1086         * css/StyleRule.h:
1087         (WebCore::StyleRule::create):
1088         (WebCore::StyleRule::properties):
1089         (WebCore::StyleRuleFontFace::create):
1090         (WebCore::StyleRuleFontFace::properties):
1091         (WebCore::StyleRulePage::create):
1092         (WebCore::StyleRulePage::properties):
1093         (WebCore::StyleRuleViewport::create):
1094         (WebCore::StyleRuleViewport::properties):
1095         (WebCore::StyleRuleFilter::create):
1096         (WebCore::StyleRuleFilter::properties):
1097         * css/StyleSheetContents.cpp:
1098         (WebCore::StyleSheetContents::addSubresourceStyleURLs):
1099         (WebCore::childRulesHaveFailedOrCanceledSubresources):
1100         * css/WebKitCSSFilterRule.cpp:
1101         (WebCore::WebKitCSSFilterRule::cssText):
1102         * css/WebKitCSSKeyframeRule.cpp:
1103         (WebCore::StyleKeyframe::StyleKeyframe):
1104         (WebCore::StyleKeyframe::mutableProperties):
1105         * css/WebKitCSSKeyframeRule.h:
1106         (WebCore::StyleKeyframe::create):
1107         (WebCore::StyleKeyframe::properties):
1108         * css/WebKitCSSViewportRule.cpp:
1109         (WebCore::WebKitCSSViewportRule::cssText):
1110         * editing/ApplyStyleCommand.cpp:
1111         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
1112         * editing/EditingStyle.cpp:
1113         (WebCore::EditingStyle::mergeStyleFromRules):
1114         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
1115         * inspector/InspectorStyleSheet.cpp:
1116         (WebCore::InspectorStyleSheet::revalidateStyle):
1117         * page/PageSerializer.cpp:
1118         (WebCore::PageSerializer::retrieveResourcesForRule):
1119         * svg/SVGFontFaceElement.cpp:
1120         (WebCore::SVGFontFaceElement::SVGFontFaceElement):
1121         (WebCore::SVGFontFaceElement::fontFamily):
1122         (WebCore::SVGFontFaceElement::rebuildFontFace):
1123
1124 2013-08-09  Julien Brianceau  <jbrianceau@nds.com>
1125
1126         [Qt] Fix build (broken by changeset r153826).
1127         https://bugs.webkit.org/show_bug.cgi?id=119616
1128
1129         Reviewed by Andreas Kling.
1130
1131         * xml/parser/XMLDocumentParserQt.cpp:
1132         (WebCore::XMLDocumentParser::XMLDocumentParser):
1133
1134 2013-08-08  Tim Horton  <timothy_horton@apple.com>
1135
1136         navigator.plugins has plugins in it when plugins are disabled
1137         https://bugs.webkit.org/show_bug.cgi?id=119607
1138         <rdar://problem/14678030>
1139
1140         Reviewed by Anders Carlsson.
1141
1142         Test: plugins/navigator-plugins-disabled.html
1143
1144         * page/Settings.cpp:
1145         (WebCore::Settings::setPluginsEnabled):
1146         Refresh the plugin database when plugins are enabled or disabled.
1147         This is necessary to ensure that navigator.plugins will have the
1148         correct set of plugins after dynamically changing whether plugins
1149         are enabled, which makes the test for this patch possible (but it
1150         makes sense in the browser as well).
1151
1152 2013-08-08  Timothy Hatcher  <timothy@apple.com>
1153
1154         Allow SVG images to be drawn into canvas without tainting.
1155         https://bugs.webkit.org/show_bug.cgi?id=119492
1156
1157         Reviewed by Darin Adler.
1158
1159         Tests: svg/as-image/svg-canvas-not-tainted.html
1160                svg/as-image/svg-canvas-link-not-colored.html
1161                svg/as-image/svg-canvas-xhtml-tainted.html
1162
1163         * html/HTMLAnchorElement.cpp:
1164         (WebCore::HTMLAnchorElement::parseAttribute): Call shouldProhibitLinks.
1165         (WebCore::shouldProhibitLinks): Added.
1166         * html/HTMLAnchorElement.h:
1167         * html/HTMLImageElement.cpp:
1168         (WebCore::HTMLImageElement::parseAttribute): Call shouldProhibitLinks.
1169         * rendering/svg/RenderSVGRoot.cpp:
1170         (WebCore::RenderSVGRoot::isEmbeddedThroughSVGImage): Use isInSVGImage.
1171         * svg/SVGAElement.cpp:
1172         (WebCore::SVGAElement::svgAttributeChanged): Call shouldProhibitLinks.
1173         * svg/graphics/SVGImage.cpp:
1174         (WebCore::SVGImage::hasSingleSecurityOrigin): Added.
1175         (WebCore::isInSVGImage): Added.
1176         * svg/graphics/SVGImage.h:
1177
1178 2013-08-08  Simon Fraser  <simon.fraser@apple.com>
1179
1180         Fix ASSERT(m_contentsSolidColor.isValid()) assertion on iOS at nytimes.com
1181         https://bugs.webkit.org/show_bug.cgi?id=119603
1182
1183         Reviewed by Dean Jackson.
1184
1185         On iOS it's possible for a GraphicsLayer to transition between having
1186         a solid background color, and containing media. This happens on nytimes.com
1187         when playing video.
1188         
1189         In this case, GraphicsLayerCA::updateContentsColorLayer() would assert
1190         because m_contentsLayer had been already set up to contain media, but
1191         it would be trying to update the color.
1192         
1193         Fix by bailing from all the updateContents* functions if there is no
1194         contents layer, or that layer exists for a different purpose.
1195
1196         * platform/graphics/ca/GraphicsLayerCA.cpp:
1197         (WebCore::GraphicsLayerCA::updateContentsMediaLayer):
1198         (WebCore::GraphicsLayerCA::updateContentsCanvasLayer):
1199         (WebCore::GraphicsLayerCA::updateContentsColorLayer):
1200
1201 2013-08-08  Commit Queue  <commit-queue@webkit.org>
1202
1203         Unreviewed, rolling out r153847.
1204         http://trac.webkit.org/changeset/153847
1205         https://bugs.webkit.org/show_bug.cgi?id=119609
1206
1207         caused new SVG animation test failures (Requested by smfr on
1208         #webkit).
1209
1210         * svg/SVGAnimateElement.cpp:
1211         (WebCore::SVGAnimateElement::calculateFromAndByValues):
1212
1213 2013-08-08  Simon Fraser  <simon.fraser@apple.com>
1214
1215         Kill updateStyleForAllDocuments()
1216         https://bugs.webkit.org/show_bug.cgi?id=118093
1217
1218         Reviewed by Geoff Garen.
1219
1220         We should never have to eagerly update style, especially for all documents
1221         that the process knows about. The WebKit model is to update style when
1222         required for layout etc, not to update it eagerly.
1223         
1224         This is historical code whose origins are lost in the mists of KHTML.
1225         r42384 makes it possible to do away with this eager updating, and
1226         r55568 removed some calls. Discussion in bug 32580 suggests that
1227         form control code still need this, but tests still pass without it.
1228
1229         * bindings/js/JSCallbackData.cpp:
1230         (WebCore::JSCallbackData::invokeCallback):
1231         * bindings/js/JSCustomXPathNSResolver.cpp:
1232         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
1233         * dom/Document.cpp:
1234         (WebCore::Document::scheduleStyleRecalc):
1235         (WebCore::Document::unscheduleStyleRecalc):
1236         * dom/Document.h:
1237         * dom/Element.cpp:
1238         (WebCore::Element::setActive):
1239
1240 2013-08-08  Jer Noble  <jer.noble@apple.com>
1241
1242         [EME] MediaKey APIs should be prefixed.
1243         https://bugs.webkit.org/show_bug.cgi?id=119606
1244
1245         Reviewed by Anders Carlsson.
1246
1247         No new tests; updated exsisting tests with new names.
1248
1249         Prefix all new classes with "WebKit" and new methods on existing unprefixed
1250         classes with "webkit"
1251
1252         * Modules/encryptedmedia/MediaKeyMessageEvent.idl: MediaKeyMessageEvent -> WebKitMediaKeyMessageEvent
1253         * Modules/encryptedmedia/MediaKeySession.idl: MediaKeySession -> WebKitMediaKeySession
1254         * Modules/encryptedmedia/MediaKeys.idl: MediaKeys -> WebKitMediaKeys
1255         * html/HTMLMediaElement.idl: keys -> webkitKeys, setMediaKeys -> webkitSetMediaKeys
1256         * html/MediaKeyError.idl: MediaKeyError -> WebKitMediaKeyError
1257
1258 2013-08-08  Jer Noble  <jer.noble@apple.com>
1259
1260         [EME] setMediaKeys function as defined in the EME specification does not work
1261         https://bugs.webkit.org/show_bug.cgi?id=119597
1262
1263         Reviewed by Anders Carlsson.
1264
1265         No new tests; updated media/encrypted-media/encrypted-media-v2-syntax.html
1266
1267         Rename the mediaKeys attribute 'keys' and make readonly, and add an explicit
1268         setMediaKeys() method in HTMLMediaElement's IDL.
1269
1270         * html/HTMLMediaElement.h:
1271         (WebCore::HTMLMediaElement::keys):
1272         * html/HTMLMediaElement.idl:
1273
1274 2013-08-06  Sam Weinig  <sam@webkit.org>
1275
1276         Hashing SecurityOrigin's can lead to trouble if you mutate them :(
1277         https://bugs.webkit.org/show_bug.cgi?id=119533
1278         <rdar://problem/12978338>
1279
1280         Reviewed by Andreas Kling.
1281
1282         We are getting into trouble in the following circumstance:
1283         - You have a HashMap<RefPtr<SecurityOrigin>, Value> map.
1284         - You add security origin A (http, www.webkit.org, 80) to the map.
1285         - You mutate security origin A by domain relaxation, so that it has the domain webkit.org.
1286         - You add security origin B (http, www.webkit.org, 80) to the map.
1287         - You mutate security origin B by domain relaxation, so that it has the domain webkit.org.
1288             You now have two identical keys in the map.
1289         - Add few more items to the map causing a rehash.
1290         - When you try to add A and B back into the map, you will have a collision, because they now equal each other.
1291
1292         We should probably stop using SecurityOrigins as keys in HashMaps (and move to using a non-mutable SecurityOriginTuple,
1293         or something), but for now, we can just only use the scheme / host / port part for equality, which is what all the users
1294         really want.
1295
1296         * page/SecurityOriginHash.h:
1297         (WebCore::SecurityOriginHash::equal):
1298         Switch to using isSameSchemeHostPort() for SecurityOriginHash::equal().
1299
1300 2013-08-08  Rob Buis  <rwlbuis@webkit.org>
1301
1302         ASSERT_NOT_REACHED() touched in WebCore::SVGAnimatedStringAnimator::addAnimatedTypes
1303         https://bugs.webkit.org/show_bug.cgi?id=113224
1304
1305         Reviewed by Dirk Schulze.
1306
1307         Do not perform from-by animations for non-additive attributes.
1308
1309         Test: svg/animations/non-additive-type-from-by-animation.html
1310
1311         * svg/SVGAnimateElement.cpp:
1312         (WebCore::SVGAnimateElement::calculateFromAndByValues):
1313
1314 2013-08-08  Brent Fulgham  <bfulgham@apple.com>
1315
1316         [Windows] Improper Caption Button Displayed to Users
1317         https://bugs.webkit.org/show_bug.cgi?id=119593 
1318
1319         Reviewed by Eric Carlson.
1320
1321         Remove the custom drawing code for the Windows port, and
1322         have it render using the CSS/SVG markup like we do on OS X.
1323
1324         * rendering/RenderThemeWin.cpp: Remove drawing code.
1325         * rendering/RenderThemeWin.h: Remove declaration.
1326
1327 2013-08-08  Alex Christensen  <achristensen@apple.com>
1328
1329         Work towards WebGL on AppleWin port.
1330         https://bugs.webkit.org/show_bug.cgi?id=119562
1331
1332         Reviewed by Brent Fulgham.
1333
1334         * WebCore.vcxproj/WebCore.vcxproj:
1335         Build GLContext.cpp and GraphicsContext3DPrivate.cpp on AppleWin port.
1336         * WebCore.vcxproj/WebCore.vcxproj.filters:
1337         Moved GLContext and GraphicsContext3DPrivate from Cairo filter to graphics.
1338         * platform/graphics/GraphicsContext3D.h:
1339         Added m_webGLLayer for AppleWin port.
1340         * platform/graphics/GraphicsContext3DPrivate.cpp:
1341         Protected inclusion of PlatformContextCairo.h in USE(CAIRO) macro for non-cairo ports.
1342         * platform/graphics/win/GraphicsContext3DWin.cpp:
1343         Removed stub GraphicsContext3DPrivate implementation in favor of GraphicsContext3DPrivate.cpp.
1344         (WebCore::GraphicsContext3D::GraphicsContext3D):
1345         Added GraphicsContext3DPrivate and PlatformCALayer initialization.
1346         (WebCore::GraphicsContext3D::makeContextCurrent):
1347         (WebCore::GraphicsContext3D::platformGraphicsContext3D):
1348         Added implementation based on Cairo ports' to be refactored soon.
1349         (WebCore::GraphicsContext3D::platformLayer):
1350         Return PlatformCALayer's PlatformLayer instead of 0.
1351
1352 2013-08-08  Jer Noble  <jer.noble@apple.com>
1353
1354         [EME] Implement MediaKeys.isTypeSupported()
1355         https://bugs.webkit.org/show_bug.cgi?id=119586
1356
1357         Reviewed by Eric Carlson.
1358
1359         Test: media/encrypted-media/encrypted-media-is-type-supported.html
1360
1361         The EME spec has removed the extra keySystem parameter from
1362         HTMLMediaElement.canPlayType() in favor of a new isTypeSupported()
1363         method on MediaKeys.
1364
1365         To implement this method, the CDMFactory needs to know whether the
1366         registered CDM supports the specified mime type.  CDMs must register
1367         this new factory method, which requires changes to CDMPrivateAVFoundation
1368         and MockCDM.
1369
1370         Add the new MediaKeys.isTypeSupported() method:
1371         * Modules/encryptedmedia/MediaKeys.cpp:
1372         (WebCore::MediaKeys::isTypeSupported):
1373         * Modules/encryptedmedia/MediaKeys.h:
1374         * Modules/encryptedmedia/MediaKeys.idl:
1375
1376         Add the new factory CDMSupportsKeySystemAndMimeType method:
1377         * Modules/encryptedmedia/CDM.cpp:
1378         (WebCore::CDMFactory::CDMFactory): Now takes a third parameter.
1379         (WebCore::installedCDMFactories): When adding the AVFoundation CDM, pass its new method.
1380         (WebCore::CDM::registerCDMFactory): Now takes a third parameter.
1381         (WebCore::CDM::keySystemSupportsMimeType): Added.
1382         * Modules/encryptedmedia/CDM.h:
1383         * WebCore.exp.in:
1384
1385         Register this new method with the factory for all concrete CDMs:
1386         * Modules/encryptedmedia/CDMPrivateAVFoundation.h:
1387         * Modules/encryptedmedia/CDMPrivateAVFoundation.mm:
1388         (WebCore::CDMPrivateAVFoundation::supportsKeySystem):
1389         (WebCore::CDMPrivateAVFoundation::supportsKeySystemAndMimeType):
1390         * testing/Internals.cpp:
1391         (WebCore::Internals::initializeMockCDM):
1392         * testing/MockCDM.cpp:
1393         (WebCore::MockCDM::supportsKeySystem):
1394         (WebCore::MockCDM::supportsKeySystemAndMimeType):
1395         * testing/MockCDM.h:
1396
1397 2013-08-08  Rob Buis  <rwlbuis@webkit.org>
1398
1399         Crash in WTF::RefPtr<WebCore::SpaceSplitStringData>::operator UnspecifiedBoolType
1400         https://bugs.webkit.org/show_bug.cgi?id=118839
1401
1402         Reviewed by Darin Adler.
1403
1404         Take into account that elementData() can be null in classAttributeChanged.
1405
1406         Test: svg/animations/classAttributeSettingCrash.html
1407
1408         * dom/Element.cpp:
1409         (WebCore::Element::classAttributeChanged):
1410
1411 2013-08-08  Robert Hogan  <robert@webkit.org>
1412
1413         REGRESSION(r147019): Page has extra space
1414         https://bugs.webkit.org/show_bug.cgi?id=119424
1415
1416         Reviewed by David Hyatt.
1417
1418         Clear the overflow rect before recomputing it in table sections.
1419
1420         No new tests: the reduction uses jquery and I was unable to simulate the reduction without it.
1421
1422         * rendering/RenderTableSection.cpp:
1423         (WebCore::RenderTableSection::layoutRows):
1424         (WebCore::RenderTableSection::computeOverflowFromCells):
1425
1426 2013-08-08  Andreas Kling  <akling@apple.com>
1427
1428         Inserting multiple rules into an empty style sheet should avoid style recalc if possible.
1429         <http://webkit.org/b/119568>
1430
1431         Reviewed by Antti Koivisto.
1432
1433         As a follow-up to <http://webkit.org/b/119475>, where I added a hack for inserting
1434         a single rule into an empty style sheet, this broadens the optimization to support
1435         any number of rules.
1436
1437         This optimizes the scenario where a style sheet is added to the DOM and then populated
1438         rule-by-rule via CSSOM insertRule()/addRule() calls. Previously we'd do a full style
1439         recalc for this case, but now we'll treat it the same as a full sheet added at once.
1440
1441         * css/CSSStyleSheet.h:
1442         * css/CSSStyleSheet.cpp:
1443         (WebCore::CSSStyleSheet::willMutateRules):
1444
1445             Made willMutateRules() return whether the style sheet contents were cloned by the
1446             copy-on-write mechanism.
1447
1448         * dom/Document.h:
1449         (WebCore::CSSStyleSheet::didMutateRules):
1450         (WebCore::CSSStyleSheet::insertRule):
1451
1452             Replaced the InsertionIntoEmptySheet mutation type by a general RuleInsertion.
1453             The mutation callback checks if we're inserting into a rule that's not (yet) part
1454             of the document's active sheet set. In that case, we defer doing the style sheet
1455             until all the insertions are done (or something forces us to style+layout.)
1456
1457             Note that this optimization only happens if the style sheet had a single client.
1458             Shared style sheets that just got cloned before mutation may have pointers into
1459             them from the Document's StyleResolver, so we're forced to do an immediate sheet
1460             update in that case.
1461
1462         (WebCore::CSSStyleSheet::RuleMutationScope::RuleMutationScope):
1463         (WebCore::CSSStyleSheet::RuleMutationScope::~RuleMutationScope):
1464
1465             Moved these out-of-line.
1466
1467         (WebCore::CSSStyleSheet::didMutateRuleFromCSSStyleDeclaration):
1468         * css/PropertySetCSSStyleDeclaration.cpp:
1469         (WebCore::StyleRuleCSSStyleDeclaration::didMutate):
1470
1471             Made a separate mutation callback for CSSStyleDeclaration since its needs are
1472             so simple compared to the mutation callback from CSSStyleSheet. Seems better
1473             than adding yet another mode to the enum.
1474
1475         * dom/Document.cpp:
1476         (WebCore::Document::Document):
1477         (WebCore::Document::recalcStyle):
1478         (WebCore::Document::styleResolverChanged):
1479         (WebCore::Document::optimizedStyleSheetUpdateTimerFired):
1480         (WebCore::Document::scheduleOptimizedStyleSheetUpdate):
1481
1482             Added mechanism to defer doing a RecalcStyleIfNeeded.
1483
1484         (WebCore::Document::updateStyleIfNeeded):
1485
1486             Synchronize the optimized style sheet update if there's one scheduled.
1487             This ensures that stuff like layout-dependent property access won't operate
1488             on stale style.
1489
1490         * dom/DocumentStyleSheetCollection.h:
1491         (WebCore::DocumentStyleSheetCollection::pendingUpdateType):
1492         (WebCore::DocumentStyleSheetCollection::setPendingUpdateType):
1493         (WebCore::DocumentStyleSheetCollection::flushPendingUpdates):
1494         * dom/DocumentStyleSheetCollection.cpp:
1495         (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
1496         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
1497
1498             Have DSSC track the kind of style sheet update it needs to do (instead of just
1499             a boolean "needs update.") This is used by Document::recalcStyle() to make sure
1500             the right kind of update happens if there's one scheduled.
1501
1502         (WebCore::DocumentStyleSheetCollection::activeStyleSheetsContains):
1503
1504             Added helper to check if a CSSStyleSheet is part of the active set.
1505
1506 2013-08-08  Allan Sandfeld Jensen  <allan.jensen@digia.com>
1507
1508         [WK1] NPStream::headers not initialized
1509         https://bugs.webkit.org/show_bug.cgi?id=119574
1510
1511         Reviewed by Alexey Proskuryakov.
1512
1513         Initialize the header field. According to user feedback that should solve some
1514         cases of random crashes when loading plugins on Mac and Windows.
1515
1516         * plugins/PluginStream.cpp:
1517         (WebCore::PluginStream::PluginStream):
1518
1519 2013-08-08  Andreas Kling  <akling@apple.com>
1520
1521         Element: Modernize attribute storage accessor functions.
1522         <http://webkit.org/b/119578>
1523
1524         Reviewed by Antti Koivisto.
1525
1526         Rename these functions to more WebKit-style names.
1527
1528         - const Attribute* attributeItem(index) => const Attribute& attributeAt(index)
1529         - const Attribute* getAttributeItem(name) => const Attribute* findAttributeByName(name)
1530         - unsigned getAttributeItemIndex(name) => unsigned findAttributeIndexByName(name)
1531
1532         Note that attributeAt() now returns a reference instead of a pointer. That's right.
1533
1534         * css/SelectorChecker.cpp:
1535         (WebCore::attributeValueMatches):
1536         (WebCore::anyAttributeMatches):
1537         * css/SelectorChecker.h:
1538         (WebCore::SelectorChecker::checkExactAttribute):
1539         * dom/Attr.cpp:
1540         (WebCore::Attr::elementAttribute):
1541         * dom/DatasetDOMStringMap.cpp:
1542         (WebCore::DatasetDOMStringMap::getNames):
1543         (WebCore::DatasetDOMStringMap::item):
1544         (WebCore::DatasetDOMStringMap::contains):
1545         * dom/Element.cpp:
1546         (WebCore::Element::detachAttribute):
1547         (WebCore::Element::removeAttribute):
1548         (WebCore::Element::getAttribute):
1549         (WebCore::Element::setAttribute):
1550         (WebCore::Element::setSynchronizedLazyAttribute):
1551         (WebCore::Element::setAttributeInternal):
1552         (WebCore::Element::setAttributeNode):
1553         (WebCore::Element::removeAttributeNode):
1554         (WebCore::Element::removeAttributeInternal):
1555         (WebCore::Element::getAttributeNode):
1556         (WebCore::Element::getAttributeNodeNS):
1557         (WebCore::Element::hasAttribute):
1558         (WebCore::Element::hasAttributeNS):
1559         (WebCore::Element::computeInheritedLanguage):
1560         (WebCore::Element::normalizeAttributes):
1561         (WebCore::Element::getURLAttribute):
1562         (WebCore::Element::getNonEmptyURLAttribute):
1563         (WebCore::Element::detachAllAttrNodesFromElement):
1564         (WebCore::Element::cloneAttributesFromElement):
1565         (WebCore::ElementData::isEquivalent):
1566         (WebCore::ElementData::findAttributeIndexByNameSlowCase):
1567         (WebCore::ElementData::findAttributeIndexByNameForAttributeNode):
1568         (WebCore::UniqueElementData::findAttributeByName):
1569         (WebCore::UniqueElementData::attributeAt):
1570         * dom/Element.h:
1571         (WebCore::Element::findAttributeIndexByName):
1572         (WebCore::Element::fastHasAttribute):
1573         (WebCore::Element::fastGetAttribute):
1574         (WebCore::Element::attributeAt):
1575         (WebCore::Element::findAttributeByName):
1576         (WebCore::ElementData::findAttributeByName):
1577         (WebCore::ElementData::findAttributeIndexByName):
1578         (WebCore::ElementData::attributeAt):
1579         * dom/NamedNodeMap.cpp:
1580         (WebCore::NamedNodeMap::removeNamedItem):
1581         (WebCore::NamedNodeMap::removeNamedItemNS):
1582         (WebCore::NamedNodeMap::item):
1583         * dom/Node.cpp:
1584         (WebCore::Node::dumpStatistics):
1585         (WebCore::Node::isDefaultNamespace):
1586         (WebCore::Node::lookupNamespaceURI):
1587         (WebCore::Node::lookupNamespacePrefix):
1588         (WebCore::Node::compareDocumentPosition):
1589         * dom/StyledElement.cpp:
1590         (WebCore::StyledElement::makePresentationAttributeCacheKey):
1591         (WebCore::StyledElement::rebuildPresentationAttributeStyle):
1592         * editing/MarkupAccumulator.cpp:
1593         (WebCore::MarkupAccumulator::appendElement):
1594         * editing/markup.cpp:
1595         (WebCore::completeURLs):
1596         (WebCore::StyledMarkupAccumulator::appendElement):
1597         * html/HTMLEmbedElement.cpp:
1598         (WebCore::HTMLEmbedElement::parametersForPlugin):
1599         * html/HTMLInputElement.cpp:
1600         (WebCore::HTMLInputElement::updateType):
1601         * html/HTMLObjectElement.cpp:
1602         (WebCore::HTMLObjectElement::parametersForPlugin):
1603         * html/HTMLSelectElement.cpp:
1604         (WebCore::HTMLSelectElement::parseAttribute):
1605         * html/parser/HTMLConstructionSite.cpp:
1606         (WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement):
1607         * inspector/DOMPatchSupport.cpp:
1608         (WebCore::DOMPatchSupport::innerPatchNode):
1609         (WebCore::DOMPatchSupport::createDigest):
1610         * inspector/InspectorDOMAgent.cpp:
1611         (WebCore::InspectorDOMAgent::setAttributesAsText):
1612         (WebCore::InspectorDOMAgent::performSearch):
1613         (WebCore::InspectorDOMAgent::buildArrayForElementAttributes):
1614         * page/PageSerializer.cpp:
1615         (WebCore::isCharsetSpecifyingNode):
1616         * svg/SVGStyledElement.cpp:
1617         (WebCore::SVGStyledElement::getPresentationAttribute):
1618         * xml/XPathFunctions.cpp:
1619         (WebCore::XPath::FunLang::evaluate):
1620         * xml/XPathNodeSet.cpp:
1621         (WebCore::XPath::NodeSet::traversalSort):
1622         * xml/XPathStep.cpp:
1623         (WebCore::XPath::Step::nodesInAxis):
1624         * xml/parser/XMLDocumentParserLibxml2.cpp:
1625         (WebCore::XMLDocumentParser::XMLDocumentParser):
1626         * xml/parser/XMLDocumentParserQt.cpp:
1627         (WebCore::XMLDocumentParser::XMLDocumentParser):
1628
1629 2013-08-08  Mark Lam  <mark.lam@apple.com>
1630
1631         Restoring use of StackIterator instead of Interpreter::getStacktrace().
1632         https://bugs.webkit.org/show_bug.cgi?id=119575.
1633
1634         Reviewed by Oliver Hunt.
1635
1636         No new tests.
1637
1638         * bindings/js/ScriptCallStackFactory.cpp:
1639         (WebCore::createScriptCallStack):
1640
1641 2013-08-08  Zalan Bujtas  <zalan@apple.com>
1642
1643         REGRESSION (r121551) Incorrect handling of invalid media query list.
1644         https://bugs.webkit.org/show_bug.cgi?id=119164
1645
1646         Reviewed by Antti Koivisto.
1647
1648         Differentiate between syntactically invalid media queries and media queries with empty expressions.
1649
1650         Introduce a dedicated function for valid, but empty expression queries, so that passing NULL MediaQuerySet
1651         object to CSSParser::createMediaRule() can indicate invalid media query.
1652
1653         Test: fast/media/invalid-media-query-list.html
1654
1655         * css/CSSGrammar.y.in:
1656         * css/CSSParser.cpp:
1657         (WebCore::CSSParser::createMediaRule):
1658         (WebCore::CSSParser::createEmptyMediaRule):
1659         * css/CSSParser.h:
1660
1661 2013-08-08  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1662
1663         Introduce toSVGMPathElement(), and use it
1664         https://bugs.webkit.org/show_bug.cgi?id=119566
1665
1666         Reviewed by Andreas Kling.
1667
1668         As a step to change static_cast with toSVGXXX, static_cast<SVGMPathElement*> can
1669         be changed with toSVGMPathElement().
1670
1671         * svg/SVGAnimateMotionElement.cpp:
1672         (WebCore::SVGAnimateMotionElement::updateAnimationPath):
1673         * svg/SVGMPathElement.h:
1674         (WebCore::toSVGMPathElement):
1675         * svg/SVGPathElement.cpp:
1676         (WebCore::SVGPathElement::invalidateMPathDependencies):
1677
1678 2013-08-08  Antti Koivisto  <antti@apple.com>
1679
1680         Move more style recalc code to StyleResolveTree.cpp
1681         https://bugs.webkit.org/show_bug.cgi?id=119553
1682
1683         Reviewed by Andreas Kling.
1684
1685         * css/StyleResolver.cpp:
1686         * css/StyleResolver.h:
1687         
1688             Remove now unused StyleResolver::styleForText.
1689
1690         * dom/ElementShadow.cpp:
1691         * dom/ElementShadow.h:
1692         
1693             Remove ElementShadow::recalcStyle.
1694
1695         * dom/ShadowRoot.cpp:
1696         (WebCore::ShadowRoot::setResetStyleInheritance):
1697         
1698             Use Style::resolveTree instead of ElementShadow::recalcStyle.
1699
1700         * dom/ShadowRoot.h:
1701         
1702             Remove ShadowRoot::recalcStyle.
1703
1704         * dom/Text.cpp:
1705         * dom/Text.h:
1706         
1707             Remove Text::recalcTextStyle.
1708
1709         * style/StyleResolveTree.cpp:
1710         (WebCore::Style::updateTextStyle):
1711         
1712             Moved from Text::recalcTextStyle. Speed up by just setting the parent style on common case.
1713
1714         (WebCore::Style::resolveShadowTree):
1715         
1716             Moved from ShadowRoot::recalcStyle. 
1717             Simplified to cover only cases that can occur with the current shadow DOM support.
1718
1719         (WebCore::Style::resolveTree):
1720
1721 2013-08-08  Andreas Kling  <akling@apple.com>
1722
1723         REGRESSION(r139282): Old caret sometimes gets "stuck" (not repainted) in contenteditable elements.
1724         <http://webkit.org/b/119520>
1725         <rdar://problem/14658929>
1726
1727         Reviewed by Simon Fraser.
1728
1729         When computing a new caret rect, don't forget to repaint the old rect if the caret jumped
1730         from one node to another.
1731         We were being a little too clever, assuming that oldRect==newRect meant that no repaint was
1732         necessary, but moving from (0,0) in one node to (0,0) in another would cause a ghost caret
1733         in the old node.
1734
1735         Test: fast/repaint/caret-jump-between-nodes.html
1736
1737         * editing/FrameSelection.cpp:
1738         (WebCore::FrameSelection::recomputeCaretRect):
1739
1740             Fall through all the way down to caret repaints if the selection's new anchor node is not
1741             the same as m_previousCaretNode.
1742
1743 2013-08-07  Andrei Bucur  <abucur@adobe.com>
1744
1745         [CSS Regions] Propagate overflow from the flow thread to the first and last region
1746         https://bugs.webkit.org/show_bug.cgi?id=118526
1747
1748         Reviewed by David Hyatt.
1749
1750         The patch implements layout overflow propagation for the first and last regions. The approach
1751         taken is triggering a simple layout on the regions after the named flows are laid out
1752         that extracts the layout overflow from the flow thread and adds it to the regions.
1753
1754         The process is based on adding two new layout phases: the overflow phase and the final phase.
1755         The overflow phase is set after the flow threads are laid out and it marks the regions as
1756         needing to extract the overflow from the flow thread. In case there are blocks with auto overflow
1757         it's possible the overflow to create scrollbars that shrink the regions. In this case the flow
1758         thread is relaid out and set in the final phase, forcing the regions to recollect the layout
1759         overflow. In theory this would be an N-step layout because scrollbars can force content to change
1760         regions and create overflow for other blocks (and thus creating more scrollbars). For now, we are
1761         limiting this to the first pass by inserting this new final layout phase.
1762
1763         A short description of the processing model for a document:
1764         - layout the document (all the flow threads should be in the constrained layout phase after this step)
1765         - reverse iterate through the flow threads and mark the regions for simplified layout (we need to
1766         reverse iterate so the overflow can correctly propagate with nested regions)
1767         - if the layout changes the size of a region, invalidate the flow thread and when laying it out mark
1768         it as needing a new pass
1769         - make a secondary pass through the flow threads that changed after scrollbars have been added and
1770         recompute the overflow for their regions; mark the flow threads in the final phase (flow threads can't
1771         be invalidated in the final phase)
1772         - after the overflow was propagated update all the flow threads in the normal layout phase
1773
1774         There are some issues with the patch:
1775         - the simplified layout doesn't compute correct overflow values for inline blocks
1776         - the layout overflow from the flow thread doesn't take the region size into account
1777
1778         The first issue is not related to regions and will be fixed in a future patch. The second issue
1779         will be fixed when box overflow will be region bound.
1780
1781         Tests: fast/regions/overflow-scrollable-1.html
1782                fast/regions/overflow-scrollable-2.html
1783                fast/regions/overflow-scrollable-3.html
1784                fast/regions/overflow-scrollable-fit-complex.html
1785                fast/regions/overflow-scrollable-fit.html
1786                fast/regions/overflow-scrollable-nested.html
1787
1788         * rendering/FlowThreadController.cpp: Flow threads layout driver functions.
1789         (WebCore::FlowThreadController::updateFlowThreadsNeedingLayout):
1790         (WebCore::FlowThreadController::updateFlowThreadsIntoConstrainedPhase):
1791         (WebCore::FlowThreadController::updateFlowThreadsIntoOverflowPhase):
1792         (WebCore::FlowThreadController::updateFlowThreadsIntoMeasureContentPhase):
1793         (WebCore::FlowThreadController::updateFlowThreadsIntoFinalPhase):
1794         * rendering/FlowThreadController.h:
1795         * rendering/RenderBlock.cpp:
1796         (WebCore::RenderBlock::simplifiedNormalFlowLayout):
1797         * rendering/RenderFlowThread.cpp:
1798         (WebCore::RenderFlowThread::RenderFlowThread):
1799         (WebCore::RenderFlowThread::invalidateRegions):
1800         (WebCore::RenderFlowThread::validateRegions):
1801         (WebCore::RenderFlowThread::layout):
1802         (WebCore::RenderFlowThread::firstRegion): This getter should work even though the region chain is invalid.
1803         (WebCore::RenderFlowThread::lastRegion): This getter should work even though the region chain is invalid.
1804         (WebCore::RenderFlowThread::initializeRegionsComputedAutoHeight):
1805         (WebCore::RenderFlowThread::markRegionsForOverflowLayoutIfNeeded): If the flow thread has no overflow do nothing.
1806         (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
1807         (WebCore::RenderFlowThread::addForcedRegionBreak):
1808         * rendering/RenderFlowThread.h:
1809         * rendering/RenderMultiColumnSet.cpp:
1810         (WebCore::RenderMultiColumnSet::flowThreadPortionOverflowRect):
1811         * rendering/RenderRegion.cpp:
1812         (WebCore::RenderRegion::pageLogicalHeight):
1813         (WebCore::RenderRegion::maxPageLogicalHeight):
1814         (WebCore::RenderRegion::logicalHeightOfAllFlowThreadContent):
1815         (WebCore::RenderRegion::flowThreadPortionOverflowRect):
1816         (WebCore::RenderRegion::overflowRectForFlowThreadPortion): Used to get the flow thread visual or layout overflow.
1817         (WebCore::RenderRegion::layoutBlock):
1818         (WebCore::RenderRegion::computeOverflowFromFlowThread):
1819         (WebCore::RenderRegion::updateLogicalHeight):
1820         * rendering/RenderRegion.h:
1821         * rendering/RenderView.cpp:
1822         (WebCore::RenderView::layoutContentToComputeOverflowInRegions):
1823         (WebCore::RenderView::layout):
1824         * rendering/RenderView.h:
1825
1826 2013-08-07  Simon Fraser  <simon.fraser@apple.com>
1827
1828         Avoid spurious "all repaint" layouts when scrolling WebViews on Retina displays
1829         https://bugs.webkit.org/show_bug.cgi?id=119564
1830
1831         Reviewed by Beth Dakin.
1832
1833         When scrolling WebViews on Macs with Retina displays, AppKit uses
1834         device pixels for the scroll offset, so [scrollView() documentVisibleRect]
1835         can return a CGRect with non-integral origin. This rect is used by layout,
1836         via layoutSize(), to decide whether the view size changed, which prompts
1837         a full repaint. However, FrameView gets a value which has been rounded
1838         by enclosingIntRect(), which increases the height or width by 1px if the 
1839         y or x offset is on a half-pixel, causing spurious full repaints.
1840         
1841         Fix by plumbing through platformVisibleContentSize(), which just
1842         gets the size of the -documentVisibleRect.
1843         
1844         * page/FrameView.cpp:
1845         (WebCore::FrameView::layout): Don't get layoutHeight and layoutWidth
1846         separately, since that is two calls down into platformVisibleContentSize.
1847         * platform/ScrollView.cpp:
1848         (WebCore::ScrollView::unscaledVisibleContentSize):
1849         (WebCore::ScrollView::platformVisibleContentSize):
1850         * platform/ScrollView.h:
1851         * platform/mac/ScrollViewMac.mm:
1852         (WebCore::ScrollView::platformVisibleContentSize):
1853
1854 2013-08-07  Simon Fraser  <simon.fraser@apple.com>
1855
1856         Be more aggressive about sending fake mouse events less frequently
1857         https://bugs.webkit.org/show_bug.cgi?id=119563
1858         <rdar://problem/14669029>
1859
1860         Reviewed by Tim Horton.
1861
1862         r109151 added code that throttles back the fake mouse events that we
1863         send during scrolling, but in such a way that a page could take up to
1864         100ms to handle a single mousemove, and we'd still send fake mousemove
1865         events every 100ms. This could cause serious scrolling stutter.
1866         
1867         Fix by changing when we drop back to sending events every 250ms, rather than every
1868         100ms: if the slowest mousemove takes 10ms or more (less than one frame), drop back
1869         to a 250ms fake move interval.
1870
1871         * page/EventHandler.cpp:
1872         (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
1873
1874 2013-08-07  Adenilson Cavalcanti  <cavalcantii@gmail.com>
1875
1876         [rendering] Implement PaintInfo interfaces
1877         https://bugs.webkit.org/show_bug.cgi?id=119388
1878
1879         Reviewed by Benjamin Poulain.
1880
1881         In discussion in IRC, it was decided to remove this comment since implementing such change
1882         would have a vast impact on rendering classes.
1883
1884         * rendering/PaintInfo.h:
1885
1886 2013-08-07  Dean Jackson  <dino@apple.com>
1887
1888         Don't remove contents layer from its parent unless necessary
1889         https://bugs.webkit.org/show_bug.cgi?id=119560
1890
1891         Reviewed by Simon Fraser.
1892
1893         RenderLayerBacking::updateInternalHierarchy() is called in some
1894         instances where there doesn't need to be a complete reparenting of the
1895         the m_graphicsLayer. For example, on OS X when the user changes the
1896         scrollbar styles to/from always visible. We don't need to always
1897         remove the graphics layer from its parent - any reparenting does that
1898         automatically.
1899
1900         Unfortunately we can't trigger this situation in an automated test.
1901
1902         * rendering/RenderLayerBacking.cpp:
1903         (WebCore::RenderLayerBacking::updateInternalHierarchy): Don't call removeFromParent().
1904
1905 2013-08-07  Tim Horton  <timothy_horton@apple.com>
1906
1907         Fall out of simple image layer optimization if the image has EXIF rotation
1908         https://bugs.webkit.org/show_bug.cgi?id=119535
1909         <rdar://problem/14071174>
1910
1911         Reviewed by Simon Fraser.
1912
1913         Test: fast/images/exif-orientation-composited.html
1914
1915         * platform/graphics/BitmapImage.cpp:
1916         (WebCore::BitmapImage::frameOrientationAtIndex):
1917         Ensure that the frame is cached if we're requesting the orientation,
1918         so we can acquire orientation information at any given time.
1919
1920         * platform/mac/DragImageMac.mm:
1921         (WebCore::createDragImageFromImage):
1922         * platform/graphics/BitmapImage.h:
1923         Rename currentFrameOrientation to frameOrientationForCurrentFrame to match
1924         the similarly-behaving nativeImageForCurrentFrame.
1925
1926         * platform/graphics/Image.h:
1927         (WebCore::Image::orientationForCurrentFrame): Added. Virtual, overriden by BitmapImage.
1928
1929         * rendering/RenderLayerBacking.cpp:
1930         (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
1931         If the given image has a non-default image orientation, don't use direct compositing.
1932
1933 2013-08-07  Antti Koivisto  <antti@apple.com>
1934
1935         fast/frames/seamless/seamless-custom-font-pruning-crash.html asserts
1936         https://bugs.webkit.org/show_bug.cgi?id=119557
1937
1938         Rubber-stamped by Eric Carlson.
1939         
1940         Pass Style::Detach style change to seamless document as Style::Force. Style::resolveTree does not expect to be called with Detach.
1941
1942         * html/HTMLIFrameElement.cpp:
1943         (WebCore::HTMLIFrameElement::didRecalcStyle):
1944
1945 2013-08-07  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
1946
1947         Disable HTTP request "Accept-Encoding:" header field on gstreamer source element to avoid receiving the wrong size when retrieving data
1948         https://bugs.webkit.org/show_bug.cgi?id=115354
1949
1950         Reviewed by Philippe Normand.
1951
1952         The default value for the HTTP "Accept-Encoding:" header field in the request allows
1953         compressed data to be received on requests.
1954         While this works fine for most cases, it can break the webkit source that needs to rely on the
1955         the proper data size when receiving the response (even though the received data is already
1956         uncompressed the size reported in ResourceResponse::expectedContentLength() is the same
1957         represented by the HTTP header field "Content-Length" which is the size of the compressed data).
1958
1959         This patch disables the HTTP "Accept-Encoding:" header field when using the request
1960         as we don't want the received response to be encoded in any way, as we need to rely on the proper
1961         size of the returned data on ResourceHandle::didReceiveResponse().
1962
1963         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1964         (webKitWebSrcStart):
1965         * platform/network/soup/ResourceRequest.h:
1966         (ResourceRequestBase):
1967         (WebCore::ResourceRequest::acceptEncoding):
1968         (WebCore::ResourceRequest::setAcceptEncoding):
1969         (WebCore::ResourceRequest::ResourceRequestBase):
1970         * platform/network/soup/ResourceRequestSoup.cpp:
1971         (WebCore::ResourceRequest::updateSoupMessage):
1972         (WebCore::ResourceRequest::toSoupMessage):
1973
1974 2013-08-07  Allan Sandfeld Jensen  <allan.jensen@digia.com>
1975
1976         [Qt] REGRESSION(r) Two pixel result fail after r153522
1977         https://bugs.webkit.org/show_bug.cgi?id=119392
1978
1979         Reviewed by Jocelyn Turcotte.
1980
1981         Consider scaling transform on the painter to determine final destination size.
1982
1983         Covered by existing tests.
1984
1985         * platform/graphics/qt/ImageQt.cpp:
1986         (WebCore::prescaleImageIfRequired):
1987         (WebCore::BitmapImage::draw):
1988
1989 2013-08-07  Antti Koivisto  <antti@apple.com>
1990
1991         2.5% regression on page cycler moz
1992         https://bugs.webkit.org/show_bug.cgi?id=102822
1993
1994         Reviewed by Andreas Kling.
1995
1996         DocumentStyleSheetCollection::invalidateInjectedStyleSheetCache() triggers a style recalc for quirks mode
1997         documents in the beginning of document parsing via Document::setCompatibilityMode. This often coalesces 
1998         with style recalc triggered by stylesheet loading. However on very simple documents it can generate genuinely
1999         unnecessary work.
2000
2001         * dom/DocumentStyleSheetCollection.cpp:
2002         (WebCore::DocumentStyleSheetCollection::invalidateInjectedStyleSheetCache):
2003         
2004             Check that we actually have cached injected stylesheets before triggering style recalc.
2005             
2006         * page/PageGroup.cpp:
2007         (WebCore::PageGroup::addUserStyleSheetToWorld):
2008         (WebCore::PageGroup::removeUserStyleSheetFromWorld):
2009         (WebCore::PageGroup::removeUserStyleSheetsFromWorld):
2010         (WebCore::PageGroup::removeAllUserContent):
2011         
2012             Fix a misspelling.
2013
2014         (WebCore::PageGroup::invalidateInjectedStyleSheetCacheInAllFrames):
2015         
2016             Always invalidate style when user sheets change since we don't do that in
2017             DocumentStyleSheetCollection::invalidateInjectedStyleSheetCache anymore.
2018
2019         * page/PageGroup.h:
2020
2021 2013-08-07  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
2022
2023         Do no check seek offset against internal size on gstreamer source element
2024         https://bugs.webkit.org/show_bug.cgi?id=116533
2025
2026         Reviewed by Philippe Normand.
2027
2028         The internal size on gstreamer source element may be wrong in case the received size in
2029         didReceiveResponse is not accurate. Lets just try to seek and let it fail if necessary.
2030
2031         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2032         (webKitWebSrcSeekDataCb):
2033
2034 2013-08-07  Antti Koivisto  <antti@apple.com>
2035
2036         Create WebCore/style and move StyleResolveTree there
2037         https://bugs.webkit.org/show_bug.cgi?id=119543
2038
2039         Reviewed by Andreas Kling.
2040
2041         WebCore/css is bloated. We should move the internal style representation and the style resolver
2042         related code to a directory of their own. CSS language related code including parser and 
2043         CSSOM stays under css.
2044
2045         Things named StyleFoo should generally move under WebCore/style. They should also be moved to
2046         the Style namespace at the same time.
2047
2048         * CMakeLists.txt:
2049         * GNUmakefile.am:
2050         * GNUmakefile.list.am:
2051         * WebCore.pri:
2052         * Target.pri:
2053         * WebCore.vcxproj/WebCore.vcxproj:
2054         * WebCore.vcxproj/WebCoreCommon.props:
2055         * WebCore.vcxproj/copyForwardingHeaders.cmd:
2056         * WebCore.xcodeproj/project.pbxproj:
2057         * css/StyleResolveTree.cpp: Removed.
2058         * css/StyleResolveTree.h: Removed.
2059         * style: Added.
2060         * style/StyleResolveTree.cpp: Copied from Source/WebCore/css/StyleResolveTree.cpp.
2061         * style/StyleResolveTree.h: Copied from Source/WebCore/css/StyleResolveTree.h.
2062
2063 2013-08-07  Antti Koivisto  <antti@apple.com>
2064
2065         Move style recalculation out from Element
2066         https://bugs.webkit.org/show_bug.cgi?id=119497
2067
2068         Reviewed by Andreas Kling.
2069
2070         Element currently does too much. Element::recalcStyle() and the related functions can be turned into
2071         standalone functions that operate on DOM tree. This will also give more freedom for future refactoring,
2072         for example making style recalculation non-recursive.
2073
2074         * WebCore.xcodeproj/project.pbxproj:
2075         * css/StyleResolveTree.cpp: Added.
2076         (WebCore::Style::determineChange):
2077                 
2078             - moved and renamed from Node::diff
2079             - factored to use early return style
2080             - simplifield the null input logic
2081
2082         (WebCore::Style::pseudoStyleCacheIsInvalid):
2083         
2084             - moved from Element::pseudoStyleCacheIsInvalid
2085             - narrowed to take RenderObject rather than operate on Element
2086
2087         (WebCore::Style::resolveLocal):
2088         
2089             - split from Element::recalcStyle
2090             - factored to use early return style
2091
2092         (WebCore::Style::resolveTree):
2093         
2094             - moved and renamed from Element::recalcStyle
2095
2096         * css/StyleResolveTree.h: Added.
2097         
2098             - introcuduce Style namespace for style related classes and functions
2099             - move and rename Node::StyleChange -> Style::Change
2100
2101         * css/StyleResolver.h:
2102         (WebCore::StyleResolverParentPusher::StyleResolverParentPusher):
2103         (WebCore::StyleResolverParentPusher::push):
2104         (WebCore::StyleResolverParentPusher::~StyleResolverParentPusher):
2105         
2106             Moved this stack helper to StyleResolver.h for now since it is needed by both
2107             StyleRecalculation and Element.
2108
2109         * dom/Document.cpp:
2110         (WebCore::Document::recalcStyle):
2111         (WebCore::Document::updateStyleIfNeeded):
2112         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
2113         (WebCore::Document::attach):
2114         (WebCore::Document::styleResolverChanged):
2115         (WebCore::Document::webkitWillEnterFullScreenForElement):
2116         * dom/Document.h:
2117         * dom/Element.cpp:
2118         (WebCore::shouldIgnoreAttributeCase):
2119         (WebCore::Element::updatePseudoElement):
2120         (WebCore::Element::resetComputedStyle):
2121         (WebCore::Element::willRecalcStyle):
2122         (WebCore::Element::didRecalcStyle):
2123         * dom/Element.h:
2124         
2125             - remove Element::recalcStyle
2126             - make a few private functions needed by StyleRecalculation public
2127
2128         * dom/ElementShadow.cpp:
2129         (WebCore::ElementShadow::recalcStyle):
2130         * dom/ElementShadow.h:
2131         * dom/Node.cpp:
2132         * dom/Node.h:
2133
2134             - remove Node::StyleChange
2135             - remove Node::diff
2136
2137         * dom/PseudoElement.cpp:
2138         (WebCore::PseudoElement::didRecalcStyle):
2139         * dom/PseudoElement.h:
2140         * dom/ShadowRoot.cpp:
2141         (WebCore::ShadowRoot::recalcStyle):
2142         (WebCore::ShadowRoot::setResetStyleInheritance):
2143         * dom/ShadowRoot.h:
2144         * dom/Text.cpp:
2145         (WebCore::Text::recalcTextStyle):
2146         * dom/Text.h:
2147         * html/HTMLFormControlElement.cpp:
2148         (WebCore::HTMLFormControlElement::didRecalcStyle):
2149         * html/HTMLFormControlElement.h:
2150         * html/HTMLFrameSetElement.cpp:
2151         (WebCore::HTMLFrameSetElement::willRecalcStyle):
2152         * html/HTMLFrameSetElement.h:
2153         * html/HTMLIFrameElement.cpp:
2154         (WebCore::HTMLIFrameElement::didRecalcStyle):
2155         * html/HTMLIFrameElement.h:
2156         * html/HTMLMediaElement.cpp:
2157         (WebCore::HTMLMediaElement::didRecalcStyle):
2158         * html/HTMLMediaElement.h:
2159         * html/HTMLOptionElement.cpp:
2160         (WebCore::HTMLOptionElement::didRecalcStyle):
2161         * html/HTMLOptionElement.h:
2162         * html/HTMLPlugInImageElement.cpp:
2163         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
2164         (WebCore::HTMLPlugInImageElement::documentWillSuspendForPageCache):
2165         (WebCore::HTMLPlugInImageElement::documentDidResumeFromPageCache):
2166         * html/HTMLPlugInImageElement.h:
2167         * inspector/InspectorOverlay.cpp:
2168         (WebCore::InspectorOverlay::update):
2169         * loader/DocumentWriter.cpp:
2170         (WebCore::DocumentWriter::reportDataReceived):
2171         * page/Frame.cpp:
2172         (WebCore::Frame::setPageAndTextZoomFactors):
2173         * page/Page.cpp:
2174         (WebCore::Page::setPageScaleFactor):
2175         * rendering/RenderBlock.cpp:
2176         (WebCore::RenderBlock::updateFirstLetterStyle):
2177         * svg/SVGElement.cpp:
2178         (WebCore::SVGElement::willRecalcStyle):
2179         * svg/SVGElement.h:
2180         * svg/SVGUseElement.cpp:
2181         (WebCore::SVGUseElement::willRecalcStyle):
2182         * svg/SVGUseElement.h:
2183
2184 2013-08-07  Mihnea Ovidenie  <mihnea@adobe.com>
2185
2186         [CSSRegions] Wrong auto-height region computation for nested named flows
2187         https://bugs.webkit.org/show_bug.cgi?id=119517
2188
2189         Reviewed by David Hyatt.
2190
2191         Test: fast/regions/abspos-autoheight-nested-region.html
2192
2193         In the case of an (inner) auto-height region that is absolutely positioned in a named flow that is displayed in an (outer) auto-height region,
2194         when we are doing the layout for the named flow we need to add a "forced region break" also for the case of simplified layout, otherwise
2195         the outer auto-height region will not get the chance to compute its auto-height, ending up with a huge value that was used to initialize
2196         the auto-height computed value before the start of the layout algorithm.
2197
2198         * rendering/RenderBlock.cpp:
2199         (WebCore::RenderBlock::simplifiedLayout):
2200
2201 2013-08-06  Stephanie Lewis  <slewis@apple.com>
2202
2203         Update Order Files for Safari
2204         <rdar://problem/14517392>
2205
2206         Unreviewed.
2207
2208         No change in functionality.
2209
2210         * WebCore.order:
2211
2212 2013-08-04  Sam Weinig  <sam@webkit.org>
2213
2214         Remove support for HTML5 Microdata
2215         https://bugs.webkit.org/show_bug.cgi?id=119480
2216
2217         Reviewed by Anders Carlsson.
2218
2219         * CMakeLists.txt:
2220         * Configurations/FeatureDefines.xcconfig:
2221         * DerivedSources.cpp:
2222         * DerivedSources.make:
2223         * DerivedSources.pri:
2224         * GNUmakefile.list.am:
2225         * Target.pri:
2226         * UseJSC.cmake:
2227         * WebCore.vcxproj/WebCore.vcxproj:
2228         * WebCore.vcxproj/WebCore.vcxproj.filters:
2229         * WebCore.xcodeproj/project.pbxproj:
2230         * bindings/gobject/GNUmakefile.am:
2231         * bindings/js/JSBindingsAllInOne.cpp:
2232         * bindings/js/JSHTMLCollectionCustom.cpp:
2233         (WebCore::JSHTMLCollection::nameGetter):
2234         * bindings/js/JSHTMLElementCustom.cpp:
2235         * bindings/js/JSMicroDataItemValueCustom.cpp: Removed.
2236         * bindings/scripts/CodeGeneratorJS.pm:
2237         (GenerateImplementation):
2238         * dom/Document.cpp:
2239         * dom/Document.h:
2240         * dom/Document.idl:
2241         * dom/Element.cpp:
2242         (WebCore::Element::ensureCachedHTMLCollection):
2243         * dom/LiveNodeList.cpp:
2244         (WebCore::LiveNodeListBase::rootNode):
2245         (WebCore::LiveNodeListBase::invalidateCache):
2246         (WebCore::LiveNodeList::namedItem):
2247         * dom/LiveNodeList.h:
2248         (WebCore::LiveNodeListBase::shouldInvalidateTypeOnAttributeChange):
2249         * dom/MicroDataItemList.cpp: Removed.
2250         * dom/MicroDataItemList.h: Removed.
2251         * dom/Node.cpp:
2252         * dom/Node.h:
2253         * dom/NodeRareData.cpp:
2254         * dom/NodeRareData.h:
2255         * dom/PropertyNodeList.cpp: Removed.
2256         * dom/PropertyNodeList.h: Removed.
2257         * dom/PropertyNodeList.idl: Removed.
2258         * html/CollectionType.h:
2259         * html/HTMLAnchorElement.cpp:
2260         * html/HTMLAnchorElement.h:
2261         * html/HTMLAreaElement.cpp:
2262         * html/HTMLAreaElement.h:
2263         * html/HTMLCollection.cpp:
2264         (WebCore::shouldOnlyIncludeDirectChildren):
2265         (WebCore::rootTypeFromCollectionType):
2266         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
2267         (WebCore::isMatchingElement):
2268         (WebCore::LiveNodeListBase::item):
2269         * html/HTMLElement.cpp:
2270         (WebCore::HTMLElement::parseAttribute):
2271         (WebCore::HTMLElement::isURLAttribute):
2272         * html/HTMLElement.h:
2273         * html/HTMLElement.idl:
2274         * html/HTMLEmbedElement.cpp:
2275         * html/HTMLEmbedElement.h:
2276         * html/HTMLIFrameElement.cpp:
2277         * html/HTMLIFrameElement.h:
2278         * html/HTMLImageElement.cpp:
2279         * html/HTMLImageElement.h:
2280         * html/HTMLLinkElement.cpp:
2281         * html/HTMLLinkElement.h:
2282         * html/HTMLMediaElement.cpp:
2283         * html/HTMLMediaElement.h:
2284         * html/HTMLMetaElement.cpp:
2285         * html/HTMLMetaElement.h:
2286         * html/HTMLObjectElement.cpp:
2287         * html/HTMLObjectElement.h:
2288         * html/HTMLPropertiesCollection.cpp: Removed.
2289         * html/HTMLPropertiesCollection.h: Removed.
2290         * html/HTMLPropertiesCollection.idl: Removed.
2291         * html/HTMLSourceElement.cpp:
2292         * html/HTMLSourceElement.h:
2293         * html/HTMLTrackElement.cpp:
2294         * html/HTMLTrackElement.h:
2295         * html/MicroDataAttributeTokenList.cpp: Removed.
2296         * html/MicroDataAttributeTokenList.h: Removed.
2297         * html/MicroDataItemValue.cpp: Removed.
2298         * html/MicroDataItemValue.h: Removed.
2299         * html/MicroDataItemValue.idl: Removed.
2300
2301 2013-08-06  Tim Horton  <timothy_horton@apple.com>
2302
2303         Remove PlatformCALayer::contentsTransform and ::setContentsTransform
2304         https://bugs.webkit.org/show_bug.cgi?id=119529
2305
2306         Reviewed by Sam Weinig.
2307
2308         No new tests, removing dead code.
2309
2310         These methods are not used and are currently unimplemented.
2311
2312         * platform/graphics/ca/PlatformCALayer.h:
2313         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2314         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2315
2316 2013-08-06  Alex Christensen  <achristensen@apple.com>
2317
2318         Moved GraphicsContext3DPrivate out of cairo directory to be used by the AppleWin port.
2319         https://bugs.webkit.org/show_bug.cgi?id=119525
2320
2321         Reviewed by Dean Jackson.
2322
2323         * GNUmakefile.list.am:
2324         * PlatformGTK.cmake:
2325         * WebCore.vcxproj/WebCore.vcxproj:
2326         * WebCore.vcxproj/WebCore.vcxproj.filters:
2327         Changed location of GraphicsContext3DPrivate.cpp and GraphicsContext3DPrivate.h.
2328         * platform/graphics/GraphicsContext3DPrivate.cpp: Copied from WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp.
2329         * platform/graphics/GraphicsContext3DPrivate.h: Copied from WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.h.
2330         * platform/graphics/cairo/GraphicsContext3DPrivate.cpp: Removed.
2331         * platform/graphics/cairo/GraphicsContext3DPrivate.h: Removed.
2332
2333 2013-08-06  Brent Fulgham  <bfulgham@apple.com>
2334
2335         [Windows] Unreviewed build correction after r153754 and r153757.
2336
2337         * page/animation/CSSPropertyAnimation.cpp:
2338         (WebCore::blendFunc): Don't force std::remainder, since we are using our own
2339         custom implementation on Windows.
2340
2341 2013-08-06  Brent Fulgham  <bfulgham@apple.com>
2342
2343         Improper Calculation of In-band Cue Colors
2344         https://bugs.webkit.org/show_bug.cgi?id=119523
2345
2346         Reviewed by Eric Carlson.
2347
2348         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
2349         (WebCore::makeRGBA32FromARGBCFArray): Remove redundant multiplication by
2350         255.  The internal conversion logic already converts to bytes.
2351
2352 2013-08-06  Rob Buis  <rwlbuis@webkit.org>
2353
2354         Speculative build fix after r153754.
2355
2356         * page/animation/CSSPropertyAnimation.cpp:
2357         (WebCore::blendFunc):
2358
2359 2013-07-23  David Farler  <dfarler@apple.com>
2360
2361         Provide optional OTHER_CFLAGS, OTHER_CPPFLAGS, OTHER_LDFLAGS additions for building with ASAN
2362         https://bugs.webkit.org/show_bug.cgi?id=117762
2363
2364         Reviewed by Mark Rowe.
2365
2366         No new tests necessary.
2367
2368         * Configurations/DebugRelease.xcconfig:
2369         Add ASAN_OTHER_CFLAGS, CPLUSPLUSFLAGS, LDFLAGS.
2370         * Configurations/WebCore.xcconfig:
2371         Add ASAN_OTHER_LDFLAGS.
2372         * Configurations/WebCoreTestShim.xcconfig:
2373         Add ASAN_OTHER_LDFLAGS.
2374         * Configurations/WebCoreTestSupport.xcconfig:
2375         Add ASAN_OTHER_LDFLAGS.
2376         * WebCore.xcodeproj/project.pbxproj:
2377         Don't use ASAN for build tools.
2378
2379 2013-08-05  Rob Buis  <rwlbuis@webkit.org>
2380
2381         SVG stroke-dasharray is not animatable
2382         https://bugs.webkit.org/show_bug.cgi?id=118574
2383
2384         Reviewed by Dirk Schulze.
2385
2386         Make stroke-dasharray a property that can be animated using CSS transitions.
2387
2388         * page/animation/CSSPropertyAnimation.cpp:
2389         (WebCore::blendFunc):
2390         (WebCore::CSSPropertyAnimation::ensurePropertyMap):
2391         * rendering/style/RenderStyle.h:
2392
2393 2013-08-06  Sergio Villar Senin  <svillar@igalia.com>
2394
2395         [CSS Grid Layout] Allow defining named grid lines on the grid element
2396         https://bugs.webkit.org/show_bug.cgi?id=118255
2397
2398         Reviewed by Andreas Kling.
2399
2400         From Blink r149798 by <jchaffraix@chromium.org>
2401
2402         This change adds parsing, style resolution and getComputedStyle
2403         support for named grid lines at the grid element level
2404         (i.e. extends our <track-list> support). Per the specification, we
2405         allow multiple grid lines with the same name.
2406
2407         To fully support resolving the grid lines to a position on our
2408         grid, we need to add the parsing at the grid item's level (which
2409         means extending our <grid-line> support). This will be done in a
2410         follow-up change.
2411
2412         Test: fast/css-grid-layout/named-grid-line-get-set.html
2413
2414         * css/CSSComputedStyleDeclaration.cpp:
2415         (WebCore::addValuesForNamedGridLinesAtIndex):
2416         (WebCore::valueForGridTrackList):
2417         (WebCore::ComputedStyleExtractor::propertyValue):
2418         * css/CSSParser.cpp:
2419         (WebCore::CSSParser::parseGridTrackList):
2420         * css/StyleResolver.cpp:
2421         (WebCore::createGridTrackList):
2422         (WebCore::StyleResolver::applyProperty):
2423         * rendering/style/RenderStyle.h:
2424         * rendering/style/StyleGridData.cpp:
2425         (WebCore::StyleGridData::StyleGridData):
2426         * rendering/style/StyleGridData.h:
2427         (WebCore::StyleGridData::operator==):
2428
2429 2013-08-06  Allan Sandfeld Jensen  <allan.jensen@digia.com>
2430
2431         [Qt] Fix minimal build.
2432
2433         Unreviewed build fix.
2434
2435         Fix build witt XSLT disabled
2436
2437         * xml/parser/XMLDocumentParserLibxml2.cpp:
2438         (WebCore::hasNoStyleInformation):
2439
2440 2013-08-06  Zan Dobersek  <zdobersek@igalia.com>
2441
2442         webkit-gtk fails to build with bison-3.0
2443         https://bugs.webkit.org/show_bug.cgi?id=119373
2444
2445         Reviewed by Gustavo Noronha Silva.
2446
2447         * GNUmakefile.am: Remove rules for generating ANGLE's glslang source files with Bison.
2448
2449 2013-06-26  Sergio Villar Senin  <svillar@igalia.com>
2450
2451         [CSS Grid Layout] Add support for parsing <grid-line> that includes a 'span'
2452         https://bugs.webkit.org/show_bug.cgi?id=118051
2453
2454         Reviewed by Andreas Kling.
2455
2456         From Blink r148766 by <jchaffraix@chromium.org>
2457
2458         This adds the parsing, style resolution and getComputedStyle bits
2459         to our code. The rendering code was not made aware of the new type
2460         of GridPosition yet.
2461
2462         * css/CSSComputedStyleDeclaration.cpp:
2463         (WebCore::valueForGridPosition):
2464         * css/CSSParser.cpp:
2465         (WebCore::CSSParser::parseValue):
2466         (WebCore::CSSParser::parseGridPosition):
2467         * css/CSSParser.h:
2468         * css/CSSValueKeywords.in:
2469         * css/StyleResolver.cpp:
2470         (WebCore::StyleResolver::adjustRenderStyle):
2471         (WebCore::StyleResolver::adjustGridItemPosition):
2472         (WebCore::createGridPosition):
2473         * css/StyleResolver.h:
2474         * rendering/RenderGrid.cpp:
2475         (WebCore::RenderGrid::resolveGridPositionFromStyle):
2476         * rendering/style/GridPosition.h:
2477         (WebCore::GridPosition::isInteger):
2478         (WebCore::GridPosition::isSpan):
2479         (WebCore::GridPosition::setSpanPosition):
2480         (WebCore::GridPosition::spanPosition):
2481
2482 2013-06-25  Sergio Villar Senin  <svillar@igalia.com>
2483
2484         [CSS Grid Layout] Rename grid placement properties
2485         https://bugs.webkit.org/show_bug.cgi?id=117878
2486
2487         Reviewed by Andreas Kling.
2488
2489         Renamed the grid placement properties to match the latest version
2490         of the spec. The new names are -webkit-grid-column-{start|end} and
2491         -webkit-grid-row-{start|end}.
2492
2493         No new tests needed as we're just renaming some properties,
2494         functionality already covered by existing tests in
2495         fast/css-grid-layout.
2496
2497         * css/CSSComputedStyleDeclaration.cpp:
2498         (WebCore::ComputedStyleExtractor::propertyValue):
2499         * css/CSSParser.cpp:
2500         (WebCore::CSSParser::parseValue):
2501         * css/CSSProperty.cpp:
2502         (WebCore::CSSProperty::isInheritedProperty):
2503         * css/CSSPropertyNames.in:
2504         * css/StylePropertyShorthand.cpp:
2505         (WebCore::webkitGridColumnShorthand):
2506         (WebCore::webkitGridRowShorthand):
2507         * css/StyleResolver.cpp:
2508         (WebCore::StyleResolver::applyProperty):
2509         * rendering/RenderGrid.cpp:
2510         (WebCore::RenderGrid::maximumIndexInDirection):
2511         (WebCore::RenderGrid::resolveGridPositionsFromStyle):
2512         (WebCore::RenderGrid::resolveGridPositionFromStyle):
2513         * rendering/RenderGrid.h:
2514         * rendering/style/RenderStyle.h:
2515         * rendering/style/StyleGridItemData.cpp:
2516         (WebCore::StyleGridItemData::StyleGridItemData):
2517         * rendering/style/StyleGridItemData.h:
2518         (WebCore::StyleGridItemData::operator==):
2519
2520 2013-08-05  Przemyslaw Szymanski  <p.szymanski3@samsung.com>
2521
2522         [WebGL] validateRenderingState method name change
2523         https://bugs.webkit.org/show_bug.cgi?id=119485
2524
2525         According to validateRenderingState method functionality its name should be
2526         changed. This method validates only vertex attributes.
2527
2528         Reviewed by Dean Jackson.
2529
2530         No new tests. Covered by existing tests. No changes in functionality.
2531
2532         * html/canvas/WebGLRenderingContext.cpp:
2533         (WebCore::WebGLRenderingContext::validateVertexAttributes):
2534         (WebCore::WebGLRenderingContext::drawArrays):
2535         (WebCore::WebGLRenderingContext::drawElements):
2536         * html/canvas/WebGLRenderingContext.h:
2537
2538 2013-07-27  Mark Rowe  <mrowe@apple.com>
2539
2540         Logging should be configurable using human-readable channel names rather than crazy bitmasks
2541         <http://webkit.org/b/119031>
2542
2543         Implement shared logic for initializing logging channels based on human-readable channel names in WTF,
2544         and rework the WebCore, WebKit and WebKit2 logging initialization on top of it.
2545
2546         Logging channels may now be enabled by providing a comma-separated list of channel names, with the special
2547         "all" name enabling all channels. Channel names prefixed with a leading "-" will result in the named channel
2548         being disabled. For instance, specifying "all,-history,-loading" will result in all logging channels except
2549         for history and loading being enabled.
2550
2551         For OS X developers, this also changes the name of the user defaults used to enable logging. This is done to allow
2552         the old user defaults to remain set for those people that need to switch between version of WebKit before and
2553         after this change. Where the old user default keys were WebCoreLogLevel, WebKitLogLevel and WebKit2LogLevel,
2554         the new user default keys are WebCoreLogging, WebKitLogging and WebKit2Logging.
2555
2556         For GTK developers, this changes the separator used in the WEBKIT_DEBUG environment variable to a comma for
2557         consistency with the other platforms and to enable more code sharing.
2558
2559         While doing this work I've also taken the opportunity to eliminate the need to touch multiple files when
2560         adding a new logging channel. Now only the header in the relevant project needs to be updated.
2561
2562         Reviewed by Sam Weinig.
2563
2564         * GNUmakefile.list.am: Remove the now-unused InitializeLogging.h
2565         * Target.pri: Ditto.
2566         * WebCore.xcodeproj/project.pbxproj: Ditto.
2567         * platform/InitializeLogging.h: Removed. Ditto.
2568         * platform/Logging.cpp: Use WEBCORE_LOG_CHANNELS to define all of the channels.
2569         (WebCore::logChannelByName): Renamed to match our naming conventions. Calls through to the new WTF function
2570         to find a log channel rather than repeating the names of the log channels a further two times each.
2571         (WebCore::initializeLoggingChannelsIfNecessary): Pass the channels and the log level string to the new
2572         WTF function that handles the initialization.
2573         * platform/Logging.h: Declare a WEBCORE_LOG_CHANNELS macro that can be used to apply a preprocessor macro
2574         across the set of all logging channels. Use this macro to declare the logging channels.
2575         * platform/blackberry/LoggingBlackBerry.cpp:
2576         (WebCore::logLevelString): Pull the value out of the WEBKIT_DEBUG environment variable.
2577         * platform/efl/LoggingEfl.cpp:
2578         (WebCore::logLevelString): Pull the value out of the WEBKIT_DEBUG environment variable, and then prepend
2579         NotYetImplemented to it so that that channel will be enabled by default.
2580         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2581         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): Accommodate the rename to logChannelByName.
2582         * platform/gtk/LoggingGtk.cpp:
2583         (WebCore::logLevelString): Pull the value out of the WEBKIT_DEBUG environment variable, and then prepend
2584         NotYetImplemented to it so that that channel will be enabled by default.
2585         * platform/mac/LoggingMac.mm:
2586         (WebCore::logLevelString): Pull the value out of the WebCoreLogging user default key.
2587         * platform/qt/LoggingQt.cpp:
2588         (WebCore::logLevelString): Pull the value out of the QT_WEBKIT_LOG environment variable, and then prepend
2589         NotYetImplemented to it so that the channel will be enabled by default.
2590         * platform/win/LoggingWin.cpp:
2591         (WebCore::logLevelString): Pull the value out of the WebCoreLogging environment variable.
2592
2593 2013-08-05  Ryosuke Niwa  <rniwa@webkit.org>
2594
2595         Editor::updateMarkersForWordsAffectedByEditing(bool) shouldn't compute start and end of words when there are nor markers
2596         https://bugs.webkit.org/show_bug.cgi?id=119501
2597
2598         Reviewed by Enrica Casucci.
2599
2600         Exit early in updateMarkersForWordsAffectedByEditing before calling startOfWord and endOfWord if there are no document markers.
2601
2602         * dom/DocumentMarkerController.h:
2603         (WebCore::DocumentMarkerController::hasMarkers): Added.
2604         * editing/Editor.cpp:
2605         (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
2606
2607 2013-08-05  Dean Jackson  <dino@apple.com>
2608
2609         Update HTMLPreloadScanner to handle img srcset
2610         https://bugs.webkit.org/show_bug.cgi?id=119360
2611
2612         Reviewed by Sam Weinig.
2613
2614         This patch is a merge of similar patches from Yoav Weiss <yoav@yoav.ws>
2615         and Dean Jackson.
2616
2617         Test: fast/preloader/image-srcset.html
2618
2619         * html/HTMLImageElement.cpp:
2620         (WebCore::HTMLImageElement::parseAttribute): Move srcset parsing into
2621         HTMLParserIdioms, and call it when we hit src or srcset.
2622         * html/HTMLImageElement.h: Remove code that was moved to HTMLParserIdioms.
2623
2624         * html/parser/HTMLDocumentParser.cpp:
2625         (WebCore::HTMLDocumentParser::pumpTokenizer): Pass device scale into preloader.
2626         (WebCore::HTMLDocumentParser::insert):
2627
2628         * html/parser/HTMLPreloadScanner.cpp:
2629         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner): Takes device scale as a parameter.
2630         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): Resolve between src and srcSet if necessary.
2631         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Add support for srcset attribute.
2632         (WebCore::TokenPreloadScanner::StartTagScanner::setUrlToLoad): New flag to indicate if we should
2633         replace any existing value.
2634         (WebCore::TokenPreloadScanner::TokenPreloadScanner): Takes device scale.
2635         (WebCore::TokenPreloadScanner::scanCommon): Pass device scale.
2636         (WebCore::HTMLPreloadScanner::HTMLPreloadScanner):
2637         * html/parser/HTMLPreloadScanner.h: New attribute to constructor for device scale. New member
2638         variable on TokenPreloadScanner that holds the srcset value.
2639
2640         * html/parser/HTMLParserIdioms.cpp:
2641         (WebCore::ImageWithScale::operator==): Used for sorting.
2642         (WebCore::compareByScaleFactor): Used for sorting.
2643         (WebCore::bestFitSourceForImageAttributes): New method that takes the code from HTMLImageElement
2644         for parsing src and srcset attributes, and finding the best match.
2645         * html/parser/HTMLParserIdioms.h:
2646
2647 2013-08-05  Oliver Hunt  <oliver@apple.com>
2648
2649         Move TypedArray implementation into JSC
2650         https://bugs.webkit.org/show_bug.cgi?id=119489
2651
2652         Reviewed by Filip Pizlo.
2653
2654         Update WebCore for new location of TypedArray implementation.
2655
2656         * ForwardingHeaders/runtime/ArrayBuffer.h: Added.
2657         * ForwardingHeaders/runtime/ArrayBufferView.h: Added.
2658         * ForwardingHeaders/runtime/Float32Array.h: Added.
2659         * ForwardingHeaders/runtime/Float64Array.h: Added.
2660         * ForwardingHeaders/runtime/Int16Array.h: Added.
2661         * ForwardingHeaders/runtime/Int32Array.h: Added.
2662         * ForwardingHeaders/runtime/Int8Array.h: Added.
2663         * ForwardingHeaders/runtime/IntegralTypedArrayBase.h: Added.
2664         * ForwardingHeaders/runtime/TypedArrayBase.h: Added.
2665         * ForwardingHeaders/runtime/Uint16Array.h: Added.
2666         * ForwardingHeaders/runtime/Uint32Array.h: Added.
2667         * ForwardingHeaders/runtime/Uint8Array.h: Added.
2668         * ForwardingHeaders/runtime/Uint8ClampedArray.h: Added.
2669         * Modules/webaudio/AnalyserNode.h:
2670         (WebCore::AnalyserNode::getFloatFrequencyData):
2671         (WebCore::AnalyserNode::getByteFrequencyData):
2672         (WebCore::AnalyserNode::getByteTimeDomainData):
2673         * Modules/webaudio/AsyncAudioDecoder.cpp:
2674         * Modules/webaudio/AsyncAudioDecoder.h:
2675         (WebCore::AsyncAudioDecoder::DecodingTask::audioData):
2676         * Modules/webaudio/AudioBuffer.h:
2677         * Modules/webaudio/AudioContext.cpp:
2678         * Modules/webaudio/AudioParam.h:
2679         * Modules/webaudio/AudioParamTimeline.h:
2680         * Modules/webaudio/PeriodicWave.h:
2681         * Modules/webaudio/RealtimeAnalyser.cpp:
2682         * Modules/webaudio/RealtimeAnalyser.h:
2683         * Modules/webaudio/ScriptProcessorNode.cpp:
2684         * Modules/webaudio/WaveShaperProcessor.h:
2685         * Modules/websockets/ThreadableWebSocketChannel.h:
2686         * Modules/websockets/WebSocket.cpp:
2687         * Modules/websockets/WebSocket.h:
2688         * Modules/websockets/WebSocketChannel.cpp:
2689         * Modules/websockets/WebSocketChannel.h:
2690         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
2691         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
2692         * WebCore.exp.in:
2693         * bindings/js/JSArrayBufferCustom.cpp:
2694         * bindings/js/JSArrayBufferViewHelper.h:
2695         * bindings/js/JSAudioContextCustom.cpp:
2696         * bindings/js/JSCryptoCustom.cpp:
2697         * bindings/js/JSDictionary.h:
2698         * bindings/js/JSFileReaderCustom.cpp:
2699         * bindings/js/JSWebGLRenderingContextCustom.cpp:
2700         * bindings/js/JSXMLHttpRequestCustom.cpp:
2701         * bindings/js/SerializedScriptValue.cpp:
2702         (WebCore::SerializedScriptValue::transferArrayBuffers):
2703         * bindings/js/SerializedScriptValue.h:
2704         * bindings/scripts/CodeGeneratorJS.pm:
2705         (AddIncludesForType):
2706         (GenerateHeader):
2707         (NativeToJSValue):
2708         * dom/MessageEvent.h:
2709         * fileapi/FileReader.cpp:
2710         * fileapi/FileReader.h:
2711         * fileapi/FileReaderLoader.cpp:
2712         * fileapi/FileReaderLoader.h:
2713         * fileapi/FileReaderSync.cpp:
2714         * fileapi/FileReaderSync.h:
2715         * fileapi/WebKitBlobBuilder.cpp:
2716         * fileapi/WebKitBlobBuilder.h:
2717         * html/HTMLMediaElement.cpp:
2718         * html/ImageData.h:
2719         * html/canvas/ArrayBuffer.idl:
2720         * html/canvas/ArrayBufferView.idl:
2721         * html/canvas/CanvasRenderingContext2D.cpp:
2722         * html/canvas/DataView.h:
2723         * html/canvas/Float32Array.idl:
2724         * html/canvas/Float64Array.idl:
2725         * html/canvas/Int16Array.idl:
2726         * html/canvas/Int32Array.idl:
2727         * html/canvas/Int8Array.idl:
2728         * html/canvas/Uint16Array.idl:
2729         * html/canvas/Uint32Array.idl:
2730         * html/canvas/Uint8Array.idl:
2731         * html/canvas/Uint8ClampedArray.idl:
2732         * html/canvas/WebGLBuffer.h:
2733         (WebCore::WebGLBuffer::elementArrayBuffer):
2734         * html/canvas/WebGLGetInfo.cpp:
2735         * html/canvas/WebGLGetInfo.h:
2736         * html/canvas/WebGLRenderingContext.cpp:
2737         * html/canvas/WebGLRenderingContext.h:
2738         * inspector/InspectorMemoryAgent.cpp:
2739         * page/Crypto.cpp:
2740         * page/Crypto.h:
2741         * platform/graphics/GraphicsContext3D.cpp:
2742         * platform/graphics/ImageBuffer.h:
2743         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2744         * platform/graphics/cg/ImageBufferDataCG.h:
2745         * platform/graphics/filters/FEBlend.cpp:
2746         * platform/graphics/filters/FEColorMatrix.cpp:
2747         * platform/graphics/filters/FEComponentTransfer.cpp:
2748         * platform/graphics/filters/FEComposite.cpp:
2749         * platform/graphics/filters/FEConvolveMatrix.cpp:
2750         * platform/graphics/filters/FECustomFilter.cpp:
2751         * platform/graphics/filters/FEDisplacementMap.cpp:
2752         * platform/graphics/filters/FEDropShadow.cpp:
2753         * platform/graphics/filters/FEGaussianBlur.cpp:
2754         * platform/graphics/filters/FELighting.h:
2755         * platform/graphics/filters/FEMorphology.cpp:
2756         * platform/graphics/filters/FETurbulence.cpp:
2757         * platform/graphics/filters/FilterEffect.cpp:
2758         * platform/graphics/filters/FilterEffect.h:
2759         * platform/graphics/mac/GraphicsContext3DMac.mm:
2760         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2761         * testing/Internals.h:
2762         * xml/XMLHttpRequest.cpp:
2763         * xml/XMLHttpRequest.h:
2764         (WebCore::XMLHttpRequest::optionalResponseArrayBuffer):
2765
2766 2013-08-05  Alexey Proskuryakov  <ap@apple.com>
2767
2768         <rdar://problem/14637103> REGRESSION (r153060?): Microphone appears in the way
2769         of text when dictating an e-mail
2770         https://bugs.webkit.org/show_bug.cgi?id=119496
2771
2772         Reviewed by Ryosuke Niwa.
2773
2774         Test: platform/mac/editing/input/firstrectforcharacterrange-caret-in-br.html
2775
2776         * rendering/RenderObject.cpp: (WebCore::RenderObject::absoluteBoundingBoxRectForRange):
2777         FloatRect::unite() doesn't preserve empty rects, which we need here.
2778         We alrady handle the case of collapsed range in Editor::firstRectForRange(), and
2779         this is similar, but we can't currently cover both with one simple fix.
2780
2781 2013-08-05  Morten Stenshorne  <mstensho@opera.com>
2782
2783         Region based columns not painted correctly in non-default writing-modes
2784         https://bugs.webkit.org/show_bug.cgi?id=118506
2785
2786         Reviewed by David Hyatt.
2787
2788         The column translation offset was calculated incorrectly.
2789         The dirty rect intersection check was also wrong.
2790
2791         Added some documentation, to make it clear what's going on.
2792
2793         Tests: fast/multicol/newmulticol/hide-box-horizontal-bt.html
2794                fast/multicol/newmulticol/hide-box-vertical-lr.html
2795                fast/multicol/newmulticol/hide-box-vertical-rl.html
2796
2797         * rendering/RenderMultiColumnSet.cpp:
2798         (WebCore::RenderMultiColumnSet::collectLayerFragments):
2799
2800 2013-08-05  Morten Stenshorne  <mstensho@opera.com>
2801
2802         Region based columns not clipped properly
2803         https://bugs.webkit.org/show_bug.cgi?id=118499
2804
2805         Reviewed by David Hyatt.
2806
2807         Need to call RenderRegion::overflowRectForFlowThreadPortion() first,
2808         and THEN clip in the column gaps. overflowRectForFlowThreadPortion()
2809         expands the logical left and right to the flow thread's overflow
2810         rectangle, effectively defeating inline direction clipping completely.
2811
2812         Tests: fast/multicol/newmulticol/clipping-overflow-hidden.html
2813                fast/multicol/newmulticol/clipping-top-overflow.html
2814                fast/multicol/newmulticol/clipping.html
2815
2816         * rendering/RenderMultiColumnSet.cpp:
2817         (WebCore::RenderMultiColumnSet::flowThreadPortionOverflowRect):
2818
2819 2013-08-05  Vivek Galatage  <vivek.vg@samsung.com>
2820
2821         XMLTreeViewer should be created only in the XML viewer mode
2822         https://bugs.webkit.org/show_bug.cgi?id=119483
2823
2824         Reviewed by Alexey Proskuryakov.
2825
2826         XMLTreeViewer is created even for the XSL transform which is avoided by the patch.
2827         The XMLTreeViewer::hasNoStyleInformation() is moved to XMLDocumentParserLibxml2.cpp
2828         as static inline method as XMLTreeViewer should not have the responsibility for it.
2829         Also removes an unnecessary conditional check while deciding for XML viewer mode.
2830
2831         Blink patch review links:
2832         https://codereview.chromium.org/19552003/
2833         https://codereview.chromium.org/22150003/
2834
2835         No new tests as the patch is about code refactoring.
2836
2837         * xml/XMLTreeViewer.cpp:
2838         * xml/XMLTreeViewer.h:
2839         * xml/parser/XMLDocumentParserLibxml2.cpp:
2840         (WebCore::hasNoStyleInformation):
2841         (WebCore::XMLDocumentParser::doEnd):
2842
2843 2013-08-03  Jer Noble  <jer.noble@apple.com>
2844
2845         Loading a video with a custom URL scheme will result in stalling playback
2846         https://bugs.webkit.org/show_bug.cgi?id=119469
2847
2848         Reviewed by Eric Carlson.
2849
2850         Break the assumption that only one AVAssetResourceRequest will be outstanding simultaneously
2851         by storing a HashMap of AVAssetResourceRequests and their resulting WebCoreAVFResourceLoader.
2852         When loading is stopped (due to completion or error), notify the MediaPlayerPrivateAVFoundation
2853         parent so that the map can be emptied.
2854
2855         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2856         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2857         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): Store the request
2858             in m_resourceLoaderMap.
2859         (WebCore::MediaPlayerPrivateAVFoundationObjC::didCancelLoadingRequest): Pull the request from
2860             m_resourceLoaderMap.
2861         (WebCore::MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest): Remove the requset from
2862             m_resourceLoaderMap.
2863         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
2864         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2865         (WebCore::WebCoreAVFResourceLoader::create): Return a PassRefPtr, rather than a PassOwnPtr.
2866         (WebCore::WebCoreAVFResourceLoader::stopLoading): Call didStopLoadingRequest.
2867
2868 2013-08-05  Abhijeet Kandalkar  <abhijeet.k@samsung.com>
2869
2870         Spatial Navigation should avoid unwanted calculation while deciding focus candidate.
2871         https://bugs.webkit.org/show_bug.cgi?id=117265
2872
2873         Reviewed by Antonio Gomes.
2874
2875         Spatial Navigation should consider only those nodes as candidate which are exactly in the focus-direction.
2876         e.g. If we are moving down then the nodes that are above CURRENT focused node should be considered as invalid.
2877         Added isValidCandidate() which checks whether node is exactly in the focus-direction.
2878
2879         Test: fast/spatial-navigation/snav-search-optimization.html
2880
2881         * page/FocusController.cpp:
2882         (WebCore::FocusController::findFocusCandidateInContainer):
2883         (WebCore::FocusController::advanceFocusDirectionally):
2884         * page/Page.cpp:
2885         (WebCore::Page::Page):
2886         * page/Page.h:
2887         (WebCore::Page::setLastSpatialNavigationCandidateCount):
2888         (WebCore::Page::lastSpatialNavigationCandidateCount):
2889         * page/SpatialNavigation.cpp:
2890         (WebCore::isValidCandidate):
2891         * page/SpatialNavigation.h:
2892         * testing/Internals.cpp:
2893         (WebCore::Internals::lastSpatialNavigationCandidateCount):
2894         * testing/Internals.h:
2895         * testing/Internals.idl:
2896
2897 2013-08-05  Mihai Tica  <mitica@adobe.com>
2898
2899         [CSS Background Blending] Specifying background-image and background-color
2900         with opaque image doesn't trigger blending. The fix consists of adding a
2901         check whether blend mode is set in hasOpaqueImage.
2902
2903         https://bugs.webkit.org/show_bug.cgi?id=119434
2904
2905         Reviewed by Dirk Schulze.
2906
2907         Test: css3/compositing/background-blend-mode-separate-layer-declaration.html
2908
2909         * rendering/style/FillLayer.cpp:
2910         (WebCore::FillLayer::hasOpaqueImage):
2911
2912 2013-08-04  Zalan Bujtas  <zalan@apple.com>
2913
2914         Background doesn't fully repaint when body has margins.
2915         https://bugs.webkit.org/show_bug.cgi?id=119033
2916
2917         Reviewed by Simon Fraser.
2918
2919         Ensure that background-color changes do not leave unpainted areas when
2920         body has margins.
2921
2922         Both <body> and <html> background-color get propagated up to the viewport.
2923         If <body> has background-color attribute set, while <html> doesn't, the color is
2924         applied not only on the <body> but on both the <html> and the viewport. However,
2925         it's not enough to mark the RenderView dirty because with tiles backing on,
2926         there could be areas outside of the viewport that need repaint. By marking
2927         the RenderView's graphics layer dirty instead, we ensure that all the related
2928         tiles get marked dirty too and the new background color covers all areas.
2929
2930         Manual test added. When forcing top-level composition on (even with embedded iframe to
2931         make sure we don't do paintsIntoWindow rendering), the test case execution changes so much,
2932         that the repaint rects don't reflect the functionality difference anymore.
2933
2934         * page/FrameView.cpp:
2935         (WebCore::FrameView::reset):
2936         (WebCore::FrameView::layout):
2937         * page/FrameView.h:
2938         (WebCore::FrameView::needsFullRepaint):
2939         * rendering/RenderBox.cpp:
2940         (WebCore::RenderBox::styleWillChange):
2941         * rendering/RenderObjectChildList.cpp:
2942         (WebCore::RenderObjectChildList::removeChildNode):
2943         * rendering/RenderView.cpp:
2944         (WebCore::RenderView::repaintRootContents):
2945         (WebCore::RenderView::repaintViewAndCompositedLayers):
2946         * rendering/RenderView.h:
2947
2948 2013-08-04  Andreas Kling  <akling@apple.com>
2949
2950         Document needn't expose its active element.
2951         <http://webkit.org/b/119466>
2952
2953         Reviewed by Antonio Gomes.
2954
2955         The Document::m_activeElement pointer is only used inside updateHoverActiveState(),
2956         so we can remove the activeElement()/setActiveElement() accessors.
2957
2958         * dom/Document.h:
2959         * dom/Document.cpp:
2960         (WebCore::Document::updateHoverActiveState):
2961
2962 2013-08-04  Andreas Kling  <akling@apple.com>
2963
2964         Inserting a rule into an empty style sheet shouldn't trigger style recalc unless necessary.
2965         <http://webkit.org/b/119475>
2966         <rdar://problem/14643481>
2967
2968         Reviewed by Antti Koivisto.
2969
2970         This is kind of a cheesy optimization, but it turns out that the use case is quite common.
2971         The pattern goes like this:
2972
2973             (1) Create <style> element.
2974             (2) Add it to the document's <head>.
2975             (3) .addRule() one rule through the CSSOM API.
2976
2977         Prior to this patch, (3) would always cause a full (deferred) style recalc.
2978
2979         Now that we exclude empty style sheets from the document's (effective) active set,
2980         we can piggyback on the style invalidation analysis when transitioning from an empty
2981         sheet to a single-rule sheet.
2982
2983         In other words, add a special code path for the first rule insertion into an empty,
2984         in-document style sheet to minimize the amount of invalidation that happens.
2985
2986         * css/CSSStyleSheet.cpp:
2987         (WebCore::CSSStyleSheet::didMutateRules):
2988         (WebCore::CSSStyleSheet::insertRule):
2989         * css/CSSStyleSheet.h:
2990         (WebCore::CSSStyleSheet::RuleMutationScope::RuleMutationScope):
2991         (WebCore::CSSStyleSheet::RuleMutationScope::~RuleMutationScope):
2992
2993 2013-08-04  Claudio Saavedra  <csaavedra@igalia.com>
2994
2995         [GTK] Fix a C++11 warning.
2996
2997         Rubber-stamped by Martin Robinson.
2998
2999         * platform/gtk/FileSystemGtk.cpp:
3000         (WebCore::sharedResourcesPath): Fix a C++11 warning.
3001
3002 2013-08-04  Diego Pino Garcia  <dpino@igalia.com>
3003
3004         [GTK] Remove legacy hack in CodeGeneratorGObject.pm
3005         https://bugs.webkit.org/show_bug.cgi?id=117545
3006
3007         Reviewed by Carlos Garcia Campos.
3008
3009         There's a checking that sets gtype to uint in case it's ushort. gtype 
3010         is a value obtained from GetGValueTypeName(), which never returns 
3011         ushort.
3012
3013         * bindings/scripts/CodeGeneratorGObject.pm:
3014         (GenerateProperty): remove unnecessary glitch
3015
3016 2013-08-04  Andreas Kling  <akling@apple.com>
3017
3018         [Mac] Disable screen font substitution at WebCore-level in OS X 10.9+
3019         <http://webkit.org/b/119474>
3020         <rdar://problem/14643349>
3021
3022         Reviewed by Dan Bernstein.
3023
3024         Disable screen font substitution by default in Settings so internal WebCore clients
3025         such as SVG-as-image will get the right default setting.
3026
3027         * page/Settings.cpp:
3028         (WebCore::Settings::Settings):
3029         (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault):
3030         (WebCore::Settings::setScreenFontSubstitutionEnabled):
3031         * page/Settings.h:
3032         (WebCore::Settings::screenFontSubstitutionEnabled):
3033         * page/Settings.in:
3034         * page/mac/SettingsMac.mm:
3035         (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault):
3036
3037 2013-08-03  Tim Horton  <timothy_horton@apple.com>
3038
3039         Refine the unavailable plug-in indicator
3040         https://bugs.webkit.org/show_bug.cgi?id=119400
3041         <rdar://problem/14616012>
3042
3043         Reviewed by Oliver Hunt.
3044
3045         Add a border, flip the text and background colors, and make the indicator
3046         much higher contrast, to be more visible on a variety of sites.
3047         Also, refine the arrow to be less blocky and inlaid inside a circle.
3048
3049         * rendering/RenderEmbeddedObject.cpp:
3050         (WebCore::replacementTextRoundedRectPressedColor):
3051         (WebCore::replacementTextRoundedRectColor):
3052         (WebCore::replacementTextColor):
3053         (WebCore::unavailablePluginBorderColor):
3054         (WebCore::drawReplacementArrow):
3055         (WebCore::RenderEmbeddedObject::paintReplaced):
3056         (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
3057         (WebCore::RenderEmbeddedObject::unavailablePluginIndicatorBounds):
3058         (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
3059         * rendering/RenderEmbeddedObject.h:
3060
3061 2013-08-03  Yoav Weiss  <yoav@yoav.ws>
3062
3063         PreloadScanner preloads external CSS with non-matching media attribute
3064         https://bugs.webkit.org/show_bug.cgi?id=106198
3065
3066         Reviewed by Dean Jackson.
3067
3068         Test: http/tests/loading/preload-css-test.html
3069
3070         * html/parser/HTMLPreloadScanner.cpp:
3071         Remove m_linkMediaAttributeIsScreen
3072         Remove MediaQueryEvaluator calls
3073         Add m_mediaAttribute that gets the value of the "media" attribute
3074         Pass m_mediaAttribute to PreloadRequest
3075         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner):
3076         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
3077         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
3078         (WebCore::TokenPreloadScanner::StartTagScanner::resourceType):
3079         (WebCore::TokenPreloadScanner::StartTagScanner::shouldPreload):
3080         * html/parser/HTMLResourcePreloader.cpp:
3081         Add MediaQueryEvaluator calls to see if "media" matches
3082         Perform preload only to resource with a matching media (if media exists)
3083         (WebCore::PreloadRequest::isSafeToSendToAnotherThread):
3084         (WebCore::mediaAttributeMatches):
3085         (WebCore::HTMLResourcePreloader::preload):
3086         * html/parser/HTMLResourcePreloader.h:
3087         Add a constructor with a mediaAttribute value
3088         Add m_mediaAttribute & its getter.
3089         (WebCore::PreloadRequest::create):
3090         (WebCore::PreloadRequest::media):
3091         (WebCore::PreloadRequest::PreloadRequest):
3092
3093 2013-08-03  Andreas Kling  <akling@apple.com>
3094
3095         RenderBoxModelObject::firstLetterRemainingText should be a RenderTextFragment*.
3096         <http://webkit.org/b/119181>
3097
3098         Reviewed by Sam Weinig.
3099
3100         De-generalize this code a bit since we know that the firstLetterRemainingText() is always
3101         going to be a RenderTextFragment.
3102
3103         * rendering/RenderBoxModelObject.h:
3104         * rendering/RenderBoxModelObject.cpp:
3105         (WebCore::RenderBoxModelObject::firstLetterRemainingText):
3106         (WebCore::RenderBoxModelObject::setFirstLetterRemainingText):
3107
3108             Make these two deal in RenderTextFragment*.
3109
3110         * rendering/RenderBlock.cpp:
3111         (WebCore::RenderBlock::updateFirstLetterStyle):
3112
3113             Tighten up some pointer types so we don't have to cast as much.
3114
3115 2013-08-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3116
3117         Introduce toSVGMaskElement(), and use it
3118         https://bugs.webkit.org/show_bug.cgi?id=119443
3119
3120         Reviewed by Andreas Kling.
3121
3122         As a step to change static_cast with toSVGXXX, static_cast<SVGMaskElement*> can
3123         be changed with toSVGMaskElement().
3124
3125         Blink merge from https://src.chromium.org/viewvc/blink?view=rev&revision=155432
3126
3127         * rendering/svg/RenderSVGResourceMasker.cpp:
3128         (WebCore::RenderSVGResourceMasker::applyResource):
3129         (WebCore::RenderSVGResourceMasker::resourceBoundingBox):
3130         * rendering/svg/RenderSVGResourceMasker.h:
3131         * svg/SVGMaskElement.h:
3132         (WebCore::toSVGMaskElement):
3133
3134 2013-08-02  Benjamin Poulain  <bpoulain@apple.com>
3135
3136         REGRESSION (r153005): Crash in SpaceSplitString::spaceSplitStringContainsValue on Facebook
3137         https://bugs.webkit.org/show_bug.cgi?id=119384
3138
3139         Reviewed by Alexey Proskuryakov.
3140
3141         When removing the "rel" attribute from HTMLAnchorElement, we parse the attribute for no value.
3142         Following r153005, we no longer checked for null String, which caused a crash in that case.
3143
3144         Creating a SpaceSplitString from a null string causes the SpaceSplitString to be null. In that case
3145         SpaceSplitString::contains() would always return false.
3146         This patch modify SpaceSplitString::spaceSplitStringContainsValue() to follow the exact same
3147         behavior.
3148
3149         Test: fast/dom/HTMLAnchorElement/remove-rel-attribute.html
3150
3151         * dom/SpaceSplitString.cpp:
3152         (WebCore::SpaceSplitString::spaceSplitStringContainsValue):
3153
3154 2013-08-02  Dean Jackson  <dino@apple.com>
3155
3156         Force elements with perspective or preserve-3d to disallow direct composited backgrounds
3157         https://bugs.webkit.org/show_bug.cgi?id=119462
3158         <rdar://problem/14607548>
3159
3160         Reviewed by Simon Fraser.
3161
3162         Bug 119461 (http://wkb.ug/119461) describes how a directly composited
3163         background color can intersect with its children. It's not clear exactly
3164         what the best way to fix that is, but for the moment we should disallow
3165         any element that has perspective or a preserve-3d transform style from
3166         getting a directly composited background.
3167
3168         Test: compositing/background-color/no-composited-background-color-when-perspective.html
3169
3170         * rendering/RenderLayerBacking.cpp:
3171         (WebCore::hasPerspectiveOrPreserves3D): New static helper.
3172         (WebCore::supportsDirectBoxDecorationsComposition): Return false if the above function is true.
3173
3174 2013-08-02  Oliver Hunt  <oliver@apple.com>
3175
3176         Update binding test results
3177
3178         * bindings/scripts/test/JS/JSFloat64Array.cpp:
3179         (WebCore::JSFloat64Array::getOwnPropertySlot):
3180         (WebCore::JSFloat64Array::getOwnPropertySlotByIndex):
3181         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3182         (WebCore::JSTestCustomNamedGetter::getOwnPropertyDescriptor):
3183         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3184         (WebCore::JSTestEventTarget::getOwnPropertyDescriptor):
3185
3186 2013-08-02  Gavin Barraclough  <barraclough@apple.com>
3187
3188         Remove no-arguments constructor to PropertySlot
3189         https://bugs.webkit.org/show_bug.cgi?id=119460
3190
3191         Reviewed by Geoff Garen.
3192
3193         This constructor was unsafe if getValue is subsequently called,
3194         and the property is a getter. Simplest to just remove it.
3195
3196         * bindings/js/JSDOMWindowCustom.cpp:
3197         (WebCore::JSDOMWindow::getOwnPropertyDescriptor):
3198         (WebCore::DialogHandler::returnValue):
3199         * bindings/js/JSHistoryCustom.cpp:
3200         (WebCore::JSHistory::getOwnPropertyDescriptorDelegate):
3201         * bindings/js/JSLocationCustom.cpp:
3202         (WebCore::JSLocation::getOwnPropertyDescriptorDelegate):
3203         * bindings/js/JSPluginElementFunctions.cpp:
3204         (WebCore::runtimeObjectCustomGetOwnPropertyDescriptor):
3205         * bindings/js/JSStorageCustom.cpp:
3206         (WebCore::JSStorage::deleteProperty):
3207         (WebCore::JSStorage::putDelegate):
3208         * bindings/scripts/CodeGeneratorJS.pm:
3209         (GenerateGetOwnPropertyDescriptorBody):
3210         * bridge/runtime_array.cpp:
3211         (JSC::RuntimeArray::getOwnPropertyDescriptor):
3212         * bridge/runtime_method.cpp:
3213         (JSC::RuntimeMethod::getOwnPropertyDescriptor):
3214         * bridge/runtime_object.cpp:
3215         (JSC::Bindings::RuntimeObject::getOwnPropertyDescriptor):
3216
3217 2013-08-02  Andreas Kling  <akling@apple.com>
3218
3219         Removing a <link> element with an empty stylesheet shouldn't trigger style recalc.
3220         <http://webkit.org/b/119442>
3221         <rdar://problem/14631785>
3222
3223         Reviewed by Antti Koivisto.
3224
3225         Let Document decide whether or not to do a style recalc after a <link> element is removed.
3226         This avoids unnecessary work when removing a <link> that refers to an empty style sheet.
3227
3228         Some Facebook pages have a <link rel="stylesheet" href="data:text/css;base64,"> that gets
3229         removed during the initial page load, causing style recalc.
3230
3231         * html/HTMLLinkElement.cpp:
3232         (WebCore::HTMLLinkElement::removedFrom):
3233
3234             Use DeferRecalcStyleIfNeeded. Since the style sheet is being removed, it will either
3235             cause a recalc (because it's no longer in the set of active sheets) or do nothing.
3236
3237 2013-08-02  Patrick Gansterer  <paroga@webkit.org>
3238
3239         Remove WebCore folder from include statements
3240         https://bugs.webkit.org/show_bug.cgi?id=119438
3241
3242         Reviewed by Darin Adler.
3243
3244         This aligns the style of the changed files with the other WebCore code.
3245
3246         * platform/network/curl/CurlDownload.cpp:
3247         * platform/network/curl/CurlDownload.h:
3248
3249 2013-08-02  Ryosuke Niwa  <rniwa@webkit.org>
3250
3251         FormAssociatedElement shouldn't create out-of-tree FormAttributeTargetObserver
3252         https://bugs.webkit.org/show_bug.cgi?id=119309
3253
3254         Reviewed by Kent Tamura.
3255
3256         Merge https://chromium.googlesource.com/chromium/blink/+/6fbdcbf311de539107bc28711b3f7a527176e97b.
3257
3258         I'm not merging the test since the attached test case only works when the shadow DOM API is enabled.
3259
3260         * html/FormAssociatedElement.cpp:
3261         (WebCore::FormAssociatedElement::formAttributeChanged):
3262         (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):
3263
3264 2013-08-02  Christophe Dumez  <ch.dumez@sisa.samsung.com>
3265
3266         compareDocumentPosition() should report PRECEDING or FOLLOWING information even if nodes are disconnected
3267         https://bugs.webkit.org/show_bug.cgi?id=119316
3268
3269         Reviewed by Ryosuke Niwa.
3270
3271         As per the latest specification, compareDocumentPosition() should report PRECEDING or FOLLOWING
3272         information even if nodes are disconnected:
3273         - http://dom.spec.whatwg.org/#dom-node-comparedocumentposition
3274
3275         This behavior is consistent with both IE10, Firefox 22 and since recently Blink.
3276
3277         No new tests, covered by existing tests.
3278
3279         * dom/Node.cpp:
3280         (WebCore::compareDetachedElementsPosition):
3281         (WebCore::Node::compareDocumentPosition):
3282
3283 2013-08-02  Simon Fraser  <simon.fraser@apple.com>
3284
3285         Revert r153632, since it caused fast/forms/change-form-element-document-crash.html
3286         to assert.
3287
3288         * html/FormAssociatedElement.cpp:
3289         (WebCore::FormAssociatedElement::formAttributeChanged):
3290         (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):
3291
3292 2013-08-02  Mario Sanchez Prada  <mario.prada@samsung.com>
3293
3294         Implement atk_text_get_text_*_offset for WORD
3295         https://bugs.webkit.org/show_bug.cgi?id=114871
3296
3297         Reviewed by Martin Robinson.
3298
3299         Re-implement this functions without using GailTextUtil nor Pango.
3300
3301         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
3302         (textForObject): Made the parameter a const, to avoid warnings.
3303         (getSelectionOffsetsForObject): Add special cases for END boundaries.
3304         (emptyTextSelectionAtOffset): Convenience function to be used in
3305         early returns from functions returning both text and offsets.
3306         (webkitAccessibleTextGetChar): Use emptyTextSelectionAtOffset(),
3307         and remove checks that are now done outside of this function, in
3308         webkitAccessibleTextGetTextForOffset().
3309         (nextWordStartPosition): Helper function to reliably find the
3310         start of the next word as and user would do it by navigating with
3311         Ctrl and the arrows (considering spaces and punctuation).
3312         (previousWordEndPosition): Similar to nextWordStartPosition, but
3313         written to help find the end of the previous one.
3314         (wordAtPositionForAtkBoundary): Helper function to find the word
3315         at a given position considering values of AtkTextBoundary.
3316         (numberOfReplacedElementsBeforeOffset): Helper function to help
3317         figure out how many embedded objects we have exposed for an
3318         AtkText object, used to adjust offsets coming from outside.
3319         (webkitAccessibleTextGetWordForBoundary): New function,
3320         implementing atk_text_get_text_*_offset for WORD.
3321         (webkitAccessibleTextGetTextForOffset): Replace usage of Gail for
3322         WORD boundaries with webkitAccessibleTextGetWordForBoundary().
3323         Also, moved the initialization of the start and end offsets to the
3324         bottom, into the gail/pango section, since those values will be
3325         from now on initialized in getSelectionOffsetsForObject().
3326         (webkitAccessibleTextGetSelection): Removed the initialization of
3327         the start and end offsets, since those values will be from now on
3328         initialized in getSelectionOffsetsForObject().
3329
3330 2013-08-02  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
3331
3332         Buildfix for !ENABLE(SVG) platforms after r153581.
3333         https://bugs.webkit.org/show_bug.cgi?id=119444
3334
3335         Reviewed by Andreas Kling.
3336
3337         Adding missing guards.
3338
3339         * css/StylePropertyShorthand.cpp:
3340         (WebCore::matchingShorthandsForLonghand):
3341         * css/StylePropertyShorthand.h:
3342
3343 2013-08-02  Brady Eidson  <beidson@apple.com>
3344
3345         REGRESSION (r130783): Scrolling is broken going back to a cached page from a page that still has outstanding subresources.
3346         <rdar://problem/14601124> and https://bugs.webkit.org/show_bug.cgi?id=119416
3347
3348         Reviewed by Darin Adler.
3349
3350         Test: http/tests/loading/unfinished-load-back-to-cached-page-callbacks.html
3351
3352         * loader/DocumentLoader.cpp:
3353         (WebCore::DocumentLoader::stopLoading): Always explicitly cancel the Document parser when stopLoading is called.
3354
3355 2013-08-02  Antoine Quint  <graouts@apple.com>
3356
3357         <input type="search"> doesn't correctly handle the "size" attribute
3358         https://bugs.webkit.org/show_bug.cgi?id=119174
3359
3360         We weren't taking into account the decorations for search fields (results and close buttons)
3361         when computing the preferred logical width for these fields based on the "size" attribute
3362         and as a result we would not guarantee that we could show the number of characters set by
3363         the "size" attribute.
3364
3365         To make the process of reporting extra width due to decorations cleaner, we add a new decorationWidth()
3366         method for InputType subclasses to override and called through HTMLInputElement::decorationWidth()
3367         and have NumberInputType and SearchInputType return custom decoration widths.
3368
3369         Reviewed by Darin Adler.
3370
3371         Test: fast/forms/search/search-size-with-decorations.html
3372
3373         * html/HTMLInputElement.cpp:
3374         (WebCore::HTMLInputElement::decorationWidth):
3375         * html/HTMLInputElement.h:
3376         * html/InputType.cpp:
3377         (WebCore::InputType::decorationWidth):
3378         * html/InputType.h:
3379         Expose a new method to get the width for the input's decoration through the InputType.
3380
3381         * html/NumberInputType.cpp:
3382         (WebCore::NumberInputType::decorationWidth):
3383         * html/NumberInputType.h:
3384         Override InputType::decorationWidth() to return the decoration width for a number input
3385         using the same code previously used in RenderTextControlSingleLine::preferredContentLogicalWidth().
3386
3387         * html/SearchInputType.cpp:
3388         (WebCore::SearchInputType::sizeShouldIncludeDecoration):
3389         Override InputType::sizeShouldIncludeDecoration() to return true since search fields
3390         have custom decoration adding to the size of the field.
3391
3392         (WebCore::SearchInputType::decorationWidth):
3393         Return the combined size of the results and cancel buttons, as available.
3394         * html/SearchInputType.h:
3395
3396         * rendering/RenderTextControlSingleLine.cpp:
3397         (WebCore::RenderTextControlSingleLine::preferredContentLogicalWidth):
3398         Remove the code specific to NumberInputType (which was moved to InputType::decorationWidth())
3399         and replace it with a call to HTMLInputElement::decorationWidth() since this method will now
3400         return the extra decoration width for an input element should it have any.
3401
3402 2013-08-02  Patrick Gansterer  <paroga@webkit.org>
3403
3404         [WIN] Fix build without precompiled header.
3405
3406         * accessibility/win/AccessibilityObjectWrapperWin.h: Added missing include.
3407         * rendering/RenderThemeWin.cpp: Ditto.
3408
3409 2013-08-02  Byungwoo Lee  <bw80.lee@samsung.com>
3410
3411         Remove redundant call of argsList->current() from loops in CSSParser.
3412         https://bugs.webkit.org/show_bug.cgi?id=119432
3413
3414         Reviewed by Christophe Dumez.
3415
3416         while loops in CSSParser call argList->current() function at the start
3417         of each iteration, but this is redundant because argsList->next() at
3418         the end of the iteration calls the argList->current() and returns the
3419         result.
3420
3421         Blink merge from https://src.chromium.org/viewvc/blink?view=rev&revision=155402
3422
3423         * css/CSSParser.cpp:
3424         (WebCore::CSSParser::parseMixFunction):
3425         (WebCore::CSSParser::parseCustomFilterFunctionWithInlineSyntax):
3426
3427 2013-08-01  Andreas Kling  <akling@apple.com>
3428
3429         Removing an empty style sheet shouldn't trigger style recalc.
3430         <http://webkit.org/b/119428>
3431         <rdar://problem/14629045>
3432
3433         Reviewed by Antti Koivisto.
3434
3435         Teach DocumentStyleSheetCollection to filter out empty style sheets when deciding whether
3436         or not to trigger a style recalc. We can then be clever when an empty style sheet is removed
3437         from the document, and avoid causing extra work.
3438
3439         Some pages use this pattern:
3440
3441             (1) Create a <style> element.
3442             (2) Add it to the document's <head> element.
3443             (3) Insert some CSS as a text child of the <style> element.
3444
3445         Since the <style> element is already inside the document at (3), we had to treat this as an
3446         old style sheet being removed, even though it was just an empty sheet of nothing.
3447
3448         With this patch, Document gains enough smarts to know that removing/adding an empty sheet
3449         won't affect layout/rendering in any meaningful way, thus a style recalc can be avoided.
3450
3451         * dom/Document.h:
3452         * dom/Document.cpp:
3453         (WebCore::Document::styleResolverChanged):
3454
3455             Add a DeferRecalcStyleIfNeeded mode to styleResolverChanged().
3456
3457         * css/CSSStyleSheet.h:
3458         * css/CSSStyleSheet.cpp:
3459         (WebCore::CSSStyleSheet::clearOwnerNode):
3460
3461             Use DeferRecalcStyleIfNeeded when saying bye from a CSSStyleSheet and let Document decide
3462             if removing the sheet should trigger style recalc instead of always assuming it should.
3463
3464         * dom/DocumentStyleSheetCollection.cpp:
3465         (WebCore::filterEnabledNonemptyCSSStyleSheets):
3466         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
3467
3468             Exclude empty sheets from the activeAuthorStyleSheets() collection. They are still
3469             visible through CSSOM's document.styleSheets.
3470
3471 2013-08-02  Zalan Bujtas  <zalan@apple.com>
3472
3473         Frame flattening: Change the logic on whether resize event needs to&nb