2009-03-26 Jungshik Shin <jshin@chromium.org>
[WebKit-https.git] / WebCore / ChangeLog
1 2009-03-26  Jungshik Shin  <jshin@chromium.org>
2
3         Reviewed by Alexey Proskuryakov.
4
5         Add an encoding detector 'hook' to TextResourceDecoder.
6          - add |usesEncodingDetector| to Settings. It's off by default.
7          - add a new encoding source type |EncodingFromParent| 
8            to distinguish cases when the encoding is inherited from
9            the parent frame from cases when it's actually auto-detected.
10          - add TextEncodingDetector* to platform/text. Currently,
11            the only implementation uses ICU. Stub is added for 
12            ports that do not use ICU and a build on Tiger. Mac OS 
13            Tiger comes with ICU 3.2 that does not support encoding detector.
14          - add ucsdet.h to icu/unicode for ports using ICU.
15
16         Layout tests will be added once bug 20534 is fixed and a WebPreference
17         can be controlled in test_shell. With UsesEncodingDetector off, there
18         is no change to test. 
19
20         http://bugs.webkit.org/show_bug.cgi?id=16482
21
22         * WebCore.vcproj/WebCore.vcproj:
23         * WebCore.xcodeproj/project.pbxproj:
24         * WebCore/GNUmakefile.am
25         * WebCore/WebCore.pro
26         * WebCore/WebCore.scons
27         * WebCore/WebCoreSources.bkl
28         * WebCore.base.exp
29         * icu/unicode/ucsdet.h
30         * loader/FrameLoader.cpp:
31         (WebCore::FrameLoader::write): turn on/off encoding detector depending on Settings and set hintEncoding of TextResourceDecoder to the parent frame encoding if necessary and the security policy allows refering to the parent frame encoding.
32         * loader/TextResourceDecoder.cpp:
33         (WebCore::TextResourceDecoder::TextResourceDecoder):
34         (WebCore::TextResourceDecoder::checkForCSSCharset): add check for EncodingFromParentFrame
35         (WebCore::TextResourceDecoder::checkForHeadCharset): ditto
36         (WebCore::TextResourceDecoder::shouldAutoDetect):
37         (WebCore::TextResourceDecoder::decode): call encoding detector if shouldAutoDetect returns true.
38         (WebCore::TextResourceDecoder::flush): if encoding is not determined by now, call encoding detector if shouldAutoDetect returns true.
39         * loader/TextResourceDecoder.h:
40         (WebCore::TextResourceDecoder::):
41         (WebCore::TextResourceDecoder::create):
42         (WebCore::TextResourceDecoder::setHintEncoding):
43         (WebCore::TextResourceDecoder::source):
44         * page/Settings.cpp: add m_usesEncodingDetector
45         (WebCore::Settings::Settings):
46         (WebCore::Settings::setUsesEncodingDetector):
47         * page/Settings.h:
48         (WebCore::Settings::usesEncodingDetector):
49         * platform/text/TextEncodingDetector.h: Added.
50         * platform/text/TextEncodingDetectorICU.cpp: Added.
51         (WebCore::detectTextEncoding):
52         * platform/text/TextEncodingDetectorNone.cpp: Added.
53         (WebCore::detectTextEncoding):
54
55 2009-03-26  Darin Adler  <darin@apple.com>
56
57         Reviewed by Geoff Garen.
58
59         Removed code that casts EventListener down to derived classes
60         without type checking. A crash could happen if you added event
61         listeners with Objective-C and then manipulated the class with
62         JavaScript.
63
64         * bindings/js/JSDOMApplicationCacheCustom.cpp:
65         (WebCore::JSDOMApplicationCache::mark): Removed all the casts
66         and used the markIfNotNull function and mark functions on
67         EventListener instead.
68         * bindings/js/JSMessagePortCustom.cpp:
69         (WebCore::JSMessagePort::mark): Ditto.
70         * bindings/js/JSWorkerContextCustom.cpp:
71         (WebCore::JSWorkerContext::mark): Ditto.
72         * bindings/js/JSWorkerCustom.cpp:
73         (WebCore::JSWorker::mark): Ditto.
74         * bindings/js/JSXMLHttpRequestCustom.cpp:
75         (WebCore::JSXMLHttpRequest::mark): Ditto.
76         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
77         (WebCore::JSXMLHttpRequestUpload::mark): Ditto.
78
79         * bindings/js/JSEventListener.cpp:
80         (WebCore::JSAbstractEventListener::handleEvent): Used function,
81         the new name for what used to be called listenerObj.
82         (WebCore::JSAbstractEventListener::virtualIsInline): Renamed since
83         this doesn't need to be virtual for callers who have a pointer to
84         this class, not the base class.
85         (WebCore::JSEventListener::function): Renamed from listenerObj.
86         (WebCore::JSProtectedEventListener::function): Ditto.
87
88         * bindings/js/JSEventListener.h: Removed unneeded forward class
89         declarations. Made all virtual functions private since there's no
90         need to call any of them on a particular derived class, only on
91         EventListener. Explicitly declare JSEventListener::mark as virtual
92         since it's now overriding a function in the EventListener base class.
93         Made JSProtectedEventListener::m_globalObject protected so the
94         JSLazyEventListener derived class can use it directly instead of using
95         a virtual function to get the pointer.
96
97         * bindings/js/JSLazyEventListener.cpp:
98         (WebCore::JSLazyEventListener::parseCode): Use m_globalObject instead
99         of globalObject since the latter is a virtual function and there's no
100         need to pay virtual function overhead.
101         (WebCore::JSLazyEventListener::function): Renamed from listenerObj.
102
103         * bindings/js/JSLazyEventListener.h: Moved forward declaration of the
104         Node class here from JSEventListener.h.
105
106         * bindings/scripts/CodeGeneratorJS.pm: Removed now-unneeded cast to
107         JSEventListener when getting the script object from a listener.
108
109         * dom/EventListener.h: Added virtual function and mark functions
110         so we can extract the JavaScript function object or mark a JavaScript
111         event listener in a type safe manner.
112
113 2009-03-26  Peter Kasting  <pkasting@google.com>
114
115         Reviewed by Adele Peterson.
116
117         https://bugs.webkit.org/show_bug.cgi?id=24859
118         Use CSS file instead of code to adjust search field styling.
119
120         * css/themeWin.css:
121         * rendering/RenderThemeWin.cpp:
122         * rendering/RenderThemeWin.h:
123
124 2009-03-26  Darin Adler  <darin@apple.com>
125
126         Reviewed by Geoff Garen.
127
128         Split JSLazyEventListener out into its own separate source file.
129         We'll be removing JSAbstractEventListener and JSProtectedEventListener soon,
130         so leave those in the same file with JSEventListener.
131
132         * GNUmakefile.am: Added JSLazyEventListener.
133         * WebCore.pro: Ditto.
134         * WebCore.scons: Ditto.
135         * WebCore.vcproj/WebCore.vcproj: Ditto.
136         * WebCore.xcodeproj/project.pbxproj: Ditto.
137         * WebCoreSources.bkl: Ditto.
138
139         * bindings/js/JSEventListener.cpp: Removed the JSLazyEventListener part.
140         Removed unneeded includes. Removed incorrect ASSERT_CLASS_FITS_IN_CELL, since
141         JSAbstractEventListener is not derived from JSCell.
142
143         * bindings/js/JSEventListener.h: Removed the JSLazyEventListener part
144         and the now-unneeded include of PlatformString.h.
145
146         * bindings/js/JSLazyEventListener.cpp: Copied from bindings/js/JSEventListener.cpp.
147         Kept only the JSLazyEventListener part.
148         (WebCore::eventParameterName): Made this have internal linkage by adding "static".
149         Also moved the default case out of the switch statement so we will get a warning
150         if we omit any cases in the future.
151
152         * bindings/js/JSLazyEventListener.h: Copied from bindings/js/JSEventListener.h.
153         Kept only the JSLazyEventListener part.
154
155         * bindings/js/ScriptController.cpp: Removed unneeded includes and sorted the
156         remanining ones. Include JSLazyEventListener.h instead of JSEventListener.h.
157
158 2009-03-26  Darin Adler  <darin@apple.com>
159
160         Reviewed by Geoff Garen.
161
162         Renamed JSUnprotectedEventListener to JSEventListener.
163         And related renames.
164
165         Soon Geoff will make all JavaScript event listeners use mark instead
166         of protect, so there's no need to emphasize "unprotected".
167
168         * bindings/js/JSDOMApplicationCacheCustom.cpp:
169         (WebCore::JSDOMApplicationCache::mark):
170         (WebCore::JSDOMApplicationCache::addEventListener):
171         (WebCore::JSDOMApplicationCache::removeEventListener):
172         * bindings/js/JSDOMGlobalObject.cpp:
173         (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject):
174         (WebCore::JSDOMGlobalObject::findJSEventListener):
175         (WebCore::JSDOMGlobalObject::findOrCreateJSEventListener):
176         (WebCore::JSDOMGlobalObject::jsEventListeners):
177         (WebCore::JSDOMGlobalObject::jsInlineEventListeners):
178         * bindings/js/JSDOMGlobalObject.h:
179         * bindings/js/JSDOMWindowBase.h:
180         * bindings/js/JSEventListener.cpp:
181         (WebCore::JSEventListener::JSEventListener):
182         (WebCore::JSEventListener::~JSEventListener):
183         (WebCore::JSEventListener::listenerObj):
184         (WebCore::JSEventListener::globalObject):
185         (WebCore::JSEventListener::clearGlobalObject):
186         (WebCore::JSEventListener::mark):
187         * bindings/js/JSEventListener.h:
188         (WebCore::JSEventListener::create):
189         * bindings/js/JSMessagePortCustom.cpp:
190         (WebCore::JSMessagePort::mark):
191         (WebCore::JSMessagePort::addEventListener):
192         (WebCore::JSMessagePort::removeEventListener):
193         * bindings/js/JSWorkerContextCustom.cpp:
194         (WebCore::JSWorkerContext::mark):
195         (WebCore::JSWorkerContext::addEventListener):
196         (WebCore::JSWorkerContext::removeEventListener):
197         * bindings/js/JSWorkerCustom.cpp:
198         (WebCore::JSWorker::mark):
199         (WebCore::JSWorker::addEventListener):
200         (WebCore::JSWorker::removeEventListener):
201         * bindings/js/JSXMLHttpRequestCustom.cpp:
202         (WebCore::JSXMLHttpRequest::mark):
203         (WebCore::JSXMLHttpRequest::addEventListener):
204         (WebCore::JSXMLHttpRequest::removeEventListener):
205         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
206         (WebCore::JSXMLHttpRequestUpload::mark):
207         (WebCore::JSXMLHttpRequestUpload::addEventListener):
208         (WebCore::JSXMLHttpRequestUpload::removeEventListener):
209         * bindings/scripts/CodeGeneratorJS.pm:
210         All just renaming.
211
212 2009-03-26  Darin Adler  <darin@apple.com>
213
214         Reviewed by Geoff Garen.
215
216         Renamed JSEventListener to JSProtectedEventListener.
217         And related renames.
218
219         Soon Geoff will make all JavaScript event listeners use mark instead
220         of protect, and so this class will be be obsolete. We will rename
221         JSUnrpotectedEventListener to JSEventListener in the next check-in,
222         since that one will remain.
223
224         * bindings/js/JSDOMGlobalObject.cpp:
225         (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject):
226         (WebCore::JSDOMGlobalObject::findJSProtectedEventListener):
227         (WebCore::JSDOMGlobalObject::findOrCreateJSProtectedEventListener):
228         (WebCore::JSDOMGlobalObject::jsProtectedEventListeners):
229         (WebCore::JSDOMGlobalObject::jsProtectedInlineEventListeners):
230         * bindings/js/JSDOMGlobalObject.h:
231         * bindings/js/JSDOMWindowBase.h:
232         * bindings/js/JSDOMWindowCustom.cpp:
233         (WebCore::JSDOMWindow::addEventListener):
234         (WebCore::JSDOMWindow::removeEventListener):
235         * bindings/js/JSEventListener.cpp:
236         (WebCore::JSProtectedEventListener::JSProtectedEventListener):
237         (WebCore::JSProtectedEventListener::~JSProtectedEventListener):
238         (WebCore::JSProtectedEventListener::listenerObj):
239         (WebCore::JSProtectedEventListener::globalObject):
240         (WebCore::JSProtectedEventListener::clearGlobalObject):
241         (WebCore::JSLazyEventListener::JSLazyEventListener):
242         (WebCore::JSLazyEventListener::parseCode):
243         * bindings/js/JSEventListener.h:
244         (WebCore::JSProtectedEventListener::create):
245         * bindings/js/JSNodeCustom.cpp:
246         (WebCore::JSNode::addEventListener):
247         (WebCore::JSNode::removeEventListener):
248         * bindings/js/JSSVGElementInstanceCustom.cpp:
249         (WebCore::JSSVGElementInstance::addEventListener):
250         (WebCore::JSSVGElementInstance::removeEventListener):
251         * bindings/scripts/CodeGeneratorJS.pm:
252         All just renaming.
253
254 2009-03-26  Dan Bernstein  <mitz@apple.com>
255
256         Reviewed by Anders Carlsson.
257
258         - fix <rdar://problem/6725042> BidiResolver::createBidiRunsForLine can
259           create runs extending beyond the end
260
261         No test because Safari does not use this version of
262         createBidiRunsForLine() with the end iterator not pointing to the end
263         of the text run.
264
265         * platform/text/BidiResolver.h:
266         (WebCore::BidiResolver::appendRun): Cap the end of the run at the end
267         of the line and set the reachedEndOfLine flag. This mirrors the logic
268         in the specialized version of appendRun() in bidi.cpp, which is why the
269         problem did not show up in HTML. Also avoid creating empty runs.
270
271 2009-03-26  Simon Fraser  <simon.fraser@apple.com>
272
273         Reviewed by Dave Hyatt
274         
275         https://bugs.webkit.org/show_bug.cgi?id=23914
276
277         Tests: compositing/overflow/ancestor-overflow.html
278                compositing/overflow/parent-overflow.html
279
280         * rendering/RenderLayer.cpp:
281         (WebCore::RenderLayer::calculateClipRects):
282         * rendering/RenderLayer.h:
283         (WebCore::ClipRects::infiniteRect):
284         New static method that returns a large rect that is used by the clipping
285         logic.
286         
287         * rendering/RenderLayerBacking.cpp:
288         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
289         Use parentClipRects(), rather than calculateRects(), to compute the overflow
290         rect that we'll use to create a masking layer for composited clipping.
291         
292         * rendering/RenderLayerCompositor.cpp:
293         (WebCore::RenderLayerCompositor::clippedByAncestor):
294         Use parentClipRects() to see whether there's a layer between us and our
295         compositing ancestor which applies clipping.
296         
297         (WebCore::RenderLayerCompositor::clipsCompositingDescendants):
298         A layer which imposes clipping to its children doesn't have to be a stacking
299         context; it might be a normal flow layer; in either case, we can rely on the
300         hasCompositingDescendant() bit.
301
302 2009-03-26  Steve Falkenburg  <sfalken@apple.com>
303
304         https://bugs.webkit.org/show_bug.cgi?id=24837
305         Escape key should dismiss select menu
306
307         Reviewed by Adam Roben.
308
309         * platform/win/PopupMenuWin.cpp:
310         (WebCore::PopupWndProc):
311
312 2009-03-26  Kevin Ollivier  <kevino@theolliviers.com>
313
314         Reviewed by Alexey Proskuryakov.
315
316         Make sure the script uses LF line endings even on Windows.
317         
318         https://bugs.webkit.org/show_bug.cgi?id=24805
319
320         * WebCore/make-generated-sources.sh: Change svn:eol-style to LF
321
322 2009-03-26  Eli Fidler  <eli.fidler@torchmobile.com>
323
324         Reviewed by George Staikos.
325
326         Remove warnings all over the place by making operator precedence
327         explicit in cases like x && y || z.  No functional change.
328
329         * css/CSSFontSelector.cpp:
330         (WebCore::CSSFontSelector::addFontFaceRule):
331         * css/CSSParser.cpp:
332         (WebCore::CSSParser::parseValue):
333         (WebCore::CSSParser::parseShadow):
334         * dom/Document.cpp:
335         (WebCore::Document::shouldScheduleLayout):
336         * dom/Node.cpp:
337         (WebCore::Node::isBlockFlowOrBlockTable):
338         * dom/Node.h:
339         (WebCore::Node::document):
340         * dom/Position.cpp:
341         (WebCore::Position::next):
342         (WebCore::Position::upstream):
343         (WebCore::Position::downstream):
344         (WebCore::Position::getInlineBoxAndOffset):
345         * dom/PositionIterator.cpp:
346         (WebCore::PositionIterator::atStart):
347         * dom/Range.cpp:
348         (WebCore::Range::intersectsNode):
349         * editing/Editor.cpp:
350         (WebCore::Editor::setBaseWritingDirection):
351         * editing/InsertParagraphSeparatorCommand.cpp:
352         (WebCore::InsertParagraphSeparatorCommand::doApply):
353         * editing/ReplaceSelectionCommand.cpp:
354         (WebCore::ReplaceSelectionCommand::doApply):
355         * editing/TextIterator.cpp:
356         (WebCore::TextIterator::advance):
357         (WebCore::SimplifiedBackwardsTextIterator::advance):
358         * editing/VisiblePosition.cpp:
359         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
360         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
361         (WebCore::VisiblePosition::canonicalPosition):
362         * editing/htmlediting.cpp:
363         (WebCore::isMailBlockquote):
364         (WebCore::lineBreakExistsAtPosition):
365         * html/HTMLSelectElement.cpp:
366         (WebCore::HTMLSelectElement::parseMappedAttribute):
367         * loader/FTPDirectoryDocument.cpp:
368         (WebCore::processFileDateString):
369         * loader/ImageLoader.cpp:
370         (WebCore::ImageLoader::updateFromElement):
371         * loader/TextResourceDecoder.cpp:
372         (WebCore::TextResourceDecoder::checkForHeadCharset):
373         * page/AccessibilityObject.cpp:
374         (WebCore::updateAXLineStartForVisiblePosition):
375         * page/EventHandler.cpp:
376         (WebCore::EventHandler::sendContextMenuEvent):
377         * page/animation/AnimationBase.cpp:
378         (WebCore::PropertyWrapperGetter::equals):
379         (WebCore::PropertyWrapperShadow::equals):
380         * platform/ContextMenu.cpp:
381         (WebCore::ContextMenu::populate):
382         * platform/ScrollView.cpp:
383         (WebCore::ScrollView::adjustScrollbarsAvoidingResizerCount):
384         * platform/text/Base64.cpp:
385         (WebCore::base64Encode):
386         * platform/text/BidiResolver.h:
387         (WebCore::::raiseExplicitEmbeddingLevel):
388         (WebCore::::createBidiRunsForLine):
389         * rendering/InlineTextBox.cpp:
390         (WebCore::InlineTextBox::placeEllipsisBox):
391         * rendering/RenderBlock.cpp:
392         (WebCore::RenderBlock::addChild):
393         (WebCore::RenderBlock::repaintOverhangingFloats):
394         (WebCore::RenderBlock::fillInlineSelectionGaps):
395         (WebCore::RenderBlock::positionForPoint):
396         (WebCore::RenderBlock::calcInlinePrefWidths):
397         (WebCore::RenderBlock::hasLineIfEmpty):
398         * rendering/RenderBox.cpp:
399         (WebCore::RenderBox::imageChanged):
400         (WebCore::RenderBox::localCaretRect):
401         (WebCore::RenderBox::positionForPoint):
402         (WebCore::RenderBox::shrinkToAvoidFloats):
403         * rendering/RenderObject.h:
404         (WebCore::objectIsRelayoutBoundary):
405         * rendering/RenderTableCell.cpp:
406         (WebCore::RenderTableCell::clippedOverflowRectForRepaint):
407         * rendering/RenderText.cpp:
408         (WebCore::RenderText::calcPrefWidths):
409         * rendering/bidi.cpp:
410         (WebCore::RenderBlock::determineStartPosition):
411         (WebCore::textWidth):
412         * rendering/style/RenderStyle.cpp:
413         (WebCore::RenderStyle::diff):
414         * rendering/style/StyleInheritedData.cpp:
415         (WebCore::cursorDataEquivalent):
416         * rendering/style/StyleRareInheritedData.cpp:
417         (WebCore::StyleRareInheritedData::shadowDataEquivalent):
418         * rendering/style/StyleRareNonInheritedData.cpp:
419         (WebCore::StyleRareNonInheritedData::shadowDataEquivalent):
420         (WebCore::StyleRareNonInheritedData::animationDataEquivalent):
421         (WebCore::StyleRareNonInheritedData::transitionDataEquivalent):
422
423 2009-03-26  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
424
425         Reviewed by Holger Freyther.
426
427         https://bugs.webkit.org/show_bug.cgi?id=24804
428         [GTK] 401 responses cause rogue content to be loaded
429
430         Our soup code handles 401 responses itself, so we should not feed
431         the headers and data of those responses to the loader.
432
433         * platform/network/soup/ResourceHandleSoup.cpp:
434         (WebCore::gotHeadersCallback):
435         (WebCore::gotChunkCallback):
436
437 2009-03-25  Geoffrey Garen  <ggaren@apple.com>
438
439         Reviewed by Oliver Hunt and Darin Adler.
440         
441         Fixed <rdar://problem/6603167> Crash in WebKit!JSC::JSGlobalObject::resetPrototype
442         during Stress test (#3 & #7 WER crashes for Safari 4 Beta)
443         
444         The problem was that allocation of the global object would, for just a
445         moment, leave the global object's prototype unprotected from GC. This
446         bug doesn't apply to non-global DOM objects because their prototypes are
447         cached and marked by the global object.
448
449         No test case because the crashing condition is hard to deterministically
450         produce in a normal build, and in a Windows Release build with
451         COLLECT_ON_EVERY_ALLOCATION set to 1, existing tests crash/hang.
452
453         * bindings/js/JSDOMWindowShell.cpp:
454         (WebCore::JSDOMWindowShell::setWindow):
455         * bindings/js/WorkerScriptController.cpp:
456         (WebCore::WorkerScriptController::initScript): Protect the global object's
457         prototype from GC during construction, since the global object does not
458         yet point to it, and therefore won't mark it.
459
460 2009-03-25  Dean Jackson  <dino@apple.com>
461
462         Reviewed by Simon Fraser
463
464         https://bugs.webkit.org/show_bug.cgi?id=23361
465
466         When using hardware compositing, some images can be directly
467         rendered by the hardware - no need to draw them into a separate
468         context, therefore saving memory.
469         Only images with certain style properties can be directly
470         composited - basically anything that is not a simple image requires
471         the usual rendering path (eg. if the image has borders).
472
473         Test: compositing/direct-image-compositing.html
474
475         * manual-tests/resources/simple_image.png: Added.
476         * manual-tests/simple-image-compositing.html: Added.
477         * platform/graphics/Image.h:
478         (WebCore::Image::startAnimation):
479             - move this to public
480         * rendering/RenderImage.cpp:
481         (WebCore::RenderImage::imageChanged):
482             - poke compositing layer if image has changed
483         (WebCore::RenderImage::notifyFinished):
484             - let the compositing layer know that it can render the image
485         * rendering/RenderImage.h:
486         * rendering/RenderLayer.cpp:
487         (WebCore::RenderLayer::rendererContentChanged):
488         * rendering/RenderLayer.h:
489         * rendering/RenderLayerBacking.cpp:
490         (WebCore::RenderLayerBacking::canUseInnerContentLayer):
491         (WebCore::RenderLayerBacking::detectDrawingOptimizations):
492         (WebCore::RenderLayerBacking::rendererContentChanged):
493         * rendering/RenderLayerBacking.h:
494             - code to hook up direct compositing of images where
495               possible
496
497 2009-03-25  David Levin  <levin@chromium.org>
498
499         Reviewed by Dimitri Glazkov.
500
501         Chromium build fix. Fix #include in V8NodeFilterCondition.cpp due to the
502         rename of V8NodeFilter to V8NodeFilterCondition.
503
504         * bindings/v8/V8NodeFilterCondition.cpp:
505
506 2009-03-25  Simon Fraser  <simon.fraser@apple.com>
507
508         Reviewed by Darin Adler
509         
510         https://bugs.webkit.org/show_bug.cgi?id=24817
511         
512         When the slider range is zero, avoid a divide by zero, which caused the
513         thumb to be positioned off in the weeds, which broke painting.
514
515         Test: media/video-empty-source.html
516
517         * rendering/RenderSlider.cpp:
518         (WebCore::SliderRange::proportionFromValue):
519         (WebCore::SliderRange::valueFromProportion):
520         (WebCore::sliderPosition):
521         (WebCore::RenderSlider::setValueForPosition):
522
523 2009-03-24  Eric Seidel  <eric@webkit.org>
524
525         Reviewed by Darin Adler.
526
527         Remove dead code and style cleanup
528         https://bugs.webkit.org/show_bug.cgi?id=24684
529
530         * html/CanvasStyle.cpp:
531         (WebCore::CanvasStyle::CanvasStyle):
532           Coverty was annoyed that we didn't initialize all of our members.  I agree, but I didn't
533           want to paste all 8 members each time, so I just cleaned up the existing constructors and left them.
534         * page/FocusController.cpp:
535         (WebCore::FocusController::setFocusedNode):
536           "node" was checked just above and is already known to be non-null
537         * rendering/RenderLayer.cpp:
538         (WebCore::RenderLayer::insertOnlyThisLayer):
539           We were already using parentLayer w/o a NULL check above, so just add an explicit ASSERT and use it w/o NULL check
540         (WebCore::RenderLayer::resize):
541           element is already ASSERTed above, no need to null check it here
542         * rendering/RenderTableSection.cpp:
543         (WebCore::RenderTableSection::addCell):
544           currentCell.cell was just assigned to the value "cell" which is known to be non-null, no need to null check again.
545
546 2009-03-24  Eric Seidel  <eric@webkit.org>
547
548         Reviewed by Darin Adler.
549
550         Move ASSERT(foo) to before where foo-> is used
551         https://bugs.webkit.org/show_bug.cgi?id=24684
552
553         * platform/chromium/PasteboardChromium.cpp:
554         (WebCore::Pasteboard::writeImage):
555           Move ASSERTs to the top of the function, code was using "node" before ASSERT(node), once I moved
556           ASSERT(node) to the top of the function it made sense to move the rest of them there too.
557         * rendering/SVGRenderSupport.cpp:
558         (WebCore::prepareToRenderSVGContent):
559           move ASSERT(object) to *before* we use "object" :)
560
561 2009-03-24  Eric Seidel  <eric@webkit.org>
562
563         Reviewed by Simon Fraser.
564
565         Make TextTokenizer ASSERT that the buffer was freed
566         https://bugs.webkit.org/show_bug.cgi?id=24684
567
568         * loader/TextDocument.cpp:
569         (WebCore::TextTokenizer::TextTokenizer):
570         (WebCore::TextTokenizer::~TextTokenizer):
571         (WebCore::TextTokenizer::finish):
572           Make it clear by adding a ~TextTokenizer that finish() will always be called and the memory never leaked.
573
574 2009-03-24  Eric Seidel  <eric@webkit.org>
575
576         Reviewed by Darin Adler.
577
578         Fix case where lBreak.obj->isBR() when lBreak.obj was NULL
579         https://bugs.webkit.org/show_bug.cgi?id=24684
580
581         I don't have a test case where we were taking the wrong path here
582         However, adding an ASSERT(lBreak.obj) before this usage caused
583         multiple bidi tests to fail, so lBreak.obj can be null here.
584
585         * rendering/bidi.cpp:
586         (WebCore::RenderBlock::findNextLineBreak):
587           lBreak.obj can be null, so we can't call ->isBR() on it unconditionally.
588
589 2009-03-24  Eric Seidel  <eric@webkit.org>
590
591         Reviewed by Simon Fraser.
592
593         Style cleanup and dead code removal in dom, editing
594         https://bugs.webkit.org/show_bug.cgi?id=24684
595
596         * dom/ContainerNode.cpp:
597         (WebCore::ContainerNode::getUpperLeftCorner):
598         (WebCore::ContainerNode::getLowerRightCorner):
599         (WebCore::ContainerNode::getRect):
600           Coverty was (rightly) confused as to what the hell "o" was being used for
601           and whether or not it would ever be NULL.  I added some ASSERTS so that people (and machines)
602           would be less confused about the logic in getUpperLeftCorner/getLowerRightCorner
603         * dom/Document.cpp:
604         (WebCore::Document::recalcStyle):
605           Remove dead code, this block already checked that change == Force
606         * editing/ApplyStyleCommand.cpp:
607         (WebCore::ApplyStyleCommand::removeInlineStyle):
608           Coverty correctly identified that traversePreviousNodePostOrder can return NULL, thus
609           prev will be null, and we don't really explicitly handle it (like we probably should)
610           It's OK though, because we end up creating a null position object, which may not have
611           been what we intended, but we certainly don't crash.
612         * editing/InsertParagraphSeparatorCommand.cpp:
613         (WebCore::InsertParagraphSeparatorCommand::doApply):
614           Remove dead code, insertionPosition.node() is already checked to be non-null above.
615         * editing/markup.cpp:
616         (WebCore::appendStartMarkup):
617           removed dead code, annotate is already known to be true at this point in the file
618           !annotate was checked above, and break; was called.
619
620 2009-03-24  Eric Seidel  <eric@webkit.org>
621
622         Reviewed by Simon Fraser.
623
624         CSS dead code removal and cleanup from Coverty errors
625         https://bugs.webkit.org/show_bug.cgi?id=24684
626
627         * css/CSSStyleSelector.cpp:
628         (WebCore::CSSStyleSelector::applyProperty):
629           Every other place in the code we check settings() for NULL, so I made these places
630           check too, even though we should never be resolving style against a document which has
631           no frame (which I believe is the only time settings() can be null)
632         * css/CSSStyleSheet.cpp:
633         (WebCore::CSSStyleSheet::styleSheetChanged):
634           Removing dead code, "root" can never be null here.
635         * css/SVGCSSStyleSelector.cpp:
636         (WebCore::colorFromSVGColorCSSValue):
637         (WebCore::CSSStyleSelector::applySVGProperty):
638           Extra returns in the old macros caused dead code.  Removing the old macros and use modern
639           ones instead. :)
640           Extra null checks to value were not needed.  Added an ASSERT at the top of the function
641           to make it clear that value will never be NULL.
642           Added colorFromSVGColorCSSValue to clean up the code a little.
643
644 2009-03-24  Eric Seidel  <eric@webkit.org>
645
646         Reviewed by Simon Fraser.
647
648         Font fallback cleanup and added ASSERT for GlyphPageTreeNode
649         https://bugs.webkit.org/show_bug.cgi?id=24684
650
651         * css/CSSFontSelector.cpp:
652         (WebCore::compareFontFaces):
653           Coverty was concerned that it was possible to index off the end of weightFallbackRuleSets
654           I can't read the code well enough to tell, so I tried to make the code clearer
655           and added an ASSERT.        
656         * platform/graphics/GlyphPageTreeNode.cpp:
657         (WebCore::GlyphPageTreeNode::initializePage):
658           Coverty believes we can crash here due to j being larger than GlyphPage::size.  I think to is already
659           known to be < GlyphPage::size due to the min() statement above, but not being sure I added an ASSERT.
660
661 2009-03-24  Eric Seidel  <eric@webkit.org>
662
663         Reviewed by Simon Fraser.
664
665         Coverty inspired fixes in Animations/Transforms
666         https://bugs.webkit.org/show_bug.cgi?id=24684
667
668         * page/animation/AnimationBase.h:
669           Fix animate() signatures to match so that the virtual methods actually override one another. :)
670         * page/animation/AnimationController.cpp:
671         (WebCore::AnimationControllerPrivate::removeFromStartTimeResponseWaitList):
672           Attempt to fix this method, prevAnimation was never set to anything but NULL,
673           as far as I can tell the author originally intended to update it at the end
674           of the loop, which is what I changed this code to do.
675         * page/animation/ImplicitAnimation.cpp:
676         (WebCore::ImplicitAnimation::animate):
677           Make method signature match AnimationBase::animate
678         * page/animation/ImplicitAnimation.h:
679         * page/animation/KeyframeAnimation.cpp:
680         (WebCore::KeyframeAnimation::animate):
681           Make method signature match AnimationBase::animate
682         * page/animation/KeyframeAnimation.h:
683         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
684         (WebCore::PerspectiveTransformOperation::blend):
685           if (blendToIdentity) already returned above.
686         * platform/graphics/transforms/RotateTransformOperation.cpp:
687         (WebCore::RotateTransformOperation::blend):
688           if (blendToIdentity) already returned above.
689
690 2009-03-25  Eli Fidler  <eli.fidler@torchmobile.com>
691
692         Reviewed by George Staikos.
693
694         Fix compiler warnings regarding assignments in if statements.
695
696         * html/HTMLFormElement.cpp:
697         (WebCore::HTMLFormElement::createFormData):
698         * plugins/PluginPackage.cpp:
699         (WebCore::PluginPackage::compare):
700
701 2009-03-25  Dan Bernstein  <mitz@apple.com>
702
703         Reviewed by Dave Hyatt.
704
705         - fix <rdar://problem/6472150> repro crash in
706           RenderBlock::rightmostPosition(bool, bool) const at mercotte.fr using
707           menus
708
709         Test: fast/inline/continuation-positioned-reparenting.html
710
711         * rendering/RenderInline.cpp:
712         (WebCore::RenderInline::splitFlow): When repurposing the existing
713         container as the "pre" block, clear its positioned objects list, because
714         positioned descendants may end up in a different block after the split.
715
716 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
717
718         Reviewed by Dave Hyatt
719         
720         https://bugs.webkit.org/show_bug.cgi?id=24784
721         
722         Length values in transform operations need to take zoom into account.
723
724         Test: fast/transforms/transforms-with-zoom.html
725
726         * css/CSSStyleSelector.cpp:
727         (WebCore::CSSStyleSelector::createTransformOperations):
728
729 2009-03-25  David Hyatt  <hyatt@apple.com>
730
731         Reviewed by Simon Fraser.
732
733         https://bugs.webkit.org/show_bug.cgi?id=24809, background-clip/origin don't use the correct
734         values.  Add support for the new values (while preserving the old values for backwards
735         compatibility).
736
737         Changed some existing test cases to use the new values.
738
739         * css/CSSParser.cpp:
740         (WebCore::CSSParser::parseFillProperty):
741         * css/CSSPrimitiveValueMappings.h:
742         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
743         (WebCore::CSSPrimitiveValue::operator EFillBox):
744         * css/CSSValueKeywords.in:
745
746 2009-03-25  Brett Wilson  <brettw@dhcp-172-22-71-191.mtv.corp.google.com>
747
748         Reviewed by Dimitri Glazkov.
749
750         Fix complex text opacity on the Chromium Windows port.
751         https://bugs.webkit.org/show_bug.cgi?id=24757
752
753         Test: fast/text/complex-text-opacity.html
754
755         * platform/graphics/chromium/FontChromiumWin.cpp:
756         (WebCore::):
757         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::TransparencyAwareFontPainter):
758         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::init):
759         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::initializeForGDI):
760         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::~TransparencyAwareFontPainter):
761         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::TransparencyAwareGlyphPainter):
762         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::~TransparencyAwareGlyphPainter):
763         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::estimateTextBounds):
764         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::drawGlyphs):
765         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::hdc):
766         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::TransparencyAwareUniscribePainter):
767         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::~TransparencyAwareUniscribePainter):
768         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::estimateTextBounds):
769         (WebCore::Font::drawGlyphs):
770         (WebCore::Font::drawComplexText):
771
772 2009-03-25  David Hyatt  <hyatt@apple.com>
773
774         Reviewed by Eric Seidel
775
776         Fix for bug 23198, border images should not clip to border radii.  The border-image should just ignore
777         the border-radius, since the assumption is that any desired rounding will be built into the border-image
778         itself.
779
780         Note that I do not agree with this change, but I am matching the spec.
781
782         Added fast/borders/border-image-border-radius.html
783
784         * rendering/RenderBoxModelObject.cpp:
785         (WebCore::RenderBoxModelObject::paintNinePieceImage):
786
787 2009-03-25  Gustavo Noronha Silva  <gns@gnome.org>
788
789         Reviewed by Holger Freyther.
790
791         https://bugs.webkit.org/show_bug.cgi?id=24750
792         [GTK] requests download instead of displaying page
793
794         Fix the Content-Type headers we get from soup, so that we set a
795         proper media type on the ResourceResponse.
796
797         * platform/network/soup/ResourceHandleSoup.cpp:
798         (WebCore::fillResponseFromMessage):
799
800 2009-03-25  Gustavo Noronha Silva  <gns@gnome.org>
801
802         Reviewed by Holger Freyther.
803
804         https://bugs.webkit.org/show_bug.cgi?id=24600
805         [GTK] responses with status code >= 400 should not be given special treatment
806
807         Do not special case requests that have HTTP responses >=
808         400. Redirects are handled automatically by libsoup, but the rest
809         of the responses should be treated like any other.
810
811         * platform/network/soup/ResourceHandleSoup.cpp:
812         (WebCore::):
813         (WebCore::gotHeadersCallback):
814         (WebCore::gotChunkCallback):
815         (WebCore::finishedCallback):
816
817 2009-03-25  Darin Adler  <darin@apple.com>
818
819         Reviewed by John Sullivan.
820
821         Tidy up LegacyWebArchive a bit. And don't include favicons in web archives when
822         they are being used only for selections, not an entire document.
823
824         * WebCore.base.exp: Remove exported function that's not used in WebKit.
825
826         * loader/archive/cf/LegacyWebArchive.cpp:
827         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Made a static member
828         function so it can share private things with other member functions. Added some FIXME
829         comments to a branch of code I think is dead. Changed boolean argument into a named
830         one. Renamed to match other similar functions.
831         (WebCore::LegacyWebArchive::createResourceResponseFromPropertyListData): Ditto.
832         (WebCore::LegacyWebArchive::createResource): Ditto.
833         (WebCore::LegacyWebArchive::create): Merged the create and init functions.
834         (WebCore::LegacyWebArchive::rawDataRepresentation): Added some assertions because
835         we should never fail to write (we can fail to read).
836         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Made a static
837         member function as above.
838         (WebCore::LegacyWebArchive::createFromSelection): Ditto.
839         (WebCore::LegacyWebArchive::create): Iterate the vector with indices rather than
840         iterators. Only include the favicon if the first node is the document since we don't
841         want to include the favicon when copying and pasting.
842
843         * loader/archive/cf/LegacyWebArchive.h: Made one of the create functions private.
844         Made the Mac-specific functions be static member functions. Made other helpers be
845         static member functions. Removed the nit function.
846
847         * loader/archive/cf/LegacyWebArchiveMac.mm:
848         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Updated
849         comment and made this a static member function.
850         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto. Also made
851         it so we only type cast in one place.
852
853 2009-03-25  Darin Adler  <darin@apple.com>
854
855         Reviewed by David Hyatt.
856
857         Bug 24740: crash in RenderSlider::setPositionFromValue when calling pause() after setting <video> to display: none
858         https://bugs.webkit.org/show_bug.cgi?id=24740
859         rdar://problem/6679873
860
861         Bug 12104: Native Slider: When the thumb's height is specified as a percentage, it is not centered properly
862         https://bugs.webkit.org/show_bug.cgi?id=12104
863
864         Test: media/video-display-none-crash.html
865
866         The problem here was that RenderSlider was trying to position its thumb in a way that
867         requires it to call updateLayout inside rendering code. The right way to position a
868         child renderer is to do layout, so I had to write a layout function. And then fix a few
869         other small problems shown by the same test case.
870
871         * rendering/RenderSlider.cpp: Made defaultTrackLength have internal linkage.
872         Renamed HTMLSliderThumbElement to SliderThumbElement because we only use the HTML
873         prefix for public DOM classes, not elements used as implementation details.
874         Made SliderThumbElement function members private and got rid of unneeded default
875         argument value for shadowParent.
876         (WebCore::SliderRange::SliderRange): Added. Parses precision, max, and min attributes.
877         (WebCore::SliderRange::clampValue): Added. Does standard clamping based on the above.
878         (WebCore::SliderRange::valueFromElement): Added. Reads the value from the element in
879         a way that clamps to the range.
880         (WebCore::sliderPosition): Added. Computes the slider position: a double.
881         (WebCore::SliderThumbElement::SliderThumbElement): Removed unneeded explicit
882         initialization of m_initialClickPoint.
883         (WebCore::SliderThumbElement::defaultEventHandler): Call setValueForPosition instead
884         of calling setCurrentPosition and valueChanged.
885         (WebCore::RenderSlider::RenderSlider): Remove unneeded explicit initialization of m_thumb.
886         (WebCore::RenderSlider::styleDidChange): Remove unneeded second argument to createThumbStyle.
887         (WebCore::RenderSlider::createThumbStyle): Remove unneeded second argument. Get rid of code
888         setting the position to relative and setting the left and top. We now handle positioning
889         in a custom layout function.
890         (WebCore::RenderSlider::layout): Rewrote to handle positioning of the thumb as layout.
891         (WebCore::RenderSlider::updateFromElement): Added code to immediately update the value
892         in the element if it's out of range. This clamping used to be done as a side effect of
893         setPositionFromValue. Also, this has nothing to do with the renderer, so at some point
894         it could be moved into HTMLInputElement. Removed call to setPositionFromValue
895         and instead just rely on the call to setNeedsLayout. Fix the setNeedsLayout call to be
896         a normal setNeedsLayout(true), not a setNeedsLayout(true, false), because we do want
897         this to be propagated to the parent -- it's not called during layout.
898         (WebCore::RenderSlider::setValueForPosition): Refactor to use the new SliderRange
899         class. Also don't call setCurrentPosition; instead just call setNeedsLayout.
900         (WebCore::RenderSlider::currentPosition): Use the actual position of the renderer rather
901         than the style to find the position; that means this needs to be done after layout is done.
902         Also removed unneeded runtime checks and replaced them with assertions, after checking
903         all callers to see they already guarantee this.
904         (WebCore::RenderSlider::trackSize): Removed unneeded runtime checks and replaced them
905         with assertions, after checking all callers to see they already guarantee this.
906         (WebCore::RenderSlider::inDragMode): Added a null check for m_thumb so this won't
907         crash if called early on a brand new RenderSlider.
908
909         * rendering/RenderSlider.h: Made all functions private except for forwardEvent and inDragMode.
910         Renamed HTMLSliderThumbElement to SliderThumbElement because we only use the HTML
911         prefix for public DOM classes, not elements used as implementation details. Made the
912         mouseEventIsInThumb function non-virtual. Removed the return value and argument from
913         setPositionFromValue. Removed valueChanged and setCurrentPosition. Removed the oldStyle
914         argument to createThumbStyle (see above). Made SliderThumbElement a friend so it can use some
915         private member functions.
916
917 2009-03-25  Eli Fidler  <eli.fidler@torchmobile.com>
918
919         Reviewed by George Staikos.
920
921         Fix ambiguous else cases by adding braces to nested if()s with elses.
922
923         * loader/MainResourceLoader.cpp:
924         (WebCore::MainResourceLoader::continueAfterContentPolicy):
925         * page/EventHandler.cpp:
926         (WebCore::EventHandler::updateDragAndDrop):
927         * rendering/RenderListMarker.cpp:
928         (WebCore::toArmenianUnder10000):
929         * rendering/TextControlInnerElements.cpp:
930         (WebCore::TextControlInnerTextElement::defaultEventHandler):
931
932 2009-03-24  Eli Fidler  <eli.fidler@torchmobile.com>
933
934         Reviewed by George Staikos.
935
936         Move variable into proper platform block to quiet warning.
937
938         * html/CanvasRenderingContext2D.cpp:
939         (WebCore::CanvasRenderingContext2D::drawTextInternal):
940
941 2009-03-24  Eric Carlson  <eric.carlson@apple.com>
942
943         Reviewed by Antti Koivisto.
944
945         Fix for <rdar://problem/6719375> Deal with QTKit loadstate changes when playing streaming movies
946
947         *  WebCore/html/HTMLMediaElement.cpp:
948         (WebCore::HTMLMediaElement::setNetworkState): Deal with media engine reviving after having
949         network state of NETWORK_NO_SOURCE.
950
951         *  WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
952         (WebCore::MediaPlayerPrivate::updateStates): Reset m_readyState at each state change since
953         some types of movies currently cause QTKit's load state to bounce around. QTMovieLoadStatePlaythroughOK
954         corresponds to HaveFutureData, not HaveEnoughData.
955
956 2009-03-24  Adele Peterson  <adele@apple.com>
957
958         Reviewed by Darin Adler.
959
960         Fix for https://bugs.webkit.org/show_bug.cgi?id=24707
961         <rdar://problem/6593021> Deleting with a caret in a blank, quoted line decreases the quoting, but does not delete the line
962
963         * editing/TypingCommand.cpp: (WebCore::TypingCommand::deleteKeyPressed):
964         After breaking out of an empty mail blockquote, we still want continue with the deletion
965         so actual content will get deleted, and not just the quote style.
966
967 2009-03-24  Darin Adler  <darin@apple.com>
968
969         Reviewed by Brady Eidson.
970
971         <rdar://problem/6624662> REGRESSION (r39904): can't save certain web pages as web archive (ones without favicons!)
972
973         * loader/archive/cf/LegacyWebArchive.cpp:
974         (WebCore::LegacyWebArchive::create): Added a null check.
975
976 2009-03-24  Adam Langley  <agl@google.com>
977
978         Reviewed by Darin Fisher.
979
980         https://bugs.webkit.org/show_bug.cgi?id=24685
981
982         The Skia drawLine function takes subpixel values and attempts to draw
983         a line with subpixel precision. This is complex and slow for drawing
984         scrollbars which use only vertical and horizontal lines.
985
986         This changes the Chromium Linux scrollbar code to use drawIRect.
987
988         * platform/chromium/ScrollbarThemeChromiumLinux.cpp:
989         (WebCore::ScrollbarThemeChromium::invalidateOnMouseEnterExit):
990         (WebCore::drawVertLine):
991         (WebCore::drawHorizLine):
992         (WebCore::drawBox):
993         (WebCore::ScrollbarThemeChromium::paintTrackPiece):
994         (WebCore::ScrollbarThemeChromium::paintThumb):
995
996 2009-03-24  David Kilzer  <ddkilzer@apple.com>
997
998         Bug 23310: Setting an absolute path (/abs) on an <iframe> with no src doesn't resolve the URL properly
999
1000         <https://bugs.webkit.org/show_bug.cgi?id=23310>
1001
1002         Reviewed by Darin Adler.
1003
1004         Test: fast/frames/iframe-no-src-set-location.html
1005
1006         * dom/Document.cpp:
1007         (WebCore::Document::completeURL): If m_baseURL is empty or is
1008         about:blank and we have a parent document, use the parent
1009         document's URL for the base when completing a new URL.
1010
1011 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
1012
1013         Reviewed by Dave Hyatt
1014         
1015         https://bugs.webkit.org/show_bug.cgi?id=24659
1016         
1017         When hit-testing 3d-transformed layers, it doesn't make sense to project the hitTestRect
1018         into the coordinate space of the layer, and doing so can result in pathalogical quads
1019         that break hit testing. In that case, simply use the same bounds as used for painting,
1020         which are the composited bounds for this layer.
1021
1022         Test: transforms/3d/hit-testing/rotated-hit-test.html
1023
1024         * rendering/RenderLayer.cpp:
1025         (WebCore::RenderLayer::hitTestLayer):
1026
1027 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
1028
1029         Reviewed by Dave Hyatt
1030
1031         https://bugs.webkit.org/show_bug.cgi?id=24436
1032         
1033         When compositing is enabled, painting and hit testing end up using different
1034         clipping roots, because, for painting, every composited layer is a clipping root,
1035         but for hit testing only layers with transforms are. To fix this, we use
1036         temporary clip rects for hit testing, if the page is in compositing mode.
1037
1038         * rendering/RenderLayer.cpp:
1039         (WebCore::RenderLayer::paintLayer):
1040         (WebCore::RenderLayer::hitTestLayer):
1041         (WebCore::RenderLayer::parentClipRects):
1042         (WebCore::RenderLayer::calculateRects):
1043         * rendering/RenderLayer.h:
1044
1045 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
1046
1047         Reviewed by Dan Bernstein
1048         
1049         https://bugs.webkit.org/show_bug.cgi?id=24782
1050
1051         Fix regression with CSS clip rects with non-length values, by reverting to
1052         the original code, but passing the zoom multiplier through convertToLength().
1053         
1054         Also make stylistic change in createTransformOperations(), renaming 'inStyle'
1055         to 'style.
1056         
1057         Tested by existing tests.
1058
1059         * css/CSSStyleSelector.cpp:
1060         (WebCore::convertToLength):
1061         (WebCore::CSSStyleSelector::applyProperty):
1062         (WebCore::CSSStyleSelector::createTransformOperations):
1063
1064 2009-03-24  David Hyatt  <hyatt@apple.com>
1065
1066         Reviewed by Simon Fraser
1067
1068         https://bugs.webkit.org/show_bug.cgi?id=21789, overflow:hidden elements should clip their foreground contents
1069         to a border-radius.
1070
1071         This patch makes non-self-painting overflow layers and control clips work with border-radius.  RenderLayers
1072         that should be clipped by overflow ancestors with border-radius are still broken.
1073
1074         Added fast/clip/overflow-border-radius-clip.html
1075
1076         * rendering/RenderBox.cpp:
1077         (WebCore::RenderBox::pushContentsClip):
1078
1079 2009-03-24  David Hyatt  <hyatt@apple.com>
1080
1081         Reviewed by Simon Fraser
1082
1083         https://bugs.webkit.org/show_bug.cgi?id=21789, overflow:hidden elements should clip their foreground contents.
1084         
1085         This first patch makes overflow:hidden properly clip the foreground contents of overflow:hidden replaced elements.  Common
1086         replaced elements now default to overflow:hidden in the UA stylesheet (this is what the spec specifically recommends be
1087         done).
1088     
1089         Added fast/replaced/border-radius-clip.html
1090
1091         * css/html4.css:
1092         * rendering/RenderReplaced.cpp:
1093         (WebCore::RenderReplaced::paint):
1094         * rendering/RenderWidget.cpp:
1095         (WebCore::RenderWidget::paint):
1096
1097 2009-03-24  Adele Peterson  <adele@apple.com>
1098
1099         RS by Mark Rowe.
1100
1101         Only build these Mail quirks checks in on the Mac.
1102
1103         * dom/Document.cpp: (WebCore::disableRangeMutation):
1104         * html/HTMLElement.cpp: (WebCore::HTMLElement::inEitherTagList):
1105
1106 2009-03-24  Brent Fulgham  <bfulgham@webkit.org>
1107
1108         Build fix, no review.
1109
1110         Remove ResourceLoaderCFNet.cpp from build list for Cairo Releas
1111         and Debug targets.
1112
1113         * WebCore.vcproj/WebCore.vcproj:
1114
1115 2009-03-24  Eric Carlson  <eric.carlson@apple.com>
1116
1117         Fix layout tests broken by r41907.
1118
1119         * html/HTMLMediaElement.cpp:
1120         (WebCore::HTMLMediaElement::setReadyState): Don't set "was playing" based on the new ready state
1121
1122 2009-03-24  Dmitry Titov  <dimich@chromium.org>
1123
1124         Reviewed by Dimitri Glazkov.
1125
1126         https://bugs.webkit.org/show_bug.cgi?id=24689
1127         Fix Chromium compilation errors.
1128
1129         * bindings/v8/WorkerContextExecutionProxy.cpp:
1130         (WebCore::WorkerContextExecutionProxy::FindOrCreateEventListener):
1131         (WebCore::WorkerContextExecutionProxy::RemoveEventListener):
1132
1133 2009-03-24  Yury Semikhatsky  <yurys@chromium.org>
1134
1135         Reviewed by Darin Adler.
1136
1137         https://bugs.webkit.org/show_bug.cgi?id=24759
1138         Add missing methods Element.prototype.removeMatchingStyleClasses and
1139         Node.prototype.enclosingNodeOrSelfWithNodeNameInArray to SourceFrame content
1140         iframe. These methods are called by Element.prototype.removeStyleClass and
1141         Node.prototype.enclosingNodeOrSelfWithNodeName.
1142
1143         * inspector/front-end/SourceFrame.js:
1144         (WebInspector.SourceFrame.prototype._loaded):
1145
1146 2009-03-24  Mark Mentovai  <mark@chromium.org>
1147
1148         Reviewed by Mark Rowe.
1149
1150         https://bugs.webkit.org/show_bug.cgi?id=24653
1151         WebKit should be buildable without prefix header injection.
1152         Adds missing #includes and forward declarations as needed.
1153
1154         * editing/SmartReplaceCF.cpp:
1155         * platform/graphics/mac/ColorMac.mm:
1156         * platform/graphics/mac/FontCacheMac.mm:
1157         * platform/graphics/mac/FontCustomPlatformData.h:
1158         * platform/graphics/mac/FontMac.mm:
1159         * platform/graphics/mac/FontMacATSUI.mm:
1160         * platform/graphics/mac/FontPlatformData.h:
1161         * platform/graphics/mac/FontPlatformDataMac.mm:
1162         * platform/graphics/mac/GraphicsContextMac.mm:
1163         * platform/graphics/mac/SimpleFontDataMac.mm:
1164         * platform/mac/FoundationExtras.h:
1165         * platform/mac/LocalCurrentGraphicsContext.h:
1166         * platform/mac/WebCoreSystemInterface.h:
1167         * platform/mac/WebCoreSystemInterface.mm:
1168         * platform/mac/WebCoreTextRenderer.h:
1169         * platform/mac/WebCoreTextRenderer.mm:
1170         * platform/mac/WebFontCache.h:
1171         * platform/mac/WebFontCache.mm:
1172         * platform/text/PlatformString.h:
1173         * platform/text/mac/ShapeArabic.c:
1174         * platform/text/mac/StringMac.mm:
1175         * rendering/RenderThemeChromiumMac.h:
1176
1177 2009-03-24  Dan Bernstein  <mitz@apple.com>
1178
1179         Reviewed by Darin Adler.
1180
1181         - fix <rdar://problem/6107874> by capping the nesting depth of
1182           "block-level" elements generated by the parser
1183
1184         Test: fast/parser/block-nesting-cap.html
1185
1186         * html/HTMLParser.cpp:
1187         (WebCore::HTMLParser::HTMLParser):
1188         (WebCore::HTMLParser::insertNode):
1189         (WebCore::HTMLParser::pushBlock):
1190         (WebCore::HTMLParser::popOneBlockCommon):
1191         (WebCore::HTMLParser::freeBlock):
1192         * html/HTMLParser.h:
1193
1194 2009-03-23  Greg Bolsinga  <bolsinga@apple.com>
1195
1196         Reviewed by David Kilzer.
1197
1198         https://bugs.webkit.org/show_bug.cgi?id=24771
1199         
1200         DOMTimeStamps are based upon 1970.
1201
1202         * platform/mac/GeolocationServiceMac.mm:
1203         (-[WebCoreCoreLocationObserver locationManager:didUpdateToLocation:fromLocation:]):
1204
1205 2009-03-23  Eric Seidel  <eric@webkit.org>
1206
1207         Build fix, no review.
1208
1209         * rendering/RenderObject.cpp:
1210         (WebCore::RenderObject::createVisiblePosition): change .container to .isNotNull()
1211
1212 2009-03-23  Eric Seidel  <eric@webkit.org>
1213
1214         Reviewed by Darin Adler.
1215
1216         Rename Position::container to m_anchorNode and make it private
1217         https://bugs.webkit.org/show_bug.cgi?id=24760
1218
1219         More code cleanup for Position.
1220
1221         Change all uses of m_container to node()
1222         Eventually most uses of node() should change to anchorNode() to designate
1223         that it's the node the Position is anchored to, but not necessarily the
1224         container of the position (it could be the before/after neighbor).
1225
1226         Remove any code which sets m_container, and change it to use a new
1227         Position::moveToPosition function which takes a node and offset.
1228         It never makes sense to change the node and leave the offset.
1229
1230         * dom/Position.h:
1231         (WebCore::Position::Position):
1232         (WebCore::Position::clear):
1233         (WebCore::Position::anchorNode):
1234         (WebCore::Position::node):
1235         (WebCore::Position::moveToPosition):
1236         (WebCore::Position::moveToOffset):
1237         (WebCore::Position::isNull):
1238         (WebCore::Position::isNotNull):
1239         (WebCore::operator==):
1240         * dom/Range.cpp:
1241         (WebCore::Range::create):
1242         (WebCore::Range::compareBoundaryPoints):
1243         * dom/RangeBoundaryPoint.h:
1244         (WebCore::RangeBoundaryPoint::container):
1245         (WebCore::RangeBoundaryPoint::set):
1246         (WebCore::RangeBoundaryPoint::setOffset):
1247         (WebCore::RangeBoundaryPoint::setToChild):
1248         (WebCore::RangeBoundaryPoint::setToStart):
1249         (WebCore::RangeBoundaryPoint::setToEnd):
1250
1251 2009-03-17  Eric Seidel  <eric@webkit.org>
1252
1253         Reviewed by David Hyatt.
1254
1255         document.write() should be able to make a document strict mode
1256         https://bugs.webkit.org/show_bug.cgi?id=24336
1257
1258         Remove an implicit write of "<html>" on the first document.write call
1259         this was added as part of a KDE import http://trac.webkit.org/changeset/798
1260         with no layout test or explanation.  I can't think of any reason why
1261         an implicit <html> write is necessary (or correct), so I'm removing it and
1262         adding a test for the correct behavior.  The parser will add any necessary
1263         HTMLHTMLElements during the write() anyway.
1264
1265         Our behavior is now tested by fast/dom/Document/document-write-doctype
1266         and matches IE, FF fails this new test.  Mozilla bug filed:
1267         https://bugzilla.mozilla.org/show_bug.cgi?id=483908
1268
1269         * dom/Document.cpp:
1270         (WebCore::Document::write):
1271
1272 2009-03-23  Sam Weinig  <sam@webkit.org>
1273
1274         Reviewed by Dan Bernstein.
1275
1276         Fix for <rdar://problem/6140966>
1277         Empty Caches does not clear the Cross-site XMLHttpRequest preflight cache
1278
1279         * WebCore.base.exp:
1280         * WebCore.xcodeproj/project.pbxproj:
1281         * loader/CrossOriginPreflightResultCache.cpp:
1282         (WebCore::CrossOriginPreflightResultCache::empty):
1283         * loader/CrossOriginPreflightResultCache.h:
1284
1285 2009-03-23  Darin Adler  <darin@apple.com>
1286
1287         Reviewed by Adele Peterson.
1288
1289         Bug 24726: hit testing doesn't work right when the click is on anonymous content
1290         https://bugs.webkit.org/show_bug.cgi?id=24726
1291         rdar://problem/6696992
1292
1293         Test: editing/selection/hit-test-anonymous.html
1294
1295         * rendering/RenderBR.cpp:
1296         (WebCore::RenderBR::positionForPoint): Call createVisiblePosition instead of
1297         creating a VisiblePosition directly. It will handle finding non-anonymous
1298         content nearby if node() is 0.
1299         * rendering/RenderBlock.cpp:
1300         (WebCore::positionForPointRespectingEditingBoundaries): Ditto.
1301         (WebCore::positionForPointWithInlineChildren): Ditto.
1302         (WebCore::RenderBlock::positionForPoint): Ditto.
1303         * rendering/RenderBox.cpp:
1304         (WebCore::RenderBox::positionForPoint): Ditto.
1305         * rendering/RenderObject.cpp:
1306         (WebCore::RenderObject::positionForPoint): Ditto.
1307         (WebCore::RenderObject::createVisiblePosition): Added.
1308         * rendering/RenderObject.h: Added createVisiblePosition.
1309         * rendering/RenderReplaced.cpp:
1310         (WebCore::RenderReplaced::positionForPoint): Call createVisiblePosition.
1311         * rendering/RenderSVGInlineText.cpp:
1312         (WebCore::RenderSVGInlineText::positionForPoint): Ditto.
1313         * rendering/RenderText.cpp:
1314         (WebCore::RenderText::positionForPoint): Ditto.
1315
1316 2009-03-23  Adele Peterson  <adele@apple.com>
1317
1318         Reviewed by Darin Adler & Dave Hyatt.
1319
1320         Fix for <rdar://problem/6621310> REGRESSION(35185): Apple Travel HTML emails missing some style after Safari 4 upgrade
1321
1322         Leopard Mail doesn't expect <style> to be in the body.  This change reverts back to the old behavior of
1323         moving <style> to <head> for that version of Mail.
1324
1325         * html/HTMLElement.cpp: (WebCore::HTMLElement::inEitherTagList):
1326
1327 2009-03-23  Adele Peterson  <adele@apple.com>
1328
1329         Reviewed by Mark Rowe & Dave Hyatt.
1330
1331         Merge some of the individual Mail quirks into two settings that we can check for future quirks.
1332
1333         * WebCore.base.exp:
1334         * dom/Document.cpp:
1335         (WebCore::disableRangeMutation):
1336         (WebCore::Document::nodeChildrenChanged):
1337         (WebCore::Document::nodeWillBeRemoved):
1338         (WebCore::Document::textInserted):
1339         (WebCore::Document::textRemoved):
1340         (WebCore::Document::textNodesMerged):
1341         (WebCore::Document::textNodeSplit):
1342         * page/Settings.cpp:
1343         (WebCore::Settings::Settings):
1344         (WebCore::Settings::setNeedsLeopardMailQuirks):
1345         (WebCore::Settings::setNeedsTigerMailQuirks):
1346         * page/Settings.h:
1347         (WebCore::Settings::needsLeopardMailQuirks):
1348         (WebCore::Settings::needsTigerMailQuirks):
1349
1350 2009-03-23  Ada Chan  <adachan@apple.com>
1351
1352         https://bugs.webkit.org/show_bug.cgi?id=24762
1353         Support text-indent in <option> elements on windows platform.
1354
1355         Reviewed by Adele Peterson.
1356
1357         * css/themeWin.css:
1358         * platform/PopupMenuStyle.h: We don't honor font specified on <option> elements right now.  Make this
1359         explicit via windows themed default stylesheet.
1360         (WebCore::PopupMenuStyle::PopupMenuStyle): Also store text-indent and text-direction.
1361         (WebCore::PopupMenuStyle::textIndent):
1362         (WebCore::PopupMenuStyle::textDirection):
1363         * platform/win/PopupMenuWin.cpp:
1364         (WebCore::PopupMenu::paint): Adjust the text's x-coordinate if text-indent is supported for options and 
1365         text-indent is specified with LTR direction.
1366         * rendering/RenderMenuList.cpp:
1367         (WebCore::RenderMenuList::updateOptionsWidth): Take text-indent into account if theme supports text-indent for options.
1368         (WebCore::RenderMenuList::itemStyle): Use new PopupMenuStyle constructor on windows.
1369         (WebCore::RenderMenuList::menuStyle): Ditto.
1370         * rendering/RenderTextControlSingleLine.cpp:
1371         (WebCore::RenderTextControlSingleLine::menuStyle): Ditto.
1372         * rendering/RenderTheme.h:
1373         (WebCore::RenderTheme::popupOptionSupportsTextIndent): Added.  Default is false since we are only supporting it in windows for now.
1374         * rendering/RenderThemeWin.h:
1375         (WebCore::RenderThemeWin::popupOptionSupportsTextIndent): Returns true for windows.
1376
1377 2009-03-23  Sam Weinig  <sam@webkit.org>
1378
1379         Reviewed by Anders Carlsson.
1380
1381         Fix for https://bugs.webkit.org/show_bug.cgi?id=24699
1382         REGRESSION: Java Applets broken
1383         <rdar://problem/6707494>
1384
1385         Fix loading Java applets without a codeBase. Only pass the base (up to the
1386         the last path component) of the baseURL to the plug-in.
1387
1388         * html/HTMLAppletElement.cpp:
1389         (WebCore::HTMLAppletElement::createRenderer):
1390         * platform/KURL.cpp:
1391         (WebCore::KURL::baseAsString):
1392         * platform/KURL.h:
1393
1394 2009-03-23  Darin Adler  <darin@apple.com>
1395
1396         Reviewed by Sam Weinig.
1397
1398         * platform/KURL.h: Removed now-incorrect comments.
1399         None of the parts include the separator characters any more, now that
1400         query doesn't include the "?", so the comments explaining which do and do
1401         not are no-longer helpful.
1402
1403 2009-03-23  David Levin  <levin@chromium.org>
1404
1405         Reviewed by Dimitri Glazkov.
1406
1407         https://bugs.webkit.org/show_bug.cgi?id=24764
1408
1409         Renamed files V8NodeFilter -> V8NodeFilterCondition to reflect
1410         class names.  Also fixed some headers that got mangled in search/replace
1411         operations.
1412
1413         No change in behavior, so no test.
1414
1415         * bindings/v8/V8NodeFilter.h: Removed.
1416         * bindings/v8/V8NodeFilterCondition.cpp: Renamed from WebCore/bindings/v8/V8NodeFilter.cpp.
1417         * bindings/v8/V8NodeFilterCondition.h: Added.
1418         * bindings/v8/custom/V8ClipboardCustom.cpp:
1419         * bindings/v8/custom/V8DocumentCustom.cpp:
1420         * bindings/v8/custom/V8ElementCustom.cpp:
1421         * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
1422         * bindings/v8/custom/V8NavigatorCustom.cpp:
1423
1424 2009-03-23  Darin Fisher  <darin@chromium.org>
1425
1426         Reviewed by Antti Koivisto.
1427
1428         https://bugs.webkit.org/show_bug.cgi?id=24741
1429
1430         Adds a unique across-browser-sessions identifier to FormData, which may
1431         be used by ResourceHandle as a secondary cache key to enable cached
1432         form submissions.
1433
1434         At issue: two otherwise identical form submissions may result in
1435         completely independent responses, which may each be appropriate to
1436         store and reuse from cache.
1437
1438         * html/HTMLFormElement.cpp: Added call to FormData::setIdentifier so that
1439         we only enable cached form submissions for those generated by HTML.  This
1440         way we do not bother with POSTs generated by XMLHttpRequest.
1441         (WebCore::generateFormDataIdentifier):
1442         (WebCore::HTMLFormElement::createFormData):
1443         * platform/network/FormData.cpp: Initialize m_identifier to 0, which means
1444         the unspecified identifier.  So by default there is no identifier and
1445         nothing changes.
1446         (WebCore::FormData::FormData):
1447         * platform/network/FormData.h: Added m_identifier with setter and getter.
1448         (WebCore::FormData::setIdentifier):
1449         (WebCore::FormData::identifier):
1450
1451 2009-03-23  Simon Fraser  <simon.fraser@apple.com>
1452
1453         Reviewed by Antti Koivisto
1454         
1455         https://bugs.webkit.org/show_bug.cgi?id=24733
1456         
1457         Fix media controller with full-page zoom. Previously, the media controller
1458         shadow nodes never saw style changes on the RenderMedia, so did not respond
1459         to zooming at all. Now, we update the style on the shadow renderers
1460         whenever RenderMedia gets a style change. Also fix the video thumb in
1461         the theme to be scaled properly.
1462
1463         Test: media/video-controls-zoomed.html
1464
1465         * rendering/MediaControlElements.cpp:
1466         (WebCore::MediaControlShadowRootElement::updateStyle):
1467         (WebCore::MediaTextDisplayElement::MediaTextDisplayElement):
1468         (WebCore::MediaTextDisplayElement::updateStyle):
1469         (WebCore::MediaControlInputElement::MediaControlInputElement):
1470         (WebCore::MediaControlInputElement::updateStyle):
1471         * rendering/MediaControlElements.h:
1472         * rendering/RenderMedia.cpp:
1473         (WebCore::RenderMedia::styleDidChange):
1474         * rendering/RenderMedia.h:
1475         * rendering/RenderThemeMac.mm:
1476         (WebCore::RenderThemeMac::adjustSliderThumbSize):
1477
1478 2009-03-23  Mike Belshe  <mike@belshe.com>
1479
1480         Reviewed by Darin Adler.
1481
1482         https://bugs.webkit.org/show_bug.cgi?id=24739
1483
1484         Rework StringImpl::create methods to try to allocate a single buffer
1485         rather than allocating both the StringImpl class and a separate data
1486         buffer.
1487
1488         * platform/text/StringImpl.cpp:
1489         * platform/text/StringImpl.h:
1490
1491 2009-03-23  Darin Adler  <darin@apple.com>
1492
1493         Reviewed by Antti Koivisto.
1494
1495         Based on a patch by Nico Weber <nicolasweber@gmx.de>
1496
1497         Bug 24755: LayoutTests/http/tests/misc/url-in-utf16le.html regression
1498         https://bugs.webkit.org/show_bug.cgi?id=24755
1499
1500         * platform/text/TextEncoding.cpp:
1501         (WebCore::TextEncoding::isUTF7Encoding): Added. Checks if the current encoding
1502         is UTF7 without loading extended codecs.
1503         (WebCore::TextEncoding::encodingForFormSubmission): Use isUTF7Encoding() instead
1504         of comparing with UTF7Encoding(). Eliminate the explicit check of
1505         noExtendedTextEncodingNameUsed() because that's now handled by the functions
1506         that this function calls instead.
1507
1508         * platform/text/TextEncoding.h: Added isUTF7Encoding function.
1509         Also tweaked formatting a bit.
1510
1511 2009-03-20  Peter Kasting  <pkasting@google.com>
1512
1513         Reviewed by Darin Fisher.
1514
1515         https://bugs.webkit.org/show_bug.cgi?id=24720
1516         RenderThemeChromium should draw something for Slider parts instead of
1517         dropping them on the floor.
1518
1519         * platform/chromium/ChromiumBridge.h:
1520         * rendering/RenderThemeChromiumWin.cpp:
1521         (WebCore::RenderThemeChromiumWin::adjustSliderThumbSize):
1522         (WebCore::RenderThemeChromiumWin::paintSliderTrack):
1523         (WebCore::RenderThemeChromiumWin::determineSliderThumbState):
1524         (WebCore::RenderThemeChromiumWin::getThemeData):
1525         * rendering/RenderThemeChromiumWin.h:
1526         (WebCore::RenderThemeChromiumWin::paintSliderThumb):
1527
1528 2009-03-23  Glen Murphy  <glen@chromium.org>
1529
1530         Reviewed by Darin Fisher.
1531
1532         https://bugs.webkit.org/show_bug.cgi?id=24657
1533
1534         Fix Skia drawing of highly scaled bitmaps; the conversion to
1535         IntRect produced visible layout test failures in highly scaled 
1536         coordinate systems.
1537
1538         Test: svg/custom/image-small-width-height.svg
1539
1540         * WebCore\platform\graphics\skia\ImageSkia.cpp:
1541
1542 2009-03-23  David Kilzer  <ddkilzer@apple.com>
1543
1544         Provide JavaScript exception information after slow script timeout
1545
1546         Reviewed by Oliver Hunt.
1547
1548         * bindings/js/ScriptController.cpp:
1549         (WebCore::ScriptController::evaluate): Changed to report
1550         exceptions for the Interrupted completion type as well.
1551
1552 2009-03-23  Simon Fraser  <simon.fraser@apple.com>
1553
1554         Reviewed by Darin Adler
1555
1556         https://bugs.webkit.org/show_bug.cgi?id=24736
1557         
1558         Fix three mostly-unrelated problems with full-page zoom:
1559         
1560         * dom/Document.cpp:
1561         (WebCore::Document::elementFromPoint):
1562         Document::elementFromPoint() needs to take full-page zoom into account.
1563         
1564         * dom/MouseRelatedEvent.cpp:
1565         (WebCore::MouseRelatedEvent::receivedTarget):
1566         Take full-page zoom into account when computing offsetX/offsetY.
1567         
1568         * html/HTMLSelectElement.cpp:
1569         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
1570         Don't use offsetX/offsetY when hit testing list boxes; offsets were broken
1571         with full-page zoom, and using pageX/pageY is easier because we don't
1572         have to worry about the event target, and we already have a point in
1573         absolute coordinates.
1574
1575         Tests: fast/forms/listbox-hit-test-zoomed.html
1576                fast/forms/search-zoomed.html
1577                fast/forms/slider-zoomed.html
1578
1579 2009-03-23  Simon Fraser  <simon.fraser@apple.com>
1580
1581         Reviewed by Dan Bernstein
1582
1583         https://bugs.webkit.org/show_bug.cgi?id=24753
1584         
1585         The rect for CSS 'clip' needs to have zooming applied to it.
1586
1587         Test: fast/css/clip-zooming.html
1588
1589         * css/CSSStyleSelector.cpp:
1590         (WebCore::CSSStyleSelector::applyProperty):
1591
1592 2009-03-23  Eric Carlson  <eric.carlson@apple.com>
1593
1594         Reviewed by Adam Roben.
1595
1596         <rdar://problem/6704282>
1597         https://bugs.webkit.org/show_bug.cgi?id=24719
1598         QTMovieWinTimer logic inversion
1599
1600         Fix logic inversion in the Win32 timer used by QTMovieWin that caused it to always
1601         use SetTimer, even when the intervals was below USER_TIMER_MINIMUM. A side effect of
1602         this was that a movie timer would sometimes be blocked for significant amounts of time 
1603         because WM_TIMER messages are not processed when the thread's message queue has any
1604         higher priority messages, and WebCore/Win's timer uses PostMessage for low interval
1605         timers. Also change SetTimer call to use HWND and custom message instead of 
1606         timer function since the timer already has an HWND for processing PostMessage.
1607
1608         Not possible to make a test for this because it is so timing dependant.
1609
1610         * platform/graphics/win/QTMovieWinTimer.cpp:
1611         (TimerWindowWndProc):
1612         (setSharedTimerFireDelay):
1613
1614 2009-03-23  Eric Carlson  <eric.carlson@apple.com>
1615
1616         Reviewed by Adele Peterson.
1617
1618         https://bugs.webkit.org/show_bug.cgi?id=24588
1619         
1620         Update media element implementation to current HTML5 spec
1621
1622         New tests: 
1623                media/media-constants.html
1624                media/video-seek-no-src-exception.html
1625                media/video-source-add-src.html
1626                media/video-src-invalid-remove.html
1627                media/video-src-plus-source.html
1628                media/video-timeupdate-during-playback.html
1629
1630         * dom/EventNames.h: Remove obsolute events, add new ones.
1631         * html/HTMLMediaElement.cpp:
1632         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize new member vars.
1633         (WebCore::HTMLMediaElement::attributeChanged): Trigger load() only when we don't
1634         have a source.
1635         (WebCore::HTMLMediaElement::removedFromDocument): Deal with state name changes.
1636         (WebCore::HTMLMediaElement::scheduleProgressEvent): New, create a progress event and 
1637         add it to the event queue to be dispatch when the timer fires.
1638         (WebCore::HTMLMediaElement::scheduleEvent): New, create a generic event and add
1639         it to the event queue to be dispatch when the timer fires.
1640         (WebCore::HTMLMediaElement::enqueueEvent): Add an event to the queue and ticke the 
1641         asynch event timer.
1642         (WebCore::HTMLMediaElement::asyncEventTimerFired): Dispatch all pending events.
1643         (WebCore::HTMLMediaElement::loadTimerFired): Either trigger the initial load or
1644         try to load the next <source> url.
1645         (WebCore::HTMLMediaElement::load): Minor style change.
1646         (WebCore::HTMLMediaElement::loadInternal): The first part of the spec load algorithm, cleanup
1647         the current load (if any) and set up state for a new load.
1648         (WebCore::HTMLMediaElement::selectMediaResource): Deal with no 'src' or <source>, post 'loadstart'
1649         event, and initiate load from 'src' if present.
1650         (WebCore::HTMLMediaElement::loadNextSourceChild): Initiate load from next <source> url, or trigger
1651         noneSupported() if no more to consider.
1652         (WebCore::HTMLMediaElement::loadResource): Instantiate a new MediaPlayer and ask it to load a url.
1653         (WebCore::HTMLMediaElement::startProgressEventTimer): Start the repeating progress event timer.
1654         (WebCore::HTMLMediaElement::noneSupported): Post error event and set up state when no valid 
1655         media url was found.
1656         (WebCore::HTMLMediaElement::mediaEngineError): Post error event and set up state when no valid 
1657         media engine failed with a decode error or a network error.
1658         (WebCore::HTMLMediaElement::mediaPlayerNetworkStateChanged):
1659         (WebCore::HTMLMediaElement::setNetworkState): Updated for new spec network states.
1660         (WebCore::HTMLMediaElement::mediaPlayerReadyStateChanged):
1661         (WebCore::HTMLMediaElement::setReadyState): Updated for new spec ready state.
1662         (WebCore::HTMLMediaElement::progressEventTimerFired): Bail if the network is not active.
1663         (WebCore::HTMLMediaElement::seek): Return INVALID_STATE_ERR exception if state is too low or
1664         if player hasn't been set up yet. This is necessary becase load() is async. Clear the flag
1665         we use to guard against sending 'ended' more than once.
1666         (WebCore::HTMLMediaElement::duration): Don't bother calling media engine before it has metadata.
1667         (WebCore::HTMLMediaElement::setDefaultPlaybackRate): Remove exception param, 0 is no longer an
1668         invalid rate. 
1669         (WebCore::HTMLMediaElement::setPlaybackRate): Remove exception param, 0 is no longer an
1670         invalid rate. Cache rate being set so we can use it later if media engine isn't ready now.
1671         (WebCore::HTMLMediaElement::play): Remove exception param, play() before load() now just
1672         starts loading asynchronously.
1673         (WebCore::HTMLMediaElement::playInternal): Remove exception param. Fire 'waiting' or 'playing'
1674         event depending on current state.
1675         (WebCore::HTMLMediaElement::pause): Remove exception param, pause() before load() now just
1676         starts loading asynchronously.
1677         (WebCore::HTMLMediaElement::pauseInternal): Remove exception param.
1678         (WebCore::HTMLMediaElement::setVolume): dispatchEventAsync -> scheduleEvent
1679         (WebCore::HTMLMediaElement::setMuted): dispatchEventAsync -> scheduleEvent
1680         (WebCore::HTMLMediaElement::togglePlayState): Remove exception param.
1681         (WebCore::HTMLMediaElement::beginScrubbing): pause() doesn't take an exception param.
1682         (WebCore::HTMLMediaElement::startPlaybackProgressTimer): New, starts timer that fires 4 times per
1683         second when the movie is playing to timeupdate so we can post 'timeupdate' events.
1684         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Timer proc.
1685         (WebCore::HTMLMediaElement::scheduleTimeupdateEvent): Bottleneck around scheduling a 'timeupdate'
1686         event because we both fire them them when the spec says we should and when the media engine
1687         says that time has jumped, but we don't want to fire more than one at a given movie time. We also
1688         use this bottleneck to keep track of the last time one was posted so we won't fire too often
1689         during playback.
1690         (WebCore::HTMLMediaElement::canPlay): readyState now tracks whether or not we have metadata.
1691         (WebCore::HTMLMediaElement::havePotentialSourceChild): New, checks to see if there are a <source>
1692         element with a 'src' attribute that we have not tried to load yet.
1693         (WebCore::HTMLMediaElement::nextSourceChild): New, returns the url and content type of the next
1694         <source> element that we haven't tried to load.
1695         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Schedule 'seeked' event when seeking completes.
1696         Set a flag when we post the 'ended' event, clear it when time changed and we aren't at the end since
1697         some media engines call this proc more than once when playback reaches the end and stops, but we
1698         don't want to post 'ended' more than once.
1699         (WebCore::HTMLMediaElement::mediaPlayerDurationChanged): New, added so media engine can inform
1700         when the movie duration changes and we can post 'durationchanged' event.
1701         (WebCore::HTMLMediaElement::mediaPlayerRateChanged): New, added so media engine can inform when
1702         the rate changed and we can updated our cached rate. This is useful because we only want to know
1703         post periodic 'timeupdate' events when the movie is actually playing, and because we want to know
1704         the actual playback rate when it differs from what we tried to set.
1705         (WebCore::HTMLMediaElement::mediaPlayerSizeChanged): New, added so media engine can inform when
1706         a movie's intrinsic size changes and we can inform the renderer.
1707         (WebCore::HTMLMediaElement::potentiallyPlaying): Renamed from activelyPlaying since the spec now
1708         uses "actively playing" for this concept. Update logic for new state names and un-comment calls
1709         to stoppedDueToErrors() and pausedForUserInteraction() since the spec says those condiditons
1710         are part of the answer.
1711         (WebCore::HTMLMediaElement::endedPlayback): Update logic for new state names. 
1712         (WebCore::HTMLMediaElement::stoppedDueToErrors): New, spec says this logic should be part of
1713         the determination of "potentially playing".
1714         (WebCore::HTMLMediaElement::pausedForUserInteraction): New, placeholder for when (if) user
1715         agent supports this spec concept.
1716         (WebCore::HTMLMediaElement::updatePlayState): Stop timer used to fire periodic 'timeupdate' 
1717         events when we pauses the movie. Set the media engine rate before calling play() in case it
1718         wasn't set up when the rate was changed.
1719         (WebCore::HTMLMediaElement::stopPeriodicTimers): New, stop the progress event and 'timeupate'
1720         event timers.
1721         (WebCore::HTMLMediaElement::userCancelledLoad): New, logic pulled out of documentWillBecomeInactive
1722         and updated for the current spec.
1723         (WebCore::HTMLMediaElement::documentWillBecomeInactive): Moved some logic to userCancelledLoad.
1724         (WebCore::HTMLMediaElement::documentDidBecomeActive): Update comments.
1725         (WebCore::HTMLMediaElement::initialURL): Update for refactoring of code that determines the 
1726         initial url.
1727         * html/HTMLMediaElement.h: Change ReadyState and NetworkState enums to match names in the spec,
1728         update for changes in .cpp.
1729         (WebCore::HTMLMediaElement::):
1730
1731         * html/HTMLMediaElement.idl: Update ready state and network state constants for spec changes.
1732         defaultPlaybackRate, playbackRate, play(), and pause() no longer raise exceptions.
1733
1734         * html/HTMLSourceElement.cpp:
1735         (WebCore::HTMLSourceElement::insertedIntoDocument): Update for network state name changes.
1736
1737         * html/HTMLVideoElement.cpp:
1738         (WebCore::HTMLVideoElement::updatePosterImage): Update for ready state name changes.
1739
1740         * html/MediaError.h:
1741         (WebCore::MediaError::): add MEDIA_ERR_NONE_SUPPORTED.
1742
1743         * html/MediaError.idl: add MEDIA_ERR_NONE_SUPPORTED.
1744
1745         * loader/MediaDocument.cpp:
1746         (WebCore::MediaDocument::defaultEventHandler): play() and pause() don't take an exception.
1747
1748         * platform/graphics/MediaPlayer.cpp:
1749         (WebCore::NullMediaPlayerPrivate::readyState): Update for newtork state name changes.
1750         (WebCore::MediaPlayer::sizeChanged): New, so engine can report intrinsic size changes.
1751         (WebCore::MediaPlayer::rateChanged): New, so engine can report rate changes.
1752         (WebCore::MediaPlayer::durationChanged): New, so engine can report duration changes.
1753         * platform/graphics/MediaPlayer.h: Update NetworkState and ReadyState enum names to match spec
1754         states.
1755         (WebCore::MediaPlayerClient::mediaPlayerDurationChanged): New.
1756         (WebCore::MediaPlayerClient::mediaPlayerRateChanged): New.
1757         (WebCore::MediaPlayerClient::mediaPlayerSizeChanged): New.
1758         (WebCore::MediaPlayer::):
1759
1760         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
1761         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): Update for network/ready state name changes.
1762         (WebCore::MediaPlayerPrivate::load): Ditto.
1763         (WebCore::MediaPlayerPrivate::updateStates): Ditto.
1764         (WebCore::MediaPlayerPrivate::loadingFailed): Ditto.
1765
1766         * platform/graphics/mac/MediaPlayerPrivateQTKit.h: Update for network/ready state name changes.
1767         Remove endPointTimer, it is no longer necessary. Add m_enabledTrackCount and m_duration.
1768         (WebCore::MediaPlayerPrivate::metaDataAvailable):
1769         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1770         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): No more m_endPointTimer or m_endTime. Initialize
1771         m_enabledTrackCount and m_duration. Update for network/ready state name changes.
1772         (WebCore::MediaPlayerPrivate::load): Update for network/ready state name changes.
1773         (WebCore::MediaPlayerPrivate::play): No more m_endPointTimer.
1774         (WebCore::MediaPlayerPrivate::pause): Ditto.
1775         (WebCore::MediaPlayerPrivate::currentTime): No more m_endTime.
1776         (WebCore::MediaPlayerPrivate::seek): Ditto.
1777         (WebCore::MediaPlayerPrivate::doSeek): Ditto, plus don't call setRate(0) when the rate is
1778         already zero.
1779         (WebCore::MediaPlayerPrivate::setEndTime): No more m_endTime.
1780         (WebCore::MediaPlayerPrivate::updateStates): Update for network/ready state name changes. Return
1781         different errors depending on what causes a failure. Watch for and report duration changes.
1782         (WebCore::MediaPlayerPrivate::rateChanged): Report rate changes.
1783         (WebCore::MediaPlayerPrivate::sizeChanged): Report size changes.
1784         (WebCore::MediaPlayerPrivate::didEnd): No more endpoint timer.
1785         (WebCore::MediaPlayerPrivate::setVisible): Update for network/ready state name changes.
1786         (WebCore::MediaPlayerPrivate::disableUnsupportedTracks): Don't return number of unsupported
1787         tracks, store in m_enabledTrackCount so we can use it to help determine causes of failure.
1788
1789         * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp:
1790         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): Update for network/ready state name changes.
1791         (WebCore::MediaPlayerPrivate::load): Ditto.
1792         (WebCore::MediaPlayerPrivate::duration): Ditto.
1793         (WebCore::MediaPlayerPrivate::updateStates): Ditto.
1794         (WebCore::MediaPlayerPrivate::naturalSize): Ditto.
1795
1796         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp:
1797         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): No more m_endPointTimer. Update for 
1798         network/ready state name changes.
1799         (WebCore::MediaPlayerPrivate::load): Update for network/ready state name changes. No more
1800         m_endPointTimer.
1801         (WebCore::MediaPlayerPrivate::play): No more m_endPointTimer.
1802         (WebCore::MediaPlayerPrivate::pause): Ditto. 
1803         (WebCore::MediaPlayerPrivate::setEndTime): Ditto.
1804         (WebCore::MediaPlayerPrivate::updateStates): Update for network/ready state name changes.
1805         (WebCore::MediaPlayerPrivate::didEnd): No more m_endPointTimer.
1806         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h:
1807
1808         * rendering/MediaControlElements.cpp:
1809         (WebCore::MediaControlPlayButtonElement::defaultEventHandler): Update for network/ready state 
1810         name changes.
1811         (WebCore::MediaControlSeekButtonElement::defaultEventHandler): Ditto.
1812
1813 2009-03-22  Kevin Ollivier  <kevino@theolliviers.com>
1814
1815         wxGTK build fix. Add missing header.
1816
1817         * platform/wx/wxcode/gtk/non-kerned-drawing.cpp:
1818
1819 2009-03-22  Simon Fraser  <simon.fraser@apple.com>
1820
1821         Reviewed by Dan Bernstein
1822         
1823         https://bugs.webkit.org/show_bug.cgi?id=24665
1824         
1825         Image-map code in RenderImage could result in RenderImage::nodeAtPoint()
1826         setting HitTestResult::innerNode(), but returning false, which violates
1827         hit testing rules. Use a temporary HitTestResult so that we only fill in
1828         result when we know we've hit.
1829
1830         * rendering/RenderImage.cpp:
1831         (WebCore::RenderImage::nodeAtPoint):
1832
1833 2009-03-22  Simon Fraser  <simon.fraser@apple.com>
1834
1835         Reviewed by Dan Bernstein
1836         
1837         https://bugs.webkit.org/show_bug.cgi?id=24743
1838         
1839         Fix hit testing regression from r41840. We need to pass the temporary
1840         HitTestResult when testing sublayers, then only copy to 'result' when
1841         the layer is known to have been hit.
1842
1843         Test: fast/layers/zindex-hit-test.html
1844
1845         * rendering/RenderLayer.cpp:
1846         (WebCore::RenderLayer::hitTestLayer):
1847
1848 2009-03-20  Simon Fraser  <simon.fraser@apple.com>
1849
1850         Reviewed by Darin Adler
1851
1852         https://bugs.webkit.org/show_bug.cgi?id=24733
1853         
1854         Fix hit testing on video controls after full page zoom by fixing wider issue
1855         with event->pageX(), pageY() with zooming. pageX and pageY are "fixed" to be
1856         invariant under zooming (for JavaScript), so we keep an actual page point around
1857         in MouseEvent::absoluteLocation() to avoid the need to factor in zooming everywhere.
1858
1859         * dom/MouseRelatedEvent.cpp:
1860         (WebCore::MouseRelatedEvent::initCoordinates):
1861         (WebCore::MouseRelatedEvent::computePageLocation):
1862         * dom/MouseRelatedEvent.h:
1863         (WebCore::MouseRelatedEvent::absoluteLocation):
1864         (WebCore::MouseRelatedEvent::setAbsoluteLocation):
1865         Member var, and getter and setter for absoluteLocation.
1866         New method, computePageLocation(), to compute the actual page point,
1867         and call it when creating and initting mouse-related events.
1868
1869         * dom/Node.cpp:
1870         (WebCore::Node::dispatchMouseEvent):
1871         (WebCore::Node::dispatchWheelEvent):
1872         Keep non-adjusted pageX and pageY around, and call setAbsoluteLocation()
1873         on the event to replace a potentially rounded point.
1874         
1875         * html/HTMLInputElement.cpp:
1876         (WebCore::HTMLInputElement::defaultEventHandler):
1877         Clean up slider handling code.
1878         
1879         * html/HTMLSelectElement.cpp:
1880         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
1881         Add FIXME comment for use of offsetX/offsetY.
1882         
1883         * page/ContextMenuController.cpp:
1884         (WebCore::ContextMenuController::handleContextMenuEvent):
1885         Use absoluteLocation() when hit testing for context menus.
1886         
1887         * rendering/RenderFrameSet.cpp:
1888         (WebCore::RenderFrameSet::userResize):
1889         Use absoluteLocation() when resizing frames.
1890         
1891         * rendering/RenderMedia.cpp:
1892         (WebCore::RenderMedia::forwardEvent):
1893         Use absoluteLocation() when hit testing media controls.
1894
1895         * rendering/RenderSlider.cpp:
1896         (WebCore::HTMLSliderThumbElement::defaultEventHandler):
1897         (WebCore::RenderSlider::mouseEventIsInThumb):
1898         Use absoluteLocation() when handling slider events.
1899
1900         (WebCore::RenderSlider::forwardEvent):
1901         Factor some code out of HTMLInputElement::defaultEventHandler().
1902         
1903         * rendering/RenderTextControlSingleLine.cpp:
1904         (WebCore::RenderTextControlSingleLine::forwardEvent):
1905         Use absoluteLocation() when hit testing search field buttons, which fixees
1906         bugs in the search field with zooming.
1907
1908 2009-03-21  David Levin  <levin@chromium.org>
1909
1910         Reviewed by Dimitri Glazkov.
1911
1912         https://bugs.webkit.org/show_bug.cgi?id=24727
1913         Add V8XMLHttpRequest*.
1914
1915         * bindings/v8/V8XMLHttpRequestUtilities.cpp: Added.
1916         * bindings/v8/V8XMLHttpRequestUtilities.h: Added.
1917         * bindings/v8/custom/V8XMLHttpRequestConstructor.cpp: Added.
1918         * bindings/v8/custom/V8XMLHttpRequestCustom.cpp: Added.
1919         * bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp: Added.
1920
1921 2009-03-21  David Levin  <levin@chromium.org>
1922
1923         Reviewed by Dimitri Glazkov.
1924
1925         https://bugs.webkit.org/show_bug.cgi?id=24725
1926         Add V8NodeFilter.
1927
1928         * bindings/v8/V8NodeFilter.cpp: Added.
1929         * bindings/v8/V8NodeFilter.h: Added.
1930
1931 2009-03-21  Dan Bernstein  <mitz@apple.com>
1932
1933         Rubber-stamped by Kevin Decker
1934
1935         - remove some redundant #include statements
1936
1937         * bindings/js/JSDOMWindowBase.cpp:
1938
1939 2009-03-20  Dan Bernstein  <mitz@apple.com>
1940
1941         Reviewed by Mark Rowe.
1942
1943         - fix <rdar://problem/6574185> REGRESSION (3.2.2-TOT): hang in text drawing code
1944
1945         * platform/graphics/win/FontCGWin.cpp:
1946         (WebCore::drawGDIGlyphs): Changed glyph stroking to fill and stroke each
1947         glyph as a separate path, instead of all glyphs as a single path. This
1948         matches what CGContextShowGlyphsWithAdvances() does, and has comparable
1949         performance.
1950
1951 2009-03-20  Dean Jackson  <dino@apple.com>
1952
1953         Reviewed by Simon Fraser
1954
1955         Build fix for ENABLE(3D_RENDERING)
1956
1957         * rendering/RenderObject.h:
1958         (WebCore::makeMatrixRenderable):
1959
1960 2009-03-20  Dave Moore  <davemoore@google.com>
1961
1962         Reviewed by Dimitri Glazkov.
1963
1964         https://bugs.webkit.org/show_bug.cgi?id=24705
1965
1966         A bug in the V8 bindings is preventing chromium from setting the href on the
1967         location object...any attempt throws a security error, not just for javascript
1968         protocol
1969
1970         * page/Location.idl:
1971
1972 2009-03-20  Craig Schlenter  <craig.schlenter@gmail.com>
1973
1974         Reviewed by Dimitri Glazkov.
1975
1976         https://bugs.webkit.org/show_bug.cgi?id=24608
1977
1978         Include stdio.h needed for printf on gcc 4.4.0
1979
1980         * platform/KURLGoogle.cpp:
1981
1982 2009-03-20  Mike Belshe <mike@belshe.com>
1983
1984         Reviewed by Darin Fisher.
1985
1986         https://bugs.webkit.org/show_bug.cgi?id=24577
1987
1988         Don't let comments at the end of an event handler
1989         break the event handler.
1990
1991         No change in behavior, so no test.
1992
1993         * bindings/v8/V8LazyEventListener.cpp:
1994         (WebCore::V8LazyEventListener::getWrappedListenerFunction):
1995
1996 2009-03-20  Norbert Leser  <norbert.leser@nokia.com>
1997
1998         Reviewed by Darin Adler.
1999
2000         https://bugs.webkit.org/show_bug.cgi?id=24535
2001
2002         Fixes missing line terminator character (;) after macro call.
2003         It is common practice to add the trailing ";" where macros are substituted
2004         and not where they are defined with #define.
2005         This change is consistent with other macro declarations across webkit,
2006         and it also solves compilation failure with symbian compilers. 
2007  
2008         No change in behavior, so no test.
2009
2010         * bindings/js/JSDOMWindowShell.cpp:
2011         * bindings/js/JSEventListener.cpp:
2012         * bindings/js/JSImageConstructor.cpp:
2013         * bindings/js/JSInspectedObjectWrapper.cpp:
2014         * bindings/js/JSInspectorCallbackWrapper.cpp:
2015         * bindings/js/JSNamedNodesCollection.cpp:
2016         * bindings/js/JSNodeFilterCondition.cpp:
2017         * bindings/js/JSOptionConstructor.cpp:
2018         * bindings/js/JSQuarantinedObjectWrapper.cpp:
2019         * bindings/js/JSRGBColor.cpp:
2020         * bindings/js/JSWorkerContextBase.cpp:
2021         * bindings/js/JSXMLHttpRequestConstructor.cpp:
2022         * bindings/js/JSXSLTProcessorConstructor.cpp:
2023         * bindings/scripts/CodeGeneratorJS.pm:
2024
2025 2009-03-20  Mike Belshe  <mike@belshe.com>
2026
2027         Reviewed by Dimitri Glazkov and Dave Hyatt.
2028
2029         https://bugs.webkit.org/show_bug.cgi?id=24324
2030
2031         Make the minimum timer configurable for different platforms.
2032
2033         * page/DOMTimer.cpp:
2034         (WebCore::DOMTimer::DOMTimer):
2035         (WebCore::DOMTimer::fired):
2036         * page/DOMTimer.h:
2037         (WebCore::DOMTimer::minTimerInterval):
2038         (WebCore::DOMTimer::setMinTimerInterval):
2039
2040 2009-03-20  Dean McNamee  <deanm@chromium.org>
2041
2042         Reviewed by Darin Adler.
2043
2044         https://bugs.webkit.org/show_bug.cgi?id=22834
2045
2046         Make sure to consistently match new/delete and fastMalloc/fastFree.
2047
2048         * css/CSSSelectorList.cpp:
2049         (WebCore::CSSSelectorList::adoptSelectorVector):
2050         (WebCore::CSSSelectorList::deleteSelectors):
2051
2052 2009-03-20  Dan Bernstein  <mitz@apple.com>
2053
2054         Reviewed by Dave Hyatt.
2055
2056         - fix https://bugs.webkit.org/show_bug.cgi?id=23739
2057           <rdar://problem/6556371> REGRESSION (r36513): iframe isn't sized properly upon load
2058
2059         * rendering/RenderBlock.cpp:
2060         (WebCore::RenderBlock::percentHeightDescendants): Added this accessor.
2061         * rendering/RenderBlock.h:
2062         * rendering/RenderTableSection.cpp:
2063         (WebCore::RenderTableSection::layoutRows): Extended the check for
2064         children that flex to include other descendants with percent height
2065         which is relative to the cell.
2066
2067 2009-03-20  Dmitry Titov  <dimich@chromium.org>
2068
2069         Reviewed by Alexey Proskuryakov.
2070
2071         https://bugs.webkit.org/show_bug.cgi?id=24706
2072         Remove ScriptExecutionContext::encoding() since Workers do not need it.
2073         WorkerContext::encoding() is simply removed, while Document::encoding()
2074         made non-virtual and private. Workers use UTF-8 now except when instructed
2075         otherwise by http header. Also updated test.
2076
2077         * dom/Document.h: Made encoding() non-virtual and private.
2078         * dom/ScriptExecutionContext.h: removed encoding().
2079
2080         * workers/Worker.cpp:
2081         (WebCore::Worker::Worker):
2082         (WebCore::Worker::notifyFinished):
2083         * workers/WorkerContext.cpp: removed encoding() implementation.
2084         (WebCore::WorkerContext::WorkerContext):
2085         (WebCore::WorkerContext::completeURL):
2086         * workers/WorkerContext.h: removed encoding()
2087         (WebCore::WorkerContext::create):
2088         * workers/WorkerContextProxy.h:
2089         * workers/WorkerImportScriptsClient.cpp:
2090         (WebCore::WorkerImportScriptsClient::didReceiveData):
2091         * workers/WorkerMessagingProxy.cpp:
2092         (WebCore::WorkerMessagingProxy::startWorkerContext):
2093         * workers/WorkerMessagingProxy.h:
2094         * workers/WorkerThread.cpp:
2095         (WebCore::WorkerThreadStartupData::create):
2096         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
2097         (WebCore::WorkerThread::create):
2098         (WebCore::WorkerThread::WorkerThread):
2099         (WebCore::WorkerThread::workerThread):
2100         * workers/WorkerThread.h:
2101         In all these, removed storing encoding and 'inheriting' it from the parent.
2102         Instead, they are all using UTF-8 now.
2103
2104 2009-03-20  Timothy Hatcher  <timothy@apple.com>
2105
2106         Change how threading exceptions are checked so they are reported
2107         by what round they were added. That way WebKit can decided the
2108         behavior per-round based on linked-on-or-after checks.
2109
2110         <rdar://problem/6626741&6648478&6635474&6674079>
2111
2112         Reviewed by Darin Adler.
2113
2114         * WebCore.base.exp: Export the new symbols.
2115         * bindings/objc/DOMAbstractView.mm: Use the new WebCoreThreadViolationCheckRoundOne macro.
2116         * bindings/scripts/CodeGeneratorObjC.pm: Ditto.
2117         * platform/ThreadCheck.h:
2118         * platform/mac/ThreadCheck.mm:
2119         (WebCore::readThreadViolationBehaviorFromUserDefaults): Refactor how the default is read.
2120         (WebCore::setDefaultThreadViolationBehavior): Take a round argument.
2121         (WebCore::reportThreadViolation): Ditto.
2122         (WebCoreReportThreadViolation): Ditto.
2123
2124 2009-03-20  Geoffrey Garen  <ggaren@apple.com>
2125
2126         Reviewed by Sam Weinig.
2127
2128         Fixed up an out-of-date comment.
2129
2130         * bindings/js/JSDOMWindowCustom.h:
2131         (WebCore::JSDOMWindow::customPut):
2132
2133 2009-03-20  Beth Dakin  <bdakin@apple.com>
2134
2135         Reviewed by Dave Hyatt.
2136
2137         Fix for https://bugs.webkit.org/show_bug.cgi?id=20909 REGRESSION 
2138         (r35318): A press release at pfizer.com does not display correctly
2139         - and corresponding -
2140         <rdar://problem/6680073>
2141
2142         * rendering/RenderObject.cpp:
2143         (WebCore::RenderObject::invalidateContainerPrefWidths):
2144         * rendering/RenderObject.h:
2145         (WebCore::RenderObject::markContainingBlocksForLayout):
2146
2147 2009-03-20  Eric Seidel  <eric@webkit.org>
2148
2149         Reviewed by Justin Garcia.
2150
2151         maxDeepOffset is confusing and should be removed
2152         https://bugs.webkit.org/show_bug.cgi?id=24586
2153
2154         Abstract some hard-to-read (but shared) logic into a new renderedAsNonInlineTableOrHR function.
2155         Add first/lastDeepEditingPositionForNode Position creation functions
2156         and deploy them to places we used to call maxDeepOffset.
2157
2158         Rename Position::atStart and atEnd to atStartOfTree atEndOfTree
2159         Add a new Position::atFirst/atLastEditingPositionForNode() and use these
2160         to replace a few more callers for maxDeepOffset()
2161         
2162         Rename maxDeepOffset to lastEditingOffsetForNode (so that we mere mortals have some clue what it does)
2163
2164         "Editing positions" are confusing because they have one
2165         of two behaviors, depending on if the container node is ignored
2166         by editing (if editingIgnoresContent(node) returns true) or not.
2167         Positions referring to nodes ignored by editing are
2168         neighbor-relative (they are before or after the node) where as
2169         positions reffering to other nodes are container-relative
2170         (they are between two child nodes of the container, identified
2171         by the offset() member).  I will be fixing this confusion in
2172         future patches.  These renames hopefully make the current behavior clearer.
2173
2174         * dom/Position.cpp:
2175         (WebCore::Position::previous):
2176         (WebCore::Position::next):
2177         (WebCore::Position::atFirstEditingPositionForNode):
2178         (WebCore::Position::atLastEditingPositionForNode):
2179         (WebCore::Position::atStartOfTree):
2180         (WebCore::Position::atEndOfTree):
2181         (WebCore::Position::previousCharacterPosition):
2182         (WebCore::Position::nextCharacterPosition):
2183         (WebCore::Position::upstream):
2184         (WebCore::Position::isCandidate):
2185         (WebCore::firstDeepEditingPositionForNode):
2186         (WebCore::lastDeepEditingPositionForNode):
2187         * dom/Position.h:
2188         * dom/PositionIterator.cpp:
2189         (WebCore::PositionIterator::operator Position):
2190         (WebCore::PositionIterator::increment):
2191         (WebCore::PositionIterator::decrement):
2192         (WebCore::PositionIterator::atEnd):
2193         (WebCore::PositionIterator::atEndOfNode):
2194         * editing/CompositeEditCommand.cpp:
2195         (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
2196         * editing/DeleteSelectionCommand.cpp:
2197         (WebCore::isTableCellEmpty):
2198         (WebCore::DeleteSelectionCommand::removeNode):
2199         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
2200         * editing/Editor.cpp:
2201         (WebCore::Editor::advanceToNextMisspelling):
2202         * editing/InsertLineBreakCommand.cpp:
2203         (WebCore::InsertLineBreakCommand::doApply):
2204         * editing/InsertListCommand.cpp:
2205         (WebCore::InsertListCommand::doApply):
2206         * editing/ReplaceSelectionCommand.cpp:
2207         (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent):
2208         * editing/TypingCommand.cpp:
2209         (WebCore::TypingCommand::forwardDeleteKeyPressed):
2210         * editing/VisiblePosition.cpp:
2211         (WebCore::VisiblePosition::previous):
2212         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
2213         (WebCore::VisiblePosition::left):
2214         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
2215         (WebCore::VisiblePosition::right):
2216         * editing/VisibleSelection.cpp:
2217         (WebCore::VisibleSelection::selectionFromContentsOfNode):
2218         (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries):
2219         * editing/htmlediting.cpp:
2220         (WebCore::nextVisuallyDistinctCandidate):
2221         (WebCore::previousVisuallyDistinctCandidate):
2222         (WebCore::firstEditablePositionAfterPositionInRoot):
2223         (WebCore::lastEditablePositionBeforePositionInRoot):
2224         (WebCore::lastOffsetForEditing):
2225         (WebCore::isFirstPositionAfterTable):
2226         (WebCore::isLastPositionBeforeTable):
2227         (WebCore::positionBeforeNode):
2228         (WebCore::positionAfterNode):
2229         (WebCore::enclosingEmptyListItem):
2230         (WebCore::caretMaxOffset):
2231         * editing/htmlediting.h:
2232         * editing/visible_units.cpp:
2233         (WebCore::renderedAsNonInlineTableOrHR):
2234         (WebCore::startOfParagraph):
2235         (WebCore::endOfParagraph):
2236         (WebCore::startOfEditableContent):
2237         (WebCore::endOfEditableContent):
2238         * page/AccessibilityObject.cpp:
2239         (WebCore::endOfStyleRange):
2240         * page/AccessibilityRenderObject.cpp:
2241         (WebCore::AccessibilityRenderObject::visiblePositionRange):
2242         * rendering/RenderBox.cpp:
2243         (WebCore::RenderBox::positionForPoint):
2244
2245 2009-03-20  Dmitry Titov  <dimich@chromium.org>
2246
2247         Reviewed by Dimitri Glazkov.
2248
2249         https://bugs.webkit.org/show_bug.cgi?id=24689
2250         Add (upstream) V8 bindings for Workers. Mostly style cleaning.
2251
2252         * bindings/v8/WorkerContextExecutionProxy.cpp: Added.
2253         * bindings/v8/WorkerContextExecutionProxy.h: Added.
2254         * bindings/v8/WorkerScriptController.cpp: Added.
2255         * bindings/v8/WorkerScriptController.h: Added.
2256         * bindings/v8/V8Index.h: Added. This is just a wrapper for v8_index.h, like V8Proxy.h
2257         * bindings/v8/V8Proxy.h: Added domObjectMap() function that wraps GetDOMObjectMap().
2258         * bindings/v8/V8WorkerContextEventListener.cpp:
2259         (WebCore::V8WorkerContextEventListener::callListenerFunction): TrackEvent() renamed trackEvent()
2260
2261 2009-03-20  Stephen White  <senorblanco@chromium.org>
2262
2263         Reviewed by Eric Seidel.
2264
2265         Fix for LayoutTests/fast/canvas/canvas-text-alignment.html
2266         on chromium/skia.  The problem was that the gradient matrix
2267         for text was being applied twice.  Fixed by reverting some of
2268         https://bugs.webkit.org/show_bug.cgi?id=23957, so that skiaDrawText
2269         is no longer responsible for measuring the text and scaling up
2270         the gradient matrix.  Instead, the text bounding box is passed
2271         in from SVGPaintServerGradient.  I didn't make this change for CG,
2272         since it uses a different method (the gradient is drawn using the
2273         text as a pre-rendered mask).
2274         https://bugs.webkit.org/show_bug.cgi?id=24687
2275
2276         * platform/graphics/skia/SkiaFontWin.cpp:
2277         (WebCore::skiaDrawText):
2278         * svg/graphics/SVGPaintServerGradient.cpp:
2279         (WebCore::SVGPaintServerGradient::setup):
2280
2281 2009-03-20  Xan Lopez  <xlopez@igalia.com>
2282
2283         Rubber-stamped by Holger Freyther.
2284
2285         There seems to be some rounding error in cairo (or in how we use
2286         cairo) with some fonts, like DejaVu Sans Mono, which makes cairo
2287         report a height smaller than ascent + descent, which is wrong and
2288         confuses WebCore's layout system. Workaround this while we figure
2289         out what's going on.
2290
2291         * platform/graphics/gtk/SimpleFontDataGtk.cpp:
2292         (WebCore::SimpleFontData::platformInit):
2293         * platform/graphics/gtk/SimpleFontDataPango.cpp:
2294         (WebCore::SimpleFontData::platformInit):
2295
2296 2009-03-19  Alexey Proskuryakov  <ap@webkit.org>
2297
2298         Reviewed by Darin Adler.
2299
2300         https://bugs.webkit.org/show_bug.cgi?id=24122
2301         <rdar://problem/6674179>
2302         REGRESSION: DOM Range extractContents/deleteContents failures seen on Moxiecode tests
2303
2304         Test: fast/dom/Range/deleted-range-endpoints.html
2305
2306         * dom/Range.cpp: (WebCore::Range::processContents): Set the final range in accordance
2307         to the specification.
2308
2309 2009-03-19  Anders Carlsson  <andersca@apple.com>
2310
2311         Reviewed by Dan Bernstein.
2312
2313         <rdar://problem/6682554> Flash content not being rendered (Shockwave Flash 10.0 r22)
2314         
2315         If calling updateWidget for some reason resulted in another widget being added to m_widgetUpdateSet, then
2316         that object would never be updated.
2317         
2318         * page/FrameView.cpp:
2319         (WebCore::FrameView::updateWidgets):
2320         Factor the widget updating code out into this method. Return true if the update set is empty.
2321         
2322         (WebCore::FrameView::performPostLayoutTasks):
2323         Loop over the update set multiple times until all widgets have been updated or until we reach the cap.
2324         
2325         * page/FrameView.h:
2326
2327 2009-03-18  Timothy Hatcher  <timothy@apple.com>
2328
2329         Make the defered data loading timer honor the Page's scheduled runloop pairs.
2330         Introduces a new RunLoopTimer class that has an API mimicking Timer but
2331         allows it to be scheduled with one or more SchedulePairs.
2332
2333         <rdar://problem/6687342> -[WebView scheduleInRunLoop:forMode:] has no affect on timers
2334
2335         Reviewed by Darin Adler.
2336
2337         * WebCore.xcodeproj/project.pbxproj: Adds the new RunLoopTimer.{cpp,h} files.
2338         * loader/MainResourceLoader.cpp:
2339         (WebCore::MainResourceLoader::handleDataLoadNow): Use the MainResourceLoaderTimer typedef.
2340         (WebCore::MainResourceLoader::startDataLoadTimer): Added. Start the timer and on
2341         Mac platforms also schedule with the Page's SchedulePairs.
2342         (WebCore::MainResourceLoader::handleDataLoadSoon): Call startDataLoadTimer().
2343         (WebCore::MainResourceLoader::setDefersLoading): Ditto.
2344         * loader/MainResourceLoader.h:
2345         * platform/cf/RunLoopTimerCF.cpp: Added.
2346         (WebCore::RunLoopTimerBase::~RunLoopTimerBase):
2347         (WebCore::timerFired):
2348         (WebCore::RunLoopTimerBase::start):
2349         (WebCore::RunLoopTimerBase::schedule):
2350         (WebCore::RunLoopTimerBase::stop):
2351         (WebCore::RunLoopTimerBase::isActive):
2352         * platform/RunLoopTimer.h: Added.
2353         (WebCore::RunLoopTimerBase::RunLoopTimerBase):
2354         (WebCore::RunLoopTimerBase::startRepeating):
2355         (WebCore::RunLoopTimerBase::startOneShot):
2356         (WebCore::RunLoopTimer::RunLoopTimer):
2357         (WebCore::RunLoopTimer::fired):
2358
2359 2009-03-19  Dimitri Glazkov  <dglazkov@chromium.org>
2360
2361         Reviewed by Darin Fisher.
2362
2363         https://bugs.webkit.org/show_bug.cgi?id=24702
2364         Upstream miscellaneous bindings changes.
2365
2366         * bindings/v8/ScheduledAction.cpp:
2367         (WebCore::ScheduledAction::execute): Changed to call lower-case evaluate.
2368         * bindings/v8/ScriptCallStack.h: Added an extra include.
2369
2370 2009-03-19  Simon Fraser  <simon.fraser@apple.com>
2371
2372         Reviewed by Dave Hyatt
2373
2374         https://bugs.webkit.org/show_bug.cgi?id=24686
2375         
2376         When hit testing a RenderLayer whose parent lives in a preserves-3D hierarchy,
2377         we need to compare the computed z-offset with the depth-test z-offset before
2378         deciding that such a RenderLayer was hit. This fixes an issue, tested by the
2379         3d-point-mapping-overlapping.html test, where the child of a transformed element
2380         is found by hit testing, even when some other element with greater Z overlaps
2381         them both.
2382         
2383         Improved the code by adding a utility method, isHitCandidate(), which computes and tests
2384         z-depth when necessary.
2385
2386         Tests: transforms/3d/point-mapping/3d-point-mapping-coplanar.html
2387                transforms/3d/point-mapping/3d-point-mapping-overlapping.html
2388
2389         * rendering/RenderLayer.cpp:
2390         (WebCore::isHitCandidate):
2391         (WebCore::RenderLayer::hitTestLayer):
2392
2393 2009-03-19  Jeremy Moskovich  <jeremy@chromium.org>
2394
2395         Reviewed by Dimitri Glazkov.
2396
2397         https://bugs.webkit.org/show_bug.cgi?id=24456
2398         Split ColorChromium.cpp into Mac & Windows variants.
2399         Remove Chromium Dependency on platform/graphics/mac/ColorMac.mm since we
2400         ultimately need to take a different approach.  For now, createCGColor()
2401         is copied from ColorMac.mm.
2402
2403         No observable change in behavior, so no test.
2404
2405         * platform/graphics/chromium/ColorChromium.cpp:
2406         (WebCore::focusRingColor):
2407         * platform/graphics/chromium/ColorChromiumMac.mm: Added.
2408
2409 2009-03-19  Pavel Feldman  <pfeldman@chromium.org>
2410
2411         Reviewed by Dimitri Glazkov.
2412
2413         https://bugs.webkit.org/show_bug.cgi?id=24675
2414         Unforking frontend: add custom InspectorController methods
2415         implementation.
2416
2417         * bindings/v8/custom/V8InspectorControllerCustom.cpp: Added.
2418
2419 2009-03-19  Jay Campan  <jcampan@google.com>
2420
2421         Reviewed by Dimitri Glazkov.
2422
2423         https://bugs.webkit.org/show_bug.cgi?id=24625
2424         Adding an accessor to the currently selected index in the PopupMenuChromium.
2425         This is required for implementing the deletion of an autocomplete entry in Chromium.
2426
2427         * platform/chromium/PopupMenuChromium.cpp:
2428         (WebCore::PopupContainer::selectedIndex):
2429         * platform/chromium/PopupMenuChromium.h:
2430
2431 2009-03-19  Evan Stade  <estade@chromium.org>
2432
2433         Reviewed by Dimitri Glazkov.
2434
2435         https://bugs.webkit.org/show_bug.cgi?id=24526
2436         Improve windows skia text stroking.
2437
2438         Test: LayoutTests/svg/custom/struct-use-09-b.svg
2439
2440         * platform/graphics/skia/SkiaFontWin.cpp: Close the path representing
2441         each font glyph polygon, rather than only closing the path once per
2442         letter. This fixes stroking for letters with multiple polygons, such
2443         as 'A' or 'D'.
2444         (WebCore::getPathForGlyph):
2445         (WebCore::skiaDrawText):
2446
2447 2009-03-19  Simon Hausmann  <simon.hausmann@nokia.com>
2448
2449         Reviewed by Tor Arne Vestbø.
2450
2451         Fixed support for doing calls from JavaScript into NPAPI Plugins for the Qt port on Windows.
2452
2453         Removed dead code for distinguishing between Widget and PluginView in the Qt port.
2454
2455         * bindings/js/ScriptControllerQt.cpp:
2456         (WebCore::ScriptController::createScriptInstanceForWidget): Removed incorrect isNPAPI check.
2457         * plugins/PluginView.cpp:
2458         (WebCore::PluginView::PluginView): Removed m_isNPAPIPlugin variable.
2459         * plugins/PluginView.h: Removed setter/getter.
2460         * plugins/mac/PluginViewMac.cpp:
2461         (WebCore::PluginView::init): Removed call to setIsNPAPIPlugin.
2462         * plugins/qt/PluginViewQt.cpp:
2463         (WebCore::PluginView::init): Ditto.
2464
2465 2009-03-19  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2466
2467         Reviewed by Oliver Hunt.
2468
2469         Bug 24596: ASSERT in JSC::PropertySlot::slotBase @ iGoogle homepage
2470         <https://bugs.webkit.org/show_bug.cgi?id=24596>
2471         <rdar://problem/6686493>
2472
2473         JSDOMWindow::customGetOwnPropertySlot() does an access check after calling
2474         JSGlobalObject::getOwnPropertySlot(). This causes the PropertySlot to be
2475         set twice, once to the value that is illegal to access, and then to undefined
2476         This causes an assertion failure in property access caching code.
2477
2478         The fix is to do the access check before calling JSGlobalObject::getOwnPropertySlot().
2479
2480         * bindings/js/JSDOMWindowCustom.h:
2481         (WebCore::JSDOMWindow::customGetOwnPropertySlot):
2482
2483 2009-03-18  Alexey Proskuryakov  <ap@webkit.org>
2484
2485         Reviewed by Sam Weinig.
2486
2487         https://bugs.webkit.org/show_bug.cgi?id=24676
2488         Simple cross-origin requests shouldn't dispatch upload progress events
2489
2490         Test: http/tests/xmlhttprequest/simple-cross-origin-progress-events.html
2491
2492         * loader/CrossOriginAccessControl.cpp: (WebCore::passesAccessControlCheck): Added a comment
2493         explaining the somewhat unexpected behavior of this function.
2494
2495         * xml/XMLHttpRequestUpload.cpp: (WebCore::XMLHttpRequestUpload::hasListeners):
2496         * xml/XMLHttpRequestUpload.h:
2497         Report whether there are any event listeners registered.
2498
2499         * xml/XMLHttpRequest.h: Added m_uploadEventsAllowed.
2500
2501         * xml/XMLHttpRequest.cpp:
2502         (WebCore::XMLHttpRequest::createRequest): Set m_uploadEventsAllowed flag.
2503         (WebCore::XMLHttpRequest::makeSameOriginRequest): Ditto.
2504         (WebCore::XMLHttpRequest::makeCrossOriginAccessRequest): Ditto.
2505         (WebCore::XMLHttpRequest::makeSimpleCrossOriginAccessRequest): Set request body - it can be
2506         non-empty for POST requests.
2507         (WebCore::XMLHttpRequest::makeCrossOriginAccessRequestWithPreflight): Set m_uploadEventsAllowed flag.
2508         (WebCore::XMLHttpRequest::handleAsynchronousPreflightResult): Ditto.
2509         (WebCore::XMLHttpRequest::abort): Only dispatch upload progress events if allowed.
2510         (WebCore::XMLHttpRequest::networkError): Ditto.
2511         (WebCore::XMLHttpRequest::abortError): Ditto.
2512         (WebCore::XMLHttpRequest::didSendData): Ditto.
2513
2514 2009-03-18  Marc-Antoine Ruel  <maruel@chromium.org>
2515
2516         Reviewed by Darin Fisher.
2517
2518         https://bugs.webkit.org/show_bug.cgi?id=24398
2519         Fix a crash when loading a svg file in Chromium's test_shell and
2520         then reloading the page.
2521
2522         * history/BackForwardListChromium.cpp:
2523         (WebCore::BackForwardList::BackForwardList):
2524         (WebCore::BackForwardList::close):
2525
2526 2009-03-18  Eric Carlson  <eric.carlson@apple.com>
2527
2528         Reviewed by Simon Fraser.
2529
2530         Fix for <rdar://problem/6685235>
2531         <video> element poster cannot be set dynamically if not originally set up in HTML
2532         
2533         Allocate the media engine immediately so the plug-in proxy is available for
2534         scripting right away.
2535
2536         * platform/graphics/MediaPlayer.cpp:
2537         (WebCore::MediaPlayer::MediaPlayer):
2538
2539 2009-03-18  Beth Dakin  <bdakin@apple.com>
2540
2541         Reviewed by Dave Hyatt.
2542
2543         Fix for <rdar://problem/6636747> REGRESSION (Safari 4 PB-r41326): 
2544         Popup menu appears at the wrong location on page at http://
2545         www.signonsandiego.com/
2546
2547         This was a regression from http://trac.webkit.org/changeset/40769, 
2548         which changed the base class of RenderInline to 
2549         RenderBoxModelObject rather than RenderBox.
2550
2551         * rendering/RenderObject.cpp:
2552         (WebCore::RenderObject::offsetParent): offsetParent should return a 
2553         RenderBoxModelObject rather than just a RenderBox, which is more 
2554         restrictive. 
2555
2556 2009-03-18  Anders Carlsson  <andersca@apple.com>
2557
2558         Reviewed by Darin Adler.
2559
2560         <rdar://problem/6504776> 
2561         CrashTracer: [USER] 188 crashes in Safari at com.apple.WebCore • WTF::HashTableIterator<WTF::RefPtr<WebCore::ResourceLoader>, ...
2562
2563         Return early in case calling the client ends up spinning the run loop and completing/cancelling the load.
2564         
2565         * loader/NetscapePlugInStreamLoader.cpp:
2566         (WebCore::NetscapePlugInStreamLoader::didCancel):
2567
2568 2009-03-18  David Levin  <levin@chromium.org>
2569
2570         Reviewed by Dimitri Glazkov.
2571
2572         https://bugs.webkit.org/show_bug.cgi?id=24664
2573         Upstreaming v8 collection.h
2574
2575         No change in behavior, so no test.
2576
2577         * bindings/v8/V8Collection.h: Added.
2578
2579 2009-03-18  Sam Weinig  <sam@webkit.org>
2580
2581         Reviewed by Simon Fraser.
2582
2583         Fix for https://bugs.webkit.org/show_bug.cgi?id=23966
2584         REGRESSION: Custom arrow navigation functionality doesn't work at dropular.net
2585         <rdar://problem/6589657>
2586
2587         Match the CSSOM spec for getClientRects and getBoundingClientRect by
2588         returning a 0x0 rect at the correct top/left position for empty inline
2589         boxes.
2590
2591         * rendering/RenderInline.cpp:
2592         (WebCore::RenderInline::absoluteRects):
2593         (WebCore::RenderInline::absoluteQuads):
2594
2595 2009-03-18  David Levin  <levin@chromium.org>
2596
2597         Reviewed by Eric Seidel.
2598
2599         Match the changes done for windows in the bug
2600         https://bugs.webkit.org/show_bug.cgi?id=24530.
2601
2602         No change in behavior, so no test.
2603
2604         * rendering/RenderThemeChromiumLinux.cpp:
2605         (WebCore::RenderThemeChromiumLinux::extraDefaultStyleSheet):
2606
2607 2009-03-18  Dirk Schulze  <krit@webkit.org>
2608
2609         Reviewed by Holger Freyther.
2610
2611         Added support for SVG's stroked texts to Qt.
2612
2613         [Qt] SVGs stroked text support missing
2614         https://bugs.webkit.org/show_bug.cgi?id=24262
2615
2616         * platform/graphics/qt/FontQt.cpp:
2617         (WebCore::Font::drawComplexText):
2618
2619 2009-03-18  Mark Rowe  <mrowe@apple.com>
2620
2621         Reviewed by Alexey Proskuryakov.
2622
2623         Fix fast/encoding/char-decoding.html with recent ICU.
2624
2625         * platform/text/TextCodecICU.cpp:
2626         (WebCore::TextCodecICU::decode): Look for gb18030 case-insensitively,
2627         as newer versions of ICU use GB18030 as the canonical name.
2628
2629 2009-03-17  David Levin  <levin@chromium.org>
2630
2631         Reviewed by Dimitri Glazkov.
2632
2633         https://bugs.webkit.org/show_bug.cgi?id=24662
2634         Chromium build fixes.
2635
2636         Bug https://bugs.webkit.org/show_bug.cgi?id=24663 tracks
2637         the invalid implementation of ScriptCallStack.
2638
2639         No change in behavior, so no test.
2640
2641         * bindings/v8/ScriptCallStack.h:
2642         (WebCore::ScriptCallStack::state):
2643         * platform/graphics/skia/PlatformContextSkia.cpp:
2644         (PlatformContextSkia::drawRect):
2645
2646 2009-03-17  David Carson  <dacarson@apple.com>
2647
2648         Reviewed by David Hyatt.
2649
2650         Add anchor elements to the simple style sheet so that applications that 
2651         are using WebKit just for simple text and links will also take advantage
2652         of the fast path.
2653
2654         * css/CSSStyleSelector.cpp:
2655         (WebCore::elementCanUseSimpleDefaultStyle):
2656
2657 2009-03-17  Darin Adler  <darin@apple.com>
2658
2659         Reviewed by Adele Peterson.
2660
2661         <rdar://problem/6687005> Need support for new move-left/right selectors.
2662
2663         * editing/EditorCommand.cpp:
2664         (WebCore::executeMoveToLeftEndOfLine): Added.
2665         (WebCore::executeMoveToLeftEndOfLineAndModifySelection): Added.
2666         (WebCore::executeMoveToRightEndOfLine): Added.
2667         (WebCore::executeMoveToRightEndOfLineAndModifySelection): Added.
2668         Added command entries for the functions above.
2669
2670 2009-03-17  Ojan Vafai  <ojan@chromium.org>
2671
2672         Reviewed by Adele Peterson.
2673
2674         Put the padding inside scrollbars on textareas.
2675         https://bugs.webkit.org/show_bug.cgi?id=24370
2676         
2677         Put the padding inside the scrollbars on textareas. This is done by moving the
2678         overflow from the shadowNode to the RenderTextControlMultiline. As a result,
2679         all of the scroll handing methods that RenderTextControl overrides can be moved
2680         down into RenderTextControlSingleLine since RenderTextControlMultiline can now
2681         just use RenderBlock's versions. This also allows RenderTextControlMultiLine to
2682         no longer need a custom layout method since the shadowNode can now just size
2683         like a regular DIV.
2684
2685         * css/CSSStyleSelector.cpp:
2686         (WebCore::CSSStyleSelector::adjustRenderStyle):
2687         * rendering/RenderTextControl.cpp:
2688         (WebCore::RenderTextControl::styleDidChange):
2689         (WebCore::RenderTextControl::selection):
2690         (WebCore::RenderTextControl::calcHeight):
2691         (WebCore::RenderTextControl::hitInnerTextElement):
2692         * rendering/RenderTextControl.h:
2693         * rendering/RenderTextControlMultiLine.cpp:
2694         (WebCore::RenderTextControlMultiLine::nodeAtPoint):
2695         (WebCore::RenderTextControlMultiLine::createInnerTextStyle):
2696         * rendering/RenderTextControlMultiLine.h:
2697         * rendering/RenderTextControlSingleLine.cpp:
2698         (WebCore::RenderTextControlSingleLine::styleDidChange):
2699         (WebCore::RenderTextControlSingleLine::autoscroll):
2700         (WebCore::RenderTextControlSingleLine::scrollWidth):
2701         (WebCore::RenderTextControlSingleLine::scrollHeight):
2702         (WebCore::RenderTextControlSingleLine::scrollLeft):
2703         (WebCore::RenderTextControlSingleLine::scrollTop):
2704         (WebCore::RenderTextControlSingleLine::setScrollLeft):
2705         (WebCore::RenderTextControlSingleLine::setScrollTop):
2706         (WebCore::RenderTextControlSingleLine::scroll):
2707         * rendering/RenderTextControlSingleLine.h:
2708         * rendering/TextControlInnerElements.cpp:
2709         (WebCore::RenderTextControlInnerBlock::RenderTextControlInnerBlock):
2710         (WebCore::RenderTextControlInnerBlock::positionForPoint):
2711         (WebCore::TextControlInnerTextElement::createRenderer):
2712
2713 2009-03-17  Darin Adler  <darin@apple.com>
2714
2715         Reviewed by David Hyatt.
2716
2717         Bug 24517: REGRESSION (r41552): innerHTML does an updateLayout -- unneeded and can be slow
2718         https://bugs.webkit.org/show_bug.cgi?id=24517
2719
2720         * editing/DeleteButtonController.cpp:
2721         (WebCore::DeleteButtonController::enable): Added a call to updateRendering, since
2722         determining whether to display the delete button involves style and updateRendering
2723         also updates style (should probably be named updateStyle, in fact). Not needed to fix
2724         this bug, but would have prevented the crash that led to this bug in the first place.
2725
2726         * editing/EditCommand.cpp:
2727         (WebCore::EditCommand::EditCommand): Get rid of unneeded null check. All frames have
2728         delete button controllers.
2729         * editing/Editor.cpp:
2730         (WebCore::Editor::rangeForPoint): Ditto.
2731
2732         * editing/markup.cpp:
2733         (WebCore::appendStartMarkup): Changed a "&" to a "&&" so that generating markup
2734         doesn't depend on renderers at all when the convertBlocksToInlines boolean is false.
2735         This allows us to omit the call to updateLayoutIgnorePendingStylesheets in the
2736         createMarkup function that's called by innerHTML.
2737         (WebCore::MarkupAccumulator::appendMarkup): Turned this into a class with a member
2738         function. Added a feature where the accumulator will skip a node. Moved arguments
2739         that don't change during recursion into an object. This function still is a bit
2740         inefficient, since it creates a new HashMap at every level as it recurses, but for now
2741         I did not tackle that. Also replaced the onlyIncludeChildren boolean with EChildrenOnly
2742         for consistency and clarity.
2743         (WebCore::createMarkup): Removed the call to updateLayoutIgnorePendingStylesheets.
2744         Instead of calling disable/enable on the delete button controller's container element,
2745         pass it in to the markup accumulator as a node to skip.
2746
2747 2009-03-17  Scott Violet  <sky@google.com>
2748
2749         Reviewed by Eric Seidel.
2750
2751         https://bugs.webkit.org/show_bug.cgi?id=24651
2752         Skia does not always render text fill/stroke pattern/gradient/color correctly
2753
2754         Changes Skia's font rendering to only render gradient/pattern if current
2755         color space indicates the gradient/pattern should be used.
2756         This is covered by LayoutTests/fast/canvas/canvas-text-alignment.html .
2757     
2758         * platform/graphics/GraphicsContext.cpp:
2759         (WebCore::GraphicsContext::strokeColorSpace):
2760         (WebCore::GraphicsContext::fillColorSpace):
2761         * platform/graphics/GraphicsContext.h:
2762         (WebCore::):
2763         * platform/graphics/GraphicsContextPrivate.h:
2764         * platform/graphics/skia/SkiaFontWin.cpp:
2765         (WebCore::paintSkiaText):
2766
2767 2009-03-17  Adele Peterson  <adele@apple.com>
2768
2769         Reviewed by Darin Adler.
2770
2771         Fix for https://bugs.webkit.org/show_bug.cgi?id=24655
2772         <rdar://problem/6633727> Hitting return at the end of a line with an anchor jumps me to the bottom of the message
2773
2774         Test: editing/inserting/6633727.html
2775
2776         This changes does a few things:
2777         1) Renames pos to insertionPosition.
2778         2) Eliminates "startNode".  It doesn't work well to consider the node separately from the insertionPosition.  
2779            The insertionPosition gets updated at various times, and it seems likely that startNode can get out of sync.
2780         3) Before building up a list of ancestors to move around when we insert the new block, make sure to use the deepest
2781            representation of the insertionPosition, so all ancestor nodes are correctly included.
2782
2783         * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply):
2784
2785 2009-03-17  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2786
2787         Reviewed by Kevin Ollivier.
2788
2789         https://bugs.webkit.org/show_bug.cgi?id=24115
2790         Introduce platform independent stubs for plugins.
2791
2792         * plugins/PluginDataNone.cpp: Copied from WebCore/plugins/wx/PluginDataWx.cpp.
2793         * plugins/PluginPackageNone.cpp: Copied from WebCore/plugins/wx/PluginPackageWx.cpp.
2794         * plugins/PluginViewNone.cpp: Copied from WebCore/plugins/wx/PluginViewWx.cpp.
2795         * plugins/wx/PluginDataWx.cpp: Removed.
2796         * plugins/wx/PluginPackageWx.cpp: Removed.
2797         * plugins/wx/PluginViewWx.cpp: Removed.
2798         * webcore-wx.bkl:
2799
2800 2009-03-17  Darin Adler  <darin@apple.com>
2801
2802         Earlier version reviewed by Adele Peterson.
2803
2804         Bug 24304: REGRESSION (r39864): Hitting the space bar to select an <input type=radio>
2805         or push an <input type=button> or <button> causes the page to scroll down.
2806
2807         Would be best to add a regression test for Windows eventually; tested that this has
2808         no effect on the Mac OS X platform.
2809
2810         * html/HTMLInputElement.cpp:
2811         (WebCore::HTMLInputElement::defaultEventHandler): Added FIXMEs and tweaked formatting.
2812         Use the code that calls the base class's defaultEventHandler early only in the cases
2813         where it's needed: keydown and keypress events in text fields. In other cases, do the
2814         more typical thing and call the default handler only at the end of the function.
2815         This function already had code to make sure the keypress event for space never gets
2816         through, but it was running too late since the scrolling code was moved into the
2817         base class default event handler.
2818
2819 2009-03-17  Simon Fraser  <simon.fraser@apple.com>
2820
2821         Reviewed by Dave Hyatt
2822
2823         https://bugs.webkit.org/show_bug.cgi?id=24632
2824
2825         Fix repaint issues when composited layers come and go (only applies
2826         when ACCELERATED_COMPOSITING is turned on).
2827         
2828         * rendering/RenderLayer.cpp:
2829         (WebCore::RenderLayer::RenderLayer):
2830         * rendering/RenderLayer.h:
2831         (WebCore::RenderLayer::mustOverlayCompositedLayers):
2832         (WebCore::RenderLayer::setMustOverlayCompositedLayers):
2833         * rendering/RenderLayerBacking.cpp:
2834         (WebCore::RenderLayerBacking::RenderLayerBacking):
2835         * rendering/RenderLayerBacking.h:
2836
2837         Move what used to be the 'forceCompositingLayer' flag from RenderLayerBacking
2838         to RenderLayer, because we don't want the side-effects of creating RenderLayerBacking
2839         when setting this flag.
2840         
2841         * rendering/RenderLayerCompositor.cpp:
2842         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
2843         When a RenderLayer flips into or out of compositing mode, compute a repaint
2844         rect relative to the containerForRepaint, and repaint it.
2845         
2846         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2847         Call layer->setMustOverlayCompositedLayers() rather than setForcedCompositingLayer().
2848         
2849         (WebCore::RenderLayerCompositor::needsToBeComposited):
2850         (WebCore::RenderLayerCompositor::requiresCompositingLayer):
2851         (WebCore::RenderLayerCompositor::requiresCompositingForTransform):
2852         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2853         * rendering/RenderLayerCompositor.h:
2854         
2855         Rename requiresCompositingLayerForTransform() to requiresCompositingForTransform()
2856         and make it a class static method to match requiresCompositingForAnimation(). Both
2857         now take RenderObjects, rathern than RenderLayers.
2858         
2859         * rendering/style/RenderStyle.h:
2860         (WebCore::InheritedFlags::hasTransformRelatedProperty):
2861         Minor tidyup using convenience methods added in an earlier commit.
2862
2863 2009-03-17  Simon Fraser  <simon.fraser@apple.com>
2864
2865         Reviewed by Darin Adler
2866
2867         https://bugs.webkit.org/show_bug.cgi?id=24396
2868
2869         * config.h:
2870         Add WTF_USE_ACCELERATED_COMPOSITING, defined to 0 for now, and add some
2871         comments to make the #ifdefs more readable.
2872
2873         * css/CSSComputedStyleDeclaration.cpp:
2874         (WebCore::computedTransform):
2875         Add a comment to mention that we don't flatten the matrix.
2876         
2877         * css/MediaQueryEvaluator.cpp:
2878         (WebCore::transform_3dMediaFeatureEval):
2879         Have the 'transform-3d' media query evaluate to 'true' if 3d-rendering
2880         is supported.
2881         
2882         * platform/graphics/mac/GraphicsLayerCA.mm:
2883         (WebCore::GraphicsLayerCA::animateTransform):
2884         No need for the #ifdef here. If we don't support 3d, we will have already flattened
2885         the matrix.
2886         
2887         * platform/graphics/transforms/TransformationMatrix.cpp:
2888         (WebCore::TransformationMatrix::makeAffine):
2889         * platform/graphics/transforms/TransformationMatrix.h:
2890         New method to convert the matrix to an affine matrix by throwing a way the non-affine
2891         parts.
2892         
2893         * rendering/RenderLayer.cpp:
2894         (WebCore::RenderLayer::updateTransform):
2895         (WebCore::RenderLayer::currentTransform):
2896         * rendering/RenderLayerBacking.cpp:
2897         (WebCore::RenderLayerBacking::updateLayerTransform):
2898         If 3d rendering is not supported, convert the matrix to an affine matrix
2899         which can be rendered, and used for hit testing.
2900         
2901         * rendering/RenderLayerCompositor.cpp:
2902         Change the name of the exported symbol that webkitdirs.pm uses to know if
2903         3d rendering is supported. There is no other 3d-rendering-specific symbol we can sniff.
2904         
2905         * rendering/RenderObject.cpp:
2906         (WebCore::RenderObject::transformFromContainer):
2907         Only take perspective into account if 3d rendering is supported.
2908
2909         * rendering/RenderObject.h:
2910         (WebCore::makeMatrixRenderable):
2911         Utility method that flattens a matrix if 3d rendering is not supported.
2912
2913 2009-03-17  Kevin Ollivier  <kevino@theolliviers.com>
2914
2915         wx build fix. Fix typo after mouse wheel changes.
2916
2917         * platform/wx/MouseWheelEventWx.cpp:
2918         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
2919
2920 2009-03-17  Darin Adler  <darin@apple.com>
2921
2922         * inspector/ConsoleMessage.cpp:
2923         (WebCore::ConsoleMessage::isEqual): Fix build, remove stray parenthesis.
2924
2925 2009-03-17  Darin Adler  <darin@apple.com>
2926
2927         Fix crash seen right away when running run-webkit-tests.
2928
2929         * inspector/ConsoleMessage.cpp:
2930         (WebCore::ConsoleMessage::isEqual): Restore assertion to its behavior pre-refactoring.
2931         Also tweaked formatting a bit.
2932
2933 2009-03-17  Alexey Proskuryakov  <ap@webkit.org>
2934
2935         Reviewed by Darin Adler.
2936
2937         HTMLSelectElement::add() doesn't look at exception code returned from insertBefore(), so 
2938         it doesn't need to zero it out before calling.
2939
2940         * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): Removed "ec = 0" line.
2941
2942 2009-03-17  Dan Bernstein  <mitz@apple.com>
2943
2944         Reviewed by Adam Roben.
2945
2946         - WebCore part of adding a mechanism for controlling the caching of
2947           responses through WebFrameLoaderClient
2948
2949         Mac already has such a mechanism, and this adds one for CFNetwork ports.
2950
2951         * WebCore.vcproj/WebCore.vcproj: Added EmptyClients.h
2952         and ResourceLoaderCFNet.cpp.
2953
2954         * loader/EmptyClients.h:
2955         (WebCore::EmptyFrameLoaderClient::shouldCacheResponse): Added an
2956         implementation that always returns true.
2957
2958         * loader/FrameLoaderClient.h: Declared shouldCacheResponse().
2959
2960         * loader/ResourceLoader.h: Ditto.
2961
2962         * loader/cf/ResourceLoaderCFNet.cpp: Added.
2963         (WebCore::ResourceLoader::shouldCacheResponse): Added. Calls through to
2964         FrameLoaderClient::shouldCacheResponse().
2965
2966         * platform/network/ResourceHandleClient.h:
2967         (WebCore::ResourceHandleClient::shouldCacheResponse): Added an
2968         implementation that always returns true.
2969
2970         * platform/network/cf/ResourceHandleCFNet.cpp:
2971         (WebCore::willCacheResponse): Added a call to
2972         ResourceHandleClient::shouldCacheResponse(). If the client returns
2973         false, return 0, which will prevent CFNetwork from caching the response.
2974
2975 2009-03-17  Alexey Proskuryakov  <ap@webkit.org>
2976
2977         Reviewed by Darin Adler.
2978
2979         https://bugs.webkit.org/show_bug.cgi?id=13287
2980         Cannot change SELECT to a dynamically created option
2981
2982         Tests: fast/forms/add-and-remove-option.html
2983                fast/forms/add-remove-option-modification-event.html
2984                fast/forms/add-selected-option.html
2985                fast/forms/select-cache-desynchronization.html
2986
2987         * dom/ContainerNode.cpp:
2988         (WebCore::dispatchChildInsertionEvents): Increment DOM tree version. This will happen when
2989         dispatching DOMSubtreeModified again, but the version should be incremented for event
2990         listeners to have an up to date view of the DOM.
2991         (WebCore::dispatchChildRemovalEvents): Ditto.
2992
2993         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::insertedIntoTree):
2994         Make sure that the select element knows about its new selected option.
2995
2996         * html/HTMLOptionElement.h: Use insertedIntoTree() instead of insertedIntoDocument(),
2997         because DOM also needs to be updated for forms that are not in document yet. Similar
2998         problems exist for node removing, but removedFromTree() is called at a wrong time, so
2999         those problems cannot be fixed without deeper refactoring.
3000
3001         * html/HTMLSelectElement.cpp:
3002         (WebCore::HTMLSelectElement::setRecalcListItems): Reset m_activeSelectionAnchorIndex - it
3003         doesn't make sense to keep the anchor after programmatically changing the selection, and
3004         keeping it was causing a failure in fast/forms/listbox-selection.html.
3005
3006         * html/HTMLSelectElement.h: Removed overrides for ContainerNode methods that only called
3007         base class versions.
3008
3009 2009-03-17  Steve Falkenburg  <sfalken@apple.com>
3010
3011         <rdar://problem/6690324> Accessing FTP sites reads unallocated memory, can result in garbled entries or crashes
3012         
3013         Reviewed by Darin Adler.
3014
3015         * loader/FTPDirectoryDocument.cpp:
3016         (WebCore::FTPDirectoryTokenizer::parseAndAppendOneLine): Assign CString to a local while we hold pointers into it.
3017
3018 2009-03-16  David Hyatt  <hyatt@apple.com>
3019
3020         <rdar://problem/6648411> REGRESSION: Layout of page is wrong at http://www.popcap.com/
3021
3022         Make sure that the initial shouldPaint check that looks at enclosingLayers properly skips over
3023         layers that don't paint themselves.  This is done by adding a new enclosingSelfPaintingLayer method
3024         so that RenderObjects can walk up the enclosing layer chain and skip any layers that don't paint
3025         themselves.
3026
3027         Reviewed by Darin Adler.
3028
3029         Added fast/block/float/overlapping-floats-with-overflow-hidden.html
3030
3031         * WebCore.base.exp:
3032         * rendering/RenderBlock.cpp:
3033         (WebCore::RenderBlock::addOverhangingFloats):
3034         * rendering/RenderObject.cpp:
3035         (WebCore::RenderObject::enclosingSelfPaintingLayer):
3036         * rendering/RenderObject.h:
3037
3038 2009-03-17  Xan Lopez  <xlopez@igalia.com>
3039
3040         Reviewed by Holger Freyther.
3041
3042         https://bugs.webkit.org/show_bug.cgi?id=24592
3043         [GTK] Crash in FcPatternHash
3044
3045         Style fixes.
3046
3047         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
3048         (WebCore::FontPlatformData::operator=):
3049         * platform/graphics/gtk/FontPlatformDataPango.cpp:
3050
3051 2009-03-17  Xan Lopez  <xlopez@igalia.com>
3052
3053         Reviewed by Holger Freyther.
3054
3055         https://bugs.webkit.org/show_bug.cgi?id=24592
3056         [GTK] Crash in FcPatternHash
3057
3058         Sanitize memory management in pango fonts.
3059
3060         Release memory allocated by FontPlatformDataPango in its own
3061         destructor instead of doing it from other classes, and add copy
3062         constructor and '=' operator to be able to track referenced
3063         objects properly.
3064
3065         * platform/graphics/gtk/FontPlatformDataPango.cpp:
3066         (WebCore::FontPlatformData::~FontPlatformData):
3067         (WebCore::FontPlatformData::operator=):
3068         (WebCore::FontPlatformData::FontPlatformData):
3069         * platform/graphics/gtk/SimpleFontDataPango.cpp:
3070
3071 2009-03-17  Darin Adler  <darin@apple.com>
3072
3073         Reviewed by Alexey Proskuryakov.
3074
3075         Bug 24624: Crash in imageLoadEventTimerFired after adoptNode used on <img>,
3076         seen with inspector, which uses adoptNode
3077         https://bugs.webkit.org/show_bug.cgi?id=24624
3078         rdar://problem/6422850
3079
3080         Test: fast/dom/HTMLImageElement/image-load-cross-document.html
3081
3082         * dom/Document.cpp:
3083         (WebCore::Document::Document): Removed m_imageLoadEventTimer.
3084         (WebCore::Document::detach): Removed m_imageLoadEventDispatchSoonList and
3085         m_imageLoadEventDispatchingList.
3086         (WebCore::Document::implicitClose): Called ImageLoader::dispatchPendingLoadEvents
3087         instead of dispatchImageLoadEventsNow.
3088
3089         * dom/Document.h: Removed ImageLoader, dispatchImageLoadEventSoon,
3090         dispatchImageLoadEventsNow, removeImage, m_imageLoadEventDispatchSoonList,
3091         m_imageLoadEventDispatchingList, m_imageLoadEventTimer, and imageLoadEventTimerFired.
3092
3093         * loader/ImageLoader.cpp:
3094         (WebCore::loadEventSender): Added. Returns the single global ImageLoadEventSender
3095         object used privately as the target of the load event timer.
3096         (WebCore::ImageLoader::~ImageLoader): Call ImageLoadEventSender::cancelLoadEvent
3097         rather than Document::removeImage.
3098         (WebCore::ImageLoader::setImage): Use m_element directly, not element().
3099         (WebCore::ImageLoader::updateFromElement): Ditto. Also name the local variable
3100         document instead of doc.
3101         (WebCore::ImageLoader::notifyFinished): Call ImageLoadEventSender::dispatchLoadEventSoon
3102         rather than Document::dispatchImageLoadEventSoon.
3103         (WebCore::ImageLoader::dispatchPendingLoadEvent): Added. Handles the common logic
3104         about when load events can be dispatched so that dispatchLoadEvent only has to
3105         have the specific part for each derived class. This includes a check that the
3106         document is attached, which used to be handled by having documents empty out the
3107         image load event vectors in the detach function.
3108         (WebCore::ImageLoader::dispatchPendingLoadEvents): Added. Calls the appropriate
3109         function on the ImageLoadEventSender, which avoids the need to have that class be
3110         public in the ImageLoader header.
3111         (WebCore::ImageLoadEventSender::ImageLoadEventSender): Added. Has the code that
3112         was previously in the Document constructor.
3113         (WebCore::ImageLoadEventSender::dispatchLoadEventSoon): Added. Has the code that
3114         was previously in Document::dispatchImageLoadEventSoon.
3115         (WebCore::ImageLoadEventSender::cancelLoadEvent): Added. Has the code that was
3116         previously in Document::removeImage.
3117         (WebCore::ImageLoadEventSender::dispatchPendingLoadEvents): Added. Has the code
3118         that was previously in Document::dispatchImageLoadEventsNow.
3119         (WebCore::ImageLoadEventSender::timerFired): Added. Calls dispatchPendingLoadEvents.
3120
3121         * loader/ImageLoader.h: Improved comments. Made the virtual functions private
3122         or protected rather than public. Added static dispatchPendingLoadEvents function
3123         for use by Document and private dispatchPendingLoadEvent function for use by
3124         ImageLoadEventSender. Made setLoadingImage private and eliminated
3125         setHaveFiredLoadEvent since that can all be done inside the class without any
3126         member functions.
3127
3128         * html/HTMLImageLoader.cpp:
3129         (WebCore::HTMLImageLoader::dispatchLoadEvent): Removed logic to check whether a
3130         load event already fired and whether image() is 0. These are now both base class
3131         responsibilities.
3132         * svg/SVGImageLoader.cpp:
3133         (WebCore::SVGImageLoader::dispatchLoadEvent): Ditto.
3134         * wml/WMLImageLoader.cpp:
3135         (WebCore::WMLImageLoader::dispatchLoadEvent): Ditto.
3136
3137 2009-03-17  Dimitri Glazkov  <dglazkov@chromium.org>
3138
3139         Reviewed by Timothy Hatcher.
3140
3141         https://bugs.webkit.org/show_bug.cgi?id=24623
3142         Refactor ConsoleMessage to use ScriptFuncitonCall and eliminate JSC
3143         dependencies.
3144
3145         * bindings/js/ScriptFunctionCall.cpp:
3146         (WebCore::ScriptFunctionCall::appendArgument): Added uint and ScriptString-taking methods.
3147         * bindings/js/ScriptFunctionCall.h:
3148         * bindings/js/ScriptObjectQuarantine.cpp:
3149         (WebCore::quarantineValue): Added generic ScriptValue quarantine helper.
3150         * bindings/js/ScriptObjectQuarantine.h:
3151         * bindings/js/ScriptValue.cpp:
3152         (WebCore::ScriptValue::isEqual): Added.
3153         * bindings/js/ScriptValue.h:
3154         * inspector/ConsoleMessage.cpp:
3155         (WebCore::ConsoleMessage::ConsoleMessage):
3156         (WebCore::ConsoleMessage::addToConsole): Added.
3157         (WebCore::ConsoleMessage::isEqual): Changed to use ScriptValue::isEqual.
3158         * inspector/ConsoleMessage.h:
3159         (WebCore::ConsoleMessage::incrementCount): Added.
3160         * inspector/InspectorController.cpp:
3161         (WebCore::InspectorController::addConsoleMessage): Changed to use ConsoleMessage::addToConsole.
3162         (WebCore::InspectorController::populateScriptObjects): Ditto.
3163         * inspector/InspectorController.h:
3164
3165 2009-03-17  Kevin Ollivier  <kevino@theolliviers.com>
3166
3167         Reviewed by Mark Rowe.
3168
3169         Get BUILDING_ON_* defines from Platform.h.
3170         
3171         https://bugs.webkit.org/show_bug.cgi?id=24630
3172
3173         * WebCorePrefix.h:
3174
3175 2009-03-16  Xan Lopez  <xlopez@igalia.com>
3176
3177         Reviewed by Holger Freyther.
3178
3179         https://bugs.webkit.org/show_bug.cgi?id=24592
3180         [GTK] Crash in FcPatternHash
3181
3182         Sanitize memory management in gtk fonts.
3183
3184         Release memory allocated by FontPlatformDataGtk in its own
3185         destructor instead of doing it from other classes, and add copy
3186         constructor and '=' operator to be able to track referenced
3187         objects properly.
3188
3189         * platform/graphics/gtk/FontPlatformData.h:
3190         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
3191         (WebCore::FontPlatformData::operator=):
3192         (WebCore::FontPlatformData::FontPlatformData):
3193         (WebCore::FontPlatformData::~FontPlatformData):
3194         * platform/graphics/gtk/SimpleFontDataGtk.cpp:
3195         (WebCore::SimpleFontData::platformDestroy):
3196
3197 2009-03-17  Ariya Hidayat  <ariya.hidayat@nokia.com>
3198
3199         Build fix for Qt < 4.5.
3200
3201         As reported by Yael Aharon  <yael.aharon@nokia.com>
3202
3203         * platform/graphics/qt/GraphicsContextQt.cpp:
3204         (WebCore::GraphicsContext::drawLine):
3205
3206 2009-03-17  Alexey Proskuryakov  <ap@webkit.org>
3207
3208         Reviewed by Sam Weinig.
3209
3210         https://bugs.webkit.org/show_bug.cgi?id=24614
3211         Access control checks are different in cached and uncached cases
3212
3213         Test: http/tests/xmlhttprequest/access-control-basic-non-simple-deny-cached.html
3214
3215         * loader/CrossOriginAccessControl.cpp:
3216         (WebCore::isOnAccessControlSimpleRequestMethodWhitelist): Factored out simple method
3217         check for use in both cached and uncached cases. In cached case, an old definition that
3218         omitted HEAD was still used.
3219         (WebCore::isOnAccessControlSimpleRequestHeaderWhitelist): Check that content type has an
3220         allowed value. This is needed in all call sites. Also changed to compare MIME type, not
3221         content type.
3222         (WebCore::isSimpleCrossOriginAccessRequest): Use the above methods.
3223
3224         * loader/CrossOriginAccessControl.h: Expose isOnAccessControlSimpleRequestMethodWhitelist.
3225
3226         * loader/CrossOriginPreflightResultCache.cpp:
3227         (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod):
3228         (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders):
3229         Use the new checks for simple method and header.
3230
3231 2009-03-16  Gustavo Noronha Silva  <gns@gnome.org> and Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
3232
3233         Reviewed by Mark Rowe.
3234
3235         https://bugs.webkit.org/show_bug.cgi?id=24638
3236         [GTK] HTML5 media tags do not work
3237
3238         Add a repaint-requested signal to the video sink, and use it to
3239         call MediaPlayerPrivate::repaint, so that the video actually
3240         plays.
3241
3242         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
3243         (WebCore::mediaPlayerPrivateRepaintCallback):
3244         (WebCore::MediaPlayerPrivate::createGSTPlayBin):
3245         * platform/graphics/gtk/VideoSinkGStreamer.cpp:
3246         (webkit_video_sink_idle_func):
3247         (webkit_video_sink_render):
3248         (webkit_video_sink_class_init):
3249
3250 2009-03-16  Gustavo Noronha Silva  <gns@gnome.org> and Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
3251
3252         Reviewed by Holger Freyther.
3253
3254         https://bugs.webkit.org/show_bug.cgi?id=24638
3255         [GTK] HTML5 media tags do not work
3256
3257         Work-around the fact that gst_element_query_duration returns true even
3258         though it is unable to figure out the duration when in stream (push)
3259         mode.
3260
3261         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
3262         (WebCore::MediaPlayerPrivate::duration):
3263
3264 2009-03-16  Darin Adler  <darin@apple.com>
3265
3266         Reviewed by Kevin Decker.
3267
3268         <rdar://problem/6642742> Top Sites malfunction when switching text zoom mode
3269
3270         * page/Frame.cpp:
3271         (WebCore::Frame::setNeedsReapplyStyles): Don’t do anything if the frame is
3272         currently showing a non-HTML view.
3273
3274 2009-03-16  Darin Adler  <darin@apple.com>
3275
3276         Reviewed by Adele Peterson.
3277
3278         Bug 24629: moving forward or backward a paragraph fails at edge of document
3279         https://bugs.webkit.org/show_bug.cgi?id=24629
3280         rdar://problem/6544413
3281
3282         Test: editing/selection/move-paragraph-document-edges.html
3283
3284         * editing/visible_units.cpp:
3285         (WebCore::previousParagraphPosition): Use the last result from
3286         previousLinePosition rather than going all the way back to what was originally
3287         passed in when we hit exception cases like null or not moving. This correctly
3288         inherits the behavior of previousLinePosition when we are in a paragraph at the
3289         edge of a document.
3290         (WebCore::nextParagraphPosition): Ditto.
3291
3292 2009-03-16  Darin Adler  <darin@apple.com>
3293
3294         Reviewed by Adele Peterson.
3295
3296         Bug 24619: RenderObject::selectionStartEnd does not need to be a virtual function
3297         https://bugs.webkit.org/show_bug.cgi?id=24619
3298
3299         * rendering/RenderObject.h: Remove virtual keyword from selectionStartEnd declaration.
3300         * rendering/RenderView.h: Ditto.
3301
3302 2009-03-16  Peter Kasting  <pkasting@google.com>
3303
3304         Reviewed by David Hyatt.
3305
3306         https://bugs.webkit.org/show_bug.cgi?id=24368
3307         DOM scroll events should be based off the actual number of wheel
3308         ticks, not off the number of lines scrolled.  This matches IE.
3309
3310         * dom/Node.cpp:
3311         (WebCore::Node::dispatchWheelEvent):
3312         * dom/WheelEvent.cpp:
3313         (WebCore::WheelEvent::WheelEvent):
3314         * dom/WheelEvent.h:
3315         (WebCore::WheelEvent::create):
3316         * platform/PlatformWheelEvent.h:
3317         (WebCore::PlatformWheelEvent::wheelTicksX):
3318         (WebCore::PlatformWheelEvent::wheelTicksY):
3319         * platform/gtk/WheelEventGtk.cpp:
3320         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3321         * platform/mac/WheelEventMac.mm:
3322         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3323         * platform/qt/WheelEventQt.cpp:
3324         * platform/win/WheelEventWin.cpp:
3325         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3326         * platform/wx/MouseWheelEventWx.cpp:
3327         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3328
3329 2009-03-16  Simon Fraser  <simon.fraser@apple.com>
3330
3331         Reviewed by Eric Seidel
3332         
3333         Clean up a few issues in the Animation code:
3334
3335         * page/animation/AnimationBase.cpp:
3336         (WebCore::AnimationBase::updateStateMachine):
3337         Whitespace
3338         
3339         (WebCore::AnimationBase::willNeedService):
3340         Don't round to float, use std::max
3341
3342         * page/animation/AnimationController.cpp:
3343         (WebCore::AnimationControllerPrivate::startTimeResponse):
3344         Fix erroneously copied line to null out m_lastResponseWaiter.
3345
3346 2009-03-12  David Hyatt  <hyatt@apple.com>
3347
3348         Reviewed by Eric Seidel
3349
3350         https://bugs.webkit.org/show_bug.cgi?id=13632
3351
3352         Overflow scrolling needs to account for the bottom/right padding on the object itself as well
3353         as for bottom/right margins on children.
3354
3355         Existing tests cover this.
3356
3357         * rendering/RenderBlock.cpp:
3358         (WebCore::RenderBlock::lowestPosition):
3359         (WebCore::RenderBlock::rightmostPosition):
3360
3361 2009-03-16  Sam Weinig  <sam@webkit.org>
3362
3363         Reviewed by Anders Carlsson.
3364
3365         Fix for <rdar://problem/6320555>
3366         Add an upper limit for setting HTMLSelectElement.length.
3367
3368         Test: fast/forms/select-max-length.html
3369
3370         * html/HTMLSelectElement.cpp:
3371         (WebCore::HTMLSelectElement::setOption):
3372         (WebCore::HTMLSelectElement::setLength):
3373
3374 2009-03-16  Eric Carlson  <eric.carlson@apple.com>
3375
3376         Reviewed by Simon Fraser.
3377
3378         <rdar://problem/6686721> Media document crash in 64-bit WebKit
3379
3380         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3381         (WebCore::MediaPlayerPrivate::createQTMovieView): QTMovieContentViewClass is only used when
3382         rendering inline with old versions of QuickTime, so don't look for it when we are in a 
3383         media document.
3384
3385 2009-03-16  Dimitri Glazkov  <dglazkov@chromium.org>
3386
3387         Reviewed by Timothy Hatcher.
3388
3389         https://bugs.webkit.org/show_bug.cgi?id=24590
3390         Refactor InspectorDOMStorageResource to use ScriptFunctionCall.
3391
3392         * bindings/js/ScriptFunctionCall.cpp:
3393         (WebCore::ScriptFunctionCall::appendArgument): Added method for bool argument.
3394         * bindings/js/ScriptFunctionCall.h: Ditto, also cleaned up.
3395         * bindings/js/ScriptObjectQuarantine.cpp:
3396         (WebCore::getQuarantinedScriptObject): Added Storage helper.
3397         * bindings/js/ScriptObjectQuarantine.h: Ditto.
3398         * inspector/InspectorController.cpp:
3399         (WebCore::InspectorController::populateScriptObjects): Changed to use bind method.
3400         (WebCore::InspectorController::resetScriptObjects): Changed to use unbind method.
3401         (WebCore::InspectorController::didUseDOMStorage): Changed to use isSameHostAndType and bind methods.
3402         * inspector/InspectorController.h: Removed add/remove methods for DOM storage.
3403         * inspector/InspectorDOMStorageResource.cpp:
3404         (WebCore::InspectorDOMStorageResource::InspectorDOMStorageResource):
3405         (WebCore::InspectorDOMStorageResource::isSameHostAndType): Added.
3406         (WebCore::InspectorDOMStorageResource::bind): Added.
3407         (WebCore::InspectorDOMStorageResource::unbind): Added.
3408         * inspector/InspectorDOMStorageResource.h:
3409
3410 2009-03-16   Mike Belshe  <mike@belse.com>
3411
3412         Reviewed by Dimitri Glazkov.
3413
3414         https://bugs.webkit.org/show_bug.cgi?id=24580
3415         Fix query() to match KURL behavior, this time with the code that
3416         compiles.
3417
3418         * platform/KURLGoogle.cpp:
3419         (WebCore::KURL::query): Fix copy/paste mistake.
3420
3421 2009-03-16  Alexey Proskuryakov  <ap@webkit.org>
3422
3423         Reviewed by Darin Adler.
3424
3425         https://bugs.webkit.org/show_bug.cgi?id=21752
3426         REGRESSION: referencing XHR constructor for a not yet loaded frame permanently breaks it
3427
3428         Test: fast/dom/Window/window-early-properties-xhr.html
3429
3430         For some transitions, the Window object is not replaced, but Document is. When this happened,
3431         window.document property was updated, but references to Document kept in cached constructors
3432         were not.
3433
3434         * bindings/js/JSAudioConstructor.cpp:
3435         (WebCore::JSAudioConstructor::JSAudioConstructor):
3436         (WebCore::JSAudioConstructor::document):
3437         (WebCore::JSAudioConstructor::mark):
3438         * bindings/js/JSAudioConstructor.h:
3439         * bindings/js/JSImageConstructor.cpp:
3440         (WebCore::JSImageConstructor::JSImageConstructor):
3441         (WebCore::JSImageConstructor::document):
3442         (WebCore::JSImageConstructor::mark):
3443         * bindings/js/JSImageConstructor.h:
3444         * bindings/js/JSMessageChannelConstructor.cpp:
3445         (WebCore::JSMessageChannelConstructor::JSMessageChannelConstructor):
3446         (WebCore::JSMessageChannelConstructor::scriptExecutionContext):
3447         (WebCore::JSMessageChannelConstructor::mark):
3448         * bindings/js/JSMessageChannelConstructor.h:
3449         * bindings/js/JSOptionConstructor.cpp:
3450         (WebCore::JSOptionConstructor::JSOptionConstructor):
3451         (WebCore::JSOptionConstructor::document):
3452         (WebCore::JSOptionConstructor::mark):
3453         * bindings/js/JSOptionConstructor.h:
3454         * bindings/js/JSXMLHttpRequestConstructor.cpp:
3455         (WebCore::JSXMLHttpRequestConstructor::JSXMLHttpRequestConstructor):
3456         (WebCore::JSXMLHttpRequestConstructor::scriptExecutionContext):
3457         (WebCore::JSXMLHttpRequestConstructor::mark):
3458         * bindings/js/JSXMLHttpRequestConstructor.h:
3459         Changed cached constructors to keep a reference to Window, not Document.
3460
3461 2009-03-15  Alexey Proskuryakov  <ap@webkit.org>
3462
3463         Reviewed by Darin Adler.
3464
3465         https://bugs.webkit.org/show_bug.cgi?id=24549
3466         Impose a limit on Access-Control-Max-Age value
3467
3468         * loader/CrossOriginPreflightResultCache.cpp:
3469         (WebCore::CrossOriginPreflightResultCacheItem::parse):
3470
3471 2009-03-15  Greg Bolsinga  <bolsinga@apple.com>
3472
3473         Reviewed by David Kilzer.
3474
3475         <rdar://problem/6668875> Normalize Geolocation results
3476
3477         * platform/mac/GeolocationServiceMac.mm:
3478         (-[WebCoreCoreLocationObserver locationManager:didUpdateToLocation:fromLocation:]):
3479
3480 2009-03-15  Greg Bolsinga  <bolsinga@apple.com>
3481
3482         Reviewed by David Kilzer.
3483
3484         Update ::toString format as suggested by Darin Adler.
3485
3486         * page/Geoposition.cpp:
3487         (WebCore::Geoposition::toString):
3488
3489 2009-03-15  David Kilzer  <ddkilzer@apple.com>
3490
3491         <rdar://problem/6668238> WebCore is registering text encodings needlessly from KURL constructor.
3492
3493         Reviewed by Darin Adler.
3494
3495         Yet another case where we would trigger extended encoding loading needlessly.
3496
3497         * platform/text/TextEncoding.cpp:
3498         (WebCore::TextEncoding::encodingForFormSubmission):
3499
3500 2009-03-15  Simon Fraser  <simon.fraser@apple.com>
3501
3502         Build fix: no review.
3503
3504         * rendering/style/ContentData.h:
3505
3506 2009-03-15  David Kilzer  <ddkilzer@apple.com>
3507
3508         Bug 24542: Improve ContentData encapsulation
3509
3510         <https://bugs.webkit.org/show_bug.cgi?id=24542>
3511
3512         Reviewed by Simon Fraser.
3513
3514         No tests since there is no change in behavior.
3515
3516         * rendering/RenderObject.cpp:
3517         (WebCore::RenderObject::createObject): Used getter methods
3518         instead of data members on ContentData class.  Used isImage()
3519         convenience method.