2007-05-11 Holger Freyther <freyther@kde.org>
[WebKit-https.git] / WebCore / ChangeLog
1 2007-05-11  Holger Freyther <freyther@kde.org>
2
3         Reviewed by Mark Rowe.
4
5         Move libcurl configuration into WebKit.pri so it will be used by GdkLauncher.
6
7         * WebCore.pro:
8
9 2007-05-10  David Hyatt  <hyatt@apple.com>
10
11         <rdar://problem/5015522> Bounds rectangle of unloaded images is 
12         drawn briefly while loading
13         
14         When the image is null and has no size, don't draw the grey
15         rectangles or alt text any more.  Wait for an actual error to
16         occur with the image before we start showing alt text and borders.
17
18         (Images with no source set at all will continue to show alt text and
19         borders immediately.)
20
21         Reviewed by bradee-oh
22
23         * rendering/RenderImage.cpp:
24         (WebCore::RenderImage::paint):
25
26 2007-05-10  Mitz Pettel  <mitz@webkit.org>
27
28         Reviewed by Darin.
29
30         - fix http://bugs.webkit.org/show_bug.cgi?id=13655
31           Incomplete repaint when text-shadow is used in a render layer with explicit height
32
33         Test: fast/repaint/layer-full-repaint.html
34
35         Removed custom repaint logic from RenderLayer. repaintAfterLayoutIfNeeded()
36         knows how to do everything we need now. The only catch is that we cannot
37         rely on its "do a full repaint if the object needs layout" behavior, since
38         by the time we call it, the needs layout flag has been reset. The solution
39         is to cache the need for a full repaint in the layer.
40
41         * page/FrameView.cpp:
42         (WebCore::FrameView::layout): Removed call to checkForRepaintOnResize().
43         * rendering/RenderLayer.cpp:
44         (WebCore::RenderLayer::checkForRepaintOnResize): Removed.
45         (WebCore::RenderLayer::RenderLayer): Replaced the m_repaintOverflowOnResize
46         flag with a m_needsFullRepaint flag, which indicates that the layer needs
47         to do a full repaint in the next call to updateLayerPositions().
48         (WebCore::RenderLayer::updateLayerPositions): Simplified the repaint logic.
49         Either call repaintAfterLayoutIfNeeded() or do a full repaint, depending on
50         m_needsFullRepaint.
51         * rendering/RenderLayer.h:
52         (WebCore::RenderLayer::setNeedsFullRepaint):
53         * rendering/RenderObject.cpp:
54         (WebCore::RenderObject::setNeedsLayout): Mark the layer for full repaint.
55
56 2007-05-10  Justin Garcia  <justin.garcia@apple.com>
57
58         Reviewed by ggaren
59
60         <rdar://problem/5195166> Incorrect proposedRange DOMRange passed to WebViewEditing delegate
61         
62         In setModifyBias, we must cache the start and the end 
63         because the calls to setBase and setExtent can modify 
64         them (added a testcase).
65         The temporary SelectionController that we use in modify() to
66         produce the proposed range that will be passed to 
67         shouldChangeSelectedDOMRange must have the same m_modifyBias
68         as the original SelectionController, or else when the 
69         modification is performed, setModifyBias can swap the base 
70         and the extent incorrectly (added a testcase).
71         Renamed m_modifyBias to m_lastChangeWasHorizontalExtension.
72         Renamed setModifyBias to willBeModified.
73
74         * editing/SelectionController.cpp:
75         (WebCore::SelectionController::SelectionController):
76         (WebCore::SelectionController::setSelection):
77         (WebCore::SelectionController::willBeModified):
78         (WebCore::SelectionController::modify):
79         * editing/SelectionController.h:
80         (WebCore::SelectionController::setLastChangeWasHorizontalExtension):
81         * page/EventHandler.cpp:
82         (WebCore::EventHandler::handleMousePressEventSingleClick):
83         (WebCore::EventHandler::updateSelectionForMouseDragOverPosition):
84
85 2007-05-10  Geoffrey Garen  <ggaren@apple.com>
86
87         Reviewed by Darin Adler.
88
89         "IconDatabase::sharedIconDatabase()" => "iconDatabase()" for terseness,
90         in the style of WebCore::cache().
91
92         * WebCore.exp:
93         * history/HistoryItem.cpp: Removed retainIconInDatabase because calling
94         "retain" in order to release something is really confusing and, now that
95         iconDatabase() is more terse, we don't need this helper to shorten the
96         syntax. (The isEmpty() check is also done by the database, so we don't 
97         need it either.)
98
99         (WebCore::IconDatabase::~IconDatabase): ASSERT that our destructor isn't
100         called. We're a singleton, so it's confusing to have tear-down code.
101
102 2007-05-10  Adele Peterson  <adele@apple.com>
103
104         Reviewed by Hyatt.
105
106         WebCore part of fix for <rdar://problem/4100616> Doing a "find" in RSS doesn't scroll to result
107
108         Test: fast/overflow/scroll-nested-positioned-layer-in-overflow.html
109
110         Merged visibleSelectionRect into selectionRect.  selectionRect() now takes an argument to determine
111         whether or not to return a rect that clips to the visible content.  This change makes all of the implementations of selectionRect
112         consistent by having them all consider the repaint rect when clipping to visible content.
113
114         * page/Frame.cpp:
115         (WebCore::Frame::revealSelection): Call selectionRect with clipToVisibleContent = false, so we can get a rect that's not visible to reveal.
116         (WebCore::Frame::selectionRect): Added clipToVisibleContent argument, and merged visibleSelectionRect into this method.
117         (WebCore::Frame::setIsActive): Use selectionRect instead of visibleSelectionRect.
118         * page/Frame.h:
119         * page/mac/FrameMac.mm: (WebCore::Frame::selectionImage): Update layout before creating the image.  Use selectionRect instead of visibleSelectionRect.
120         * page/DragController.cpp: (WebCore::dragLocForSelectionDrag): Use selectionRect instead of visibleSelectionRect.
121
122         * rendering/RenderBR.h: (WebCore::RenderBR::selectionRect): Updated argument.
123         * rendering/RenderBlock.h: (WebCore::RenderBlock::selectionRect): ditto.
124         * rendering/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::selectionRect): ditto.
125         * rendering/RenderSVGInlineText.h: ditto.
126         * rendering/RenderObject.h: 
127         (WebCore::RenderObject::selectionRect): ditto.
128         (WebCore::RenderObject::SelectionInfo::SelectionInfo): ditto.
129         * rendering/RenderView.cpp:
130         (WebCore::RenderView::selectionRect): ditto.
131         (WebCore::RenderView::setSelection): ditto.
132         * rendering/RenderView.h:
133
134         * rendering/RenderText.h:
135         * rendering/RenderText.cpp: (WebCore::RenderText::selectionRect): Only call computeAbsoluteRepaintRect when clipping to visible content.
136         Otherwise, just adjust the rect to the correct position.
137         * rendering/RenderListMarker.h:
138         * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::selectionRect):
139           To match what we do in RenderText, if we're trying to clip to visible content, just call computeAbsoluteRepaintRect.
140         * rendering/RenderReplaced.h:
141         * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::selectionRect): ditto.
142
143         * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): Check for a parent layer at the beginning, so we can try to scroll all of our parent layers 
144           first, before trying to scroll the top level view.  Also, don't try to scroll overflow layers that have -webkit-line-clamp restricting the height.
145           This will prevent us from revealing text hidden by the slider in Safari RSS.
146
147         * WebCore.exp: Update symbols for WebKit.
148
149 2007-05-10  David Hyatt  <hyatt@apple.com>
150
151         Fix for:
152
153         <rdar://problem/5195272> REGRESSION: broke outline rings for continuations 
154         with empty inline containers
155         
156         http://bugs.webkit.org/show_bug.cgi?id=13667
157
158         Make sure to only include collapsed top/bottom margins of the block portion
159         of the continuation if we know for sure that we have inline line boxes before
160         and after that would prevent the collapse from going further.
161
162         In plain English: the focus rings were too tall. :)
163
164         Reviewed by beth
165
166         * rendering/RenderFlow.cpp:
167         (WebCore::RenderFlow::addFocusRingRects):
168
169 2007-05-10  David Hyatt  <hyatt@apple.com>
170
171         Fix for:
172
173         <rdar://problem/5067235> REGRESSION: Excessively wide table, impossible to resize
174
175         The table used white-space: pre-wrap, which is supported only by WebKit.  There
176         was a bug with the computation of min pref width for pre-wrap text.
177
178         Reviewed by mitzpettel
179
180         fast/text/white-space/pre-wrap-line-test.html
181
182         * rendering/RenderText.cpp:
183         (WebCore::RenderText::calcPrefWidths):
184
185 2007-05-10  Brady Eidson  <beidson@apple.com>
186
187         Reviewed by Oliver
188
189         Cleanup from my earlier Java Applet patch.  We should keep a central location to query if 
190         a mime type counts as a Java Applet
191
192         * html/HTMLObjectElement.cpp:
193         (WebCore::HTMLObjectElement::containsJavaApplet): Query MimeTypeRegistry on the type
194
195         * platform/MimeTypeRegistry.cpp:
196         (WebCore::MimeTypeRegistry::isSupportedImageMIMEType): Update style
197         (WebCore::MimeTypeRegistry::isSupportedImageResourceMIMEType): Ditto
198         (WebCore::MimeTypeRegistry::isSupportedNonImageMIMEType): Ditto
199         (WebCore::MimeTypeRegistry::isJavaAppletMIMEType): Perform the Java Applet check
200         * platform/MimeTypeRegistry.h:
201
202         * rendering/RenderPartObject.cpp:
203         (WebCore::RenderPartObject::updateWidget): Query MimeTypeRegistry on the type
204
205 2007-05-10  Patti Hoa  <patti@apple.com>
206
207         Reviewed by Darin.
208         
209         <rdar://problem/4720109> Sentence textMarker methods do not work well with empty lines
210         
211         * bridge/mac/WebCoreAXObject.mm:
212         (-[WebCoreAXObject doAXNextSentenceEndTextMarkerForTextMarker:]):
213         (-[WebCoreAXObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
214         When a marker position is given, the sentence ax methods automatically shift position by one to make sure
215         not to ask for the current sentence again.  This is generally fine except when the position
216         shift over an empty line break, which is should be considered a separate sentence. In this case, 
217         if we used the shifted position to ask for sentence boundary, ICU parser is not given the text data
218         containing the newline to correctly determine the sentence boundary.  Since the ax sentence method is 
219         explicitly shifting the position to ask for sentence boundary, it should make sure not to skip over important
220         character that can be a standalone sentence.
221         * editing/visible_units.cpp:
222         (WebCore::nextBoundary):
223         When determining boundary, don't stop on a collapsed range, such as newline.  
224         Just pick the next valid position to use as boundary.
225
226 2007-05-10  Maciej Stachowiak  <mjs@apple.com>
227
228         Reviewed by Oliver.
229
230         - WebCore part of fix for:
231         <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
232         <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)
233
234         The basic approach is to have Frames start out containing an empty document instead of absolutely nothing,
235         so there is no need to initialize them on demand. Various side effects of that cause both of these bugs.
236         
237         However, this caused many regressions so I had to fix the fallout.
238         
239         * WebCore.exp: fix symbol exports
240         * bindings/js/kjs_window.cpp:
241         (KJS::createNewWindow): useless "created" bool (we don't need it here)
242         (KJS::WindowFunc::callAsFunction): detect if we created a new frame, because if so,
243         we need to initialize the domain (can't count on it not having a document), also
244         don't try to make a new document for it.
245         Also, stop properly.
246         * css/cssstyleselector.cpp:
247         (WebCore::CSSStyleSelector::CSSStyleSelector): don't count on document having a view here
248         * html/HTMLObjectElement.cpp:
249         (WebCore::HTMLObjectElement::isImageType): Ask client, to match how other <object> renderer
250         decisions are made.
251         * loader/FrameLoader.cpp:
252         (WebCore::FrameLoader::FrameLoader): Initialize new data members
253         (WebCore::FrameLoader::init): Do the slightly tricky sequence of steps to properly make
254         an empty document with everything hooked up.
255         (WebCore::FrameLoader::createWindow): Added "created" bool.
256         (WebCore::FrameLoader::stopLoading): (whitespace change)
257         (WebCore::FrameLoader::begin): Don't try to create an empty document.
258         (WebCore::FrameLoader::finishedParsing): If creating an initial empty document, don't
259         do any of this work.
260         (WebCore::FrameLoader::checkCompleted): Do checkLoadComplete() as well.
261         (WebCore::FrameLoader::baseURL): don't check for null document
262         (WebCore::FrameLoader::baseTarget): ditto
263         (WebCore::FrameLoader::completeURL): ditto
264         (WebCore::FrameLoader::didTellBridgeAboutLoad): ditto
265         (WebCore::FrameLoader::scheduleLocationChange): determine duringLoad differently; doc won't
266         be null.
267         (WebCore::FrameLoader::gotoAnchor): don't check for null document
268         (WebCore::FrameLoader::canTarget): don't check for null document
269         (WebCore::FrameLoader::stopForUserCancel): new method for explicit stops like window.stop().
270         (WebCore::FrameLoader::transitionToCommitted): check for pre-loaded state properly
271         (WebCore::FrameLoader::createEmptyDocument): removed
272         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): don't send delegate callbacks when making initial
273         doc.
274         (WebCore::FrameLoader::tokenizerProcessedData): Assume document; just checkCompleted now that it
275         does checkLoadComplete.
276         (WebCore::FrameLoader::receivedMainResourceError): assume document
277         (WebCore::FrameLoader::saveDocumentState): Assume there's a document except during initial load
278         (WebCore::FrameLoader::mainReceivedCompleteError): do checkCompleted, not checkLoadComplete
279         (WebCore::FrameLoader::continueLoadWithData): assume document
280         * loader/FrameLoader.h:
281         * loader/MainResourceLoader.cpp:
282         (WebCore::MainResourceLoader::receivedError): Add more ref protection and do things in a slightly
283         different order.
284         * page/DOMWindow.cpp:
285         (WebCore::DOMWindow::document): don't force document creation, just assert there is one.
286         * page/Frame.cpp:
287         (WebCore::Frame::init): Added init method.
288         (WebCore::Frame::pageDestroyed): when a frame is removed, make sure to check if the parent is
289         done loading.
290         * page/Frame.h:
291         * page/mac/WebCoreFrameBridge.mm:
292         (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]): No need to force
293         document.
294         (-[WebCoreFrameBridge aeDescByEvaluatingJavaScriptFromString:]): ditto
295         * platform/graphics/svg/SVGImage.cpp:
296         (WebCore::SVGImage::dataChanged): init the frame
297         * rendering/RenderPart.cpp:
298         (WebCore::RenderPart::updateWidgetPosition): If a subframe needs layout, then lay it out even
299         if the bounds did not change; the content size might be wrong.
300         * rendering/RenderTreeAsText.cpp:
301         (WebCore::externalRepresentation): Don't crash if the frame lacks a view.
302
303 2007-05-10  David Hyatt  <hyatt@apple.com>
304
305         Fix for:
306
307         <rdar://problem/5146757> REGRESSION: div that wrapped to screen width in 
308         tiger no longer wraps
309         
310         http://bugs.webkit.org/show_bug.cgi?id=13654
311
312         Reviewed by mitz
313
314         fast/text/whitespace/normal-after-nowrap-breaking.html
315
316         * rendering/RenderBlock.cpp:
317         (WebCore::RenderBlock::calcInlinePrefWidths):
318
319 2007-05-10  David Hyatt  <hyatt@apple.com>
320
321         Fix for:
322
323         <rdar://problem/4778099> Links with nested continuations fail to 
324         paint their outlines (11255)
325         
326         http://bugs.webkit.org/show_bug.cgi?id=11255
327
328         Fix multiple bugs with outline painting of continuations to ensure that
329         all combos work (empty/full inline - block with/without margins - 
330         empty/full inline).
331
332         Reviewed by mitz
333
334         fast/inline/continuation-outlines.html
335
336         * rendering/RenderBlock.cpp:
337         (WebCore::RenderBlock::paintObject):
338         * rendering/RenderFlow.cpp:
339         (WebCore::RenderFlow::addFocusRingRects):
340
341 2007-05-10  David Hyatt  <hyatt@apple.com>
342
343         Fix for:
344
345         <rdar://problem/5193529> REGRESSION: RTL Overflows scrollbar not showing 
346         when they should be
347         
348         Fallout from fix for bug 11926.  Make sure to restrict the fix to the
349         RenderView for now, since the full-blown overflow case is pretty involved.
350
351         Reviewed by mitzpettel
352
353         fast/overflow/unreachable-content-bug-rtl.html
354
355         * rendering/RenderBlock.cpp:
356         (WebCore::RenderBlock::lowestPosition):
357         (WebCore::RenderBlock::rightmostPosition):
358         (WebCore::RenderBlock::leftmostPosition):
359
360 2007-05-10  Brady Eidson <beidson@apple.com>
361
362         Reviewed by Oliver
363
364         Fix for http://bugs.webkit.org/show_bug.cgi?id=13636 and <rdar://problem/5190816>
365
366         When creating the applets collection, be sure to only count Objects if they contain
367         a java applet
368
369         * html/HTMLCollection.cpp:
370         (WebCore::HTMLCollection::traverseNextItem): Add the qualifier for Objects that 
371           containsJavaApplet() must be true
372
373         * html/HTMLObjectElement.cpp:
374         (WebCore::HTMLObjectElement::containsJavaApplet): Check this Object element and inner
375           nodes for any Java applets
376         * html/HTMLObjectElement.h: 
377
378 2007-05-10  David Hyatt  <hyatt@apple.com>
379
380         Fix for:
381
382         <rdar://problem/4694859> SAP: HTML tags with overflow:hidden consume
383         space on page, do not consume space in Firefox (11926)
384
385         http://bugs.webkit.org/show_bug.cgi?id=11926
386
387         Make sure that unreachable objects along one axis (e.g., top/left) do not
388         contribute to the scrollable area in the opposite axis (e.g., right/bottom).
389
390         Reviewed by olliej
391
392         fast/overflow/unreachable-content-test.html
393
394         * rendering/RenderBlock.cpp:
395         (WebCore::RenderBlock::lowestPosition):
396         (WebCore::RenderBlock::rightmostPosition):
397         (WebCore::RenderBlock::leftmostPosition):
398
399 2007-05-10  David Hyatt  <hyatt@apple.com>
400
401         Fix for:
402
403         <rdar://problem/4656825> REGRESSION: Japanese TV time table widget:
404         part of the number in background has been cut off.
405
406         Now that opacity uses a tight bounding box to clip, we need to make sure
407         to factor spillout caused by negative letter spacing into our right
408         overflow.  Latch on to the code that does this already for text-stroke
409         and text-shadow.
410
411         Reviewed by olliej
412
413         fast/text/letter-spacing-negative-opacity.html
414
415        * rendering/InlineFlowBox.cpp:
416         (WebCore::InlineFlowBox::placeBoxesHorizontally):
417
418 2007-05-10  Geoffrey Garen  <ggaren@apple.com>
419
420         Reviewed by Maciej Stachowiak.
421         
422         More fix-ups to the WebScriptObject/WebScripting APIs, related to
423         <rdar://problem/5140447> API for fetching JSGlobalContextRef from WebView 
424         or WebFrame
425
426         * bindings/objc/WebScriptObject.h: Fully specified the surprising rules for
427         type conversion between JavaScript and ObjC.
428         * bindings/objc/WebScriptObject.mm: Added up-call accessor to WebFrame.
429         This is kind of stinky, but I'm OK with it because eventually all of this
430         code should move up into WebKit.
431         (+[WebScriptObject scriptObjectForJSObject:frame:]):
432         (-[WebScriptObject valueForKey:]):
433         (-[WebScriptObject JSObject]): 
434             - Added _rootObject check because if _rootObject returns NULL it means 
435             that _imp is no longer GC protected, so it's not safe to use. 
436             - Added _isSafeScript check because that's what WebScriptObject methods
437             typically do, even though the value of doing so isn't clear to me.
438         * bindings/objc/WebScriptObjectPendingPublic.h: Added WebFrame* parameter
439         to -scriptObjectForJSObject:. This is required to wrap JS objects that
440         are not already in the wrapper cache. It would be nice to remove this
441         limitation of WebScriptObject some day.
442         * page/mac/FrameMac.mm:
443         (WebCore::Frame::cleanupPlatformScriptObjects): Force removal of m_windowScriptObject
444         from the cache, to avoid retrieving the m_windowScriptObject from the previous
445         page on a new page load. (It would be non-functional in that case.)
446
447 2007-05-10  David Hyatt  <hyatt@apple.com>
448
449         Fix for <rdar://problem/5183697>.
450
451         http://bugs.webkit.org/show_bug.cgi?id=13576
452
453         Make sure verticalPositionHint is not called on an inline-block from
454         content inside the inline-block (like text).
455
456         Reviewed by olliej
457
458         fast/inline-block/inline-block-vertical-align.html
459
460         * rendering/RenderObject.cpp:
461         (WebCore::RenderObject::verticalPositionHint):
462         * rendering/RenderText.cpp:
463         (WebCore::RenderText::verticalPositionHint):
464         * rendering/RenderThemeMac.mm:
465         (WebCore::RenderThemeMac::setFontFromControlSize):
466
467 2007-05-09  Holger Freyther <zecke@selfish.org>
468
469         Reviewed by Mark Rowe.
470
471         Gdk build fix with SVG enabled.  Stub out ImageBufferCairo.
472
473         * WebCore.pro: Build ImageBufferCairo.cpp
474         * platform/graphics/cairo/ImageBufferCairo.cpp: Added.
475         (WebCore::ImageBuffer::create):
476         (WebCore::ImageBuffer::~ImageBuffer):
477         (WebCore::ImageBuffer::context):
478
479 2007-05-08  Justin Garcia  <justin.garcia@apple.com>
480
481         Reviewed by darin
482         
483         <rdar://problem/5017613> Style changes don't effect fully selected ToDo content
484
485         * editing/ApplyStyleCommand.cpp:
486         (WebCore::ApplyStyleCommand::applyInlineStyle):
487         Use a for loop instead of while(1).
488         Simplify loop termination using Range::pastEndNode.
489         Don't handle the start.node() == end.node() case 
490         specially, it's unnecessary.
491         Apply the style change to fully selected plaintext-only
492         regions, not with wrapper spans inside the region, but 
493         by changing the element's inline style declaration.
494         Don't descend into nodes whose children we should ignore.
495
496 2007-05-09  Adele Peterson  <adele@apple.com>
497
498         Reviewed by Hyatt.
499
500         Fix for <rdar://problem/5113578> REGRESSION: textfields that set the height but not the font 
501         look different from IE & FF because the font is small
502
503         For plain text fields, don't stretch the inner text box.  Center it vertically in the field.
504
505         * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::layout):
506
507 2007-05-09  Atul Mehrotra  <atul.mehrotra@celunite.com>
508
509         Gdk build fix.
510
511         * platform/gdk/TemporaryLinkStubs.cpp:
512         (Editor::newGeneralClipboard):
513
514 2007-05-09  Mitz Pettel  <mitz@webkit.org>
515
516         Reviewed by Dave Hyatt.
517
518         - fix http://bugs.webkit.org/show_bug.cgi?id=13037
519           REGRESSION: Copy-on-scroll not reset properly after back/forward navigation
520
521         * page/FrameView.cpp:
522         (WebCore::FrameViewPrivate::FrameViewPrivate): Moved initialization of
523         m_slowRepaintObjectCount here.
524         (WebCore::FrameViewPrivate::reset): Do not reset the slow repaint object
525         count here.
526         (WebCore::FrameView::useSlowRepaints):
527         (WebCore::FrameView::addSlowRepaintObject):
528         (WebCore::FrameView::removeSlowRepaintObject): Added an assertion that the
529         object count is positive.
530         * rendering/RenderObject.cpp:
531         (WebCore::RenderObject::setStyle): Corrected a mix up between old and new
532         style, which caused the object count to be decremented when it was supposed
533         to be incremented and vice versa.
534
535 2007-05-09  Peter Müller <pm@one.com>
536
537         Reviewed by Dave Hyatt.
538
539         Changed the hardcoded colors that are used for CSS 2.1 system colors.
540         Previous colors had numerous conflicts in semantic pairs, which
541         made text invisible in highlight, info and menu colored areas.
542         The new hardcoded colors are inspired by Aqua.
543
544         Ideally these colors should be fetched through AppKit instead,
545         though I am not sure if it is possible to make a 1:1 mapping
546         between CSS2.1 system colors and Mac OS X.
547
548         * css/cssstyleselector.cpp:
549         (WebCore::):
550
551 2007-05-09  Lars Knoll <lars@trolltech.com>
552
553         Fix the Qt build.
554
555         * editing/qt/EditorQt.cpp:
556
557 2007-05-08  Geoffrey Garen  <ggaren@apple.com>
558
559         Reviewed by Darin Adler.
560         
561         More fix-ups to the WebScriptObject/WebScripting APIs, related to
562         <rdar://problem/5140447> API for fetching JSGlobalContextRef from WebView 
563         or WebFrame
564         
565         1. Added -scriptObjectForJSObject: SPI so you can bridge back from JavaScriptCore
566         to WebScriptObject.
567         
568         2. Fixed WebScriptObject bridging so that you always get the same WebScriptObject
569         for a JSObject (like in the DOM). This makes -scriptObjectForJSObject: a
570         lot more coherent as an API.
571
572         * bindings/objc/DOMInternal.mm: Renamed wrapperCache to DOMWrapperCache
573         to distinguish from the JSWrapperCache. Added typedef for readability.
574         (WebCore::getDOMWrapper):
575         (WebCore::addDOMWrapper):
576         (WebCore::removeDOMWrapper):
577         * bindings/objc/WebScriptObject.mm: Added JSWrapperCache, which works just
578         like the DOMWrapperCache.
579         (WebCore::getJSWrapper):
580         (WebCore::addJSWrapper):
581         (WebCore::removeJSWrapper):
582         (WebCore::createJSWrapper):
583         (+[WebScriptObject scriptObjectForJSObject:]): This is the new API. It attempts
584         to return a specific DOM wrapper object, or, barring that, it returns a 
585         generic WebScriptObject.
586         (+[WebScriptObject scriptObjectForJSObject:originRootObject:rootObject:]):
587         Added this method to support our old WebScriptObject security and leak 
588         checking model, even though it doesn't work very well. 
589         (-[WebScriptObject _setImp:originRootObject:rootObject:]):
590         (-[WebScriptObject dealloc]):
591         (-[WebScriptObject finalize]):
592         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
593         * bindings/objc/WebScriptObjectPendingPublic.h:
594         * bindings/objc/WebScriptObjectPrivate.h:
595         * page/mac/FrameMac.mm:
596         (WebCore::Frame::windowScriptObject): Changed to use the new API. This
597         fixes a bug where the object sent to -windowScriptObjectAvailable: and returned
598         from -windowScriptObject could not be round-tripped.
599
600 2007-05-09  Mark Rowe  <mrowe@apple.com>
601
602         Build fix.
603
604         * editing/Editor.cpp:
605         (WebCore::findFirstGrammarDetailInRange): Use unsigned rather than int.
606         (WebCore::findFirstBadGrammarInRange): Cast to unsigned in assertion.
607         (WebCore::isRangeUngrammatical): Remove unused variables.
608
609 2007-05-08  Oliver Hunt  <oliver@apple.com>
610
611         Reviewed by Darin.
612         
613         Fix <rdar://problem/5188938> arc method on Canvas causes hang or crash
614         
615         Workaround bad behaviour of CGPathAddArc when passed inf as start or
616         end angles.
617
618         * platform/graphics/cg/PathCG.cpp:
619         (WebCore::Path::addArc):
620
621 2007-05-08  Darin Adler  <darin@apple.com>
622
623         Reviewed by Hyatt and Hatcher.
624
625         - fix auto-activation code path so Tiger and Leopard aren't different
626
627         * platform/mac/WebFontCache.mm: (+[WebFontCache fontWithFamily:traits:size:]):
628         Do the auto-activation dance first before doing anything else, and ignore the
629         font that it returns.
630
631 2007-05-08  Steve Falkenburg  <sfalken@apple.com>
632
633         Reviewed by Darin.
634
635         Moved most spelling/grammar logic to C++.  Now calls through to
636         WebKit to actually invoke NSSpellChecker.
637
638         * editing/Editor.cpp:
639         (WebCore::Editor::ignoreSpelling): Added (ported from EditorMac).
640         (WebCore::Editor::learnSpelling): Added (ported from EditorMac).
641         (WebCore::findFirstMisspellingInRange): Added (ported from EditorMac).
642         (WebCore::paragraphAlignedRangeForRange): Added (ported from EditorMac).
643         (WebCore::findFirstGrammarDetailInRange): Added (ported from EditorMac).
644         (WebCore::findFirstBadGrammarInRange): Added (ported from EditorMac).
645         (WebCore::Editor::advanceToNextMisspelling): Added (ported from EditorMac).
646         (WebCore::Editor::isSelectionMisspelled): Added (ported from EditorMac).
647         (WebCore::isRangeUngrammatical): Added (ported from EditorMac).
648         (WebCore::Editor::isSelectionUngrammatical): Added (ported from EditorMac).
649         (WebCore::Editor::guessesForUngrammaticalSelection): Added (ported from EditorMac).
650         (WebCore::Editor::guessesForMisspelledSelection): Added (ported from EditorMac).
651         (WebCore::Editor::showSpellingGuessPanel): Added (ported from EditorMac).
652         (WebCore::Editor::spellingPanelIsShowing): Added (ported from EditorMac).
653         (WebCore::Editor::markMisspellingsAfterTypingToPosition): Added (ported from EditorMac).
654         (WebCore::markAllMisspellingsInRange): Added (ported from EditorMac).
655         (WebCore::markAllBadGrammarInRange): Added (ported from EditorMac).
656         (WebCore::markMisspellingsOrBadGrammar): Added (ported from EditorMac).
657         (WebCore::Editor::markMisspellings): Added (ported from EditorMac).
658         (WebCore::Editor::markBadGrammar): Added (ported from EditorMac).
659         * editing/mac/EditorMac.mm: Removed Objective C version of spelling/grammar calls.
660
661 2007-05-08  Steve Falkenburg  <sfalken@apple.com>
662
663         Reviewed by Ada.
664
665         Slight modification to last editor method fix.
666
667         * bridge/EditorClient.h:
668         * platform/gdk/EditorClientGdk.cpp:
669         (WebCore::EditorClientGdk::updateSpellingUIWithGrammarString):
670         * platform/gdk/EditorClientGdk.h:
671         * platform/graphics/svg/SVGImageEmptyClients.h:
672         (WebCore::SVGEmptyEditorClient::updateSpellingUIWithGrammarString):
673
674 2007-05-08  Alexey Proskuryakov  <ap@webkit.org>
675
676         Reviewed by Hyatt.
677
678         http://bugs.webkit.org/show_bug.cgi?id=13480
679         window.Attr is undefined
680
681         Test: fast/dom/Window/attr-constructor.html
682
683         * dom/Attr.idl:
684         * dom/CDATASection.idl:
685         * dom/CharacterData.idl:
686         * dom/Comment.idl:
687         * dom/DOMImplementation.idl:
688         * dom/DocumentType.idl:
689         * dom/Entity.idl:
690         * dom/EntityReference.idl:
691         * dom/Notation.idl:
692         * dom/ProcessingInstruction.idl:
693         * dom/Text.idl:
694         Added GenerateConstructor.
695
696         * page/DOMWindow.idl: Added constructor properties for DOM interfaces.
697
698 2007-05-07  Geoffrey Garen  <ggaren@apple.com>
699
700         Reviewed by Maciej Stachowiak.
701
702         Fixed <rdar://problem/5140447> API for fetching JSGlobalContextRef from 
703         WebView or WebFrame
704         
705         Added support for new -[WebScriptObject JSObject] and -[WebFrame globalContext]
706         APIs.
707         
708         Also fixed some more cases of <rdar://problem/4395622> API: 
709         WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript 
710         returns NO by default, and generally cleaned up that documentation.
711
712         * WebCore.exp: A lot of the diff here is from sorting.
713         * WebCore.xcodeproj/project.pbxproj:
714         * bindings/objc/WebScriptObject.h:
715         * bindings/objc/WebScriptObject.mm:
716         (-[WebScriptObject JSObject]):
717         * bindings/objc/WebScriptObjectPendingPublic.h: Added.
718
719 2007-05-08  Lars Knoll <lars@trolltech.com>
720
721         Reviewed by Hyatt.
722
723         Fix valgrind reported uninitialized memory read.
724
725         * rendering/RenderText.cpp:
726         (WebCore::RenderText::RenderText):
727
728 2007-05-07  Justin Garcia  <justin.garcia@apple.com>
729
730         Reviewed by oliver
731
732         <rdar://problem/4895428> Can't drag selected ToDo
733         
734         The user tries to drag a selection by mousing down
735         on the editable part of a ToDo, which is focusable,
736         since it is an editable node within non-editable 
737         content.  But we focus focusable elements on mouse 
738         down, and focusing the editable piece blows away 
739         the selection and prevents the drag. This is how 
740         IE behaves, but content seems generally difficult 
741         to drag in IE, so this doesn't make it any worse.
742         
743         Since focus doesn't appear to be cancelable, either
744         with a DOM event or an editing delegate, I fixed this
745         by delaying the focus of focusable nodes that are 
746         selected and inside an already focused node.  The 
747         node will be focused if the user mouses up without 
748         doing any dragging because the mouse up sets a
749         selection, which calls setFocusNodeIfNeeded.
750
751         * page/EventHandler.cpp:
752         (WebCore::EventHandler::dispatchMouseEvent):
753
754 2007-05-07  Atul Mehrotra <atul.mehrotra@celunite.com>
755
756         Reviewed by Maciej.
757
758         GDK Build fix
759
760         * platform/gdk/TemporaryLinkStubs.cpp:
761
762 2007-05-07  Oliver Hunt  <oliver@apple.com>
763
764         Reviewed by Maciej.
765
766         Correcting comparisons to handle NaN in the same manner
767         as other Canvas methods.
768
769         * html/CanvasRenderingContext2D.cpp:
770         (WebCore::CanvasRenderingContext2D::arcTo):
771         (WebCore::CanvasRenderingContext2D::arc):
772           Correcting arc/arcTo to match the WHAT WG draft.
773         (WebCore::CanvasRenderingContext2D::rect):
774         (WebCore::CanvasRenderingContext2D::clearRect):
775         (WebCore::CanvasRenderingContext2D::fillRect):
776         (WebCore::CanvasRenderingContext2D::strokeRect):
777
778 2007-05-07  David Hyatt  <hyatt@apple.com>
779
780         Add some comments to the glyph/font code (patch from MarvinD, tweaked by
781         me to correct a few bits and to make it forward-compatible with the work
782         going on in 3315.
783
784         Reviewed by me
785
786         * ChangeLog:
787         * platform/Font.cpp:
788         (WebCore::Font::glyphDataForCharacter):
789         * platform/GlyphPageTreeNode.cpp:
790         (WebCore::GlyphPageTreeNode::initializePage):
791         * platform/GlyphPageTreeNode.h:
792
793 2007-05-07  Justin Garcia  <justin.garcia@apple.com>
794
795         Fix layout test failures.
796
797         * editing/SelectionController.cpp:
798         (WebCore::SelectionController::contains): Use comparePositions
799         instead of Range::comparePoint, because comparePositions can
800         handle positions inside shadow trees.
801
802 2007-05-07  Justin Garcia  <justin.garcia@apple.com>
803
804         Reviewed by darin
805         
806         <rdar://problem/4895428> Can't drag selected To Do if it is not showing a due date
807         
808         The code in SelectionController::contains returned false 
809         incorrectly if the selection end just after a table 
810         and the position was inside that table.
811
812         * editing/SelectionController.cpp:
813         (WebCore::SelectionController::contains): Compare the position with the
814         ends of the selection and then use Range::comparePoint.
815
816 2007-05-07  Darin Adler  <darin@apple.com>
817
818         - rolling out setInnerHTML optimization until I can figure out why tests are failing
819
820 2007-05-07  Darin Adler  <darin@apple.com>
821
822         Reviewed by Hyatt.
823
824         - fix http://bugs.webkit.org/show_bug.cgi?id=13602
825           Amazon product pages keep repainting over and over again
826
827         Optimize setInnerHTML, setOuterHTML, and setInnerText so they don't change the DOM at all
828         if they don't need to.
829
830         Test: fast/dom/HTMLElement/set-inner-outer-optimization.html
831
832         * html/HTMLElement.cpp:
833         (WebCore::equal): Added. Helper function that compares two Text nodes or two NamedAttrMap
834         attribute maps.
835         (WebCore::shallowEqual): Added. Helper function that compares two Element nodes or two
836         arbitrary nodes.
837         (WebCore::replaceChildrenWithFragment): Added. Helper function used by setInnerHTML and
838         setInnerText. Optimizes the cases where all the nodes are the same, where both the current
839         and the new content are single text nodes, and where the current content is a single node
840         that can be replaced with replaceChild.
841         (WebCore::replaceChildrenWithText): Added. Helper function used by setInnerText. Optimizes
842         the case where the current content is a single text node or a single node that can be
843         replaced with replaceChild.
844         (WebCore::HTMLElement::setInnerHTML): Changed to call replaceChildrenWithFragment.
845         (WebCore::HTMLElement::setOuterHTML): Added special case to optimize when the new content
846         exactly matches the current node.
847         (WebCore::HTMLElement::setInnerText): Changed to call replaceChildrenWithText in a few
848         cases instead of doing removeChildren/appendChild. Changed code that was using
849         DeprecatedString to instead use String. Changed general case to use a document fragment
850         and replaceChildrenWithFragment.
851
852         * dom/CharacterData.cpp: (WebCore::CharacterData::dispatchModifiedEvent):
853         Fixed bug where we would not dispatch the DOMSubtreeModified event unless someone
854         was registered for the DOMCharacterDataModified event. Caused trouble in the test.
855
856 2007-05-06  Darin Adler  <darin@apple.com>
857
858         - blind try at fixing the Qt build
859
860         * platform/qt/TextBreakIteratorQt.cpp: (WebCore::sentenceBreakIterator):
861         Added a placeholder.
862
863 2007-05-06  Darin Adler  <darin@apple.com>
864
865         Reviewed by Hyatt.
866
867         - fix http://bugs.webkit.org/show_bug.cgi?id=13537
868           Canvex example starts rendering strangely after a while
869
870         * html/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::drawImage):
871         Don't raise an exception if the source or destination rectangle is empty.
872
873 2007-05-06  Darin Adler  <darin@apple.com>
874
875         Reviewed by Hyatt.
876
877         - fix <rdar://problem/4585593> REGRESSION: Some 2-byte characters in printed page
878           header are drawn with too-large font and clipped
879
880         Doesn't affect text within web pages, so no layout test.
881
882         * platform/mac/FontCacheMac.mm: (WebCore::FontCache::getFontDataForCharacters):
883         Base the substitute font on the FontPlatformData rather than the FontDescription.
884         Before, it was a mix of both. This works properly for fonts where we have no
885         FontDescription and is also more internally consistent.
886
887 2007-05-06  Darin Adler  <darin@apple.com>
888
889         Reviewed by Hyatt.
890
891         - http://bugs.webkit.org/show_bug.cgi?id=13606
892           some functions are virtual that don't need to be
893
894         * dom/Node.h: Made first/lastChild be inline functions that call virtual functions.
895         This lets us hide the functions with another inline function in a derived class,
896         yet still override the behavior here in the base class by overriding the virtual
897         functions too.
898         * dom/Node.cpp:
899         (WebCore::Node::virtualFirstChild): Renamed virtual functions. There are now
900         non-virtual inline functions that call these virtual functions.
901         (WebCore::Node::virtualLastChild): Ditto.
902
903         * dom/ContainerNode.h: Added non-virtual first/lastChild functions that hide the ones
904         inherited from the Node class; these also replace the fastFirst/LastChild functions,
905         and transparently give callers the faster form if they have a pointer of the right
906         type. But still override the virtual functions named virtualFirst/LastChild, because
907         those can still be called through a Node*. Removed the "fast" from the names of
908         fastSetFirst/LastChild.
909         * dom/ContainerNode.cpp:
910         (WebCore::ContainerNode::virtualFirstChild): Renamed virtual functions. There are now
911         also non-virtual inline versions.
912         (WebCore::ContainerNode::virtualLastChild): Ditto.
913
914         * dom/CharacterData.cpp: Removed implementations of data and length functons.
915         * dom/CharacterData.h: Made data, setData, length, substringData, appendData,
916         insertData, deleteData, and replaceData all non-virtual, and made data and length
917         both be inline.
918
919         * dom/NamedAttrMap.h: (WebCore::NamedAttrMap::attributeItem): Removed a null check
920         from this function. If the length of the map is known to be greater than 0, then
921         the null check isn't needed. But if the length of the map hasn't been checked at all,
922         then it's unsafe to call this function since it doesn't range check the array
923         index. Thus the null check is never needed. I also looked at all callers.
924
925         * dom/Attr.cpp: (WebCore::Attr::createTextChild):
926         * dom/Document.cpp: (WebCore::Document::recalcStyle):
927         * dom/Element.cpp: (WebCore::Element::recalcStyle):
928         * ksvg2/svg/SVGElement.cpp:
929         (WebCore::SVGElement::haveLoadedRequiredResources):
930         Removed "fast" prefix from calls to fastFirst/LastChild and fastSetFirst/LastChlld.
931         It's not needed any more -- you still get fast behavior if the pointer has a type
932         that's ContainerNode or derived from it.
933
934 2007-05-06  Mitz Pettel  <mitz@webkit.org>
935
936         Reviewed by Hyatt.
937
938         - fix http://bugs.webkit.org/show_bug.cgi?id=13557
939           Crash when dragging selection over absolutely positioned generated content on block element
940
941         Test: fast/css-generated-content/positioned-background-hit-test-crash.html
942
943         * rendering/RenderLayer.cpp:
944         (WebCore::RenderLayer::enclosingElement): Added. Factored out of hitTestLayer().
945         (WebCore::RenderLayer::hitTestLayer): Implemented the fix for <rdar://problem/3552346>
946         from r6106 to the self hit test as well, namely: return the enclosing element
947         for generated positioned content.
948         * rendering/RenderLayer.h:
949
950 2007-05-06  Alexey Proskuryakov  <ap@webkit.org>
951
952         Reviewed by Darin.
953
954         http://bugs.webkit.org/show_bug.cgi?id=13584
955         <script> code wrongly assumes requests can't fail
956
957         Test: fast/loader/unloadable-script.html
958
959         * html/HTMLScriptElement.cpp:
960         (WebCore::HTMLScriptElement::parseMappedAttribute):
961         (WebCore::HTMLScriptElement::insertedIntoDocument):
962         Check the return value of requestScript().
963
964 2007-05-06  Alexey Proskuryakov  <ap@webkit.org>
965
966         Reviewed by Darin.
967
968         http://bugs.webkit.org/show_bug.cgi?id=13304
969         REGRESSION(14784): WebKit doesn't dynamically reflect changes to the highlight color in System Preferences
970
971         Implemented a notification observer that invalidates cached system colors.
972
973         No automated test possible.
974
975         * rendering/RenderTheme.cpp:
976         (WebCore::RenderTheme::activeSelectionBackgroundColor):
977         (WebCore::RenderTheme::inactiveSelectionBackgroundColor):
978         (WebCore::RenderTheme::platformColorsDidChange):
979         * rendering/RenderTheme.h:
980         * rendering/RenderThemeMac.h:
981         * rendering/RenderThemeMac.mm:
982         (-[WebCoreRenderThemeNotificationObserver initWithTheme:WebCore::]):
983         (-[WebCoreRenderThemeNotificationObserver systemColorsDidChange:]):
984         (WebCore::theme):
985         (WebCore::RenderThemeMac::RenderThemeMac):
986         (WebCore::RenderThemeMac::~RenderThemeMac):
987         (WebCore::RenderThemeMac::checkbox):
988         (WebCore::RenderThemeMac::radio):
989         (WebCore::RenderThemeMac::button):
990         (WebCore::RenderThemeMac::popupButton):
991         (WebCore::RenderThemeMac::search):
992         (WebCore::RenderThemeMac::sliderThumbHorizontal):
993         (WebCore::RenderThemeMac::sliderThumbVertical):
994
995 2007-05-05  Rob Buis  <buis@kde.org>
996
997         Reviewed by Oliver.
998
999         http://bugs.webkit.org/show_bug.cgi?id=13592
1000         parseMappedAttribute inconsistency
1001
1002         Do not use local vars in parseMappedAttribute for attr name and value.
1003
1004         * ksvg2/svg/SVGAnimateMotionElement.cpp:
1005         (WebCore::SVGAnimateMotionElement::parseMappedAttribute):
1006         * ksvg2/svg/SVGAnimateTransformElement.cpp:
1007         (WebCore::SVGAnimateTransformElement::parseMappedAttribute):
1008         * ksvg2/svg/SVGAnimationElement.cpp:
1009         (WebCore::SVGAnimationElement::parseMappedAttribute):
1010         * ksvg2/svg/SVGCircleElement.cpp:
1011         (WebCore::SVGCircleElement::parseMappedAttribute):
1012         * ksvg2/svg/SVGClipPathElement.cpp:
1013         (WebCore::SVGClipPathElement::parseMappedAttribute):
1014         * ksvg2/svg/SVGCursorElement.cpp:
1015         (WebCore::SVGCursorElement::parseMappedAttribute):
1016         * ksvg2/svg/SVGEllipseElement.cpp:
1017         (WebCore::SVGEllipseElement::parseMappedAttribute):
1018         * ksvg2/svg/SVGExternalResourcesRequired.cpp:
1019         (WebCore::SVGExternalResourcesRequired::parseMappedAttribute):
1020         * ksvg2/svg/SVGGradientElement.cpp:
1021         (WebCore::SVGGradientElement::parseMappedAttribute):
1022         * ksvg2/svg/SVGImageElement.cpp:
1023         (WebCore::SVGImageElement::parseMappedAttribute):
1024         * ksvg2/svg/SVGLineElement.cpp:
1025         (WebCore::SVGLineElement::parseMappedAttribute):
1026         * ksvg2/svg/SVGLinearGradientElement.cpp:
1027         (WebCore::SVGLinearGradientElement::parseMappedAttribute):
1028         * ksvg2/svg/SVGMarkerElement.cpp:
1029         (WebCore::SVGMarkerElement::parseMappedAttribute):
1030         * ksvg2/svg/SVGMaskElement.cpp:
1031         (WebCore::SVGMaskElement::parseMappedAttribute):
1032         * ksvg2/svg/SVGPathElement.cpp:
1033         (WebCore::SVGPathElement::parseMappedAttribute):
1034         * ksvg2/svg/SVGPatternElement.cpp:
1035         (WebCore::SVGPatternElement::parseMappedAttribute):
1036         * ksvg2/svg/SVGRadialGradientElement.cpp:
1037         (WebCore::SVGRadialGradientElement::parseMappedAttribute):
1038         * ksvg2/svg/SVGRectElement.cpp:
1039         (WebCore::SVGRectElement::parseMappedAttribute):
1040         * ksvg2/svg/SVGSVGElement.cpp:
1041         (WebCore::SVGSVGElement::parseMappedAttribute):
1042         * ksvg2/svg/SVGScriptElement.cpp:
1043         (WebCore::SVGScriptElement::parseMappedAttribute):
1044         * ksvg2/svg/SVGStopElement.cpp:
1045         (WebCore::SVGStopElement::parseMappedAttribute):
1046         * ksvg2/svg/SVGTests.cpp:
1047         (WebCore::SVGTests::parseMappedAttribute):
1048         * ksvg2/svg/SVGTextContentElement.cpp:
1049         (WebCore::SVGTextContentElement::parseMappedAttribute):
1050         * ksvg2/svg/SVGTextPositioningElement.cpp:
1051         (WebCore::SVGTextPositioningElement::parseMappedAttribute):
1052         * ksvg2/svg/SVGUseElement.cpp:
1053         (WebCore::SVGUseElement::parseMappedAttribute):
1054         * ksvg2/svg/SVGViewElement.cpp:
1055         (WebCore::SVGViewElement::parseMappedAttribute):
1056         * ksvg2/svg/SVGZoomAndPan.cpp:
1057         (WebCore::SVGZoomAndPan::parseMappedAttribute):
1058
1059 2007-05-05  Oliver Hunt  <oliver@apple.com>
1060
1061         Reviewed by Hyatt.
1062
1063         Initialise default fill with Color::black rather than parsing
1064         the string "black"
1065
1066         * ksvg2/svg/SVGPaint.cpp:
1067         (WebCore::SVGPaint::defaultFill):
1068
1069 2007-05-04  Steve Falkenburg  <sfalken@apple.com>
1070
1071         Reviewed by Oliver.
1072
1073         Use TextBreakIterator for sentence breaking instead of TextBoundaries.
1074
1075         * WebCore.xcodeproj/project.pbxproj: Added TextBreakIeratorInternalICUMac.mm
1076         * editing/visible_units.cpp:
1077         (WebCore::startSentenceBoundary): Call TextBreakIterator instead of TextBoundaries.
1078         (WebCore::endSentenceBoundary): Call TextBreakIterator instead of TextBoundaries.
1079         (WebCore::previousSentencePositionBoundary): Call TextBreakIterator instead of TextBoundaries.
1080         (WebCore::nextSentencePositionBoundary): Call TextBreakIterator instead of TextBoundaries.
1081         * platform/TextBoundaries.h: Removed findSentenceBoundary, findNextSentenceFromIndex.
1082         * platform/TextBreakIterator.h: Added sentenceBreakIterator.
1083         * platform/TextBreakIteratorICU.cpp:
1084         (WebCore::setUpIterator): Add locale parameter (needed to maintain functionality that TextBoundaries code had).
1085         (WebCore::characterBreakIterator): Pass en_us for locale (same as old code).
1086         (WebCore::wordBreakIterator): Pass en_us for locale (same as old code).
1087         (WebCore::lineBreakIterator): Pass en_us for locale (same as old code).
1088         (WebCore::sentenceBreakIterator): Added.
1089         * platform/TextBreakIteratorInternalICU.h: Added.
1090         * platform/gdk/TemporaryLinkStubs.cpp: Removed findNextSentenceFromIndex, findSentenceBoundary.
1091         (WebCore::currentTextBreakLocaleID): Added stub.
1092         * platform/mac/TextBoundaries.mm: Removed currentTextBreakLocaleID, findSentenceBoundary, findNextSentenceFromIndex.
1093         * platform/mac/TextBreakIteratorInternalICUMac.mm: Added.
1094         (WebCore::currentTextBreakLocaleID): Moved from TextBoundaries.mm
1095         * platform/qt/TextBoundaries.cpp: Removed findNextSentenceFromIndex, findSentenceBoundary.
1096
1097 2007-05-04  Adele Peterson  <adele@apple.com>
1098
1099         Reviewed by Hyatt.
1100
1101         Fix for <rdar://problem/5116871> REGRESSION: Can't select options in widget's listbox
1102
1103         Don't use user-select to determine whether or not options can be selected in listboxes.
1104         This will match Firefox behavior for -moz-user-select.
1105
1106         * html/HTMLSelectElement.cpp:
1107         (WebCore::HTMLSelectElement::canSelectAll):
1108         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
1109
1110 2007-05-04  Geoffrey Garen  <ggaren@apple.com>
1111
1112         Reviewed by Tim Hatcher.
1113
1114         First step in fixing <rdar://problem/5055182> The back cache has no global cap
1115
1116         Stop giving SnapBack infinite cache-ability. Instead, make SnapBack rely
1117         on the underlying back cache.
1118
1119         * WebCore.exp:
1120         * history/HistoryItem.cpp:
1121         (WebCore::HistoryItem::HistoryItem):
1122         * history/HistoryItem.h:
1123         * loader/FrameLoader.cpp:
1124         (WebCore::FrameLoader::purgePageCache):
1125
1126 2007-05-04  Geoffrey Garen  <ggaren@apple.com>
1127
1128         Reviewed by Brady Eidson.
1129         
1130         Removed export of clearPageCache(), since it was unused externally. I plan
1131         to remove its use from WebCore eventually, too.
1132
1133         Removed usesPageCache(), since it was unused and it duplicated pageCacheSize().
1134
1135         * WebCore.exp:
1136         * history/BackForwardList.cpp:
1137         * history/BackForwardList.h: Moved statics to the top of the class definition.
1138         * loader/FrameLoader.cpp:
1139         (WebCore::FrameLoader::canCachePage):
1140
1141 2007-05-04  Anders Carlsson  <andersca@apple.com>
1142
1143         Reviewed by Antti.
1144
1145         <rdar://problem/5179977> Use the correct URLs when dispatching delegate methods for data loads.
1146
1147         Restore behavior to matching release WebKit by adding a response URL to SubstituteData. If a nil base URL is
1148         passed, set the _request_ URL to "about:blank", but the response URL to a generated "applewebdata" URL.
1149
1150         * loader/FrameLoader.cpp:
1151         (WebCore::FrameLoader::commitProvisionalLoad):
1152         First, check for the SubstituteData's response URL.
1153
1154         (WebCore::FrameLoader::continueAfterNavigationPolicy):
1155         No need to special case applewebdata URLs here, they're only used in the response.
1156
1157         * loader/MainResourceLoader.cpp:
1158         (WebCore::MainResourceLoader::handleDataLoadNow):
1159         If the substitute data has a response URL, use it.
1160
1161         (WebCore::MainResourceLoader::loadNow):
1162         Only load "about:blank" as an empty document if there's no substitute data.
1163
1164         * loader/SubstituteData.h:
1165         (WebCore::SubstituteData::SubstituteData):
1166         (WebCore::SubstituteData::responseURL):
1167         Add responseURL member to SubstituteData.
1168
1169 2007-05-03  Steve Falkenburg  <sfalken@apple.com>
1170
1171         Reviewed by Oliver.
1172
1173         Add missing user description parameter to spelling-related editor client method.
1174
1175         * bridge/EditorClient.h:
1176         * platform/gdk/EditorClientGdk.cpp:
1177         (WebCore::EditorClientGdk::updateSpellingUIWithGrammarString):
1178         * platform/gdk/EditorClientGdk.h:
1179         * platform/graphics/svg/SVGImageEmptyClients.h:
1180         (WebCore::SVGEmptyEditorClient::updateSpellingUIWithGrammarString):
1181
1182 2007-05-03  Brady Eidson  <beidson@apple.com>
1183
1184         Reviewed by Oliver
1185
1186         Resolve an outstanding FIXME in Loader::numRequests()
1187
1188         Before, numRequests() would iterate through the list of requests pending load and the list of currently
1189         loading requests and tally up a count matching the current DocLoader.
1190
1191         I noticed while studying and cleaning up the loader code that numRequests() is potentially very hot!
1192         Indeed load a complex site with many resources and multiple frames, and this method gets called very often,
1193         tallying up this number every time.
1194
1195         The FIXME was to keep a collection of Requests mapped to each DocLoader.  In reality, since this map would
1196         simply be used for retrieving a count, that was overkill.  Keeping a request count in the DocLoader itself
1197         along with maintaining that count in Loader as requests come and go is a much better way to do this.
1198
1199         * loader/DocLoader.cpp:
1200         (WebCore::DocLoader::DocLoader):
1201         (WebCore::DocLoader::incrementRequestCount):
1202         (WebCore::DocLoader::decrementRequestCount):
1203         (WebCore::DocLoader::requestCount): Emulate the defunct Loader::numRequests()
1204         * loader/DocLoader.h:
1205
1206         * loader/FrameLoader.cpp:
1207         (WebCore::numRequests): Call DocLoader::requestCount() directly
1208         (WebCore::FrameLoader::checkCompleted): Use numRequests()
1209
1210         * loader/loader.cpp:
1211         (WebCore::Loader::load): Increment the DocLoader's request count
1212         (WebCore::Loader::servePendingRequests): If the SubresourceLoader failed to create, decrement the count
1213         (WebCore::Loader::didFinishLoading): If the Request is not Multipart, decrement the count
1214         (WebCore::Loader::didFail): If the Request is not Multipart, decrement the count
1215         (WebCore::Loader::didReceiveResponse): If the Request becomes Multipart, decrement the count
1216         (WebCore::Loader::cancelRequests): Decrement the count for the pending requests being tossed, and ASSERT the
1217           count is zero after all requests have been cancelled
1218         * loader/loader.h:
1219
1220 2007-05-03  Geoffrey Garen  <ggaren@apple.com>
1221
1222         Reviewed by Brady Eidson.
1223         
1224         Some cleanup in preparation for fixing <rdar://problem/5055182> The 
1225         back/forward cache has no global cap
1226
1227         * loader/FrameLoader.cpp:
1228         (WebCore::FrameLoader::provisionalLoadStarted): Moved "Can I cache this
1229         page?" logic to canCachePage(). Moved "I am caching this page" logic to
1230         cachePageToHistoryItem().
1231         (WebCore::FrameLoader::canCachePage): Moved above logic here.
1232         (WebCore::FrameLoader::cachePageToHistoryItem): Removed bogus NULL check
1233         and failure return value. Moved above logic here. Don't call setCachedPage()
1234         until the CachedPage is fully constructed.
1235         (WebCore::FrameLoader::purgePageCache): Removed comment that duplicated
1236         the function name.
1237         * loader/FrameLoader.h:
1238
1239 2007-05-03  Justin Garcia  <justin.garcia@apple.com>
1240
1241         Reviewed by harrison.
1242
1243         <rdar://problem/5120281> CrashTracer: [USER] 1 crash in Mail at WebCore::CSSComputedStyleDeclaration::copyInheritableProperties() const
1244
1245         Problem is that checkAncestor and lastClosed can be nil when createMarkup is called unrendered nodes, and that was not checked for.
1246         
1247         * editing/markup.cpp:
1248         (WebCore::createMarkup):
1249         Nil-check checkAncestor and lastClosed.
1250
1251 2007-05-03  Timothy Hatcher  <timothy@apple.com>
1252
1253         Reviewed by Kevin.
1254
1255         <rdar://problem/5016318> Contextual menu item for opening links is missing in compose windows but present in viewer
1256
1257         Add the Open Link, Open Link in New Window, Download Linked File and Copy Link menu
1258         items to the content editable context menu.
1259
1260         * platform/ContextMenu.cpp:
1261         (WebCore::ContextMenu::populate):
1262
1263 2007-05-03  Holger Freyther <freyther@kde.org>
1264
1265         Reviewed by Zack, landed by Simon.
1266         This is bugzilla bug 13499.
1267
1268         * WebCore.pro: Place the Qt port into the qt-port scope, add the Gdk port
1269
1270 2007-05-03  Adele Peterson  <adele@apple.com>
1271
1272         Use BUILDING_ON_TIGER.
1273
1274         * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry):
1275
1276 2007-05-03  Brady Eidson  <beidson@apple.com>
1277
1278         Reviewed by Darin
1279
1280         Some more minor cleanup that resolves a FIXME and ditches another pointless method
1281
1282         No change in functionality == no layout test
1283
1284         * loader/FrameLoader.cpp:
1285         (WebCore::FrameLoader::commitProvisionalLoad):  Updated a comment
1286         (WebCore::FrameLoader::continueLoadAfterWillSubmitForm): Folded startLoading() into this method
1287         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): continueAfterWillSubmitForm becomes continueLoadAfterWillSubmitForm
1288         * loader/FrameLoader.h: Removed startLoading()
1289
1290 2007-05-03  Adele Peterson  <adele@apple.com>
1291
1292         Reviewed by Tim Hatcher.
1293
1294         Fix for <rdar://problem/4727607> REGRESSION: KeyScript is deprecated, need a new solution for forcing Roman input for password fields on Leopard
1295
1296         * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry):
1297         Use TSMSetDocumentProperty and TSMRemoveDocumentProperty on Leopard disable and enable non-ascii input sources.
1298
1299 2007-05-03  Brady Eidson  <beidson@apple.com>
1300
1301         Reviewed by Anders
1302
1303         commitProvisionalLoad() was the name of two methods.
1304         One of them was private and only called from one other private place.
1305         This was driving me crazy.  I had to change that.
1306
1307         No change in functionality == no layout test
1308
1309         * loader/FrameLoader.cpp:
1310         (WebCore::FrameLoader::transitionToCommitted): roll commitProvisionalLoad() into this method
1311         * loader/FrameLoader.h: Removed commitProvisionalLoad()
1312
1313 2007-05-03  Darin Adler  <darin@apple.com>
1314
1315         Reviewed by Anders.
1316
1317         - make ICU initialization lazy to speed up application start-up time
1318           (when it includes an initial webpage load)
1319
1320         * platform/TextCodecICU.h: Replaced registerEncodingNames and
1321         registerCodecs with registerBaseEncodingNames, registerBaseCodecs,
1322         registerExtendedEncodingNames, and registerExtendedCodecs.
1323         * platform/TextCodecICU.cpp:
1324         (WebCore::newTextCodecICU): Moved up to the top of the file.
1325         (WebCore::TextCodecICU::registerBaseEncodingNames): Added. Registers
1326         just UTF-8.
1327         (WebCore::TextCodecICU::registerBaseCodecs): Ditto.
1328         (WebCore::TextCodecICU::registerExtendedEncodingNames): Renamed.
1329         (WebCore::TextCodecICU::registerExtendedCodecs): Ditto.
1330         (WebCore::TextCodecICU::createICUConverter): Compare with the name
1331         "GBK" in a way that does not require extending the maps.
1332
1333         * platform/TextEncoding.cpp:
1334         (WebCore::TextEncoding::usesVisualOrdering): Added code so this will
1335         just return false if we haven't used any extended encoding names yet.
1336         The result will be correct, and we won't ask for an encoding name that
1337         will require registering the extended encoding names.
1338         (WebCore::TextEncoding::isJapanese): Ditto.
1339         (WebCore::TextEncoding::backslashAsCurrencySymbol): Ditto, but return
1340         a backslash instead of false.
1341
1342         * platform/TextEncodingRegistry.h: Added a new function named
1343          noExtendedTextEncodingNameUsed.
1344         * platform/TextEncodingRegistry.cpp:
1345         (WebCore::buildBaseTextCodecMaps): Added. Registers the base encodings,
1346         including Latin-1 because it's the default, and the UTF encodings.
1347         (WebCore::extendTextCodecMaps): Added. Registers all the other encodings.
1348         (WebCore::newTextCodec): Removed the all to buildTextCodecMap because
1349         we always build the map when making the canonical encoding name.
1350         (WebCore::atomicCanonicalTextEncodingName): Changed code to build only
1351         the base maps at first, then extend the maps the first time we run into
1352         a name we don't know.
1353         (WebCore::noExtendedTextEncodingNameUsed): Added.
1354
1355 2007-05-03  Mark Rowe  <mrowe@apple.com>
1356
1357         Qt build fix.  In r21185 the Qt version of WebCore::scaleDragImage was
1358         updated to have the incorrect signature.
1359
1360         * platform/qt/DragImageQt.cpp:
1361         (WebCore::scaleDragImage):
1362
1363 2007-05-02  Beth Dakin  <bdakin@apple.com>
1364
1365         * dom/Node.h: Just fixing a variable name because it's driving me 
1366         mad.
1367
1368 2007-05-02  Beth Dakin  <bdakin@apple.com>
1369
1370         Reviewed by Hyatt.
1371
1372         Fix for <rdar://problem/4513966> Never-ending identical repaint @ 
1373         orbitz.com (Safari eating 85% CPU)
1374
1375         We need to be a little bit more savvy about when we do a FULL style 
1376         recalc since it can be unnecessary and expensive.
1377
1378         * css/CSSMutableStyleDeclaration.cpp:
1379         (WebCore::CSSMutableStyleDeclaration::setChanged): Now takes a 
1380         StyleChangeType as a parameter.
1381         (WebCore::CSSMutableStyleDeclaration::setProperty): Send 
1382         InlineStyleChange as the paramter. This is the optimization!
1383         * css/CSSMutableStyleDeclaration.h: setChanged takes a 
1384         StyleChangeType as a parameter.
1385         * dom/Document.cpp: setChanged now takes a StyleChangeType instead 
1386         of a bool.
1387         (WebCore::Document::recalcStyle): Same.
1388         * dom/Element.cpp: 
1389         (WebCore::Element::recalcStyle): This is the fix!! Only set change 
1390         to Force is we use descendant rules AND it's a FullStyleChange.
1391         * dom/Node.cpp: m_hasStyle was an unused bit on Node, so this patch 
1392         gets rid of it and uses that extra bit for m_changed to be a 
1393         StyleChangeType instead of a bool.
1394         (WebCore::Node::Node):
1395         (WebCore::Node::setChanged):
1396         (WebCore::Node::dump):
1397         * dom/Node.h: Same.
1398         (WebCore::): Define the StyleChangeType enum.
1399         (WebCore::Node::hasClass):
1400         (WebCore::Node::changed):
1401         (WebCore::Node::styleChangeType):
1402         (WebCore::Node::setHasClass):
1403         * dom/StyledElement.cpp:
1404         (WebCore::StyledElement::parseMappedAttribute): Don't bother 
1405         calling setHasStyle() since m_hasStyle is gone now. It was never 
1406         used, and this was the only place it was set.
1407         * dom/Text.cpp:
1408         (WebCore::Text::recalcStyle): setChanged now takes a 
1409         StyleChangeType instead of a bool.
1410         * html/HTMLFrameSetElement.cpp:
1411         (WebCore::HTMLFrameSetElement::recalcStyle): Same.
1412         * html/HTMLSelectElement.cpp:
1413         (WebCore::HTMLSelectElement::restoreState): Same.
1414         (WebCore::HTMLSelectElement::reset): Same.
1415         * html/HTMLTextAreaElement.cpp:
1416         (WebCore::HTMLTextAreaElement::setValue): Same.
1417         * ksvg2/misc/SVGTimer.cpp:
1418         (WebCore::SVGTimer::applyAnimations): Same.
1419         * ksvg2/svg/SVGUseElement.cpp:
1420         (WebCore::SVGUseElement::recalcStyle): Same.
1421         * platform/graphics/svg/SVGResource.cpp:
1422         (WebCore::SVGResource::repaintClients): Same.
1423
1424 2007-05-02  David Harrison  <harrison@apple.com>
1425
1426         Reviewed by Antti.
1427
1428         <rdar://problem/4859132> Grammar must always be checked in entire-sentence chunks, and shouldn't show markers for current sentence
1429
1430         Restore the remainder of the original fix now that blocking bug rdar://5174862 is addressed.
1431
1432         John made the original patch on 2007-04-10, but this fell prey to rdar://5157329.
1433         Justin backed out the whole patch on 2007-04-30 to avoid the crash.
1434         Justin then restored most of the original patch, but used word granularity instead, to keep the build working.
1435         I just addressed the root cause of rdar://5157329 in rdar://5174862.
1436         This patch switches the temp uses of word granularity back to sentence granularity.
1437         
1438         * editing/mac/EditorMac.mm:
1439         (WebCore::Editor::markMisspellingsAfterTypingToPosition):
1440         * page/Frame.cpp:
1441         (WebCore::Frame::respondToChangedSelection):
1442
1443 2007-05-02  David Harrison  <harrison@apple.com>
1444
1445         Reviewed by Antti.
1446
1447         <rdar://problem/5174862> Crash resulting from DeprecatedString::insert()
1448         
1449         Test added: editing/selection/move-by-sentence-001.html
1450
1451         * editing/visible_units.cpp:
1452         (WebCore::previousBoundary):
1453         (WebCore::nextBoundary):
1454         Use a UChar Vector instead of DeprecatedString.
1455         Avoid creating an extra string for secure bullet replacement unless it is actually needed.
1456         
1457         * platform/DeprecatedString.cpp:
1458         (WebCore::DeprecatedString::insert):
1459         Call forceUnicode() before setLength(), so that only the unicode buffer is resized.
1460
1461        (WebCore::DeprecatedString::setLength):
1462         Adjust the unicode buffer even if the ascii buffer is valid.
1463         
1464 2007-05-02  Mitz Pettel  <mitz@webkit.org>
1465
1466         Reviewed by Brady.
1467
1468         - http://bugs.webkit.org/show_bug.cgi?id=13564
1469           Remove friend class FrameLoader from Frame
1470
1471         No test added since there is no change in functionality.
1472
1473         * loader/FrameLoader.cpp:
1474         (WebCore::FrameLoader::didOpenURL):
1475         (WebCore::FrameLoader::begin):
1476         (WebCore::FrameLoader::open):
1477         * loader/FrameLoader.h: Made clear() private.
1478         * page/Frame.cpp:
1479         (WebCore::Frame::setDocument): Changed the argument into a PassRefPtr.
1480         * page/Frame.h:
1481         * xml/XSLTProcessor.cpp:
1482         (WebCore::XSLTProcessor::createDocumentFromSource):
1483
1484 2007-05-02  Mitz Pettel  <mitz@webkit.org>
1485
1486         Reviewed by Dave Hyatt.
1487
1488         - fix http://bugs.webkit.org/show_bug.cgi?id=9276
1489           Quirksmode: Image swap resize bug
1490
1491         Test: fast/replaced/image-resize-width.html
1492
1493         * rendering/RenderImage.cpp:
1494         (WebCore::RenderImage::imageChanged): Moved the call to dirtyPrefWidths()
1495         before the call to calcWidth().
1496
1497 2007-05-02  David Hyatt  <hyatt@apple.com>
1498
1499         Fix for bug 13566, broken Dashboard widgets.  setPrefWidthsDirty did
1500         the wrong thing for text children of a positioned element.
1501
1502         Reviewed by mitz
1503
1504         fast/block/positioning/pref-width-change.html
1505
1506         * rendering/RenderObject.cpp:
1507         (WebCore::RenderObject::setPrefWidthsDirty):
1508
1509 2007-05-01  Darin Adler  <darin@apple.com>
1510
1511         * rendering/RenderReplaced.cpp: Fix typo in a comment.
1512
1513 2007-05-01  David Hyatt  <hyatt@apple.com>
1514
1515         Fix for 13558, crash when using absolutely positioned generated content
1516         inside an inline.
1517
1518         Reviewed by darin
1519
1520         fast/css-generated-content/absolute-position-inside-inline.html
1521
1522         * rendering/RenderContainer.cpp:
1523         (WebCore::RenderContainer::updateBeforeAfterContentForContainer):
1524
1525 2007-05-01  Justin Garcia  <justin.garcia@apple.com>
1526
1527         Reviewed by darin
1528
1529         <rdar://problem/5002441> 
1530         Pressing space key does nothing above quoted content or a signature
1531         
1532         Inserting a space under these circumstances inserts a single 
1533         text node containing a regular space and then does a layout. 
1534         That space isn't rendered (which is correct).  Whitespace 
1535         rebalancing is supposed to correct it but failed.  It replaces 
1536         the space with a non-breaking space, but that change doesn't 
1537         dirty line boxes (9441) and so the space isn't rendered.
1538         
1539         This workaround turns all incoming spaces into non-breaking 
1540         spaces before they're inserted (they're rebalanced after 
1541         insertion and turned back into regular spaces if possible).
1542
1543         * editing/InsertTextCommand.cpp:
1544         (WebCore::InsertTextCommand::prepareForTextInsertion): Removed
1545         an old irrelevant FIXME.
1546         (WebCore::InsertTextCommand::input): Turn incoming spaces into
1547         non breaking spaces before inserting them.
1548         
1549 2007-05-01  Darin Adler  <darin@apple.com>
1550
1551         Reviewed by Hyatt.
1552
1553         - fix http://bugs.webkit.org/show_bug.cgi?id=13559
1554           REGRESSION: Canvas aspect ratio is incorrect
1555
1556         - remove intrinsicWidth/Height functions from RenderObject
1557
1558         Test: fast/canvas/canvas-size-change-after-layout.html
1559
1560         * html/HTMLCanvasElement.cpp:
1561         (WebCore::HTMLCanvasElement::createRenderer): Removed code to set
1562         the intrinsic size, because the renderer now takes care of this
1563         in its constructor.
1564         (WebCore::HTMLCanvasElement::reset): Instead of calling the
1565         setIntrinsicWidth/Height functions, call canvasSizeChanged, which
1566         takes care of layout, but only if the size actually changed. Also
1567         call repaint if the contents of the canvas changed.
1568
1569         * rendering/RenderApplet.h:
1570         * rendering/RenderApplet.cpp: (WebCore::RenderApplet::intrinsicSize):
1571         Override the new intrinsicSize function. This override still doesn't
1572         make sense, so left a FIXME in here.
1573
1574         * rendering/RenderBox.h: Added an intrinsicSize function here to replace
1575         the intrinsicWidth/Height functions removed from RenderObject.
1576         * rendering/RenderBox.cpp:
1577         (WebCore::RenderBox::calcReplacedWidthUsing): Use intrinsicSize instead
1578         of intrinsicWidth.
1579         (WebCore::RenderBox::calcReplacedHeightUsing): Ditto, but for height.
1580
1581         * rendering/RenderHTMLCanvas.h: Changed the constructor parameter to be
1582         an HTMLCanvasElement* instead of Node*. Also added a canvasSizeChanged
1583         function.
1584         * rendering/RenderHTMLCanvas.cpp:
1585         (WebCore::RenderHTMLCanvas::RenderHTMLCanvas): Pass an initial intrinsic
1586         size based on the current size of the canvas element. This is now the
1587         responsibility of the renderer and the DOM element calls the canvasSizeChanged
1588         function when the size changes.
1589         (WebCore::RenderHTMLCanvas::paint): Removed checks of the type of the element,
1590         and used the node() function because we don't have to worry about the anonymous
1591         case in this class.
1592         (WebCore::RenderHTMLCanvas::canvasSizeChanged): Added. Changes the size and
1593         then calls setNeedsLayout and setPrefWidthsDirty as needed. I based the logic
1594         here on careful reading of RenderImage::imageChanged.
1595
1596         * rendering/RenderImage.cpp:
1597         (WebCore::RenderImage::RenderImage): Pass a default intrinsic size of 0,0
1598         instead of calling setIntrinsicWidth/Height.
1599         (WebCore::RenderImage::setImageSizeForAltText): Call the new intrinsic size
1600         functions instead of the width/height ones. Simplifies the logic since we
1601         handle both dimensions at once.
1602         (WebCore::RenderImage::imageChanged): Ditto.
1603         (WebCore::RenderImage::layout): Ditto.
1604         (WebCore::RenderImage::calcAspectRatioWidth): Ditto.
1605         (WebCore::RenderImage::calcAspectRatioHeight): Ditto.
1606
1607         * rendering/RenderObject.h: Removed intrinsicWidth/Height virtual functions.
1608
1609         * rendering/RenderReplaced.h: Replaced intrinsicWidth, intrinsicHeight,
1610         setIntrinsicWidth, setIntrinsicHeight, m_intrinsicWidth, and m_intrinsicHeight
1611         with intrinsicSize, setIntrinsicSize, and m_intrinsicSize.
1612         * rendering/RenderReplaced.cpp:
1613         (WebCore::RenderReplaced::RenderReplaced): Added a second contructor that takes
1614         an intrinsic size parameter. Also updated constructor since the intrinsic size
1615         is now an IntSize instead of two integers.
1616         (WebCore::RenderReplaced::intrinsicSize): Added. No point in making this inline
1617         because it's a virtual function.
1618         (WebCore::RenderReplaced::setIntrinsicSize): Added. Didn't make this inline,
1619         partly because in the future we might want this to be more than just a simple
1620         setter function, factoring in common code used in both RenderImage and
1621         RenderHTMLCanvas.
1622
1623         * rendering/RenderWidget.h: Removed a stray using declaration that wasn't needed.
1624
1625 2007-05-01  David Hyatt  <hyatt@apple.com>
1626
1627         Fix for hang when incorrectly trying to add before/after content to
1628         a <select>.  Disallow generated content in all selects and also turn it
1629         off for <input> buttons.
1630
1631         Reviewed by aroben
1632
1633         * rendering/RenderBlock.cpp:
1634         (WebCore::RenderBlock::setStyle):
1635         * rendering/RenderButton.cpp:
1636         (WebCore::RenderButton::canHaveChildren):
1637         * rendering/RenderButton.h:
1638
1639 2007-05-01  Darin Adler  <darin@apple.com>
1640
1641         Reviewed by Hyatt.
1642
1643         - removed the m_implicit bit from Node, freeing up a bit
1644
1645         - fixed <rdar://problem/5172607> XML parser is creating implicit tbody elements
1646         - fixed <rdar://problem/5172596> HTML-parser-created tbody elements are being
1647           ignored when processing CSS child rules
1648
1649         Test: fast/css/child-selector-implicit-tbody.html
1650
1651         * css/cssstyleselector.cpp: (WebCore::CSSStyleSelector::checkSelector):
1652         Removed code that used to look at implicitNode(), which no longer exists.
1653
1654         * css/html4.css: Added a style rule to handle cases where we have a tr
1655         inside a table with no intervening table section.
1656
1657         * dom/Node.h: Removed the bit.
1658         * dom/Node.cpp:
1659         (WebCore::Node::Node): Don't initialize the bit.
1660         (WebCore::Node::dump): Don't dump the bit.
1661
1662         * dom/XMLTokenizer.cpp:
1663         (WebCore::XMLTokenizer::startElementNs): Remove the code that made a
1664         table body element. This is handled in the render tree, the DOM tree
1665         should not be mangled.
1666         (WebCore::XMLTokenizer::endElementNs): Removed code that used to look at
1667         implicitNode(), which no longer exists.
1668
1669         * html/HTMLElementFactory.cpp: (WebCore::tableSectionConstructor):
1670         Removed boolean parameter that was passed to the HTMLTableSectionElement
1671         constructor.
1672         * html/HTMLParser.cpp: (WebCore::HTMLParser::handleError): Ditto.
1673         * html/HTMLTableElement.cpp:
1674         (WebCore::HTMLTableElement::createTHead): Ditto.
1675         (WebCore::HTMLTableElement::createTFoot): Ditto.
1676         (WebCore::HTMLTableElement::insertRow): Changed to return a PassRefPtr,
1677         because it's possible the row could be removed from the table by JavaScript
1678         code responding to DOM mutation events before the function returns. Just
1679         something I noticed by code inspection.
1680
1681         * html/HTMLTableSectionElement.cpp:
1682         (WebCore::HTMLTableSectionElement::HTMLTableSectionElement): Removed
1683         boolean "implicit" parameter to the constructor.
1684         (WebCore::HTMLTableSectionElement::insertRow): Changed to return a
1685         PassRefPtr for the same reason cited above.
1686
1687         * html/HTMLTableElement.h: Changed the return value of insertRow to be
1688         a PassRefPtr.
1689         * html/HTMLTableSectionElement.h: Ditto.
1690
1691 2007-04-30  David Hyatt  <hyatt@apple.com>
1692
1693         Fix for bug 12691, generated content and display: table-cell duplicates
1694         content on a size change.  Make sure that the code to update before/after
1695         content is smart enough to drill into anonymous containers to find the
1696         old child.
1697
1698         Reviewed by olliej
1699
1700         Added fast/css-generated-content/table-cell-before-content.html
1701
1702         * rendering/RenderBlock.cpp:
1703         (WebCore::RenderBlock::setStyle):
1704         * rendering/RenderButton.cpp:
1705         (WebCore::RenderButton::updateBeforeAfterContent):
1706         * rendering/RenderButton.h:
1707         * rendering/RenderContainer.cpp:
1708         (WebCore::RenderContainer::beforeAfterContainer):
1709         (WebCore::RenderContainer::updateBeforeAfterContent):
1710         (WebCore::RenderContainer::updateBeforeAfterContentForObject):
1711         * rendering/RenderContainer.h:
1712         * rendering/RenderInline.cpp:
1713         (WebCore::RenderInline::setStyle):
1714         (WebCore::RenderInline::addChildToFlow):
1715         (WebCore::RenderInline::splitInlines):
1716
1717 2007-04-30  Jungshik Shin <jungshik.shin@gmail.com>
1718
1719         Reviewed by justin
1720         
1721         <http://bugs.webkit.org/show_bug.cgi?id=13552>
1722         comment to Range::comparePoint in dom/Range.cpp has 
1723         '0xD0' in place of '-': leading to a compiler warning
1724
1725         * dom/Range.cpp:
1726         (WebCore::Range::comparePoint):
1727
1728 2007-04-30  Justin Garcia  <justin.garcia@apple.com>
1729
1730         Reviewed by darin
1731
1732         <rdar://problem/4875189> List gets deleted when replacing contents
1733
1734         * editing/ReplaceSelectionCommand.cpp:
1735         (WebCore::ReplaceSelectionCommand::doApply): Don't expand
1736         to include elements, like lists, when deleting a selection 
1737         to replace it.
1738
1739 2007-04-30  Justin Garcia  <justin.garcia@apple.com>
1740
1741         Reviewed by ggaren
1742         
1743         Buildfix.  Leave in grammar checking machinery to 
1744         keep WebKit building on other platforms but don't
1745         operate on sentence sized chunks so that we don't
1746         re-introduce 5157329.
1747
1748         * editing/Editor.h:
1749         * editing/mac/EditorMac.mm:
1750         (WebCore::Editor::markMisspellingsAfterTypingToPosition):
1751         (WebCore::markMisspellingsOrBadGrammar):
1752         (WebCore::Editor::markMisspellings):
1753         (WebCore::Editor::markBadGrammar):
1754         * page/Frame.cpp:
1755         (WebCore::Frame::respondToChangedSelection):
1756
1757 2007-04-30  Justin Garcia  <justin.garcia@apple.com>
1758
1759         Reviewed by darin
1760
1761         <rdar://problem/5168598> 
1762         Crash when deleting a link inside an input field
1763         
1764         Deletion code tries to update one of its positions to keep 
1765         it valid and nullifies it.  Later in mergeParagraphs we try 
1766         to find out if it's valid by checking to see if it's still in 
1767         the document and crash.
1768         
1769         The fix is just to not bother keeping the position, 
1770         m_upstreamStart, valid, since after the point in the code 
1771         under examination, it doesn't need to be valid anymore.  
1772         Besides, code to update DeleteSelectionCommand's positions 
1773         should go in the functions that handle the content removal 
1774         that might invalid them (there are already FIXMEs about this).
1775         
1776         Also, users shouldn't be able to insert links (or any rich content)
1777         into plaintext-only regions like text fields, even if those
1778         text fields are inside richly editable regions.  This is a 
1779         separate bug and is filed as 5171552.
1780
1781         * editing/DeleteSelectionCommand.cpp:
1782         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Don't
1783         bother updating m_upstreamStart.
1784
1785 2007-04-30  Patti Hoa  <patti@apple.com>
1786
1787         Reviewed by Dave Hyatt.
1788         
1789         <rdar://problem/5108546> REGRESSION: Zoom follows keyboard focus does not work
1790
1791         * WebCore.xcodeproj/project.pbxproj:
1792         Add new file SelectionControllerMac.mm
1793         * dom/Document.cpp:
1794         (WebCore::Document::updateSelection):
1795         Move the code to fire off AXSelectedTextChanged notification to a new method notifyAccessibilityForSelectionChange in SelectionControllerMac.mm
1796         * editing/SelectionController.cpp:
1797         (WebCore::SelectionController::setSelection):
1798         call notifyAccessibilityForSelectionChange to handle firing of accessibility notification and zoomFocusChange
1799         * editing/SelectionController.h:
1800         Add notifyAccessibilityForSelectionChange method for Mac platform
1801         * platform/Widget.h:
1802         * platform/mac/WidgetMac.mm:
1803         (WebCore::Widget::convertToScreenCoordinate):
1804         Add a helper routine that takes IntPoint in local coordinate and convert that to screen coordinate
1805
1806 2007-04-30  Justin Garcia  <justin.garcia@apple.com>
1807
1808         Reviewed by harrison
1809
1810         <rdar://problem/5157329> 
1811         REGRESSION: Crash at WTF::fastFree() when arrowing or deleting backward through editable text (13493)
1812         
1813         Backing out the changes for 4859132.
1814
1815         * editing/Editor.h:
1816         * editing/mac/EditorMac.mm:
1817         (WebCore::Editor::markMisspellingsAfterTypingToPosition):
1818         (WebCore::Editor::markMisspellings):
1819         * page/Frame.cpp:
1820         (WebCore::Frame::respondToChangedSelection):
1821
1822 2007-04-29  Antti Koivisto  <antti@apple.com>
1823
1824         Reviewed by Oliver.
1825
1826         Fix <rdar://problem/5169261>
1827         REGRESSION: Google Maps zooming too sensitive when using two fingers on trackpad
1828         
1829         Use line based delta values when generating DOM wheel events, use pixel deltas
1830         for scrolling only.
1831         
1832         No test case, requires user interaction and specific hardware.
1833
1834         * page/EventHandler.cpp:
1835         (WebCore::EventHandler::handleWheelEvent):
1836         * platform/PlatformWheelEvent.h:
1837         (WebCore::PlatformWheelEvent::continuousDeltaX):
1838         (WebCore::PlatformWheelEvent::continuousDeltaY):
1839         * platform/mac/WheelEventMac.mm:
1840         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1841
1842 2007-04-29  Oliver Hunt  <oliver@apple.com>
1843
1844         Reviewed by Brady.
1845
1846         Build fix for experimental features build
1847
1848         * rendering/RenderForeignObject.cpp:
1849
1850 2007-04-29  Mitz Pettel  <mitz@webkit.org>
1851
1852         Reviewed by Dave Hyatt.
1853
1854         - fix http://bugs.webkit.org/show_bug.cgi?id=13544
1855           REGRESSION (r21120): Member profile frame not erased at Yahoo! Answers
1856
1857         Test: fast/repaint/layer-hide-when-needs-layout.html
1858
1859         * rendering/RenderObject.cpp:
1860         (WebCore::RenderObject::setStyle): If we get a layout hint, we count on
1861         layout() or updateLayerPositions() to repaint. In the case of a layer
1862         going invisible, however, we need to repaint here since neither of the
1863         above will do it.
1864
1865 2007-04-29  Oliver Hunt  <oliver@apple.com>
1866
1867         Reviewed by Steve.
1868
1869         Fix for <rdar://problem/5126393> REGRESSION (r19672-19697): Safari drag image drags at original size (13261)
1870
1871         Added logic to ensure that when we create the drag image
1872         we're looking at the rendered image size.
1873
1874         * page/DragController.cpp:
1875         (WebCore::DragController::doImageDrag):
1876           Pass the rendered image size to fitDragImageToMaxSize
1877
1878         * platform/DragImage.cpp:
1879         (WebCore::fitDragImageToMaxSize):
1880            Need to do scaling relative to rendered image size
1881
1882         * platform/DragImage.h:
1883            scaleDragImage needs x and y scales to allow for them to be
1884            scaled seperately on a page
1885
1886         * platform/gdk/DragImageGdk.cpp:
1887         (WebCore::scaleDragImage):
1888            Prevent build bustage
1889
1890         * platform/mac/DragImageMac.mm:
1891         (WebCore::scaleDragImage):
1892            scale width and height independently
1893
1894         * platform/qt/DragImageQt.cpp:
1895         (WebCore::scaleDragImage):
1896            Prevent build bustage
1897
1898 2007-04-29  Darin Adler  <darin@apple.com>
1899
1900         Reviewed by Adele.
1901
1902         - fix the Gmail part of http://bugs.webkit.org/show_bug.cgi?id=12798
1903           and <rdar://problem/4118559>
1904
1905         This patch changes things so that resizing can make things larger than their
1906         initial size, but not smaller. I believe this resolves the problem for Gmail,
1907         but you can still get strange behavior if you have a small right-aligned <textarea>.
1908
1909         * rendering/RenderLayer.cpp:
1910         (WebCore::RenderLayer::resize): Rewrote to use more IntPoint and IntSize and add
1911         in a new minimum-size algorithm. This function now has the side effect of storing
1912         a new minimumSizeForResizing in the element being resized, and respects any existing
1913         minimum as well.
1914         (WebCore::RenderLayer::offsetFromResizeCorner): Reversed this so it converts the
1915         point into coordinates relative to the resize corner, hence negative numbers mean
1916         the point is above and to the left. This is used only in the algorithm above.
1917
1918         * dom/Element.h: Removed unneeded include of Attr.h, and added forward declarations
1919         as needed. Removed all friend declarations; there was no need for any of them.
1920         Tweaked formatting of various declarations and removed unneeded parameter names.
1921         Made as much as possible private, and a couple things public to avoid the need for
1922         friend classes. Added minimumSizeForResizing, setMinimumSizeForResizing, rareData,
1923         and createRareData functions.
1924
1925         * dom/Element.cpp:
1926         (WebCore::rareDataMap): Added. Function to return the single global map.
1927         (WebCore::rareDataFromMap): Added. For use by inlined functions to get the
1928         data from the map in the case where it's present.
1929         (WebCore::ElementRareData::ElementRareData): Added.
1930         (WebCore::Element::~Element): Added code to delete the element from the rare
1931         data map when appropriate.
1932         (WebCore::Element::rareData): Added.
1933         (WebCore::Element::createRareData): Added.
1934         (WebCore::Element::setAttributeNodeNS): Got rid of the old inline version of this,
1935         since it was the sole reason we had to include Attr.h in Element.h.
1936         (WebCore::Element::minimumSizeForResizing): Added. Accesses rare data.
1937         (WebCore::Element::setMinimumSizeForResizing): Ditto.
1938
1939         * dom/Node.h: Renamed the m_specified bit since it's now used for two purposes.
1940         Its new long name is m_attrWasSpecifiedOrElementHasRareData.
1941
1942         * dom/Attr.cpp: (WebCore::Attr::Attr): Updated for bit name change.
1943         * dom/Attr.h:
1944         (WebCore::Attr::specified): Ditto.
1945         (WebCore::Attr::setSpecified): Added, since setting the bit directly is pretty ugly now.
1946         * dom/Document.cpp: (WebCore::Document::adoptNode): Updated for bit name change.
1947         * dom/Node.cpp:
1948         (WebCore::Node::Node): Ditto.
1949         (WebCore::Node::dump): Ditto.
1950
1951         * dom/NamedAttrMap.cpp: (WebCore::NamedAttrMap::isReadOnlyNode): Moved out of line,
1952         since this was the sole reason we had to include Element.h in NamedAttrMap.h.
1953
1954         * html/HTMLElement.cpp:
1955         (WebCore::HTMLElement::nodeName): Changed to use tagQName() since that's a public
1956         way to do something that's now private.
1957         (WebCore::HTMLElement::cloneNode): Ditto.
1958
1959         * dom/Attribute.cpp:
1960         * dom/NamedAttrMap.h:
1961         * dom/NamedMappedAttrMap.cpp:
1962         * dom/StyledElement.h:
1963         * html/HTMLTokenizer.h:
1964         * xml/XPathFunctions.cpp:
1965         * xml/XPathStep.cpp:
1966         Updated includes, and other administrivia.
1967
1968 2007-04-29  Mitz Pettel  <mitz@webkit.org>
1969
1970         Reviewed by Darin and Hyatt.
1971
1972         - http://bugs.webkit.org/show_bug.cgi?id=13487
1973           Implement O(1) absoluteClippedOverflowRect and absoluteOutlineBox during layout for a possible speed gain
1974
1975         Test for a bug fixed by this patch: fast/repaint/intermediate-layout-position-clip.html
1976
1977         By keeping track of the total translation and clip during layout, absolutePosition and
1978         computeAbsoluteRepaintRect become O(1).
1979
1980         * WebCore.pro: Added LayoutState.cpp
1981         * WebCore.vcproj/WebCore/WebCore.vcproj: Added LayoutState.{cpp,h}
1982         * WebCore.xcodeproj/project.pbxproj: Added LayoutState.{cpp,h}
1983         * WebCoreSources.bkl: Added LayoutState.cpp
1984         * page/FrameView.cpp:
1985         (WebCore::FrameView::layout): When doing subtree layout, push an initial layout state for the
1986         layout root.
1987         * rendering/LayoutState.cpp: Added. A LayoutState corresponding to a box consists of the origin of
1988         its coordinate system in view coordinates and possibly the clip rect, in view coordinates, which
1989         applies to its children.
1990         (WebCore::LayoutState::LayoutState):
1991         (WebCore::LayoutState::destroy):
1992         (WebCore::throw):
1993         (WebCore::LayoutState::operator delete):
1994         * rendering/LayoutState.h: Added.
1995         (WebCore::LayoutState::LayoutState):
1996         * rendering/RenderBlock.cpp:
1997         (WebCore::RenderBlock::layoutBlock): Factored out the "only positioned objects" case into
1998         layoutOnlyPositionedObjects(). Added code to push/pop LayoutState, unless we have columns, in
1999         which case we disable/enable LayoutState. Removed the translation by the layout delta
2000         of the old absolute rects, since that is now integral to absoluteClippedOverflowRect() and
2001         absoluteOutlineBox().
2002         (WebCore::RenderBlock::layoutOnlyPositionedObjects): Added this helper function that checks for
2003         and handles the case where only positioned objects need layout. Returns true in that case.
2004         (WebCore::RenderBlock::repaintOverhangingFloats): Disabled LayoutState when repainting floats, since
2005         they may belong to other containers.
2006         (WebCore::RenderBlock::updateFirstLetter): Disabled LayoutState when adding and removing from the
2007         first letter container, since it may be different than ourselves.
2008         * rendering/RenderBlock.h:
2009         * rendering/RenderBox.cpp:
2010         (WebCore::RenderBox::setStyle): Minor cleanup: changed element()->document() to the equivalent document().
2011         (WebCore::RenderBox::offsetForPositionedInContainer): Added. Factored out common code from
2012         absolutePosition, computeAbsoluteRepaintRect and RenderLayer::updateLayerPosition into this function.
2013         (WebCore::RenderBox::absolutePosition): Added an O(1) code path when this function is called during
2014         layout (and LayoutState has not been disabled). Factored out some code into
2015         offsetForPositionedInContainer.
2016         (WebCore::RenderBox::absoluteClippedOverflowRect): Added the layout delta here, so callers don't need
2017         to.
2018         (WebCore::RenderBox::computeAbsoluteRepaintRect): Added an O(1) code path when this function is called
2019         during layout (and LayoutState has not been disabled). Factored out some code into
2020         offsetForPositionedInContainer.
2021         * rendering/RenderContainer.cpp:
2022         (WebCore::RenderContainer::layout): Added LayoutState push/pop.
2023         * rendering/RenderFlexibleBox.cpp:
2024         (WebCore::RenderFlexibleBox::layoutBlock): Factored out the "only positioned objects" case into
2025         layoutOnlyPositionedObjects(). Added LayoutState push/pop. Removed the translation by the layout delta
2026         of the old absolute rects, since that is now integral to absoluteClippedOverflowRect() and
2027         absoluteOutlineBox().
2028         * rendering/RenderFlow.cpp:
2029         (WebCore::RenderFlow::absoluteClippedOverflowRect): Added an ASSERT.
2030         * rendering/RenderForeignObject.cpp:
2031         (WebCore::RenderForeignObject::layout): Disabled LayoutState because it is incompatible with arbitrary
2032         affine transforms.
2033         * rendering/RenderHTMLCanvas.cpp:
2034         (WebCore::RenderHTMLCanvas::layout): Removed the translation by the layout delta of the old absolute
2035         rects, since that is now integral to absoluteClippedOverflowRect() and absoluteOutlineBox().
2036         * rendering/RenderImage.cpp:
2037         (WebCore::RenderImage::layout): Ditto.
2038         * rendering/RenderLayer.cpp:
2039         (WebCore::RenderLayer::updateLayerPositions): Added ASSERTs. Factored out some code into
2040         RenderBox::offsetForPositionedInContainer.
2041         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Disabled LayoutState around the call to
2042         scrollToOffset.
2043         * rendering/RenderListItem.cpp:
2044         (WebCore::RenderListItem::updateMarkerLocation): Disabled LayoutState when moving the list marker, since
2045         it can trigger repainting in other containers.
2046         * rendering/RenderObject.cpp:
2047         (WebCore::RenderObject::isRoot): Minor cleanup: changed element()->document() to the equivalent
2048         document().
2049         (WebCore::RenderObject::computeAbsoluteRepaintRect): Removed 'return' at the end of the function.
2050         (WebCore::RenderObject::container): Reordered to avoid calling isText() twice.
2051         (WebCore::RenderObject::absoluteOutlineBox): Added the layout delta here, so callers don't need to.
2052         * rendering/RenderSVGContainer.cpp:
2053         (WebCore::RenderSVGContainer::layout): Disabled LayoutState because it is incompatible with arbitrary
2054         affine transforms.
2055         * rendering/RenderTable.cpp:
2056         (WebCore::RenderTable::layout):  Factored out the "only positioned objects" case into
2057         layoutOnlyPositionedObjects(). Added LayoutState push/pop. Removed the translation by the layout delta
2058         of the old absolute rects, since that is now integral to absoluteClippedOverflowRect() and
2059         absoluteOutlineBox().
2060         * rendering/RenderTableCell.cpp:
2061         (WebCore::RenderTableCell::absoluteClippedOverflowRect): Added the layout delta here, so callers
2062         don't need to.
2063         (WebCore::RenderTableCell::computeAbsoluteRepaintRect): For the O(1) code path, skipped the correction
2064         for the parent row, because RenderTableRow doesn't push a translation into LayoutState.
2065         (WebCore::RenderTableCell::absolutePosition): Ditto.
2066         * rendering/RenderTableRow.cpp:
2067         (WebCore::RenderTableRow::layout): Added LayoutState push/pop.
2068         * rendering/RenderTableSection.cpp:
2069         (WebCore::RenderTableSection::setCellWidths): Added LayoutState push/pop if cells are repainted or
2070         receive layout.
2071         (WebCore::RenderTableSection::calcRowHeight): Ditto.
2072         (WebCore::RenderTableSection::layoutRows): Added LayoutState push/pop.
2073         * rendering/RenderView.cpp:
2074         (WebCore::RenderView::RenderView):
2075         (WebCore::RenderView::layout): Added initial LayoutState setup for the layout.
2076         (WebCore::RenderView::paintBoxDecorations): Minor cleanup: changed element()->document() to the
2077         equivalent document().
2078         (WebCore::RenderView::repaintViewRectangle): Ditto.
2079         (WebCore::RenderView::pushLayoutState): Added. Pushes initial layout state for subtree layout.
2080         * rendering/RenderView.h:
2081         (WebCore::RenderView::pushLayoutState):
2082         (WebCore::RenderView::popLayoutState):
2083         (WebCore::RenderView::layoutState):
2084         (WebCore::RenderView::disableLayoutState):
2085         (WebCore::RenderView::enableLayoutState):
2086
2087 2007-04-29  David Hyatt  <hyatt@apple.com>
2088
2089         Fix for bugzilla 13535, regression from positioning cleanup a while
2090         back.  Some code got added to compute available width for a relpositioned
2091         inline, only the code meant to be used for inline flows and not inline blocks.
2092
2093         Reviewed by mjs
2094
2095         fast/block/positioning/inline-block-relposition.html
2096
2097         * rendering/RenderBox.cpp:
2098         (WebCore::RenderBox::containingBlockWidthForPositioned):
2099
2100 2007-04-29  Oliver Hunt  <oliver@apple.com>
2101
2102         Reviewed by Zack.
2103
2104         Implement basic drag and drop support for qt
2105         this allows content and link dragging but does not
2106         provide the DOM data access methods.
2107
2108         * platform/DragData.h:
2109         * platform/qt/ClipboardQt.cpp:
2110         (WebCore::ClipboardQt::ClipboardQt):
2111         (WebCore::ClipboardQt::~ClipboardQt):
2112         (WebCore::ClipboardQt::clearData):
2113         (WebCore::ClipboardQt::clearAllData):
2114         (WebCore::ClipboardQt::setData):
2115         (WebCore::ClipboardQt::declareAndWriteDragImage):
2116         (WebCore::ClipboardQt::writeURL):
2117         (WebCore::ClipboardQt::writeRange):
2118         (WebCore::ClipboardQt::hasData):
2119         * platform/qt/ClipboardQt.h:
2120         (WebCore::ClipboardQt::clipboardData):
2121         (WebCore::ClipboardQt::invalidateWritableData):
2122         * platform/qt/DragDataQt.cpp:
2123         (WebCore::DragData::canSmartReplace):
2124         (WebCore::DragData::containsPlainText):
2125         (WebCore::DragData::asPlainText):
2126         (WebCore::DragData::createClipboard):
2127         (WebCore::DragData::containsCompatibleContent):
2128         (WebCore::DragData::containsURL):
2129         (WebCore::DragData::asURL):
2130         (WebCore::DragData::asFragment):
2131
2132 2007-04-28  Maciej Stachowiak  <mjs@apple.com>
2133
2134         Reviewed by Darin and Oliver.
2135
2136         - change Document to hold onto Frame* instead of FrameView*
2137         
2138         This is an architectural cleanup and a prerequisite to fixing citibank login
2139         in an architecturally sound way.
2140
2141         Some fixups for the page cache:
2142         
2143         * history/CachedPage.cpp:
2144         (WebCore::CachedPage::restore): Add an assert that the document's view
2145         matches the cached page's view - this needs to be true by the time this
2146         function is called.
2147         (WebCore::CachedPage::clear): Change assert to require frame matching, not
2148         view matching.
2149         * history/CachedPage.h:
2150         (WebCore::CachedPage::view): Add a way to get the view out.
2151         * loader/FrameLoader.cpp:
2152         (WebCore::FrameLoader::begin): pass Frame, not FrameView, when creating document
2153         (WebCore::FrameLoader::open): restore view based on CachedPage, not Document. 
2154
2155         Remaining changes are just straightforward updates based on which
2156         pointer is held or passed:
2157         
2158         * dom/DOMImplementation.cpp:
2159         (WebCore::DOMImplementation::createDocument):
2160         (WebCore::DOMImplementation::createHTMLDocument):
2161         * dom/DOMImplementation.h:
2162         * dom/Document.cpp:
2163         (WebCore::Document::Document):
2164         (WebCore::Document::view):
2165         (WebCore::Document::frame):
2166         (WebCore::Document::recalcStyle):
2167         (WebCore::Document::updateLayout):
2168         (WebCore::Document::attach):
2169         (WebCore::Document::detach):
2170         (WebCore::Document::createTokenizer):
2171         (WebCore::Document::recalcStyleSelector):
2172         (WebCore::Document::setInPageCache):
2173         (WebCore::Document::applyXSLTransform):
2174         * dom/Document.h:
2175         * html/HTMLDocument.cpp:
2176         (WebCore::HTMLDocument::HTMLDocument):
2177         * html/HTMLDocument.h:
2178         * html/HTMLViewSourceDocument.cpp:
2179         (WebCore::HTMLViewSourceDocument::HTMLViewSourceDocument):
2180         * html/HTMLViewSourceDocument.h:
2181         * ksvg2/svg/SVGDocument.cpp:
2182         (WebCore::SVGDocument::SVGDocument):
2183         * ksvg2/svg/SVGDocument.h:
2184         * loader/ImageDocument.cpp:
2185         (WebCore::ImageDocument::ImageDocument):
2186         * loader/ImageDocument.h:
2187         * loader/PluginDocument.cpp:
2188         (WebCore::PluginDocument::PluginDocument):
2189         * loader/PluginDocument.h:
2190         * loader/TextDocument.cpp:
2191         (WebCore::TextDocument::TextDocument):
2192         * loader/TextDocument.h:
2193         * xml/XSLTProcessor.cpp:
2194         (WebCore::XSLTProcessor::createDocumentFromSource):
2195         (WebCore::XSLTProcessor::transformToDocument):
2196         * xml/XSLTProcessor.h:
2197
2198 2007-04-28  Adele Peterson  <adele@apple.com>
2199
2200         RS by Darin.
2201
2202         Update to fix for <rdar://problem/5152299>
2203
2204         Test: fast/events/no-blur-on-enter-button.html
2205
2206         * html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::defaultEventHandler):
2207         Don't blur the button when handling the enter key.  This matches our new behavior for input elements.
2208
2209 2007-04-28  Adele Peterson  <adele@apple.com>
2210
2211         Fix by Darin, reviewed by me.
2212
2213         Fix for <rdar://problem/5152299> REGRESSION: <button> elements do not respond to space and return key as similar <input> elements do
2214
2215         Tests:
2216         fast/forms/button-spacebar-click.html
2217         fast/forms/button-enter-click.html
2218
2219         * html/HTMLButtonElement.h: (WebCore::HTMLButtonElement::): Made type enum private.
2220         Removed unnecessary m_value and m_currValue, and unused m_dirty.
2221         * html/HTMLButtonElement.cpp:
2222         (WebCore::HTMLButtonElement::HTMLButtonElement): Removed initialization of m_dirty.
2223         (WebCore::HTMLButtonElement::parseMappedAttribute): Removed case to parse value and accesskey attributes, which don't do anything.
2224         (WebCore::HTMLButtonElement::defaultEventHandler): Removed unnecessary check for button type.
2225          Added cases to handle spacebar and enter keys in the same way that they're handled for <input type=button/reset/submit> buttons.
2226         (WebCore::HTMLButtonElement::isSuccessfulSubmitButton): Shortened comment.
2227         (WebCore::HTMLButtonElement::appendFormData): Use value() instead of m_currValue.  Renamed encoding argument to formData.
2228
2229 2007-04-28  Mitz Pettel  <mitz@webkit.org>
2230
2231         Reviewed by Darin.
2232
2233         - fix http://bugs.webkit.org/show_bug.cgi?id=13501
2234           REGRESSION (r21093): Pasting into text field fails and makes the caret disappear
2235
2236         Test: fast/dynamic/anonymous-block-layer-lost.html
2237
2238         * rendering/RenderBlock.cpp:
2239         (WebCore::RenderBlock::removeChild): Avoid cutting off layers when removing
2240         the anonymous block.
2241
2242 2007-04-28  Mitz Pettel  <mitz@webkit.org>
2243
2244         Reviewed by Darin.
2245
2246         - fix http://bugs.webkit.org/show_bug.cgi?id=13471
2247           REGRESSION (r21045): Secure keyboard entry mode remains in effect after leaving a password field by submitting
2248
2249         * loader/FrameLoader.cpp:
2250         (WebCore::FrameLoader::clear): Replaced direct access to Frame's d->m_doc
2251         with a call to Frame::setDocument.
2252         (WebCore::FrameLoader::begin): Ditto.
2253         (WebCore::FrameLoader::open): Ditto.
2254         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady): Ditto.
2255         (WebCore::FrameLoader::canCachePage): Added a comment.
2256         * manual-tests/secure-keyboard-enabled-after-submit.html: Added.
2257         * page/Frame.cpp:
2258         (WebCore::Frame::setDocument): Reset secure keyboard entry, in case the
2259         old document's focused node has set it.
2260
2261 2007-04-28  Mitz Pettel  <mitz@webkit.org>
2262
2263         Reviewed by Adele.
2264
2265         - fix http://bugs.webkit.org/show_bug.cgi?id=13379
2266           REGRESSION: Cannot add an option to a selected popup
2267
2268         * manual-tests/update-empty-popup.html: Added.
2269         * platform/mac/PopupMenuMac.mm:
2270         (WebCore::PopupMenu::show): Added a call to the client's hidePopup()
2271         callback before returning in the case that the menu is empty. Otherwise
2272         the client thinks that the menu stayed open.
2273
2274 2007-04-28  Adele Peterson  <adele@apple.com>
2275
2276         Reviewed by Darin.
2277
2278         Fix for <rdar://problem/4806988> REGRESSION: history.go(0) doesn't reload page (affects buttons at facebook.com)
2279
2280         Test: fast/history/history_reload.html
2281
2282         * loader/FrameLoader.cpp: (WebCore::FrameLoader::scheduleHistoryNavigation):
2283         We avoid doing a redirection when going to the same url in a history navigation, but we have to still
2284         schedule a redirection when the number of steps is zero so we can force a reload.
2285
2286 2007-04-28  Alexey Proskuryakov  <ap@webkit.org>
2287
2288         Reviewed by Darin.
2289
2290         http://bugs.webkit.org/show_bug.cgi?id=13514
2291         REGRESSION (r20997-21003): Crash in WebCore::Node::document
2292
2293         Test: fast/dom/NodeList/childNodes-reset-cache.html
2294
2295         * dom/Node.cpp:
2296         (WebCore::Node::notifyLocalNodeListsChildrenChanged): Reset the common caches for child node
2297         lists. We cannot rely on notifications, since there may be no list objects left around.
2298
2299         * dom/ChildNodeList.cpp:
2300         (WebCore::ChildNodeList::rootNodeChildrenChanged):
2301         * dom/ChildNodeList.h:
2302         Override rootNodeChildrenChanged() with an empty implementation, now that caches are reset
2303         in Node::notifyLocalNodeListsChildrenChanged().
2304
2305 2007-04-28  Mark Rowe  <mrowe@apple.com>
2306
2307         Build fix.  Change use of nil to 0 in C++ source file.
2308
2309         * editing/Editor.cpp:
2310         (WebCore::Editor::increaseSelectionListLevel):
2311         (WebCore::Editor::increaseSelectionListLevelOrdered):
2312         (WebCore::Editor::increaseSelectionListLevelUnordered):
2313
2314 2007-04-28  Darin Adler  <darin@apple.com>
2315
2316         Reviewed by Adele.
2317
2318         - fix http://bugs.webkit.org/show_bug.cgi?id=6216
2319           REGRESSION: getElementsByTagNameNS with empty namespace doesn't work
2320
2321         * dom/Node.cpp:
2322         (WebCore::TagNodeList::TagNodeList): Changed parameter to PassRefPtr, tweaked formatting.
2323         (WebCore::TagNodeList::item): Tweaked formatting.
2324         (WebCore::TagNodeList::nodeMatches): Tweaked formatting.
2325         (WebCore::Node::setPrefix): Tweaked formatting.
2326         (WebCore::Node::getElementsByTagNameNS): Added special case to turn empty namespaces into
2327         null namespaces.
2328
2329 2007-04-28  Darin Adler  <darin@apple.com>
2330
2331         Reviewed by Kevin Decker.
2332
2333         - fix <rdar://problem/5148271> Chinese numbers are incorrect in numbered lists
2334           (including pasting from TextEdit to Mail)
2335
2336         Covered by an existing regression test, which had wrong results checked in.
2337
2338         Hyatt told me not to use the algorithm in the CSS 3 specification, but I didn't listen!
2339         This corrects mistakes there and makes our results match current Firefox.
2340
2341         * rendering/RenderListMarker.cpp:
2342         (WebCore::toCJKIdeographic): Added code to strip off trailing zero digits.
2343         Added special case for zero, since that's the one case where we don't want
2344         to strip off trailing zero digits. Fixed mixed-up logic that would put the
2345         digits in each group backwards.
2346         (WebCore::listMarkerText): Corrected character values for the CJK_IDEOGRAPHIC case.
2347
2348 2007-04-28  Darin Adler  <darin@apple.com>
2349
2350         Reviewed by Oliver.
2351
2352         - fix <rdar://problem/5138250> REGRESSION (r18245): Changing any one aspect
2353           of a font applies all the aspects to selected text
2354
2355         Since this bug is only visible with the font panel, I don't
2356         think there's any way to make a DumpRenderTree-driven test.
2357
2358         * editing/Editor.cpp: (WebCore::Editor::fontForSelection):
2359         Set hasMultipleFonts properly. The old code had an early exit
2360         that was left over from when hasMultipleFonts was a pointer.
2361
2362 2007-04-27  Mitz Pettel  <mitz@webkit.org>
2363
2364         Reviewed by Dave Hyatt.
2365
2366         - fix http://bugs.webkit.org/show_bug.cgi?id=13525
2367           Repainting a listbox schedules a relayout
2368
2369         No test possible as there is no change to functionality.
2370
2371         - fix the root cause of http://bugs.webkit.org/show_bug.cgi?id=10862
2372           REGRESSION: Collapsing form input on www.myspace.com
2373
2374         No test possible since text fields are no longer implemented as flexboxes.
2375
2376         * rendering/RenderObject.cpp:
2377         (WebCore::RenderObject::scheduleRelayout): Added a check that the subtree
2378         root is in the tree and not free-floating.
2379         * rendering/bidi.cpp:
2380         (WebCore::RenderBlock::bidiReorderCharacters): Changed addChild and removeChild
2381         to appendChildNode and removeChildNode to save some unnecessary overhead.
2382         These calls still mark the tree for relayout, but the change in scheduleRelayout 
2383         ensures that a layout won't be scheduled.
2384
2385 2007-04-27  Patti Hoa  <patti@apple.com>
2386
2387         Reviewed by Darin.
2388         
2389         <rdar://problem/5153017> REPRODUCIBLE ASSERT: range != nil in WebViewFactory.mm:415 -[WebViewFactory startOfTextMarkerRange:] (13354)
2390         
2391         * bridge/mac/WebCoreAXObject.mm:
2392         (-[WebCoreAXObject textMarkerRangeForRange:]):
2393         Fix the range length check.  It was incorrectly assuming that the max range requested cannot be equal
2394         to the length of the string.  Since NSRange location is index based, it's perfectly valid to have the max
2395         range equal to the the text length.
2396
2397 2007-04-27  David Harrison  <harrison@apple.com>
2398
2399         Reviewed by Darin.
2400
2401         <rdar://problem/5160627> Export JS list creation support as ObjC SPI for Mail
2402
2403         * WebCore.exp:
2404         * editing/Editor.h:
2405         * editing/Editor.cpp:
2406         (WebCore::Editor::insertOrderedList):
2407         (WebCore::Editor::insertUnorderedList):
2408         (WebCore::Editor::canIncreaseSelectionListLevel):
2409         (WebCore::Editor::canDecreaseSelectionListLevel):
2410         (WebCore::Editor::increaseSelectionListLevel):
2411         (WebCore::Editor::increaseSelectionListLevelOrdered):
2412         (WebCore::Editor::increaseSelectionListLevelUnordered):
2413         (WebCore::Editor::decreaseSelectionListLevel):
2414         Add insertOrderedList() and insertUnorderedList().
2415         Move existing list management functions from WebCoreFrameBridge.
2416         The level increasing functions now return a PassRefPtr<Node> instead of Node.
2417         Add check for canEditRichly.
2418         
2419         - in many other functions, condense the check for nil client().
2420         
2421         * editing/InsertListCommand.h:
2422         * editing/InsertListCommand.cpp:
2423         (WebCore::InsertListCommand::insertList):
2424         (WebCore::InsertListCommand::fixOrphanedListChild):
2425         (WebCore::InsertListCommand::doApply):
2426         Add insertList(), which returns the new list element.
2427         Don't set the list element's ID if the specified ID was an empty string.
2428                 
2429         * editing/ModifySelectionListLevel.h:
2430         * editing/ModifySelectionListLevel.cpp:
2431         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelWithType):
2432         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel):
2433         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered):
2434         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered):
2435         Return PassRefPtr<Node> instead of Node.
2436
2437         * page/mac/WebCoreFrameBridge.h:
2438         * page/mac/WebCoreFrameBridge.mm:
2439         Move list management functions to Editor.h and Editor.cpp.
2440
2441
2442 2007-04-27  David Hyatt  <hyatt@apple.com>
2443
2444         Fix for <rdar://problem/5134254>, toolbar buttons don't work in gmail after double-click.  Make sure
2445         to clear out the capturing frame, since you don't get a second up when a double-click happens.
2446
2447         Reviewed by mjs
2448
2449         * page/EventHandler.cpp:
2450         (WebCore::EventHandler::handleMouseDoubleClickEvent):
2451
2452 2007-04-27  Justin Garcia  <justin.garcia@apple.com>
2453
2454         Reviewed by oliver
2455
2456         <rdar://problem/5164796> 
2457         Enable execCommand("CreateLink", ...) for caret selections
2458
2459         * editing/CreateLinkCommand.cpp:
2460         (WebCore::CreateLinkCommand::doApply): For a caret
2461         selection, insert a link at the caret position
2462         with the url as the link text.
2463         * editing/JSEditor.cpp: Enable CreateLink for caret 
2464         selections.
2465
2466 2007-04-27  Antti Koivisto  <antti@apple.com>
2467
2468         Reviewed by Darin, Hyatt.
2469         
2470         Fix http://bugs.webkit.org/show_bug.cgi?id=13081
2471         Empty table cells not handled correctly
2472         <rdar://problem/5067926>
2473         
2474         To match Firefox and IE, empty table cells with variable width need to be
2475         treated as special case. They generally get zero width.
2476
2477         * rendering/AutoTableLayout.cpp:
2478         (WebCore::AutoTableLayout::recalcColumn):
2479         (WebCore::AutoTableLayout::calcEffectiveWidth):
2480         (WebCore::AutoTableLayout::layout):
2481         * rendering/AutoTableLayout.h:
2482         (WebCore::AutoTableLayout::Layout::Layout):
2483         * rendering/RenderStyle.h:
2484         (WebCore::RenderStyle::hasPadding):
2485
2486 2007-04-27  Rob Buis  <buis@kde.org>
2487
2488         Reviewed by Oliver.
2489
2490         http://bugs.webkit.org/show_bug.cgi?id=13052
2491         Text not rendered in a second inline SVG element
2492
2493         Correct the rendering of svg text when embedded in non-svg container.
2494
2495         * rendering/RenderSVGText.cpp:
2496         (WebCore::RenderSVGText::paint):
2497
2498 2007-04-27  Mark Rowe  <mrowe@apple.com>
2499
2500         Reviewed by Maciej.
2501
2502         * WebCore.pro: Remove non-existent paths from qmake files.
2503
2504 2007-04-25  Lars Naesbye Christensen <lars@naesbye.dk>
2505
2506         Reviewed by Timothy Hatcher.
2507
2508         http://bugs.webkit.org/show_bug.cgi?id=13477
2509         Bug 13477: Help and context menu cursors need dropshadows.
2510
2511         * Resources/cellCursor.png:
2512         * Resources/contextMenuCursor.png:
2513         * Resources/helpCursor.png:
2514         * platform/mac/CursorMac.mm:
2515         (WebCore::contextMenuCursor):
2516         (WebCore::copyCursor):
2517         (WebCore::progressCursor):
2518         (WebCore::noDropCursor):
2519
2520 2007-04-27  Holger Freyther <freyther@kde.org>
2521
2522         Reviewed by Maciej.
2523
2524         Remove unmaintained CMake build system.
2525
2526         * CMakeLists.txt: Removed.
2527
2528 2007-04-26  Matt Perry  <mpComplete@gmail.com>
2529
2530         Reviewed by Maciej.
2531
2532         Added a version check to hackAroundLibXMLEntityBug, since that bug has
2533         been fixed in recent versions of libxml2.
2534
2535         * dom/XMLTokenizer.cpp:
2536         (WebCore::hackAroundLibXMLEntityBug):
2537
2538 2007-04-26  Christopher Brichford  <chrisb@adobe.com>
2539
2540         Reviewed by Timothy Hatcher.
2541
2542         - Fix for Bug 13204: Submit initial version of mac project files for apollo
2543           port of WebCore
2544           http://bugs.webkit.org/show_bug.cgi?id=13204
2545
2546         * WebCore.apolloproj/mac/WebCore.Debug.xcconfig: Added.
2547         * WebCore.apolloproj/mac/WebCore.Release.xcconfig: Added.
2548         * WebCore.apolloproj/mac/WebCore.xcconfig: Added.
2549         * WebCore.apolloproj/mac/WebCore.xcodeproj/project.pbxproj: Added.
2550
2551 2007-04-26  Alp Toker  <alp@atoker.com>
2552
2553         Reviewed by Maciej.
2554
2555         http://bugs.webkit.org/show_bug.cgi?id=13505
2556         Cast loses precision on x86_64
2557
2558         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2559         (WebCore::GraphicsContext::beginTransparencyLayer):
2560         (WebCore::GraphicsContext::endTransparencyLayer):
2561         Use a stack of opacity values instead of Cairo user data.
2562
2563 2007-04-26  Mitz Pettel  <mitz@webkit.org>
2564
2565         Reviewed by Darin.
2566
2567         - fix http://bugs.webkit.org/show_bug.cgi?id=13500
2568           REGRESSION: Listbox scrollbar does not reflect actual scrolled position when selected option is added after layout
2569
2570         Test: fast/forms/listbox-scrollbar-incremental-load.html
2571
2572         The scroller position was not updated correctly during insertion, since
2573         scrollbar proportions are updated only during layout
2574
2575         * rendering/RenderListBox.cpp:
2576         (WebCore::RenderListBox::selectionChanged): Delay scrolling to reveal the
2577         selection until after layout if m_optionsChanged is set. Layout is
2578         guaranteed to happen soon when the flag is set.
2579
2580 2007-04-26  David Hyatt  <hyatt@apple.com>
2581
2582         Fix for 13511, crash on a counters page.  Make sure that RenderTexts
2583         never get a null StringImpl.  I would have added an assert that the length
2584         had to be nonzero also, but unfortunately editing creates empty RenderTexts
2585         because of its EditingText DOM subclass that always forces renderers to be
2586         made.  I suppose there is a good reason for this...
2587
2588         Reviewed by aroben
2589
2590         * dom/CharacterData.cpp:
2591         (WebCore::CharacterData::setData):
2592         (WebCore::CharacterData::appendData):
2593         (WebCore::CharacterData::insertData):
2594         (WebCore::CharacterData::deleteData):
2595         (WebCore::CharacterData::replaceData):
2596         * rendering/RenderCounter.cpp:
2597         (WebCore::RenderCounter::RenderCounter):
2598         * rendering/RenderText.cpp:
2599         (WebCore::RenderText::RenderText):
2600         (WebCore::RenderText::trimmedPrefWidths):
2601         (WebCore::RenderText::setTextWithOffset):
2602         (WebCore::RenderText::setTextInternal):
2603         (WebCore::RenderText::setText):
2604
2605 2007-04-26  Alice Liu  <alice.liu@apple.com>
2606
2607         Reviewed by Oliver.
2608
2609         * editing/SelectionController.cpp:
2610         (WebCore::SelectionController::selectAll):
2611         adding null check
2612
2613 2007-04-26  Justin Garcia  <justin.garcia@apple.com>
2614
2615         Reviewed by oliver
2616
2617         <rdar://problem/5120591> 
2618         Crash when creating a link in Leopard wiki server
2619
2620         * editing/CreateLinkCommand.cpp:
2621         (WebCore::CreateLinkCommand::doApply): Use a RefPtr,
2622         setting the anchor's href can destroy it if there is
2623         an ancestor with a subtree modified event listener.
2624
2625 2007-04-26  Mitz Pettel  <mitz@webkit.org>
2626
2627         Reviewed by hyatt
2628
2629         - http://bugs.webkit.org/show_bug.cgi?id=13496
2630           Eliminate repaintObjectsBeforeLayout
2631
2632         No tests added since there is no change to functionality. Several
2633         tests in fast/repaint test repainting of objects that move during layout.
2634
2635         * page/FrameView.cpp:
2636         (WebCore::FrameView::layout):
2637         * rendering/RenderBlock.cpp:
2638         (WebCore::RenderBlock::layoutBlockChildren): Removed an early
2639         setNeedsLayout(false). Resetting the bit here prevents the full repaint
2640         that we rely on when we decide not to repaint children that move.
2641         * rendering/RenderBlock.h:
2642         * rendering/RenderObject.cpp:
2643         * rendering/RenderObject.h:
2644         * rendering/RenderTableSection.cpp:
2645         (WebCore::RenderTableSection::setCellWidths): Replaced the call to
2646         repaintObjectsBeforeLayout() if the cell didn't need layout with
2647         an unconditional repaint(). We don't bother with repainting only the
2648         delta between the old and new widths, since by marking the cell for
2649         layout results in a full repaint with the new width anyway.
2650
2651 2007-04-26  David Hyatt  <hyatt@apple.com>
2652
2653         Fix for 13509.  Don't recur to parent inline flows if they have been
2654         marked as needing layout themselves.
2655
2656         Reviewed by adele
2657
2658         * rendering/RenderFlow.cpp:
2659         (WebCore::RenderFlow::dirtyLinesFromChangedChild):
2660
2661 2007-04-26  Matt Perry  <mpComplete@gmail.com>
2662
2663         Reviewed and landed by Alexey.
2664
2665         http://bugs.webkit.org/show_bug.cgi?id=13495
2666         Crash when referencing an undefined entity in an XHTML document
2667
2668         Test: fast/parser/badentity.xhtml
2669
2670         * dom/XMLTokenizer.cpp:
2671         (WebCore::getEntityHandler): Check for a NULL returned from getXHTMLEntity
2672
2673 2007-04-26  Anders Carlsson  <andersca@apple.com>
2674
2675         Reviewed by Hyatt.
2676
2677         <rdar://problem/4851944>
2678         REGRESSION: With TOT, BMP images can no longer be opened in the browser window
2679         
2680         On Tiger, the MIME type for the com.microsoft.bmp UTI isn't in the registry, so add it manually.
2681         
2682         * platform/MimeTypeRegistry.cpp:
2683         (WebCore::initialiseSupportedImageMIMETypes):
2684
2685 2007-04-26  David Hyatt  <hyatt@apple.com>
2686
2687         Fix for bug 13503, invalidateContainingBlockPrefWidths is 15% of the
2688         nesting PLT.  Avoid O(n^2) behavior by including inlines in the minmax
2689         dirty chain.
2690
2691         Reviewed by kevin
2692
2693         * rendering/RenderBlock.cpp:
2694         (WebCore::RenderBlock::calcInlinePrefWidths):
2695         * rendering/RenderObject.cpp:
2696         (WebCore::RenderObject::setPrefWidthsDirty):
2697         (WebCore::RenderObject::invalidateContainerPrefWidths):
2698         * rendering/RenderObject.h:
2699
2700 2007-04-26  Anders Carlsson  <andersca@apple.com>
2701
2702         Reviewed by Darin.
2703
2704         <rdar://problem/5067925>
2705         Reproducible crash (infinite recursion) with a layout test that submits on unload (13078)
2706         
2707         Ask the document loader whether it's loading the main resource, since there are cases where the frame 
2708         loader's variable isn't updated correctly.
2709         
2710         In the distant future, the frame loader shouldn't have an instance variable but this is the least intrusive fix for now.
2711         
2712         I couldn't come up with a good test case for this since it requires running three tests in a row and scheduleLoad didn't work. Also,
2713         calling submit in the onunload prevents any new tests from loading!
2714         
2715         * loader/FrameLoader.cpp:
2716         (WebCore::FrameLoader::isLoading):
2717
2718 2007-04-26  Anders Carlsson  <andersca@apple.com>
2719
2720         ... and fix the build.
2721         
2722         * loader/FrameLoader.cpp:
2723         (WebCore::FrameLoader::continueAfterNavigationPolicy):
2724
2725 2007-04-26  Anders Carlsson  <andersca@apple.com>
2726
2727         Revert the previous change - activeDocumentLoader never returns the policy document loader.
2728         Instead, add a null check for the policy document loader.
2729         
2730         * loader/FrameLoader.cpp:
2731         (WebCore::FrameLoader::continueAfterNavigationPolicy):
2732
2733 2007-04-26  Anders Carlsson  <andersca@apple.com>
2734
2735         Use the active document loader instead of the policy document loader.
2736         
2737         * loader/FrameLoader.cpp:
2738         (WebCore::FrameLoader::continueAfterNavigationPolicy):
2739
2740 2007-04-26  Anders Carlsson  <andersca@apple.com>
2741
2742         Reviewed by Maciej.
2743
2744         <rdar://problem/5049099> documents no longer have a default base URL
2745
2746         Don't call canHandleRequest if we have valid substitute data and the protocol is "applewebdata".
2747         
2748         * loader/FrameLoader.cpp:
2749         (WebCore::FrameLoader::continueAfterNavigationPolicy):
2750
2751 2007-04-25  Stephanie Lewis <slewis@apple.com>
2752
2753         Reviewed by Darin.
2754
2755         Fix the build for platforms that overload the abs function.        
2756
2757         * dom/ChildNodeList.cpp:
2758         (WebCore::ChildNodeList::item):
2759
2760 2007-04-25  David Hyatt  <hyatt@apple.com>
2761
2762         Fix for bug 13373, make sure to invalidate the pref widths for objects
2763         with percentage padding.
2764
2765         Reviewed by beth
2766
2767         * rendering/RenderBlock.cpp:
2768         (WebCore::RenderBlock::layoutBlockChildren):
2769         (WebCore::RenderBlock::layoutPositionedObjects):
2770         * rendering/bidi.cpp:
2771         (WebCore::RenderBlock::layoutInlineChildren):
2772
2773 2007-04-25  David Harrison  <harrison@apple.com>
2774
2775         Comment change. Correct the header name in the endif comment.
2776         
2777         * editing/FormatBlockCommand.h:
2778         Change InsertListCommand_h to FormatBlockCommand_h.
2779
2780 2007-04-25  Darin Adler  <darin@apple.com>
2781
2782         Reviewed by Hyatt.
2783
2784         * platform/AtomicString.cpp: (WebCore::AtomicString::add):
2785         Removed unnecessary use of strlen to check if a string is empty.
2786
2787 2007-04-25  Mitz Pettel  <mitz@webkit.org>
2788
2789         Build fix.
2790
2791         * rendering/RenderListMarker.h: Undeleted the m_text member.
2792
2793 2007-04-25  David Hyatt  <hyatt@apple.com>
2794
2795         Rearchitect calcPrefWidths.  The calculation is now done lazily only when minPrefWidth
2796         or maxPrefWidth are asked for.  The result of the calculation is cached.
2797
2798         The new invalidation scheme for pref width invalidation follows the
2799         containing block hierarchy and knows to halt at positioned objects, since
2800         they cannot influence the size of their containers.
2801
2802         Reviewed by darin
2803
2804         * css/cssstyleselector.cpp:
2805         (WebCore::CSSStyleSelector::init):
2806         (WebCore::CSSStyleSelector::initForStyleResolve):
2807         * page/FrameView.cpp:
2808         (WebCore::FrameView::layout):
2809         * rendering/RenderApplet.cpp:
2810         (WebCore::RenderApplet::layout):
2811         * rendering/RenderBlock.cpp:
2812         (WebCore::RenderBlock::makeChildrenNonInline):
2813         (WebCore::RenderBlock::removeChild):
2814         (WebCore::RenderBlock::layout):
2815         (WebCore::RenderBlock::layoutBlock):
2816         (WebCore::RenderBlock::calcPrefWidths):
2817         (WebCore::InlineMinMaxIterator::endOfInline):
2818         (WebCore::shouldGrowTableCellForImage):
2819         (WebCore::RenderBlock::calcInlinePrefWidths):
2820         (WebCore::RenderBlock::calcBlockPrefWidths):
2821         * rendering/RenderBlock.h:
2822         * rendering/RenderBox.cpp:
2823         (WebCore::RenderBox::setStyle):
2824         (WebCore::RenderBox::minPrefWidth):
2825         (WebCore::RenderBox::maxPrefWidth):
2826         (WebCore::RenderBox::calcWidth):
2827         (WebCore::RenderBox::calcWidthUsing):
2828         (WebCore::RenderBox::calcAbsoluteHorizontal):
2829         (WebCore::RenderBox::calcAbsoluteHorizontalValues):
2830         * rendering/RenderBox.h:
2831         * rendering/RenderContainer.cpp:
2832         (WebCore::RenderContainer::removeChildNode):
2833         (WebCore::RenderContainer::appendChildNode):
2834         (WebCore::RenderContainer::insertChildNode):
2835         (WebCore::RenderContainer::layout):
2836         * rendering/RenderContainer.h:
2837         (WebCore::RenderContainer::moveChildNode):
2838         * rendering/RenderCounter.cpp:
2839         (WebCore::RenderCounter::dirtyLineBoxes):
2840         (WebCore::RenderCounter::calcPrefWidths):
2841         * rendering/RenderCounter.h:
2842         * rendering/RenderFileUploadControl.cpp:
2843         (WebCore::RenderFileUploadControl::calcPrefWidths):
2844         * rendering/RenderFlexibleBox.cpp:
2845         (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths):
2846         (WebCore::RenderFlexibleBox::calcVerticalPrefWidths):
2847         (WebCore::RenderFlexibleBox::calcPrefWidths):
2848         (WebCore::RenderFlexibleBox::layoutBlock):
2849         * rendering/RenderForeignObject.cpp:
2850         (WebCore::RenderForeignObject::layout):
2851         * rendering/RenderFrameSet.cpp:
2852         (WebCore::RenderFrameSet::layout):
2853         * rendering/RenderHTMLCanvas.cpp:
2854         (WebCore::RenderHTMLCanvas::layout):
2855         * rendering/RenderImage.cpp:
2856         (WebCore::RenderImage::layout):
2857         * rendering/RenderInline.cpp:
2858         * rendering/RenderInline.h:
2859         * rendering/RenderListBox.cpp:
2860         (WebCore::RenderListBox::updateFromElement):
2861         (WebCore::RenderListBox::calcPrefWidths):
2862         * rendering/RenderListItem.cpp:
2863         (WebCore::firstNonMarkerChild):
2864         (WebCore::RenderListItem::updateMarkerLocation):
2865         (WebCore::RenderListItem::calcPrefWidths):
2866         (WebCore::RenderListItem::layout):
2867         * rendering/RenderListMarker.cpp:
2868         (WebCore::RenderListMarker::layout):
2869         (WebCore::RenderListMarker::calcPrefWidths):
2870         (WebCore::RenderListMarker::updateMargins):
2871         * rendering/RenderListMarker.h:
2872         * rendering/RenderObject.cpp:
2873         (WebCore::RenderObject::RenderObject):
2874         (WebCore::RenderObject::removeChildNode):
2875         (WebCore::RenderObject::moveChildNode):
2876         (WebCore::RenderObject::appendChildNode):
2877         (WebCore::RenderObject::insertChildNode):
2878         (WebCore::RenderObject::setPrefWidthsDirty):
2879         (WebCore::RenderObject::invalidateContainingBlockPrefWidths):
2880         (WebCore::RenderObject::information):
2881         (WebCore::RenderObject::setStyle):
2882         * rendering/RenderObject.h:
2883         (WebCore::RenderObject::layer):
2884         (WebCore::RenderObject::hasLayer):
2885         (WebCore::RenderObject::prefWidthsDirty):
2886         (WebCore::RenderObject::setNeedsLayoutAndPrefWidthsRecalc):
2887         (WebCore::RenderObject::setHasLayer):
2888         * rendering/RenderPartObject.cpp:
2889         (WebCore::RenderPartObject::layout):
2890         * rendering/RenderSVGContainer.cpp:
2891         (WebCore::RenderSVGContainer::layout):
2892         * rendering/RenderSVGContainer.h:
2893         * rendering/RenderSVGHiddenContainer.cpp:
2894         * rendering/RenderSVGHiddenContainer.h:
2895         * rendering/RenderSVGText.cpp:
2896         (WebCore::RenderSVGText::layout):
2897         * rendering/RenderTable.cpp:
2898         (WebCore::RenderTable::calcWidth):
2899         (WebCore::RenderTable::layout):
2900         (WebCore::RenderTable::removeChildNode):
2901         * rendering/RenderTable.h:
2902         * rendering/RenderTableRow.cpp:
2903         (WebCore::RenderTableRow::layout):
2904         * rendering/RenderTableSection.cpp:
2905         (WebCore::RenderTableSection::removeChildNode):
2906         * rendering/RenderTableSection.h:
2907         * rendering/RenderText.cpp:
2908         (WebCore::RenderText::trimmedPrefWidths):
2909         (WebCore::isSpaceAccordingToStyle):
2910         (WebCore::RenderText::minPrefWidth):
2911         (WebCore::RenderText::maxPrefWidth):
2912         (WebCore::RenderText::calcPrefWidths):
2913         (WebCore::RenderText::width):
2914         * rendering/RenderText.h:
2915         * rendering/RenderView.cpp:
2916         (WebCore::RenderView::RenderView):
2917         (WebCore::RenderView::calcPrefWidths):
2918         (WebCore::RenderView::layout):
2919         * rendering/RenderWidget.cpp:
2920         (WebCore::RenderWidget::layout):
2921
2922 2007-04-25  Steve Falkenburg  <sfalken@apple.com>
2923
2924         Reviewed by Adam.
2925
2926         Fix spelling error in spelling method name.
2927         Expose new spelling callback methods to all platforms.
2928
2929         * bridge/EditorClient.h:
2930         * platform/gdk/EditorClientGdk.cpp:
2931         (WebCore::EditorClientGdk::updateSpellingUIWithGrammarString):
2932         * platform/gdk/EditorClientGdk.h:
2933         * platform/graphics/svg/SVGImageEmptyClients.h:
2934         (WebCore::SVGEmptyEditorClient::updateSpellingUIWithGrammarString):
2935         (WebCore::SVGEmptyEditorClient::getGuessesForWord):
2936
2937 2007-04-24  Geoffrey Garen  <ggaren@apple.com>
2938
2939         Reviewed by Darin Adler, Tim Hatcher.
2940
2941         Fixed a few NSAutoreleasePool issues I noticed while reviewing Brady's patch.
2942
2943         * platform/graphics/mac/GraphicsContextMac.mm:
2944         (WebCore::GraphicsContext::setCompositeOperation): Call -drain instead of 
2945         -release, since -release is a no-op in a GC world.
2946
2947 2007-04-25  Alexey Proskuryakov  <ap@webkit.org>
2948
2949         Reviewed by Darin.
2950
2951         http://bugs.webkit.org/show_bug.cgi?id=13445
2952         NodeList access by index is slow
2953
2954         * dom/ChildNodeList.cpp:
2955         (WebCore::ChildNodeList::item): Support iterating backwards from the last accessed node
2956         or from the last child.
2957         * dom/NodeList.h: Make cachedLength unsigned.
2958
2959 2007-04-26  Mark Rowe  <mrowe@apple.com>
2960
2961         Gdk build fix.  Add missing stub.
2962
2963         * platform/gdk/TemporaryLinkStubs.cpp:
2964         (Editor::advanceToNextMisspelling):
2965
2966 2007-04-25  Rob Buis  <buis@kde.org>
2967
2968         Reviewed by Darin.
2969
2970         http://bugs.webkit.org/show_bug.cgi?id=12163
2971         SVG text does not appear in a scrolling <div>
2972
2973         Make sure SVG text is painted when scrolling by taking into account the relative offset of the non-SVG parent in the paintInfo rect.
2974
2975         * rendering/RenderSVGContainer.cpp:
2976         (WebCore::RenderSVGContainer::paint):
2977
2978 2007-04-26  Mark Rowe  <mrowe@apple.com>
2979
2980         Fix non-Mac builds after r21081.
2981
2982         Stub out new Editor methods for Qt and Gdk, and new SVGEmptyEditorClient methods
2983         for all non-Mac builds.
2984
2985         * editing/qt/EditorQt.cpp:
2986         (WebCore::Editor::showSpellingGuessPanel):
2987         (WebCore::Editor::spellingPanelIsShowing):
2988         * page/qt/EventHandlerQt.cpp:
2989         (WebCore::EventHandler::passWheelEventToWidget):
2990         (WebCore::EventHandler::passMousePressEventToScrollbar):
2991         * platform/gdk/TemporaryLinkStubs.cpp:
2992         (Editor::showSpellingGuessPanel):
2993         (Editor::spellingPanelIsShowing):
2994         * platform/graphics/svg/SVGImageEmptyClients.h:
2995         (WebCore::SVGEmptyEditorClient::ignoreWordInSpellDocument):
2996         (WebCore::SVGEmptyEditorClient::learnWord):
2997         (WebCore::SVGEmptyEditorClient::checkSpellingOfString):
2998         (WebCore::SVGEmptyEditorClient::checkGrammarOfString):
2999         (WebCore::SVGEmptyEditorClient::udpateSpellingUIWithGrammarString):
3000         (WebCore::SVGEmptyEditorClient::updateSpellingUIWithMisspelledWord):
3001         (WebCore::SVGEmptyEditorClient::showSpellingUI):
3002         (WebCore::SVGEmptyEditorClient::spellingUIIsShowing):
3003         (WebCore::SVGEmptyEditorClient::getGuessesForWord):
3004
3005 2007-04-25  Anders Carlsson  <andersca@apple.com>
3006
3007         Reviewed by Ada.
3008
3009         <rdar://problem/5122153>
3010         Crash occurs at WebCore::Frame::loader() when switching to Bookmarks view while loading standalone image
3011
3012         Don't call writeRawData if the data length is 0. (This is checked by the decoder for the non-raw case).
3013
3014         * loader/FrameLoader.cpp:
3015         (WebCore::FrameLoader::write):
3016
3017 2007-04-26  Mark Rowe  <mrowe@apple.com>
3018
3019         Gdk build fix courtesy of Alp Toker.
3020
3021         * make-generated-sources.sh:  Remove conditional logic to ensure the
3022         script exits with the correct exit code.
3023
3024 2007-04-24  Anders Carlsson  <andersca@apple.com>
3025
3026         Reviewed by Mitz.
3027
3028         <rdar://problem/4869095> 
3029         default content type for XMLHttpRequest POSTs changed (breaks Flickrator 0.1 widget)
3030         
3031         Use the right MIME type.
3032         
3033         * xml/xmlhttprequest.cpp:
3034         (WebCore::XMLHttpRequest::send):
3035
3036 2007-04-24  Darin Adler  <darin@apple.com>
3037
3038         Reviewed by Maciej.
3039
3040         - second round of preparation for Hyatt's "lazy minMaxWidth" change
3041           http://bugs.webkit.org/show_bug.cgi?id=13431
3042
3043         These are small changes that are either safe to do first, or unrelated to the main
3044         change in Hyatt's patch.
3045
3046         - Preallocate 4 entries each in m_layoutStruct and m_spanCells to save allocation
3047           in AutoTableLayout.
3048         - Add an early exit to RenderFlow::dirtyLinesFromChangedChild.
3049         - Change InlineBox::hasTextChildren() to use a bit directly and never a virtual function.
3050         - Save a virtual function call by using a local bool variable for isTableCell().
3051
3052         - Fix containingBlock() so it returns 0 for table cells with no parent.
3053
3054         - Change all callers who are getting at layer() as a boolean to use hasLayer().
3055         - Change if statements to max() function calls (only the ones Hyatt had in his patch).
3056         - Remove some old kdDebug calls.
3057         - Tweak formatting of some code.
3058         - Add const in one place.
3059
3060         * bindings/js/kjs_html.cpp:
3061         (KJS::HTMLElementFunction::callAsFunction):
3062         * page/EventHandler.cpp:
3063         (WebCore::EventHandler::eventMayStartDrag):
3064         * page/Frame.cpp:
3065         (WebCore::Frame::clearTimers):
3066         * rendering/AutoTableLayout.cpp:
3067         (WebCore::AutoTableLayout::recalcColumn):
3068         * rendering/AutoTableLayout.h:
3069         * rendering/InlineBox.h:
3070         (WebCore::InlineBox::InlineBox):
3071         (WebCore::InlineBox::hasTextChildren):
3072         * rendering/InlineFlowBox.cpp:
3073         (WebCore::InlineFlowBox::nodeAtPoint):
3074         * rendering/InlineFlowBox.h:
3075         (WebCore::InlineFlowBox::InlineFlowBox):
3076         * rendering/RenderBlock.cpp:
3077         (WebCore::RenderBlock::layoutBlock):
3078         (WebCore::RenderBlock::repaintOverhangingFloats):
3079         (WebCore::RenderBlock::paintChildren):
3080         (WebCore::RenderBlock::paintFloats):
3081         (WebCore::RenderBlock::fillBlockSelectionGaps):
3082         (WebCore::RenderBlock::insertFloatingObject):
3083         (WebCore::RenderBlock::floatRect):
3084         (WebCore::RenderBlock::lowestPosition):
3085         (WebCore::RenderBlock::rightmostPosition):
3086         (WebCore::RenderBlock::leftmostPosition):
3087         (WebCore::RenderBlock::addOverhangingFloats):
3088         (WebCore::RenderBlock::nodeAtPoint):
3089         (WebCore::RenderBlock::hitTestContents):
3090         (WebCore::RenderBlock::calcPrefWidths):
3091         (WebCore::InlineMinMaxIterator::next):
3092         (WebCore::getBorderPaddingMargin):
3093         (WebCore::RenderBlock::calcInlinePrefWidths):
3094         (WebCore::RenderBlock::calcBlockPrefWidths):
3095         * rendering/RenderContainer.cpp:
3096         (WebCore::RenderContainer::appendChildNode):
3097         (WebCore::RenderContainer::insertChildNode):
3098         * rendering/RenderFlexibleBox.cpp:
3099         (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths):
3100         (WebCore::RenderFlexibleBox::calcVerticalPrefWidths):
3101         * rendering/RenderFlow.cpp:
3102         (WebCore::RenderFlow::dirtyLinesFromChangedChild):
3103         * rendering/RenderLayer.cpp:
3104         (WebCore::RenderLayer::updateVisibilityStatus):
3105         (WebCore::RenderLayer::updateLayerPosition):
3106         * rendering/RenderObject.cpp:
3107         (WebCore::RenderObject::containingBlock):
3108         * rendering/RenderTable.cpp:
3109         (WebCore::RenderTable::paint):
3110         * rendering/RenderTableCell.cpp:
3111         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
3112         * rendering/RenderTableRow.cpp:
3113         (WebCore::RenderTableRow::nodeAtPoint):
3114         (WebCore::RenderTableRow::paint):
3115         * rendering/RenderTableSection.cpp:
3116         (WebCore::RenderTableSection::nodeAtPoint):
3117         * rendering/RenderTreeAsText.cpp:
3118         (WebCore::write):
3119
3120 2007-04-24  Steve Falkenburg  <sfalken@apple.com>
3121
3122         Reviewed by Darin, Oliver.
3123
3124         Refactor spelling codepaths
3125
3126         * bridge/EditorClient.h:
3127         * page/ContextMenuController.cpp:
3128         (WebCore::ContextMenuController::contextMenuItemSelected):
3129         * platform/ContextMenu.cpp:
3130         (WebCore::ContextMenu::populate):
3131         (WebCore::ContextMenu::checkOrEnableIfNeeded):
3132         * platform/gdk/EditorClientGdk.cpp:
3133         (WebCore::EditorClientGdk::ignoreWordInSpellDocument):
3134         (WebCore::EditorClientGdk::learnWord):
3135         (WebCore::EditorClientGdk::checkSpellingOfString):
3136         (WebCore::EditorClientGdk::checkGrammarOfString):
3137         (WebCore::EditorClientGdk::udpateSpellingUIWithGrammarString):
3138         (WebCore::EditorClientGdk::updateSpellingUIWithMisspelledWord):
3139         (WebCore::EditorClientGdk::showSpellingUI):
3140         (WebCore::EditorClientGdk::spellingUIIsShowing):
3141         (WebCore::EditorClientGdk::getGuessesForWord):
3142         * platform/gdk/EditorClientGdk.h:
3143
3144 2007-04-24  Darin Adler  <darin@apple.com>
3145
3146         Reviewed by Adele.
3147
3148         - first round of preparation for Hyatt's "lazy minMaxWidth" change
3149           http://bugs.webkit.org/show_bug.cgi?id=13431
3150
3151         This patch limits itself to renaming and making other super-simple
3152         changes so that the above change will be smaller and easier to review
3153         and understand.
3154
3155         Rename:
3156
3157             calcHorizontalMinMaxWidth -> calcHorizontalPrefWidths
3158             calcMinMaxWidth -> calcPrefWidths
3159             calcMinMaxWidthInternal -> calcPrefWidthsInternal
3160             calcVerticalMinMaxWidth -> calcVerticalPrefWidths
3161             setNeedsLayoutAndMinMaxRecalc -> setNeedsLayoutAndPrefWidthsRecalc
3162             trimmedMinMaxWidth -> trimmedPrefWidths
3163
3164             RenderObject::m_maxWidth -> RenderObject::m_maxPrefWidth
3165             RenderObject::m_minWidth -> RenderObject::m_minPrefWidth
3166             RenderObject::maxWidth() -> RenderObject::maxPrefWidth()
3167             RenderObject::minWidth() -> RenderObject::minPrefWidth()
3168
3169         Replace m_minMaxKnown, minMaxKnown(), and setMinMaxKnown() with
3170         m_prefWidthsDirty, prefWidthsDirty(), and setPrefWidthsDirty(),
3171         a boolean with the opposite sense.
3172
3173         Convert some uses of if statements into "max".
3174
3175         Change many uses of layer() to hasLayer(). For now it's just a boolean
3176         version of layer(), but Hyatt's patch makes it faster by using a bit.
3177
3178         Added a guard to use of axObjectCache() to make RenderObject destruction
3179         a little faster for the normal case.
3180
3181         Removed some assertions that will be removed in Hyatt's patch.
3182
3183         Made some functions const that will be const in Hyatt's patch.
3184
3185         Put in some revised comments from Hyatt's patch.
3186
3187         Removed an unneeded nil check from RenderListMarker::setStyle.
3188
3189         Moved RootInlineBox::setHorizontalOverflowPositions and
3190         RootInlineBox::setVerticalSelectionPositions to the RootInlineBox.h
3191         header and marked them inline.
3192
3193         * dom/Document.cpp:
3194         (WebCore::Document::updateStyleSelector):
3195         * html/HTMLTextAreaElement.cpp:
3196         (WebCore::HTMLTextAreaElement::parseMappedAttribute):
3197         * page/Frame.cpp:
3198         (WebCore::Frame::forceLayoutWithPageWidthRange):
3199         * rendering/AutoTableLayout.cpp:
3200         (WebCore::AutoTableLayout::recalcColumn):
3201         (WebCore::AutoTableLayout::calcPrefWidths):
3202         (WebCore::AutoTableLayout::calcEffectiveWidth):
3203         * rendering/AutoTableLayout.h:
3204         * rendering/CounterNode.cpp:
3205         (WebCore::CounterNode::recount):
3206         * rendering/FixedTableLayout.cpp:
3207         (WebCore::FixedTableLayout::calcPrefWidths):
3208         * rendering/FixedTableLayout.h:
3209         * rendering/InlineFlowBox.cpp:
3210         (WebCore::InlineFlowBox::paint):
3211         * rendering/RenderApplet.cpp:
3212         (WebCore::RenderApplet::layout):
3213         * rendering/RenderBlock.cpp:
3214         (WebCore::RenderBlock::removeChild):
3215         (WebCore::RenderBlock::layoutBlock):
3216         (WebCore::RenderBlock::handleCompactChild):
3217         (WebCore::RenderBlock::getClearDelta):
3218         (WebCore::RenderBlock::calcPrefWidths):
3219         (WebCore::RenderBlock::calcInlinePrefWidths):
3220         (WebCore::RenderBlock::calcBlockPrefWidths):
3221         * rendering/RenderBlock.h:
3222         * rendering/RenderBox.cpp:
3223         (WebCore::RenderBox::RenderBox):
3224         (WebCore::RenderBox::nodeAtPoint):
3225         (WebCore::RenderBox::calcWidth):
3226         (WebCore::RenderBox::calcWidthUsing):
3227         (WebCore::RenderBox::calcAbsoluteHorizontal):
3228         (WebCore::RenderBox::calcAbsoluteHorizontalValues):
3229         * rendering/RenderBox.h:
3230         (WebCore::RenderBox::minPrefWidth):
3231         (WebCore::RenderBox::maxPrefWidth):
3232         * rendering/RenderContainer.cpp:
3233         (WebCore::RenderContainer::removeChildNode):
3234         (WebCore::RenderContainer::appendChildNode):
3235         (WebCore::RenderContainer::insertChildNode):
3236         (WebCore::RenderContainer::layout):
3237         * rendering/RenderContainer.h:
3238         (WebCore::RenderContainer::calcPrefWidths):
3239         * rendering/RenderCounter.cpp:
3240         (WebCore::RenderCounter::calcPrefWidths):
3241         * rendering/RenderCounter.h:
3242         * rendering/RenderFieldset.cpp:
3243         (WebCore::RenderFieldset::calcPrefWidths):
3244         * rendering/RenderFieldset.h:
3245         * rendering/RenderFileUploadControl.cpp:
3246         (WebCore::RenderFileUploadControl::calcPrefWidths):
3247         * rendering/RenderFileUploadControl.h:
3248         * rendering/RenderFlexibleBox.cpp:
3249         (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths):
3250         (WebCore::RenderFlexibleBox::calcVerticalPrefWidths):
3251         (WebCore::RenderFlexibleBox::calcPrefWidths):
3252         (WebCore::RenderFlexibleBox::layoutBlock):
3253         (WebCore::RenderFlexibleBox::allowedChildFlex):
3254         * rendering/RenderFlexibleBox.h:
3255         (WebCore::RenderFlexibleBox::hasMultipleLines):
3256         (WebCore::RenderFlexibleBox::isVertical):
3257         (WebCore::RenderFlexibleBox::isHorizontal):
3258         * rendering/RenderFlow.cpp:
3259         (WebCore::RenderFlow::absoluteClippedOverflowRect):
3260         * rendering/RenderForeignObject.cpp:
3261         (WebCore::RenderForeignObject::layout):
3262         * rendering/RenderFrameSet.cpp:
3263         (WebCore::RenderFrameSet::layout):
3264         * rendering/RenderHTMLCanvas.cpp:
3265         (WebCore::RenderHTMLCanvas::layout):
3266         * rendering/RenderImage.cpp:
3267         (WebCore::RenderImage::imageChanged):
3268         (WebCore::RenderImage::layout):
3269         (WebCore::RenderImage::calcPrefWidths):
3270         * rendering/RenderImage.h:
3271         * rendering/RenderInline.cpp:
3272         (WebCore::RenderInline::addChildToFlow):
3273         (WebCore::RenderInline::splitInlines):
3274         (WebCore::RenderInline::splitFlow):
3275         (WebCore::RenderInline::calcPrefWidths):
3276         * rendering/RenderInline.h:
3277         * rendering/RenderListBox.cpp:
3278         (WebCore::RenderListBox::updateFromElement):
3279         (WebCore::RenderListBox::calcPrefWidths):
3280         * rendering/RenderListBox.h:
3281         * rendering/RenderListItem.cpp:
3282         (WebCore::RenderListItem::updateValue):
3283         (WebCore::RenderListItem::updateMarkerLocation):
3284         (WebCore::RenderListItem::calcPrefWidths):
3285         (WebCore::RenderListItem::layout):
3286         (WebCore::RenderListItem::explicitValueChanged):
3287         * rendering/RenderListItem.h:
3288         * rendering/RenderListMarker.cpp:
3289         (WebCore::RenderListMarker::setStyle):
3290         (WebCore::RenderListMarker::layout):
3291         (WebCore::RenderListMarker::imageChanged):
3292         (WebCore::RenderListMarker::calcPrefWidths):
3293         (WebCore::RenderListMarker::calcWidth):
3294         * rendering/RenderListMarker.h:
3295         * rendering/RenderMenuList.cpp:
3296         (WebCore::RenderMenuList::updateOptionsWidth):
3297         (WebCore::RenderMenuList::calcPrefWidths):
3298         * rendering/RenderMenuList.h:
3299         * rendering/RenderObject.cpp:
3300         (WebCore::RenderObject::RenderObject):
3301         (WebCore::addLayers):
3302         (WebCore::RenderObject::removeLayers):
3303         (WebCore::RenderObject::moveLayers):
3304         (WebCore::RenderObject::addAbsoluteRectForLayer):
3305         (WebCore::RenderObject::checkForRepaintDuringLayout):
3306         (WebCore::RenderObject::dump):
3307         (WebCore::RenderObject::setStyle):
3308         (WebCore::RenderObject::destroy):
3309         (WebCore::RenderObject::recalcMinMaxWidths):
3310         * rendering/RenderObject.h:
3311         (WebCore::RenderObject::hasLayer):
3312         (WebCore::RenderObject::prefWidthsDirty):
3313         (WebCore::RenderObject::setPrefWidthsDirty):
3314         (WebCore::RenderObject::setNeedsLayoutAndPrefWidthsRecalc):
3315         (WebCore::RenderObject::calcPrefWidths):
3316         (WebCore::RenderObject::minPrefWidth):
3317         (WebCore::RenderObject::maxPrefWidth):
3318         * rendering/RenderPart.cpp:
3319         (WebCore::RenderPart::setWidget):
3320         * rendering/RenderPartObject.cpp:
3321         (WebCore::RenderPartObject::updateWidget):
3322         (WebCore::RenderPartObject::layout):
3323         * rendering/RenderReplaced.cpp:
3324         (WebCore::RenderReplaced::calcPrefWidths):
3325         * rendering/RenderReplaced.h:
3326         * rendering/RenderSVGContainer.cpp:
3327         (WebCore::RenderSVGContainer::calcPrefWidths):
3328         (WebCore::RenderSVGContainer::layout):
3329         * rendering/RenderSVGContainer.h:
3330         * rendering/RenderSVGHiddenContainer.cpp:
3331         (WebCore::RenderSVGHiddenContainer::calcPrefWidths):
3332         * rendering/RenderSVGHiddenContainer.h:
3333         * rendering/RenderSVGText.cpp:
3334         (WebCore::RenderSVGText::layout):
3335         * rendering/RenderSlider.cpp:
3336         (WebCore::RenderSlider::calcPrefWidths):
3337         * rendering/RenderSlider.h:
3338         * rendering/RenderTable.cpp:
3339         (WebCore::RenderTable::calcWidth):
3340         (WebCore::RenderTable::layout):
3341         (WebCore::RenderTable::calcPrefWidths):
3342         (WebCore::RenderTable::splitColumn):
3343         (WebCore::RenderTable::appendColumn):
3344         * rendering/RenderTable.h:
3345         * rendering/RenderTableCell.cpp:
3346         (WebCore::RenderTableCell::updateFromElement):
3347         (WebCore::RenderTableCell::styleOrColWidth):
3348         (WebCore::RenderTableCell::calcPrefWidths):
3349         * rendering/RenderTableCell.h:
3350         * rendering/RenderTableCol.cpp:
3351         (WebCore::RenderTableCol::updateFromElement):
3352         * rendering/RenderTableRow.cpp:
3353         (WebCore::RenderTableRow::layout):
3354         * rendering/RenderTableSection.cpp:
3355         (WebCore::RenderTableSection::paint):
3356         * rendering/RenderText.cpp:
3357         (WebCore::RenderText::trimmedPrefWidths):
3358         (WebCore::RenderText::calcPrefWidths):
3359         (WebCore::RenderText::calcPrefWidthsInternal):
3360         (WebCore::RenderText::setText):
3361         * rendering/RenderText.h:
3362         (WebCore::RenderText::minPrefWidth):
3363         (WebCore::RenderText::maxPrefWidth):
3364         * rendering/RenderTextControl.cpp:
3365         (WebCore::RenderTextControl::calcPrefWidths):
3366         * rendering/RenderTextControl.h:
3367         * rendering/RenderView.cpp:
3368         (WebCore::RenderView::RenderView):
3369         (WebCore::RenderView::calcPrefWidths):
3370         (WebCore::RenderView::layout):
3371         * rendering/RenderView.h:
3372         * rendering/RenderWidget.cpp:
3373         (WebCore::RenderWidget::layout):
3374         * rendering/RootInlineBox.cpp:
3375         * rendering/RootInlineBox.h:
3376         (WebCore::RootInlineBox::setHorizontalOverflowPositions):
3377         (WebCore::RootInlineBox::setVerticalSelectionPositions):
3378         * rendering/TableLayout.h:
3379
3380 2007-04-24  Justin Garcia  <justin.garcia@apple.com>
3381
3382         Reviewed by oliver
3383         
3384         <rdar://problem/5156401> 
3385         Crash when dragging text into a link inside a table cell
3386
3387         * editing/CompositeEditCommand.cpp:
3388         (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
3389         Don't avoid the anchor if doing so would skip over a line break, that
3390         would put content in the wrong paragraph, which can throw ReplaceSelectionCommand,
3391         which relies on moveParagraphs into infinite recursion.
3392         Renamed the input position.
3393         Don't need to re-fetch the enclosing anchor when preparing to push it down,
3394         since it hasn't changed since the top of the function.
3395
3396 2007-04-24  Timothy Hatcher  <timothy@apple.com>
3397
3398         Reviewed by Adam.
3399
3400         <rdar://problem/5133011> 64-bit: Attempting to paste copied text in a input field results in a crash at WebCore::Range::startPosition()
3401
3402         Change a couple incorrect uses of LONG_MAX to INT_MAX to match the variable type they are used in.
3403         The LONG_MAX on 64-bit was overflowing the int variables, causing this crash on paste.
3404
3405         * bridge/mac/WebCoreAXObject.mm:
3406         (-[WebCoreAXObject value]):
3407         * editing/TextIterator.cpp:
3408         (WebCore::TextIterator::handleTextNode):
3409         (WebCore::TextIterator::handleTextBox):
3410
3411 2007-04-24  Timothy Hatcher  <timothy@apple.com>
3412
3413         Reviewed by Adam.
3414
3415         <rdar://problem/4966982> 64-bit: In a unordered list, TYPE=DISC and TYPE=CIRCLE attribute values are ignored
3416
3417         We need to draw our full-circle arcs counter-clockwise, since a clockwise arc from 0 to 2Ï\80 is no arc at all!
3418         This only worked on 32-bit due to a rounding error in CoreGraphics, causing it to draw a full circle anyway.
3419
3420         * platform/graphics/cg/GraphicsContextCG.cpp:
3421         (WebCore::GraphicsContext::drawEllipse):
3422
3423 2007-04-24  Brady Eidson  <beidson@apple.com>
3424
3425         Reviewed by Beth, Hyatt, Ada, and Darin
3426
3427         <rdar://problem/5011477> and <rdar://problem/5011514>
3428         Provide support for the icon.db to be moved to a different directory from the old WebKit-style
3429         icons, and remove the old directory if that is the case
3430
3431         Support for this starts in WebCore, where we can use the metadata table in the icon.db to track
3432         whether or not we've ever done the import
3433
3434         * WebCore.exp:
3435         * loader/icon/IconDatabase.cpp:
3436         (WebCore::IconDatabase::defaultDatabaseFilename): Changed to "Icons.db"
3437         (WebCore::IconDatabase::IconDatabase):
3438         (WebCore::IconDatabase::deleteAllPreparedStatements): Delete the new statements added
3439         (WebCore::IconDatabase::imported): Grab this flag from the DB or return the cached flag
3440         (WebCore::IconDatabase::setImported): Store this flag into the DB
3441         (WebCore::IconDatabase::importedQuery): Actually do the DB query for this save
3442         (WebCore::IconDatabase::setImportedQuery): Actually do the DB query for this retrieval
3443         * loader/icon/IconDatabase.h:
3444
3445 2007-04-24  Darin Adler  <darin@apple.com>
3446
3447         Reviewed by Justin.
3448
3449         - fix <rdar://problem/4356361> Selection after multiple delete
3450           keypresses and undo selects only the last deleted character
3451
3452         Test: editing/undo/undo-combined-delete-boundary.html
3453         Test: editing/undo/undo-combined-delete.html
3454         Test: editing/undo/undo-delete-boundary.html
3455         Test: editing/undo/undo-delete.html
3456         Test: editing/undo/undo-forward-delete-boundary.html
3457         Test: editing/undo/undo-forward-delete.html
3458
3459         * editing/TypingCommand.cpp:
3460         (WebCore::TypingCommand::insertText): Fix obviously-wrong code where there were missing
3461         braces. I couldn't find any real symptom of this, but I think the fix should go in anyway.
3462         All layout tests still pass.
3463         (WebCore::TypingCommand::deleteKeyPressed): Added code to compute a selection that goes
3464         back to the beginning of the composite editing operation.
3465         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
3466
3467         * editing/Selection.h:
3468         * editing/Selection.cpp: (WebCore::Selection::setWithoutValidation):
3469         Added. Back door to allow setting the ends of a selection without revalidating,
3470         because we need to use it on a selection where the endpoints may no longer be
3471         valid due to mutations done by earlier pieces of the editing operation.
3472
3473         * editing/EditCommand.h:
3474         (WebCore::EditCommand::startingSelection): Return a const& for speed.
3475         (WebCore::EditCommand::endingSelection): Ditto.
3476
3477 2007-04-24  Sam Weinig  <sam@webkit.org>
3478
3479         Reviewed by Mitz.
3480
3481         - fix for http://bugs.webkit.org/show_bug.cgi?id=13448
3482           REGRESSION: setting an input element's value to JavaScript null gives "null"
3483
3484         Test: fast/forms/input-null.html
3485
3486         * html/HTMLInputElement.idl: Convert JS null to the empty string on setting
3487         DOMString attributes.
3488
3489 2007-04-24  Mitz Pettel  <mitz@webkit.org>
3490
3491         Reviewed by Dave Hyatt.
3492
3493         - fix http://bugs.webkit.org/show_bug.cgi?id=13453
3494           Control clip isn't applied to children's backgrounds, outlines and floats
3495
3496         Test: fast/forms/control-clip.html
3497
3498         * rendering/RenderBlock.cpp:
3499         (WebCore::RenderBlock::paint): Apply the clip in all phases that paint
3500         children. Split PaintPhaseOutline and PaintPhaseChildBlockBackground into
3501         two phases each, applying the clip only to the children.
3502         * rendering/RenderListBox.cpp:
3503         (WebCore::RenderListBox::paintObject): Treat the scrollbar as part of the
3504         background rather than as a child's background, now that children are
3505         clipped out.
3506
3507 2007-04-24  Benjamin Otte  <otte@gnome.org>
3508
3509         Reviewed by Mark Rowe.
3510
3511         Gdk build system improvements.
3512
3513         * make-generated-sources.sh: Exit with failure status if make fails.
3514
3515 2007-04-24  Benjamin Otte  <otte@gnome.org>
3516
3517         Reviewed by Mark Rowe.
3518
3519         Gdk build system improvements.