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