Reviewed by Darin.
[WebKit-https.git] / WebCore / ChangeLog
1 2006-07-27  Rob Buis  <buis@kde.org>
2
3         Reviewed by Darin.
4
5         http://bugzilla.opendarwin.org/show_bug.cgi?id=9938
6         Fix viewBox issues in Hixie's test
7
8         Do a more accurate and quicker job of parsing the viewBox
9         attribute. Handle properly on negative width/height and
10         invalid syntax in general.
11
12         * ksvg2/svg/SVGFitToViewBox.cpp:
13         (SVGFitToViewBox::parseViewBox):
14
15 2006-07-27  Eric Seidel  <eric@eseidel.com>
16
17         Reviewed by ap.
18
19         Enables getSVGDocument() support for HTMLObjectElement and HTMLEmbedElement
20         This patch does not try to autogenerate anything, but enables the SVG functionality.
21         Also fix HTMLObjectElement vspace and hspace to be numbers instead of strings to match IE & Firefox.
22
23         * bindings/js/kjs_dom.cpp:
24         (KJS::toJS):
25         * bindings/js/kjs_html.cpp:
26         (KJS::JSHTMLElement::objectGetter):
27         (KJS::HTMLElementFunction::callAsFunction):
28         (KJS::JSHTMLElement::objectSetter):
29         * bindings/js/kjs_html.h:
30         (KJS::JSHTMLElement::):
31         * dom/Document.h:
32         (WebCore::Document::isSVGDocument):
33         * html/HTMLEmbedElement.cpp:
34         (WebCore::HTMLEmbedElement::contentDocument):
35         (WebCore::HTMLEmbedElement::getSVGDocument):
36         * html/HTMLEmbedElement.h:
37         * html/HTMLObjectElement.cpp:
38         (WebCore::HTMLObjectElement::HTMLObjectElement):
39         (WebCore::HTMLObjectElement::getInstance):
40         (WebCore::HTMLObjectElement::parseMappedAttribute):
41         (WebCore::HTMLObjectElement::contentDocument):
42         (WebCore::HTMLObjectElement::rendererIsNeeded):
43         (WebCore::HTMLObjectElement::createRenderer):
44         (WebCore::HTMLObjectElement::setCode):
45         (WebCore::HTMLObjectElement::setArchive):
46         (WebCore::HTMLObjectElement::setBorder):
47         (WebCore::HTMLObjectElement::setCodeBase):
48         (WebCore::HTMLObjectElement::setCodeType):
49         (WebCore::HTMLObjectElement::setData):
50         (WebCore::HTMLObjectElement::hspace):
51         (WebCore::HTMLObjectElement::setHspace):
52         (WebCore::HTMLObjectElement::setStandby):
53         (WebCore::HTMLObjectElement::setType):
54         (WebCore::HTMLObjectElement::setUseMap):
55         (WebCore::HTMLObjectElement::vspace):
56         (WebCore::HTMLObjectElement::setVspace):
57         (WebCore::HTMLObjectElement::getSVGDocument):
58         * html/HTMLObjectElement.h:
59         * ksvg2/svg/SVGDocument.h:
60         (WebCore::SVGDocument::isSVGDocument):
61         * rendering/RenderWidget.h:
62         (WebCore::RenderWidget::frameView):
63
64 2006-07-26  Alexey Proskuryakov  <ap@nypop.com>
65
66         Reviewed by Darin.
67
68         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9901
69         XSLTProcessor cannot parse text nodes for INPUT ELEMENTS in an XSLT stylesheet
70
71         Test: fast/js/xhtml-serialize.html
72
73         * editing/markup.cpp:
74         (WebCore::endMarkup): If the element has child nodes, write a closing tag even if it 
75         is not permitted in HTML, to make it valid XML.
76
77 2006-07-26  Alice Liu  <alice.liu@apple.com>
78
79         Reviewed by John Sullivan (and Kevin and Timo).
80
81         landing this patch for John et al.  
82         Fixed <rdar://problem/4651380> REGRESSION (9A232->9A234): existing web clips don't render if you restart Dashboard
83
84         * page/FrameView.cpp:
85         (WebCore::FrameView::layout):
86         moved the call to didFirstLayout to above the check for needsLayout
87         because we need to call didFirstLayout for every webview, not just
88         ones we think need layout.  
89
90 2006-07-26  Justin Garcia  <justin.garcia@apple.com>
91
92         Reviewed by darin
93         
94         <rdar://problem/4652788>
95         REGRESSION: Can't change size or style of any text in message body
96
97         * dom/Node.cpp:
98         (WebCore::Node::isContentRichlyEditable): Mimic Node::isContentEditable.
99         * html/HTMLElement.cpp:
100         (WebCore::HTMLElement::isContentRichlyEditable): First check
101         the frame for editability, then userModify, like what
102         HTMLElement::isContentEditable() does.
103         * html/HTMLElement.h:
104
105 2006-07-26  Mitz Pettel  <opendarwin.org@mitzpettel.com>
106
107         Reviewed by ap.
108
109         - fix debug-only information() string for table cells
110
111         * rendering/RenderObject.cpp:
112         (WebCore::RenderObject::information):
113
114 2006-07-25  David Harrison  <harrison@apple.com>
115
116         Reviewed by timo and Darin.
117
118         <rdar://problem/4618584> "Paste and Match Style" is not working in Mail (add SPI)
119         
120         * WebCore.xcodeproj/project.pbxproj:
121         * bridge/mac/WebCoreFrameBridge.h:
122         * bridge/mac/WebCoreFrameBridge.mm:
123         (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
124         Add matchStyle parameter for use by WebKit.
125
126 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
127
128         Reviewed by adele
129         
130         <rdar://problem/4649560>
131         REGRESSION: Can't Select All when the body is contentEditable="true"
132
133         * editing/VisiblePosition.cpp:
134         (WebCore::VisiblePosition::canonicalPosition): Allow descent from a non-editable html
135         element into an editable body as a convenience.
136
137 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
138
139         Reviewed by darin
140         
141         <rdar://problem/4468458> Incoming HTML message is editable <body contenteditable="true">
142
143         * dom/Document.cpp:
144         (WebCore::Document::inDesignMode): Removed some spaces.
145         * page/Frame.cpp:
146         (WebCore::Frame::applyEditingStyleToElement): Just add CSS properties needed for editing.
147         (WebCore::Frame::removeEditingStyleFromElement): Made this a no-op, we'll remove
148         it eventually.
149
150 2006-07-25  David Kilzer  <ddkilzer@kilzer.net>
151
152         Reviewed by Darin.
153
154         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9717
155           Replace IDL ConvertUndefinedToTrue parameter attribute with Optional attribute
156
157         No test added because there is no change in functionality.
158
159         * bindings/js/kjs_binding.cpp: Removed valueToBooleanTreatUndefinedAsTrue() method.
160         * bindings/js/kjs_binding.h: Ditto.
161         * bindings/scripts/CodeGeneratorJS.pm: Removed support for ConvertUndefinedToTrue parameter attribute.
162         * dom/Element.h: Set default value to true for scrollIntoView() and scrollIntoViewIfNeeded() arguments.
163         * dom/Element.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
164           Fixed name of scrollIntoViewIfNeeded() argument to match implementation.
165         * page/DOMWindow.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
166
167 2006-07-24  Dan Waylonis  <waylonis@google.com>
168
169         Reviewed and tweaked a bunch by Darin.
170
171         Test: plugins/bindings-test.html
172
173         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9902
174           jsNull and NSNull not properly converted between JS and ObjC
175
176         * bindings/objc/WebScriptObject.mm:
177         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
178         Added case that converts jsNull to NSNull.
179
180 2006-07-24  Darin Adler  <darin@apple.com>
181
182         Reviewed by Adele and Justin.
183
184         - fix <rdar://problem/4613616> REGRESSION: some spaces typed in <textarea> are posted as non-breaking spaces (9630)
185           http://bugzilla.opendarwin.org/show_bug.cgi?id=9630
186         - also fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=9939
187           REGRESSION: Pasting text into native text area with newline at end does not preserve newline
188         - removed some uses of DeprecatedPtrList in the markup code
189
190         Test: fast/forms/textarea-type-spaces.html
191         Test: fast/forms/textarea-paste-newline.html
192
193         * bindings/objc/DOMHTML.mm: (-[DOMHTMLDocument createDocumentFragmentWithText:]):
194         Updated call to pass a range -- in this case it is the range of the entire document,
195         so this will not handle the whitespace properly.
196
197         * bridge/mac/WebCoreFrameBridge.h: Added range context parameter to the
198         documentFragmentWithText: method, so we can handle whitespace properly.
199         * bridge/mac/WebCoreFrameBridge.mm:
200         (-[WebCoreFrameBridge nodesFromList:]): Changed from DeprecatedPtrList to Vector.
201         (-[WebCoreFrameBridge markupStringFromNode:nodes:]): Ditto.
202         (-[WebCoreFrameBridge markupStringFromRange:nodes:]): Ditto.
203         (-[WebCoreFrameBridge documentFragmentWithText:inContext:]): Added range context
204         parameter -- pass it on to createFragmentFromText.
205         (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]): Changed from
206         DeprecatedPtrList to Vector.
207         (-[WebCoreFrameBridge replaceSelectionWithText:selectReplacement:smartReplace:]):
208         Pass the range of the current selection as context when creating the fragment.
209
210         * dom/Position.cpp: (WebCore::Position::inRenderedText): Replace range check with
211         a call to the new containsCaretOffset function -- helps make the caret work right when
212         it is past the end of the last line in a textarea.
213
214         * editing/CompositeEditCommand.cpp:
215         (WebCore::CompositeEditCommand::rebalanceWhitespaceAt): Don't do anything if the
216         style does not call for collapsing whitespace.
217         (WebCore::CompositeEditCommand::rebalanceWhitespace): Call replaceWhitespaceAt
218         to share code, including the new logic mentioned above.
219
220         * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply):
221         Use a text node instead of a break element when inserting and the style is preserveNewline.
222
223         * editing/JSEditor.cpp: (WebCore::execRemoveFormat): Pass the selection range
224         to createFragmentFromText.
225
226         * editing/RebalanceWhitespaceCommand.cpp: (WebCore::RebalanceWhitespaceCommand::doApply):
227         Assert that we're in a style that collapses whitespace. It's the caller's responsibility
228         not to call otherwise.
229
230         * editing/ReplaceSelectionCommand.h: Removed unused destructor, type, isSingleTextNode,
231         isTreeFragment, m_type, and added a context parameter to inertFragmentForTestRendering.
232         Also changed the constructor to take a selection rather than a pointer to the root
233         editable element, replaced removeEndBRIfNeeded with shouldRemoveEndBR and removed an
234         unused parameter from shouldMergeEnd.
235         * editing/ReplaceSelectionCommand.cpp:
236         (WebCore::ReplacementFragment::ReplacementFragment): Removed code to set up m_type.
237         Compute root editable element from passed-in selection. Used the start of the selection
238         as a base node for style purposes for the test rendering. Removed the special case
239         "single text node" alternative to createFragmentFromText in the plain text case, since
240         createFragmentFromText now handles that correctly.
241         (WebCore::ReplacementFragment::insertFragmentForTestRendering): Copy the whitespace
242         property from the source location when creating a temporary element for test rendering.
243         (WebCore::ReplacementFragment::shouldMergeEnd): Removed unneeded boolean
244         parameter fragmentHadInterchangeNewlineAtEnd, which is always false.
245         (WebCore::ReplaceSelectionCommand::doApply): Update for ReplacementFragment changes,
246         change code to not remove end BR when it can be re-used instead, don't call the
247         paragraph separator insertion when the position is at the start of a paragraph already,
248         removed redundant computation of identical "next" value, removed unneeded boolean
249         parameter to shouldMergeEnd, add case for merging when all we need to do is to delete
250         a newline character, removed unneeded code to set insertionPos after all code that uses
251         it, and  use spaces instead of non-breaking spaces when doing smart paste if the
252         context is one where we do not collapse white space.
253         (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): Renamed and changed to return
254         a boolean instead of doing the removal.
255
256         * editing/markup.h: Use Vector instead of DeprecatedPtrList. Change the
257         createFragmentFromText function to take a range for context instead of a document.
258         * editing/markup.cpp:
259         (WebCore::markup): Use Vector instead of DeprecatedPtrList.
260         (WebCore::createMarkup): Ditto.
261         (WebCore::createParagraphContentsFromString): Remove unneeded document parameter
262         and changed a couple places to use isEmpty instead of comparing with "".
263         (WebCore::createFragmentFromText): Given the new context parameter, if the context
264         is one that preserves newlines, then use "\n" instead of <br> elements.
265         (WebCore::createFragmentFromNodes): Use Vector instead of DeprecatedPtrList.
266
267         * html/HTMLElement.cpp: (WebCore::HTMLElement::setInnerText): Do not use <br>
268         elements if the context of this node is one where we preserve newlines.
269
270         * rendering/InlineTextBox.h:
271         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::containsCaretOffset):
272         Added. Implements the appropriate rule for determining if a caret position is
273         in this line or not. Returns true for both one line and the next in cases where
274         affinity must be considered to determine which line the caret is on.
275
276         * rendering/RenderText.h: Make atLineWrap no longer be a member function.
277         * rendering/RenderText.cpp:
278         (WebCore::atLineWrap): Remove special rule about preserveNewline and isLineBreak,
279         which will no longer apply due to the new containsCaretOffset function logic.
280         (WebCore::RenderText::caretRect): Use containsCaretOffset.
281         (WebCore::RenderText::inlineBox): Ditto.
282
283         * rendering/RenderTextControl.cpp:
284         (WebCore::RenderTextControl::updateFromElement): Make a placeholder <br> element
285         after calling setInnerText so that the last newline in the string has the effect
286         we expect outside the HTML world (an additional line).
287         (WebCore::RenderTextControl::setSelectionRange): Set granularity of the selection
288         too. The layout tests caught this problem, which needs a better solution long term.
289         (WebCore::RenderTextControl::text): Call textContent with the parameter false
290         so it will not include newlines for <br> elements. Now the only <br> element
291         that will ever be in the shadow DOM tree is the one to prevent collapsing, and
292         that one should not show up in the text value.
293
294         * rendering/bidi.cpp: (WebCore::RenderBlock::findNextLineBreak): Took a rule
295         that specifically called out the pre whitespace mode and made it work for all
296         the modes that preserve newlines. This makes sure we get a last line box for
297         text after the last "\n" even in cases where there is no <br> afterward.
298
299         * editing/DeleteSelectionCommand.cpp:
300         (WebCore::DeleteSelectionCommand::fixupWhitespace):
301         * editing/InsertParagraphSeparatorCommand.cpp:
302         (WebCore::InsertParagraphSeparatorCommand::doApply):
303         Added assertions to make sure we don't do anything when we're not collapsing
304         whitespace.
305
306         * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::setDefaultValue):
307         Changed to use Vector instead of DeprecatedPtrList.
308
309         * editing/HTMLInterchange.cpp: Removed obsolete comment.
310
311         * loader/Cache.h: Removed a stray include.
312
313 2006-07-24  Adele Peterson  <adele@apple.com>
314
315         Reviewed by Justin.
316
317         - Fix for <rdar://problem/4632132> Changing style of content with mixed editability fails
318
319         Test: * editing/style/apple-style-editable-mix.html
320
321         * dom/Node.cpp: (WebCore::Node::isContentRichlyEditable): Doesn't need to check the editable root.  It now just
322           checks the user modify property of its own renderer, since that is inherited.
323         * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyInlineStyle): If the end position is in a table,
324         Adjust the end node to the last descendant of the table, so we don't skip over any runs.
325
326 2006-07-24  Darin Adler  <darin@apple.com>
327
328         Reviewed by Hyatt.
329
330         - implement String::createCFString
331
332         * WebCore.xcodeproj/project.pbxproj: Added StringImplMac.mm and StringMac.mm.
333
334         * bindings/objc/DOMInternal.mm: Moved NSString conversion functions out of here.
335
336         * platform/mac/StringImplMac.mm: Added. Moved NSString conversion members here
337         and added the CFStringRef ones.
338         * platform/mac/StringMac.mm: Added. Ditto.
339
340 2006-07-24  David Hyatt  <hyatt@apple.com>
341
342         Two bug fixes.
343
344         (1) Make sure to mark positioned objects that depend on line position to
345         mark themselves as needing layout when their line box placeholder gets
346         repositioned.
347
348         * rendering/RenderBox.cpp:
349         (WebCore::RenderBox::position):
350        
351         (2) Improve highlighting to factor the inflation into overflow so that
352         invalidation and repainting will work properly.
353
354         * rendering/RootInlineBox.cpp:
355         (WebCore::RootInlineBox::addHighlightOverflow):
356         * rendering/RootInlineBox.h:
357         * rendering/bidi.cpp:
358         (WebCore::RenderBlock::layoutInlineChildren):
359
360 2006-07-24  Anders Carlsson  <acarlsson@apple.com>
361
362         Reviewed by Adele.
363
364         <rdar://problem/4641824> REGRESSION: Wikipedia widget fails to complete a search after pressing return key
365         
366         * html/HTMLInputElement.cpp:
367         (WebCore::HTMLInputElement::defaultEventHandler):
368         Don't eat enter events for search fields that have no enclosing form; they need to be passed to AppKit so
369         that onsearch can be invoked.
370         
371         * manual-tests/onsearch-enter.html: Added.
372
373 2006-07-24  Dave MacLachlan  <dmaclach@mac.com>
374
375         Reviewed by Darin and Alexey.
376         
377         Fix for: <http://bugzilla.opendarwin.org/show_bug.cgi?id=8425> 
378         and <http://bugzilla.opendarwin.org/show_bug.cgi?id=6947>
379
380         Test: svg/custom/non-opaque-filters.svg
381
382         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
383         (WebCore::KCanvasFilterQuartz::prepareFilter):
384         We create an autorelease pool so we can control the deallocation of the
385         CIContext that we're creating. The CIContext retains the CGContext that 
386         you pass it internally so when the CIContext is released, the 
387         CGContext is released as well.
388         This is all fine and dandy unless you wrap the creation of the CIFilter
389         with a pair of CGBegin/EndTransparencyLayer calls which swap the context
390         out from underneath you. So if you start with context A, 
391         CGBeginTransparencyLayer swaps it out and gives you B. You create a CIFilter
392         with it and add a reference to B. CGEndTransparencyLayer swaps out B and
393         gives you back A. Autorelease pool comes and cleans up the Filter, and calls
394         release on A, but A never got the refcount in the first place. B did. BOOM!
395         So we create a pool, then do a retain, then release the pool so that we 
396         don't have to worry about the pool releasing it at a later time.
397         See <rdar://problem/4647735> for reduction of CGEndTransparencyLayer case
398
399 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
400
401         Reviewed by Hyatt.
402
403         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9669
404           Incomplete repaint when changing an inline's border
405
406         Test: fast/repaint/line-overflow.html
407
408         * rendering/RenderBlock.h:
409         * rendering/bidi.cpp:
410         (WebCore::RenderBlock::layoutInlineChildren): Added repaintTop and repaintBottom
411         variables to track the vertical edges of the area that changed, accounting for
412         lines that were deleted, inserted or moved. Removed unnecessary updating of
413         m_overflowHeight.
414         (WebCore::RenderBlock::determineStartPosition): Removed unnecessary updating of
415         m_overflowHeight.
416         (WebCore::RenderBlock::determineEndPosition):
417         (WebCore::RenderBlock::matchedEndLine): Added repaintTop and repaintBottom
418         arguments, which this method updates to account for deleted lines.
419         (WebCore::RenderBlock::checkLinesForOverflow): Removed outdated FIXME.
420
421 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
422
423         Reviewed by Darin.
424
425         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10075
426           REGRESSION: Reversed pop-up text in visually-ordered Hebrew pages
427
428         Test: fast/forms/select-visual-hebrew.html
429
430         * css/html4.css: Set "-webkit-rtl-ordering: logical" on select elements.
431
432 2006-07-24  Alexey Proskuryakov  <ap@nypop.com>
433
434         Reviewed by Darin.
435
436         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10009
437         REGRESSION: Schubert-IT PDF Plug-in not working for full page (works in frames)
438
439         * page/Frame.cpp:
440         (WebCore::Frame::begin): Give PDF plugins a chance to handle frame content, before ImageDocument
441         claims it.
442
443 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
444
445         Reviewed by Darin.
446
447         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10083
448           REGRESSION (r15584): editing/selection/select-from-textfield-outwards failing
449
450         * rendering/RenderBlock.cpp:
451         (WebCore::RenderBlock::positionForCoordinates): Added back change from the fix
452         for bug 9312: For coordinates outside a replaced object, return the position
453         just before (after) the element if the coordinates are above or to the left (below
454         or to the right).
455
456 2006-07-23  Mark Rowe  <opendarwin.org@bdash.net.nz>
457
458         Reviewed by maciej.
459
460         Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
461         http://bugzilla.opendarwin.org/show_bug.cgi?id=9686
462
463         WebCore portion of the fix.
464
465         * bridge/mac/WebCoreScriptDebugger.h:
466         (-[WebScriptDebugger exceptionRaised:sourceId:line::]): Add delegate method.
467         * bridge/mac/WebCoreScriptDebugger.mm:
468         (WebCoreScriptDebuggerImp::exception): Call delegate method when an exception is raised.
469
470 2006-07-23  Alice Liu  <alice.liu@apple.com>
471
472         Reviewed by Adele.
473         Actually Adele figured out how to fix the layout test failures.  Landing this patch for her.  Layout test failures exposed but not caused by  r15584 (my patch earlier today).
474
475         * editing/visible_units.cpp:
476         (WebCore::previousLinePosition):
477         When setting selection endpoints, don't traverse down into nodes where editing would ignore its contents. Use the parent node instead.  
478         (WebCore::nextLinePosition):
479         same as above
480
481 2006-07-23  David Harrison  <harrison@apple.com>
482
483         Reviewed by timo.
484
485         <rdar://problem/4646759> Mail crash editing To Do - WebCore::InsertTextCommand::prepareForTextInsertion
486         
487         * Test: editing/deleting/delete-mixed-editable-content-001.html
488
489         * editing/visible_units.cpp:
490         (WebCore::startOfParagraph):
491         Respect editable boundary the same way endOfParagraph does.
492
493 2006-07-23  Beth Dakin  <bdakin@apple.com>
494
495         Reviewed by Maciej. (Patch by me, Maciej, and Harrison.)
496
497         Fix for <rdar://problem/4529398> WebCore crashes when pasting rich 
498         text - WebCore::InlineBox::root()
499
500         The initial rendering crash was due to a render object having a 
501         stale reference to an inline box that had already been deleted and 
502         then recreated in the exact same location in memory. (Crazy, I 
503         know.) The situation seemed pretty specific to list markers 
504         according to Hyatt according to Maciej, so that is what I patched 
505         specifically. Fixing this crash unearthed a separate editing crash 
506         where we were trying to insert a block into itself. I worked on 
507         that with Maciej and Harrison, and Harrison came up with a fix.
508
509         * editing/CompositeEditCommand.cpp:
510         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): This is the fix for the editing crash. If paragraphStart is an atomic 
511         node, insert the new block into the parent instead.
512         * rendering/InlineBox.cpp:
513         (WebCore::InlineBox::isChildOfParent): This function is for 
514         posterity. It will help keep the linebox tree in check.
515         * rendering/InlineBox.h:
516         * rendering/InlineFlowBox.cpp:
517         (WebCore::InlineFlowBox::addToLine): Added assert.
518         (WebCore::InlineFlowBox::deleteLine): Added assert.
519         * rendering/ListMarkerBox.cpp:
520         (WebCore::ListMarkerBox::destroy): If this has a parent, call 
521         removeChild on this.
522         (WebCore::ListMarkerBox::operator delete):
523         * rendering/ListMarkerBox.h:
524
525 2006-07-23  Alice Liu  <alice.liu@apple.com>
526
527         Reviewed by Darin.
528
529         fixed <rdar://problem/4617841> REGRESSION (NativeTextField): You can move keyboard focus to a field without getting insertion point
530
531         * rendering/RenderBlock.cpp:
532         (WebCore::RenderBlock::positionForCoordinates):
533         removed some unnecessary vertical position checks and added a fudge factor to be more forgiving for clicks near lines.
534         * rendering/RenderTextControl.cpp:
535         (WebCore::RenderTextControl::nodeAtPoint):
536         added implementation
537         * rendering/RenderTextControl.h:
538         added function protocol
539
540 2006-07-23  Adele Peterson  <adele@apple.com>
541
542         Reviewed by Darin.
543
544         Updating fix from last checkin.
545
546         * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutVerticalBox):
547         Only tell the view about this flexbox if there isn't another flexbox already cached.
548
549 2006-07-23  Adele Peterson  <adele@apple.com>
550
551         Reviewed by Maciej.
552
553         - Fix for <rdar://problem/4644614> REGRESSION: Typing, pasting or dragging in new text areas causes unnecessary scrolling
554
555         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutBlock): Don't updateScrollInfoAfterLayout if an ancestor flexible box is just on
556         its first layout.
557         * rendering/RenderFlexibleBox.cpp:
558         (WebCore::RenderFlexibleBox::layoutBlock): ditto.
559         (WebCore::RenderFlexibleBox::layoutVerticalBox): Let the view know if this flex box is doing its first pass at layout.
560
561         * rendering/RenderView.cpp: (WebCore::RenderView::RenderView): Caches a flexible box that's doing its first layout.
562         * rendering/RenderView.h:
563         (WebCore::RenderView::setFlexBoxInFirstLayout):
564         (WebCore::RenderView::flexBoxInFirstLayout):
565
566 2006-07-22  Alexey Proskuryakov  <ap@nypop.com>
567
568         Reviewed by Darin.
569
570         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10038
571         REGRESSION: Length of navigator.mimeTypes collection returns number of installed plugins, not number 
572         of registered mime types
573
574         * bindings/js/kjs_navigator.cpp:
575         (KJS::MimeTypes::getValueProperty): Return the length of the mime types vector, not the plugins one.
576         (KJS::MimeTypes::getOwnPropertySlot): Fixed another typo, which prevented MimeTypes::getValueProperty()
577         from even being called.
578
579 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
580
581         Reviewed by Adele and Tim Omernick.
582
583         <rdar://problem/4641004> 9A224: Safari crashes in WebCore::RenderMenuList::showPopup when changing a input select field to input text field
584
585         Couldn't figure out how to make layout test, here's a manual test:
586         * manual-tests/remove-select-onchange.html: Added.
587         
588         * rendering/RenderMenuList.cpp:
589         (WebCore::RenderMenuList::showPopup): Don't add the RenderPopupMenu to the render
590         tree so it doesn't get destroyed if we do.
591         
592         The remaining changes are to let the RenderPopupMenu know its menu list w/o having
593         to be in the render tree:
594         
595         * rendering/RenderPopupMenu.cpp:
596         (WebCore::RenderPopupMenu::RenderPopupMenu):
597         * rendering/RenderPopupMenu.h:
598         (WebCore::RenderPopupMenu::menuList):
599         * rendering/RenderPopupMenuMac.h:
600         * rendering/RenderPopupMenuMac.mm:
601         (WebCore::RenderPopupMenuMac::RenderPopupMenuMac):
602         * rendering/RenderPopupMenuWin.h:
603         (WebCore::RenderPopupMenuWin::RenderPopupMenuWin):
604         * rendering/RenderTheme.h:
605         * rendering/RenderThemeMac.h:
606         * rendering/RenderThemeMac.mm:
607         (WebCore::RenderThemeMac::createPopupMenu):
608         * rendering/RenderThemeWin.cpp:
609         (WebCore::RenderThemeWin::createPopupMenu):
610         * rendering/RenderThemeWin.h:
611
612 2006-07-21  Adele Peterson  <adele@apple.com>
613
614         Reviewed by Darin.
615
616         Fix for: <rdar://problem/4643238> REGRESSION: Can't set insertion point at the end of a line of text
617
618         Test: fast/forms/textarea-scrolled-endline-caret.html
619
620         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
621         When looking for the closest line box, take the scroll offset into account.
622
623 2006-07-21  Tim Omernick  <timo@apple.com>
624
625         Reviewed by Geoff & Maciej.
626
627         <rdar://problem/4632505> REGRESSION: Crash at WebCore::Widget::getView() const + 6
628
629         Geoff is working on a layout test for this.
630
631         * bridge/mac/FrameMac.mm:
632         (WebCore::FrameMac::focusWindow):
633         (WebCore::FrameMac::unfocusWindow):
634         Check for a NULL view.  The view can be NULL if the frame has not yet loaded any data.  This fixes the crash, but the behavior is still
635         wrong -- we should focus the frame once it gets a view.  I've filed <rdar://problem/4645685> to track that.  It's not as urgent as this
636         crasher.
637         
638 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
639
640         Reviewed by Darin.
641
642         <rdar://problem/4523976> REGRESSION (NativeTextField): Crash occurs when choosing "Undo Typing" after typing and setting the value
643
644         * rendering/RenderTextControl.cpp:
645         (WebCore::RenderTextControl::updateFromElement): Clear the undo
646         chain when the text control contents have been set
647         programmatically.
648         * bridge/mac/FrameMac.mm:
649         (WebCore::FrameMac::clearUndoRedoOperations): Before clearing undo
650         stack, close all open undo groups and then open an equal number,
651         since otherwise NSUndoManager ends up in an inconsistent state
652         leading to uncaught ObjC exceptions.
653
654 2006-07-21  Beth Dakin  <bdakin@apple.com>
655         
656         Reviewed by Darin.
657
658         Just moving this assertion down a couple of lines. It was hitting 
659         every time you try to print a page because we put it too early in 
660         the function.
661
662         * bridge/mac/WebCoreFrameBridge.mm:
663         (-[WebCoreFrameBridge drawRect:]):
664
665 2006-07-21  Justin Garcia  <justin.garcia@apple.com>
666
667         Reviewed by levi
668         
669         <rdar://problem/4548238>
670         REGRESSION: Can't remove the first OL/UL list item in a Mail's compose window
671
672         * editing/CompositeEditCommand.cpp:
673         (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): 
674         Moved from InsertParagraphSeparator.  Does its own typing style restoration.
675         * editing/CompositeEditCommand.h:
676         * editing/InsertParagraphSeparatorCommand.cpp:
677         (WebCore::InsertParagraphSeparatorCommand::doApply): Call breakOutOfEmptyListItem.
678         * editing/TypingCommand.cpp:
679         (WebCore::TypingCommand::deleteKeyPressed): Call breakOutOfEmptyListItem if
680         the endingSelection is at the start of an editable region.
681         * editing/htmlediting.cpp:
682         (WebCore::embeddedSublist): Moved from InsertParagraphSeparator.
683         (WebCore::appendedSublist): Ditto.
684         (WebCore::enclosingEmptyListItem): Ditto.
685         * editing/htmlediting.h:
686
687 === Safari-521.20 ===
688
689 2006-07-21  Tim Omernick  <timo@apple.com>
690
691         Reviewed by Beth Dakin & John Sullivan.
692
693         <rdar://problem/4633717> 9A218: Reproducible crash in -[NSScroller mouseDown:]
694
695         Beth is in the middle of making a layout test for this; she will land it soon.
696
697         * platform/mac/ScrollBarMac.mm:
698         (ScrollBar::~ScrollBar):
699         Call Widget::removeFromSuperview() rather than -removeFromSuperview directly on the scroll bar view.
700         Widget::removeFromSuperview() obeys the "mustStayInWindow" flag, which is set while tracking the mouse
701         in view-based widgets to prevent their destruction while the tracking is in progress.
702         I searched around WebCore and this is the only Widget subclass that directly removes its view rather
703         than using removeFromSuperview().
704
705 2006-07-21  Mitz Pettel  <opendarwin.org@mitzpettel.com>
706
707         Reviewed by Darin.
708
709         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9312
710           REGRESSION: Selection bug in new text fields when selecting past the first letter
711
712         Test: editing/selection/select-from-textfield-outwards.html
713
714         * editing/Selection.cpp:
715         (WebCore::Selection::adjustForEditableContent): Added code to handle the case
716         where the selection starts (resp. ends) in the last (resp. first) visual position
717         inside an editable root.
718         * editing/htmlediting.cpp:
719         (WebCore::comparePositions): Fixed the case of comparing a position inside a shadow
720         tree with a position in the shadow ancestor.
721         * rendering/RenderBlock.cpp:
722         (WebCore::RenderBlock::positionForCoordinates): For coordinates outside a replaced
723         object, return the position just before (after) the element if the coordinates are above or
724         to the left (below or to the right).
725         * rendering/RenderObject.cpp:
726         (WebCore::RenderObject::caretMaxOffset): Changed to return 1 for replaced objects.
727         * rendering/RenderText.cpp:
728         (WebCore::RenderText::positionForCoordinates): Changed to return the last position
729         in the lowest text box if the y coordinate is below all text boxes.
730
731 2006-07-21  Geoffrey Garen  <ggaren@apple.com>
732
733         Reviewed by Darin.
734         
735         - Fixed <rdar://problem/4507265> REGRESSION: overlays don't work on 
736         HousingMaps.com (Google Maps-based site)
737         
738         - Made style.filter undetectable, like document.all.
739         
740         Unfortunately, the SVG spec-makers invented a CSS attribute named 'filter',
741         which conflicts with IE's custom CSS attribute by the same name. Web programs 
742         like the Google maps API test for style.filter, and assume it's the IE 
743         style.filter if they find it, so we need to make style.filter undetectable 
744         to avoid breaking them.
745         
746         An alternative solution would be to hotwire a delorean, go back in time,
747         and beg the web standards makers to make standards that work on the web.
748
749         * bindings/js/kjs_css.cpp:
750         (KJS::DOMCSSStyleDeclaration::cssPropertyGetter):
751
752 2006-07-20  Justin Garcia  <justin.garcia@apple.com>
753
754         Reviewed by john
755         
756         <rdar://problem/4641033>
757         REGRESSION: Pasting from web pages into Mail (or Blot) often loses most of the content
758         
759         * editing/markup.cpp:
760         (WebCore::createMarkup): We surround the currently accumulated markup with markup 
761         for ancestors of the startNode when the pre-order traversal leaves the trees rooted 
762         at those ancestors.  We assumed that any ancestors of the current node not in the 
763         ancestorsToClose list were those kind of ancestors.  But we don't add renderer-less 
764         containers to the ancestorsToClose list.  So, we were incorrectly surrounding the 
765         currently accumulated markup with markup for render-less containers.  Most of the
766         content at apple.com was being put inside an <optgroup> inside a <select> element.  
767         Then on Paste createContextualFragment would drop it.
768
769 2006-07-21  Anders Carlsson  <acarlsson@apple.com>
770
771         Reviewed by Geoff.
772
773         * dom/Document.h:
774         (WebCore::Document::):
775         * dom/EventTargetNode.cpp:
776         (WebCore::EventTargetNode::addEventListener):
777         * page/FrameView.cpp:
778         (WebCore::FrameView::layout):
779         * rendering/RenderLayer.cpp:
780         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
781         Only dispatch overflowchanged events if overflowchanged event listeners have been registered on the document.
782
783 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
784
785         Reviewed by Geoff.
786
787         <rdar://problem/4637807> REGRESSION: "Features & Options" page at volvocars.us fails
788
789         * xml/XSLTProcessor.cpp:
790         (WebCore::xsltParamArrayFromParameterMap):
791         Turns out parameters never worked. String parameters need to be escaped so we create a transform context,
792         add the parameters to it quoted and then use xsltApplyStylesheetUser which lets us pass the transform context to it.
793         This also works around a bug in libxslt where a hash table isn't allocated.
794
795 2006-07-20  Alice Liu  <alice.liu@apple.com>
796
797         Reviewed by Tim Omernick.
798
799         Fixed <rdar://problem/4621649> repro crash: Upload link causes crash on pages.google.com in Frame::nodeForWidget
800         added manual test because there is no way to change the value of an <input type=file> via the DOM.  It's not supported because it's a security risk. 
801
802         * manual-tests/remove-input-file-onchange.html: Added.
803         * platform/mac/FileButtonMac.mm:
804         (-[WebFileChooserButton chooseFilename:]):
805         swapped the calls to changeFilename and bridgeForWidget because changeFilename will destroy the widget that is accessed in bridgeForWidget 
806
807 2006-07-20  Alice Liu  <alice.liu@apple.com>
808
809         Reviewed by Adele.
810
811         Fixed <rdar://problem/4532113> REGRESSION (NativeTextField): Crash occurs after modifying field then reloading page -[FormDelegate frameLayoutHasChanged:]
812         added a manual test because of the need to use AutoFill.
813
814         * dom/Node.h:
815         (WebCore::Node::aboutToUnload):
816         added virtual function prototype
817         * html/HTMLInputElement.cpp:
818         (WebCore::HTMLInputElement::aboutToUnload):
819         added implementation that sends textFieldDidEndEditing notification
820         * html/HTMLInputElement.h:
821         added virtual function prototype
822         * manual-tests/input-type-file-autocomplete-frame-1.html: Added.
823         * manual-tests/input-type-file-autocomplete-frame-2.html: Added.
824         * manual-tests/input-type-file-autocomplete-refresh.html: Added.
825         * page/Frame.cpp:
826         (WebCore::Frame::stopLoading):
827         before unloading, call aboutToUnload on the current focused node
828
829 2006-07-20  Brady Eidson  <beidson@apple.com>
830
831         Reviewed by Maciej
832
833         fixed <rdar://problem/4611303> REGRESSION: repro crash in WebCore::EventTargetNode::dispatchWindowEvent at aeropostale.com
834         There was an attempt to deref an EventListener that got cleaned up in GC.  Changing Document's EventListener list from 
835         vanilla ptrs to refptrs to prevent GC, following EventTargetNode's proven example.
836
837         * dom/Document.cpp:
838         (WebCore::Document::Document):
839         (WebCore::Document::clear):
840         (WebCore::Document::handleWindowEvent):
841         (WebCore::Document::getHTMLWindowEventListener):
842         (WebCore::Document::removeHTMLWindowEventListener):
843         (WebCore::Document::removeWindowEventListener):
844         (WebCore::Document::hasWindowEventListener):
845         Changed all of the list iterators to work with RefPtrs instead of vanilla ptrs
846
847         * dom/Document.h:
848         Changed the EventListener list to be a vanilla pointer list to a refptr list
849
850 2006-07-20  John Sullivan  <sullivan@apple.com>
851
852         Reviewed by Maciej
853
854         - WebCore part of fix for:
855         <rdar://problem/4557386> REGRESSION (419.3-521.19): repro Safari world leak involving 
856         closing tabs after clicking in a web page
857         
858         * bridge/mac/WebCoreFrameBridge.h:
859         (-[WebCoreFrameBridge textViewWasFirstResponderAtMouseDownTime:])
860         renamed to be more specific (formerly wasFirstResponderAtMouseDownTime:)
861         * bridge/mac/FrameMac.mm:
862         (WebCore::FrameMac::passMouseDownEventToWidget):
863         updated for name change
864
865 2006-07-19  Alexey Proskuryakov  <ap@nypop.com>
866
867         Reviewed by Darin.
868
869         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8272
870         Use of window.open & window.close can cause crash
871
872         * platform/PlatformMouseEvent.h:
873         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
874         * platform/mac/PlatformMouseEventMac.mm:
875         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
876         The default constructor now creates a "zero" event, and a new one was added to create the "current" one.
877
878         * bridge/mac/FrameMac.mm:
879         (WebCore::FrameMac::handleMouseMoveEvent):
880         * rendering/RenderFormElement.cpp:
881         (WebCore::RenderFormElement::clicked): 
882         Updated for the above changes.
883
884         * platform/gdk/MouseEventGdk.cpp:
885         * platform/gdk/TemporaryLinkStubs.cpp:
886         (PlatformMouseEvent::PlatformMouseEvent):
887         * platform/win/MouseEventWin.cpp:
888         * platform/win/TemporaryLinkStubs.cpp:
889         (PlatformMouseEvent::PlatformMouseEvent):
890         Trying not to break other platforms.
891
892         * manual-tests/invalid-mouse-event.html: Added.
893
894 2006-07-20  Maciej Stachowiak  <mjs@apple.com>
895         
896         Reviewed by Anders.
897
898         - delete line that I only commented in the last patch - meant to do this before landing
899
900         * html/HTMLFrameElement.cpp:
901         (WebCore::HTMLFrameElement::close): 
902
903 2006-07-19  Maciej Stachowiak  <mjs@apple.com>
904
905         Reviewed by Geoff.
906
907         - fixed <rdar://problem/4634484> REGRESSION: Project Change Request form should have vertical scroll bar, but doesn't
908         
909         I couldn't figure out how to make an automated test case for this,
910         or even a manual one. It seems to be timing-related in some way.
911
912         * html/HTMLFrameElement.cpp:
913         (WebCore::HTMLFrameElement::close): detach the child frame from
914         its element, not the frame containing this element.
915
916 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
917
918         Reviewed by Darin.
919
920         * bridge/mac/FrameMac.mm:
921         (WebCore::FrameMac::nextKeyViewInFrame):
922         Hold a ref to the node in case it gets destroyed by an event handler.
923
924 2006-07-19  Mark Rowe  <opendarwin.org@bdash.net.nz>
925
926         Reviewed by Darin.
927
928         http://bugzilla.opendarwin.org/show_bug.cgi?id=10021
929         Bug 10021: REGRESSION: Stack overflow due to infinite recursion in 
930         Image::checkForSolidColor
931
932         * platform/Image.cpp:
933         (WebCore::Image::cacheFrame): Don't call checkForSolidColor unless 
934         the frame was decoded successfully.
935
936 2006-07-19  Adele Peterson  <adele@apple.com>
937
938         Reviewed by Maciej.
939
940         - Fix for: 
941         <rdar://problem/4422657> REGRESSION: member name field or password field should have focus after loading webmail.mac.com (7405)
942         http://bugzilla.opendarwin.org/show_bug.cgi?id=7405
943
944         <rdar://problem/4614181> REGRESSION: Crash in WebCore::RenderTextField::text() when quoting post at the Ars Technica forum (9707)
945         http://bugzilla.opendarwin.org/show_bug.cgi?id=9707
946
947         Needs an http test. (http://bugzilla.opendarwin.org/show_bug.cgi?id=10020)
948
949         These bugs were both cases where focus() was called on an element which didn't have a renderer yet because stylesheets hadn't finished loading yet.
950         Now, we detect this case and let setFocusNode be called.  And when the stylesheet finishes loading, and the element attaches, a timer will fire, 
951         which will cause the correct selection & scrolling behavior to occur. 
952
953         This fix removes selection and scrolling behavior from the focus method.  This code is now in a new method, updateFocusAppearance.
954         updateFocusAppearance can now be called directly from focus(), but it can also be called when a timer fires.  This timer gets set
955         up when an element attaches, and its already been focused by the focus method.  We have to use a timer, because updateFocusAppearance can cause
956         a layout to happen, and we don't want that to happen in the middle of attach().
957
958         * bindings/objc/DOM.mm: (-[DOMElement isFocused]): Added SPI for autofill.
959         * bindings/objc/DOMPrivate.h:
960
961         * dom/Element.cpp:
962         (WebCore::Element::Element): Initializes timer and needFocusAppearanceUpdate bool.
963         (WebCore::Element::attach): Checks needsFocusAppearanceUpdate, and if the node is focused, then starts the timer.
964         (WebCore::Element::focus): Updated to check supportsFocus before calling setFocusNode, 
965         and only requiring the element to be focusable now before updating focus appearance.
966         (WebCore::Element::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
967         (WebCore::Element::updateFocusAppearanceTimerFired): Stops the timer, and if the element is focusable, calls updateFocusAppearance.
968         (WebCore::Element::stopUpdateFocusAppearanceTimer):  Cancels timer, and setsNeedsFocusAppearanceUpdate(false).
969         (WebCore::Element::detach): Calls stopUpdateFocusAppearanceTimer.
970         (WebCore::Element::blur): ditto.
971         * dom/Element.h:
972         (WebCore::Element::needsFocusAppearanceUpdate): Added so the timer only fires when focus() methods have caused an element to be focused.
973         (WebCore::Element::setNeedsFocusAppearanceUpdate): Added so focus methods can set this flag.
974
975         * dom/Node.h: (WebCore::Node::supportsFocus): Added.  Base class just calls isFocusable.
976         * html/HTMLAnchorElement.h: Added supportsFocus.
977         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::supportsFocus): Added. Checks for the case where stylesheets haven't loaded yet,
978         so we can still focus the node without a renderer, and when it gets a renderer, we'll update the focus appearance.
979         * html/HTMLGenericFormElement.h: (WebCore::HTMLGenericFormElement::supportsFocus): ditto.
980         * html/HTMLGenericFormElement.cpp: Removed include of Document.h since this is now in the header.
981
982         * html/HTMLInputElement.cpp:
983         (WebCore::HTMLInputElement::focus): Updated to check supportsFocus before calling setFocusNode, 
984         and only requiring the element to be focusable now before updating focus appearance.
985         (WebCore::HTMLInputElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
986         * html/HTMLInputElement.h:
987
988         * html/HTMLTextAreaElement.cpp:
989         (WebCore::HTMLTextAreaElement::focus): Updated to check supportsFocus before calling setFocusNode, 
990         and only requiring the element to be focusable now before updating focus appearance.
991         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
992         * html/HTMLTextAreaElement.h:
993
994 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
995
996         Reviewed by levi
997         
998         <rdar://problem/4631972>
999         REGRESSION: Mail crashes when pasting entire contents of http://www.apple.com/support/ into a new mail message
1000
1001         * dom/Position.cpp:
1002         (WebCore::Position::upstream): Deployed isBlock and enclosingBlock.
1003         (WebCore::Position::downstream): Ditto.
1004         * editing/CompositeEditCommand.cpp:
1005         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Ditto.
1006         * editing/htmlediting.cpp:
1007         (WebCore::canHaveChildrenForEditing): Added !iframe.
1008         (WebCore::isBlock): Added, returns !node->renderer()->isInline()
1009         (WebCore::enclosingBlock): Added.
1010         * editing/htmlediting.h:
1011
1012 2006-07-19  Anders Carlsson  <acarlsson@apple.com>
1013
1014         Reviewed by Adele.
1015
1016         <rdar://problem/4631272> REGRESSION: Crash tabbing out of hostname field at autorestore.apple.com
1017         
1018         * bridge/mac/FrameMac.mm:
1019         (WebCore::FrameMac::nextKeyViewInFrame):
1020         Take into account that focus handlers can cause a node's renderer to be destroyed.
1021         
1022 2006-07-19  David Hyatt  <hyatt@apple.com>
1023
1024         Fix for 4638376.  The 1x1 solid color image optimization was broken when
1025         I re-architected image.  This patch restores the optimization for CG.  Cairo
1026         will still need the optimization.
1027
1028         Reviewed by darin
1029
1030         WARNING: NO TEST CASES ADDED OR CHANGED (need test cases still)
1031
1032         * platform/Image.cpp:
1033         (WebCore::Image::Image):
1034         (WebCore::Image::invalidateData):
1035         (WebCore::Image::cacheFrame):
1036         * platform/Image.h:
1037         (WebCore::Image::setIsPDF):
1038         * platform/cairo/ImageCairo.cpp:
1039         (WebCore::Image::checkForSolidColor):
1040         * platform/mac/ImageMac.mm:
1041         (WebCore::Image::initNativeData):
1042         (WebCore::Image::invalidateNativeData):
1043         (WebCore::Image::checkForSolidColor):
1044         (WebCore::Image::draw):
1045         (WebCore::Image::drawTiled):
1046
1047 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
1048
1049         Reviewed by levi
1050         
1051         <rdar://problem/4613519>
1052         REGRESSION: Pasting text in native text area inserts text one character before it should (9527)
1053
1054         * editing/InsertParagraphSeparatorCommand.cpp:
1055         (WebCore::InsertParagraphSeparatorCommand::doApply): Turn into an InsertLineBreakCommand instead of bailing
1056         if the enclosingBlockFlowElement doesn't have a parent.
1057
1058 2006-07-19  David Harrison  <harrison@apple.com>
1059
1060         Reviewed by Tim Hatcher.
1061
1062         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
1063         <rdar://problem/4062218> pasting in contents of web.apple.com strips off the <table> element from the first table
1064         
1065         Better patch than previous checkin.
1066
1067         * test: editing/pasteboard/paste-table-003.html
1068         
1069         * editing/markup.cpp:
1070         (WebCore::createMarkup):
1071         Make sure to include the table when including a tbody.
1072
1073 === Safari-521.19 ===
1074
1075 2006-07-19  David Harrison  <harrison@apple.com>
1076
1077         Reviewed by Tim Hatcher.
1078
1079         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
1080
1081         No test case as this can only be reproduced through ObjC APIs.
1082
1083         * editing/markup.cpp:
1084         (WebCore::createMarkup):
1085         Adjust the range for ancestor markup handling when main loop skips first node.
1086
1087 2006-07-18  David Hyatt  <hyatt@apple.com>
1088
1089         Fix for radar 4611287, make resizable text fields opt-in rather than
1090         opt-out.  Open source users will need to write the pref into their defaults
1091         to see the resizers on textareas now.
1092
1093         Reviewed by mjs and adele
1094
1095         * WebCore.xcodeproj/project.pbxproj:
1096         * bridge/mac/WebCoreSettings.mm:
1097         (-[WebCoreSettings setTextAreasAreResizable:]):
1098         * css/cssparser.cpp:
1099         (WebCore::CSSParser::parseValue):
1100         * css/cssstyleselector.cpp:
1101         (WebCore::CSSStyleSelector::applyProperty):
1102         * css/html4.css:
1103
1104 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1105
1106         Reviewed by Darin.
1107
1108         http://bugzilla.opendarwin.org/show_bug.cgi?id=9959
1109         REGRESSION: iframes stop rendering after 200th one on successive reloads
1110         
1111         * html/HTMLFrameElement.cpp:
1112         (WebCore::HTMLFrameElement::attach):
1113         (WebCore::HTMLFrameElement::close):
1114         * html/HTMLIFrameElement.cpp:
1115         (WebCore::HTMLIFrameElement::insertedIntoDocument):
1116         (WebCore::HTMLIFrameElement::willRemove):
1117         Remove calls to incrementFrameCount and decrementFrameCount.
1118         
1119         * page/Frame.cpp:
1120         (WebCore::Frame::Frame):
1121         Call incrementFrameCount here.
1122         
1123         (WebCore::Frame::~Frame):
1124         Call disconnectOwnerElement.
1125         
1126         (WebCore::Frame::disconnectOwnerElement):
1127         Call decrementFrameCount here.
1128         
1129 2006-07-18  Alexey Proskuryakov  <ap@nypop.com>
1130
1131         Reviewed by Darin.
1132
1133         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9013
1134         Let correct CSS custom cursor declarations parse
1135
1136         * css/cssparser.cpp:
1137         (WebCore::CSSParser::parseValue): Ignore any values following a custom CSS cursor URI, instead of
1138         requiring that it is the only one in the list (which is actually illegal, according to the spec). 
1139         This is only a temporary hack, with a real implementation to follow in bug 6001/6002.
1140
1141         * manual-tests/custom-cursors.html: Added a test for this issue.
1142         * manual-tests/resources/helpCursor.tiff: A cursor image used in the test.
1143
1144 2006-07-18  Timothy Hatcher  <timothy@apple.com>
1145
1146         Reviewed by Anders.
1147         
1148         <rdar://problem/4636216> NetNewsWire fails to launch on 9A224 - missing symbols
1149         
1150         WebCore needs to add -sub_library libobjc to maintain
1151         backwards compatibility with binaries linked with WebKit
1152         before JavaScriptCore moved out of WebKit.
1153
1154         * WebCore.xcodeproj/project.pbxproj:
1155
1156 2006-07-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1157
1158         Reviewed by Justin.
1159
1160         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9978
1161           REGRESSION (r12949-r12988): Clicking the first letter on a line places the caret at the end of the previous line
1162
1163         Test: editing/selection/click-start-of-line.html
1164
1165         * rendering/RenderText.cpp:
1166         (WebCore::RenderText::positionForCoordinates): Changed to return downstream
1167         affinity if the x coordinate is to the left of the middle of the first character
1168         in the text box.
1169
1170 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1171
1172         Reviewed by Darin.
1173
1174         http://bugzilla.opendarwin.org/show_bug.cgi?id=9695
1175         <rdar://problem/4614085> 
1176         TOT REGRESSION: NativeTextArea: Text area does not respond to Cmd-UpArrow/Cmd-DownArrow (9695)
1177         
1178         * editing/SelectionController.cpp:
1179         (WebCore::SelectionController::modifyExtendingRightForward):
1180         (WebCore::SelectionController::modifyMovingRightForward):
1181         (WebCore::SelectionController::modifyExtendingLeftBackward):
1182         (WebCore::SelectionController::modifyMovingLeftBackward):
1183         If the caret is inside an editable region, the beginning/end of the document should actually be the
1184         beginning/end of the editable region.
1185
1186 2006-07-17  Tim Omernick  <timo@apple.com>
1187
1188         Reviewed by Maciej.
1189
1190         <rdar://problem/4612079> need a way to prevent pages from scrolling to reveal elements that are focused
1191         by script
1192
1193         * bridge/mac/WebCoreFrameBridge.h:
1194         * bridge/mac/WebCoreFrameBridge.mm:
1195         (-[WebCoreFrameBridge setProhibitsScrolling:]):
1196         * page/Frame.cpp:
1197         (WebCore::Frame::prohibitsScrolling):
1198         (WebCore::Frame::setProhibitsScrolling):
1199         * page/Frame.h:
1200         * page/FramePrivate.h:
1201         (WebCore::FramePrivate::FramePrivate):
1202         * page/FrameView.cpp:
1203         (WebCore::FrameView::scrollPointRecursively):
1204         (WebCore::FrameView::setContentsPos):
1205         * page/FrameView.h:
1206         * platform/ScrollView.h:
1207
1208 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1209
1210         Reviewed by Dave Harrison.
1211         
1212         - fixed <rdar://problem/4618089> Blot crashes when I paste in all the contents of http://www.apple.com/startpage/
1213
1214         * editing/htmlediting.cpp:
1215         (WebCore::editingIgnoresContent):
1216
1217 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1218
1219         Reviewed by levi
1220         
1221         <rdar://problem/4621728>
1222         REGRESSION: Selecting by dragging down creates selection in wrong direction, with certain steps
1223         <rdar://problem/4604932>
1224         REGRESSION: Dragging too far left on a line will select all lines above it.
1225  
1226         No layout test because of 9980.
1227
1228         * rendering/RenderBlock.cpp:
1229         (WebCore::RenderBlock::positionForCoordinates): Don't return positions inside editable roots
1230         for coordinates outside those roots, except for coordinates outside a document that is entirely 
1231         editable.
1232
1233 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1234
1235         Reviewed by Darin.
1236
1237         <rdar://problem/4635281> JSCanvasRenderingContext2D::drawImage needs to initialize the exception code to zero
1238
1239         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
1240         (WebCore::JSCanvasRenderingContext2D::drawImage): initialize ec to zero
1241         * html/CanvasRenderingContext2D.cpp:
1242         (WebCore::CanvasRenderingContext2D::drawImage): initialize ec before earlier return
1243
1244 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1245
1246         Reviewed by Maciej.
1247
1248         <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
1249
1250         Moves WebScriptObject and WebUndefined to WebCore.
1251
1252         * WebCore.exp:
1253         * WebCore.xcodeproj/project.pbxproj:
1254         * bindings/objc/DOM.mm:
1255         * bindings/objc/DOMCore.h:
1256         * bindings/objc/DOMInternal.mm:
1257         * bindings/objc/DOMUtility.mm:
1258         * bindings/objc/WebScriptObject.mm: Added.
1259         (+[WebUndefined allocWithZone:]):
1260         (-[WebUndefined initWithCoder:]):
1261         (-[WebUndefined encodeWithCoder:]):
1262         (-[WebUndefined copyWithZone:]):
1263         * bindings/objc/WebScriptObjectPrivate.h: Added.
1264         * bridge/mac/FrameMac.mm:
1265         * bridge/mac/WebCoreScriptDebugger.mm:
1266
1267 2006-07-17  David Hyatt  <hyatt@apple.com>
1268
1269         Back out the fix for 5564, since it turns out font:x-small; is a pretty
1270         prominent IE-specific CSS hack.  Because Web sites rely on IE's incorrect
1271         font parsing as a means of also correcting IE's incorrect font size rules.
1272
1273         This fixes Yahoo.com.
1274
1275         Reviewed by darin
1276
1277         * css/cssparser.cpp:
1278         (WebCore::CSSParser::parseFont):
1279
1280 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1281
1282         Reviewed by levi
1283         
1284         <rdar://problem/4618389> REGRESSION: After applying a link to the last word of a sentence, a new selection is created at the start of the sentence
1285         
1286         * dom/Document.cpp:
1287         (WebCore::Document::updateSelection):
1288
1289 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1290
1291         Reviewed by Beth.
1292         
1293         <rdar://problem/4604946> REGRESSION: 'checkboxRef.checked = true' fires onchange event in Leopard
1294
1295         * html/HTMLInputElement.cpp:
1296         (WebCore::HTMLInputElement::setChecked):
1297         (WebCore::HTMLInputElement::preDispatchEventHandler):
1298         * html/HTMLInputElement.h:
1299
1300 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1301
1302         Reviewed by Darin.
1303
1304         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9954
1305           REGRESSION: document.dir should return empty string in <head>
1306
1307         Test: fast/dom/document-dir-property.html
1308
1309         * bindings/js/kjs_html.cpp:
1310         (KJS::JSHTMLDocument::getValueProperty): Return an empty string instead of an
1311         undefined value for an unset document.dir property.
1312
1313 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1314
1315         Reviewed by Darin.
1316
1317         * dom/NodeFilter.idl:
1318         Removed "No newline at end of file" that snuck in as part of the "apply patch" process.
1319         * manual-tests/input-empty-on-focus.html:
1320         Removed "Property changes" that snuck in as part of the "apply patch" process.
1321
1322 2006-07-16  Darin Adler  <darin@apple.com>
1323
1324         Reviewed by John Sullivan.
1325
1326         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9943
1327           <rdar://problem/4590613>
1328           REGRESSION (Tiger-TOT): menus are offset to the right at http://movies.aol.com/movie-photo-bts/superman-returns
1329
1330         The problem turns out to be the fact that body.offsetLeft is returning a non-zero value.
1331         I have no idea why the menus worked in Tiger Safari, because body.offsetLeft behavior has not changed.
1332         Presumably some other bug that we fixed had been compensating.
1333
1334         Test: fast/html/body-offset-properties.html
1335
1336         * rendering/RenderObject.cpp:
1337         (WebCore::RenderObject::offsetLeft): Always return 0 for any object without an offsetParent.
1338         (WebCore::RenderObject::offsetTop): Ditto.
1339         (WebCore::RenderObject::offsetParent): Return 0 for the body (treat as a special case).
1340
1341 2006-07-16  Beth Dakin  <bdakin@apple.com>
1342
1343         Reviewed by Maciej.
1344
1345         Fix for <rdar://problem/4616595> REGRESSION: Problems with world 
1346         clock widget clock hand motion on 9A211 + 4604574
1347
1348         The second hand on the widget was jiggling because the rotation was 
1349         messing up the use of the affine transformation matrix while 
1350         rounding to pixel boundaries in device space. We are mainly 
1351         concerned with rounding to pixel boundaries with the scale in mind, 
1352         so this patch extracts the scale to device space from the matrix, 
1353         and rounds to pixel boundaries using only the scale. This doesn't 
1354         seem like it is a perfect solution, but it definitely solves the 
1355         immediate problem. We will probably need to re-address what should 
1356         happen to avoid pixel cracks with rotations at non-integral scale 
1357         factors. 
1358
1359         * platform/cg/GraphicsContextCG.cpp:
1360         (WebCore::GraphicsContext::roundToDevicePixels):
1361
1362 2006-07-15  Darin Adler  <darin@apple.com>
1363
1364         - fix mistake from fix for 8952 that was breaking layout tests
1365
1366         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
1367         Justin was right! I changed the behavior of the function by accident. Changed it
1368         back so that it doesn't blow away the selection on the DOM side in the case where
1369         it didn't before.
1370
1371         I will write 100 times on the blackboard: "When Justin says something about editing,
1372         assume he is right."
1373
1374 2006-07-15  Darin Adler  <darin@apple.com>
1375
1376         - try to fix Windows build
1377
1378         * WebCore.vcproj/WebCore/WebCore.vcproj: Added StreamingTextDecoderICU.cpp/h.
1379
1380 2006-07-15  Darin Adler  <darin@apple.com>
1381
1382         Reviewed by John Sullivan.
1383
1384         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8952
1385           <rdar://problem/4575185>
1386           REGRESSION: crash on drag of highlighted Google custom home page modules
1387
1388         Test: fast/dynamic/move-node-with-selection.html
1389
1390         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
1391         Call updateRendering before calling clearSelection(), since it's important to do any
1392         work beforehand, and there are calls inside clearSelection that will indirectly do an
1393         updateRendering. Also change code to make fewer assumptions about object lifetime.
1394
1395 2006-07-15  Darin Adler  <darin@apple.com>
1396
1397         Reviewed by John Sullivan.
1398
1399         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8587
1400           <rdar://problem/4631844>
1401           REGRESSION: {display:list-item} on items outside an ol or ul element no longer causes incremental numbering
1402
1403         Test: fast/lists/numeric-markers-outside-list.html
1404
1405         * rendering/RenderListItem.cpp: (WebCore::previousListItem):
1406         Look for list items, even when we're outside any list.
1407
1408 2006-07-15  Adele Peterson  <adele@apple.com>
1409
1410         Reviewed by John.
1411
1412         - Fix for <rdar://problem/4593970> REGRESSION (NativeTextField): autofill menu disappears after typing a 2nd character
1413
1414         This was caused by composite editing commands, (like typing or pasting) that include a DeleteCommand, being
1415         interpreted by the form delegate as an actual delete.  This fix doesn't notify the form delegate if the deletion is
1416         part of an editing command to replace the selected text.
1417
1418         * editing/DeleteSelectionCommand.h: Added m_replace to keep track of whether this deletion is 
1419           part of a composite command to replace the text being deleted.
1420         * editing/DeleteSelectionCommand.cpp:
1421         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand): Initialize m_replace.
1422         (WebCore::DeleteSelectionCommand::doApply): Only notify the form delegate of the deletion if the text is not being replaced.
1423         * editing/CompositeEditCommand.h:
1424         * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::deleteSelection): 
1425           Added replace argument to construct DeleteSelectionCommand.
1426           
1427         * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::input): Call deleteSelection with replace argument.
1428         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply): ditto.
1429
1430 2006-07-15  Geoffrey Garen  <ggaren@apple.com>
1431
1432         Reviewed by Maciej, tweaked to match Darin's patch.
1433         
1434         - Fixed <rdar://problem/4631837> REGRESSION: Reproducible crash on 
1435         FCKeditor demo (9911)
1436         
1437         * WebCore.xcodeproj/project.pbxproj:
1438         * bindings/js/kjs_html.cpp:
1439         (KJS::JSHTMLDocument::putValueProperty): Check for a null body element before
1440         forwarding the put request to it. I confirmed that no other parts of the 
1441         file use 'body' or 'bodyElement' without checking for null. 
1442         
1443         Also, use 'body' rather than 'bodyElement' because dir can bet set on 
1444         any element, not just HTMLBodyElement.
1445
1446 2006-07-15  Darin Adler  <darin@apple.com>
1447
1448         Reviewed by Adele.
1449
1450         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8871
1451           <rdar://problem/4575417>
1452           REGRESSION: Pressing Enter/Return in a text input removes the selected text
1453
1454         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9743
1455           <rdar://problem/4614228>
1456           REGRESSION: crash dispatching JavaScript-created keyboard event to input element
1457
1458         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::doTextFieldCommandFromEvent):
1459         Add a null check to fix the crash, and a FIXME explaining why this is not necessarily
1460         enough for the future.
1461
1462         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
1463         Consume Enter key keypress events even if the element is not in a form.
1464
1465         * platform/mac/KeyEventMac.mm: (WebCore::keyIdentifierForKeyEvent): Added \n to the
1466         characters that turn into "Enter". Actual keyboard events always are \r or \003 on
1467         the Macintosh, but in layout tests we can use \n, and everything other than the
1468         code path here works, so worth fixing.
1469
1470 2006-07-15  Darin Adler  <darin@apple.com>
1471
1472         Reviewed by John Sullivan.
1473
1474         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9883
1475           <rdar://problem/4631821>
1476           REGRESSION: NativePopups don't work correctly in some forum software
1477
1478         Test: fast/forms/select-selected.html
1479
1480         * rendering/RenderMenuList.h:
1481         * rendering/RenderMenuList.cpp:
1482         (WebCore::RenderMenuList::updateFromElement): Added code to map the selected option
1483         index to a list index before using it to index into the list.
1484         (WebCore::RenderMenuList::showPopup): Added code to map the selection option index
1485         to a list index before passing it to the menu renderer.
1486         (WebCore::RenderMenuList::valueChanged): Added code to map the list index back to a
1487         option index before calling setSelectedIndex (that function takes an option index).
1488
1489 2006-07-15  Darin Adler  <darin@apple.com>
1490
1491         Reviewed by John Sullivan.
1492
1493         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9928
1494           REGRESSION: Text Encoding menu inoperative (after gcc protocol build fix)
1495
1496         * bindings/objc/DOM.mm:
1497         (-[DOMNode addEventListener:::]): Moved into DOMEventTarget category.
1498         (-[DOMNode removeEventListener:::]): Ditto.
1499         (-[DOMNode dispatchEvent:]): Ditto.
1500
1501         * WebCore.xcodeproj/project.pbxproj: Allow Xcode to do its thing.
1502
1503 2006-07-15  Maciej Stachowiak  <mjs@apple.com>
1504
1505         Reviewed by Anders.
1506
1507         <rdar://problem/4632144> REGRESSION: table column tests failing as a result of very recent fix
1508
1509         * rendering/RenderTable.cpp:
1510         (WebCore::RenderTable::addChild): columns and colgroups are valid children of a table too, not
1511         just table sections!
1512
1513 2006-07-15  Anders Carlsson  <acarlsson@apple.com>
1514
1515         Reviewed by Darin.
1516
1517         http://bugzilla.opendarwin.org/show_bug.cgi?id=9866
1518         <rdar://problem/4631561>
1519         REGRESSION: Repro crash from mangleme using iframe, only from server.
1520         
1521         * html/HTMLIFrameElement.cpp:
1522         (WebCore::HTMLIFrameElement::attach):
1523         Add null check for contentFrame() since content frames won't be created for invalid URLs.        
1524
1525 2006-07-14  Alexey Proskuryakov  <ap@nypop.com>
1526
1527         Reviewed by Darin.
1528
1529         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4195
1530         REGRESSION: KOI8-U encoding no longer supported.
1531
1532         Tests:
1533         * http/tests/misc/BOM-override.pl
1534         * http/tests/misc/BOM-override-script.html
1535         * fast/encoding/charset-koi8-u.html
1536         * fast/encoding/charset-x-nextstep.html
1537
1538         Restored a TEC code path for encodings that are not supported by ICU (but which currently
1539         passes all layout tests even by itself with ICU disabled). A lot of refactoring is 
1540         still needed - most importantly, round-tripping encoding names via CFStringEncoding 
1541         makes little sense now.
1542
1543         * WebCore.exp:
1544         * bridge/mac/WebCoreTextDecoder.h: Removed.
1545         * bridge/mac/WebCoreTextDecoder.mm: Removed.
1546         WebCoreTextDecoder was not used anywhere since WebTextView was moved into WebCore.
1547
1548         * loader/Decoder.cpp:
1549         (Decoder::Decoder):
1550         (Decoder::setEncodingName):
1551         (Decoder::decode):
1552         Use StreamingTextDecoder::create().
1553
1554         * platform/StreamingTextDecoder.cpp:
1555         (WebCore::StreamingTextDecoder::create):
1556         (WebCore::StreamingTextDecoder::~StreamingTextDecoder):
1557         * platform/StreamingTextDecoder.h:
1558         StreamingTextDecoder is just an abstract interface to implementations now.
1559
1560         * platform/StreamingTextDecoderICU.cpp: Added.
1561         (WebCore::StreamingTextDecoderICU::StreamingTextDecoderICU):
1562         (WebCore::StreamingTextDecoderICU::~StreamingTextDecoderICU):
1563         (WebCore::StreamingTextDecoderICU::releaseICUConverter):
1564         (WebCore::StreamingTextDecoderICU::textEncodingSupported):
1565         (WebCore::StreamingTextDecoderICU::convertUTF16):
1566         (WebCore::StreamingTextDecoderICU::convertIfASCII):
1567         (WebCore::StreamingTextDecoderICU::createICUConverter):
1568         (WebCore::StreamingTextDecoderICU::appendOmittingBOM):
1569         (WebCore::StreamingTextDecoderICU::convertUsingICU):
1570         (WebCore::StreamingTextDecoderICU::convert):
1571         (WebCore::StreamingTextDecoderICU::toUnicode):
1572         (WebCore::StreamingTextDecoderICU::fromUnicode):
1573         * platform/StreamingTextDecoderICU.h: Added.
1574         Renamed from StreamingTextDecoder; added a way to tell whether the encoding is actually
1575         supported by the decoder; minor cleanup.
1576
1577         * platform/TextEncoding.cpp:
1578         (WebCore::TextEncoding::effectiveEncoding): Moved from StreamingTextDecoder.
1579         (WebCore::TextEncoding::toUnicode): Use StreamingTextDecoder::create().
1580         (WebCore::TextEncoding::fromUnicode): Moved to StreamingTextDecoderICU.
1581         
1582         * platform/TextEncoding.h: Changed __APPLE__ to PLATFORM(MAC); added effectiveEncoding().
1583
1584         * platform/mac/StreamingTextDecoderMac.cpp: Added.
1585         (WebCore::StreamingTextDecoderMac::StreamingTextDecoderMac):
1586         (WebCore::StreamingTextDecoderMac::~StreamingTextDecoderMac):
1587         (WebCore::StreamingTextDecoderMac::releaseTECConverter):
1588         (WebCore::StreamingTextDecoderMac::textEncodingSupported):
1589         (WebCore::StreamingTextDecoderMac::convertUTF16):
1590         (WebCore::StreamingTextDecoderMac::convertIfASCII):
1591         (WebCore::StreamingTextDecoderMac::createTECConverter):
1592         (WebCore::StreamingTextDecoderMac::appendOmittingBOM):
1593         (WebCore::StreamingTextDecoderMac::convertOneChunkUsingTEC):
1594         (WebCore::StreamingTextDecoderMac::convertUsingTEC):
1595         (WebCore::StreamingTextDecoderMac::convert):
1596         (WebCore::StreamingTextDecoderMac::toUnicode):
1597         (WebCore::StreamingTextDecoderMac::fromUnicode):
1598         * platform/mac/StreamingTextDecoderMac.h: Added.
1599         (WebCore::StreamingTextDecoderMac::convert):
1600         This is a TEC+CFString code path for decoding, basically restored from a year-old revision.
1601
1602         * platform/mac/TextEncodingMac.cpp: Removed. Code moved to StreamingTextDecoderMac.
1603
1604         * WebCore.xcodeproj/project.pbxproj:
1605
1606 === Safari-521.17 ===
1607
1608 2006-07-14  Timothy Hatcher  <timothy@apple.com>
1609
1610         <rdar://problem/4623957> SWB: gcc-5412 (new?) objc warning causes WebCore project failure
1611
1612         Made a DOMNode category in DOMEvents.h that lets DOMNode conform to the
1613         DOMEventTarget protocol that works with GCC 5412.
1614
1615         Removed forward declarations of WebCoreWidgetHolder and imported WebCoreWidgetHolder.h.
1616
1617         Removed all <Cocoa/Cocoa.h> and <Foundation/Foundation.h> imports in other headers,
1618         we import <Cocoa/Cocoa.h> in the prefix header for ObjC.
1619
1620         * WebCore.xcodeproj/project.pbxproj:
1621         * bindings/objc/DOMCore.h:
1622         * bindings/objc/DOMEvents.h:
1623         * bridge/mac/FormDataMac.h:
1624         * bridge/mac/WebCoreAXObject.h:
1625         * bridge/mac/WebCoreCache.h:
1626         * bridge/mac/WebCoreEncodings.h:
1627         * bridge/mac/WebCoreFrameBridge.h:
1628         * bridge/mac/WebCoreFrameNamespaces.h:
1629         * bridge/mac/WebCoreJavaScript.h:
1630         * bridge/mac/WebCorePageBridge.h:
1631         * bridge/mac/WebCorePageState.h:
1632         * bridge/mac/WebCoreResourceLoader.h:
1633         * bridge/mac/WebCoreScriptDebugger.h:
1634         * bridge/mac/WebCoreSettings.h:
1635         * bridge/mac/WebCoreStringTruncator.h:
1636         * bridge/mac/WebCoreStringTruncator.mm:
1637         * bridge/mac/WebCoreTextDecoder.h:
1638         * bridge/mac/WebDashboardRegion.h:
1639         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
1640         * platform/mac/CookieJar.mm:
1641         * platform/mac/DeprecatedStringMac.mm:
1642         * platform/mac/FontDataMac.mm:
1643         * platform/mac/FoundationExtras.h:
1644         * platform/mac/TextBoundaries.mm:
1645         * platform/mac/WebCoreHistory.h:
1646         * platform/mac/WebCoreHistory.m:
1647         * platform/mac/WebCoreKeyGenerator.h:
1648         * platform/mac/WebCoreTextArea.h:
1649         * platform/mac/WebCoreTextField.h:
1650         * platform/mac/WebCoreTextRenderer.h:
1651         * platform/mac/WebCoreView.h:
1652         * platform/mac/WebCoreWidgetHolder.h:
1653
1654 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
1655
1656         Reviewed by Maciej.
1657
1658         - Updated ScriptInterpreter to work with Interpreter ref-counting in 
1659         JavaScriptCore.
1660
1661         (KJS::ScriptInterpreter::~ScriptInterpreter): Now protected to catch
1662         manual delete.
1663
1664 2006-07-14  Anders Carlsson  <acarlsson@apple.com>
1665
1666         Reviewed by Adele and Justin.
1667
1668         http://bugzilla.opendarwin.org/show_bug.cgi?id=9658
1669         <rdar://problem/4613948>
1670         REGRESSION: Check Spelling does not work in textarea elements
1671         
1672         * bridge/mac/FrameMac.mm:
1673         (WebCore::FrameMac::advanceToNextMisspelling):
1674         Don't use setStartBefore or setEndAfter on the search range because for shadow trees, there
1675         is no notion of before and after. Instead, use setStart and setEnd and pass in the start and end
1676         indices respectively.
1677         
1678         * dom/Range.cpp:
1679         (WebCore::Range::checkNodeBA):
1680         Allow range operations on shadow trees.
1681
1682         * manual-tests/form-element-spelling.html: Added.
1683
1684 2006-07-14  Beth Dakin  <bdakin@apple.com>
1685
1686         Reviewed by Hyatt.
1687
1688         Fix for <rdar://problem/4621660> REGRESSION: Safari crashing in 
1689         WebCore::FrameView::updateOverflowStatus
1690
1691         m_viewportRenderer is never initialized for framesets, and it 
1692         shouldn't be. So we just need to nil-check for it in 
1693         updateOverflowStatus() and return early.
1694
1695         * page/FrameView.cpp:
1696         (WebCore::FrameView::updateOverflowStatus): Nil check.
1697
1698 2006-07-14  Adele Peterson  <adele@apple.com>
1699
1700         RS by Darin.
1701
1702         Backing out fix for <rdar://problem/4604703> 
1703         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
1704
1705         Darin had a better fix in WebKit for this.
1706
1707         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
1708
1709 2006-07-14  Adele Peterson  <adele@apple.com>
1710
1711         Reviewed by Darin.
1712
1713         - Fix for <rdar://problem/4614054> REGRESSION: Safari submits forms when the Return key is hit to complete inline inputs
1714
1715         * page/Frame.h: (WebCore::Frame::inputManagerHasMarkedText): Added.
1716         * bridge/mac/FrameMac.h: ditto.
1717         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::inputManagerHasMarkedText): Added. Asks the input manager if there's marked text.
1718         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler): For text fields, don't submit the form on Enter
1719         if the input manager says there's marked text.  I added this code for all text field paths.  For widgets, WebCoreTextField.mm
1720         has code to deal with this case.  But as we convert search, password, and isindex, they will need to do this check too.
1721
1722 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1723
1724         Reviewed by Darin.
1725
1726         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9907
1727           REGRESSION (r15418): editing/pasteboard/paste-table-001 fails in pixel  mode
1728
1729         * rendering/RenderText.cpp:
1730         (WebCore::RenderText::caretRect): Fixed the calculation of the max/min allowed caret
1731         position.
1732
1733 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1734
1735         Reviewed by Darin.
1736
1737         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9905
1738           REGRESSION (r15404-r15415): Repro crash when pressing delete in an empty editable div
1739
1740         Test: editing/deleting/delete-at-start-or-end.html
1741
1742         * editing/TypingCommand.cpp:
1743         (WebCore::TypingCommand::deleteKeyPressed): Added null check.
1744         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
1745
1746 2006-07-14  David Kilzer  <ddkilzer@kilzer.net>
1747
1748         Reviewed by Geoffrey.
1749
1750         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9903
1751           Simplify logic in JSHTMLOptionsCollection::setLength() by using no-arg getNumber()
1752
1753         No test cases since there is no change in functionality.
1754
1755         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
1756         (WebCore::JSHTMLOptionsCollection::setLength):  Simplified logic by using the
1757         no-argument getNumber() method.
1758
1759 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
1760
1761         Reviewed by Adele.
1762
1763         - Build fix: don't need BLOCK_OBJC_EXCEPTIONS because we already have
1764         one surrounding this function, and the nested one makes the compiler
1765         think our local variable is volatile (seems like a compiler bug to me).
1766         
1767         * bridge/mac/FrameMac.mm:
1768         (WebCore::FrameMac::sendContextMenuEvent):
1769
1770 2006-07-14  Timothy Hatcher  <timothy@apple.com>
1771
1772         Reviewed by Maciej.
1773
1774         Make JavaScriptCore a public framework. Adjusted the paths.
1775
1776         * WebCore.xcodeproj/project.pbxproj:
1777
1778 2006-07-14  Maciej Stachowiak  <mjs@apple.com>
1779
1780         Reviewed by Hyatt.
1781
1782         - fixed <rdar://problem/4567031> REGRESSION: Crash at WebCore::RenderBlock::createLineBoxes (seems to be a security hole?)
1783         
1784         I also fixed all the similar crash / assertion failure cases I could think of.
1785
1786         * dom/Node.cpp:
1787         (WebCore::Node::nextRendererWithSameParent): Helper function for some of the above.
1788         * dom/Node.h:
1789         * rendering/RenderTable.cpp:
1790         (WebCore::RenderTable::addChild): Don't allow inserting forms when not in
1791         an HTML document, since we don't need that quirk and because parsing won't
1792         do certain render tree fixups. Also watch out for case when inserting before
1793         the renderer of a misnested child.
1794         * rendering/RenderTableRow.cpp:
1795         (WebCore::RenderTableRow::addChild): ditto
1796         * rendering/RenderTableSection.cpp:
1797         (WebCore::RenderTableSection::addChild): ditto
1798
1799 2006-07-13  Adele Peterson  <adele@apple.com>
1800
1801         Reviewed by Maciej.
1802
1803         - Fix for <rdar://problem/4604703> 
1804         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
1805
1806         Test:
1807         * manual-tests/password-ctrl-click-lose-focus.html: Added.
1808
1809         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
1810         If we're about to set a selection in the current view, make sure its the first responder.
1811         In this case, this will cause the password field to resign first responder at the right time.
1812
1813 2006-07-13  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1814
1815         Reviewed by Hyatt.
1816
1817         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9670
1818           REGRESSION: RTL white-space:pre-wrap text is offset to the right
1819
1820         Test: fast/text/international/rtl-white-space-pre-wrap.html
1821
1822         * rendering/RenderText.cpp:
1823         (WebCore::RenderText::caretRect): Fixed LTR case and added the RTL case
1824         of clipping the caret position to the text box when the caret is after
1825         the trailing space of an autowrapped line.
1826         * rendering/bidi.cpp:
1827         (WebCore::RenderBlock::computeHorizontalPositionsForLine): Changed to truncate-
1828         to-fit the logically last text box if it contains the trailing spaces of an
1829         autowrapped line. 
1830         (WebCore::RenderBlock::bidiReorderLine): Remember the logically last text run.
1831         In the case of autowrapped text with white space that overflows beyond the line,
1832         the last text run is the one containing the overflowing white space.
1833         (WebCore::RenderBlock::findNextLineBreak): Split overflowing white space on a
1834         line that autowraps only after white space into a separate text run.
1835
1836 2006-07-13  David Harrison  <harrison@apple.com>
1837
1838         Reviewed by Dave Hyatt.
1839
1840         <rdar://problem/4624203> -webkit-highlight should be behind images
1841
1842         * rendering/RenderImage.cpp:
1843         (WebCore::RenderImage::paint):
1844         * rendering/RenderListMarker.cpp:
1845         (WebCore::RenderListMarker::paint):
1846         * rendering/RenderWidget.cpp:
1847         (WebCore::RenderWidget::paint):
1848         Call custom highlighter before painting the image, marker, or widget.
1849
1850 2006-07-13  David Harrison  <harrison@apple.com>
1851
1852         Reviewed by Justin and Levi.
1853
1854         <rdar://problem/4620743> REGRESSION: Option-Delete doesn't delete words during typing
1855
1856         * Tests:
1857         editing/deleting/delete-by-word-001.html
1858         editing/deleting/delete-by-word-002.html
1859
1860         * editing/TypingCommand.cpp:
1861         (WebCore::TypingCommand::deleteKeyPressed):
1862         (WebCore::TypingCommand::forwardDeleteKeyPressed):
1863         (WebCore::TypingCommand::doApply):
1864         * editing/TypingCommand.h:
1865         Delete and forward delete to use specified granularity.
1866         Undo of delete and forward delete to select what had been deleted (non-char granularity only).
1867         
1868         * page/Frame.cpp:
1869         (WebCore::Frame::setSelection):
1870         Close typing and end style even if selection is not changing.
1871         * page/Frame.h:
1872         Remove unused setSelection parameter keepTypingStyle.
1873
1874 2006-07-12  Levi Weintraub  <lweintraub@apple.com>
1875
1876         Reviewed by justin
1877
1878         <rdar://problem/4622763> Deleting from beginning of paragraph following a table deletes rather than selects the table
1879
1880         * editing/DeleteSelectionCommand.cpp:
1881         (WebCore::DeleteSelectionCommand::initializeStartEnd): Added selection expansion for HRs.
1882         (WebCore::DeleteSelectionCommand::initializePositionData): Now uses enclosingBlockFlowOrTableElement
1883         instead of enclosingBlockFlowElement.
1884         (WebCore::DeleteSelectionCommand::removeNode): Use to identify that we need a placeholder
1885         when the start or end block is removed.
1886         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Added check for canHaveChildrenForEditing
1887         to keep things like HRs from being given children.
1888         (WebCore::DeleteSelectionCommand::doApply): Switched to use member variable for needPlaceholder.
1889         * editing/DeleteSelectionCommand.h: Made needPlaceholder a member variable.
1890         * editing/TypingCommand.cpp:
1891         (WebCore::TypingCommand::deleteKeyPressed): Fixed selection bug for tables and open typing commands.
1892         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
1893         * editing/htmlediting.cpp:
1894         (WebCore::editingIgnoresContent): Added check for HRs, since it's not considered a widget.
1895         * editing/visible_units.cpp:
1896         (WebCore::startOfParagraph): Fix for HRs and tables.
1897         (WebCore::endOfParagraph): Ditto.
1898
1899 2006-07-13  Alexey Proskuryakov  <ap@nypop.com>
1900
1901         Reviewed by Darin.
1902
1903         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9880
1904           Memory leaks running DOM-Hanoi
1905
1906         No change in behavior, thus no test included.
1907
1908         * bridge/mac/FrameMac.mm:
1909         (WebCore::FrameMac::setStatusBarText): Use a local autorelease pool to release the temporaries - 
1910         the test runs non-stop, and the enclosing pool doesn't get a chance to be drained.
1911
1912 2006-07-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1913
1914         Reviewed by Adele.
1915
1916         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9862
1917           REGRESSION: GMail: Crash in RenderView::repaintViewRectangle when spoofing as FF
1918         - see also <rdar://problem/4622407>
1919
1920         Test: fast/frames/repaint-display-none-crash.html
1921
1922         * rendering/RenderView.cpp:
1923         (WebCore::RenderView::repaintViewRectangle): Added null checking of the owner element's
1924         renderer, which can be null if the iframe is set to display:none.
1925
1926 2006-07-12  Justin Garcia  <justin.garcia@apple.com>
1927
1928         Reviewed by levi
1929         
1930         <rdar://problem/4509393>
1931         selected DOM range starts with <object>, 0 offset but selection should include the <object>
1932
1933         * editing/ReplaceSelectionCommand.cpp:
1934         (WebCore::ReplaceSelectionCommand::shouldMergeStart): 
1935         Don't pull content out of a table cell.
1936         * editing/htmlediting.cpp:
1937         (WebCore::editingIgnoresContent): Added <select> nodes.
1938         (WebCore::rangeCompliantEquivalent): Convert [node, 0] positions to positionBeforeNode(node)
1939         for more types of nodes.
1940         * rendering/RenderContainer.cpp:
1941         (WebCore::RenderContainer::positionForCoordinates): 
1942         Fix a crasher when right clicking on an anonymous table.
1943
1944 2006-07-12  John Sullivan  <sullivan@apple.com>
1945
1946         Reviewed by Brady Eidson
1947         
1948         - fixed <rdar://problem/4611164> REGRESSION: Crash occurs when undoing a series of 
1949         misspelled words (WebCore::RenderObject::repaint(bool)
1950
1951         * dom/Document.cpp:
1952         (WebCore::Document::removeMarkers):
1953         put (it - markers.begin()) in a local variable before altering markers, in every case where this was
1954         happening. One of the cases like this was fixed a while back, but other cases were
1955         either missed at that time or crept in since. 
1956
1957 2006-07-13  Anders Carlsson  <acarlsson@apple.com>
1958
1959         Reviewed by Justin.
1960
1961         http://bugzilla.opendarwin.org/show_bug.cgi?id=9663
1962         REGRESSION (r14948-r14956): Selection in text field remains highlighted when the text field loses focus
1963         
1964         * dom/Document.cpp:
1965         (WebCore::Document::updateSelection):
1966         Don't return early if the selection is empty.
1967
1968 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
1969
1970         Reviewed by Adele.
1971
1972         <rdar://problem/4614656> REGRESSION: onpaste() handlers don't run for textarea elements
1973         
1974         * bridge/mac/FrameMac.mm:
1975         (WebCore::FrameMac::dispatchCPPEvent):
1976         If the element is a shadow node, dispatch the event to its real parent.
1977
1978         * manual-tests/textarea-onpaste.html: Added.
1979
1980 2006-07-12  Beth Dakin  <bdakin@apple.com>
1981
1982         Reviewed by Anders.
1983
1984         Fix for layout test regressions after my check-in last night. Just 
1985         a silly mistake where I should have asked if we were NOT printing 
1986         instead of if we were in the listbox code.
1987
1988         * WebCore.xcodeproj/project.pbxproj: Project file wars. Back to 
1989         XCode 2.3
1990         * platform/mac/ListBoxMac.mm:
1991         (itemTextRenderer): Inverted check.
1992         (groupLabelTextRenderer): Inverted check.
1993
1994 2006-07-12  Darin Adler  <darin@apple.com>
1995
1996         Reviewed by Maciej.
1997
1998         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9806
1999           <rdar://problem/4622622>
2000           REGRESSION: Large rowspan causes WebKit to call abort()
2001
2002         Test: fast/table/large-rowspan-crash.html
2003
2004         * rendering/RenderTableSection.cpp:
2005         (WebCore::RenderTableSection::ensureRows):
2006         Use sizeof(RowStruct) instead of sizeof(int).
2007         Clearly we'll need something better to solve this completely.
2008         I expect another smaller, but still huge, value will still cause a problem.
2009
2010 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2011
2012         Reviewed by Maciej.
2013
2014         <rdar://problem/4586665> REGRESSION: autorestore.apple.com: Crashes Safari in WebCore::Widget::client() const
2015
2016         * bridge/mac/FrameMac.h:
2017         Add focusCallResultedInViewBeingCreated argument. 
2018         
2019         * bridge/mac/FrameMac.mm:
2020         (WebCore::FrameMac::nextKeyViewInFrame):
2021         If the call to focus() caused the node to get a native widget, set focusCallResultedInViewBeingCreated to true.
2022         
2023         (WebCore::FrameMac::nextKeyViewInFrameHierarchy):
2024         Don't reset the focus node if focusCallResultedInViewBeingCreated is true. Also, add magic to prevent setting
2025         a text field as the first responder if its field editor already is the current first responder.
2026         
2027         * page/FrameView.cpp:
2028         (WebCore::FrameView::handleMousePressEvent):
2029         In some cases, get the event target node again after dispatching the mouse event.
2030
2031 2006-07-12  Beth Dakin  <bdakin@apple.com>
2032
2033         Reviewed by Adele.
2034
2035         Fix for <rdar://problem/4615765> Input[type='search' fields 
2036         initially render too large in Widgets
2037
2038         Fundamentally, the problem here is that we were miscalculating 
2039         things because [NSGraphicsContext currentContextDrawingToScreen] 
2040         was evaluating to false when widgets first load. We only ever used 
2041         this check, however, to determine if we were printing or not, so it 
2042         should not have evaluated to false for loading in Dashbaord. 
2043         Instead, if we query the RenderView about whether or not we are 
2044         printing, we will get the right answer.
2045
2046         No test case added since this appears only to affect Dashboard.
2047
2048         * bridge/mac/WebCoreFrameBridge.mm:
2049         (-[WebCoreFrameBridge drawRect:]): Ask the RenderView if we are 
2050         printing instead. This is not part of the actual bug fix, but it 
2051         seems wise to get rid of all calls to [NSGraphicsContext 
2052         currentContextDrawingToScreen] when we are just trying to determine 
2053         if we are printing or not.
2054         * platform/mac/ListBoxMac.mm:
2055         (itemTextRenderer):This function now takes a boolean, isPrinting.
2056         (groupLabelTextRenderer): Same as above.
2057         (ListBox::sizeForNumberOfLines): Ask the RenderView if we are 
2058         printing.
2059         (-[WebCoreTableView drawRow:clipRect:]): Same as above.
2060         * platform/mac/PopUpButtonMac.mm:
2061         (PopUpButton::sizeHint): Same as above.
2062         * platform/mac/TextFieldMac.mm:
2063         (-[NSSearchFieldCell _addStringToRecentSearches:]):
2064         * rendering/RenderLineEdit.cpp: Same as above.
2065
2066 2006-07-12  Adele Peterson  <adele@apple.com>
2067
2068         Reviewed by Maciej.
2069
2070         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=9813
2071         OPTION text can paint over select element's scrollbar
2072
2073         Test: fast/forms/option-text-clip.html
2074
2075         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::paintObject):
2076         When calculating the clip to apply to the button text, also consider padding.
2077         In the future, we may have separate renderers for the text part, and the arrow part
2078         of the control, and then the separation should be natural.  For now, we use padding.
2079
2080 2006-07-11  David Kilzer  <ddkilzer@kilzer.net>
2081
2082         Windows build fix.  Reviewed by NOBODY.
2083
2084         * WebCore.vcproj/WebCore/WebCore.vcproj:  Added JSHTMLOptionsCollection.cpp/h
2085         and JSHTMLOptionsCollectionCuston.cpp.  VC++ Express realphabetized the file list.
2086
2087 2006-07-11  Darin Adler  <darin@apple.com>
2088
2089         Reviewed by Adele.
2090
2091         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9809
2092           <rdar://problem/4619515>
2093           focus ring fails to appear on select element after choosing item from popup
2094
2095         - includes http://bugzilla.opendarwin.org/show_bug.cgi?id=9853
2096           improvements to select element, including some storage leak fixes
2097
2098         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::index): Use a const
2099         reference for the list items, so we don't have to copy a vector.
2100         * html/HTMLSelectElement.cpp:
2101         (WebCore::HTMLSelectElement::selectedIndex): Ditto.
2102         (WebCore::HTMLSelectElement::setSelectedIndex): Ditto.
2103         (WebCore::HTMLSelectElement::length): Ditto.
2104         (WebCore::HTMLSelectElement::remove): Ditto.
2105         (WebCore::HTMLSelectElement::value): Ditto.
2106         (WebCore::HTMLSelectElement::setValue): Ditto.
2107         (WebCore::HTMLSelectElement::stateValue): Ditto.
2108         (WebCore::HTMLSelectElement::restoreState): Ditto.
2109         (WebCore::HTMLSelectElement::appendFormData): Ditto.
2110         (WebCore::HTMLSelectElement::optionToListIndex): Ditto.
2111         (WebCore::HTMLSelectElement::listToOptionIndex): Ditto.
2112         (WebCore::HTMLSelectElement::recalcListItems): Made const, with the appropriate
2113         fields mutable.
2114         (WebCore::HTMLSelectElement::reset): Use a const reference for
2115         the list items, so we don't have to copy the vector. Remove the call to
2116         setSelectionChanged for the RenderMenuList case.
2117         (WebCore::HTMLSelectElement::notifyOptionSelected): Ditto, on both counts.
2118         (WebCore::HTMLSelectElement::defaultEventHandler): Call focus() before showing
2119         the pop-up.
2120         * html/HTMLSelectElement.h: The RenderMenuList class is no longer a friend.
2121         Changed the listItems function to return a const reference to the vector so
2122         it no longer copies the vector. Removed the const_cast to the call to
2123         recalcListItems and changed it to a const member function. Made m_recalcListItems
2124         mutable.
2125         * rendering/DeprecatedRenderSelect.cpp:
2126         (WebCore::DeprecatedRenderSelect::updateFromElement): Removed an unnecessary call
2127         to recalcListItems, which is called automatically. Use a const reference for the
2128         list items so we don't have to copy a vector.
2129         (WebCore::DeprecatedRenderSelect::layout): Ditto.
2130         (WebCore::DeprecatedRenderSelect::selectionChanged): Ditto.
2131         (WebCore::DeprecatedRenderSelect::updateSelection): Ditto.
2132         * rendering/RenderMenuList.cpp:
2133         (WebCore::RenderMenuList::RenderMenuList): Updated for renamed data members.
2134         (WebCore::RenderMenuList::createInnerBlock): Ditto.
2135         (WebCore::RenderMenuList::addChild): Ditto.
2136         (WebCore::RenderMenuList::removeChild): Ditto.
2137         (WebCore::RenderMenuList::setStyle): Ditto. Also removed code to set the style
2138         on the pop-up menu, because it's created with the correct style and destroyed
2139         before it a style change could occur.
2140         (WebCore::RenderMenuList::updateFromElement): Rearranged code to compute the
2141         maximum width in a simpler fashion, and to not bother trying to maintain
2142         the "selected" flags on the elements, since the HTMLSelectElement class
2143         takes care of that. Store the width as an int. Call setText to set the text
2144         based on the selected element's option text.
2145         (WebCore::RenderMenuList::paintObject): Don't check m_inner when setting
2146         up the clip -- always set up the clip.
2147         (WebCore::RenderMenuList::calcMinMaxWidth): Use m_optionsWidth directly
2148         instead of calling ceilf on m_longestWidth.
2149         (WebCore::RenderMenuList::showPopup): Don't use m_popupMenu to store the
2150         menu -- instead keep the pointer in a local variable. Get the selected
2151         index from the HTMLSelectElement.
2152         (WebCore::RenderMenuList::valueChanged): Call HTMLSelectElement::setSelectedIndex
2153         to do most of the work.
2154         * rendering/RenderMenuList.h: Renamed m_inner to m_innerBlock. Removed
2155         m_popupMenu, m_size, m_selectionChanged, and m_selectedIndex. Renamed
2156         m_longestWidth to m_optionsWidth and changed it to be an int. Removed
2157         unneeded override of removeLeftoverAnonymousBoxes function. Removed
2158         unneeded selectionChanged, setSelectionChanged, updateSelection, and
2159         hasPopupMenu functions. Removed extra includes.
2160         * rendering/RenderPopupMenu.cpp: (WebCore::RenderPopupMenu::populate):
2161         Change to iterate the list items instead of iterating all children
2162         of the select node.
2163         * rendering/RenderPopupMenu.h: Renamed getRenderMenuList to menuList.
2164         * rendering/RenderPopupMenuMac.mm:
2165         (WebCore::RenderPopupMenuMac::populate): Moved code to clear and create
2166         the pop-up here from the caller. Removed an extra retain that would cause
2167         the NSPopUpButtonCell to leak.
2168         (WebCore::RenderPopupMenuMac::showPopup): Removed unnecessary code to
2169         create the pop-up, which is now in populate, and also the call to the
2170         clear function, for the same reason. Reorganized code to make it a bit
2171         more readable. Removed an unnecessary if to check if frame is nil.
2172         Used a RefPtr to make sure we don't make a call on a frame after it's
2173         deleted. As part of the reorganization fixed a problem where we'd retain
2174         the event and then return early without releasing it in one case.
2175         (WebCore::RenderPopupMenuMac::addSeparator): Tweaked a little.
2176         (WebCore::RenderPopupMenuMac::addGroupLabel): Grouped all the code to
2177         manage the NSMenu at the bottom of the function.
2178         (WebCore::RenderPopupMenuMac::addOption): Ditto.
2179
2180 2006-07-11  Justin Garcia  <justin.garcia@apple.com>
2181
2182         Reviewed by levi
2183         
2184         <rdar://problem/4620686>
2185         REGRESSION: Mispelling markers are still displayed when using the delete key to place caret into a misspelled word
2186
2187         * bridge/mac/FrameMac.mm:
2188         (WebCore::FrameMac::respondToChangedSelection): Remove markers from newAdjacentWords 
2189         even if oldAdjacentWords is equal to newAdjacentWords.  This happens during a deletion.
2190         
2191
2192 2006-07-11  Tim Omernick  <timo@apple.com>
2193
2194         Reviewed by NOBODY (build fix)
2195
2196         * bindings/objc/DOMPrivate.h:
2197         Don't @class NPObject; that breaks files that actually #import <JavaScriptCore/npruntime.h>, since the NPObject
2198         there is of a different type.
2199         Also clarified a highly misleading comment from my last commit.  I meant to clarify the comment
2200         before landing.
2201
2202 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2203
2204         Reviewed by Geoff.
2205
2206         http://bugzilla.opendarwin.org/show_bug.cgi?id=9635
2207         REGRESSION: Crash when adding to cart at <http://www.yemeksepeti.com/>
2208         
2209         * html/HTMLTokenizer.cpp:
2210         (WebCore::HTMLTokenizer::scriptHandler):
2211         Don't load external scripts if the parser is stopped.
2212         
2213         * manual-tests/open-close-tokenizer-crash.html: Added.
2214         * manual-tests/resources/empty-file.js: Added.
2215         * manual-tests/resources/open-close-tokenizer-crash.html: Added.
2216         Add manual test.
2217
2218 2006-07-11  John Sullivan  <sullivan@apple.com>
2219
2220         Reviewed by Kevin, Timo O, Brady, Darin, and Hyatt (whee!)
2221
2222         - added support for creating a selection image with white text
2223
2224         * rendering/RenderObject.h:
2225         (WebCore::):
2226         add PaintRestriction enum
2227         (WebCore::RenderObject::PaintInfo::PaintInfo):
2228         add forceWhiteText boolean to PaintInfo struct
2229
2230         * page/FramePrivate.h:
2231         (WebCore::FramePrivate::FramePrivate):
2232         replaced m_selectionOnly bool with m_paintRestriction, which also handles forcing the
2233         text to white
2234
2235         * page/Frame.cpp:
2236         (WebCore::Frame::paint):
2237         updated to use & pass m_paintRestriction where it used to use & pass just m_selectionOnly
2238
2239         * bridge/mac/FrameMac.h:
2240         * bridge/mac/FrameMac.mm:
2241         (WebCore::FrameMac::selectionImage):
2242         now takes forceWhiteText parameter, stored in FramePrivate as part of PaintRestriction
2243
2244         * bridge/mac/WebCoreFrameBridge.h:
2245         * bridge/mac/WebCoreFrameBridge.mm:
2246         (-[WebCoreFrameBridge selectionImageForcingWhiteText:]):
2247         renamed from selectionImage, now takes forceWhiteText parameter, which is passed
2248         down into Frame
2249
2250         * rendering/RenderLayer.h:
2251         * rendering/RenderLayer.cpp:
2252         (WebCore::RenderLayer::paint):
2253         use a PaintRestriction value where we used to use a selectionOnly bool
2254         (WebCore::RenderLayer::paintLayer):
2255         ditto; also stores forceWhiteText in PaintInfo struct
2256
2257         * kcanvas/KCanvasResources.cpp:
2258         (WebCore::KCanvasMarker::draw):
2259         updated for changed signature of PaintInfo constructor
2260
2261         * ksvg2/svg/SVGMaskElement.cpp:
2262         (WebCore::SVGMaskElement::drawMaskerContent):
2263         ditto
2264
2265         * ksvg2/svg/SVGPatternElement.cpp:
2266         (WebCore::SVGPatternElement::drawPatternContentIntoTile):
2267         ditto
2268
2269         * rendering/InlineTextBox.cpp:
2270         (WebCore::InlineTextBox::paint):
2271         paint with white text color if forceWhiteText is set in PaintInfo struct
2272
2273 2006-07-11  Tim Omernick  <timo@apple.com>
2274
2275         Reviewed by Anders.
2276
2277         <http://bugzilla.opendarwin.org/show_bug.cgi?id=9843>:
2278         Give Netscape plug-ins access to their own DOM element
2279
2280         * html/HTMLPlugInElement.h:
2281         Just import JSC headers on Mac.  The NPObject and Bindings::Instance stuff is only used on Mac anyway.
2282         Changed __APPLE__ to PLATFORM(MAC).
2283         Added m_NPObject ivar.
2284         * html/HTMLPlugInElement.cpp:
2285         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
2286         Initialize the NPObject.
2287         (WebCore::HTMLPlugInElement::~HTMLPlugInElement):
2288         Release the NPObject when the element is destroyed.
2289         (WebCore::HTMLPlugInElement::createNPObject):
2290         Creates an NPObject for the element.
2291         (WebCore::HTMLPlugInElement::getNPObject):
2292         Returns the NPObject for the element, creating and caching it if necessary.
2293
2294         * html/HTMLAppletElement.h:
2295         Changed __APPLE__ to PLATFORM(MAC).
2296         * html/HTMLAppletElement.cpp:
2297         ditto
2298         * html/HTMLEmbedElement.h:
2299         ditto
2300         * html/HTMLEmbedElement.cpp:
2301         ditto
2302         * html/HTMLObjectElement.h:
2303         ditto
2304         * html/HTMLObjectElement.cpp:
2305         ditto
2306
2307         * bindings/objc/DOMPrivate.h:
2308         Added -[DOMElement _NPObject].
2309
2310         * bindings/objc/DOM.mm:
2311         (-[DOMElement _NPObject]):
2312         Returns the NPObject for the element.  Since this is only needed by the Netscape plug-in API, you can only get 
2313         the NPObject for applet, embed, and object elements.
2314         
2315 2006-07-11  Adele Peterson  <adele@apple.com>
2316
2317         Reviewed by Hyatt.
2318
2319         - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9861
2320         REGRESSION: Can't dynamically change list box to popup
2321         
2322         and updated fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
2323         REGRESSION: Can't dynamically change popup to list box
2324
2325         The original fix for 9859 was in the renderer, and I think we can catch the change
2326         earlier in the element to detach and reattach.
2327
2328         I also did some cleanup to remove the PopupButton code path from DeprecatedRenderSelect
2329
2330         Test: fast/forms/select-change-listbox-to-popup.html
2331
2332         * html/HTMLSelectElement.cpp:
2333         (WebCore::HTMLSelectElement::parseMappedAttribute): If the new attribute value is going to require us to change from listbox to popup or vice versa,
2334         and we're already attached, then detach and reattach to create the correct renderer.  If we're not attached, then we'll create the correct renderer
2335         when we attach.
2336         (WebCore::HTMLSelectElement::recalcStyle): Updated shouldUseMenuList since it no longer takes a RenderStyle.
2337         (WebCore::HTMLSelectElement::isKeyboardFocusable): ditto.
2338         (WebCore::HTMLSelectElement::isMouseFocusable): ditto.
2339         (WebCore::HTMLSelectElement::createRenderer): ditto.
2340         (WebCore::HTMLSelectElement::setRecalcListItems): ditto.
2341         (WebCore::HTMLSelectElement::reset): ditto.
2342         (WebCore::HTMLSelectElement::notifyOptionSelected): ditto.
2343         (WebCore::HTMLSelectElement::defaultEventHandler): ditto.
2344
2345         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList):
2346         This method no longer takes a RenderStyle.  That was leftover from when we used to use the appearance
2347         to determine whether or not to use the new menu list implementation.
2348
2349         * rendering/DeprecatedRenderSelect.h: Removed PopupButton code path.
2350         * rendering/DeprecatedRenderSelect.cpp:
2351         (WebCore::DeprecatedRenderSelect::DeprecatedRenderSelect):
2352         (WebCore::DeprecatedRenderSelect::setWidgetWritingDirection):
2353         (WebCore::DeprecatedRenderSelect::updateFromElement):
2354         (WebCore::DeprecatedRenderSelect::baselinePosition):
2355         (WebCore::DeprecatedRenderSelect::layout):
2356         (WebCore::DeprecatedRenderSelect::updateSelection):
2357
2358         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2359         Backed out previous fix since this is now done in HTMLSelectElement.
2360
2361 2006-07-11  Adele Peterson  <adele@apple.com>
2362
2363         Reviewed by Hyatt.
2364
2365         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
2366         REGRESSION: Can't dynamically change popup to list box
2367
2368         Test: fast/forms/select-change-popup-to-listbox.html
2369
2370         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2371         If the select element has the multiple property set, or has a size > 1, then it
2372         really should be a list box, so we detach and attach the element so it creates the
2373         correct type of renderer.
2374
2375 2006-07-11  John Sullivan  <sullivan@apple.com>
2376
2377         Reviewed by Beth Dakin and Tim Omernick
2378
2379         - fixed <rdar://problem/4622794> HiDPI: dragging the selection in Safari can show pixel cracks 
2380         at non-integral scale factors
2381
2382         * bridge/mac/FrameMac.mm:
2383         (WebCore::FrameMac::imageFromRect):
2384         round image rect in window coordinate space
2385
2386 2006-07-10  Darin Adler  <darin@apple.com>
2387
2388         Reviewed by Geoff.
2389
2390         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9811
2391           rdar://problem/4619572
2392           OPTION text contained in OPTGROUP appears at the wrong size
2393
2394         * dom/Node.h:
2395         * dom/Node.cpp: (WebCore::Node::renderStyle): Made a const member function.
2396         The derived classes were overriding with const member functions, and I could
2397         change either this or the derived -- decided to do this.
2398
2399 2006-07-10  Darin Adler  <darin@apple.com>
2400
2401         Reviewed by Geoff.
2402
2403         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9810
2404           rdar://problem/4619534
2405           OPTGROUP label text is using the default font instead of Lucida Grande
2406
2407         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::setFontFromControlSize):
2408         Code wants the family name, but was calling fontName, which is not the same thing.
2409         Also removed the unneeded conversion to DeprecatedString.
2410
2411 === Safari-521.16 ===
2412
2413 2006-07-10  David Kilzer  <ddkilzer@kilzer.net>
2414
2415         Reviewed by Darin.
2416
2417         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
2418           Implement select.options.add() method
2419
2420         Tests:
2421         - fast/dom/select-selectedIndex-multiple.html
2422         - fast/dom/select-selectedIndex.html
2423         - fast/js/select-options-add.html
2424
2425         * DerivedSources.make: Added JSHTMLOptionsCollection.h.
2426         * ForwardingHeaders/kjs/operations.h: Added.
2427         * WebCore.xcodeproj/project.pbxproj: Added new source files.
2428         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Added.
2429         (WebCore::JSHTMLOptionsCollection::length):
2430         (WebCore::JSHTMLOptionsCollection::setLength):
2431         (WebCore::JSHTMLOptionsCollection::indexSetter):
2432         * bindings/js/kjs_html.cpp: Removed JSHTMLOptionsCollection implementation.
2433         Renamed classes and methods for consistency.
2434         (KJS::JSHTMLElement::selectGetter):
2435         (KJS::JSHTMLElement::put):
2436         (KJS::JSHTMLElement::selectSetter):
2437         (KJS::JSHTMLCollection::JSHTMLCollection):
2438         (KJS::JSHTMLCollectionProtoFunc::callAsFunction):
2439         (KJS::getHTMLOptionsCollection):
2440         * bindings/js/kjs_html.h: Ditto.
2441         * bindings/scripts/CodeGeneratorJS.pm: Added support for HasCustomIndexSetter class attribute.
2442         Added support for Optional parameter attribute, which makes generated code assume overloaded
2443         implementation methods are available for a JavaScript function with optional arguments.  Changed
2444         local 'impl' variables to 'imp' so that impl() methods could be called without class designation.
2445         * html/HTMLOptionElement.idl: Added GenerateNativeConverter attribute.
2446         * html/HTMLOptionsCollection.cpp: Added methods used by generated JSHTMLOptionsCollection class.
2447         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
2448         (WebCore::HTMLOptionsCollection::add):
2449         (WebCore::HTMLOptionsCollection::selectedIndex):
2450         (WebCore::HTMLOptionsCollection::setSelectedIndex):
2451         (WebCore::HTMLOptionsCollection::setLength):
2452         * html/HTMLOptionsCollection.h: Ditto.
2453         * html/HTMLOptionsCollection.idl: Added.
2454
2455 2006-07-10  David Harrison  <harrison@apple.com>
2456
2457         Reviewed by Dave Hyatt.
2458
2459         <rdar://problem/4602408> -webkit-highlight needs to support images and elements other than text
2460
2461         * rendering/RenderBox.cpp:
2462         (WebCore::RenderBox::paintCustomHighlight):
2463         * rendering/RenderBox.h:
2464         Utility for subclasses.
2465         
2466         * rendering/RenderImage.cpp:
2467         (WebCore::RenderImage::paint):
2468         Custom highlight in front of images.
2469         
2470         * rendering/RenderListMarker.cpp:
2471         (WebCore::RenderListMarker::paint):
2472         Custom highlight in front of list markers.
2473
2474         * rendering/RenderWidget.cpp:
2475         (WebCore::RenderWidget::paint):
2476         Custom highlight in front of objects.
2477
2478 2006-07-10  David Hyatt  <hyatt@apple.com>
2479
2480         <rdar://problem/4620557> REGRESSION: In a mail message, text isn't painted
2481         correctly after choosing Redo Typing
2482
2483         Better fix for repainting issue with positioned objects when height
2484         changes.  Optimize when only a positioned child changes so that we don't
2485         incorrectly do normal flow layout.
2486
2487         Reviewed by darin
2488
2489         * WebCore.xcodeproj/project.pbxproj:
2490         * rendering/RenderBlock.cpp:
2491         (WebCore::RenderBlock::layoutBlock):
2492         * rendering/RenderFlexibleBox.cpp:
2493         (WebCore::RenderFlexibleBox::layoutBlock):
2494         * rendering/RenderTable.cpp:
2495         (WebCore::RenderTable::layout):
2496         * rendering/RenderView.cpp:
2497         (WebCore::RenderView::layout):
2498         * rendering/bidi.cpp:
2499         (WebCore::RenderBlock::layoutInlineChildren):
2500
2501 2006-07-10  Adele Peterson  <adele@apple.com>
2502
2503         Reviewed by Beth.
2504
2505         - Fix for <rdar://problem/4621442> REGRESSION (NativePopup) : Popup menus aren't drawn correctly on page at orbitz.com; cheaptickets.com
2506
2507         Test: fast/forms/select-style.html
2508
2509         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::isControlStyled):
2510         Don't let popups be style-able for now.  We'll allow it later, when we
2511         have a good way to handle border & backgrounds and still having it look like a control.
2512
2513 2006-07-10  Justin Garcia  <justin.garcia@apple.com>
2514
2515         Reviewed by harrison
2516         
2517         <rdar://problem/4619260>
2518         9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
2519         <rdar://problem/4619841>
2520         REGRESSION: Dragging selection over input field results in a crash (WebCore::maxDeepOffset(WebCore::Node const*)
2521
2522         * WebCore.xcodeproj/project.pbxproj:
2523         * editing/Selection.cpp:
2524         (WebCore::Selection::adjustForEditableContent): Iterate using next/previousVisuallyDistinctCandidate 
2525         instead of traverseNext/Previous node because we were skipping positions.  Jump out of shadow trees.  
2526         Migrate to isEditablePosition instead of isContentEditable.
2527         
2528
2529 2006-07-10  Beth Dakin  <bdakin@apple.com>
2530
2531         Reviewed by Adele.
2532
2533         Shuffling comments around from my last check-in to make things read 
2534         more clearly.
2535
2536         * page/DOMWindow.h:
2537         * page/DOMWindow.idl:
2538
2539 2006-07-10  Beth Dakin  <bdakin@apple.com>
2540
2541         Reviewed by Darin.
2542
2543         Fix for <rdar://problem/4621095> The should be a way to 
2544         access the user interface scale factor through the DOM
2545
2546         window.devicePixelRatio returns the user interface scale factor.
2547
2548         * page/DOMWindow.cpp:
2549         (WebCore::DOMWindow::devicePixelRatio):
2550         * page/DOMWindow.h:
2551         * page/DOMWindow.idl:
2552
2553 2006-07-10  Brady Eidson  <beidson@apple.com>
2554
2555         Reviewed by Alexey
2556
2557         Resolved the console error messages people got from the new DB even if they didn't have it enabled
2558
2559         * icon/IconDatabase.cpp:
2560         (WebCore::IconDatabase::pruneUnreferencedIcons):
2561         (WebCore::IconDatabase::pruneUnretainedIcons):
2562         Added quick check to bail if the DB isn't open
2563
2564 2006-07-10  David Harrison  <harrison@apple.com>
2565
2566         Reviewed by Tim Hatcher
2567
2568         Partial fix for...
2569         <rdar://problem/4619260> 9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
2570         
2571         * editing/Selection.cpp:
2572         (WebCore::Selection::adjustForEditableContent):
2573         Allow for node being 0.  This is a bandaid fix to prevent the crash.  It will still assert in a debug build.  See bug for more info.
2574
2575 2006-07-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2576
2577         Reviewed by Darin.
2578
2579         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9808
2580           REGRESSION: Incorrect layout (and ERROR) when forcing ATSU For All Text
2581
2582         * manual-tests/ATSU-bad-layout.html: Added.
2583         * platform/mac/FontMac.mm:
2584         (WebCore::Font::floatWidthForComplexText): Return 0 immediately for empty runs.
2585
2586 2006-07-10  Darin Adler  <darin@apple.com>
2587
2588         - try to fix the no-SVG build
2589
2590         * ksvg2/misc/SVGImageLoader.cpp: Move namespace brace inside the #if.
2591
2592 2006-07-10  Darin Adler  <darin@apple.com>
2593
2594         Reviewed by Anders.
2595
2596         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9833
2597           REGRESSION: Reproducible crash: RenderMenuList.cpp:58: failed assertion `!m_first'
2598
2599         * manual-tests/empty-title-popup.html: Added.
2600
2601         * rendering/RenderMenuList.h: Add createInnerBlock.
2602         * rendering/RenderMenuList.cpp:
2603         (WebCore::RenderMenuList::createInnerBlock): Factored out of addChild.
2604         (WebCore::RenderMenuList::addChild): Call createInnerBlock.
2605         (WebCore::RenderMenuList::setText): Changed parameter type.
2606         (WebCore::RenderMenuList::showPopup): Call createInnerBlock before calling
2607         the parent class's addChild.
2608
2609 2006-07-10  Rob Buis  <buis@kde.org>
2610
2611         Reviewed by Maciej via IRC.
2612
2613         Make sure the attributes are calculated against viewport width value,
2614         as defined in the spec.  http://paste.lisp.org/display/22342
2615
2616         * ksvg2/svg/SVGEllipseElement.cpp:
2617         (WebCore::SVGEllipseElement::rx): Changed LM_HEIGHT to LM_WIDTH.
2618         * ksvg2/svg/SVGLineElement.cpp:
2619         (SVGLineElement::x2): Ditto.
2620
2621 2006-07-10  Beth Dakin  <bdakin@apple.com>
2622
2623         Reviewed by Maciej.
2624
2625         Fix for <rdar://problem/4610314> Support the CSS3 content property 
2626         for images
2627
2628         This patch provides initial support for the CSS3 content property. 
2629         It lacks support for any content other than images, and only allows 
2630         content for elements that seemed safe for now.
2631
2632         * css/cssstyleselector.cpp:
2633         (WebCore::CSSStyleSelector::applyProperty): Remove restrictions for 
2634         just :before and :after
2635         * html/HTMLBRElement.cpp:
2636         (WebCore::HTMLBRElement::createRenderer):
2637         * html/HTMLFrameSetElement.cpp:
2638         (WebCore::HTMLFrameSetElement::createRenderer):
2639         * html/HTMLImageElement.cpp:
2640         (WebCore::HTMLImageElement::createRenderer):
2641         * html/HTMLLegendElement.cpp:
2642         (WebCore::HTMLLegendElement::createRenderer):
2643         * rendering/RenderImage.cpp:
2644         (WebCore::RenderImage::RenderImage):
2645         (WebCore::RenderImage::setCachedImage): Don't allow the image to be 
2646         set this way if it was already set with the content property.
2647         * rendering/RenderImage.h:
2648         (WebCore::RenderImage::setIsAnonymousImage): Anonymous images are 
2649         those set through the content property.
2650         (WebCore::RenderImage::isAnonymousImage):
2651         * rendering/RenderObject.cpp:
2652         (WebCore::RenderObject::createObject): If there is content 
2653         specified, create a RenderImage with the content and initialize the 
2654         cached image to whatever was specified in the CSS.
2655
2656 2006-07-10  Brady Eidson  <beidson@apple.com>
2657
2658         Reviewed by NOBODY (Build Fix!)
2659
2660         * icon/SiteIcon.cpp:
2661         (SiteIcon::getImage):
2662         Release build made an "unused variable" warning, which is, of course, an error.  fixed that.
2663
2664 2006-07-10  Brady Eidson  <beidson@apple.com>
2665
2666         Reviewed by Maciej
2667
2668         SQLite Icon DB now fully replicates functionality of the old DB, including pruning to keep unused
2669         information out to keep down disk usage.  For now, it is still off by default, as the critical
2670         feature of importing old icons into the new DB is still unrealized.
2671         If you'd like to test, add #define ICONDEBUG to your WebKitPrefix.h
2672
2673         * icon/IconDatabase.cpp:
2674         (WebCore::IconDatabase::IconDatabase):
2675         (WebCore::IconDatabase::open):
2676           -Sets up a timer for initial pruning
2677         (WebCore::IconDatabase::iconForPageURL):
2678           -Switched away from "dirty blob hack" as the problem is provisionally solved
2679         (WebCore::IconDatabase::retainIconForURL):
2680         (WebCore::IconDatabase::releaseIconForURL):
2681           -Same as found in WebKit
2682         (WebCore::IconDatabase::totalRetainCountForIconURL):
2683           -Adds up all retainers of icon
2684         (WebCore::IconDatabase::forgetIconForIconURLFromDatabase):
2685           -Wipes an Icon table entry out
2686         (WebCore::IconDatabase::establishTemporaryIconIDForIconURL):
2687         (WebCore::IconDatabase::establishTemporaryIconIDForEscapedIconURL):
2688         (WebCore::IconDatabase::establishIconIDForIconURL):
2689         (WebCore::IconDatabase::establishIconIDForEscapedIconURL):
2690           -Added ability to get an iconID without creating a new one if a lookup is all
2691            that is genuinely wanted
2692         (WebCore::IconDatabase::pruneUnreferencedIcons):
2693         (WebCore::IconDatabase::pruneUnretainedIcons):
2694           -Called on a timer on DB startup to clean it out
2695         * icon/IconDatabase.h:
2696         * icon/SiteIcon.cpp:
2697         (SiteIcon::SiteIcon):
2698         (SiteIcon::~SiteIcon):
2699           -Deletes the image on deletion
2700         (SiteIcon::getImage):
2701           -Cut down on no-longer-necessary debug info
2702
2703 2006-07-10  Anders Carlsson  <acarlsson@apple.com>
2704
2705         Reviewed by Adele.
2706
2707         http://bugzilla.opendarwin.org/show_bug.cgi?id=9245
2708         Quirksmode: Incorrect handling of disabled BUTTON elements
2709
2710         * html/HTMLButtonElement.cpp:
2711         (WebCore::HTMLButtonElement::defaultEventHandler):
2712         Don't call prepareSubmit if the element is disabled.
2713
2714         * html/HTMLInputElement.cpp:
2715         (WebCore::HTMLInputElement::defaultEventHandler):
2716         Don't call prepareSubmit if the element is disabled.
2717
2718 2006-07-10  Darin Adler  <darin@apple.com>
2719
2720         - try to fix Windows build
2721
2722         * platform/win/TemporaryLinkStubs.cpp: Put a few functions in the WebCore namespace.
2723         * platform/gdk/TemporaryLinkStubs.cpp: Ditto.
2724
2725 2006-07-10  Darin Adler  <darin@apple.com>
2726
2727         Reviewed by Geoff.
2728
2729         - fix failures seen in layout tests
2730
2731         * bindings/js/kjs_dom.cpp: (KJS::toJS): Restore one of the few WebCore:: prefixes
2732         that really needed to be there -- because we have two classes named JSHTMLDocument
2733         at the moment! (One in KJS and one in WebCore namespace.)
2734
2735 2006-07-10  Darin Adler  <darin@apple.com>
2736
2737         - try to fix Windows build
2738
2739         * rendering/RenderLayer.h: Correct a forward declaration of ScrollBar.
2740
2741 2006-07-09  Adele Peterson  <adele@apple.com>
2742
2743         Reviewed by Maciej.
2744
2745         Fix for <rdar://problem/4463835> Switch to use new popup menu implementation for <select>
2746
2747         * css/html4.css: Added style for new selects, and for list boxes.
2748         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList): Removed check for appearance so new popups can be styled.
2749    
2750         * rendering/RenderMenuList.cpp:
2751         (WebCore::RenderMenuList::setStyle): Removed padding.  This is now set by the theme.
2752         (WebCore::RenderMenuList::calcMinMaxWidth): Now takes minimum text size into account.
2753         * rendering/RenderMenuList.h: Removed baselinePosition since we're letting the theme calculate that.
2754
2755         * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isControlContainer): Added menuList as a ControlContainer, 
2756         so RenderThemeMac will compute its baseline.
2757         * rendering/RenderTheme.h: (WebCore::RenderTheme::minimumTextSize): Added.
2758         * rendering/RenderThemeMac.h: Added minimumTextSize, setPopupPaddingFromControlSize, popupButtonSizes, popupButtonMargins, popupButtonPadding.
2759         Removed sizeOfArrowControl. 
2760         * rendering/RenderThemeMac.mm:
2761         (WebCore::): Added enum for padding.
2762         (WebCore::RenderThemeMac::adjustRepaintRect): Now inflates rect to account for control shadow.
2763         (WebCore::RenderThemeMac::baselinePosition): Now calculates baseline for menulist.
2764         (WebCore::RenderThemeMac::popupButtonMargins): Tweaked values.
2765         (WebCore::RenderThemeMac::popupButtonSizes): Added.
2766         (WebCore::RenderThemeMac::popupButtonPadding): Added, so different padding can be set for different control sizes.
2767         (WebCore::RenderThemeMac::setPopupPaddingFromControlSize): Added.
2768         (WebCore::RenderThemeMac::paintMenuList): Now inflates rect to account for control shadow.
2769         (WebCore::RenderThemeMac::adjustMenuListStyle): Resets border, sets padding, sets control size.
2770         (WebCore::RenderThemeMac::setPopupButtonCellState): Removed unnecessary class name.
2771         (WebCore::RenderThemeMac::minimumTextSize): Added.
2772
2773 2006-07-09  Darin Adler  <darin@apple.com>
2774
2775         - add back "unused code" for plain text fields, still used by <isindex>!
2776
2777         * platform/TextField.h:
2778         * platform/mac/TextFieldMac.mm:
2779         * platform/mac/WebCoreTextField.h:
2780         * platform/mac/WebCoreTextField.mm:
2781         * rendering/RenderLineEdit.cpp:
2782
2783 2006-07-09  Darin Adler  <darin@apple.com>
2784
2785         Reviewed by Tim Hatcher.
2786
2787         - put more into the WebCore namespace
2788         - removed unused code for plain text fields
2789
2790         Put more classes, class templates, enums, functions, and constants into
2791         the WebCore namespace, including all the headers in the platform directory.
2792
2793         Removed lots of unneeded "WebCore::" qualifiers and "using" directives.
2794
2795         Added some "WebCore::" qualifiers in a few places.
2796
2797         Removed "uses WebCore::" in headers that we said we'd remove "when
2798         everything is in the WebCore namespace".
2799
2800         * bindings/js/JSDOMParser.cpp:
2801         * bindings/js/JSHTMLElementWrapperFactory.cpp:
2802         * bindings/js/JSXSLTProcessor.cpp:
2803         * bindings/js/kjs_binding.cpp:
2804         * bindings/js/kjs_css.cpp:
2805         * bindings/js/kjs_dom.cpp:
2806         * bindings/js/kjs_dom.h:
2807         * bindings/js/kjs_events.cpp:
2808         * bindings/js/kjs_proxy.h:
2809         * bindings/js/kjs_window.h:
2810         * bindings/objc/DOM.mm:
2811         * bridge/History.h:
2812         * bridge/JavaAppletWidget.h:
2813         * bridge/mac/FormDataMac.h:
2814         * bridge/mac/FormDataMac.mm:
2815         * bridge/mac/WebCoreAXObject.mm:
2816         * bridge/mac/WebCoreEncodings.mm:
2817         * bridge/mac/WebCoreFrameBridge.h:
2818         * bridge/mac/WebCoreIconDatabaseBridge.mm:
2819         * bridge/mac/WebCorePageState.h:
2820         * bridge/mac/WebCoreScriptDebugger.mm:
2821         * bridge/mac/WebCoreSettings.h:
2822         * css/CSSGrammar.y:
2823         * css/CSSPageRule.cpp:
2824         * css/CSSPageRule.h:
2825         * css/MediaList.cpp:
2826         * css/cssstyleselector.h:
2827         * dom/Clipboard.h:
2828         * dom/Document.cpp:
2829         * dom/Document.h:
2830         * dom/EventTargetNode.h:
2831         * dom/Node.cpp:
2832         * dom/Node.h:
2833         * dom/Position.h:
2834         * dom/Range.cpp:
2835         * dom/XMLTokenizer.cpp:
2836         * editing/AppendNodeCommand.h:
2837         * editing/ApplyStyleCommand.cpp:
2838         * editing/BreakBlockquoteCommand.cpp:
2839         * editing/BreakBlockquoteCommand.h:
2840         * editing/CompositeEditCommand.cpp:
2841         * editing/CompositeEditCommand.h:
2842         * editing/CreateLinkCommand.h:
2843         * editing/DeleteFromTextNodeCommand.h:
2844         * editing/DeleteSelectionCommand.h:
2845         * editing/FormatBlockCommand.h:
2846         * editing/HTMLInterchange.cpp:
2847         * editing/HTMLInterchange.h:
2848         * editing/IndentOutdentCommand.h:
2849         * editing/InsertIntoTextNodeCommand.h:
2850         * editing/InsertLineBreakCommand.h:
2851         * editing/InsertListCommand.h:
2852         * editing/InsertNodeBeforeCommand.h:
2853         * editing/InsertTextCommand.cpp:
2854         * editing/InsertTextCommand.h:
2855         * editing/JSEditor.cpp:
2856         * editing/JSEditor.h:
2857         * editing/JoinTextNodesCommand.h:
2858         * editing/MergeIdenticalElementsCommand.cpp:
2859         * editing/MergeIdenticalElementsCommand.h:
2860         * editing/ModifySelectionListLevel.h:
2861         * editing/MoveSelectionCommand.h:
2862         * editing/RebalanceWhitespaceCommand.h:
2863         * editing/RemoveNodeAttributeCommand.h:
2864         * editing/RemoveNodeCommand.h:
2865         * editing/RemoveNodePreservingChildrenCommand.h:
2866         * editing/ReplaceSelectionCommand.h:
2867         * editing/SetNodeAttributeCommand.h:
2868         * editing/SplitElementCommand.cpp:
2869         * editing/SplitElementCommand.h:
2870         * editing/SplitTextNodeCommand.cpp:
2871         * editing/SplitTextNodeCommand.h:
2872         * editing/SplitTextNodeContainingElementCommand.h:
2873         * editing/TypingCommand.cpp:
2874         * editing/TypingCommand.h:
2875         * editing/UnlinkCommand.h:
2876         * editing/VisiblePosition.cpp:
2877         * editing/WrapContentsInDummySpanCommand.cpp:
2878         * editing/WrapContentsInDummySpanCommand.h:
2879         * editing/markup.cpp:
2880         * editing/markup.h:
2881         * html/HTMLAnchorElement.cpp:
2882         * html/HTMLBodyElement.cpp:
2883         * html/HTMLButtonElement.h:
2884         * html/HTMLCollection.h:
2885         * html/HTMLDocument.h:
2886         * html/HTMLEmbedElement.cpp:
2887         * html/HTMLFormElement.cpp:
2888         * html/HTMLFormElement.h:
2889         * html/HTMLFrameElement.cpp:
2890         * html/HTMLFrameSetElement.cpp:
2891         * html/HTMLKeygenElement.cpp:
2892         * html/HTMLLabelElement.cpp:
2893         * html/HTMLObjectElement.cpp:
2894         * html/HTMLObjectElement.h:
2895         * html/HTMLTableElement.cpp:
2896         * html/HTMLTablePartElement.cpp:
2897         * icon/IconDatabase.h:
2898         * kcanvas/KCanvasPath.h:
2899         * kcanvas/KCanvasResources.cpp:
2900         * kcanvas/KCanvasResources.h:
2901         * kcanvas/KCanvasTreeDebug.cpp:
2902         * kcanvas/KCanvasTreeDebug.h:
2903         * kcanvas/RenderSVGContainer.cpp:
2904         * kcanvas/RenderSVGText.h:
2905         * kcanvas/device/KRenderingPaintServer.h:
2906         * kcanvas/device/KRenderingPaintServerGradient.h:
2907         * kcanvas/device/KRenderingPaintServerSolid.cpp:
2908         * ksvg2/misc/SVGImageLoader.cpp:
2909         * ksvg2/svg/SVGElement.cpp:
2910         * ksvg2/svg/SVGElement.h:
2911         * ksvg2/svg/SVGForeignObjectElement.cpp:
2912         * ksvg2/svg/SVGForeignObjectElement.h:
2913         * ksvg2/svg/SVGImageElement.cpp:
2914         * ksvg2/svg/SVGPoint.h:
2915         * ksvg2/svg/SVGStylable.h:
2916         * ksvg2/svg/SVGTRefElement.cpp:
2917         * ksvg2/svg/SVGTRefElement.h:
2918         * ksvg2/svg/SVGTSpanElement.cpp:
2919         * ksvg2/svg/SVGTSpanElement.h:
2920         * ksvg2/svg/SVGTextElement.h:
2921         * ksvg2/svg/svgpathparser.cpp:
2922         * ksvg2/svg/svgpathparser.h:
2923         * loader/Cache.h:
2924         * loader/DocLoader.h:
2925         * loader/LoaderFunctions.h:
2926         * loader/mac/LoaderFunctionsMac.mm:
2927         * page/Frame.h:
2928         * page/FrameView.h:
2929         * page/Page.h:
2930         * page/Settings.h:
2931         * platform/AffineTransform.cpp:
2932         * platform/AffineTransform.h:
2933         * platform/Arena.cpp:
2934         * platform/Arena.h:
2935         * platform/CookieJar.h:
2936         * platform/DeprecatedCString.cpp:
2937         * platform/DeprecatedCString.h:
2938         * platform/DeprecatedPtrList.h:
2939         * platform/DeprecatedPtrListImpl.cpp:
2940         * platform/DeprecatedPtrListImpl.h:
2941         * platform/DeprecatedPtrQueue.h:
2942         * platform/DeprecatedString.cpp:
2943         * platform/DeprecatedString.h:
2944         * platform/DeprecatedStringList.cpp:
2945         * platform/DeprecatedStringList.h:
2946         * platform/DeprecatedValueList.h:
2947         * platform/DeprecatedValueListImpl.cpp:
2948         * platform/DeprecatedValueListImpl.h:
2949         * platform/FileButton.h:
2950         * platform/FloatPoint.h:
2951         * platform/FloatRect.h:
2952         * platform/FloatSize.h:
2953         * platform/FontData.h:
2954         * platform/FontFallbackList.h:
2955         * platform/GraphicsContext.h:
2956         * platform/IntPoint.h:
2957         * platform/IntRect.h:
2958         * platform/IntSize.h:
2959         * platform/KURL.cpp:
2960         * platform/KURL.h:
2961         * platform/ListBox.h:
2962         * platform/Logging.cpp:
2963         * platform/Logging.h:
2964         * platform/Pen.h:
2965         * platform/PopUpButton.h:
2966         * platform/RegularExpression.cpp:
2967         * platform/RegularExpression.h:
2968         * platform/SSLKeyGenerator.h:
2969         * platform/ScrollBar.h:
2970         * platform/SegmentedString.h:
2971         * platform/Shared.h:
2972         * platform/Slider.h:
2973         * platform/StringImpl.h:
2974         * platform/TextBox.h:
2975         * platform/TextField.h:
2976         * platform/TextStream.cpp:
2977         * platform/TextStream.h:
2978         * platform/TransferJob.h:
2979         * platform/TransferJobClient.h:
2980         * platform/Widget.h:
2981         * platform/cg/AffineTransformCG.cpp:
2982         * platform/mac/ClipboardMac.h:
2983         * platform/mac/ClipboardMac.mm:
2984         * platform/mac/DeprecatedStringListMac.mm:
2985         * platform/mac/FontCacheMac.mm:
2986         * platform/mac/KURLMac.mm:
2987         * platform/mac/ListBoxMac.mm:
2988         * platform/mac/PopUpButtonMac.mm:
2989         * platform/mac/SSLKeyGeneratorMac.mm:
2990         * platform/mac/TextBoxMac.mm:
2991         * platform/mac/TextFieldMac.mm:
2992         * platform/mac/WebCoreTextArea.h:
2993         * platform/mac/WebCoreTextArea.mm:
2994         * platform/mac/WebCoreTextField.h:
2995         * platform/mac/WebCoreTextField.mm:
2996         * rendering/DeprecatedRenderSelect.h:
2997         * rendering/RenderArena.cpp:
2998         * rendering/RenderArena.h:
2999         * rendering/RenderBlock.cpp:
3000         * rendering/RenderBox.cpp:
3001         * rendering/RenderContainer.cpp:
3002         * rendering/RenderFlexibleBox.cpp:
3003         * rendering/RenderFlow.cpp:
3004         * rendering/RenderLayer.cpp:
3005         * rendering/RenderLineEdit.cpp:
3006         * rendering/RenderObject.h:
3007         * rendering/RenderStyle.cpp:
3008         * rendering/RenderStyle.h:
3009         * rendering/RenderText.cpp:
3010         * rendering/RenderTextFragment.cpp:
3011         * rendering/RenderTheme.h:
3012         * rendering/RenderTreeAsText.cpp:
3013         * rendering/RenderTreeAsText.h:
3014         * rendering/RenderView.h:
3015         * rendering/bidi.h:
3016         * xml/XSLStyleSheet.cpp:
3017         * xml/XSLTProcessor.cpp:
3018
3019 2006-07-09  Geoffrey Garen  <ggaren@apple.com>
3020
3021         Reviewed by Beth.
3022
3023         * bindings/js/kjs_window.cpp:
3024         (KJS::Window::clear): Garbage collect after reinitalizing the global
3025         object, not before, since the reinitialization tends to create garbage.
3026
3027 2006-07-09  Timothy Hatcher  <timothy@apple.com>
3028
3029         Reviewed by Darin.
3030
3031         Bug 9820: Move new DOM API that has been through API review to public headers
3032         http://bugzilla.opendarwin.org/show_bug.cgi?id=9820
3033
3034         * bindings/objc/DOM.mm:
3035         (-[DOMElement focus]):
3036         (-[DOMElement blur]):
3037         (-[DOMRange text]):
3038         (-[DOMRange _text]):
3039         * bindings/objc/DOMCSS.mm:
3040         (-[DOMRGBColor color]):
3041         (-[DOMRGBColor _color]):
3042         * bindings/objc/DOMCore.h:
3043         * bindings/objc/DOMEvents.h:
3044         * bindings/objc/DOMExtensions.h:
3045         * bindings/objc/DOMHTML.mm:
3046         (-[DOMHTMLElement titleDisplayString]):
3047         (-[DOMHTMLDocument createDocumentFragmentWithMarkupString:baseURL:]):
3048         (-[DOMHTMLDocument createDocumentFragmentWithText:]):
3049         (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:]):
3050         (-[DOMHTMLDocument _createDocumentFragmentWithText:]):
3051         * bindings/objc/DOMPrivate.h:
3052         * bindings/objc/DOMXPath.h:
3053         * bindings/objc/DOMXPath.mm:
3054
3055 2006-07-09  Beth Dakin  <bdakin@apple.com>
3056
3057         Reviewed by Maciej.
3058
3059         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9749 A 
3060         nested content editable div causes unnecessary screen redraws.
3061         
3062         We were repainting too much because we were deciding that we needed 
3063         a full layout because we didn't have a first line box. Our code 
3064         used to hold a lot of assumptions that positioned elements would 
3065         always have line boxes, but I fixed a few bugs a while back that 
3066         appeared because this assumption isn't true. This assumption was 
3067         also causing the extra redraws because the check meant that we 
3068         would decide to do a full layout for any positioned element that 
3069         did not have any line boxes in the first place. Maciej and I talked 
3070         about this, and we couldn't figure out why the check for line boxes 
3071         was part of determining if we need a full layout in the first 
3072         place. After hunting around the code, we decided to assume that 
3073         this check is antiquated. Removing it fixes the bug and doesn't 
3074         seem to break any layout tests. So, fingers crossed!
3075
3076         Will add layout test so soon.
3077
3078         * rendering/bidi.cpp:
3079         (WebCore::RenderBlock::layoutInlineChildren): Remove firstLineBox 
3080         check.
3081
3082 2006-07-09  David Harrison  <harrison@apple.com>
3083
3084         Reviewed by John Sullivan.
3085
3086         <rdar://problem/4598149> Deleting the contents of a DOMRange and then inserting a node into it crashes in WebCore::Font::canUseGlyphCache
3087
3088         Test: fast/dom/delete-contents.html
3089         
3090         * dom/Range.cpp:
3091         (WebCore::Range::processContents):
3092
3093 2006-07-09  Darin Adler  <darin@apple.com>
3094
3095         - another round of renaming; and KWQ is dead
3096
3097         * WebCore.vcproj/WebCore/WebCore.vcproj: Remove paths for kwq and khtml directories.
3098         Move files to their new locations. Did rename.
3099         * WebCore.xcodeproj/project.pbxproj: Move files to their new locations. Did rename.
3100         * WebCoreSources.bkl: Did rename.
3101         * webcore-base.bkl: Removed kwq.
3102
3103         * kwq/AccessibilityObjectCache.h: Removed.
3104         * kwq/AccessibilityObjectCache.mm: Removed.
3105         * kwq/FormDataMac.h: Removed.
3106         * kwq/FormDataMac.mm: Removed.
3107         * kwq/WebCoreAXObject.h: Removed.
3108         * kwq/WebCoreAXObject.mm: Removed.
3109         * kwq/WebCoreEditCommand.h: Removed.
3110         * kwq/WebCoreEditCommand.mm: Removed.
3111         * kwq/WebCorePageState.h: Removed.
3112         * kwq/WebCorePageState.mm: Removed.
3113         * kwq/WebCoreResourceLoaderImp.h: Removed.
3114         * kwq/WebCoreResourceLoaderImp.mm: Removed.
3115
3116         * bridge/AXObjectCache.h: Added.
3117         * bridge/mac/AXObjectCacheMac.mm: Added.
3118         * bridge/mac/WebCoreAXObject.h: Added.
3119         * bridge/mac/WebCoreAXObject.mm: Added.
3120
3121         * loader/CachedObject.cpp: Removed.
3122         * loader/CachedObject.h: Removed.
3123         * loader/CachedObjectClient.h: Removed.
3124         * loader/CachedObjectClientWalker.cpp: Removed.
3125         * loader/CachedObjectClientWalker.h: Removed.
3126
3127         * loader/CachedResource.cpp: Added.
3128         * loader/CachedResource.h: Added.
3129         * loader/CachedResourceClient.h: Added.
3130         * loader/CachedResourceClientWalker.cpp: Added.
3131         * loader/CachedResourceClientWalker.h: Added.
3132
3133         * bridge/mac/FrameMac.mm:
3134         * bridge/mac/WebCoreFrameBridge.mm:
3135         * css/CSSImageValue.h:
3136         * css/CSSImportRule.h:
3137         * dom/Document.cpp:
3138         * dom/Document.h:
3139         * dom/Notation.h:
3140         * dom/ProcessingInstruction.h:
3141         * dom/XMLTokenizer.cpp:
3142         * html/CanvasPattern.h:
3143         * html/HTMLDocument.h:
3144         * html/HTMLImageLoader.cpp:
3145         * html/HTMLImageLoader.h:
3146         * html/HTMLLinkElement.h:
3147         * html/HTMLScriptElement.cpp:
3148         * html/HTMLScriptElement.h:
3149         * html/HTMLTokenizer.cpp:
3150         * html/HTMLTokenizer.h:
3151         * kcanvas/KCanvasFilters.h:
3152         * ksvg2/svg/SVGCursorElement.cpp:
3153         * ksvg2/svg/SVGCursorElement.h:
3154         * ksvg2/svg/SVGFEImageElement.cpp:
3155         * ksvg2/svg/SVGFEImageElement.h:
3156         * loader/Cache.cpp:
3157         * loader/Cache.h:
3158         * loader/CachedCSSStyleSheet.cpp:
3159         * loader/CachedCSSStyleSheet.h:
3160         * loader/CachedImage.cpp:
3161         * loader/CachedImage.h:
3162         * loader/CachedScript.cpp:
3163         * loader/CachedScript.h:
3164         * loader/CachedXBLDocument.cpp:
3165         * loader/CachedXBLDocument.h:
3166         * loader/CachedXSLStyleSheet.cpp:
3167         * loader/CachedXSLStyleSheet.h:
3168         * loader/DocLoader.cpp:
3169         * loader/DocLoader.h:
3170         * loader/LoaderFunctions.h:
3171         * loader/Request.cpp:
3172         * loader/Request.h:
3173         * loader/loader.cpp:
3174         * loader/loader.h:
3175         * loader/mac/LoaderFunctionsMac.mm:
3176         * page/Frame.cpp:
3177         * page/FrameView.cpp:
3178         * platform/gdk/TemporaryLinkStubs.cpp:
3179         * platform/mac/ClipboardMac.h:
3180         * platform/win/TemporaryLinkStubs.cpp:
3181         * rendering/RenderBox.h:
3182         * rendering/RenderContainer.cpp:
3183         * rendering/RenderImage.cpp:
3184         * rendering/RenderImage.h:
3185         * rendering/RenderLayer.h:
3186         * rendering/RenderObject.cpp:
3187         * rendering/RenderObject.h:
3188         * rendering/RenderStyle.cpp:
3189         * rendering/RenderStyle.h:
3190         * xml/XSLImportRule.h:
3191         Did renaming.
3192
3193         * platform/mac/can-convert.mm: Removed.
3194
3195 2006-07-09  Anders Carlsson  <acarlsson@apple.com>
3196
3197         Reviewed by Tim O.
3198
3199         * WebCore.exp:
3200         Add wkPathFromFont.
3201         
3202         * platform/mac/FontDataMac.mm:
3203         (-[NSFont WebCore]):
3204         Use wkPathFromFont.
3205         
3206         * platform/mac/WebCoreSystemInterface.h:
3207         * platform/mac/WebCoreSystemInterface.mm:
3208         Declare wkPathFromFont.
3209
3210 2006-07-09  Brady Eidson  <beidson@apple.com>
3211
3212         Reviewed by Maciej
3213
3214         Set the stage to remove the workaround for the SQLite BLOB corruption.  A few other small cleanups, and
3215         preparation for pruning unreferenced and unretained icons.
3216
3217         * icon/IconDatabase.cpp:
3218         (WebCore::IconDatabase::recreateDatabase):  Added another trigger to assist in icon removal
3219         (WebCore::IconDatabase::deletePrivateTables):  Cleaned up logging messages
3220         (WebCore::IconDatabase::imageDataForIconID):  #ifdefed the blobbing hack for impending removal, use the real blob by default
3221         (WebCore::IconDatabase::imageDataForIconURL):  same
3222         (WebCore::IconDatabase::imageDataForPageURL):  same
3223         (WebCore::IconDatabase::pruneUnreferencedIcons):  Will delete any icons and their data that are not referenced
3224           by any PageURL
3225         * icon/IconDatabase.h:
3226
3227         * icon/SQLDatabase.h:  Changed BlobAsVector to be unsigned char as thats the most reasonable type for
3228           a byte-buffer, and is what CFData expects
3229         * icon/SQLStatement.cpp:
3230         (WebCore::SQLStatement::getColumnBlobAsVector):
3231
3232 2006-07-09  Darin Adler  <darin@apple.com>
3233
3234         - move all but the last 12 files out of kwq directory
3235         - removed a few unused source files I discovered
3236
3237         * WebCore.vcproj/WebCore/WebCore.vcproj: Update for new file locations.
3238         * WebCore.xcodeproj/project.pbxproj: Ditto.
3239
3240         * bridge/mac/FrameMac.mm:
3241         * dom/Element.h:
3242         * html/HTMLImageLoader.cpp:
3243         * loader/Cache.cpp:
3244         * loader/Cache.h:
3245         * loader/CachedCSSStyleSheet.cpp:
3246         * loader/CachedCSSStyleSheet.h:
3247         * loader/CachedImage.cpp:
3248         * loader/CachedImage.h:
3249         * loader/CachedObject.h:
3250         * loader/CachedScript.cpp:
3251         * loader/CachedScript.h:
3252         * loader/CachedXBLDocument.cpp:
3253         * loader/CachedXBLDocument.h:
3254         * loader/CachedXSLStyleSheet.cpp:
3255         * loader/CachedXSLStyleSheet.h:
3256         * loader/DocLoader.cpp:
3257         * loader/DocLoader.h:
3258         * page/Frame.cpp:
3259         * page/Frame.h:
3260         * page/FramePrivate.h:
3261         * platform/gdk/TemporaryLinkStubs.cpp:
3262         * platform/win/TemporaryLinkStubs.cpp:
3263         * rendering/DeprecatedSlider.cpp:
3264         * rendering/RenderObject.h:
3265         * xml/xmlhttprequest.cpp:
3266         Updated includes as needed for file location changes. Changed
3267         CachePolicy uses to match new filename and enum names.
3268
3269         * loader/CachedResource.cpp: Removed.
3270         * loader/CachedResource.h: Removed.
3271         * loader/CachedResourceClient.h: Removed.
3272         * loader/CachedResourceClientWalker.cpp: Removed.
3273         * loader/CachedResourceClientWalker.h: Removed.
3274         The above files were checked in by accident a while back. The rename of
3275         CachedObject to CachedResource is now reflected in do-webcore-rename,
3276         and will be done soon.
3277
3278         * kwq/AffineTransform.cpp: Removed.
3279         * kwq/AffineTransform.h: Removed.
3280         * kwq/CacheControl.h: Removed.
3281         * kwq/DeprecatedPtrQueue.h: Removed.
3282         * kwq/FileButton.h: Removed.
3283         * kwq/FileButton.mm: Removed.
3284         * kwq/ListBox.h: Removed.
3285         * kwq/ListBox.mm: Removed.
3286         * kwq/LoaderFunctions.h: Removed.
3287         * kwq/LoaderFunctions.mm: Removed.
3288         * kwq/PopUpButton.h: Removed.
3289         * kwq/PopUpButton.mm: Removed.
3290         * kwq/SSLKeyGenerator.h: Removed.
3291         * kwq/SSLKeyGenerator.mm: Removed.
3292         * kwq/Settings.h: Removed.
3293         * kwq/TextBox.h: Removed.
3294         * kwq/TextBox.mm: Removed.
3295         * kwq/TextField.h: Removed.
3296         * kwq/TextField.mm: Removed.
3297         * kwq/WebCoreScrollBar.h: Removed.
3298         * kwq/WebCoreScrollBar.mm: Removed.
3299         * kwq/WebCoreSlider.h: Removed.
3300         * kwq/WebCoreSlider.mm: Removed.
3301
3302         * loader/CachePolicy.h: Added.
3303         * loader/LoaderFunctions.h: Added.
3304
3305         * loader/mac/LoaderFunctionsMac.mm: Added.
3306
3307         * page/Settings.h: Added.
3308
3309         * platform/AffineTransform.cpp: Added.
3310         * platform/AffineTransform.h: Added.
3311         * platform/DeprecatedPtrQueue.h: Added.
3312         * platform/FileButton.h: Added.
3313         * platform/ListBox.h: Added.
3314         * platform/PopUpButton.h: Added.
3315         * platform/SSLKeyGenerator.h: Added.
3316         * platform/ScrollBar.h: Added.
3317         * platform/Slider.h: Added.
3318         * platform/TextBox.h: Added.
3319         * platform/TextField.h: Added.
3320
3321         * platform/cg/AffineTransformCG.cpp: Added.
3322
3323         * platform/mac/FileButtonMac.mm: Added.
3324         * platform/mac/ListBoxMac.mm: Added.
3325         * platform/mac/PopUpButtonMac.mm: Added.
3326         * platform/mac/SSLKeyGeneratorMac.mm: Added.
3327         * platform/mac/ScrollBarMac.mm: Added.
3328         * platform/mac/ScrollBarMac.mm: Added.
3329         * platform/mac/SliderMac.mm: Added.
3330         * platform/mac/SliderMac.mm: Added.
3331         * platform/mac/TextBoxMac.mm: Added.
3332         * platform/mac/TextFieldMac.mm: Added.
3333
3334 2006-07-09  Darin Adler  <darin@apple.com>
3335
3336         - move 4 files out of kwq directory
3337         - make some minor project adjustments for the WebCore project
3338
3339         * WebCore.xcodeproj/project.pbxproj: Link libsqlite3 the same way we do other
3340         libraries, rather than using a custom linker option. Moved the files from their
3341         old locations to the new ones. Removed "khtml" from the list of header search
3342         paths since that directory doesn't exist any more. Eliminated STYLE_LDFLAGS
3343         and just put -umbrella WebKit in OTHER_LDFLAGS in the Production configuration
3344         (was a leftover from "build styles" in Xcode 1). Changed to use EXPORTED_SYMBOLS_FILE
3345         instead of using -exported_symbols_list directly again now that Xcode has fixed the
3346         "strip twice" bug. Removed unneeded explicit SECTORDER_FLAGS = "" settings.
3347         Removed the explicit -Y,3 option now that Xcode does that by default.
3348
3349         * WebCore.vcproj/WebCore/WebCore.vcproj: Removed some obsolete uneeded files,
3350         many of which didn't exist any more. Moved the files from their old locations
3351         to the new ones.
3352
3353         * WebCoreSources.bkl: Moved the files from their old locations to the new ones.
3354
3355         * kwq/DeprecatedCString.cpp: Removed.
3356         * kwq/DeprecatedCString.h: Removed.
3357         * kwq/TextStream.cpp: Removed.
3358         * kwq/TextStream.h: Removed.
3359         * platform/DeprecatedCString.cpp: Added.
3360         * platform/DeprecatedCString.h: Added.
3361         * platform/TextStream.cpp: Added.
3362         * platform/TextStream.h: Added.
3363
3364 2006-07-09  Darin Adler  <darin@apple.com>
3365
3366         Rubber stamped by Maciej (kinda).
3367
3368         - did the next pass of renaming (used do-webcore-rename script)
3369           this takes care of most of the remaining KWQ names (almost all)
3370
3371         * WebCore+SVG/DOMList.h:
3372         * WebCore.vcproj/WebCore/WebCore.vcproj:
3373         * WebCore.xcodeproj/project.pbxproj:
3374         * WebCoreSources.bkl:
3375         * bindings/js/kjs_dom.cpp:
3376         * bindings/js/kjs_window.cpp:
3377         * bindings/objc/DOMHTML.mm:
3378         * bridge/mac/FrameMac.h:
3379         * bridge/mac/FrameMac.mm:
3380         * bridge/mac/WebCoreFrameBridge.mm:
3381         * bridge/mac/WebCoreSettings.h:
3382         * bridge/mac/WebCoreSettings.mm:
3383         * bridge/win/FrameWin.cpp:
3384         * css/CSSPrimitiveValue.cpp:
3385         * css/CSSValueKeywords.in:
3386         * css/MediaQueryEvaluator.cpp:
3387         * css/cssparser.cpp:
3388         * css/cssstyleselector.cpp:
3389         * css/cssstyleselector.h:
3390         * dom/CharacterData.cpp:
3391         * dom/CharacterData.h:
3392         * dom/Document.cpp:
3393         * dom/Element.cpp:
3394         * dom/Element.h:
3395         * dom/EventTargetNode.cpp:
3396         * dom/EventTargetNode.h:
3397         * dom/Node.cpp:
3398         * dom/Node.h:
3399         * dom/Position.cpp:
3400         * dom/ProcessingInstruction.cpp:
3401         * dom/QualifiedName.cpp:
3402         * dom/QualifiedName.h:
3403         * dom/XMLTokenizer.cpp: Added.
3404         * dom/xml_tokenizer.cpp: Removed.
3405         * dom/xml_tokenizer.h: Removed.
3406         * editing/EditAction.h:
3407         * editing/HTMLInterchange.cpp:
3408         * editing/HTMLInterchange.h:
3409         * editing/Selection.h:
3410         * editing/SelectionController.h:
3411         * editing/TextAffinity.h:
3412         * editing/TextIterator.cpp:
3413         * editing/TextIterator.h:
3414         * editing/VisiblePosition.h:
3415         * editing/htmlediting.cpp:
3416         * editing/markup.cpp:
3417         * editing/markup.h:
3418         * editing/visible_units.cpp:
3419         * editing/visible_units.h:
3420         * html/HTMLDocument.cpp:
3421         * html/HTMLFontElement.cpp:
3422         * html/HTMLInputElement.cpp:
3423         * html/HTMLKeygenElement.cpp:
3424         * html/HTMLSelectElement.h:
3425         * html/HTMLTextAreaElement.cpp:
3426         * html/HTMLTextFieldInnerElement.cpp:
3427         * html/HTMLTokenizer.cpp:
3428         * html/HTMLTokenizer.h:
3429         * kcanvas/KCanvasContainer.cpp: Removed.
3430         * kcanvas/KCanvasContainer.h: Removed.
3431         * kcanvas/KCanvasCreator.cpp:
3432         * kcanvas/KCanvasFilters.cpp:
3433         * kcanvas/KCanvasFilters.h:
3434         * kcanvas/KCanvasMatrix.cpp:
3435         * kcanvas/KCanvasMatrix.h:
3436         * kcanvas/KCanvasPath.cpp:
3437         * kcanvas/KCanvasPath.h:
3438         * kcanvas/KCanvasResources.cpp:
3439         * kcanvas/KCanvasResources.h:
3440         * kcanvas/KCanvasTreeDebug.cpp:
3441         * kcanvas/KCanvasTreeDebug.h:
3442         * kcanvas/RenderForeignObject.cpp:
3443         * kcanvas/RenderForeignObject.h:
3444         * kcanvas/RenderPath.cpp:
3445         * kcanvas/RenderPath.h:
3446         * kcanvas/RenderSVGContainer.cpp: Added.
3447         * kcanvas/RenderSVGContainer.h: Added.
3448         * kcanvas/RenderSVGImage.cpp:
3449         * kcanvas/RenderSVGImage.h:
3450         * kcanvas/RenderSVGText.cpp:
3451         * kcanvas/RenderSVGText.h:
3452         * kcanvas/device/KRenderingPaintServer.h:
3453         * kcanvas/device/KRenderingPaintServerGradient.cpp:
3454         * kcanvas/device/KRenderingPaintServerGradient.h:
3455         * kcanvas/device/KRenderingPaintServerPattern.cpp:
3456         * kcanvas/device/KRenderingPaintServerPattern.h:
3457         * kcanvas/device/KRenderingPaintServerSolid.cpp:
3458         * kcanvas/device/KRenderingPaintServerSolid.h:
3459         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
3460         * kcanvas/device/quartz/KCanvasItemQuartz.h:
3461         * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
3462         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
3463         * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
3464         * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
3465         * ksvg2/css/CSSValueKeywords.in:
3466         * ksvg2/css/SVGRenderStyleDefs.cpp:
3467         * ksvg2/misc/KCanvasRenderingStyle.cpp:
3468         * ksvg2/misc/KSVGTimeScheduler.cpp:
3469         * ksvg2/svg/SVGAElement.cpp:
3470         * ksvg2/svg/SVGAnimateTransformElement.cpp:
3471         * ksvg2/svg/SVGAnimateTransformElement.h:
3472         * ksvg2/svg/SVGGElement.cpp:
3473         * ksvg2/svg/SVGHelper.cpp:
3474         * ksvg2/svg/SVGHelper.h:
3475         * ksvg2/svg/SVGImageElement.cpp:
3476         * ksvg2/svg/SVGLinearGradientElement.cpp:
3477         * ksvg2/svg/SVGMarkerElement.cpp:
3478         * ksvg2/svg/SVGMaskElement.cpp:
3479         * ksvg2/svg/SVGMatrix.cpp:
3480         * ksvg2/svg/SVGMatrix.h:
3481         * ksvg2/svg/SVGPatternElement.cpp:
3482         * ksvg2/svg/SVGRadialGradientElement.cpp:
3483         * ksvg2/svg/SVGSVGElement.cpp:
3484         * ksvg2/svg/SVGStyledElement.h:
3485         * ksvg2/svg/SVGStyledTransformableElement.cpp:
3486         * ksvg2/svg/SVGStyledTransformableElement.h:
3487         * ksvg2/svg/SVGSwitchElement.cpp:
3488         * ksvg2/svg/SVGTextElement.cpp:
3489         * ksvg2/svg/SVGTransformable.h:
3490         * ksvg2/svg/SVGUseElement.cpp:
3491         * kwq/AffineTransform.cpp: Added.
3492         * kwq/AffineTransform.h: Added.
3493         * kwq/DeprecatedCString.cpp: Added.
3494         * kwq/DeprecatedCString.h: Added.
3495         * kwq/DeprecatedPtrQueue.h: Added.
3496         * kwq/FileButton.h: Added.
3497         * kwq/FileButton.mm: Added.
3498         * kwq/FormDataMac.mm: Added.
3499         * kwq/KWQCString.cpp: Removed.
3500         * kwq/KWQCString.h: Removed.
3501         * kwq/KWQComboBox.h: Removed.
3502         * kwq/KWQComboBox.mm: Removed.
3503         * kwq/KWQEditCommand.h: Removed.
3504         * kwq/KWQEditCommand.mm: Removed.