2008-03-19 Stephanie Lewis <slewis@apple.com>
[WebKit-https.git] / WebCore / ChangeLog
1 2008-03-19  Stephanie Lewis  <slewis@apple.com>
2
3         Rubber-stamped by Anders.
4
5         Fix Windows Build
6
7         * platform/cf/SharedBufferCF.cpp:
8         (WebCore::SharedBuffer::createCFData):
9
10 2008-03-19  Stephanie Lewis <slewis@apple.com>
11
12         Rubber-stamped by Anders.
13
14         Fix Windows Build
15
16         * platform/SharedBuffer.h:
17
18 2008-03-19  Justin Garcia  <justin.garcia@apple.com>
19
20         Reviewed by Oliver.
21         
22         <rdar://problem/5780697> Copying content with CSS property values that are percentages can cause fidelity issues
23          
24         Elements with height: x%; overflow: visible; overlap what's below them when they are copied from
25         a document in quirksmode and pasted into to one in standards mode.  This fix uses the computed 
26         the value for a property if its value is a percentage.
27         
28         * css/CSSMutableStyleDeclaration.cpp:
29         (WebCore::CSSMutableStyleDeclaration::addParsedProperty): Added so that we don't have to use
30         setProperty from appendStartMarkup.  We already have a parsed property value, so we shouldn't
31         use setProperty, since it takes in a String.  If we did, we would have to call CSSValue::cssText()
32         for a String only to re-parse it in setProperty.  This wasn't extremely important now, but it will 
33         be as we compute more properties to fix the rest of the copy/paste fidelity bugs.
34         * css/CSSMutableStyleDeclaration.h:
35         * editing/markup.cpp:
36         (WebCore::appendStartMarkup): Compute values for properties that have percentage values.  We could
37         perhaps narrow this special case to only include properties that are effected by quirksmode.
38
39 2008-03-19  Sam Weinig  <sam@webkit.org>
40
41         Reviewed by Anders Carlsson.
42
43         Fix for <rdar://problem/5785694>
44         Crash occurs at KJS::Collector::collect() when loading web clip widgets with a PAC file
45
46         Make the activeExecStates stack per JSGlobalObject instead of static to ensure
47         thread safety.
48
49         * bindings/objc/WebScriptObject.mm:
50         (+[WebScriptObject throwException:]): Change to throw an exception on the current
51         GlobalObject instead of the top of the static activeExecStates stack.
52         (-[WebScriptObject setException:]): Change to use the top of the rootObjects GlobalObject
53         instead of the top of the static activeExecStates stack.
54
55         * bridge/c/c_instance.cpp:
56         * bridge/c/c_instance.h:
57         * bridge/jni/jni_instance.cpp:
58         (JavaInstance::virtualBegin):
59         (JavaInstance::virtualEnd):
60         * bridge/jni/jni_instance.h:
61         * bridge/objc/objc_instance.h:
62         * bridge/objc/objc_instance.mm:
63         (ObjcInstance::~ObjcInstance):
64         (ObjcInstance::virtualBegin):
65         (ObjcInstance::virtualEnd):
66         * bridge/runtime.cpp:
67         (KJS::Bindings::Instance::setDidExecuteFunction):
68         (KJS::Bindings::Instance::didExecuteFunction):
69         (KJS::Bindings::Instance::setCurrentGlobalObject): Added.
70         (KJS::Bindings::Instance::currentGlobalObject): Added.
71         (KJS::Bindings::Instance::begin):
72         (KJS::Bindings::Instance::end):
73         * bridge/runtime.h:
74         (KJS::Bindings::Instance::virtualBegin): Renamed from begin().
75         (KJS::Bindings::Instance::virtualEnd): Renamed from end().
76         We now store the currently active globalObject everytime we cross the runtime
77         object boundary.  To do this, we take advantage of the existing begin/end
78         methods that are called when crossing this boundary, making begin set the current
79         globalObject and then call the old begin, now called virtualBegin.
80
81 2008-03-19  Brady Eidson  <beidson@apple.com>
82
83         Reviewed by Anders
84
85         Change SharedBuffer so the wrapping platform data aspect can be shared with all CoreFoundation platforms
86         (Mac and Windows instead of just Mac)
87
88         * WebCore.vcproj/WebCore.vcproj: Add SharedBufferCF.cpp
89         * WebCore.xcodeproj/project.pbxproj: Ditto
90
91         * platform/SharedBuffer.cpp:
92         * platform/SharedBuffer.h: Change the private c'tor from NSData to CFDataRef, other PLATFORM tweaks
93
94         * platform/cf/SharedBufferCF.cpp: Added.
95         (WebCore::SharedBuffer::SharedBuffer):
96         (WebCore::SharedBuffer::createCFData): Non-Mac version of createCFData
97         (WebCore::SharedBuffer::hasPlatformData):
98         (WebCore::SharedBuffer::platformData):
99         (WebCore::SharedBuffer::platformDataSize):
100         (WebCore::SharedBuffer::maybeTransferPlatformData):
101         (WebCore::SharedBuffer::clearPlatformData):
102
103         * platform/mac/SharedBufferMac.mm:
104         (WebCore::SharedBuffer::wrapNSData): Use the CFDataRef constructor via toll-free bridging
105         (WebCore::SharedBuffer::createCFData): Mac-specific version of createCFData
106
107 2008-03-19  Oliver Hunt  <oliver@apple.com>
108
109         Reviewed by Antti.
110
111         Bug 17954: Canvas arc() with radius of 0 throws exception
112         http://bugs.webkit.org/show_bug.cgi?id=17954
113
114         Simple fix -- use >= instead of > when validating the radius.
115
116         * html/CanvasRenderingContext2D.cpp:
117         (WebCore::CanvasRenderingContext2D::arc):
118
119 2008-03-19  Justin Garcia  <justin.garcia@apple.com>
120
121         Reviewed by Oliver.
122
123         <rdar://problem/5794920> Acid3: Assertion failure in VisiblePosition::previous when clicking on results (17004)
124         
125         The position inside an empty inline-block was a candidate, but upstream and downstream
126         would move across it without stopping.  This confused canonicalPosition, since no more
127         than two candidates should have the same upstream/downstream (be visually equivalent).
128         
129         Code was added intentionally in isCandidate to make VisiblePositions inside empty 
130         inline-blocks, so we need to make upstream/downstream understand that.
131
132         * dom/Position.cpp:
133         (WebCore::endsOfNodeAreVisuallyDistinctPositions): upstream and downstream used to only
134         stop when entering or leaving a non-inline element (referred to as a "block").  We must also 
135         avoid entering or leaving an empty inline-block.  This will allow a VisiblePosition there, to 
136         match up with what the code in isCandidate intended.
137         (WebCore::enclosingVisualBoundary): Removed enclosingBlock and replaced it with this.
138         (WebCore::Position::upstream): Added better comments, called the new functions.
139         (WebCore::Position::downstream): Ditto.
140         * dom/Position.h:
141
142 2008-03-19  Dan Bernstein  <mitz@apple.com>
143
144         Rubber-stamped by John Sullivan.
145
146         - change CSS property and value keyword constants from all-caps with
147           underscores to intra-caps.
148
149         * css/makeprop.pl:
150         * css/makevalues.pl:
151         * All files using the constants
152
153 2008-03-19  Adam Roben  <aroben@apple.com>
154
155         Make clicking anywhere in a row in the DOM tree select that row's node
156
157         We now have mousedown and dblclick event listeners on the root of the
158         tree that forward the event to the node on the row the mouse is over.
159
160         Reviewed by Tim Hatcher.
161
162         * page/inspector/DocumentPanel.js:
163         (WebInspector.DocumentPanel): Added a dblclick and mousedown event
164         listeners to the root of the tree.
165         (WebInspector.DocumentPanel._treeElementFromEvent): Added. Finds the
166         tree element for the row underneath the mouse.
167         (WebInspector.DocumentPanel._ondblclick): Added. Sends the dblclick
168         event on to the tree element in the current row.
169         (WebInspector.DocumentPanel._onmousedown): Added. Selects the tree
170         element in the current row.
171         * page/inspector/treeoutline.js:
172         (TreeOutline.treeElementFromPoint): Added.
173         (TreeElement.treeElementSelected): Changed to call
174         TreeElement.isEventWithinDisclosureTriangle, and added an early return.
175         (TreeElement.treeElementToggled): Ditto.
176         (TreeElement.isEventWithinDisclosureTriangle): Added.
177         * page/inspector/utilities.js:
178         (Node.enclosingNodeOrSelfWithNodeNameInArray): Added.
179         (Node.enclosingNodeOrSelfWithNodeName): Now just calls
180         enclosingNodeOrSelfWithNodeNameInArray.
181         (Elemnt.get totalOffsetLeft): Added.
182         (Elemnt.get totalOffsetTop): Added.
183
184 2008-03-19  Dan Bernstein  <mitz@apple.com>
185
186         Reviewed by Sam Weinig.
187
188         - fix assertion failure in RenderBlock::determineStartPosition() at http://www.wired.com/techbiz/it/magazine/16-04/bz_apple
189
190         Test: fast/repaint/line-flow-with-floats-10.html
191
192         * rendering/bidi.cpp:
193         (WebCore::RenderBlock::determineStartPosition): Removed bogus assertion.
194         If the float's top margin has changed and it has not been repositioned
195         yet, we do not have its new y position.
196
197 2008-03-19  David Hyatt  <hyatt@apple.com>
198
199         New implementation of full page zoom.  Because of how much doesn't transform when zooming, and because
200         of the need to obey viewport constraints, I decided to take a completely different approach.  Now CSS
201         lengths and intrinsic sizes are simply adjusted by the zoom factor.  This approach works much better and
202         avoids pixel cracks more than the old approach.   In addition widgets "just work", namely plugins zoom
203         and scrollbars do not.
204
205         This patch also implements the IE zoom CSS property.  This property allows fine-grained control over
206         zooming at the element level.  It takes values of normal | <number> | <percentage> to match WinIE.  In
207         addition, in the vein of text-size-adjust for text zooming, I have extended the zoom property with an
208         extra value, reset.  The reset keyword can be used to prevent a section of the page from scaling at all
209         when a zoom is applied.
210
211         Reviewed by olliej
212
213         * css/CSSComputedStyleDeclaration.cpp:
214         (WebCore::):
215         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
216         Support the new 'zoom' property for getComputedStyle.
217
218         * css/CSSParser.cpp:
219         (WebCore::CSSParser::parseValue):
220         Code that parses the 'zoom' property.
221
222         * css/CSSPrimitiveValue.cpp:
223         (WebCore::CSSPrimitiveValue::computeLengthInt):
224         (WebCore::CSSPrimitiveValue::computeLengthIntForLength):
225         (WebCore::CSSPrimitiveValue::computeLengthShort):
226         (WebCore::CSSPrimitiveValue::computeLengthFloat):
227         (WebCore::CSSPrimitiveValue::computeLengthDouble):
228         * css/CSSPrimitiveValue.h:
229         Extend all of the computeLength methods to take a multiplier so that lengths can be adjusted by the
230         zoom factor.
231
232         * css/CSSPropertyNames.in:
233         Add the new zoom property to the list of properties we understand.
234
235         * css/CSSStyleSelector.cpp:
236         (WebCore::CSSStyleSelector::applyDeclarations):
237         (WebCore::CSSStyleSelector::applyProperty):
238         (WebCore::CSSStyleSelector::mapBackgroundSize):
239         (WebCore::CSSStyleSelector::mapBackgroundXPosition):
240         (WebCore::CSSStyleSelector::mapBackgroundYPosition):
241         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
242         * css/CSSStyleSelector.h:
243         (WebCore::CSSStyleSelector::setStyle):
244         Pass in the zoom factor when computing all lengths in CSS.
245
246         * css/CSSValueKeywords.in:
247         Add support for the 'reset' keyword of the zoom property.
248
249         * dom/Document.cpp:
250         (WebCore::Document::recalcStyle):
251         Set the 'zoom' CSS property on the RenderView.  This is how we implement full page zoom.
252
253         * html/CanvasRenderingContext2D.cpp:
254         (WebCore::size):
255         Make sure the back end canvas size ignores zooming when rendering images.
256
257         * html/HTMLImageElement.cpp:
258         (WebCore::HTMLImageElement::width):
259         (WebCore::HTMLImageElement::height):
260         (WebCore::HTMLImageElement::naturalWidth):
261         (WebCore::HTMLImageElement::naturalHeight):
262         Use the unzoomed width/height if we have no style information in HTMLImageElement.cpp.
263
264         * loader/CachedImage.cpp:
265         (WebCore::CachedImage::ref):
266         (WebCore::CachedImage::imageSize):
267         (WebCore::CachedImage::imageRect):
268         * loader/CachedImage.h:
269         (WebCore::CachedImage::canRender):
270         Force access to the CachedImage metrics to take a multiplier so that people have to think about
271         the zoom factor.  The "intrinsic size" of the image then takes that into account.
272
273         * loader/ImageDocument.cpp:
274         (WebCore::ImageTokenizer::finish):
275         (WebCore::ImageDocument::scale):
276         (WebCore::ImageDocument::resizeImageToFit):
277         (WebCore::ImageDocument::imageChanged):
278         (WebCore::ImageDocument::restoreImageSize):
279         (WebCore::ImageDocument::imageFitsInWindow):
280         Make sure image documents respect the zoom.
281
282         * page/AnimationController.cpp:
283         (WebCore::ImplicitAnimation::animate):
284         Make the 'zoom' CSS property work with CSS transitions.
285
286         * page/Frame.h:
287         (WebCore::Frame::pageZoomFactor):
288         (WebCore::Frame::textZoomFactor):
289         Add accessors for obtaining the pageZoom vs. textZoom.
290
291         * page/FrameView.cpp:
292         (WebCore::FrameView::adjustViewSize):
293         Remove the old zoom implementation that used transforms.
294
295         * page/mac/WebCoreAXObject.mm:
296         (-[WebCoreAXObject accessibilityIsIgnored]):
297         Pass in the zoom factor.
298
299         * rendering/InlineFlowBox.cpp:
300         (WebCore::InlineFlowBox::paintBackground):
301         (WebCore::InlineFlowBox::paintBoxDecorations):
302         Pass in the zoom factor when testing for size.
303
304         * rendering/RenderBox.cpp:
305         (WebCore::RenderBox::calculateBackgroundSize):
306         (WebCore::RenderBox::imageChanged):
307         (WebCore::RenderBox::paintBackgroundExtended):
308         (WebCore::RenderBox::calcHeight):
309         * rendering/RenderFrameSet.cpp:
310         (WebCore::RenderFrameSet::layout):
311         * rendering/RenderHTMLCanvas.cpp:
312         (WebCore::RenderHTMLCanvas::canvasSizeChanged):
313         * rendering/RenderHTMLCanvas.h:
314         (WebCore::RenderHTMLCanvas::renderName):
315         (WebCore::RenderHTMLCanvas::intrinsicSizeChanged):
316         * rendering/RenderImage.cpp:
317         (WebCore::RenderImage::setImageSizeForAltText):
318         (WebCore::RenderImage::imageChanged):
319         (WebCore::RenderImage::calcReplacedWidth):
320         (WebCore::RenderImage::calcReplacedHeight):
321         * rendering/RenderImage.h:
322         (WebCore::RenderImage::intrinsicSizeChanged):
323         * rendering/RenderListMarker.cpp:
324         (WebCore::RenderListMarker::layout):
325         (WebCore::RenderListMarker::imageChanged):
326         (WebCore::RenderListMarker::getRelativeMarkerRect):
327         * rendering/RenderObject.cpp:
328         (WebCore::RenderObject::mustRepaintBackgroundOrBorder):
329         (WebCore::RenderObject::paintBorder):
330         Pass in the zoom factor when testing for size.
331
332         * rendering/RenderReplaced.cpp:
333         (WebCore::RenderReplaced::RenderReplaced):
334         (WebCore::RenderReplaced::setStyle):
335         (WebCore::RenderReplaced::intrinsicSizeChanged):
336         * rendering/RenderReplaced.h:
337         Added a new call when the zoom factor changes, intrinsicSizeChanged().  Replaced element subclasses
338         respond to this via overrides.
339
340         * rendering/RenderStyle.cpp:
341         (WebCore::StyleVisualData::StyleVisualData):
342         (WebCore::StyleInheritedData::StyleInheritedData):
343         (WebCore::StyleInheritedData::operator==):
344         (WebCore::RenderStyle::diff):
345         * rendering/RenderStyle.h:
346         (WebCore::StyleVisualData::operator==):
347         (WebCore::RenderStyle::zoom):
348         (WebCore::RenderStyle::zoomInEffect):
349         (WebCore::RenderStyle::setZoom):
350         (WebCore::RenderStyle::setZoomInEffect):
351         (WebCore::RenderStyle::initialZoom):
352         Support for 'zoom' in the RenderStyle.  "zoomInEffect" represents the computed zoom taking into account
353         all the zooms specified on ancestors.
354
355         * rendering/RenderTableCol.cpp:
356         (WebCore::RenderTableCol::imageChanged):
357         * rendering/RenderTableRow.cpp:
358         (WebCore::RenderTableRow::imageChanged):
359         * rendering/RenderTableSection.cpp:
360         (WebCore::RenderTableSection::imageChanged):
361         * rendering/RenderVideo.h:
362         (WebCore::RenderVideo::intrinsicSizeChanged):
363         Pass in the zoom factor.
364
365         * rendering/RenderView.cpp:
366         (WebCore::RenderView::calcHeight):
367         (WebCore::RenderView::calcWidth):
368         (WebCore::RenderView::layout):
369         (WebCore::RenderView::viewHeight):
370         (WebCore::RenderView::viewWidth):
371         * rendering/RenderView.h:
372         (WebCore::RenderView::zoomFactor):
373         Back out the old implementation.
374
375 2008-03-19  Adam Roben  <aroben@apple.com>
376
377         Rename firstParent* methods to enclosingNode*
378
379         Rubberstamped by John Sullivan.
380
381         * page/inspector/ConsolePanel.js:
382         * page/inspector/DocumentPanel.js:
383         * page/inspector/NetworkPanel.js:
384         * page/inspector/inspector.js:
385         * page/inspector/utilities.js:
386
387 2008-03-19  Dan Bernstein  <mitz@apple.com>
388
389         Reviewed by John Sullivan.
390
391         - fix <rdar://problem/5805070> CrashTracer: [USER] 33 crashes in Safari at com.apple.WebCore: WebCore::FrameView::layout + 431
392
393         Test: fast/dynamic/subtree-parent-static-y.html
394
395         * rendering/RenderObject.cpp:
396         (WebCore::RenderObject::markContainingBlocksForLayout): Avoid calling
397         this method on the parent if the parent is the new layout subtree root,
398         which would result in marking all the way to the top, when it should
399         actually do nothing.
400
401 2008-03-19  Mark Rowe  <mrowe@apple.com>
402
403         Reviewed by Oliver Hunt.
404
405         Use WTF::Unicode abstraction rather than using ICU functions directly.
406
407         * html/PreloadScanner.cpp:
408         (WebCore::PreloadScanner::tokenize):
409
410 2008-03-19  Mark Rowe  <mrowe@apple.com>
411
412         Attempt to fix the Gtk build.
413
414         * platform/network/curl/ResourceHandleCurl.cpp:
415         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate):
416
417 2008-03-18  Darin Adler  <darin@apple.com>
418
419         Reviewed by Maciej.
420
421         - Speed up JavaScript built-in properties by changing the
422           hash table to take advantage of the identifier objects
423
424         5% speedup for Acid3 test 26
425
426         * bindings/js/JSDOMWindowBase.cpp:
427         (WebCore::JSDOMWindowBase::getOwnPropertySlot): Update for change to HashTable.
428         (WebCore::JSDOMWindowBase::put): Ditto.
429         * bindings/js/JSDOMWindowCustom.cpp:
430         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Ditto.
431         * bindings/js/JSHTMLInputElementBase.cpp:
432         (WebCore::JSHTMLInputElementBase::getOwnPropertySlot): Ditto.
433         * bindings/js/JSHistoryCustom.cpp:
434         (WebCore::JSHistory::customGetOwnPropertySlot): Ditto.
435         * bindings/js/JSLocation.cpp:
436         (WebCore::JSLocation::customGetOwnPropertySlot): Ditto.
437         (WebCore::JSLocation::put): Ditto.
438         * bindings/js/kjs_binding.cpp:
439         (WebCore::nonCachingStaticFunctionGetter): Ditto.
440
441         * bindings/scripts/CodeGeneratorJS.pm: Same changes as in the
442         create_hash_table script.
443
444 2008-03-18  Matt Lilek  <webkit@mattlilek.com>
445
446         Fix the Gtk build for real this time.
447
448         * platform/network/curl/AuthenticationChallenge.h:
449
450 2008-03-18  Sam Weinig  <sam@webkit.org>
451
452         Reviewed by Anders Carlsson.
453
454         Fix for http://bugs.webkit.org/show_bug.cgi?id=17057
455         REGRESSION: Frequent random crashes in WebCore::JSNodeList::indexGetter
456         <rdar://problem/5725058>
457
458         Tests: fast/dom/NodeList/5725058-crash-scenario-1.html
459                fast/dom/NodeList/5725058-crash-scenario-2.html
460                fast/dom/NodeList/5725058-crash-scenario-3.html
461
462         * dom/ChildNodeList.cpp: 
463         (WebCore::ChildNodeList::ChildNodeList):
464         * dom/ChildNodeList.h:
465         Remove rootNodeChildrenChanged() method and fix the constructor to not 
466         pass in a needsNotifications argument to DynamicNodeList, as it no longer
467         takes one.
468
469         * dom/ClassNodeList.cpp:
470         (WebCore::ClassNodeList::ClassNodeList):
471         Don't pass the needsNotifications argument to DynamicNodeList.
472
473         * dom/ContainerNode.cpp:
474         (WebCore::ContainerNode::childrenChanged):
475         Rename call to hasNodeLists() to hasNodeListCaches().
476
477         * dom/Document.cpp:
478         (WebCore::Document::Document):
479         (WebCore::Document::~Document): Zero out the m_document variable to signify
480         to destructors down the destruction chain that this is a Document type node
481         being destructed, and thus, accessing document() is prohibited.
482         * dom/Document.h:
483         (WebCore::Document::addNodeListCache): Renamed from addNodeList.
484         (WebCore::Document::removeNodeListCache): Renamed from removeNodeList, adds assertion.
485         (WebCore::Document::hasNodeListCaches): Renamed from hasNodeListCaches.
486         Rename m_numNodeLists to m_numNodeListCaches.
487
488         * dom/DynamicNodeList.cpp:
489         (WebCore::DynamicNodeList::DynamicNodeList):
490         (WebCore::DynamicNodeList::~DynamicNodeList):
491         (WebCore::DynamicNodeList::invalidateCache):
492         (WebCore::DynamicNodeList::Caches::Caches):
493         * dom/DynamicNodeList.h:
494         (WebCore::DynamicNodeList::hasOwnCaches):
495         Remove the needsNotifications concept from DynamicNodeList, instead, manually
496         invalidate the cache for lists that own their own cache.
497
498         * dom/NameNodeList.cpp:
499         (WebCore::NameNodeList::NameNodeList):
500         * dom/NameNodeList.h:
501         Remove rootNodeAttributeChanged() method and fix the constructor to not 
502         pass in a needsNotifications argument to DynamicNodeList, as it no longer
503         takes one.
504
505         * dom/Node.cpp:
506         (WebCore::Node::~Node): Decrement the document's nodeListCache count
507         if we had a NodeListsNodeData cache and this is not the Document being
508         destructor, as tagged by a null m_document.
509         (WebCore::Node::childNodes): Increment the document's nodeListCache count 
510         if we need create the NodeListsNodeData.
511         (WebCore::Node::registerDynamicNodeList): Increment the document's nodeListCache count 
512         if we need create the NodeListsNodeData.  Change to invalidate all the caches, instead 
513         of just the ChildNodeList, if document has had no NodeListCaches.
514         (WebCore::Node::unregisterDynamicNodeList): Change to remove the cache from the m_listsWithCaches
515         set if it is owned by the NodeList and clear the m_nodeLists if it is empty.
516         (WebCore::Node::notifyLocalNodeListsAttributeChanged): Move logic to 
517         NodeListsNodeData::invalidateAttributeCaches and clear the cache pointer if it is empty.
518         (WebCore::Node::notifyLocalNodeListsChildrenChanged): Move logic to 
519         NodeListsNodeData::invalidateCaches and clear the cache pointer if it is empty.
520         (WebCore::Node::notifyNodeListsChildrenChanged): Cleanup.
521         (WebCore::Node::getElementsByName): Increment the document's nodeListCache count 
522         if we need create the NodeListsNodeData.
523         (WebCore::Node::getElementsByClassName): Increment the document's nodeListCache count 
524         if we need create the NodeListsNodeData.
525
526         (WebCore::NodeListsNodeData::invalidateCaches): Added.
527         (WebCore::NodeListsNodeData::invalidateAttributeCaches): Added.
528         (WebCore::NodeListsNodeData::isEmpty): Added.
529
530         * dom/TagNodeList.cpp:
531         (WebCore::TagNodeList::TagNodeList):
532         Don't pass the needsNotifications argument to DynamicNodeList.
533
534 2008-03-18  Matt Lilek  <webkit@mattlilek.com>
535
536         Not reviewed, build fix.
537
538         * platform/network/curl/AuthenticationChallenge.h:
539
540 2008-03-18  Brent Fulgham  <bfulgham@gmail.com>
541
542         Reviewed by Adam Roben.
543
544         Provide some stub implementations for things that WebKit
545         uses for performing authentication/challenge activities.  This
546         is in support of http://bugs.webkit.org/show_bug.cgi?id=17837
547
548         * platform/network/ResourceHandle.h:
549         * platform/network/curl/AuthenticationChallenge.h:
550         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
551         (WebCore::AuthenticationChallenge::sourceHandle):
552
553 2008-03-18  Eric Seidel  <eric@webkit.org>
554
555         Reviewed by Oliver.
556
557         Fix SVGImage crash seen once, and obvious via code inspection.
558         
559         I was not able to find a test case for this.
560
561         * svg/graphics/SVGImage.cpp:
562         (WebCore::SVGImage::setContainerSize):
563         (WebCore::SVGImage::usesContainerSize):
564         (WebCore::SVGImage::hasRelativeWidth):
565         (WebCore::SVGImage::hasRelativeHeight):
566
567 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
568
569         Fix Qt build after r31123.
570
571         Add PluginView methods to TemporaryLinkStubs.
572
573         * platform/qt/TemporaryLinkStubs.cpp:
574
575 2008-03-18  Sam Weinig  <sam@webkit.org>
576
577         Reviewed by Darin Adler.
578
579         - Speed up JavaScript prototype and constructor object creation
580           using a static Identifier in the self() methods to avoid the
581           cost of creating one from a c-string each time.
582
583         5% speedup for Acid3 test 26
584
585         * bindings/scripts/CodeGeneratorJS.pm:
586
587 2008-03-18  Antti Koivisto  <antti@apple.com>
588
589         Reviewed by Mark Rowe.
590
591         Enable preloading for other platforms besides Mac.
592
593         * GNUmakefile.am:
594         * WebCore.pro:
595         * WebCore.vcproj/WebCore.vcproj:
596         * WebCoreSources.bkl:
597         * html/HTMLTokenizer.cpp:
598         * html/HTMLTokenizer.h:
599         * html/PreloadScanner.cpp:
600         (WebCore::PreloadScanner::tokenize):
601
602 2008-03-18  Dan Bernstein  <mitz@apple.com>
603
604         Reviewed by Adele Peterson.
605
606         - fix <rdar://problem/5805127> REGRESSION (r31116): Assertion failure (floatIndex < floats.size()) in RenderBlock::determineStartPosition() at digg.com
607
608         Test: fast/dynamic/floating-to-positioned.html
609
610         * rendering/RenderObject.cpp:
611         (WebCore::RenderObject::setStyle): Added code to remove a float from
612         object lists if its position property changes to something other than
613         static, since then it ceases to be a float.
614
615 2008-03-18  Adam Roben  <aroben@apple.com>
616
617         Windows build fix after r31123
618
619         * plugins/win/PluginViewWin.cpp: Add back MozillaUserAgent.
620
621 2008-03-18  Dan Bernstein  <mitz@apple.com>
622
623         Reviewed by Darin Adler.
624
625         - eliminate RenderFlow::m_clear
626
627         * rendering/RenderBlock.cpp:
628         (WebCore::RenderBlock::layoutBlock): Removed code to set m_clear.
629         (WebCore::RenderBlock::newLine): Added a 'clear' parameter.
630         * rendering/RenderBlock.h:
631         * rendering/RenderFlow.h:
632         (WebCore::RenderFlow::RenderFlow): Removed initialization of m_clear.
633         * rendering/bidi.cpp:
634         (WebCore::RenderBlock::layoutInlineChildren): Added a local 'clear'
635         variable, passing a pointer to it to findNextLineBreak() and its value
636         to newLine(). 
637         (WebCore::RenderBlock::findNextLineBreak): Added a 'clear' parameter,
638         which this method adjusts when it encounters a <br>.
639
640 2008-03-18  Simon Hausmann  <hausmann@webkit.org>
641
642         Reviewed by Holger.
643
644         Fix the Qt build and clean up the invoke mechanism for dispatching
645         functions in the main thread by using QMetaObject::invokeMethod
646         instead of posting a null event.
647
648         * platform/qt/MainThreadQt.cpp:
649
650 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
651
652         Fix Mac build from commit of r31123.
653
654         Add a typedef for NSView* to PlatformWidget, remove duplicate PluginMessageThrottlerWin definition.
655
656         * platform/Widget.h:
657         * WebCore.vcproj/WebCore.vcproj:
658
659 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
660
661         Reviewed by Jon Honeycutt.
662
663         Add PluginView.cpp and npapi.cpp to build files.
664         Copy win/PluginViewWin.cpp to PluginView.cpp for shared code.
665         Split Windows specific code out of PluginView.cpp.
666         Add #if USE(NPOBJECT) around dependant code.
667         Use npruntime_internal.h instead of npapi.h.
668         Add PlatformWidget typedef to Widget.h.
669         Update WidgetGtk.cpp for the PlatformWidget usage.
670         Add needed methods to TemporaryLinkStubs for GTK+ port.
671
672         * GNUmakefile.am:
673         * WebCore.pro:
674         * WebCoreSources.bkl:
675         * WebCore.vcproj/WebCore.vcproj:
676         * plugins/win/PluginViewWin.cpp:
677         * plugins/PluginView.cpp:
678         * plugins/PluginView.h:
679         * plugins/npapi.cpp:
680         * platform/Widget.h:
681         * platform/gtk/WidgetGtk.cpp:
682         * platform/gtk/TemporaryLinkStubs.cpp:
683
684 2008-03-17  Darin Adler  <darin@apple.com>
685
686         Reviewed by Maciej.
687
688         - speed up document property fetching (eliminate the AtomicString
689           objects made during document property lookup)
690
691         3% speedup for Acid3 test 26
692
693         * bindings/js/JSDOMWindowBase.cpp:
694         (WebCore::JSDOMWindowBase::getOwnPropertySlot): Use AtomicString::find to
695         locate the AtomicString, only if already present. Also call the new faster
696         versions of the hasNamedItem and hasElementWithId functions that don't
697         ref/deref the AtomicStringImpl, get inlined, etc.
698         * bindings/js/JSHTMLDocumentCustom.cpp:
699         (WebCore::JSHTMLDocument::canGetItemsForName): Ditto.
700         (WebCore::writeHelper): Use a Vector instead of a String to build up
701         the string to avoid the bad performance of string append.
702
703         * dom/Document.cpp: Tweaked code and comments a bit. Nothing substantive.
704         * dom/Document.h: Added new hasElementWithId function that's faster than
705         getElementById because it doesn't ref/deref the AtomicStringImpl*, gets
706         inlined, doesn't have to handle the 0 case, and doesn't try to return the
707         element pointer (just a boolean).
708
709         * html/HTMLAppletElement.cpp:
710         (WebCore::HTMLAppletElement::parseMappedAttribute): Use AtomicString
711         consistently. Also renamed the data member for clarity.
712         (WebCore::HTMLAppletElement::insertedIntoDocument): Ditto.
713         (WebCore::HTMLAppletElement::removedFromDocument): Ditto.
714         * html/HTMLAppletElement.h: Ditto.
715
716         * html/HTMLDocument.cpp:
717         (WebCore::addItemToMap): Use AtomicString instead of String.
718         (WebCore::removeItemFromMap): Ditto.
719         (WebCore::HTMLDocument::addNamedItem): Updated for member name change.
720         (WebCore::HTMLDocument::removeNamedItem): Ditto.
721         (WebCore::HTMLDocument::addExtraNamedItem): Ditto.
722         (WebCore::HTMLDocument::removeExtraNamedItem): Ditto.
723         (WebCore::HTMLDocument::clear): Added. Moved code here from the JavaScript
724         bindings. If we're going to have an empty placeholder function, there's no
725         reason to have it in the bindings instead of here.
726         * html/HTMLDocument.h: Added clear. Changed the named item function
727         arguments to AtomicString insted of String. Changed the NameCountMap to
728         use AtomicStringImpl* instead of StringImpl*. Renamed the data members
729         to add a m_ prefix and remove the needless doc prefix. Added hasNamedItem
730         and hasExtraNamedItem functions that are inlined and faster than the old
731         idiom because they doesn't ref/deref the AtomicStringImpl*, get inlined,
732         and don't have to handle the 0 case.
733         * html/HTMLDocument.idl: Removed the [Custom] attribute on clear and took
734         it out of the JavaScript-specific section.
735
736         * html/HTMLEmbedElement.cpp:
737         (WebCore::HTMLEmbedElement::parseMappedAttribute): Use AtomicString
738         consistently. Also renamed the data member for clarity.
739         (WebCore::HTMLEmbedElement::insertedIntoDocument): Ditto.
740         (WebCore::HTMLEmbedElement::removedFromDocument): Ditto.
741         * html/HTMLFormElement.cpp:
742         (WebCore::HTMLFormElement::insertedIntoDocument): Ditto.
743         (WebCore::HTMLFormElement::removedFromDocument): Ditto.
744         (WebCore::HTMLFormElement::parseMappedAttribute): Ditto.
745         * html/HTMLFormElement.h: Ditto.
746
747         * html/HTMLFrameElementBase.cpp:
748         (WebCore::HTMLFrameElementBase::openURL): Renamed m_name to m_frameName for
749         clarity, since the frame name is not the same as the name attribute.
750         (WebCore::HTMLFrameElementBase::parseMappedAttribute): Ditto.
751         (WebCore::HTMLFrameElementBase::setNameAndOpenURL): Ditto.
752         * html/HTMLFrameElementBase.h: Ditto.
753
754         * html/HTMLIFrameElement.cpp:
755         (WebCore::HTMLIFrameElement::parseMappedAttribute): Use AtomicString
756         consistently. Also renamed the data member for clarity.
757         (WebCore::HTMLIFrameElement::insertedIntoDocument): Ditto.
758         (WebCore::HTMLIFrameElement::removedFromDocument): Ditto.
759         * html/HTMLIFrameElement.h: Ditto.
760         * html/HTMLImageElement.cpp:
761         (WebCore::HTMLImageElement::parseMappedAttribute): Ditto.
762         (WebCore::HTMLImageElement::insertedIntoDocument): Ditto.
763         (WebCore::HTMLImageElement::removedFromDocument): Ditto.
764         * html/HTMLImageElement.h: Ditto.
765         * html/HTMLObjectElement.cpp:
766         (WebCore::HTMLObjectElement::parseMappedAttribute): Ditto.
767         (WebCore::HTMLObjectElement::insertedIntoDocument): Ditto.
768         (WebCore::HTMLObjectElement::removedFromDocument): Ditto.
769         (WebCore::HTMLObjectElement::updateDocNamedItem): Ditto.
770         * html/HTMLObjectElement.h: Ditto.
771
772         * html/HTMLParamElement.cpp:
773         (WebCore::HTMLParamElement::isURLAttribute): Use equalIgnoringCase instead
774         of callling lower().
775
776         * html/HTMLPlugInElement.h: Changed the type of m_name. The code that
777         uses this is in HTMLAppletElement, HTMLEmbedElement, and HTMLObjectElement.
778
779         * platform/text/AtomicString.cpp:
780         (WebCore::equal): Moved to an inline so we can share this code between a
781         few different functions. It could move to a header too if we want to use
782         it elsewhere.
783         (WebCore::UCharBufferTranslator::equal): Change to use inline.
784         (WebCore::HashAndCharactersTranslator::hash): Added.
785         (WebCore::HashAndCharactersTranslator::equal): Added.
786         (WebCore::HashAndCharactersTranslator::translate): Added.
787         (WebCore::AtomicString::add): Improved the Identifier and UString overloads
788         to use the already-computed hash code instead of rehashing the string.
789         (WebCore::AtomicString::find): Added.
790         * platform/text/AtomicString.h: Added a find function so we can avoid
791         allocating memory just to look up a string in an atomic string set or map.
792
793         * platform/text/StringImpl.h: Added declarations needed for the
794         AtomicString changes.
795
796 2008-03-17  Timothy Hatcher  <timothy@apple.com>
797
798         Reviewed by Mark Rowe.
799
800         Bug 17908: Various bugs in the Console completion code
801         http://bugs.webkit.org/show_bug.cgi?id=17908
802
803         * page/inspector/ConsolePanel.js:
804         (WebInspector.ConsolePanel.complete): Moved the code that checked for the caret being at the end
805         of the prompt into the _caretAtEndOfPrompt helper function.
806         (WebInspector.ConsolePanel.messagesSelectStart): Clear and redo the auto complete when the selection changes.
807         (WebInspector.ConsolePanel._caretInsidePrompt): Fixed a logic error that always caused a false result.
808         (WebInspector.ConsolePanel._caretAtEndOfPrompt): Added. Tests if the selection is a caret at the
809         end of the prompt.
810         (WebInspector.ConsolePanel._moveCaretToEndOfPrompt): Changed the offset to use the childNodes length.
811         This makes sure the caret is at the end when there are multiple text nodes in the prompt.
812
813 2008-03-17  Dan Bernstein  <mitz@apple.com>
814
815         Rubber-stamped by Dave Hyatt.
816
817         - FloatingObject cleanup
818
819         Renamed FloatingObject's data members as follows: node -> m_renderer,
820         startY -> m_top, endY -> m_bottom, left -> m_left, width -> m_width,
821         and noPaint -> !m_shouldPaint, reversing the meaning of the flag.
822
823         Also addressed the FIXME in RenderBlock::containsFloat().
824
825         * rendering/RenderBlock.cpp:
826         (WebCore::RenderBlock::repaintOverhangingFloats):
827         (WebCore::RenderBlock::paintFloats):
828         (WebCore::RenderBlock::insertFloatingObject):
829         (WebCore::RenderBlock::removeFloatingObject):
830         (WebCore::RenderBlock::positionNewFloats):
831         (WebCore::RenderBlock::leftRelOffset):
832         (WebCore::RenderBlock::rightRelOffset):
833         (WebCore::RenderBlock::nextFloatBottomBelow):
834         (WebCore::RenderBlock::floatBottom):
835         (WebCore::RenderBlock::floatRect):
836         (WebCore::RenderBlock::lowestPosition):
837         (WebCore::RenderBlock::rightmostPosition):
838         (WebCore::RenderBlock::leftmostPosition):
839         (WebCore::RenderBlock::leftBottom):
840         (WebCore::RenderBlock::rightBottom):
841         (WebCore::RenderBlock::clearFloats):
842         (WebCore::RenderBlock::addOverhangingFloats):
843         (WebCore::RenderBlock::addIntrudingFloats):
844         (WebCore::RenderBlock::containsFloat): Changed to return false if the
845         floats lists exists but is empty, since line layout code no longer
846         relies on the buggy behavior.
847         (WebCore::RenderBlock::nodeAtPoint):
848         (WebCore::RenderBlock::adjustForBorderFit):
849         * rendering/RenderBlock.h:
850         (WebCore::RenderBlock::containsFloats):
851         (WebCore::RenderBlock::FloatingObject::FloatingObject):
852         * rendering/bidi.cpp:
853         (WebCore::RenderBlock::layoutInlineChildren):
854         (WebCore::RenderBlock::matchedEndLine):
855
856 2008-03-17  Dan Bernstein  <mitz@apple.com>
857
858         Reviewed by Dave Hyatt.
859
860         - allow incremental relayout of blocks that contain floats
861
862         Tests: fast/repaint/line-flow-with-floats-[1-9].html
863
864         * rendering/RenderBlock.cpp:
865         (WebCore::RenderBlock::clearFloatsIfNeeded): Cleaned up by moving most
866         of the function body out of an if statement which was replaced with an
867         early return.
868         (WebCore::RenderBlock::insertFloatingObject): Cleaned up by moving most
869         of the function body out of an if statement and moving the ASSERT, which
870         is a crash in release builds, to the beginning. Made this function set
871         the m_isDescendant flag of floating objects it creates.
872         (WebCore::RenderBlock::removeFloatingObject): Added a call to
873         markLinesDirtyInVerticalRange() when removing a float from a block with
874         inline children.
875         (WebCore::RenderBlock::markLinesDirtyInVerticalRange): Added. Marks the
876         lines in the given range as dirty.
877         (WebCore::RenderBlock::clearFloats): Added code to detect changes to
878         the geometry of floats intruding into this block from other blocks and
879         mark any lines whose available width has changed as a result as dirty.
880
881         * rendering/RenderBlock.h:
882         (WebCore::RenderBlock::FloatWithRect::FloatWithRect): Added a structure
883         to cache a float with its position and size.
884         (WebCore::RenderBlock::FloatingObject::FloatingObject): Added an
885         m_isDescendant flag, used by clearFloats() to distinguish between floats
886         entering the block from outside and floats internal to the block.
887
888         * rendering/RootInlineBox.h:
889         (WebCore::RootInlineBox::floats): Added.
890         (WebCore::RootInlineBox::floatsPtr): Added.
891         (WebCore::RootInlineBox::Overflow::Overflow): Added a data member to
892         hold the floats originating on the line.
893
894         * rendering/bidi.cpp:
895         (WebCore::RenderBlock::layoutInlineChildren): Made the existence of
896         floats not force a full layout. Changed to cache the geometry of floats
897         in the block and detect changes to it. If a float's size or position
898         changes, all lines from that point on are treated as dirty. An exception
899         is a change in the dimensions of a float on an otherwise-clean line,
900         which only dirties lines potentially affected by the change (see
901         determineStartPosition()). Added code to update each RootInlineBox's
902         set of floats as lines are laid out. Added code to shift floats
903         belonging to clean lines in the end along with the lines.
904         (WebCore::RenderBlock::determineStartPosition): Made this function look
905         for changes to floats' dimensions and mark lines as dirty accordingly.
906         Also look for new floats and if found, cause a full layout. Added code
907         to re-add floats belonging to clean lines.
908         (WebCore::RenderBlock::matchedEndLine): Added checking that the clean
909         lines in the end can be shifted vertically as needed, i.e. that the
910         available width along the way is uniform.
911
912 2008-03-17  Eric Seidel  <eric@webkit.org>
913
914         Reviewed by darin.
915
916         Fix _NPN_IntFromIdentifier (and export the symbol for use!)
917
918         Test: plugins/netscape-identifier-conversion.html
919
920         * WebCore.NPAPI.exp:
921         * bridge/npruntime.cpp:
922         (_NPN_IntFromIdentifier):
923
924 2008-03-17  Sam Weinig  <sam@webkit.org>
925
926         Reviewed by Dan Bernstein.
927
928         Add HTMLCollection constructor to the Window object. (Omission noticed by Harri Porten)
929
930         * page/DOMWindow.idl: 
931
932 2008-03-17  Holger Hans Peter Freyther  <zecke@selfish.org>
933
934         Unreviewed Gtk+ build fix.
935
936         * platform/gtk/ScrollViewGtk.cpp: remove const
937
938 2008-03-17  Julien Chaffraix  <julien.chaffraix@gmail.com>
939
940         Reviewed by Holger.
941
942         <http://bugs.webkit.org/show_bug.cgi?id=17754>
943
944         - Implement ResourceHandle::loadResourceSynchronously to dispatch synchronous
945           requests.
946
947         - Implement WebCoreSynchronousLoader, the ResourceHandleClient which holds
948           the network data, response and error for us during the transfert.
949
950         * platform/network/ResourceHandleInternal.h: Remove trailing white space.
951         * platform/network/curl/ResourceHandleCurl.cpp: Add WebCoreSynchronousLoader
952         (WebCore::WebCoreSynchronousLoader::resourceResponse):
953         (WebCore::WebCoreSynchronousLoader::resourceError):
954         (WebCore::WebCoreSynchronousLoader::data):
955         (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader):
956         (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
957         (WebCore::WebCoreSynchronousLoader::didReceiveData):
958         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
959         (WebCore::WebCoreSynchronousLoader::didFail):
960         (WebCore::ResourceHandle::loadResourceSynchronously): Implement method
961         using WebCoreSynchronousLoader.
962
963         * platform/network/curl/ResourceHandleManager.cpp:
964         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
965         (WebCore::ResourceHandleManager::startJob):
966         (WebCore::ResourceHandleManager::initializeHandle): Handle initialization
967         method used both for synchronous and asynchronous job.
968
969         * platform/network/curl/ResourceHandleManager.h:
970
971 2008-03-17  Darin Adler  <darin@apple.com>
972
973         - try to fix GTK build
974
975         * platform/ScrollView.h: Make setGtkAdjustments adjustment.
976         And non-virtual (why was it virtual?).
977
978 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
979
980         Fix Bug 17898: Split PluginMessageThrottlerWin into its own files
981
982         <http://bugs.webkit.org/show_bug.cgi?id=17898>
983
984         Move the PluginMessageThrottlerWin class into its own files, in
985         preparation for refactoring PluginView code to be shared.
986
987         Reviewed and tweaked by Adam Roben.
988
989         * WebCore.vcproj/WebCore.vcproj:
990         * plugins/PluginView.h:
991         * plugins/win/PluginMessageThrottlerWin.cpp: Added.
992         * plugins/win/PluginMessageThrottlerWin.h: Added.
993         * plugins/win/PluginViewWin.cpp:
994
995 2008-03-17  Adam Roben  <aroben@apple.com>
996
997         More Windows build fixes after r31098
998
999         * platform/ScrollView.h: Make some more methods public.
1000
1001 2008-03-17  Adam Roben  <aroben@apple.com>
1002
1003         Windows and Qt build fixes after r31098
1004
1005         * platform/ScrollView.h: Mark methods public that still need to be so.
1006
1007 2008-03-16  Timothy Hatcher  <timothy@apple.com>
1008
1009         Reviewed by Darin Adler.
1010
1011         Bug 17883: Console completion should support bracket notation
1012         http://bugs.webkit.org/show_bug.cgi?id=17883
1013
1014         Also fixes a bug where the Inspector's window object was used instead of the
1015         inspected window object.
1016
1017         * page/inspector/ConsolePanel.js:
1018         (WebInspector.ConsolePanel.complete): Add a comment about the _backwardsRange call.
1019         (WebInspector.ConsolePanel.completions): Add a comment about the _backwardsRange call.
1020         Check the last character of the expression for a dot or bracket. Fallback
1021         to the InspectorController.inspectedWindow() instead of window, this was a bad bug.
1022         If the expression caused an exception, just consider the prefix a window property.
1023         When bracket notation is used remember what quote was used and compared property names
1024         with that quote surrounding it. Also escape the property name for the quote and backslash.
1025
1026 2008-03-17  Robert Blaut  <webkit@blaut.biz>
1027
1028         Reviewed by Darin.
1029
1030         Fix for bug http://bugs.webkit.org/show_bug.cgi?id=17696
1031         Set default margin-bottom for form element in quirk mode
1032         and be compatible with Gecko.
1033
1034         Tests: fast/css/margin-bottom-form-element-quirk.html
1035                fast/css/margin-bottom-form-element-strict.html
1036
1037         * css/html4.css:
1038         * css/quirks.css:
1039
1040 2008-03-17  Antti Koivisto  <antti@apple.com>
1041
1042         Reviewed by Darin.
1043
1044         Speculative fix for http://bugs.webkit.org/show_bug.cgi?id=17878
1045         Bug 17878: REGRESSION: Acid3 sometimes crashes Webkit under WebCore::Loader::Host::cancelRequests
1046         
1047         I can't reproduce the crash or make a test case for this one but I'm pretty sure this
1048         is the problem. Essentially the same bug as http://bugs.webkit.org/show_bug.cgi?id=17862
1049         except in didFail() instead of didFinishLoading().
1050
1051         * loader/loader.cpp:
1052         (WebCore::Loader::Host::didFail):
1053
1054 2008-03-17  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
1055
1056         Reviewed and tweaked by Darin.
1057
1058         http://bugs.webkit.org/show_bug.cgi?id=17172
1059         Refactor platform checks in ScrollView.h
1060
1061         * platform/ScrollView.h: Change #ifs around.
1062
1063 2008-03-17  Yuzhu Shen  <yuzhu.shen@gmail.com>
1064
1065         Reviewed by Darin.
1066
1067         Fix the bug: http://bugs.webkit.org/show_bug.cgi?id=17760
1068         It is necessary to load the image even when src="".
1069
1070         Test: fast/images/load-img-with-empty-src.html
1071
1072         * html/HTMLImageLoader.cpp:
1073         (WebCore::HTMLImageLoader::updateFromElement): isNull rather than isEmpty.
1074
1075 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
1076
1077         Fix GTK+ build from r31094.
1078
1079         * plugins/gtk/PluginDatabaseGtk.cpp:
1080         (PluginDatabase::getPluginsInPaths):
1081
1082 2008-03-17  Adam Roben  <aroben@apple.com>
1083
1084         Fix Bug 17876: REGRESSION (r31060): Attempting to visit Ofcom page causes crash
1085
1086         <http://bugs.webkit.org/show_bug.cgi?id=17876>
1087
1088         Reviewed by John.
1089
1090         Test: fast/dom/remove-named-attribute-crash.html
1091
1092         * dom/NamedAttrMap.cpp:
1093         (WebCore::NamedAttrMap::removeAttribute): Store the Attribute we're
1094         going to remove from the m_attributes Vector in a RefPtr so it doesn't
1095         get deleted when it is removed from the Vector.
1096
1097 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
1098
1099         Reviewed by Adam Roben.
1100
1101         Implement PluginDatabase for GTK+ with PluginDatabaseGtk.cpp.
1102         Remove implemented methods from TemporaryLinkStubs.
1103
1104         * GNUmakefile.am:
1105         * plugins/gtk:
1106         * plugins/gtk/PluginDatabaseGtk.cpp:
1107         * platform/gtk/TemporaryLinkStubs.cpp:
1108
1109 2008-03-17  Simon Hausmann  <hausmann@webkit.org>
1110
1111         Fix the Qt build.
1112
1113         * platform/text/qt/TextCodecQt.cpp:
1114         (WebCore::TextCodecQt::encode):
1115         * platform/text/qt/TextCodecQt.h:
1116
1117 2008-03-16  Maciej Stachowiak  <mjs@apple.com>
1118
1119         Not reviewed, just fixing an incomplete comment from the last commit.
1120
1121         * dom/Range.cpp:
1122         (WebCore::Range::surroundContents):
1123
1124 2008-03-16  Maciej Stachowiak  <mjs@apple.com>
1125
1126         Reviewed by Darin.
1127
1128         - fixed "Acid3 expects different exceptions for surroundContents calls involving comment nodes (affects Acid3 test 11)"
1129         http://bugs.webkit.org/show_bug.cgi?id=17509
1130         
1131         This gets us to 92/100
1132
1133         * dom/Range.cpp:
1134         (WebCore::Range::surroundContents): Check for
1135         HIERARCHY_REQUEST_ERR before BAD_BOUNDARYPOINTS_ERR, since Acid3
1136         expects exceptional conditions to be tested in the order that the
1137         spec lists them. Also, adjust the HIERARCHY_REQUEST_ERR check. If
1138         the start point of the range is in a comment node, the node that
1139         would be the parent of a partial replacement is actually the
1140         comment node's parent (since comment nodes have character
1141         indices), so we should do the HIERARCHY_REQUEST_ERR check based on
1142         the parent of the comment node, as for text nodes, even though it
1143         will fail later with a different exception because it is not
1144         allowed to surround a partially selected non-text node.
1145
1146 2008-03-16  Marvin Decker  <marv.decker@gmail.com>
1147
1148         Reviewed by Darin.
1149
1150         Fix bug 15119: URL query characters that are unencodable in the
1151         request's character set should be converted to XML entities with
1152         non-alphanumeric characters escaped.
1153
1154         Test: http/tests/uri/escaped-entity.html
1155
1156         * html/FormDataList.cpp:
1157         (WebCore::FormDataList::appendString):
1158         * html/HTMLFormElement.cpp:
1159         (WebCore::HTMLFormElement::formData):
1160         * platform/KURL.cpp:
1161         (WebCore::encodeRelativeString):
1162         * platform/text/String.cpp:
1163         (WebCore::String::latin1):
1164         (WebCore::String::utf8):
1165         * platform/text/TextCodec.cpp:
1166         (WebCore::TextCodec::unencodableCharReplacement):
1167         * platform/text/TextCodec.h:
1168         (WebCore::):
1169         * platform/text/TextCodecICU.cpp:
1170         (WebCore::urlEscapedEntityCallback):
1171         (WebCore::gbkUrlEscapedEntityCallack):
1172         (WebCore::TextCodecICU::encode):
1173         * platform/text/TextCodecICU.h:
1174         (WebCore::TextCodecICU::setNeedsGBKFallbacks):
1175         * platform/text/TextCodecLatin1.cpp:
1176         (WebCore::encodeComplexWindowsLatin1):
1177         (WebCore::TextCodecLatin1::encode):
1178         * platform/text/TextCodecLatin1.h:
1179         * platform/text/TextCodecUTF16.cpp:
1180         (WebCore::TextCodecUTF16::encode):
1181         * platform/text/TextCodecUTF16.h:
1182         * platform/text/TextCodecUserDefined.cpp:
1183         (WebCore::encodeComplexUserDefined):
1184         (WebCore::TextCodecUserDefined::encode):
1185         * platform/text/TextCodecUserDefined.h:
1186         * platform/text/TextEncoding.cpp:
1187         (WebCore::TextEncoding::encode):
1188         * platform/text/TextEncoding.h:
1189         * platform/text/mac/TextCodecMac.cpp:
1190         (WebCore::TextCodecMac::encode):
1191         * platform/text/mac/TextCodecMac.h:
1192         * xml/XMLHttpRequest.cpp:
1193         (WebCore::XMLHttpRequest::send):
1194
1195 2008-03-16  Kevin Ollivier  <kevino@theolliviers.com>
1196
1197         Rubber stamped by Darin.
1198
1199         Add set-webkit-configuration support for wx port, and centralize
1200         build dir location setting.
1201
1202         http://bugs.webkit.org/show_bug.cgi?id=17790
1203
1204         * webcore-base.bkl:
1205
1206 2008-03-16  Darin Adler  <darin@apple.com>
1207
1208         Reviewed by Mark Rowe.
1209
1210         - http://bugs.webkit.org/show_bug.cgi?id=17881
1211           a little cleanup for HTMLTextAreaElement
1212
1213         Tests: fast/forms/textarea-default-value-leading-newline.html
1214                fast/forms/textarea-linewrap-dynamic.html
1215
1216         * html/HTMLTextAreaElement.cpp:
1217         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Tweaked names/
1218         (WebCore::HTMLTextAreaElement::selectionStart): Ditto, also use early return
1219         and check for < 0 rather than -1 specifically.
1220         (WebCore::HTMLTextAreaElement::selectionEnd): Ditto.
1221         (WebCore::HTMLTextAreaElement::setSelectionStart): Early return.
1222         (WebCore::HTMLTextAreaElement::setSelectionEnd): Ditto.
1223         (WebCore::HTMLTextAreaElement::select): Ditto.
1224         (WebCore::HTMLTextAreaElement::setSelectionRange): Ditto.
1225         (WebCore::HTMLTextAreaElement::parseMappedAttribute): Changed value parsing
1226         to treat unknown values as meaning "default" rather than "leave value as-is".
1227         Only call setNeedsLayoutAndPrefWidthsRecalc when mode changed.
1228         (WebCore::HTMLTextAreaElement::createRenderer): Removed name of unused argument.
1229         (WebCore::HTMLTextAreaElement::appendFormData): Updated for name changes.
1230         (WebCore::HTMLTextAreaElement::isKeyboardFocusable): Got rid of unnneeded explicit
1231         class name in isFocusable call.
1232         (WebCore::HTMLTextAreaElement::isMouseFocusable): Ditto.
1233         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Tweaked formatting.
1234         (WebCore::HTMLTextAreaElement::defaultEventHandler): Ditto.
1235         (WebCore::HTMLTextAreaElement::updateValue): Early return.
1236         (WebCore::HTMLTextAreaElement::setValue): Got rid of intermediate value to
1237         eliminate on small refcount churn.
1238         (WebCore::HTMLTextAreaElement::defaultValue): Got rid of unneeded redundant
1239         string length checks, since String already checks all indexing and returns 0.
1240         (WebCore::HTMLTextAreaElement::setDefaultValue): Added code to normalize
1241         line endings and add a leading line ending to fix cases where the first
1242         character is a newline.
1243         (WebCore::HTMLTextAreaElement::accessKeyAction): Removed name of unused arg.
1244         (WebCore::HTMLTextAreaElement::accessKey): Changed return value to avoid
1245         refcount churn.
1246         (WebCore::HTMLTextAreaElement::selection): Updated names and use < 0 instead
1247         of -1 specifically.
1248
1249         * html/HTMLTextAreaElement.h: Replaced wrap function with more-specific
1250         shouldWrapText one. Changed return value of accessKey. Made WrapMethod enum
1251         provate and renamed the values. Renamed cachedSelStart and cachedSelEnd to
1252         m_cachedSelectionStart and m_cachedSelectionEnd.
1253
1254         * rendering/RenderTextControl.cpp:
1255         (WebCore::RenderTextControl::createInnerTextStyle): Updated for change to
1256         HTMLTextAreaElement wrap function.
1257
1258 2008-03-16  Antti Koivisto  <antti@apple.com>
1259
1260         Reviewed by Mitz.
1261
1262         Fix http/tests/security/frame-loading-via-document-write.html
1263         which was broken by the preload patch.
1264         
1265         Don't print error message when preload fails local file security check.
1266         Some minor refactoring.
1267
1268         * html/PreloadScanner.cpp:
1269         (WebCore::PreloadScanner::emitTag):
1270         (WebCore::PreloadScanner::emitCSSRule):
1271         * loader/Cache.cpp:
1272         (WebCore::Cache::requestResource):
1273         * loader/Cache.h:
1274         * loader/DocLoader.cpp:
1275         (WebCore::DocLoader::requestResource):
1276         (WebCore::DocLoader::preload):
1277         (WebCore::DocLoader::printPreloadStats):
1278         * loader/DocLoader.h:
1279
1280 2008-03-16  Antti Koivisto  <antti@apple.com>
1281
1282         Reviewed by Darin.
1283         
1284         Fix http://bugs.webkit.org/show_bug.cgi?id=17862
1285         REGRESSION (r31038): Reproducible crash under DocLoader::checkForReload() at marware.com
1286         
1287         This was a memory smasher introduced by the preloading patch. 
1288         If a script resource was marked uncacheable, early deletion of the 
1289         Request object would cause deletion of the CachedResource too if
1290         it was referred more than once in a single document.
1291
1292         Test: http/tests/misc/uncacheable-script-repeated.html
1293
1294         * loader/loader.cpp:
1295         (WebCore::Loader::Host::servePendingRequests):
1296         (WebCore::Loader::Host::didFinishLoading):
1297
1298 2008-03-16  Yuzhu Shen  <yuzhu.shen@gmail.com>
1299
1300         Reviewed by Darin.
1301
1302         Fix bug http://bugs.webkit.org/show_bug.cgi?id=17714
1303         <img href="#"> should go to top of the page.
1304
1305         Test: fast/html/empty-fragment-id-goto-top.html
1306
1307         * loader/FrameLoader.cpp:
1308         (WebCore::FrameLoader::gotoAnchor):
1309
1310 2008-03-16  Thiago Macieira  <thiago.macieira@trolltech.com>
1311
1312         Reviewed by Darin.
1313
1314         Don't use RefPtr in classes you haven't seen the implementation of.
1315
1316         Forward-declaration and declaration of RefPtr<Foo> is ok. But you
1317         cannot *use* said objects until Foo is defined. This is true even for
1318         initialisation with a 0.
1319
1320         Seems the HP aCC compiler is more strict here than gcc.
1321
1322         * editing/SplitTextNodeCommand.h:
1323         * page/FrameTree.h:
1324         * xml/XPathExpressionNode.h:
1325
1326 2008-03-16  Darin Adler  <darin@apple.com>
1327
1328         Reviewed by Mitz.
1329
1330         - fix http://bugs.webkit.org/show_bug.cgi?id=14941
1331           <rdar://problem/5404093> textarea value from JavaScript includes extra newline
1332
1333         Test: fast/forms/textarea-trailing-newline.html
1334
1335         * rendering/RenderTextControl.cpp:
1336         (WebCore::RenderTextControl::finishText): Added code to strip the trailing
1337         newline. It's possible there are some obscure cases where this is not wanted,
1338         but I couldn't find any. If someone finds a case where this is bad, we can
1339         make the code conditional.
1340
1341 2008-03-16  Darin Adler  <darin@apple.com>
1342
1343         Reviewed by Mitz.
1344
1345         - fix http://bugs.webkit.org/show_bug.cgi?id=17876
1346           Attempting to visit Ofcom page causes crash
1347
1348         This is causing intermittent crashes on some existing test cases on the buildbot
1349         too; I don't have a 100% test case right now, but it should be easy to add one later
1350         and this does fix a crash in a test we already have.
1351
1352         * dom/CharacterData.cpp:
1353         (WebCore::CharacterData::CharacterData): Initialize m_data to the empty string,
1354         not the null string. The class assumes the string can never being null.
1355         (WebCore::CharacterData::setData): If asked to set the data to the null string,
1356         set it to the empty string instead. This matches what the (non-empty) constructor
1357         has always done.
1358
1359 2008-03-15  Timothy Hatcher  <timothy@apple.com>
1360
1361         Reviewed by Adam Roben.
1362
1363         Bug 17870: Web Inspector console should feel more like a terminal
1364         http://bugs.webkit.org/show_bug.cgi?id=17870
1365
1366         Bug 14390: Console input area should be more noticeable
1367         http://bugs.webkit.org/show_bug.cgi?id=14390
1368
1369         Adds tab completion, auto completion and a blended input prompt.
1370         The prompt is also focused when the console is shown.
1371            Implements a new look, that will be part of the UI refresh.
1372
1373         * page/inspector/ConsolePanel.js: 
1374         (WebInspector.ConsolePanel): Renamed a few properties.
1375         (WebInspector.ConsolePanel.get/set promptText): Property to set
1376         and get the current prompt text. Does not affect command history.
1377         (WebInspector.ConsolePanel.show): Make the prompt focus on show.
1378         (WebInspector.ConsolePanel.acceptAutoComplete): Accepts any
1379         pending auto complete text.
1380         (WebInspector.ConsolePanel.clearAutoComplete): Cancels any pending
1381         auto complete text.
1382         (WebInspector.ConsolePanel.autoCompleteSoon): Sets a timeout to auto
1383         complete in 250 ms, only if there isn't a pending auto complete.
1384         (WebInspector.ConsolePanel.complete): 
1385         (WebInspector.ConsolePanel.completions): Generate a list of possible
1386         completions based on the prefix and the previous expression ranges.
1387         (WebInspector.ConsolePanel._backwardsRange): Helper to scan backwards
1388         from a node and offset to find a start node and offset of the first
1389         character found in the characters string.
1390         (WebInspector.ConsolePanel._evalInInspectedWindow): Helper to eval in the
1391         inspected window.
1392         (WebInspector.ConsolePanel._caretInsidePrompt): Returns true if the selection
1393         is collapsed and is inside the prompt element.
1394         (WebInspector.ConsolePanel._moveCaretToEndOfPrompt): Moves the selection
1395         to the end of the prompt.
1396         (WebInspector.ConsolePanel._onTabPressed): Calls complete on
1397         tab press.
1398         (WebInspector.ConsolePanel._onEnterPressed): Call clearAutoComplete so the
1399         autocompletion text is not evaluated.
1400
1401         * page/inspector/Images/errorIcon.png: New image.
1402         * page/inspector/Images/userInputIcon.png: Added.
1403         * page/inspector/Images/userInputPreviousIcon.png: Added.
1404         * page/inspector/Images/warningIcon.png: New image.
1405         * page/inspector/inspector.css: New refreshed UI.
1406
1407 2008-03-15  Mark Mentovai  <mark@moxienet.com>
1408
1409         Reviewed and landed by Darin.
1410
1411         - http://bugs.webkit.org/show_bug.cgi?id=17833
1412           use file extensions instead of explicit file types in WebCore's Xcode project
1413
1414         * WebCore.xcodeproj/project.pbxproj: Remove unnecessary
1415           uses of explicitFileType, preferring lastKnownFileType ("File Type:
1416           Default for File" in Xcode's File Info's General tab).  Files below
1417           that relied on an explicit file type setting other than what would
1418           be implied by their extensions have been renamed to have correct
1419           extensions.
1420         * bridge/jni/jni_jsobject.cpp: Removed.
1421         * bridge/jni/jni_jsobject.mm: Copied from bridge/jni/jni_jsobject.cpp.
1422         * loader/mac/LoaderNSURLExtras.m: Removed.
1423         * loader/mac/LoaderNSURLExtras.mm: Copied from loader/mac/LoaderNSURLExtras.m.
1424         * platform/mac/SharedTimerMac.cpp: Removed.
1425         * platform/mac/SharedTimerMac.mm: Copied from platform/mac/SharedTimerMac.cpp.
1426
1427 2008-03-15  Darin Adler  <darin@apple.com>
1428
1429         Reviewed by Sam.
1430
1431         - fix http://bugs.webkit.org/show_bug.cgi?id=11997
1432           Ranges are not fixed after mutation (affects Acid3 test 13)
1433
1434         Test: fast/dom/Range/mutation.html
1435
1436         * WebCore.xcodeproj/project.pbxproj: Added NodeWithIndex.h, NodeWithIndexAfter.h,
1437         and NodeWithIndexBefore.h.
1438
1439         * dom/CharacterData.cpp:
1440         (WebCore::CharacterData::setData): Replaced call to Document::removeMarkers
1441         with call to Document::textRemoved.
1442         (WebCore::CharacterData::insertData): Replaced call to Document::shiftMarkers
1443         with call to Document::textInserted.
1444         (WebCore::CharacterData::deleteData): Replaced call to Document::removeMarkers
1445         and Document::shiftMarkers with call to Document::textRemoved.
1446         (WebCore::CharacterData::replaceData): Replaced call to Document::removeMarkers
1447         and Document::shiftMarkers with call to Document::textRemoved and
1448         Document::textInserted.
1449         (WebCore::CharacterData::containsOnlyWhitespace): Tweaked a bit.
1450
1451         * dom/ContainerNode.cpp:
1452         (WebCore::ContainerNode::childrenChanged): Added a call to
1453         Document::nodeChildrenChanged when the nmber of children was changed (and not
1454         by the parser).
1455         (WebCore::dispatchChildRemovalEvents): Updated for name change.
1456
1457         * dom/Document.cpp:
1458         (WebCore::Document::~Document): Assert that all ranges are gone.
1459         (WebCore::Document::nodeChildrenChanged): Added. Calls nodeChildrenChanged on
1460         all ranges.
1461         (WebCore::Document::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
1462         Added code to call nodeWillBeRemoved on all ranges.
1463         (WebCore::Document::textInserted): Added. Calls textInserted on all ranges and
1464         also calls shiftMarkers.
1465         (WebCore::Document::textRemoved): Added. Calls textRemoved on all ranges and also
1466         calls removeMarkers and shiftMarkers.
1467         (WebCore::Document::textNodesMerged): Added. Calls textNodesMerged on all ranges.
1468         (WebCore::Document::textNodeSplit): Added. Calls textNodeSplit on all ranges.
1469         (WebCore::Document::attachRange): Added. Adds range to the HashSet of all ranges
1470         for this document.
1471         (WebCore::Document::detachRange): Added. Removes range from the HashSet.
1472         * dom/Document.h: Added the new functions and the data member.
1473
1474         * dom/Element.cpp:
1475         (WebCore::Element::normalizeAttributes): Added. Contains the part of the
1476         normalize function that's specific to Element. Better encapsulation to have it
1477         here rather than in Node::normalize.
1478         * dom/Element.h: Added the new function.
1479
1480         * dom/Node.cpp:
1481         (WebCore::Node::normalize): Rewrote so it's no longer recursive. Also added
1482         a call to textNodesMerged after each pair of nodes is merged but before the
1483         second node is removed.
1484         (WebCore::Node::traverseNextNodePostOrder): Added. Helper function used by
1485         normalize, but also useful elsewhere.
1486         * dom/Node.h: Added the new function.
1487
1488         * dom/NodeIterator.cpp:
1489         (WebCore::NodeIterator::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
1490         * dom/NodeIterator.h: Ditto.
1491
1492         * dom/ProcessingInstruction.cpp:
1493         (WebCore::ProcessingInstruction::setData): Call textRemoved.
1494
1495         * dom/Range.cpp:
1496         (WebCore::NodeWithIndex::index): Added. Computes and stores index.
1497         (WebCore::NodeWithIndexBefore::indexBefore): Added. Computes and stores index.
1498         (WebCore::NodeWithIndexAfter::indexAfter): Added. Computes and stores index.
1499         (WebCore::Range::Range): Call attachRange.
1500         (WebCore::Range::~Range): Call detachRange unless the range is already detached.
1501         (WebCore::Range::commonAncestorContainer): Removed check for WRONG_DOCUMENT_ERR.
1502         It's no longer possible to create a range where the two containers are non-zero
1503         and have no common ancestor.
1504         (WebCore::Range::isPointInRange): Rewrote expression to be more readable.
1505         (WebCore::Range::compareNode): Changed local variable to use int for consistency.
1506         (WebCore::Range::compareBoundaryPoints): Replaced ASSERT with ASSERT_NOT_REACHED.
1507         (WebCore::Range::deleteContents): Removed check for INVALID_STATE_ERR and
1508         initialization of ec to 0; both are now inside checkDeleteExtract.
1509         (WebCore::Range::intersectsNode): Changed local variable to use int for consistency.
1510         Also changed comparison to use < 0 and >= 0 rather than checking explicitly for 1
1511         and -1.
1512         (WebCore::Range::processContents): Changed code to not get the nodeType multiple
1513         times on the same node, and tweaked formatting. Removed code to update the range
1514         on deletion, because the normal delete logic will take care of that now.
1515         (WebCore::Range::extractContents): Removed check for INVALID_STATE_ERR and
1516         initialization of ec to 0; both are now inside checkDeleteExtract.
1517         (WebCore::Range::insertNode): Changed local variable to use int for consistency.
1518         (WebCore::Range::toString): Changed variable name to pastLast.
1519         (WebCore::Range::detach): Call detachRange.
1520         (WebCore::Range::checkDeleteExtract): Added check for detached range and code to
1521         set ec to 0; moved here from the two callers. Also changed variable name to pastLast.
1522         (WebCore::endpointNodeChildrenChanged): Added.
1523         (WebCore::Range::nodeChildrenChanged): Added.
1524         (WebCore::endpointNodeWillBeRemoved): Added.
1525         (WebCore::Range::nodeWillBeRemoved): Added.
1526         (WebCore::endpointTextInserted): Added.
1527         (WebCore::Range::textInserted): Added.
1528         (WebCore::endpointTextRemoved): Added.
1529         (WebCore::Range::textRemoved): Added.
1530         (WebCore::endpointTextNodesMerged): Added.
1531         (WebCore::Range::textNodesMerged): Added.
1532         (WebCore::endpointTextNodesSplit): Added.
1533         (WebCore::Range::textNodeSplit): Added.
1534
1535         * dom/Range.h: Added new member functions.
1536
1537         * dom/NodeWithIndex.h: Added. Makes it so we won't find the index for the same
1538         node more than once.
1539         * dom/NodeWithIndexAfter.h: Added. Similar to NodeWithIndex but gives the index after a
1540         node and treats a node pointer of 0 as meaning "before first node in parent container".
1541         * dom/NodeWithIndexBefore.h: Added.  Similar to NodeWithIndex but treats a node pointer of 0
1542         as meaning "after last node in parent container".
1543
1544         * dom/Text.cpp:
1545         (WebCore::Text::splitText): Call textNodeSplit.
1546
1547         * editing/ApplyStyleCommand.cpp:
1548         (WebCore::ApplyStyleCommand::applyInlineStyle): Changed variable name to pastLast.
1549
1550 2008-03-15  Julien Chaffraix  <julien.chaffraix@gmail.com>
1551
1552         Reviewed by Holger.
1553
1554         [CURL] Crash below ResourceHandleManager::setupPOST when job->request().httpBody() is NULL
1555         http://bugs.webkit.org/show_bug.cgi?id=16906
1556
1557         Add null checks for httpBody() to match other ports.
1558
1559         Test: http/tests/xmlhttprequest/xmlhttprequest-post-crash.html
1560
1561         * platform/network/curl/ResourceHandleManager.cpp:
1562         (WebCore::readCallback): Add null check.
1563         (WebCore::ResourceHandleManager::setupPOST): Ditto.
1564
1565 2008-03-14  Steve Falkenburg  <sfalken@apple.com>
1566
1567         PGO build fixes.
1568
1569         * WebCore.vcproj/WebCore.vcproj:
1570
1571 2008-03-14  Anders Carlsson  <andersca@apple.com>
1572
1573         Reviewed by Sam.
1574
1575         <rdar://problem/5794989>
1576         https://bugs.webkit.org/show_bug.cgi?id=17792
1577         REGRESSION (Safari 3.0.4-3.1): Ordering tickets from Sweden's biggest train operator doesn't work
1578
1579         Pass the frame loader that should be used for looking up the frame name to FrameLoader::createWindow
1580         so that somewindow.open calls where the active window and 'somewindow' differ return the correct frame.
1581         
1582         * bindings/js/JSDOMWindowBase.cpp:
1583         (WebCore::createWindow):
1584         * loader/FrameLoader.cpp:
1585         (WebCore::FrameLoader::createWindow):
1586         * loader/FrameLoader.h:
1587
1588 2008-03-14  Dan Bernstein  <mitz@apple.com>
1589
1590         Reviewed by Mark Rowe.
1591
1592         - fix <rdar://problem/5797836> shadow offsets are smaller than specified
1593
1594         * platform/graphics/cg/GraphicsContextCG.cpp:
1595         (WebCore::GraphicsContext::setShadow): Made the workaround for
1596         <rdar://problem/5539388> unconditional.
1597
1598 2008-03-14  Adam Roben  <aroben@apple.com>
1599
1600         Fix it right this time
1601
1602         * platform/MainThread.cpp: Cast to unsigned so we can use %u in the
1603         format string.
1604         * platform/mac/MainThreadMac.mm:
1605
1606 2008-03-14  Adam Roben  <aroben@apple.com>
1607
1608         Mac build fix
1609
1610         * platform/mac/MainThreadMac.mm: Corrected a typo.
1611
1612 2008-03-14  Dan Bernstein  <mitz@apple.com>
1613
1614         Reviewed by Darin Adler.
1615
1616         - fix http://bugs.webkit.org/show_bug.cgi?id=17834
1617           REGRESSION: floated first-letter does not work when included in table
1618
1619         Test: fast/css/first-letter-float.html
1620
1621         * rendering/RenderBlock.cpp:
1622         (WebCore::RenderBlock::updateFirstLetter): Changed the search for the
1623         first text node to stop at a float if that float is an existing first-
1624         letter.
1625
1626 2008-03-14  Sam Weinig  <sam@webkit.org>
1627
1628         Fix Mac build
1629
1630         * WebCore.xcodeproj/project.pbxproj:
1631
1632 2008-03-13  Adam Roben  <aroben@apple.com>
1633
1634         Make most of callOnMainThread's implementation be cross-platform
1635
1636         I took the non-platform-specific parts of MainThreadWin.cpp and moved
1637         them to a new MainThread.cpp. Each platform is now responsible for
1638         implementing one function, scheduleDispatchFunctionsOnMainThread,
1639         which is supposed to set things up so that
1640         dispatchFunctionsFromMainThread gets called from the main thread in
1641         the near future.
1642
1643         Reviewed by Alexey.
1644
1645         * GNUmakefile.am: Added MainThread.cpp to the project.
1646         * WebCore.pro: Ditto.
1647         * WebCore.vcproj/WebCore.vcproj: Ditto.
1648         * WebCore.xcodeproj/project.pbxproj: Ditto.
1649         * WebCoreSources.bkl: Ditto.
1650         * platform/MainThread.cpp:
1651           - Copied from WebCore/platform/win/MainThreadWin.cpp.
1652           - Removed the Windows-specific parts.
1653         (WebCore::callOnMainThread): Changed to call
1654         scheduleDispatchFunctionsOnMainThread instead of PostMessage.
1655         * platform/gtk/MainThreadGtk.cpp:
1656         (WebCore::timeoutFired): Renamed from callFunctionOnMainThread. Now
1657         just calls dispatchFunctionsFromMainThread.
1658         (WebCore::scheduleDispatchFunctionsOnMainThread): Added. Calls through
1659         to g_timeout_add.
1660         * platform/mac/MainThreadMac.mm: Renamed WebCoreFunctionWrapper to
1661         WebCoreMainThreadCaller.
1662         (-[WebCoreMainThreadCaller call]): Calls through to
1663         dispatchFunctionsFromMainThread.
1664         (WebCore::scheduleDispatchFunctionsOnMainThread): Makes a new
1665         WebCoreMainThreadCaller and calls performSelectorOnMainThread on it.
1666         * platform/qt/MainThreadQt.cpp: Removed PerformFunctionEvent.
1667         (WebCore::MainThreadInvoker::event): Chagned to call through to
1668         dispatchFunctionsFromMainThread.
1669         (WebCore::scheduleDispatchFunctionsOnMainThread): Sends an empty event
1670         to the MainThreadInvoker.
1671         * platform/win/MainThreadWin.cpp:
1672           - Removed the non-Windows-specific parts.
1673           - Removed some unnecessary initialization of static variables to 0.
1674         (WebCore::ThreadingWindowWndProc): Changed to call
1675         dispatchFunctionsFromMainThread.
1676         (WebCore::scheduleDispatchFunctionsOnMainThread): Calls through to
1677         PostMessage.
1678         * platform/wx/MainThreadWx.cpp:
1679         (WebCore::scheduleDispatchFunctionsOnMainThread): Added.
1680
1681 2008-03-14  Beth Dakin  <bdakin@apple.com>
1682
1683         Reviewed by Geoff.
1684
1685         Fix for <rdar://problem/5728171> Potential PLT speedup: don't 
1686         realloc every time inside NamedAttrMap::addAttribute
1687
1688         The speed-up for this turned out to be so small that it is mostly 
1689         imperceptible. It is likely that it is a tiny boost, though, and 
1690         the new code is much cleaner.
1691
1692         * dom/Element.cpp:
1693         (WebCore::Element::setAttributeMap): attrs is now called 
1694         m_attributes
1695         * dom/NamedAttrMap.cpp: The array attrs is now the Vector of 
1696         RefPtrs called m_attributes, and there is no longer any need for 
1697         the len member variable. 
1698         (WebCore::NamedAttrMap::NamedAttrMap): 
1699         (WebCore::NamedAttrMap::item):
1700         (WebCore::NamedAttrMap::getAttributeItem):
1701         (WebCore::NamedAttrMap::clearAttributes):
1702         (WebCore::NamedAttrMap::operator=):
1703         (WebCore::NamedAttrMap::addAttribute):
1704         (WebCore::NamedAttrMap::removeAttribute):
1705         (WebCore::NamedAttrMap::mapsEquivalent):
1706         * dom/NamedAttrMap.h: Same.
1707         (WebCore::NamedAttrMap::length):
1708         (WebCore::NamedAttrMap::attributeItem):
1709         (WebCore::NamedAttrMap::shrinkToLength):
1710         (WebCore::NamedAttrMap::reserveCapacity):
1711         * html/HTMLTokenizer.cpp: One of the benefits of the old array was 
1712         that it never took up more memory than it needed to. So the 
1713         tokenizer utilizes new member functions on NamedAttrMap 
1714         (shrinkToLength and reserveCapacity) to try to keep memory usage at 
1715         a minimum. 
1716         (WebCore::Token::addAttribute):
1717         (WebCore::HTMLTokenizer::processToken):
1718
1719 2008-03-14  David D. Kilzer  <ddkilzer@apple.com>
1720
1721         BUILD FIX when ENABLE(MAC_JAVA_BRIDGE) set to 0.
1722
1723         * page/mac/FrameMac.mm: Move up #if ENABLE(MAC_JAVA_BRIDGE) guard
1724         to comment out unused code.
1725
1726 2008-03-14  David D. Kilzer  <ddkilzer@apple.com>
1727
1728         Unify concept of enabling the Mac Java bridge.
1729
1730         Reviewed by Darin and Anders.
1731
1732         No test cases added since there is no change in functionality.
1733
1734         * DerivedSources.make: Added check for ENABLE_MAC_JAVA_BRIDGE macro.
1735         If defined as "1", add WebCore.JNI.exp to WEBCORE_EXPORT_DEPENDENCIES.
1736         * WebCore.JNI.exp: Added.
1737         * WebCore.base.exp: Moved exported JNI methods to WebCore.JNI.exp.
1738
1739         * bridge/jni/jni_class.cpp: Added #if ENABLE(MAC_JAVA_BRIDGE) guard.
1740         * bridge/jni/jni_class.h: Ditto.
1741         * bridge/jni/jni_instance.cpp: Ditto.
1742         * bridge/jni/jni_instance.h: Ditto.
1743         * bridge/jni/jni_jsobject.cpp: Ditto.
1744         * bridge/jni/jni_jsobject.h: Ditto.
1745         * bridge/jni/jni_objc.mm: Ditto.
1746         * bridge/jni/jni_runtime.cpp: Ditto.
1747         * bridge/jni/jni_runtime.h: Ditto.
1748         * bridge/jni/jni_utility.cpp: Ditto.
1749         * bridge/jni/jni_utility.h: Ditto.
1750
1751         * bridge/runtime.cpp: Removed unused #include statements.
1752         * bridge/runtime.h:
1753         (KJS::Bindings::Instance::BindingLanguage): Added #if ENABLE(MAC_JAVA_BRIDGE)
1754         guard for JavaLanguage enum.  Also added #if PLATFORM(MAC) guard for
1755         ObjectiveCLanguage enum to match corresponding code in runtime.cpp.
1756
1757         * config.h: Removed definition of HAVE_JNI.
1758
1759         * loader/FrameLoaderClient.h:
1760         (WebCore::FrameLoaderClient::javaApplet): Added #if ENABLE(MAC_JAVA_BRIDGE) guard.
1761         * page/Frame.cpp:
1762         (WebCore::Frame::Frame): Ditto.
1763         * page/Frame.h:
1764         (WebCore::Frame::initJavaJSBindings): Ditto.
1765         * page/mac/FrameMac.mm:
1766         (WebCore::Frame::createScriptInstanceForWidget): Ditto.
1767         (WebCore::Frame::initJavaJSBindings): Ditto.
1768
1769 2008-03-13  Darin Adler  <darin@apple.com>
1770
1771         * html/PreloadScanner.h: Corrected license.
1772         * html/PreloadScanner.cpp: Corrected license.
1773
1774 2008-03-13  Mark Mentovai  <mark@moxienet.com>
1775
1776         Reviewed by darin.  Landed by eseidel.
1777
1778         * platform/FloatConversion.h: Include a header to get CoreGraphics
1779         types when using CoreGraphics types.
1780
1781 2008-03-13  Mark Mentovai  <mark@moxienet.com>
1782
1783         Reviewed by eseidel.  Landed by eseidel.
1784
1785         * WebCore.xcodeproj/project.pbxproj:
1786         * css/CSSParser.cpp:
1787         * css/makeprop.pl:
1788         Move CSSPropertyNames.c to CSSPropertyNames.cpp
1789
1790 2008-03-13  Mark Mentovai  <mark@moxienet.com>
1791
1792         Reviewed by eseidel.  Landed by eseidel.
1793
1794         * platform/Arena.h: Use statement1;statement2 instead of
1795         (statement1,statement2) in CLEAR_UNUSED.
1796
1797 2008-03-13  Tommi Komulainen  <tommi.komulainen@iki.fi>
1798
1799         Reviewed by Alp Toker.
1800
1801         http://bugs.webkit.org/show_bug.cgi?id=17821
1802         [SOUP] POST requests are empty
1803
1804         Send the HTTP request body as well.
1805
1806         * platform/network/soup/ResourceHandleSoup.cpp:
1807         (WebCore::ResourceHandle::start):
1808
1809 2008-03-13  Dan Bernstein  <mitz@apple.com>
1810
1811         Reviewed by Dave Hyatt.
1812
1813         - fix http://bugs.webkit.org/show_bug.cgi?id=17819
1814           Border-collapse: collapse later cell wins on PC, earlier cell on Mac
1815
1816         Test: fast/table/border-collapsing/equal-precedence-resolution.html
1817
1818         * rendering/RenderTableCell.cpp:
1819         (WebCore::RenderTableCell::collapsedLeftBorder): When calling
1820         compareBorders() with borders that may have the same precedence, made
1821         sure to pass the border belonging to the earlier (in document order)
1822         element first, since compareBorders() prefers the first argument when
1823         there is a tie.
1824         (WebCore::RenderTableCell::collapsedRightBorder): Ditto.
1825         (WebCore::RenderTableCell::collapsedTopBorder): Ditto.
1826
1827 2008-03-13  Adam Roben  <aroben@apple.com>
1828
1829         wx build fix and Windows leak fix after r31034
1830
1831         * platform/graphics/wx/ImageWx.cpp:
1832         (WebCore::Image::loadPlatformResource): Use SharedBuffer::create.
1833         * platform/win/SharedBufferWin.cpp:
1834         (WebCore::SharedBuffer::createWithContentsOfFile): Ditto (we were
1835         leaking the SharedBuffer here before).
1836
1837 2008-03-13  Antti Koivisto  <antti@apple.com>
1838
1839         Reviewed by Eric.
1840
1841         Correct a few issues spotted by Mike Belshe. 
1842
1843         * html/PreloadScanner.cpp:
1844         (WebCore::PreloadScanner::tokenize):
1845         * loader/loader.cpp:
1846         (WebCore::Loader::cancelRequests):
1847
1848 2008-03-13  Rodney Dawes  <dobey@wayofthemonkey.com>
1849
1850         Fix GTK+ build for SharedBuffer changes.
1851
1852         * platform/graphics/gtk/ImageGtk.cpp:
1853         (Image::loadPlatformResource):
1854
1855 2008-03-13  Steve Falkenburg  <sfalken@apple.com>
1856
1857         More PGO build fixes.
1858
1859         * WebCorePrefix.cpp:
1860
1861 2008-03-13  Antti Koivisto  <antti@apple.com>
1862
1863         Reviewed by Darin.
1864         
1865         Make page loads go fast.
1866         
1867         http://bugs.webkit.org/show_bug.cgi?id=17480
1868
1869         - Implement speculative preloading. When a script load blocks the main parser, use a side 
1870           parser to pick up more resources.
1871         - Implement per-host load queues, prioritize scripts and stylesheets over images.
1872         
1873         Depending on content and network latency this may speed things up quite a bit.
1874
1875         * WebCore.xcodeproj/project.pbxproj:
1876         * dom/Document.cpp:
1877         (WebCore::Document::implicitClose):
1878         Clear the preloads after laoding completes.
1879         
1880         * html/HTMLLinkElement.cpp:
1881         (WebCore::HTMLLinkElement::parseMappedAttribute):
1882         (WebCore::HTMLLinkElement::tokenizeRelAttribute):
1883         * html/HTMLLinkElement.h:
1884         Make tokenizeRelAttribute() public static so it can be used from elsewhere.
1885         Eliminate a pointless bitfield so I can get references.
1886         
1887         * html/HTMLTokenizer.cpp:
1888         (WebCore::HTMLTokenizer::scriptHandler):
1889         (WebCore::HTMLTokenizer::scriptExecution):
1890         (WebCore::HTMLTokenizer::write):
1891         * html/HTMLTokenizer.h:
1892         Spin up the preload scanner whenever a script load blocks the parser. One scanner tracks the end of 
1893         the document while temporary ones are created as needed to scan document.write() output.
1894         
1895         * html/PreloadScanner.cpp: Added.
1896         (WebCore::PreloadScanner::PreloadScanner):
1897         (WebCore::PreloadScanner::~PreloadScanner):
1898         (WebCore::PreloadScanner::begin):
1899         (WebCore::PreloadScanner::end):
1900         (WebCore::PreloadScanner::reset):
1901         (WebCore::PreloadScanner::write):
1902         (WebCore::isWhitespace):
1903         (WebCore::PreloadScanner::clearLastCharacters):
1904         (WebCore::PreloadScanner::rememberCharacter):
1905         (WebCore::PreloadScanner::lastCharactersMatch):
1906         (WebCore::legalEntityFor):
1907         (WebCore::PreloadScanner::consumeEntity):
1908         (WebCore::PreloadScanner::tokenize):
1909         (WebCore::PreloadScanner::processAttribute):
1910         (WebCore::PreloadScanner::emitCharacter):
1911         (WebCore::PreloadScanner::tokenizeCSS):
1912         (WebCore::PreloadScanner::emitTag):
1913         (WebCore::PreloadScanner::emitCSSRule):
1914         * html/PreloadScanner.h: Added.
1915         (WebCore::PreloadScanner::inProgress):
1916         (WebCore::PreloadScanner::):
1917         HTML5 tokenization plus some glue code. Fake CSS parsing thrown in just for fun.
1918         
1919         * loader/Cache.cpp:
1920         (WebCore::Cache::pruneDeadResources):
1921         Preloads have zero refcount, avoid kicking them out too early.
1922         
1923         * loader/CachedResource.cpp:
1924         (WebCore::CachedResource::CachedResource):
1925         (WebCore::CachedResource::ref):
1926         * loader/CachedResource.h:
1927         (WebCore::CachedResource::):
1928         (WebCore::CachedResource::preloadResult):
1929         (WebCore::CachedResource::setRequestedFromNetworkingLayer):
1930         (WebCore::CachedResource::canDelete):
1931         (WebCore::CachedResource::isPreloaded):
1932         (WebCore::CachedResource::increasePreloadCount):
1933         (WebCore::CachedResource::decreasePreloadCount):
1934         Keep track which resources are preloads. Avoid deleting them. Track
1935         at which point of the loading preloads get utilized to enable some interesting 
1936         statistics.
1937         
1938         * loader/DocLoader.cpp:
1939         (WebCore::DocLoader::~DocLoader):
1940         (WebCore::DocLoader::checkForReload):
1941         (WebCore::DocLoader::registerPreload):
1942         (WebCore::DocLoader::clearPreloads):
1943         (WebCore::DocLoader::printPreloadStats):
1944         * loader/DocLoader.h:
1945         Ensure we utilize preloaded resources during reloads.
1946         Keep a list of all preloads in the document. Clear the preloads after
1947         parsing is complete. Some debug statistics.
1948         
1949         * loader/DocumentLoader.cpp:
1950         (WebCore::DocumentLoader::isLoadingInAPISense):
1951         Avoid signaling that loading is complete too early. 
1952         
1953         * loader/loader.cpp:
1954         (WebCore::Loader::Loader):
1955         (WebCore::Loader::~Loader):
1956         (WebCore::Loader::determinePriority):
1957         (WebCore::Loader::load):
1958         (WebCore::Loader::scheduleServePendingRequests):
1959         (WebCore::Loader::requestTimerFired):
1960         (WebCore::Loader::servePendingRequests):
1961         (WebCore::Loader::cancelRequests):
1962         (WebCore::Loader::Host::Host):
1963         (WebCore::Loader::Host::~Host):
1964         (WebCore::Loader::Host::addRequest):
1965         (WebCore::Loader::Host::hasRequests):
1966         (WebCore::Loader::Host::servePendingRequests):
1967         (WebCore::Loader::Host::didFinishLoading):
1968         (WebCore::Loader::Host::didFail):
1969         (WebCore::Loader::Host::didReceiveResponse):
1970         (WebCore::Loader::Host::didReceiveData):
1971         (WebCore::Loader::Host::cancelPendingRequests):
1972         (WebCore::Loader::Host::cancelRequests):
1973         * loader/loader.h:
1974         (WebCore::Loader::):
1975         Distribute load requests to per-host priority queues. Limit the number of loads issued to the 
1976         networking layer so we have better changes of getting important requests through first.
1977         Prioritize scripts > stylesheets > images.
1978
1979 2008-03-13  David Hyatt  <hyatt@apple.com>
1980
1981         This patch makes full page zoom work pretty well. It fixes repainting so that it works when transforms
1982         are set on the RenderView. It also implements the "smart layout" behavior that other browsers support when
1983         zooming. The page will still try to constrain to the viewport size even when zoomed.
1984
1985         Reviewed by john
1986
1987         * dom/Document.cpp:
1988         (WebCore::Document::recalcStyle):
1989         Make sure to test for transform changes even when there is no zoom.  This fixes repainting issues
1990         caused by jumping from a zoomed state back to the standard size.
1991
1992         * page/FrameView.cpp:
1993         (WebCore::FrameView::adjustViewSize):
1994         Adjust for the zoom factor (the render tree is in unzoomed coordinates, but the scrollbars of the view
1995         need to handle zoomed coordinates).
1996
1997         * rendering/RenderBox.cpp:
1998         (WebCore::RenderBox::calcHeight):
1999         Fix the body-sizing-to-the-view-height quirk so that it takes the zoom factor into account when
2000         stretching to fill the viewport.
2001
2002         * rendering/RenderLayer.cpp:
2003         (WebCore::RenderLayer::updateLayerPositions):
2004         (WebCore::RenderLayer::setHasVisibleContent):
2005         Remove the FIXMEs now that absoluteClippedOverflowRect works with transforms on the RenderView.
2006
2007         * rendering/RenderView.cpp:
2008         (WebCore::RenderView::calcHeight):
2009         (WebCore::RenderView::calcWidth):
2010         Make sure the calculated width/height take the zoom factor into account in order to get the "smart layout"
2011         behavior.
2012
2013         (WebCore::RenderView::layout):
2014         When deciding whether children have to get a relayout, we need to check the zoomed width/height and not just
2015         the viewport size.
2016
2017         (WebCore::RenderView::computeAbsoluteRepaintRect):
2018         Patched to take into account transforms set on the RenderView.
2019
2020         (WebCore::RenderView::docHeight):
2021         (WebCore::RenderView::docWidth):
2022         Patched to just always use m_width and m_height initially, since those have already been adjusted for
2023         the zoom factor.
2024
2025         (WebCore::RenderView::zoomedHeight):
2026         (WebCore::RenderView::zoomedWidth):
2027         * rendering/RenderView.h:
2028         New helper methods for obtaining the adjusted width/height of the viewport taking into account the
2029         zoom factor.
2030
2031 2008-03-13  Anders Carlsson  <andersca@apple.com>
2032
2033         Build fix.
2034
2035         * WebCore.base.exp:
2036
2037 2008-03-13  Anders Carlsson  <andersca@apple.com>
2038
2039         Reviewed by Adam.
2040
2041         Get rid of actualRequest, it is not used anymore. Also, get rid of 
2042         initialRequest and replace all uses with originalRequest because those are
2043         the same thing.
2044         
2045         * loader/DocumentLoader.cpp:
2046         * loader/DocumentLoader.h:
2047         * loader/FrameLoader.cpp:
2048         (WebCore::FrameLoader::initialRequest):
2049         (WebCore::FrameLoader::originalRequestURL):
2050
2051 2008-03-13  Brady Eidson  <beidson@apple.com>
2052
2053         Reviewed by Anders
2054
2055         Convert SharedBuffer to start with a refCount of 1
2056
2057         * loader/ImageDocument.cpp:
2058         (WebCore::ImageTokenizer::finish):
2059
2060         * loader/ResourceLoader.cpp:
2061         (WebCore::ResourceLoader::addData):
2062         (WebCore::ResourceLoader::willStopBufferingData):
2063
2064         * loader/icon/IconDatabase.cpp:
2065         (WebCore::IconDatabase::defaultIcon):
2066         (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
2067
2068         * loader/loader.cpp:
2069         (WebCore::Loader::didReceiveData):
2070
2071         * platform/SharedBuffer.h:
2072         (WebCore::SharedBuffer::create): Make all constructors private, add ::create() calls
2073         * platform/SharedBuffer.cpp:
2074         (WebCore::SharedBuffer::SharedBuffer): Revert to default RefCounted constructor to start with a ref count of 1
2075         (WebCore::SharedBuffer::copy):
2076         * platform/mac/SharedBufferMac.mm:
2077         (WebCore::SharedBuffer::wrapNSData):
2078         (WebCore::SharedBuffer::SharedBuffer): Revert to default RefCounted constructor to start with a ref count of 1
2079
2080 2008-03-13  Steve Falkenburg  <sfalken@apple.com>
2081
2082         PGO build fixes.
2083         
2084         Disable PGO for normal release builds.
2085         Added work-in-progress Release_PGOInstrument/Release_PGOOptimize targets.
2086
2087         * WebCore.vcproj/WebCore.vcproj:
2088
2089 2008-03-13  Anders Carlsson  <andersca@apple.com>
2090
2091         Reviewed by Darin.
2092
2093         Make a bunch of DocumentLoader setters/getters inline.
2094         
2095         * loader/DocumentLoader.cpp:
2096         * loader/DocumentLoader.h:
2097         (WebCore::DocumentLoader::isStopping):
2098         (WebCore::DocumentLoader::setCommitted):
2099         (WebCore::DocumentLoader::isCommitted):
2100         (WebCore::DocumentLoader::isLoading):
2101         (WebCore::DocumentLoader::setLoading):
2102         (WebCore::DocumentLoader::response):
2103         (WebCore::DocumentLoader::mainDocumentError):
2104         (WebCore::DocumentLoader::setResponse):
2105         (WebCore::DocumentLoader::isClientRedirect):
2106         (WebCore::DocumentLoader::setIsClientRedirect):
2107         (WebCore::DocumentLoader::overrideEncoding):
2108         (WebCore::DocumentLoader::responses):
2109         (WebCore::DocumentLoader::triggeringAction):
2110         (WebCore::DocumentLoader::setTriggeringAction):
2111         (WebCore::DocumentLoader::setOverrideEncoding):
2112         (WebCore::DocumentLoader::setLastCheckedRequest):
2113         (WebCore::DocumentLoader::lastCheckedRequest):
2114         (WebCore::DocumentLoader::title):
2115         (WebCore::DocumentLoader::setLoadingFromCachedPage):
2116         (WebCore::DocumentLoader::isLoadingFromCachedPage):
2117
2118 2008-03-13  Rodney Dawes  <dobey@wayofthemonkey.com>
2119
2120         Fix builds without SVG enabled.
2121
2122         * page/Frame.cpp:
2123         (Frame::shouldApplyTextZoom):
2124         (Frame::shouldApplyPageZoom):
2125
2126 2008-03-13  Simon Hausmann  <hausmann@webkit.org>
2127
2128         Fix the Qt build.
2129
2130         * bridge/qt/qt_instance.cpp:
2131         (KJS::Bindings::QtInstance::getQtInstance):
2132         (KJS::Bindings::QtInstance::getRuntimeObject):
2133         * bridge/qt/qt_instance.h:
2134         (KJS::Bindings::QtInstance::create):
2135         * bridge/qt/qt_runtime.cpp:
2136         (KJS::Bindings::convertQVariantToValue):
2137         (KJS::Bindings::QtConnectionObject::execute):
2138         * page/qt/FrameQt.cpp:
2139         (WebCore::Frame::createScriptInstanceForWidget):
2140
2141 2008-03-12  Sam Weinig  <sam@webkit.org>
2142
2143         Reviewed by Darin Adler.
2144
2145         Fix <rdar://problem/5784773>
2146         Crash loading QT movies @ apple.com/ipodtouch/features.html with a PAC file (WebKitThreadingException)
2147
2148         Make bridged RuntimeObjects get collected on the main thread only. This is necessary
2149         because clients of the bridged objects are unlikely to prepared for a collection on 
2150         non-main thread, which can happen with a PAC file.
2151
2152         * bridge/runtime_object.cpp:
2153         (RuntimeObjectImp::RuntimeObjectImp):
2154
2155 2008-03-12  Adam Roben  <aroben@apple.com>
2156
2157         Fix Bug 17815: Inspector's DOM tree should descend into subframes
2158
2159         <http://bugs.webkit.org/show_bug.cgi?id=17815>
2160
2161         Reviewed by Tim.
2162
2163         * page/inspector/DocumentPanel.js:
2164         (WebInspector.DocumentPanel.revealNode): Changed to provide
2165         _isAncestorIncludingParentFramesWithinPanel and
2166         _parentNodeOrFrameElementWithinPanel for the isAncestor and getParent
2167         parameters to findTreeElement so that parent frames will be searched.
2168         (WebInspector.DocumentPanel.updateBreadcrumb):
2169           - Changed while loop to for loop
2170           - Use _parentNodeOrFrameElementWithinPanel instead of
2171             Node.parentNode to move to the next node
2172           - The loop now ends when we reach the DocumentPanel's document node
2173           - Traversal past other Document nodes is now allowed
2174           - We add the "start" class to the final crumb after the loop exits
2175         (WebInspector.DocumentPanel._getDocumentForNode): Added. Simple helper
2176         that returns the node itself if the node is a Document node, or the
2177         node's ownerDocument otherwise.
2178         (WebInspector.DocumentPanel._parentNodeOrFrameElementWithinPanel):
2179         Added. Returns the node's parent node or, in the case of a Document
2180         node, the node's window's owning frame element, but will not return a
2181         node that is in a parent frame of the DocumentPanel's Document.
2182         (WebInspector.DocumentPanel._isAncestorIncludingParentFramesWithinPanel):
2183         Added. Returns true if a is an ancestor of b if a is an ancestor of a
2184         frame element whose subframe(s) contain b.
2185         (WebInspector.DOMNodeTreeElement): We now consider ourselves to have
2186         children if we have a contentDocument.
2187         (WebInspector.DOMNodeTreeElement.onpopulate): Moved the appendChild
2188         loop into a function so that we can add both children of our
2189         contentDocument and children of our node to the tree.
2190         (WebInspector.DOMNodeTreeElement.ondblclick): Changed so that we get
2191         the rootDOMNode by traversing the tree outline hierarchy instead of
2192         the DOM hierarchy so that we can easily jump up to a parent frame.
2193
2194 2008-03-12  Adam Roben  <aroben@apple.com>
2195
2196         Update the styles/metrics panes and breadcrumb after editing DOM
2197         attributes
2198
2199         Reviewed by Tim.
2200
2201         * page/inspector/DocumentPanel.js:
2202         (WebInspector.DocumentPanel.set focusedDOMNode): Moved code to update
2203         the parts of the DocumentPanel other than the DOM tree into a new
2204         function, _focusedNodeChanged.
2205         (WebInspector.DocumentPanel._focusedNodeChanged): Added. The
2206         forceUpdate parameter specifies whether the update should occur even
2207         if the focused node hasn't changed since the last update.
2208         (WebInspector.DocumentPanel.updateBreadcrumb): Added a forceUpdate
2209         parameter. If forceUpdate is true, we always rebuild the breadcrumbs.
2210         (WebInspector.DocumentPanel.updateStyles): Added a forceUpdate
2211         parameter. If forceUpdate is true, we always rebuild the styles pane.
2212         (WebInspector.DOMNodeTreeElement._attributeEditingCommitted): Added a
2213         call to DocumentPanel._focusedNodeChanged. We have to force the update
2214         because we haven't changed the focused node (the attributes of the
2215         node have changed).
2216         * page/inspector/StylesSidebarPane.js:
2217         (WebInspector.StylesSidebarPane.update): Added a forceUpdate
2218         parameter. If forceUpdate is true we always rebuild the styles.
2219
2220 2008-03-12  Mark Rowe  <mrowe@apple.com>
2221
2222         Further Gtk and Qt build fixes.
2223
2224         * bridge/runtime.cpp:
2225         (KJS::Bindings::Instance::createRuntimeObject): Adapt Qt-only code for change to PassRefPtr.
2226         * page/gtk/FrameGtk.cpp: Add missing include.
2227
2228 2008-03-12  Mark Rowe  <mrowe@apple.com>
2229
2230         Fix Gtk and Qt builds.
2231
2232         * page/gtk/FrameGtk.cpp:
2233         * page/qt/FrameQt.cpp:
2234
2235 2008-03-12  Mark Rowe  <mrowe@apple.com>
2236
2237         Mac build fix.
2238
2239         * WebCore.base.exp:  Remove symbol.
2240
2241 2008-03-12  Steve Falkenburg  <sfalken@apple.com>
2242
2243         Build fix.
2244
2245         * page/win/FrameWin.cpp:
2246
2247 2008-03-12  Steve Falkenburg  <sfalken@apple.com>
2248
2249         Build fix.
2250
2251         * plugins/win/PluginViewWin.cpp:
2252         (WebCore::PluginView::bindingInstance):
2253
2254 2008-03-12  Darin Adler  <darin@apple.com>
2255
2256         Reviewed by Anders.
2257
2258         - http://bugs.webkit.org/show_bug.cgi?id=17640
2259           eliminate WebCoreFrameBridge
2260
2261         * WebCore.base.exp: Added more exports, needed by code moved from WebCoreFrameBridge
2262         to WebFrame in WebKit.
2263         * WebCore.xcodeproj/project.pbxproj: Added more headers, same reason. Also deleted
2264         WebCoreFrameBridge.h and WebCoreFrameBridge.mm.
2265
2266         * page/Frame.cpp:
2267         (WebCore::Frame::Frame): Added call to initJavaJSBindings(), formerly handled by
2268         the WebCoreFrameBridge.
2269         * page/Frame.h: Added initJavaJSBindings function.
2270
2271         * page/mac/FrameMac.mm:
2272         (WebCore::updateRenderingForBindings): Moved here from WebCoreFrameBridge.
2273         (WebCore::Frame::initJavaJSBindings): Ditto; code was in the init function.
2274
2275         * page/mac/WebCoreFrameBridge.h: Removed.
2276         * page/mac/WebCoreFrameBridge.mm: Removed.
2277
2278 2008-03-12  Sam Weinig  <sam@webkit.org>
2279
2280         Reviewed by Anders Carlsson.
2281
2282         Don't go through the Document just to get the frame Element.
2283
2284         * page/DOMWindow.cpp:
2285         (WebCore::DOMWindow::frameElement):
2286
2287 2008-03-12  Anders Carlsson  <andersca@apple.com>
2288
2289         Reviewed by Geoff and Sam.
2290
2291         More Instance cleanup:
2292         
2293         * Make Instance inherit from RefCounted instead of doing its own refcounting.        
2294         * Make all Instance subclasses private, add static create methods.         
2295         * Have Instance start out with a refcount of 1.
2296         * Get rid of Instance::createBindingForLanguageInstance and call the individual 
2297           instance constructor methods instead.
2298         * Fix many methods to take and return PassRefPtr<Instance> to ensure that the
2299           refcounting is done correctly.
2300          
2301         * bridge/c/c_instance.h:
2302         (KJS::Bindings::CInstance::create):
2303         * bridge/c/c_utility.cpp:
2304         (KJS::Bindings::convertNPVariantToValue):
2305         * bridge/jni/jni_instance.cpp:
2306         (JavaInstance::invokeMethod):
2307         * bridge/jni/jni_instance.h:
2308         (KJS::Bindings::JavaInstance::create):
2309         * bridge/jni/jni_jsobject.cpp:
2310         (JavaJSObject::convertJObjectToValue):
2311         * bridge/jni/jni_runtime.cpp:
2312         (JavaField::valueFromInstance):
2313         (JavaArray::valueAt):
2314         * bridge/objc/objc_instance.h:
2315         (KJS::Bindings::ObjcInstance::create):
2316         * bridge/objc/objc_utility.mm:
2317         (KJS::Bindings::convertObjcValueToValue):
2318         * bridge/qt/qt_instance.cpp:
2319         (KJS::Bindings::QtRuntimeObjectImp::QtRuntimeObjectImp):
2320         (KJS::Bindings::QtInstance::getQtInstance):
2321         (KJS::Bindings::QtInstance::getRuntimeObject):
2322         * bridge/qt/qt_instance.h:
2323         * bridge/runtime.cpp:
2324         (KJS::Bindings::Instance::Instance):
2325         (KJS::Bindings::Instance::createRuntimeObject):
2326         * bridge/runtime.h:
2327         * bridge/runtime_object.cpp:
2328         (RuntimeObjectImp::RuntimeObjectImp):
2329         * bridge/runtime_object.h:
2330         * page/Frame.h:
2331         * page/mac/FrameMac.mm:
2332         (WebCore::Frame::createScriptInstanceForWidget):
2333         * page/win/FrameWin.cpp:
2334         (WebCore::Frame::createScriptInstanceForWidget):
2335         * plugins/PluginView.h:
2336         * plugins/win/PluginViewWin.cpp:
2337         (WebCore::PluginView::bindingInstance):
2338
2339 2008-03-12  Dan Bernstein  <mitz@apple.com>
2340
2341         Suggested by Darin Adler. Reviewed by Dave Hyatt.
2342
2343         - speed up BidiIterator::direction()
2344
2345         * rendering/bidi.cpp:
2346         (WebCore::BidiIterator::current): Made inline and corrected the
2347         out-of-bounds condition to work with 0-length text and offsets beyond
2348         the end of the text.
2349         (WebCore::BidiIterator::direction): Changed to call current() and not
2350         call the virtual method isListMarker() most of the time.
2351         (WebCore::addMidpoint): Removed unnecessary null-check of smidpoints.
2352         (WebCore::appendRunsForObject): Ditto.
2353
2354 2008-03-12  Adam Roben  <aroben@apple.com>
2355
2356         Make URLs not be underlined while editing them in the DOM view
2357
2358         Reviewed by Tim.
2359
2360         * page/inspector/inspector.css:
2361
2362 2008-03-12  Adam Roben  <aroben@apple.com>
2363
2364         Part of Bug 17224: DOM nodes/attributes should be editable
2365
2366         <http://bugs.webkit.org/show_bug.cgi?id=17224>
2367         <rdar://problem/5732825>
2368
2369         We now start editing if the user single-clicks on an attribute,
2370         attribute value, or text node while the parent element is selected.
2371         Previously, we started editing on double-click regardless of the
2372         selection state of the element.
2373
2374         URLs in the DOM tree are now followed on Alt/Option-click, rather than
2375         on just click.
2376
2377         Reviewed by Tim.
2378
2379         * English.lproj/InspectorLocalizedStrings.js: Added four new localized
2380         strings.
2381         * page/inspector/DocumentPanel.js:
2382         (WebInspector.DOMNodeTreeElement.onattach): Call new
2383         _makeURLSActivateOnModifiedClick.
2384         (WebInspector.DOMNodeTreeElement._makeURLsActivateOnModifiedClick):
2385         Added. Changes the tooltip of each link in this element to indicate
2386         that Alt/Option-click will follow the URL, and sets the
2387         followOnAltClick property on each link.
2388         (WebInspector.DOMNodeTreeElement.onselect): Mark that we're being
2389         selected.
2390         (WebInspector.DOMNodeTreeElement.onmousedown): If we're not currently
2391         being selected, start editing.
2392         (WebInspector.DOMNodeTreeElement.ondblclick): We no longer start
2393         editing here. We block re-rooting of the tree if we're currently
2394         editing.
2395         (WebInspector.DOMNodeTreeElement._startEditing):
2396           - Don't do anything if we're not focused
2397           - Pass the event down to _startEditingAttribute.
2398         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Don't do
2399         anything if the event target is a URL and the Alt/Option key is
2400         pressed -- in this case we want to follow the link.
2401         (WebInspector.DOMNodeTreeElement._updateTitle): Call
2402         _makeURLsActivateOnClick again since the anchor elements have all been
2403         recreated.
2404         * page/inspector/inspector.js:
2405         (WebInspector.documentClick): If the anchor as a followOnAltClick
2406         property and the Alt/Option key is not pressed, do nothing.
2407
2408 2008-03-12  Ada Chan  <adachan@apple.com>
2409
2410         Fixed the initial value of zoom factor.
2411
2412         Reviewed by Adam.
2413
2414         * page/Frame.cpp:
2415         (WebCore::FramePrivate::FramePrivate):
2416
2417 2008-03-12  David Hyatt  <hyatt@apple.com>
2418
2419         Make full page zoom vaguely work.  This patch uses the CSS transform system to turn on full page zoom at the
2420         document level.  There are many many bugs that I'm going to file to track all the issues (most of the issues
2421         are just bugs with transforms themselves).
2422
2423         Reviewed by Adam Roben
2424
2425         * css/CSSStyleSelector.cpp:
2426         (WebCore::CSSStyleSelector::applyProperty):
2427         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
2428         * dom/Document.cpp:
2429         (WebCore::Document::recalcStyle):
2430         * page/Frame.cpp:
2431         (WebCore::Frame::shouldApplyTextZoom):
2432         (WebCore::Frame::shouldApplyPageZoom):
2433         * page/Frame.h:
2434         * rendering/RenderLayer.cpp:
2435         (WebCore::RenderLayer::updateLayerPositions):
2436         (WebCore::RenderLayer::setHasVisibleContent):
2437         (WebCore::RenderLayer::paintLayer):
2438         (WebCore::RenderLayer::hitTestLayer):
2439         * rendering/RenderLayer.h:
2440
2441 2008-03-12  David Hyatt  <hyatt@apple.com>
2442
2443         Make the zoom factor a float and not a percent.
2444
2445         Reviewed by antti
2446
2447         * WebCore.base.exp:
2448         * css/CSSStyleSelector.cpp:
2449         (WebCore::CSSStyleSelector::applyProperty):
2450         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
2451         * page/Frame.cpp:
2452         (WebCore::Frame::zoomFactor):
2453         (WebCore::Frame::setZoomFactor):
2454         * page/Frame.h:
2455         * page/FramePrivate.h:
2456         * svg/SVGSVGElement.cpp:
2457         (WebCore::SVGSVGElement::currentScale):
2458         (WebCore::SVGSVGElement::setCurrentScale):
2459
2460 2008-03-12  David Hyatt  <hyatt@apple.com>
2461
2462         Eliminate setTextMultiplier from the bridge.  Make Webkit just call setZoomFactor on the frame directly.
2463
2464         Reviewed by Tim H.
2465
2466         * WebCore.base.exp:
2467         * page/mac/WebCoreFrameBridge.h:
2468         * page/mac/WebCoreFrameBridge.mm:
2469
2470 2008-03-12  Dan Bernstein  <mitz@apple.com>
2471
2472         Reviewed by Darin Adler and Sam Weinig.
2473
2474         - <rdar://problem/4433248> use CoreText API instead of SPI on Leopard
2475
2476         Use CTFontCopyGraphicsFont and CTFontGetPlatformFont on Leopard instead
2477         of wkGetCGFontFromNSFont and wkGetNSFontATSUFontId, relying on NSFont
2478         and CTFontRef being toll-free bridged.
2479
2480         * WebCore.Tiger.exp:
2481         * WebCore.base.exp:
2482         * platform/graphics/mac/FontMac.mm:
2483         (WebCore::Font::drawGlyphs): Changed to use the cgFont() accessor.
2484         * platform/graphics/mac/FontPlatformData.h:
2485         Made m_cgFont a RetainPtr on Leopard.
2486         (WebCore::toCTFontRef): Added a function that encapsulates the
2487         toll-free bridging.
2488         (WebCore::FontPlatformData::FontPlatformData):
2489         (WebCore::FontPlatformData::cgFont): Added this accessor method.
2490         * platform/graphics/mac/FontPlatformDataMac.mm:
2491         (WebCore::FontPlatformData::FontPlatformData): Changed to use
2492         CoreText API on Leopard.
2493         (WebCore::FontPlatformData::setFont): Ditto.
2494         * platform/graphics/mac/SimpleFontDataMac.mm:
2495         (WebCore::initFontData):
2496         (WebCore::pathFromFont):
2497         (WebCore::SimpleFontData::platformInit):
2498         (WebCore::SimpleFontData::platformWidthForGlyph):
2499         * platform/mac/WebCoreSystemInterface.mm:
2500
2501 2008-03-12  David Harrison  <harrison@apple.com>
2502
2503         Reviewed by Darin.
2504
2505         <rdar://problem/5607382> CrashTracer: [REGRESSION] 2290 crashes in Safari at com.apple.WebCore: -[WebCoreAXObject isWebArea] + 8
2506
2507         The problem was that we lost track of the AX cache for a subframe when Frame::disconnectOwnerElement() was
2508         called, so we were unable to locate the AXObjects to de-register from AppKit's accessibility registry.
2509         Also saw that cache clearing was missing from Document::detach(), and fixed that.
2510         
2511         Also added a debug-only check that AXObjectCache::remove() not finding the AXObject is expected.
2512         
2513         Lastly, RenderWidget::destroy() now skips trying to remove the AXObject if accessibility has never been enabled.
2514        
2515         * dom/Document.cpp:
2516         (WebCore::Document::attach):
2517         Assert that there is no AX cache (since there is no renderer).
2518         
2519         (WebCore::Document::detach):
2520         Destroy the AX cache installed on this document.
2521         
2522         (WebCore::Document::clearAXObjectCache):
2523         New. Destroy the AX cache associated with this document.
2524         
2525         (WebCore::Document::axObjectCache):
2526         Added some comments.
2527         
2528         * dom/Document.h:
2529         Declare clearAXObjectCache().
2530         
2531         * page/Frame.cpp:
2532         (WebCore::Frame::disconnectOwnerElement):
2533         Destroy the AX cache associated with this frame's document.
2534         
2535         * page/mac/AXObjectCacheMac.mm:
2536         (WebCore::AXObjectCache::remove):        
2537         * page/mac/WebCoreAXObject.mm:
2538         (-[WebCoreAXObject initWithRenderer:]):
2539         (-[WebCoreAXObject detach]):
2540         * rendering/RenderObject.cpp:
2541         (WebCore::RenderObject::RenderObject):
2542         (WebCore::RenderObject::~RenderObject):
2543         * rendering/RenderObject.h:
2544         (WebCore::RenderObject::setHasAXObject):
2545         (WebCore::RenderObject::hasAXObject):
2546         Add debug-only check that AXObjectCache::remove() not finding the AXObject is expected.
2547         
2548         * rendering/RenderWidget.cpp:
2549         (WebCore::RenderWidget::destroy):
2550         Skip call to remove the AXObject if accessibility has never been enabled. A simple speed optimization in the
2551         very common case that the accessibility APIs are not being used. Same as in RenderObject::destroy().
2552
2553 2008-03-12  Xan Lopez  <xan@gnome.org>
2554
2555         Reviewed by Alp Toker.
2556
2557         http://bugs.webkit.org/show_bug.cgi?id=15229
2558
2559         Add Pango font backend.
2560
2561         Original patch by Sven Herzberg <sven@imendio.com>
2562
2563         * GNUmakefile.am:
2564         * platform/graphics/gtk/FontCacheGtk.cpp:
2565         (WebCore::FontCache::fontExists):
2566         * platform/graphics/gtk/FontCustomPlatformDataPango.cpp: Added.
2567         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
2568         (WebCore::FontCustomPlatformData::fontPlatformData):
2569         (WebCore::releaseData):
2570         (WebCore::createFontCustomPlatformData):
2571         * platform/graphics/gtk/FontPlatformData.h:
2572         (WebCore::FontPlatformData::FontPlatformData):
2573         (WebCore::FontPlatformData::hash):
2574         * platform/graphics/gtk/FontPlatformDataPango.cpp: Added.
2575         (WebCore::FontPlatformData::FontPlatformData):
2576         (WebCore::FontPlatformData::init):
2577         (WebCore::FontPlatformData::~FontPlatformData):
2578         (WebCore::FontPlatformData::isFixedPitch):
2579         (WebCore::FontPlatformData::setFont):
2580         (WebCore::FontPlatformData::operator==):
2581         * platform/graphics/gtk/GlyphPageTreeNodePango.cpp: Added.
2582         (WebCore::pango_font_get_glyph):
2583         (WebCore::GlyphPage::fill):
2584         * platform/graphics/gtk/SimpleFontDataPango.cpp: Added.
2585         (WebCore::SimpleFontData::platformInit):
2586         (WebCore::SimpleFontData::platformDestroy):
2587         (WebCore::SimpleFontData::smallCapsFontData):
2588         (WebCore::SimpleFontData::containsCharacters):
2589         (WebCore::SimpleFontData::determinePitch):
2590         (WebCore::SimpleFontData::platformWidthForGlyph):
2591         (WebCore::SimpleFontData::setFont):
2592
2593 2008-03-12  Justin Garcia  <justin.garcia@apple.com>
2594
2595         Reviewed by Oliver.
2596         
2597         <rdar://problem/5770834> Crash at InsertTextCommand::prepareForTextInsertion() doing RemoveFormat in a certain list
2598         
2599         Fixes some (but not all) of the instances of:
2600         <rdar://problem/5659795> CrashTracer: [REGRESSION] 187 crashes in Safari at com.apple.WebCore: WebCore::InsertTextCommand::prepareForTextInsertion + 241
2601         <rdar://problem/5779631> CrashTracer: [USER] 25 crashes in Mail at WebCore::InsertTextCommand::prepareForTextInsertion
2602
2603         * editing/InsertLineBreakCommand.cpp:
2604         (WebCore::InsertLineBreakCommand::doApply): applyStyle may have destroyed content that held
2605         the old endingSelection(), so we must recompute it.  Added a FIXME.  Added a few comments.
2606         * editing/RemoveFormatCommand.cpp:
2607         (WebCore::RemoveFormatCommand::doApply): Added a FIXME.
2608
2609 2008-03-11  Alexey Proskuryakov  <ap@webkit.org>
2610
2611         Reviewed by Darin.
2612
2613         <rdar://problem/5640615> REGRESSION (Safari 2-3): Changing subframe encoding rules broke
2614         some sites.
2615
2616         Other browsers' behavior keeps changing; let's implement what Firefox and Opera do now:
2617         if the frame and subframe belong to the same site, then the encoding is inherited from parent
2618         frame to subframe. Otherwise, it is not.
2619
2620         Always inheriting the encoding would cause a security problem.
2621
2622         Tests: http/tests/misc/frame-default-enc-different-domain.html
2623                http/tests/misc/frame-default-enc-same-domain.html
2624                fast/encoding/frame-default-enc.html
2625
2626         * loader/FrameLoader.cpp:
2627         (WebCore::FrameLoader::write): Also removed a check for m_frame->document() being non-null -
2628         this function also has code that uses it without checking, so it must be safe.
2629
2630 2008-03-12  Mark Rowe  <mrowe@apple.com>
2631
2632         Gtk build fix.
2633
2634         * page/Frame.h: Forward-declare FramePrivate.
2635
2636 2008-03-11  Steve Falkenburg  <sfalken@apple.com>
2637
2638         Disable LTCG/PGO for all of WebCore for now.
2639         We'll re-enable this as part of follow-on PGO work.
2640         
2641         Reviewed by Oliver.
2642
2643         * WebCore.vcproj/WebCore.vcproj:
2644
2645 2008-03-11  Darin Adler  <darin@apple.com>
2646
2647         Reviewed by Sam.
2648
2649         - remove all bridge-related things from WebCore except the bridge itself
2650
2651         * WebCore.base.exp: Removed the bridge and setBridge functions.
2652
2653         * loader/FrameLoader.cpp:
2654         (WebCore::FrameLoader::detachFromParent): Removed call to the bridge's
2655         close method.
2656
2657         * page/Frame.cpp:
2658         (WebCore::Frame::~Frame): Removed call to setBridge(0).
2659         (WebCore::FramePrivate::FramePrivate): Removed initialization of m_bridge.
2660         * page/Frame.h: Removed setBridge and bridge functions.
2661         * page/FramePrivate.h: Removed m_bridge pointer.
2662         * page/mac/FrameMac.mm: Removed setBridge and bridge functions.
2663
2664         * page/mac/WebCoreFrameBridge.h: Added setWebCoreFrame: method.
2665         Removed bridgeForDOMDocument: and clearFrame methods.
2666         * page/mac/WebCoreFrameBridge.mm: Ditto.
2667         (-[WebCoreFrameBridge close]): Changed to set m_frame to 0 directly.
2668         (-[WebCoreFrameBridge setWebCoreFrame:]): Added.
2669
2670 2008-03-11  Darin Adler  <darin@apple.com>
2671
2672         - restored some code I removed in the Range change; this code can't go
2673           until the rest of the Range fix is in
2674
2675         * dom/Range.cpp:
2676         (WebCore::Range::commonAncestorContainer): Added back the check for 0
2677         that I removed erroneously in the Range patch.
2678         (WebCore::Range::processContents): Left in assertions I used to debug
2679         this.
2680
2681 2008-03-11  Darin Adler  <darin@apple.com>
2682
2683         - fix Release build
2684
2685         * platform/mac/ScrollViewMac.mm:
2686         (WebCore::ScrollView::setContentsPos): Don't use NSMakePoint.
2687
2688 2008-03-11  Darin Adler  <darin@apple.com>
2689
2690         Reviewed by Anders.
2691
2692         - simplify Mac code for ScrollView, since it's used only for FrameView
2693           and not in two different modes like it was historically
2694         - remove code depending on the bridge to get from an NSView to a WebCore::Frame
2695
2696         * bindings/objc/DOMHTML.mm:
2697         (-[DOMHTMLInputElement _rectOnScreen]): getDocumentView -> documentView.
2698
2699         * bridge/jni/jni_jsobject.cpp:
2700         (createRootObject): Instead of using WebCoreViewFactory to find the frame given
2701         and NSView, use the WebCoreFrameView interface to do it.
2702
2703         * editing/mac/EditorMac.mm:
2704         (WebCore::Editor::paste): getDocumentView -> documentView.
2705         * editing/mac/SelectionControllerMac.mm:
2706         (WebCore::SelectionController::notifyAccessibilityForSelectionChange): Ditto.
2707
2708         * page/FrameView.h: Fixed comment.
2709
2710         * page/InspectorController.cpp:
2711         (WebCore::InspectorController::drawNodeHighlight): Removed uneeded typecasts
2712         to ScrollView* since FrameView is derived from ScrollView.
2713
2714         * page/mac/EventHandlerMac.mm:
2715         (WebCore::EventHandler::focusDocumentView): getDocumentView -> documentView.
2716         * page/mac/FrameMac.mm:
2717         (WebCore::Frame::imageFromRect): Ditto.
2718         * page/mac/WebCoreAXObject.mm:
2719         (-[WebCoreAXObject position]): Ditto.
2720         (-[WebCoreAXObject doAXTextMarkerForPosition:]): Ditto.
2721         (-[WebCoreAXObject rendererForView:]): Updated code that used to use
2722         WebCoreBridgeHolder to use WebCoreFrameView instead.
2723
2724         * page/mac/WebCoreFrameBridge.mm:
2725         (-[WebCoreFrameBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
2726         getDocumentView -> documentView.
2727
2728         * page/mac/WebCoreFrameView.h: Removed the WebCoreScrollbarMode type; we just
2729         use WebCore::ScrollbarMode directly. Renamed the WebCoreFrameView protocol to
2730         WebCoreFrameScrollView, since it's a protocol for the scroll view, not the
2731         frame view itself. Replaced WebCoreBridgeHolder protocol with WebCoreFrameView
2732         protocol, which returns a WebCore::Frame directly rather than a bridge.
2733
2734         * page/mac/WebCoreViewFactory.h: Eliminated the bridgeForView method.
2735
2736         * platform/ScrollView.h: Moved the constructor and destructor out of the
2737         class-specific #if blocks. Renamed Mac-specific function that gets the
2738         NSView for from getDocumentView to documentView and a scrollView function
2739         that returns an appropriately classed NSScrollView.
2740
2741         * platform/graphics/MediaPlayer.h: Changed type of parentWidget to FrameView
2742         instead of Widget.
2743         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2744         (WebCore::MediaPlayerPrivate::createQTMovieView): Removed unnecessary cast.
2745
2746         * platform/mac/PopupMenuMac.mm:
2747         (WebCore::PopupMenu::show): getDocumentView -> documentView.
2748         * platform/mac/ScrollViewMac.mm:
2749         (WebCore::ScrollView::ScrollView): Added.
2750         (WebCore::ScrollView::~ScrollView): Added.
2751         (WebCore::ScrollView::scrollView): Added.
2752         (WebCore::ScrollView::visibleWidth): Removed unused non-NSScrollView case.
2753         (WebCore::ScrollView::visibleHeight): Ditto.
2754         (WebCore::ScrollView::visibleContentRect): Ditto.
2755         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers): Ditto.
2756         (WebCore::ScrollView::contentsWidth): Ditto.
2757         (WebCore::ScrollView::contentsHeight): Ditto.
2758         (WebCore::ScrollView::contentsX): Ditto.
2759         (WebCore::ScrollView::contentsY): Ditto.
2760         (WebCore::ScrollView::scrollOffset): Ditto.
2761         (WebCore::ScrollView::scrollRectIntoViewRecursively): Ditto.
2762         (WebCore::ScrollView::setContentsPos): Ditto.
2763         (WebCore::ScrollView::setVScrollbarMode): Ditto.
2764         (WebCore::ScrollView::setHScrollbarMode): Ditto.
2765         (WebCore::ScrollView::setScrollbarsMode): Ditto.
2766         (WebCore::ScrollView::vScrollbarMode): Ditto.
2767         (WebCore::ScrollView::hScrollbarMode): Ditto.
2768         (WebCore::ScrollView::suppressScrollbars): Ditto.
2769         (WebCore::ScrollView::addChild): Ditto.
2770         (WebCore::ScrollView::resizeContents): Ditto.
2771         (WebCore::ScrollView::updateContents): Ditto.
2772         (WebCore::ScrollView::contentsToWindow): Ditto.
2773         (WebCore::ScrollView::windowToContents): Ditto.
2774         (WebCore::ScrollView::setStaticBackground): Ditto.
2775         (WebCore::ScrollView::documentView): Renamed and removed unused case.
2776         (WebCore::ScrollView::scrollbarUnderMouse): Removed incorrect comment.
2777
2778         * platform/mac/WidgetMac.mm:
2779         (WebCore::Widget::getOuterView): Update for protocol name change.
2780
2781         * rendering/RenderThemeMac.mm:
2782         (WebCore::RenderThemeMac::paintCheckbox): getDocumentView -> documentView.
2783         (WebCore::RenderThemeMac::paintRadio): Ditto.
2784         (WebCore::RenderThemeMac::paintButton): Ditto.
2785         (WebCore::RenderThemeMac::paintMenuList): Ditto.
2786         (WebCore::RenderThemeMac::paintSliderThumb): Ditto.
2787         (WebCore::RenderThemeMac::paintSearchField): Ditto.
2788         (WebCore::RenderThemeMac::paintSearchFieldCancelButton): Ditto.
2789         (WebCore::RenderThemeMac::paintSearchFieldResultsDecoration): Ditto.
2790         (WebCore::RenderThemeMac::paintSearchFieldResultsButton): Ditto.
2791
2792 2008-03-11  Brent Fulgham  <bfulgham@gmail.com>
2793
2794         Reviewed by Adam Roben.
2795
2796         Split CookieJarWin.cpp into CFNet and non-CFNet versions to
2797         reduce the massive amount of conditionalization in the file.
2798         (see http://bugs.webkit.org/show_bug.cgi?id=17788)
2799
2800         * WebCore.vcproj/WebCore.vcproj:
2801         * platform/network/win/CookieJarCFNetWin.cpp: Copied from WebCore/platform/network/win/CookieJarWin.cpp.
2802         (WebCore::setCookies):
2803         (WebCore::cookies):
2804         (WebCore::cookiesEnabled):
2805         * platform/network/win/CookieJarWin.cpp:
2806         (WebCore::setCookies):
2807         (WebCore::cookies):
2808         (WebCore::cookiesEnabled):
2809
2810 2008-03-11  Darin Adler  <darin@apple.com>
2811
2812         Reviewed by Sam.
2813
2814         - eliminate the remaining parts of WebCoreBridge used for calls to WebKit from WebCore
2815
2816         * page/ChromeClient.h: Added new client functions to replace calls up to WebKit
2817         that were formerly handled by the bridge.
2818
2819         * page/Frame.h: Removed unneeded declarations. Moved declarations of script-specific
2820         functions to a ScriptController section. Removed willPopupMenu.
2821
2822         * page/mac/ChromeMac.mm:
2823         (WebCore::Chrome::focusNSView): Changed to call firstResponder and makeFirstResponder
2824         via the client instead of the bridge.
2825
2826         * page/mac/EventHandlerMac.mm:
2827         (WebCore::EventHandler::passMouseDownEventToWidget): Changed to call firstResponder
2828         and makeFirstResponder via the chrome client instead of the bridge.
2829
2830         * page/mac/FrameMac.mm: Removed willPopupMenu.
2831
2832         * page/mac/WebCoreFrameBridge.h: Removed WebCoreFrameBridge protocol and
2833         SubclassResponsibility category. Also removed some unneeded imports.
2834
2835         * platform/mac/PopupMenuMac.mm:
2836         (WebCore::PopupMenu::show): Call willPopUpMenu on chrome client instead of frame.
2837
2838         * platform/mac/WidgetMac.mm:
2839         (WebCore::Widget::setIsSelected): Call functions directly on the view rather than
2840         calling via the bridge.
2841
2842 2008-03-11  Darin Adler  <darin@apple.com>
2843
2844         Reviewed by Mitz.
2845
2846         - make some Range improvements (preparation for Range support for DOM mutation)
2847
2848         Made constructors private, added create functions.
2849         Made refcount start at 1 rather than starting at 0 and being incremented.
2850         Made Range use two Position objects for the start/end container/offset pairs.
2851
2852         * WebCore.base.exp: Updated.
2853
2854         * dom/Document.cpp:
2855         (WebCore::Document::createRange): Changed to use Range::create.
2856         (WebCore::Document::removeMarkers): Updated for Range::first/pastLastNode name change.
2857
2858         * dom/Position.cpp:
2859         (WebCore::Position::formatForDebugger): Updated for member variable name change.
2860         (WebCore::Position::showTreeForThis): Ditto.
2861         (WebCore::startPosition): Changed to use Range::startPosition.
2862         (WebCore::endPosition): Changed to use Range::endPosition.
2863
2864         * dom/Position.h: Made the data members public and renamed them to container
2865         and offset. But since offset() is already a function, temporarily used posOffset
2866         for the data member. Later we'll get rid of offset(). Made more functions inline.
2867         Removed the constructor that takes a PositionIterator.
2868
2869         * dom/PositionIterator.cpp:
2870         (WebCore::PositionIterator::operator Position): Added. Replaces the constructor
2871         that used to be in Position.
2872         * dom/PositionIterator.h: Added conversion operator to produce a Position.
2873         Removed friend declaration for Position.
2874
2875         * dom/Range.cpp:
2876         (WebCore::Range::Range): Updated constructors for data member changes and made
2877         them use a refcount of 1.
2878         (WebCore::Range::create): Added.
2879         (WebCore::Range::startContainer): Updated to eliminate use of m_detached; detached
2880         is now indicated by m_start.container of 0. Also updated to use m_start instead
2881         of the old m_startContainer.
2882         (WebCore::Range::startOffset): Ditto.
2883         (WebCore::Range::endContainer): Ditto.
2884         (WebCore::Range::endOffset): Ditto.
2885         (WebCore::Range::commonAncestorContainer): Ditto.
2886         (WebCore::Range::collapsed): Ditto.
2887         (WebCore::Range::setStart): Ditto.
2888         (WebCore::Range::setEnd): Ditto.
2889         (WebCore::Range::collapse): Ditto.
2890         (WebCore::Range::isPointInRange): Ditto.
2891         (WebCore::Range::comparePoint): Ditto.
2892         (WebCore::Range::compareNode): Ditto.
2893         (WebCore::Range::compareBoundaryPoints): Ditto.
2894         (WebCore::Range::boundaryPointsValid): Ditto.
2895         (WebCore::Range::deleteContents): Ditto.
2896         (WebCore::Range::intersectsNode): Ditto.
2897         (WebCore::Range::processContents): Ditto.
2898         (WebCore::Range::extractContents): Ditto.
2899         (WebCore::Range::cloneContents): Ditto.
2900         (WebCore::Range::insertNode): Ditto.
2901         (WebCore::Range::toString): Ditto.
2902         (WebCore::Range::text): Ditto.
2903         (WebCore::Range::createContextualFragment): Ditto.
2904         (WebCore::Range::detach): Ditto.
2905         (WebCore::Range::checkNodeBA): Changed to use switch statements instead of
2906         multiple calls to the virtual nodeType() function.
2907         (WebCore::Range::cloneRange): Ditto.
2908         (WebCore::Range::setStartAfter): Ditto.
2909         (WebCore::Range::setEndBefore): Ditto.
2910         (WebCore::Range::setEndAfter): Ditto.
2911         (WebCore::Range::selectNode): Ditto.
2912         (WebCore::Range::selectNodeContents): Ditto.
2913         (WebCore::Range::surroundContents): Ditto.
2914         (WebCore::Range::setStartBefore): Ditto.
2915         (WebCore::Range::checkDeleteExtract): Ditto.
2916         (WebCore::Range::containedByReadOnly): Ditto.
2917         (WebCore::Range::firstNode): Ditto.
2918         (WebCore::Range::editingStartPosition): Ditto.
2919         (WebCore::Range::pastLastNode): Ditto.
2920         (WebCore::Range::addLineBoxRects): Ditto.
2921         (WebCore::Range::formatForDebugger): Ditto.
2922         (WebCore::operator==): Ditto.
2923         (WebCore::rangeOfContents): Ditto.
2924         (WebCore::Range::maxStartOffset): Ditto.
2925         (WebCore::Range::maxEndOffset): Ditto.
2926
2927         * dom/Range.h: Made constructors private. Added create functions.
2928         Added getters for startContainer/Offset and endContainer/Offset that
2929         return 0 instead of an exception for detached ranges that are inline
2930         and don't require an ExceptionCode out parameter. Changed the parameters
2931         to setStart and setEnd to PassRefPtr. Removed isDetached function.
2932         Made ActionType and processContents private. Made startPosition and
2933         endPosition inlines and have then return const&. Renamed startNode and
2934         pastEndNode to firstNode and pastLastNode to reduce the chance of
2935         confusion with startContainer/endContainer. Used Position for m_start
2936         and m_end instead of separate container and offset members. Changed
2937         maxStartOffset and maxEndOffset into int to match other offsets.
2938
2939         * editing/ApplyStyleCommand.cpp:
2940         (WebCore::ApplyStyleCommand::applyBlockStyle): Changed to use Range::create.
2941         (WebCore::ApplyStyleCommand::applyInlineStyle): Ditto.
2942         * editing/CompositeEditCommand.cpp:
2943         (WebCore::CompositeEditCommand::inputText): Ditto.
2944         (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
2945         * editing/DeleteSelectionCommand.cpp:
2946         (WebCore::DeleteSelectionCommand::mergeParagraphs): Ditto.
2947         * editing/Editor.cpp:
2948         (WebCore::Editor::fontForSelection): Changed for pastLastNode name change.
2949         (WebCore::Editor::setComposition): Changed to use Range::create.
2950         (WebCore::paragraphAlignedRangeForRange): Ditto.
2951         (WebCore::markMisspellingsOrBadGrammar): Changed to get rid of check for
2952         isDetached and check for 0 from startContainer instead.
2953         (WebCore::Editor::compositionRange): Changed to use Range::create.
2954         * editing/EditorCommand.cpp:
2955         (WebCore::unionDOMRanges): Ditto.
2956         * editing/Selection.cpp:
2957         (WebCore::Selection::toRange): Ditto.
2958         * editing/TextIterator.cpp:
2959         (WebCore::TextIterator::TextIterator): Changed for firstNode and pastLastNode
2960         name change.
2961         (WebCore::TextIterator::range): Changed to use Range::create.
2962         (WebCore::SimplifiedBackwardsTextIterator::range): Ditto.
2963         (WebCore::TextIterator::subrange): Ditto.
2964         * editing/VisiblePosition.cpp:
2965         (WebCore::makeRange): Ditto.
2966         * editing/VisiblePosition.h: Added now-needed include.
2967         * editing/htmlediting.cpp:
2968         (WebCore::indexForVisiblePosition): Changed to use Range::create.
2969         (WebCore::avoidIntersectionWithNode): Changed to get rid of check for
2970         isDetached and check for 0 instead and to use Range::create.
2971         * editing/markup.cpp:
2972         (WebCore::renderedText): Changed to use Range::create.
2973         (WebCore::createMarkup): Changed to no longer use isDetached and also
2974         for new firstNode/pastEndNode names.
2975         (WebCore::createFragmentFromText): Ditto.
2976         * editing/visible_units.cpp:
2977         (WebCore::previousBoundary): Changed to use Range::create.
2978         * page/mac/WebCoreFrameBridge.mm:
2979         (-[WebCoreFrameBridge convertToNSRange:]): Changed to no longer use
2980         isDetached().
2981         * rendering/RenderTextControl.cpp:
2982         (WebCore::RenderTextControl::visiblePositionForIndex): Changed to use Range::create.
2983         (WebCore::RenderTextControl::indexForVisiblePosition): Ditto.
2984
2985 2008-03-11  Daniel Zucker <zucker@wake3.com>
2986
2987         Reviewed by Adam Roben.
2988
2989         There are a handful of placed where the use of CFNetwork-specific
2990         calls are protected by PLATFORM(CF).  Revise to use the more specific
2991         USE(CFNETWORK) macro.  (See http://bugs.webkit.org/show_bug.cgi?id=17783) 
2992
2993         * platform/network/ProtectionSpace.cpp:  Change PLATFORM(CF) to USE(CFNETWORK)
2994         * platform/network/ResourceHandle.cpp: Change PLATFORM(CF) to USE(CFNETWORK)
2995         * platform/network/win/CookieJarWin.cpp:  Correct error in
2996           InternetGetCookie call.  Conditionalize 'cookiesEnabled' the same
2997           as all other implementations in this file.
2998
2999 2008-03-11  Xan Lopez  <xan@gnome.org>
3000
3001         Reviewed by Alp Toker.
3002
3003         http://bugs.webkit.org/show_bug.cgi?id=16476
3004
3005         Add libsoup HTTP backend.
3006         
3007         * GNUmakefile.am:
3008         * platform/network/ResourceHandleInternal.h:
3009         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3010         * platform/network/soup/AuthenticationChallenge.h: Added.
3011         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
3012         * platform/network/soup/ResourceError.h: Added.
3013         (WebCore::ResourceError::ResourceError):
3014         * platform/network/soup/ResourceHandleSoup.cpp: Added.
3015         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
3016         (WebCore::ResourceHandle::~ResourceHandle):
3017         (WebCore::dataCallback):
3018         (WebCore::parseDataUrl):
3019         (WebCore::ResourceHandle::start):
3020         (WebCore::ResourceHandle::cancel):
3021         (WebCore::ResourceHandle::bufferedData):
3022         (WebCore::ResourceHandle::supportsBufferedData):
3023         (WebCore::ResourceHandle::setDefersLoading):
3024         (WebCore::ResourceHandle::loadsBlocked):
3025         (WebCore::ResourceHandle::willLoadFromCache):
3026         * platform/network/soup/ResourceRequest.h: Copied from WebCore/platform/network/curl/ResourceRequest.h.
3027         (WebCore::ResourceRequest::ResourceRequest):
3028         (WebCore::ResourceRequest::doUpdatePlatformRequest):
3029         * platform/network/soup/ResourceResponse.h: Added.
3030         (WebCore::ResourceResponse::ResourceResponse):
3031         (WebCore::ResourceResponse::setResponseFired):
3032         (WebCore::ResourceResponse::responseFired):
3033         (WebCore::ResourceResponse::doUpdateResourceResponse):
3034
3035 2008-03-11  Rodney Dawes  <dobey@wayofthemonkey.com>
3036
3037         Fix Qt build.
3038
3039         * plugins/qt/PluginDataQt.cpp:
3040         (PluginData::initPlugins)
3041
3042 2008-03-11  Adam Roben  <aroben@apple.com>
3043
3044         Make attribute quoting in DOM view more consistent with source view
3045
3046         Two changes which make the DOM view more consistent with source view:
3047          1) We now quote all attribute values, including URLs
3048          2) The quotes around the values are now purple, matching the left and
3049             right angle brackets that surround the tag
3050
3051         One bug fixed by these changes:
3052          1) The entire URL is selected for editing when you double-click a URL
3053             that is an attribute value. Previously, the first and last
3054             characters were not included in the selection.
3055
3056         Reviewed by Darin.
3057
3058         * page/inspector/DocumentPanel.js:
3059         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Don't need
3060         to account for the quotes around attribute values anymore because the
3061         quotes are now outside the webkit-html-attribute-value span.
3062         * page/inspector/utilities.js:
3063         (nodeTitleInfo): Quote all attribute values, including URLs, and place
3064         the quotes outside the webkit-html-attribute-value span.
3065
3066 2008-03-11  Adam Roben  <aroben@apple.com>
3067
3068         Stop including pthread.h in WebCore on Windows
3069
3070         Reviewed by Darin.
3071
3072         * WebCore.vcproj/WebCore.vcproj:
3073           - Changed the include path to not contain pthreads/
3074           - Let VS remove a duplicate FileConfiguration element
3075           - Let VS have its way with the file ordering
3076         * WebCorePrefix.h: Made the #include of pthread.h be compiled out on
3077         Windows.
3078         * loader/FTPDirectoryDocument.cpp: Added a Windows-specific #define of
3079         localtime_r (pthread.h was providing a macro that substituted plain
3080         old localtime before, but localtime_s is "more secure", so I went with
3081         that).
3082         * loader/FTPDirectoryParser.cpp: Ditto for gmtime_r.
3083
3084 2008-03-11  Adam Roben  <aroben@apple.com>
3085
3086         Roll out r30961 since it broke the default site icon on Windows
3087
3088         * loader/icon/IconDatabase.cpp:
3089         (WebCore::IconDatabase::defaultIcon):
3090
3091 2008-03-11  Dan Bernstein  <mitz@apple.com>
3092
3093         Reviewed by Darin Adler.
3094
3095         - clean up line layout code
3096
3097         * platform/graphics/GraphicsContext.cpp:
3098         (WebCore::TextRunIterator::increment): Removed the resolver parameter.
3099         (WebCore::GraphicsContext::drawBidiText): Adjusted for changes to
3100         createBidiRunsForLine(), which no longer takes a start parameter.
3101         * platform/text/BidiResolver.h:
3102         (WebCore::BidiResolver::): Made Noncopyable and removed the
3103         m_adjustEmbedding member variable.
3104         (WebCore::BidiResolver::position): Added. Returns the resolver's current
3105         position.
3106         (WebCore::BidiResolver::setPosition): Added. Sets the resolver's current
3107         position without changing any other state.
3108         (WebCore::BidiResolver::increment): Added. Advances the resolver to the
3109         next position, allowing the iterator to push and pop embedding.
3110         (WebCore::BidiResolver::appendRun): Removed the resolver parameter in
3111         the call to increment().
3112         (WebCore::BidiResolver::embed): Removed code to save, set and restore
3113         m_adjustEmbedding.
3114         (WebCore::BidiResolver::createBidiRunsForLine): Changed to not take a
3115         'start' iterator. Instead, start at the current position. Removed code
3116         to set m_adjustEmbedding. Changed for noncopyability.
3117         * rendering/RenderBlock.h:
3118         * rendering/bidi.cpp:
3119         (WebCore::bidiNext): Made the resolver parameter optional. Changed to
3120         null-check the 'end of inline' pointer only twice.
3121         (WebCore::bidiFirst): Made the resolver parameter optional.
3122         (WebCore::BidiIterator::increment): Ditto.
3123         (WebCore::BidiState::increment): Added. Overrides the default
3124         BidiResolver::increment() method by passing the resolver to
3125         BidiIterator::increment().
3126         (WebCore::checkMidpoints): Removed the resolver parameter.
3127         (WebCore::BidiState::appendRun): Removed code to save, set and restore
3128         m_adjustEmbedding. Adjusted for change to increment().
3129         (WebCore::RenderBlock::bidiReorderLine): Removed the 'start' parameter
3130         and unreachable code.
3131         (WebCore::buildCompactRuns): Adjusted for changes to BidiResolver/
3132         (WebCore::RenderBlock::layoutInlineChildren): Moved code to initialize
3133         the resolver from this method to determineStartPosition(). Unified the
3134         resolver with the 'start' iterator. Removed unreachable code. Moved one
3135         statement from the beginning of the while loop to the end.
3136         (WebCore::RenderBlock::determineStartPosition): Moved code to initialize
3137         the resolver from layoutInlineChildren() into this method.
3138         (WebCore::RenderBlock::matchedEndLine): Adjusted for the resolver and
3139         the 'start' iterator being one object.
3140         (WebCore::skipNonBreakingSpace): Made the parameter const.
3141         (WebCore::requiresLineBox): Ditto.
3142         (WebCore::RenderBlock::generatesLineBoxesForInlineChild): Adjusted for
3143         the change to BidiIterator::increment().
3144         (WebCore::RenderBlock::skipWhitespace): Made two versions of this
3145         method, one for BidiIterator and one for BidiState.
3146         (WebCore::shouldSkipWhitespaceAfterStartObject): Removed the resolver
3147         parameter.
3148         (WebCore::RenderBlock::findNextLineBreak): Removed the resolver
3149         parameter. Removed calls to setAdjustEmbedding(). Removed the 'previous'
3150         variable and changed the 'last' variable to do its job.
3151         * rendering/bidi.h:
3152
3153 2008-03-10  Adam Roben  <aroben@apple.com>
3154
3155         Part of Bug 17224: DOM nodes/attributes should be editable
3156
3157         <http://bugs.webkit.org/show_bug.cgi?id=17224>
3158         <rdar://problem/5732825>
3159
3160         This patch makes text nodes editable via double-click.
3161
3162         Reviewed by Tim.
3163
3164         * page/inspector/DocumentPanel.js:
3165         (WebInspector.DOMNodeTreeElement._startEditing):
3166           - Moved most of this code to _startEditingAttribute
3167           - Calls _startEditingTextNode or _startEditingAttribute as
3168             appropriate
3169         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Added. Code
3170         came from _startEditing.
3171         (WebInspector.DOMNodeTreeElement._startEditingTextNode): Added.
3172         (WebInspector.DOMNodeTreeElement._textNodeEditingCommitted): Added.
3173         (WebInspector.DOMNodeTreeElement._editingCancelled): Renamed from
3174         _attributeEditingCancelled.
3175         * page/inspector/utilities.js:
3176         (nodeTitleInfo): Wrap text nodes in a webkit-html-text-node span so
3177         that we can easily recognize/edit them.
3178
3179 2008-03-11  Holger Hans Peter Freyther  <zecke@selfish.org>
3180
3181         Reviewed by Darin.
3182
3183         r25512 inlined the urlIcon to improve the startup time of Safari on Mac. Inlining is
3184         not suitable for platforms where this icon is themable. E.g. the Qt platform is allowing
3185         to theme this icon and the Gtk+ platform will probably end up with themable icons
3186         as well.
3187         
3188         Remove dead code from the windows port and move the urlIcon from the windows
3189         directory to the Resource directory to be used by Qt and other ports.
3190         
3191         Ifdef the usage of the built-in icon in IconDatabase.cpp and for Qt do not use
3192         it. Gtk+ currently has no proper implementation of Image::loadPlatformResource but
3193         once it does it wants to use this for getting the urlIcon as well.
3194
3195         * Resources/urlIcon.png: Renamed from WebKit/win/WebKit.vcproj/urlIcon.png.
3196         * loader/icon/IconDatabase.cpp:
3197         (WebCore::IconDatabase::defaultIcon):
3198
3199 2008-03-11  Tor Arne Vestbø  <tavestbo@trolltech.com>
3200
3201         Reviewed by Darin.
3202
3203         Implemented HTML media element support for QtWebKit, using Phonon.
3204
3205         http://bugs.webkit.org/show_bug.cgi?id=17766
3206
3207         * WebCore.pro:
3208         * platform/graphics/MediaPlayer.cpp:
3209         * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp: Added.
3210         (debugMediaObject):
3211         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
3212         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
3213         (WebCore::MediaPlayerPrivate::getSupportedTypes):
3214         (WebCore::MediaPlayerPrivate::hasVideo):
3215         (WebCore::MediaPlayerPrivate::load):
3216         (WebCore::MediaPlayerPrivate::cancelLoad):
3217         (WebCore::MediaPlayerPrivate::play):
3218         (WebCore::MediaPlayerPrivate::pause):
3219         (WebCore::MediaPlayerPrivate::paused):
3220         (WebCore::MediaPlayerPrivate::seek):
3221         (WebCore::MediaPlayerPrivate::seeking):
3222         (WebCore::MediaPlayerPrivate::duration):
3223         (WebCore::MediaPlayerPrivate::currentTime):
3224         (WebCore::MediaPlayerPrivate::setEndTime):
3225         (WebCore::MediaPlayerPrivate::maxTimeBuffered):
3226         (WebCore::MediaPlayerPrivate::maxTimeSeekable):
3227         (WebCore::MediaPlayerPrivate::bytesLoaded):
3228         (WebCore::MediaPlayerPrivate::totalBytesKnown):
3229         (WebCore::MediaPlayerPrivate::totalBytes):
3230         (WebCore::MediaPlayerPrivate::setRate):
3231         (WebCore::MediaPlayerPrivate::setVolume):
3232         (WebCore::MediaPlayerPrivate::setMuted):
3233         (WebCore::MediaPlayerPrivate::dataRate):
3234         (WebCore::MediaPlayerPrivate::networkState):
3235         (WebCore::MediaPlayerPrivate::readyState):
3236         (WebCore::MediaPlayerPrivate::updateStates):
3237         (WebCore::MediaPlayerPrivate::setVisible):
3238         (WebCore::MediaPlayerPrivate::setRect):
3239         (WebCore::MediaPlayerPrivate::loadStateChanged):
3240         (WebCore::MediaPlayerPrivate::rateChanged):
3241         (WebCore::MediaPlayerPrivate::sizeChanged):
3242         (WebCore::MediaPlayerPrivate::timeChanged):
3243         (WebCore::MediaPlayerPrivate::volumeChanged):
3244         (WebCore::MediaPlayerPrivate::didEnd):
3245         (WebCore::MediaPlayerPrivate::loadingFailed):
3246         (WebCore::MediaPlayerPrivate::naturalSize):
3247         (WebCore::MediaPlayerPrivate::eventFilter):
3248         (WebCore::MediaPlayerPrivate::repaint):
3249         (WebCore::MediaPlayerPrivate::paint):
3250         (WebCore::MediaPlayerPrivate::stateChanged):
3251         (WebCore::MediaPlayerPrivate::tick):
3252         (WebCore::MediaPlayerPrivate::metaDataChanged):
3253         (WebCore::MediaPlayerPrivate::seekableChanged):
3254         (WebCore::MediaPlayerPrivate::hasVideoChanged):
3255         (WebCore::MediaPlayerPrivate::bufferStatus):
3256         (WebCore::MediaPlayerPrivate::finished):
3257         (WebCore::MediaPlayerPrivate::currentSourceChanged):
3258         (WebCore::MediaPlayerPrivate::aboutToFinish):
3259         (WebCore::MediaPlayerPrivate::prefinishMarkReached):
3260         (WebCore::MediaPlayerPrivate::totalTimeChanged):
3261         * platform/graphics/qt/MediaPlayerPrivatePhonon.h: Added.
3262         (WebCore::MediaPlayerPrivate::):
3263         (WebCore::MediaPlayerPrivate::isAvailable):
3264
3265 2008-03-10  Sam Weinig  <sam@webkit.org>
3266
3267         Reviewed by Beth Dakin.
3268
3269         Throw a SECURITY_ERR when accessing a tainted canvas
3270         by CanvasRenderingContext2D::getImageData() and
3271         HTMLCanvasElement::toDataURL().
3272
3273         * html/CanvasRenderingContext2D.cpp:
3274         (WebCore::CanvasRenderingContext2D::getImageData):
3275         * html/CanvasRenderingContext2D.h:
3276         * html/CanvasRenderingContext2D.idl:
3277         * html/HTMLCanvasElement.cpp:
3278         (WebCore::HTMLCanvasElement::toDataURL):
3279         * html/HTMLCanvasElement.h:
3280         * html/HTMLCanvasElement.idl:
3281
3282 2008-03-10  Justin Garcia  <justin.garcia@apple.com>
3283
3284         Reviewed by Sam.
3285
3286         <rdar://problem/5779984> REGRESSION (r30391): GMail: Safari won't display the Edit Link dialog
3287
3288         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3289         (WebCore::hasCSSPropertyNamePrefix): Fixed a typo.  The code was only
3290         comparing the first character of the prefix to the first character
3291         of the property name.
3292
3293 2008-03-10  Andre Boule  <aboule@apple.com>
3294
3295         Reviewed by Beth.
3296
3297         Hold off on initializing the frame to avoid the RenderView getting 
3298         a null FrameView. This could potentially cause problems.
3299
3300         * svg/graphics/SVGImage.cpp:
3301         (WebCore::SVGImage::dataChanged):
3302
3303 2008-03-10  Darin Adler  <darin@apple.com>
3304
3305         - try to fix Qt build
3306
3307         * bridge/qt/qt_runtime.cpp:
3308         (KJS::Bindings::convertQVariantToValue): Change KJS::UChar to UChar.
3309
3310 2008-03-10  Darin Adler  <darin@apple.com>
3311
3312         Reviewed by Antti.
3313
3314         - fix <rdar://problem/3059610> VIP: links opened in new frame, window, or tab
3315           should be redrawn as visited immediately
3316         - fix <rdar://problem/4382809> Going "back" a page doesn't change the color of
3317           the visited URL at directory.umi
3318         - fix http://bugs.webkit.org/show_bug.cgi?id=4941
3319           Visited links should be marked as visited
3320         - fix http://bugs.webkit.org/show_bug.cgi?id=7960
3321           REGRESSION: Visited link color doesn't displayed after loading page from cache
3322
3323         We now mark all links on a page as "changed" at the appropriate times.
3324
3325         * WebCore.base.exp: Update since I made completeURL be a const member function.
3326
3327         * css/CSSStyleSelector.cpp: Got rid of some unneeded globals that could be turned
3328         into locals. Also changed some static data members to file-scoped globals with
3329         internal linkage. Renamed the globals to get rid of the m_ prefix. Changed the
3330         prefix on m_styleNotYetAvailable to s_styleNotYetAvailable.
3331         (WebCore::CSSStyleSelector::CSSStyleSelector): Updated for name changes.
3332         (WebCore::parseUASheet): Tweak the comment.
3333         (WebCore::CSSStyleSelector::loadDefaultStyle): Updated for name changes and to
3334         use local variables instead of globals where possible.
3335         (WebCore::CSSStyleSelector::checkPseudoState): Made this a member function so
3336         it can store the link in a hash. Also changed it to have a return value instead
3337         of having it modify a global variable. Added code to put the hash into a set so
3338         we can tell later if this is one of the links that affects this page.
3339         (WebCore::CSSStyleSelector::canShareStyleWithElement): Updated for the change to
3340         checkPseudoState.
3341         (WebCore::CSSStyleSelector::matchUARules): Updated for name changes.
3342         (WebCore::CSSStyleSelector::styleForElement): Ditto.
3343         (WebCore::CSSStyleSelector::adjustRenderStyle): Ditto.
3344         (WebCore::CSSStyleSelector::pseudoStyleRulesForElement): Changed code to read
3345         the SVG style sheet to use a boolean global and put it right here in the function
3346         since this is the only code that needs to know about it.
3347         (WebCore::CSSStyleSelector::checkOneSelector): Updated for name changes.
3348         (WebCore::colorForCSSValue): Moved code inside the function that is not needed
3349         anywhere else.
3350         (WebCore::CSSStyleSelector::getColorFromPrimitiveValue): Updaed for the change
3351         to checkPseudoState.
3352         (WebCore::CSSStyleSelector::allVisitedStateChanged): Added. Calls setChanged on
3353         all links if there were any in the set.
3354         (WebCore::CSSStyleSelector::visitedStateChanged): Added. Calls setChanged on all
3355         links if the one that changed is in the set.
3356
3357         * css/CSSStyleSelector.h: Removed unused StyleSelector class and State enum. Made
3358         CSSStyleSelector derive from Noncopyable. Made lots of member functions private that
3359         didn't need to be public, and removed others that could be made into non-member
3360         functions. Changed pseudoStyleRulesForElement to take a const String& instead of
3361         a StringImpl*. Added new allVisitedStateChanged and visitedStateChanged functions.
3362         Got rid of unneeded friend declarations.
3363
3364         * dom/Document.cpp:
3365         (WebCore::Document::completeURL): Made const.
3366         (WebCore::findSlashDotDotSlash): Moved here from PageGroup.
3367         (WebCore::findSlashSlash): Ditto.
3368         (WebCore::findSlashDotSlash): Ditto.
3369         (WebCore::containsColonSlashSlash):
3370         (WebCore::cleanPath): Ditto.
3371         (WebCore::matchLetter): Ditto.
3372         (WebCore::needsTrailingSlash): Ditto.
3373         (WebCore::Document::visitedLinkHash): Moved this here from PageGroup. This is
3374         the poor-man's completeURL function. The idea of putting it here is that this
3375         way it can be alongside the real completeURL function. Later we should figure out
3376         a way to make this function share more code with the real thing and match behavior.
3377
3378         * dom/Document.h: Marked completeURL function const. Added visitedLinkHash function.
3379
3380         * page/DOMWindow.cpp:
3381         (WebCore::DOMWindow::getMatchedCSSRules): Updated for change to CSSStyleSelector.
3382
3383         * page/Page.cpp:
3384         (WebCore::Page::allVisitedStateChanged): Added. Calls allVisitedStateChanged on all
3385         style selectors.
3386         (WebCore::Page::visitedStateChanged): Ditto.
3387         * page/Page.h: Added the above functions.
3388
3389         * page/PageGroup.cpp:
3390         (WebCore::PageGroup::isLinkVisited): Changed to take a visitedLinkHash parameter.
3391         The CSSStyleSelector now handles actually computing the hash, and it does so by
3392         calling code in Document.
3393         (WebCore::PageGroup::addVisitedLink): Refactored so the two overloaded copies share
3394         a bit more code. Added code that calls visitedStateChanged if a new link was added.
3395         (WebCore::PageGroup::removeVisitedLinks): Added code to call allVisitedStateChanged
3396         if any visited links are removed.
3397         * page/PageGroup.h: Include StringHash.h instead of having the AlreadyHashed struct
3398         definition here.
3399
3400         * platform/text/StringHash.h:
3401         (WebCore::CaseFoldingHash::hash): Tweaked to make this a bit more consistent with
3402         the StringImpl::computeHash function, using the same technique for avoiding 0.
3403         (WebCore::AlreadyHashed::hash): Added. Was formerly in PageGroup.h.
3404         (WebCore::AlreadyHashed::avoidDeletedValue): Added. Was formerly in PageGroup.cpp.
3405
3406         * rendering/RenderStyle.cpp:
3407         (WebCore::RenderStyle::isStyleAvailable): Changed to use an inline function instead
3408         of getting directly at a data member so the data member could be made private.
3409
3410         * loader/FrameLoader.cpp:
3411         (WebCore::FrameLoader::scrollToAnchor): Added call to updateHistoryForAnchorScroll.
3412         (WebCore::FrameLoader::updateHistoryForAnchorScroll): Added.
3413         * loader/FrameLoader.h: Added updateHistoryForAnchorScroll.
3414
3415 2008-03-10  Adam Roben  <aroben@apple.com>
3416
3417         Part of Bug 17224: DOM nodes/attributes should be editable
3418
3419         <http://bugs.webkit.org/show_bug.cgi?id=17224>
3420         <rdar://problem/5732825>
3421
3422         This patch makes DOM attributes editable via double-click.
3423
3424         Reviewed by Tim.
3425
3426         * page/inspector/DocumentPanel.js:
3427         (WebInspector.DOMNodeTreeElement.onmousedown): Don't do anything if
3428         we're being edited, since we want default editing behaviors to work.
3429         (WebInspector.DOMNodeTreeElement.ondblclick): Try to start editing
3430         before doing anything else.
3431         (WebInspector.DOMNodeTreeElement._startEditing): Added. Currently only
3432         lets you edit attributes.
3433         (WebInspector.DOMNodeTreeElement._attributeEditingCommitted): Added.
3434         Uses a scratch element to get the new attribute(s) parsed, then sets
3435         the attribute(s) on the node in the inspected document.
3436         (WebInspector.DOMNodeTreeElement._attributeEditingCancelled): Added.
3437         (WebInspector.DOMNodeTreeElement._updateTitle): Added. Refreshes the
3438         representation of the node in the Inspector's DOM tree to reflect
3439         the node's current state.
3440         * page/inspector/inspector.css: Made the .editing class apply
3441         everywhere.
3442         * page/inspector/utilities.js:
3443         (nodeTitleInfo): Changed to surround attribute name/value pairs in a
3444         webkit-html-attribute span so that we can easily edit the pair as a
3445         whole.
3446
3447 2008-03-10  David Kilzer  <ddkilzer@apple.com>
3448
3449         Fix 64-bit builds.
3450
3451         Reviewed by Stephanie.
3452
3453         WebCore.exp only gets generated once for both 32-bit and 64-bit builds,
3454         so we must exclude the _NPN symbols when creating WebCore.LP64.exp.
3455
3456         * WebCore.xcodeproj/project.pbxproj: Reverted build phase shell code to
3457         r30826 to remove _NPN symbols from 64-bit builds in WebCore.LP64.exp.
3458
3459 2008-03-10  Eric Seidel  <eric@webkit.org>
3460
3461         Reviewed by Darin.
3462
3463         Remove KJS::UChar, use ::UChar instead
3464         http://bugs.webkit.org/show_bug.cgi?id=17017
3465
3466         To functional changes, thus no tests.
3467
3468         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3469         (WebCore::hasCSSPropertyNamePrefix):
3470         (WebCore::cssPropertyName):
3471         * bindings/js/JSDOMWindowBase.cpp:
3472         (WebCore::windowProtoFuncAToB):
3473         (WebCore::windowProtoFuncBToA):
3474         * bindings/js/JSSVGPODTypeWrapper.h:
3475         * bindings/js/kjs_proxy.cpp:
3476         (WebCore::KJSProxy::evaluate):
3477         * bridge/objc/objc_utility.mm:
3478         (KJS::Bindings::throwError):
3479         * dom/Document.cpp:
3480         (WebCore::Document::parseQualifiedName):
3481         * platform/text/AtomicString.cpp:
3482         (WebCore::AtomicString::add):
3483         * platform/text/String.cpp:
3484         (WebCore::String::String):
3485         (WebCore::String::operator Identifier):
3486         (WebCore::String::operator UString):
3487         * platform/text/TextCodecICU.cpp:
3488         (WebCore::TextCodecICU::decode):
3489         * svg/SVGAnimatedTemplate.h:
3490
3491 2008-03-10  Darin Adler  <darin@apple.com>
3492
3493         Reviewed by Sam.
3494
3495         - eliminate keyboard UI mode method from WebCoreFrameBridge
3496
3497         * page/ChromeClient.h: Added keyboardUIMode function.
3498         (WebCore::ChromeClient::keyboardUIMode): Ditto.
3499         * page/mac/EventHandlerMac.mm:
3500         (WebCore::EventHandler::tabsToAllControls): Call chrome client function instead
3501         of bridge function.
3502         * page/mac/WebCoreFrameBridge.h: Removed keyboardUIMode method, and other unused
3503         ones.
3504
3505         * WebCore.xcodeproj/project.pbxproj: Allowed Xcode to change the project.
3506         Do not try to fight the Xcode.
3507
3508 2008-03-10  Darin Adler  <darin@apple.com>
3509
3510