Reviewed by Anders.
[WebKit-https.git] / WebCore / ChangeLog
1 2006-05-11  Darin Adler  <darin@apple.com>
2
3         Reviewed by Adele.
4
5         - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8743
6           REGRESSION: focus() on input field selects all text within it
7           (was: cannot select cities on British Rail reservation site)
8
9         Test: fast/forms/double-focus.html
10
11         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::focus):
12         Changed to only call setFocusNode, select, and revealSelection
13         if the element is not already focused. Also changed to use return
14         a bit more rather than else.
15
16 2006-05-11  Darin Adler  <darin@apple.com>
17
18         Reviewed by Tim Hatcher (earlier version).
19
20         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8821
21           use the preprocessor for IDL files
22
23         * bindings/scripts/IDLParser.pm: Invoke the preprocessor via the "gcc"
24         driver script, passing "-E" so we only preprocess, "-P" so we don't get
25         "#line" directives, and "-x c++" so we handle both C and C++ comments.
26         Removed the code to eliminate comments since the preprocessor handles that.
27         * css/make-css-file-arrays.pl: This already invoked the preprocessor, but
28         updated it to do the same way as above.
29
30 2006-05-11  Anders Carlsson  <acarlsson@apple.com>
31
32         Reviewed by Darin.
33
34         http://bugzilla.opendarwin.org/show_bug.cgi?id=7838
35         Add support for mozilla-style node constructors as properties of the window object
36         
37         * DerivedSources.make:
38         * WebCore.xcodeproj/project.pbxproj:
39         Add new generated files.
40         
41         * bindings/js/JSCanvasRenderingContext2DBase.cpp:
42         (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
43         * bindings/js/JSHTMLElementWrapperFactory.cpp:
44         (WebCore::createJSWrapper):
45         Specify the KJS namespace for JSHTMLElmement.
46                 
47         * bindings/js/kjs_dom.cpp:
48         (KJS::toJS):
49         Create a WebCore::JSHTMLDocument for document nodes. Also, create
50         JSDocumentFragments for document fragments (instead of plain node objects).
51         
52         * bindings/js/kjs_html.cpp:
53         (KJS::JSHTMLDocumentProtoFunc::callAsFunction):
54         (KJS::JSHTMLDocument::JSHTMLDocument):
55         (KJS::JSHTMLDocument::getOwnPropertySlot):
56         Add a prototype for JSHTMLDocument and move all functions there.
57         
58         (KJS::JSHTMLElement::JSHTMLElement):
59         (KJS::JSHTMLElement::getOwnPropertySlot):
60         Update since JSHTMLElement now inherits from WebCore::JSHTMLElement.
61         
62         (KJS::JSHTMLElement::getValueProperty):
63         (KJS::JSHTMLElement::putValueProperty):
64         Remove title setter and getter. Those are autogenerated now.
65         
66         * bindings/js/kjs_html.h:
67         (KJS::JSHTMLElement::):
68         Inherit from WebCore::JSHTMLElement. Clarify the inheritance chain.
69         
70         * bindings/scripts/CodeGeneratorJS.pm:
71         Always generate a prototype object, regardless of whether the object has any functions or
72         constants.
73         
74         Use the type of generator attributes to determine what constructor to use. This is useful for
75         the XMLDocument property in DOMWindow.idl, since that's just an alias for the Document constructor.
76         
77         * dom/DocumentFragment.idl: Added.        
78         * html/HTMLDocument.idl: Added.
79         * html/HTMLElement.idl: Added.
80         
81         * page/DOMWindow.idl:
82         Add constructors for DocumentFragment, HTMLElement, HTMLDocument and XMLDocument. XMLDocument is just
83         an alias for the Document constructor.
84         
85 2006-05-11  David Hyatt  <hyatt@apple.com>
86
87         Bug 8845.  Define a TextRun (similar to the old WebCoreTextRun) and
88         make it the new API for Font and GraphicsContext when drawing/measuring
89         text.
90
91         Reviewed by andersca
92
93         * platform/Font.cpp:
94         (WebCore::m_finalRoundingWidth):
95         (WebCore::WidthIterator::advance):
96         (WebCore::WidthIterator::normalizeVoicingMarks):
97         (WebCore::Font::width):
98         (WebCore::Font::canUseGlyphCache):
99         (WebCore::Font::drawSimpleText):
100         (WebCore::Font::drawText):
101         (WebCore::Font::floatWidth):
102         (WebCore::Font::floatWidthForSimpleText):
103         * platform/Font.h:
104         (WebCore::TextRun::m_to):
105         (WebCore::TextRun::operator[]):
106         (WebCore::TextRun::data):
107         (WebCore::TextRun::adjustFrom):
108         (WebCore::TextRun::adjustTo):
109         (WebCore::TextRun::characters):
110         (WebCore::TextRun::length):
111         (WebCore::TextRun::from):
112         (WebCore::TextRun::to):
113         * platform/GraphicsContext.cpp:
114         (WebCore::GraphicsContext::drawText):
115         (WebCore::GraphicsContext::drawHighlightForText):
116         * platform/GraphicsContext.h:
117         * platform/mac/FontMac.mm:
118         (WebCore::addDirectionalOverride):
119         (WebCore::overrideLayoutOperation):
120         (WebCore::ATSULayoutParameters::initialize):
121         (WebCore::Font::selectionRectForText):
122         (WebCore::Font::drawComplexText):
123         (WebCore::Font::drawHighlightForText):
124         (WebCore::Font::floatWidthForComplexText):
125         (WebCore::Font::checkSelectionPoint):
126         * platform/win/FontWin.cpp:
127         (WebCore::hackishExtentForString):
128         (WebCore::Font::floatWidth):
129         (WebCore::Font::drawText):
130         (WebCore::Font::drawHighlightForText):
131         (WebCore::Font::selectionRectForText):
132         (WebCore::Font::checkSelectionPoint):
133         * rendering/InlineTextBox.cpp:
134         (WebCore::InlineTextBox::selectionRect):
135         (WebCore::InlineTextBox::paint):
136         (WebCore::InlineTextBox::paintSelection):
137         (WebCore::InlineTextBox::paintMarkedTextBackground):
138         (WebCore::InlineTextBox::paintTextMatchMarker):
139         (WebCore::InlineTextBox::offsetForPosition):
140         (WebCore::InlineTextBox::positionForOffset):
141         * rendering/RenderBlock.cpp:
142         (WebCore::stripTrailingSpace):
143         * rendering/RenderFlexibleBox.cpp:
144         (WebCore::RenderFlexibleBox::layoutVerticalBox):
145         * rendering/RenderImage.cpp:
146         (WebCore::RenderImage::imageChanged):
147         (WebCore::RenderImage::paint):
148         * rendering/RenderText.cpp:
149         (WebCore::RenderText::cacheWidths):
150         (WebCore::RenderText::widthFromCache):
151         (WebCore::RenderText::trimmedMinMaxWidth):
152         (WebCore::RenderText::calcMinMaxWidth):
153         (WebCore::RenderText::width):
154         * rendering/RenderTextField.cpp:
155         (WebCore::RenderTextField::calcMinMaxWidth):
156         * rendering/bidi.cpp:
157         (WebCore::RenderBlock::tabWidth):
158         (WebCore::RenderBlock::checkLinesForTextOverflow):
159         * rendering/render_line.cpp:
160         (WebCore::EllipsisBox::paint):
161         * rendering/render_list.cpp:
162         (WebCore::RenderListMarker::paint):
163         (WebCore::RenderListMarker::calcMinMaxWidth):
164         (WebCore::RenderListMarker::getRelativeMarkerRect):
165
166 2006-05-10  Justin Garcia  <justin.garcia@apple.com>
167
168         Reviewed by darin
169
170         * editing/ReplaceSelectionCommand.cpp:
171         (WebCore::ReplaceSelectionCommand::doApply):
172         Removed the code to find out if we must later add smart replace whitespace.  We can 
173         wait until we've done the insertion to figure it out, and the position sampled (startPos)
174         to make the decision about trailing whitespace was wrong.
175         Changed the order that work is done during a paste: 1) Insert everything 2) Do one of
176         the following: a) handle a trailing interchange newline, b) uncollapse the last incoming
177         br if it has been collapsed because of quirks mode, c) do an end merge 3) Add smart replace
178         whitespace (2 and 3 were reversed because the end merge must happen before we can know
179         whether or not we need to add a trailing space).
180         Don't do an end merge if the last node inserted was a br because the end merge will 
181         clobber it.
182         
183         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
184         brs where [br, 0] is at the end of a block and not at the start of the paragraph
185         are the ones that are collapsed because of quirks mode.
186
187 2006-05-10  David Hyatt  <hyatt@apple.com>
188
189         Rename isSpace to treatAsSpace.  Move it and the rounding hack function into
190         Font and make them static methods (inlined in the header).  Make the rounding
191         hack character table a static member as well.  Remove the redundant space/rounding
192         functions from FontData.mm.
193
194         Reviewed by darin
195
196         * platform/Font.cpp:
197         (WebCore::):
198         (WebCore::m_finalRoundingWidth):
199         (WebCore::WidthIterator::advance):
200         * platform/Font.h:
201         (WebCore::Font::treatAsSpace):
202         (WebCore::Font::isRoundingHackCharacter):
203         * platform/mac/FontData.mm:
204         (WebCore::overrideLayoutOperation):
205         (WebCore::createATSULayoutParameters):
206         (WebCore::initializeWidthIterator):
207         (WebCore::advanceWidthIterator):
208         * platform/mac/FontMac.mm:
209         (WebCore::overrideLayoutOperation):
210         (WebCore::ATSULayoutParameters::initialize):
211
212 2006-05-10  Darin Adler  <darin@apple.com>
213
214         * WebCore: Removed an extra WebCore subtree that somehow got checked in.
215
216 >>>>>>> .r14297
217 2006-05-10  David Carson <dacarson@gmail.com>
218
219         - Fix for bug 8833. Removed inline keyword from functions declared
220         in .mm and .cpp files. inline function code needs to reside in the
221         header file for the linker to find the code. 
222         http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7
223
224         Reviewed by Darin, landed by Timothy.
225
226         * platform/Font.cpp:
227         (WebCore::isSpace):
228         * platform/mac/FontData.mm:
229         (WebCore::widthForGlyph):
230         (WebCore::isRoundingHackCharacter):
231         (WebCore::glyphForCharacter):
232
233 2006-05-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
234
235         Reviewed and landed by Anders.
236
237         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8830
238           REGRESSION: Words render on top of each other when fallback font is used
239
240         Already covered by several pixel tests in fast/text
241
242         * platform/Font.cpp:
243         (WebCore::Font::drawSimpleText):
244
245 2006-05-10  David Hyatt  <hyatt@apple.com>
246
247         Fix for bug 8809, lift the Mac-specific WebTextRenderer code for
248         drawing and measuring of runs up into the Font class.  The fast code
249         path is in Font.cpp and is designed to be mostly cross-platform.  The
250         slow code path is in FontMac.cpp and is Mac-specific.
251
252         Reviewed by darin
253
254         * WebCore.xcodeproj/project.pbxproj:
255         * platform/Font.cpp:
256         (WebCore::isSpace):
257         (WebCore::):
258         (WebCore::isRoundingHackCharacter):
259         (WebCore::m_finalRoundingWidth):
260         (WebCore::WidthIterator::advance):
261         (WebCore::WidthIterator::normalizeVoicingMarks):
262         (WebCore::Font::primaryFont):
263         (WebCore::Font::setAlwaysUseComplexPath):
264         (WebCore::Font::canUseGlyphCache):
265         (WebCore::Font::drawSimpleText):
266         (WebCore::Font::drawText):
267         (WebCore::Font::floatWidth):
268         (WebCore::Font::floatWidthForSimpleText):
269         * platform/Font.h:
270         * platform/FontData.h:
271         (WebCore::FontData::platformData):
272         * platform/GlyphBuffer.h: Added.
273         (WebCore::GlyphBuffer::GlyphBuffer):
274         (WebCore::GlyphBuffer::isEmpty):
275         (WebCore::GlyphBuffer::size):
276         (WebCore::GlyphBuffer::glyphs):
277         (WebCore::GlyphBuffer::advances):
278         (WebCore::GlyphBuffer::fontDataAt):
279         (WebCore::GlyphBuffer::swap):
280         (WebCore::GlyphBuffer::glyphAt):
281         (WebCore::GlyphBuffer::advanceAt):
282         (WebCore::GlyphBuffer::add):
283         * platform/mac/FontData.mm:
284         (WebCore::isSpace):
285         (WebCore::isRoundingHackCharacter):
286         (WebCore::FontData::widthForGlyph):
287         (WebCore::m_ATSUMirrors):
288         (WebCore::FontData::xHeight):
289         (WebCore::FontData::smallCapsFontData):
290         (WebCore::findSubstituteFont):
291         (WebCore::rendererForAlternateFont):
292         (WebCore::findSubstituteRenderer):
293         (WebCore::FontData::findSubstituteFontData):
294         (WebCore::computeWidthForSpace):
295         (WebCore::FontData::updateGlyphMapEntry):
296         (WebCore::extendGlyphMap):
297         (WebCore::extendWidthMap):
298         (WebCore::createATSULayoutParameters):
299         (WebCore::FontData::glyphForCharacter):
300         (WebCore::advanceWidthIterator):
301         (WebCore::shouldUseATSU):
302         * platform/mac/FontMac.mm:
303         (WebCore::ATSULayoutParameters::m_padPerSpace):
304         (WebCore::addDirectionalOverride):
305         (WebCore::initializeATSUStyle):
306         (WebCore::overrideLayoutOperation):
307         (WebCore::ATSULayoutParameters::initialize):
308         (WebCore::disposeATSULayoutParameters):
309         (WebCore::Font::drawComplexText):
310         (WebCore::Font::floatWidthForComplexText):
311         (WebCore::Font::drawGlyphs):
312         * platform/mac/WebCoreTextRenderer.mm:
313         (WebCoreSetAlwaysUseATSU):
314
315 2006-05-10  Darin Adler  <darin@apple.com>
316
317         - another try at fixing the Windows build
318
319         * platform/win/FontWin.cpp: (WebCore::getFontData): Use characters()
320         instead of unicode().
321
322 == Rolled over to ChangeLog-2006-05-10 ==