Changes in trunk [40086:40124] in webkit
- Location:
- trunk
- Files:
-
- 16 added
- 4 deleted
- 174 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r40086 r40124 1 2009-01-22 Dmitry Titov <dimich@chromium.org> 2 3 Reviewed by Alexey Proskuryakov. 4 5 https://bugs.webkit.org/show_bug.cgi?id=23373 6 7 Implement ThreadCondition::timedWait(). 8 Since we borrow the code for condition variables from other sources, 9 I did the same for timedWait(). See comments in ThreadingWin.cpp for 10 rationale and more info. 11 12 * wtf/CONTRIBUTORS.pthreads-win32: 13 Added. A list of Pthreads-win32 contributors mentioned in their license. The license itself 14 is included into wtf/ThreadingWin32.cpp. 15 16 * wtf/Threading.h: 17 * wtf/ThreadingWin.cpp: 18 Additional info and Pthreads-win32 license at the beginning. 19 (WTF::PlatformCondition::timedWait): new method, derived from Pthreads-win32. 20 (WTF::PlatformCondition::signal): same 21 (WTF::ThreadCondition::ThreadCondition): 22 (WTF::ThreadCondition::~ThreadCondition): 23 (WTF::ThreadCondition::wait): this now calls PlatformCondition::timedWait. 24 (WTF::ThreadCondition::timedWait): same 25 (WTF::ThreadCondition::signal): this now calls PlatformCondition::signal. 26 (WTF::ThreadCondition::broadcast): same 27 28 2009-01-21 Gavin Barraclough <barraclough@apple.com> 29 30 Reviewed by Oliver Hunt. 31 32 Fix for https://bugs.webkit.org/show_bug.cgi?id=23469. 33 34 We need to check all numbers in integer switches, not just those 35 represented as integer JSImmediates. 36 37 * interpreter/Interpreter.cpp: 38 (JSC::Interpreter::privateExecute): 39 (JSC::Interpreter::cti_op_switch_imm): 40 41 2009-01-21 Gavin Barraclough <barraclough@apple.com> 42 43 Reviewed by Geoff Garen. 44 45 Fix for https://bugs.webkit.org/show_bug.cgi?id=23468. 46 47 * interpreter/Interpreter.cpp: 48 (JSC::Interpreter::privateExecute): 49 1 50 2009-01-21 Alexey Proskuryakov <ap@webkit.org> 2 51 -
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r40086 r40124 2552 2552 RefPtr<Structure>* end = it + count; 2553 2553 2554 JSObject* baseObject = asObject(baseCell);2555 while (1) {2556 baseObject = asObject(baseObject->structure()->prototypeForLookup(callFrame)); 2554 while (true) { 2555 JSObject* baseObject = asObject(baseCell->structure()->prototypeForLookup(callFrame)); 2556 2557 2557 if (UNLIKELY(baseObject->structure() != (*it).get())) 2558 2558 break; … … 2568 2568 NEXT_INSTRUCTION(); 2569 2569 } 2570 2571 // Update baseCell, so that next time around the loop we'll pick up the prototype's prototype. 2572 baseCell = baseObject; 2570 2573 } 2571 2574 } … … 3141 3144 if (scrutinee.isInt32Fast()) 3142 3145 vPC += callFrame->codeBlock()->immediateSwitchJumpTable(tableIndex).offsetForValue(scrutinee.getInt32Fast(), defaultOffset); 3143 else 3144 vPC += defaultOffset; 3146 else { 3147 int32_t value; 3148 if (scrutinee.numberToInt32(value)) 3149 vPC += callFrame->codeBlock()->immediateSwitchJumpTable(tableIndex).offsetForValue(value, defaultOffset); 3150 else 3151 vPC += defaultOffset; 3152 } 3145 3153 NEXT_INSTRUCTION(); 3146 3154 } … … 5966 5974 if (scrutinee.isInt32Fast()) 5967 5975 return codeBlock->immediateSwitchJumpTable(tableIndex).ctiForValue(scrutinee.getInt32Fast()); 5968 5969 return codeBlock->immediateSwitchJumpTable(tableIndex).ctiDefault; 5976 else { 5977 int32_t value; 5978 if (scrutinee.numberToInt32(value)) 5979 return codeBlock->immediateSwitchJumpTable(tableIndex).ctiForValue(value); 5980 else 5981 return codeBlock->immediateSwitchJumpTable(tableIndex).ctiDefault; 5982 } 5970 5983 } 5971 5984 -
trunk/JavaScriptCore/wtf/Threading.h
r40086 r40124 133 133 }; 134 134 struct PlatformCondition { 135 size_t m_timedOut; 136 size_t m_blocked; 137 size_t m_waitingForRemoval; 138 HANDLE m_gate; 139 HANDLE m_queue; 140 HANDLE m_mutex; 135 size_t m_waitersGone; 136 size_t m_waitersBlocked; 137 size_t m_waitersToUnblock; 138 HANDLE m_blockLock; 139 HANDLE m_blockQueue; 140 HANDLE m_unblockLock; 141 142 bool timedWait(PlatformMutex&, DWORD durationMilliseconds); 143 void signal(bool unblockAll); 141 144 }; 142 145 #else -
trunk/JavaScriptCore/wtf/ThreadingWin.cpp
r40086 r40124 1 1 /* 2 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 25 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * 28 * ============================================================================= 29 * Note: The implementation of condition variables under the Windows 30 * plaform was based on that of the excellent BOOST C++ library. It 31 * has been rewritten to fit in with the WebKit architecture and to 32 * use its coding conventions. 33 * ============================================================================= 34 * 35 * The Boost license is virtually identical to the Apple variation at the 36 * top of this file, but is included here for completeness: 37 * 38 * Boost Software License - Version 1.0 - August 17th, 2003 39 * 40 * Permission is hereby granted, free of charge, to any person or organization 41 * obtaining a copy of the software and accompanying documentation covered by 42 * this license (the "Software") to use, reproduce, display, distribute, 43 * execute, and transmit the Software, and to prepare derivative works of the 44 * Software, and to permit third-parties to whom the Software is furnished to 45 * do so, all subject to the following: 46 * 47 * The copyright notices in the Software and this entire statement, including 48 * the above license grant, this restriction and the following disclaimer, 49 * must be included in all copies of the Software, in whole or in part, and 50 * all derivative works of the Software, unless such copies or derivative 51 * works are solely in the form of machine-executable object code generated by 52 * a source language processor. 53 * 54 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 55 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 56 * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 57 * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 58 * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 59 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 60 * DEALINGS IN THE SOFTWARE. 28 */ 29 30 /* 31 * There are numerous academic and practical works on how to implement pthread_cond_wait/pthread_cond_signal/pthread_cond_broadcast 32 * functions on Win32. Here is one example: http://www.cs.wustl.edu/~schmidt/win32-cv-1.html which is widely credited as a 'starting point' 33 * of modern attempts. There are several more or less proven implementations, one in Boost C++ library (http://www.boost.org) and another 34 * in pthreads-win32 (http://sourceware.org/pthreads-win32/). 35 * 36 * The number of articles and discussions is the evidence of significant difficulties in implementing these primitives correctly. 37 * The brief search of revisions, ChangeLog entries, discussions in comp.programming.threads and other places clearly documents 38 * numerous pitfalls and performance problems the authors had to overcome to arrive to the suitable implementations. 39 * Optimally, WebKit would use one of those supported/tested libraries directly. To roll out our own implementation is impractical, 40 * if even for the lack of sufficient testing. However, a faithful reproduction of the code from one of the popular supported 41 * libraries seems to be a good compromise. 42 * 43 * The early Boost implementation (http://www.boxbackup.org/trac/browser/box/nick/win/lib/win32/boost_1_32_0/libs/thread/src/condition.cpp?rev=30) 44 * is identical to pthreads-win32 (http://sourceware.org/cgi-bin/cvsweb.cgi/pthreads/pthread_cond_wait.c?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=pthreads-win32). 45 * Current Boost uses yet another (although seemingly equivalent) algorithm which came from their 'thread rewrite' effort. 46 * 47 * This file includes timedWait/signal/broadcast implementations translated to WebKit coding style from the latest algorithm by 48 * Alexander Terekhov and Louis Thomas, as captured here: http://sourceware.org/cgi-bin/cvsweb.cgi/pthreads/pthread_cond_wait.c?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=pthreads-win32 49 * It replaces the implementation of their previous algorithm, also documented in the same source above. 50 * The naming and comments are left very close to original to enable easy cross-check. 51 * 52 * The corresponding Pthreads-win32 License is included below, and CONTRIBUTORS file which it refers to is added to 53 * source directory (as CONTRIBUTORS.pthreads-win32). 54 */ 55 56 /* 57 * Pthreads-win32 - POSIX Threads Library for Win32 58 * Copyright(C) 1998 John E. Bossom 59 * Copyright(C) 1999,2005 Pthreads-win32 contributors 60 * 61 * Contact Email: rpj@callisto.canberra.edu.au 62 * 63 * The current list of contributors is contained 64 * in the file CONTRIBUTORS included with the source 65 * code distribution. The list can also be seen at the 66 * following World Wide Web location: 67 * http://sources.redhat.com/pthreads-win32/contributors.html 68 * 69 * This library is free software; you can redistribute it and/or 70 * modify it under the terms of the GNU Lesser General Public 71 * License as published by the Free Software Foundation; either 72 * version 2 of the License, or (at your option) any later version. 73 * 74 * This library is distributed in the hope that it will be useful, 75 * but WITHOUT ANY WARRANTY; without even the implied warranty of 76 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 77 * Lesser General Public License for more details. 78 * 79 * You should have received a copy of the GNU Lesser General Public 80 * License along with this library in the file COPYING.LIB; 81 * if not, write to the Free Software Foundation, Inc., 82 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 61 83 */ 62 84 … … 70 92 #include <process.h> 71 93 #include <windows.h> 94 #include <wtf/CurrentTime.h> 72 95 #include <wtf/HashMap.h> 73 96 #include <wtf/MathExtras.h> … … 215 238 LOG_ERROR("ThreadIdentifier %u did not correspond to an active thread when trying to quit", threadID); 216 239 217 DWORD joinResult = ::WaitForSingleObject(threadHandle, INFINITE);240 DWORD joinResult = WaitForSingleObject(threadHandle, INFINITE); 218 241 if (joinResult == WAIT_FAILED) 219 242 LOG_ERROR("ThreadIdentifier %u was found to be deadlocked trying to quit", threadID); 220 243 221 ::CloseHandle(threadHandle);244 CloseHandle(threadHandle); 222 245 clearThreadHandleForIdentifier(threadID); 223 246 … … 231 254 HANDLE threadHandle = threadHandleForIdentifier(threadID); 232 255 if (threadHandle) 233 ::CloseHandle(threadHandle);256 CloseHandle(threadHandle); 234 257 clearThreadHandleForIdentifier(threadID); 235 258 } … … 237 260 ThreadIdentifier currentThread() 238 261 { 239 return static_cast<ThreadIdentifier>( ::GetCurrentThreadId());262 return static_cast<ThreadIdentifier>(GetCurrentThreadId()); 240 263 } 241 264 … … 248 271 { 249 272 m_mutex.m_recursionCount = 0; 250 ::InitializeCriticalSection(&m_mutex.m_internalMutex);273 InitializeCriticalSection(&m_mutex.m_internalMutex); 251 274 } 252 275 253 276 Mutex::~Mutex() 254 277 { 255 ::DeleteCriticalSection(&m_mutex.m_internalMutex);278 DeleteCriticalSection(&m_mutex.m_internalMutex); 256 279 } 257 280 258 281 void Mutex::lock() 259 282 { 260 ::EnterCriticalSection(&m_mutex.m_internalMutex);283 EnterCriticalSection(&m_mutex.m_internalMutex); 261 284 ++m_mutex.m_recursionCount; 262 285 } … … 270 293 // tests in WebKit that check to see if the current thread already 271 294 // owned this mutex (see e.g., IconDatabase::getOrCreateIconRecord) 272 DWORD result = ::TryEnterCriticalSection(&m_mutex.m_internalMutex);295 DWORD result = TryEnterCriticalSection(&m_mutex.m_internalMutex); 273 296 274 297 if (result != 0) { // We got the lock … … 277 300 // pthread_mutex_trylock: 278 301 if (m_mutex.m_recursionCount > 0) { 279 ::LeaveCriticalSection(&m_mutex.m_internalMutex);302 LeaveCriticalSection(&m_mutex.m_internalMutex); 280 303 return false; 281 304 } … … 291 314 { 292 315 --m_mutex.m_recursionCount; 293 ::LeaveCriticalSection(&m_mutex.m_internalMutex); 294 } 295 296 static const long MaxSemaphoreCount = static_cast<long>(~0UL >> 1); 297 298 ThreadCondition::ThreadCondition() 299 { 300 m_condition.m_timedOut = 0; 301 m_condition.m_blocked = 0; 302 m_condition.m_waitingForRemoval = 0; 303 m_condition.m_gate = ::CreateSemaphore(0, 1, 1, 0); 304 m_condition.m_queue = ::CreateSemaphore(0, 0, MaxSemaphoreCount, 0); 305 m_condition.m_mutex = ::CreateMutex(0, 0, 0); 306 307 if (!m_condition.m_gate || !m_condition.m_queue || !m_condition.m_mutex) { 308 if (m_condition.m_gate) 309 ::CloseHandle(m_condition.m_gate); 310 if (m_condition.m_queue) 311 ::CloseHandle(m_condition.m_queue); 312 if (m_condition.m_mutex) 313 ::CloseHandle(m_condition.m_mutex); 314 } 315 } 316 317 ThreadCondition::~ThreadCondition() 318 { 319 ::CloseHandle(m_condition.m_gate); 320 ::CloseHandle(m_condition.m_queue); 321 ::CloseHandle(m_condition.m_mutex); 322 } 323 324 void ThreadCondition::wait(Mutex& mutex) 325 { 326 PlatformMutex& cs = mutex.impl(); 327 316 LeaveCriticalSection(&m_mutex.m_internalMutex); 317 } 318 319 bool PlatformCondition::timedWait(PlatformMutex& mutex, DWORD durationMilliseconds) 320 { 328 321 // Enter the wait state. 329 DWORD res = ::WaitForSingleObject(m_condition.m_gate, INFINITE);322 DWORD res = WaitForSingleObject(m_blockLock, INFINITE); 330 323 ASSERT(res == WAIT_OBJECT_0); 331 ++m_ condition.m_blocked;332 res = ::ReleaseSemaphore(m_condition.m_gate, 1, 0);324 ++m_waitersBlocked; 325 res = ReleaseSemaphore(m_blockLock, 1, 0); 333 326 ASSERT(res); 334 327 335 ::LeaveCriticalSection(&cs.m_internalMutex); 336 337 res = ::WaitForSingleObject(m_condition.m_queue, INFINITE); 328 LeaveCriticalSection(&mutex.m_internalMutex); 329 330 // Main wait - use timeout. 331 bool timedOut = (WaitForSingleObject(m_blockQueue, durationMilliseconds) == WAIT_TIMEOUT); 332 333 res = WaitForSingleObject(m_unblockLock, INFINITE); 338 334 ASSERT(res == WAIT_OBJECT_0); 339 335 340 res = ::WaitForSingleObject(m_condition.m_mutex, INFINITE); 341 ASSERT(res == WAIT_OBJECT_0); 342 size_t wasWaiting = m_condition.m_waitingForRemoval; 343 size_t wasTimedOut = m_condition.m_timedOut; 344 if (wasWaiting != 0) { 345 if (--m_condition.m_waitingForRemoval == 0) { 346 if (m_condition.m_blocked != 0) { 347 res = ::ReleaseSemaphore(m_condition.m_gate, 1, 0); // open m_gate 348 ASSERT(res); 349 wasWaiting = 0; 350 } 351 else if (m_condition.m_timedOut != 0) 352 m_condition.m_timedOut = 0; 353 } 354 } else if (++m_condition.m_timedOut == ((std::numeric_limits<unsigned>::max)() / 2)) { 355 // timeout occured, normalize the m_condition.m_timedOut count 336 int signalsLeft = m_waitersToUnblock; 337 338 if (m_waitersToUnblock) 339 --m_waitersToUnblock; 340 else if (++m_waitersGone == (INT_MAX / 2)) { // timeout/canceled or spurious semaphore 341 // timeout or spurious wakeup occured, normalize the m_waitersGone count 356 342 // this may occur if many calls to wait with a timeout are made and 357 343 // no call to notify_* is made 358 res = ::WaitForSingleObject(m_condition.m_gate, INFINITE);344 res = WaitForSingleObject(m_blockLock, INFINITE); 359 345 ASSERT(res == WAIT_OBJECT_0); 360 m_ condition.m_blocked -= m_condition.m_timedOut;361 res = ::ReleaseSemaphore(m_condition.m_gate, 1, 0);346 m_waitersBlocked -= m_waitersGone; 347 res = ReleaseSemaphore(m_blockLock, 1, 0); 362 348 ASSERT(res); 363 m_condition.m_timedOut = 0; 364 } 365 res = ::ReleaseMutex(m_condition.m_mutex); 349 m_waitersGone = 0; 350 } 351 352 res = ReleaseMutex(m_unblockLock); 366 353 ASSERT(res); 367 354 368 if (wasWaiting == 1) { 369 for (/**/ ; wasTimedOut; --wasTimedOut) { 370 // better now than spurious later 371 res = ::WaitForSingleObject(m_condition.m_queue, INFINITE); 372 ASSERT(res == WAIT_OBJECT_0); 373 } 374 res = ::ReleaseSemaphore(m_condition.m_gate, 1, 0); 355 if (signalsLeft == 1) { 356 res = ReleaseSemaphore(m_blockLock, 1, 0); // Open the gate. 375 357 ASSERT(res); 376 358 } 377 359 378 ::EnterCriticalSection (&cs.m_internalMutex); 379 } 380 381 bool ThreadCondition::timedWait(Mutex& mutex, double absoluteTime) 382 { 383 // FIXME: Implement. 384 ASSERT(false); 385 return false; 386 } 387 388 void ThreadCondition::signal() 389 { 390 unsigned signals = 0; 391 392 DWORD res = ::WaitForSingleObject(m_condition.m_mutex, INFINITE); 360 EnterCriticalSection (&mutex.m_internalMutex); 361 362 return !timedOut; 363 } 364 365 void PlatformCondition::signal(bool unblockAll) 366 { 367 unsigned signalsToIssue = 0; 368 369 DWORD res = WaitForSingleObject(m_unblockLock, INFINITE); 393 370 ASSERT(res == WAIT_OBJECT_0); 394 371 395 if (m_ condition.m_waitingForRemoval != 0) { // the m_gate is already closed396 if ( m_condition.m_blocked == 0) {397 res = ::ReleaseMutex(m_condition.m_mutex);372 if (m_waitersToUnblock) { // the gate is already closed 373 if (!m_waitersBlocked) { // no-op 374 res = ReleaseMutex(m_unblockLock); 398 375 ASSERT(res); 399 376 return; 400 377 } 401 378 402 ++m_condition.m_waitingForRemoval; 403 --m_condition.m_blocked; 404 405 signals = 1; 406 } else { 407 res = ::WaitForSingleObject(m_condition.m_gate, INFINITE); 379 if (unblockAll) { 380 signalsToIssue = m_waitersBlocked; 381 m_waitersToUnblock += m_waitersBlocked; 382 m_waitersBlocked = 0; 383 } else { 384 signalsToIssue = 1; 385 ++m_waitersToUnblock; 386 --m_waitersBlocked; 387 } 388 } else if (m_waitersBlocked > m_waitersGone) { 389 res = WaitForSingleObject(m_blockLock, INFINITE); // Close the gate. 408 390 ASSERT(res == WAIT_OBJECT_0); 409 if (m_condition.m_blocked > m_condition.m_timedOut) { 410 if (m_condition.m_timedOut != 0) { 411 m_condition.m_blocked -= m_condition.m_timedOut; 412 m_condition.m_timedOut = 0; 413 } 414 signals = m_condition.m_waitingForRemoval = 1; 415 --m_condition.m_blocked; 391 if (m_waitersGone != 0) { 392 m_waitersBlocked -= m_waitersGone; 393 m_waitersGone = 0; 394 } 395 if (unblockAll) { 396 signalsToIssue = m_waitersBlocked; 397 m_waitersToUnblock = m_waitersBlocked; 398 m_waitersBlocked = 0; 416 399 } else { 417 res = ::ReleaseSemaphore(m_condition.m_gate, 1, 0); 418 ASSERT(res); 400 signalsToIssue = 1; 401 m_waitersToUnblock = 1; 402 --m_waitersBlocked; 419 403 } 420 } 421 422 res =::ReleaseMutex(m_condition.m_mutex); 404 } else { // No-op. 405 res = ReleaseMutex(m_unblockLock); 406 ASSERT(res); 407 return; 408 } 409 410 res = ReleaseMutex(m_unblockLock); 423 411 ASSERT(res); 424 412 425 if (signals ) {426 res = ::ReleaseSemaphore(m_condition.m_queue, signals, 0);413 if (signalsToIssue) { 414 res = ReleaseSemaphore(m_blockQueue, signalsToIssue, 0); 427 415 ASSERT(res); 428 416 } 429 417 } 430 418 419 static const long MaxSemaphoreCount = static_cast<long>(~0UL >> 1); 420 421 ThreadCondition::ThreadCondition() 422 { 423 m_condition.m_waitersGone = 0; 424 m_condition.m_waitersBlocked = 0; 425 m_condition.m_waitersToUnblock = 0; 426 m_condition.m_blockLock = CreateSemaphore(0, 1, 1, 0); 427 m_condition.m_blockQueue = CreateSemaphore(0, 0, MaxSemaphoreCount, 0); 428 m_condition.m_unblockLock = CreateMutex(0, 0, 0); 429 430 if (!m_condition.m_blockLock || !m_condition.m_blockQueue || !m_condition.m_unblockLock) { 431 if (m_condition.m_blockLock) 432 CloseHandle(m_condition.m_blockLock); 433 if (m_condition.m_blockQueue) 434 CloseHandle(m_condition.m_blockQueue); 435 if (m_condition.m_unblockLock) 436 CloseHandle(m_condition.m_unblockLock); 437 } 438 } 439 440 ThreadCondition::~ThreadCondition() 441 { 442 CloseHandle(m_condition.m_blockLock); 443 CloseHandle(m_condition.m_blockQueue); 444 CloseHandle(m_condition.m_unblockLock); 445 } 446 447 void ThreadCondition::wait(Mutex& mutex) 448 { 449 m_condition.timedWait(mutex.impl(), INFINITE); 450 } 451 452 bool ThreadCondition::timedWait(Mutex& mutex, double absoluteTime) 453 { 454 double currentTime = WTF::currentTime(); 455 456 // Time is in the past - return immediately. 457 if (absoluteTime < currentTime) 458 return false; 459 460 double intervalMilliseconds = (absoluteTime - currentTime) * 1000.0; 461 if (intervalMilliseconds >= INT_MAX) 462 intervalMilliseconds = INT_MAX; 463 464 return m_condition.timedWait(mutex.impl(), static_cast<unsigned long>(intervalMilliseconds)); 465 } 466 467 void ThreadCondition::signal() 468 { 469 m_condition.signal(false); // Unblock only 1 thread. 470 } 471 431 472 void ThreadCondition::broadcast() 432 473 { 433 unsigned signals = 0; 434 435 DWORD res = ::WaitForSingleObject(m_condition.m_mutex, INFINITE); 436 ASSERT(res == WAIT_OBJECT_0); 437 438 if (m_condition.m_waitingForRemoval != 0) { // the m_gate is already closed 439 if (m_condition.m_blocked == 0) { 440 res = ::ReleaseMutex(m_condition.m_mutex); 441 ASSERT(res); 442 return; 443 } 444 445 m_condition.m_waitingForRemoval += (signals = m_condition.m_blocked); 446 m_condition.m_blocked = 0; 447 } else { 448 res = ::WaitForSingleObject(m_condition.m_gate, INFINITE); 449 ASSERT(res == WAIT_OBJECT_0); 450 if (m_condition.m_blocked > m_condition.m_timedOut) { 451 if (m_condition.m_timedOut != 0) { 452 m_condition.m_blocked -= m_condition.m_timedOut; 453 m_condition.m_timedOut = 0; 454 } 455 signals = m_condition.m_waitingForRemoval = m_condition.m_blocked; 456 m_condition.m_blocked = 0; 457 } else { 458 res = ::ReleaseSemaphore(m_condition.m_gate, 1, 0); 459 ASSERT(res); 460 } 461 } 462 463 res = ::ReleaseMutex(m_condition.m_mutex); 464 ASSERT(res); 465 466 if (signals) { 467 res = ::ReleaseSemaphore(m_condition.m_queue, signals, 0); 468 ASSERT(res); 469 } 474 m_condition.signal(true); // Unblock all threads. 470 475 } 471 476 -
trunk/LayoutTests/ChangeLog
r40086 r40124 1 2009-01-21 Gavin Barraclough <barraclough@apple.com> 2 3 Rubber stamped by Geoff "Cameron Zwarich" Garen. 4 5 Add pre & post standalone driver scripts to assist running the javascript layout tests 6 on jsc, rather than a full webkit build. 7 8 * fast/js/resources/standalone-post.js: Copied from fast/js/resources/js-test-post.js. 9 * fast/js/resources/standalone-pre.js: Copied from fast/js/resources/js-test-pre.js. 10 (description): 11 (debug): 12 (escapeString): 13 (testPassed): 14 (testFailed): 15 16 2009-01-21 Gavin Barraclough <barraclough@apple.com> 17 18 Reviewed by Oliver Hunt. 19 20 Add layout test for switch (-0). 21 22 * fast/js/resources/switch-behaviour.js: 23 * fast/js/switch-behaviour-expected.txt: 24 25 2009-01-19 Chris Marrin <cmarrin@apple.com> 26 27 Reviewed by David Hyatt 28 29 Fix for https://bugs.webkit.org/show_bug.cgi?id=23317 30 31 * transitions/repeated-firing-background-color-expected.txt: Added. 32 * transitions/repeated-firing-background-color.html: Added. 33 34 2009-01-21 Eric Seidel <eric@webkit.org> 35 36 Reviewed by Justin Garcia. 37 38 Remove the style='' turds left by some editing commands 39 https://bugs.webkit.org/show_bug.cgi?id=23463 40 41 * editing/execCommand/toggle-styles-expected.txt: updated results 42 43 2009-01-21 Chris Fleizach <cfleizach@apple.com> 44 45 Reviewed by Beth Dakin. 46 47 Test to make sure accessibility doesn't crash when a table is modified through JavaScript 48 49 * accessibility/table-modification-crash-expected.txt: Added. 50 * accessibility/table-modification-crash.html: Added. 51 52 2009-01-16 Eric Seidel <eric@webkit.org> 53 54 Reviewed by Justin Garcia. 55 56 Updated results for execCommand() 'sub' and 'super' toggle fixes. 57 https://bugs.webkit.org/show_bug.cgi?id=17733 58 59 * editing/execCommand/toggle-styles-expected.txt: 60 1 61 2009-01-20 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com> 2 62 -
trunk/LayoutTests/editing/execCommand/resources/toggle-styles.js
r40086 r40124 89 89 runTests("italic", "i", "font-style", "italic"); 90 90 testTagRemovalOnToggle("em", "italic"); // IE adds "em" tags for italic, so we should remove them (even though FF doesn't) 91 runTests("subscript", "sub", "vertical-align", "sub script");92 runTests("superscript", "sup", "vertical-align", "super script");91 runTests("subscript", "sub", "vertical-align", "sub"); 92 runTests("superscript", "sup", "vertical-align", "super"); 93 93 runTests("strikethrough", "strike", "text-decoration", "line-through"); 94 94 testTagRemovalOnToggle("s", "strikethrough"); -
trunk/LayoutTests/editing/execCommand/toggle-styles-expected.txt
r40086 r40124 7 7 PASS bold toggle 8 8 PASS bold removing b 9 FAIL bold removing font-weight: bold -- <span style="">test</span>9 FAIL bold removing font-weight: bold -- <span>test</span> 10 10 FAIL bold removing strong -- <strong><span class="Apple-style-span" style="font-weight: normal;">test</span></strong> 11 11 PASS italic toggle 12 12 PASS italic removing i 13 FAIL italic removing font-style: italic -- <span style="">test</span>13 FAIL italic removing font-style: italic -- <span>test</span> 14 14 FAIL italic removing em -- <em><span class="Apple-style-span" style="font-style: normal;">test</span></em> 15 FAIL subscript toggle: <span class="Apple-style-span" style="vertical-align: sub;">test</span> 16 FAIL subscript removing sub -- <sub>test</sub> 17 FAIL subscript removing vertical-align: sub script -- <span><span class="Apple-style-span" style="vertical-align: sub;">test</span></span>18 FAIL superscript toggle: <span class="Apple-style-span" style="vertical-align: super;">test</span> 19 FAIL superscript removing sup -- <sup>test</sup> 20 FAIL superscript removing vertical-align: super script -- <span><span class="Apple-style-span" style="vertical-align: super;">test</span></span>15 PASS subscript toggle 16 PASS subscript removing sub 17 FAIL subscript removing vertical-align: sub -- <span>test</span> 18 PASS superscript toggle 19 PASS superscript removing sup 20 FAIL superscript removing vertical-align: super -- <span>test</span> 21 21 PASS strikethrough toggle 22 FAIL strikethrough removing strike -- <strike style=""><span class="Apple-style-span" style="text-decoration: none;">test</span></strike>23 FAIL strikethrough removing text-decoration: line-through -- <span style="">test</span>24 FAIL strikethrough removing s -- <s style=""><span class="Apple-style-span" style="text-decoration: none;">test</span></s>22 FAIL strikethrough removing strike -- <strike><span class="Apple-style-span" style="text-decoration: none;">test</span></strike> 23 FAIL strikethrough removing text-decoration: line-through -- <span>test</span> 24 FAIL strikethrough removing s -- <s><span class="Apple-style-span" style="text-decoration: none;">test</span></s> 25 25 PASS underline toggle 26 FAIL underline removing u -- <u style=""><span class="Apple-style-span" style="text-decoration: none;">test</span></u>27 FAIL underline removing text-decoration: underline -- <span style="">test</span>26 FAIL underline removing u -- <u><span class="Apple-style-span" style="text-decoration: none;">test</span></u> 27 FAIL underline removing text-decoration: underline -- <span>test</span> 28 28 PASS successfullyParsed is true 29 29 -
trunk/LayoutTests/fast/js/resources/switch-behaviour.js
r40086 r40124 241 241 shouldBe("characterSwitch({toString: function(){return 'B'}})", '"default"'); 242 242 shouldBe("characterSwitch(0)", '"default"'); 243 shouldBe("characterSwitch(-0)", '"default"'); 243 244 shouldBe("characterSwitch(1)", '"default"'); 244 245 shouldBe("characterSwitch(-1)", '"default"'); … … 257 258 shouldBe("sparseCharacterSwitch({toString: function(){return 'B'}})", '"default"'); 258 259 shouldBe("sparseCharacterSwitch(0)", '"default"'); 260 shouldBe("sparseCharacterSwitch(-0)", '"default"'); 259 261 shouldBe("sparseCharacterSwitch(1)", '"default"'); 260 262 shouldBe("sparseCharacterSwitch(-1)", '"default"'); … … 275 277 shouldBe("stringSwitch('s')", '"default"'); 276 278 shouldBe("stringSwitch(0)", '"default"'); 279 shouldBe("stringSwitch(-0)", '"default"'); 277 280 shouldBe("stringSwitch(1)", '"default"'); 278 281 shouldBe("stringSwitch(-1)", '"default"'); … … 293 296 shouldBe("numberSwitch('s')", '"default"'); 294 297 shouldBe("numberSwitch(0)", '0'); 298 shouldBe("numberSwitch(-0)", '0'); 295 299 shouldBe("numberSwitch(1)", '1'); 296 300 shouldBe("numberSwitch(-1)", '-1'); … … 311 315 shouldBe("sparseNumberSwitch('s')", '"default"'); 312 316 shouldBe("sparseNumberSwitch(0)", '0'); 317 shouldBe("sparseNumberSwitch(-0)", '0'); 313 318 shouldBe("sparseNumberSwitch(1)", '1'); 314 319 shouldBe("sparseNumberSwitch(-1)", '-1'); … … 329 334 shouldBe("generalSwitch('s')", '"default"'); 330 335 shouldBe("generalSwitch(0)", '0'); 336 shouldBe("generalSwitch(-0)", '0'); 331 337 shouldBe("generalSwitch(1)", '1'); 332 338 shouldBe("generalSwitch(-1)", '-1'); -
trunk/LayoutTests/fast/js/switch-behaviour-expected.txt
r40086 r40124 13 13 PASS characterSwitch({toString: function(){return 'B'}}) is "default" 14 14 PASS characterSwitch(0) is "default" 15 PASS characterSwitch(-0) is "default" 15 16 PASS characterSwitch(1) is "default" 16 17 PASS characterSwitch(-1) is "default" … … 27 28 PASS sparseCharacterSwitch({toString: function(){return 'B'}}) is "default" 28 29 PASS sparseCharacterSwitch(0) is "default" 30 PASS sparseCharacterSwitch(-0) is "default" 29 31 PASS sparseCharacterSwitch(1) is "default" 30 32 PASS sparseCharacterSwitch(-1) is "default" … … 43 45 PASS stringSwitch('s') is "default" 44 46 PASS stringSwitch(0) is "default" 47 PASS stringSwitch(-0) is "default" 45 48 PASS stringSwitch(1) is "default" 46 49 PASS stringSwitch(-1) is "default" … … 59 62 PASS numberSwitch('s') is "default" 60 63 PASS numberSwitch(0) is 0 64 PASS numberSwitch(-0) is 0 61 65 PASS numberSwitch(1) is 1 62 66 PASS numberSwitch(-1) is -1 … … 75 79 PASS sparseNumberSwitch('s') is "default" 76 80 PASS sparseNumberSwitch(0) is 0 81 PASS sparseNumberSwitch(-0) is 0 77 82 PASS sparseNumberSwitch(1) is 1 78 83 PASS sparseNumberSwitch(-1) is -1 … … 91 96 PASS generalSwitch('s') is "default" 92 97 PASS generalSwitch(0) is 0 98 PASS generalSwitch(-0) is 0 93 99 PASS generalSwitch(1) is 1 94 100 PASS generalSwitch(-1) is -1 -
trunk/WebCore/ChangeLog
r40086 r40124 1 2009-01-22 David Hyatt <hyatt@apple.com> 2 3 Fix regressions in list box selection on Mac. The wrong color was being used for the list box 4 background, and list box colors actually weren't even being properly fetched because of a bug in 5 the RenderTheme base class. Existing pixel tests cover the bug fix. 6 7 Reviewed by Jon Honeycutt 8 9 * rendering/RenderTheme.cpp: 10 (WebCore::RenderTheme::activeListBoxSelectionBackgroundColor): 11 (WebCore::RenderTheme::inactiveListBoxSelectionBackgroundColor): 12 (WebCore::RenderTheme::activeListBoxSelectionForegroundColor): 13 (WebCore::RenderTheme::inactiveListBoxSelectionForegroundColor): 14 * rendering/RenderThemeMac.mm: 15 (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor): 16 17 2009-01-22 David Levin <levin@chromium.org> 18 19 Reviewed by Alexey Proskuryakov. 20 21 Bug 22720: Make XMLHttpRequest work in Workers 22 <https://bugs.webkit.org/show_bug.cgi?id=22720> 23 24 Add copy/adopt for HTTPHeaderMap to allow the data to be passed across threads. 25 26 No observable change in behavior, so no test. 27 28 * GNUmakefile.am: 29 * WebCore.pro: 30 * WebCore.scons: 31 * WebCore.vcproj/WebCore.vcproj: 32 * WebCore.xcodeproj/project.pbxproj: 33 * WebCoreSources.bkl: 34 * platform/network/HTTPHeaderMap.cpp: Added. 35 (WebCore::HTTPHeaderMap::copyData): 36 (WebCore::HTTPHeaderMap::adopt): 37 * platform/network/HTTPHeaderMap.h: 38 39 2009-01-21 David Hyatt <hyatt@apple.com> 40 41 Back out a portion of my patch that I did not mean to land. Revert paintOutline back to the way it 42 was before my landing. Fixes failing SVG focus ring tests. 43 44 * rendering/RenderObject.cpp: 45 (WebCore::RenderObject::paintOutline): 46 * rendering/RenderObject.h: 47 * rendering/RenderPath.cpp: 48 (WebCore::RenderPath::paint): 49 * rendering/RenderSVGContainer.cpp: 50 (WebCore::RenderSVGContainer::paint): 51 52 2009-01-21 David Hyatt <hyatt@apple.com> 53 54 Fix Node's renderBox() method on Windows. 55 56 * dom/Node.cpp: 57 (WebCore::Node::renderBox): 58 59 2009-01-21 David Hyatt <hyatt@apple.com> 60 61 Fix RenderThemeSafari bustage on Win32. 62 63 * rendering/RenderThemeSafari.cpp: 64 (WebCore::RenderThemeSafari::baselinePosition): 65 66 2009-01-21 David Hyatt <hyatt@apple.com> 67 68 Fix bustage in RenderThemeWin. It's actually terrible that RenderThemeWin is using absoluteContentBox, 69 but that's a problem for another day. 70 71 * rendering/RenderThemeWin.cpp: 72 (WebCore::RenderThemeWin::paintSearchFieldCancelButton): 73 (WebCore::RenderThemeWin::paintSearchFieldResultsDecoration): 74 (WebCore::RenderThemeWin::paintSearchFieldResultsButton): 75 76 2009-01-21 Oliver Hunt <oliver@apple.com> 77 78 Reviewed by Dave Hyatt. 79 80 Bug 23470: Crash when page load occurs while processing scroll event with MallocScribble enabled 81 <https://bugs.webkit.org/show_bug.cgi?id=23470> 82 83 Add a RefPtr protector to handleWheelEvent to guard against destruction 84 while processing the scroll event. Alas the absurd set of circumstances 85 required to trigger this do not appear to be reproducible in DRT. 86 87 * page/EventHandler.cpp: 88 (WebCore::EventHandler::handleWheelEvent): 89 90 2009-01-21 David Hyatt <hyatt@apple.com> 91 92 Fix for https://bugs.webkit.org/show_bug.cgi?id=23453 93 94 Devirtualize the width/height/x/y methods of the render tree. The methods are now non-virtual on RenderBox. 95 Many functions that were previously in RenderObject.cpp are now in RenderBox.cpp. 96 97 Reviewed by Eric Seidel and Darin Adler 98 99 * WebCore.base.exp: 100 * css/CSSComputedStyleDeclaration.cpp: 101 (WebCore::sizingBox): 102 * dom/ContainerNode.cpp: 103 (WebCore::ContainerNode::getUpperLeftCorner): 104 (WebCore::ContainerNode::getLowerRightCorner): 105 * dom/Element.cpp: 106 (WebCore::Element::offsetLeft): 107 (WebCore::Element::offsetTop): 108 (WebCore::Element::offsetWidth): 109 (WebCore::Element::offsetHeight): 110 (WebCore::Element::offsetParent): 111 (WebCore::Element::clientLeft): 112 (WebCore::Element::clientTop): 113 (WebCore::Element::clientWidth): 114 (WebCore::Element::clientHeight): 115 (WebCore::Element::scrollLeft): 116 (WebCore::Element::scrollTop): 117 (WebCore::Element::setScrollLeft): 118 (WebCore::Element::setScrollTop): 119 (WebCore::Element::scrollWidth): 120 (WebCore::Element::scrollHeight): 121 * dom/Node.cpp: 122 (WebCore::Node::renderBox): 123 (WebCore::Node::getRect): 124 * dom/Node.h: 125 * dom/Position.cpp: 126 (WebCore::endsOfNodeAreVisuallyDistinctPositions): 127 (WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight): 128 (WebCore::Position::isCandidate): 129 * dom/PositionIterator.cpp: 130 (WebCore::PositionIterator::isCandidate): 131 * editing/CompositeEditCommand.cpp: 132 (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded): 133 * editing/DeleteButtonController.cpp: 134 (WebCore::isDeletableElement): 135 * editing/DeleteSelectionCommand.cpp: 136 (WebCore::DeleteSelectionCommand::removeNode): 137 * editing/Editor.cpp: 138 (WebCore::Editor::insideVisibleArea): 139 * editing/EditorCommand.cpp: 140 (WebCore::verticalScrollDistance): 141 * html/HTMLAnchorElement.cpp: 142 (WebCore::HTMLAnchorElement::isKeyboardFocusable): 143 * html/HTMLCanvasElement.cpp: 144 (WebCore::HTMLCanvasElement::willDraw): 145 * html/HTMLFormControlElement.cpp: 146 (WebCore::HTMLFormControlElement::isFocusable): 147 * html/HTMLFrameElementBase.cpp: 148 (WebCore::HTMLFrameElementBase::width): 149 (WebCore::HTMLFrameElementBase::height): 150 * html/HTMLImageElement.cpp: 151 (WebCore::HTMLImageElement::width): 152 (WebCore::HTMLImageElement::height): 153 * inspector/InspectorController.cpp: 154 (WebCore::InspectorController::drawNodeHighlight): 155 * page/AccessibilityRenderObject.cpp: 156 (WebCore::AccessibilityRenderObject::accessibilityIsIgnored): 157 * page/FrameView.cpp: 158 (WebCore::FrameView::createScrollbar): 159 (WebCore::FrameView::updateDashboardRegions): 160 * page/animation/AnimationBase.cpp: 161 (WebCore::blendFunc): 162 * rendering/HitTestResult.cpp: 163 (WebCore::HitTestResult::imageRect): 164 * rendering/InlineBox.cpp: 165 (WebCore::InlineBox::renderBox): 166 (WebCore::InlineBox::adjustPosition): 167 * rendering/InlineBox.h: 168 * rendering/InlineFlowBox.cpp: 169 (WebCore::InlineFlowBox::placeBoxesHorizontally): 170 (WebCore::InlineFlowBox::verticallyAlignBoxes): 171 (WebCore::InlineFlowBox::placeBoxesVertically): 172 * rendering/InlineFlowBox.h: 173 * rendering/RenderApplet.cpp: 174 (WebCore::RenderApplet::createWidgetIfNecessary): 175 * rendering/RenderBlock.cpp: 176 (WebCore::RenderBlock::overflowHeight): 177 (WebCore::RenderBlock::overflowWidth): 178 (WebCore::RenderBlock::overflowRect): 179 (WebCore::RenderBlock::isSelfCollapsingBlock): 180 (WebCore::RenderBlock::layout): 181 (WebCore::RenderBlock::layoutBlock): 182 (WebCore::RenderBlock::adjustPositionedBlock): 183 (WebCore::RenderBlock::adjustFloatingBlock): 184 (WebCore::RenderBlock::handleSpecialChild): 185 (WebCore::RenderBlock::handlePositionedChild): 186 (WebCore::RenderBlock::handleFloatingChild): 187 (WebCore::RenderBlock::handleCompactChild): 188 (WebCore::RenderBlock::insertCompactIfNeeded): 189 (WebCore::RenderBlock::handleRunInChild): 190 (WebCore::RenderBlock::collapseMargins): 191 (WebCore::RenderBlock::clearFloatsIfNeeded): 192 (WebCore::RenderBlock::estimateVerticalPosition): 193 (WebCore::RenderBlock::determineHorizontalPosition): 194 (WebCore::RenderBlock::handleBottomOfBlock): 195 (WebCore::RenderBlock::layoutBlockChildren): 196 (WebCore::RenderBlock::layoutOnlyPositionedObjects): 197 (WebCore::RenderBlock::layoutPositionedObjects): 198 (WebCore::RenderBlock::markPositionedObjectsForLayout): 199 (WebCore::RenderBlock::repaintOverhangingFloats): 200 (WebCore::RenderBlock::paint): 201 (WebCore::RenderBlock::paintChildren): 202 (WebCore::RenderBlock::paintObject): 203 (WebCore::RenderBlock::paintFloats): 204 (WebCore::RenderBlock::paintContinuationOutlines): 205 (WebCore::clipOutPositionedObjects): 206 (WebCore::RenderBlock::fillSelectionGaps): 207 (WebCore::RenderBlock::fillBlockSelectionGaps): 208 (WebCore::RenderBlock::leftSelectionOffset): 209 (WebCore::RenderBlock::rightSelectionOffset): 210 (WebCore::RenderBlock::insertPositionedObject): 211 (WebCore::RenderBlock::removePositionedObject): 212 (WebCore::RenderBlock::removePositionedObjects): 213 (WebCore::RenderBlock::insertFloatingObject): 214 (WebCore::RenderBlock::removeFloatingObject): 215 (WebCore::RenderBlock::positionNewFloats): 216 (WebCore::RenderBlock::newLine): 217 (WebCore::RenderBlock::lowestPosition): 218 (WebCore::RenderBlock::rightmostPosition): 219 (WebCore::RenderBlock::leftmostPosition): 220 (WebCore::RenderBlock::clearFloats): 221 (WebCore::RenderBlock::addOverhangingFloats): 222 (WebCore::RenderBlock::markAllDescendantsWithFloatsForLayout): 223 (WebCore::RenderBlock::getClearDelta): 224 (WebCore::RenderBlock::nodeAtPoint): 225 (WebCore::RenderBlock::positionForCoordinates): 226 (WebCore::RenderBlock::layoutColumns): 227 (WebCore::RenderBlock::getBaselineOfFirstLineBox): 228 (WebCore::RenderBlock::getBaselineOfLastLineBox): 229 (WebCore::getHeightForLineCount): 230 (WebCore::RenderBlock::adjustForBorderFit): 231 * rendering/RenderBlock.h: 232 (WebCore::RenderBlock::FloatWithRect::FloatWithRect): 233 (WebCore::RenderBlock::hasOverhangingFloats): 234 (WebCore::RenderBlock::CompactInfo::compact): 235 (WebCore::RenderBlock::CompactInfo::set): 236 * rendering/RenderBox.cpp: 237 (WebCore::RenderBox::RenderBox): 238 (WebCore::RenderBox::offsetLeft): 239 (WebCore::RenderBox::offsetTop): 240 (WebCore::RenderBox::offsetParent): 241 (WebCore::RenderBox::clientWidth): 242 (WebCore::RenderBox::clientHeight): 243 (WebCore::RenderBox::scrollWidth): 244 (WebCore::RenderBox::scrollHeight): 245 (WebCore::RenderBox::scrollLeft): 246 (WebCore::RenderBox::scrollTop): 247 (WebCore::RenderBox::setScrollLeft): 248 (WebCore::RenderBox::setScrollTop): 249 (WebCore::RenderBox::absoluteRects): 250 (WebCore::RenderBox::absoluteQuads): 251 (WebCore::RenderBox::absoluteContentBox): 252 (WebCore::RenderBox::absoluteContentQuad): 253 (WebCore::RenderBox::absoluteOutlineBounds): 254 (WebCore::RenderBox::addFocusRingRects): 255 (WebCore::RenderBox::reflectionBox): 256 (WebCore::RenderBox::reflectionOffset): 257 (WebCore::RenderBox::reflectedRect): 258 (WebCore::RenderBox::overrideWidth): 259 (WebCore::RenderBox::overrideHeight): 260 (WebCore::RenderBox::nodeAtPoint): 261 (WebCore::RenderBox::paint): 262 (WebCore::RenderBox::maskClipRect): 263 (WebCore::RenderBox::repaintLayerRectsForImage): 264 (WebCore::RenderBox::paintCustomHighlight): 265 (WebCore::RenderBox::getOverflowClipRect): 266 (WebCore::RenderBox::getClipRect): 267 (WebCore::RenderBox::containingBlockWidth): 268 (WebCore::RenderBox::localToAbsolute): 269 (WebCore::RenderBox::offsetFromContainer): 270 (WebCore::RenderBox::position): 271 (WebCore::RenderBox::computeAbsoluteRepaintRect): 272 (WebCore::RenderBox::repaintDuringLayoutIfMoved): 273 (WebCore::RenderBox::calcWidth): 274 (WebCore::RenderBox::calcWidthUsing): 275 (WebCore::RenderBox::calcHorizontalMargins): 276 (WebCore::RenderBox::calcHeight): 277 (WebCore::RenderBox::calcPercentageHeight): 278 (WebCore::RenderBox::calcReplacedHeightUsing): 279 (WebCore::RenderBox::containingBlockWidthForPositioned): 280 (WebCore::RenderBox::containingBlockHeightForPositioned): 281 (WebCore::RenderBox::calcAbsoluteHorizontal): 282 (WebCore::RenderBox::calcAbsoluteVertical): 283 (WebCore::RenderBox::calcAbsoluteVerticalValues): 284 (WebCore::RenderBox::calcAbsoluteHorizontalReplaced): 285 (WebCore::RenderBox::calcAbsoluteVerticalReplaced): 286 (WebCore::RenderBox::localCaretRect): 287 (WebCore::RenderBox::lowestPosition): 288 (WebCore::RenderBox::rightmostPosition): 289 (WebCore::RenderBox::leftmostPosition): 290 (WebCore::RenderBox::localTransform): 291 * rendering/RenderBox.h: 292 (WebCore::): 293 (WebCore::RenderBox::x): 294 (WebCore::RenderBox::y): 295 (WebCore::RenderBox::width): 296 (WebCore::RenderBox::height): 297 (WebCore::RenderBox::setX): 298 (WebCore::RenderBox::setY): 299 (WebCore::RenderBox::setWidth): 300 (WebCore::RenderBox::setHeight): 301 (WebCore::RenderBox::location): 302 (WebCore::RenderBox::size): 303 (WebCore::RenderBox::setLocation): 304 (WebCore::RenderBox::setSize): 305 (WebCore::RenderBox::move): 306 (WebCore::RenderBox::frameRect): 307 (WebCore::RenderBox::setFrameRect): 308 (WebCore::RenderBox::borderBoxRect): 309 (WebCore::RenderBox::contentBoxRect): 310 (WebCore::RenderBox::previousSiblingBox): 311 (WebCore::RenderBox::nextSiblingBox): 312 (WebCore::RenderBox::parentBox): 313 (WebCore::RenderBox::overflowHeight): 314 (WebCore::RenderBox::overflowWidth): 315 (WebCore::RenderBox::setOverflowHeight): 316 (WebCore::RenderBox::setOverflowWidth): 317 (WebCore::RenderBox::overflowLeft): 318 (WebCore::RenderBox::overflowTop): 319 (WebCore::RenderBox::overflowRect): 320 (WebCore::RenderBox::contentWidth): 321 (WebCore::RenderBox::contentHeight): 322 (WebCore::RenderBox::offsetWidth): 323 (WebCore::RenderBox::offsetHeight): 324 (WebCore::RenderBox::clientLeft): 325 (WebCore::RenderBox::clientTop): 326 (WebCore::RenderBox::availableWidth): 327 (WebCore::RenderBox::tryLayoutDoingPositionedMovementOnly): 328 * rendering/RenderButton.cpp: 329 (WebCore::RenderButton::controlClipRect): 330 * rendering/RenderContainer.cpp: 331 (WebCore::RenderContainer::layout): 332 (WebCore::RenderContainer::positionForCoordinates): 333 * rendering/RenderContainer.h: 334 (WebCore::RenderContainer::firstChildBox): 335 (WebCore::RenderContainer::lastChildBox): 336 * rendering/RenderFieldset.cpp: 337 (WebCore::RenderFieldset::calcPrefWidths): 338 (WebCore::RenderFieldset::layoutLegend): 339 (WebCore::RenderFieldset::findLegend): 340 (WebCore::RenderFieldset::paintBoxDecorations): 341 (WebCore::RenderFieldset::paintMask): 342 * rendering/RenderFieldset.h: 343 * rendering/RenderFileUploadControl.cpp: 344 (WebCore::RenderFileUploadControl::maxFilenameWidth): 345 (WebCore::RenderFileUploadControl::paintObject): 346 * rendering/RenderFlexibleBox.cpp: 347 (WebCore::FlexBoxIterator::FlexBoxIterator): 348 (WebCore::FlexBoxIterator::first): 349 (WebCore::FlexBoxIterator::next): 350 (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths): 351 (WebCore::RenderFlexibleBox::calcVerticalPrefWidths): 352 (WebCore::RenderFlexibleBox::layoutBlock): 353 (WebCore::RenderFlexibleBox::layoutHorizontalBox): 354 (WebCore::RenderFlexibleBox::layoutVerticalBox): 355 (WebCore::RenderFlexibleBox::placeChild): 356 (WebCore::RenderFlexibleBox::allowedChildFlex): 357 * rendering/RenderFlexibleBox.h: 358 * rendering/RenderFlow.cpp: 359 (WebCore::RenderFlow::absoluteClippedOverflowRect): 360 (WebCore::RenderFlow::lowestPosition): 361 (WebCore::RenderFlow::rightmostPosition): 362 (WebCore::RenderFlow::leftmostPosition): 363 (WebCore::RenderFlow::localCaretRect): 364 (WebCore::RenderFlow::addFocusRingRects): 365 * rendering/RenderFrameSet.cpp: 366 (WebCore::RenderFrameSet::paint): 367 (WebCore::RenderFrameSet::layout): 368 (WebCore::RenderFrameSet::positionFrames): 369 * rendering/RenderHTMLCanvas.cpp: 370 (WebCore::RenderHTMLCanvas::paintReplaced): 371 (WebCore::RenderHTMLCanvas::canvasSizeChanged): 372 * rendering/RenderImage.cpp: 373 (WebCore::RenderImage::imageChanged): 374 (WebCore::RenderImage::paintReplaced): 375 (WebCore::RenderImage::nodeAtPoint): 376 (WebCore::RenderImage::calcReplacedWidth): 377 * rendering/RenderInline.cpp: 378 (WebCore::RenderInline::absoluteRects): 379 (WebCore::RenderInline::boundingBoxWidth): 380 (WebCore::RenderInline::boundingBoxHeight): 381 (WebCore::RenderInline::positionForCoordinates): 382 * rendering/RenderInline.h: 383 (WebCore::RenderInline::offsetWidth): 384 (WebCore::RenderInline::offsetHeight): 385 * rendering/RenderLayer.cpp: 386 (WebCore::RenderLayer::updateTransform): 387 (WebCore::RenderLayer::updateLayerPosition): 388 (WebCore::RenderLayer::scrollbarCornerPresent): 389 (WebCore::RenderLayer::createScrollbar): 390 (WebCore::RenderLayer::positionOverflowControls): 391 (WebCore::RenderLayer::paintScrollCorner): 392 (WebCore::RenderLayer::paintResizer): 393 (WebCore::RenderLayer::paintLayer): 394 (WebCore::RenderLayer::hitTestLayer): 395 (WebCore::RenderLayer::calculateRects): 396 (WebCore::RenderLayer::boundingBox): 397 * rendering/RenderListBox.cpp: 398 (WebCore::RenderListBox::calcHeight): 399 (WebCore::RenderListBox::controlClipRect): 400 * rendering/RenderListItem.cpp: 401 (WebCore::RenderListItem::positionListMarker): 402 (WebCore::RenderListItem::paint): 403 * rendering/RenderListMarker.cpp: 404 (WebCore::RenderListMarker::paint): 405 (WebCore::RenderListMarker::layout): 406 (WebCore::RenderListMarker::imageChanged): 407 (WebCore::RenderListMarker::getRelativeMarkerRect): 408 (WebCore::RenderListMarker::selectionRect): 409 * rendering/RenderMarquee.cpp: 410 (WebCore::RenderMarquee::computePosition): 411 * rendering/RenderMedia.cpp: 412 (WebCore::RenderMedia::layout): 413 (WebCore::RenderMedia::lowestPosition): 414 (WebCore::RenderMedia::rightmostPosition): 415 (WebCore::RenderMedia::leftmostPosition): 416 * rendering/RenderMenuList.cpp: 417 (WebCore::RenderMenuList::controlClipRect): 418 * rendering/RenderObject.cpp: 419 (WebCore::RenderObject::RenderObject): 420 (WebCore::RenderObject::markAllDescendantsWithFloatsForLayout): 421 (WebCore::RenderObject::paintOutline): 422 (WebCore::RenderObject::addLineBoxRects): 423 (WebCore::RenderObject::absoluteBoundingBoxRect): 424 (WebCore::RenderObject::addAbsoluteRectForLayer): 425 (WebCore::RenderObject::paintingRootRect): 426 (WebCore::RenderObject::container): 427 (WebCore::RenderObject::removeFromObjectLists): 428 (WebCore::RenderObject::updateHitTestResult): 429 (WebCore::RenderObject::addDashboardRegions): 430 (WebCore::RenderObject::localTransform): 431 * rendering/RenderObject.h: 432 (WebCore::RenderObject::isBox): 433 (WebCore::RenderObject::hasMask): 434 (WebCore::RenderObject::setIsText): 435 (WebCore::RenderObject::setIsBox): 436 (WebCore::RenderObject::borderTop): 437 (WebCore::RenderObject::borderBottom): 438 (WebCore::RenderObject::absoluteRects): 439 (WebCore::RenderObject::collectAbsoluteLineBoxQuads): 440 (WebCore::RenderObject::absoluteQuads): 441 (WebCore::RenderObject::hasReflection): 442 (WebCore::RenderObject::addFocusRingRects): 443 (WebCore::RenderObject::absoluteOutlineBounds): 444 * rendering/RenderPart.cpp: 445 (WebCore::RenderPart::updateWidgetPosition): 446 * rendering/RenderPath.cpp: 447 (WebCore::RenderPath::layout): 448 (WebCore::RenderPath::paint): 449 (WebCore::RenderPath::absoluteOutlineBounds): 450 * rendering/RenderPath.h: 451 * rendering/RenderReplaced.cpp: 452 (WebCore::RenderReplaced::layout): 453 (WebCore::RenderReplaced::paint): 454 (WebCore::RenderReplaced::shouldPaint): 455 (WebCore::RenderReplaced::positionForCoordinates): 456 (WebCore::RenderReplaced::localSelectionRect): 457 (WebCore::RenderReplaced::adjustOverflowForBoxShadow): 458 (WebCore::RenderReplaced::overflowRect): 459 * rendering/RenderReplica.cpp: 460 (WebCore::RenderReplica::layout): 461 (WebCore::RenderReplica::calcPrefWidths): 462 (WebCore::RenderReplica::paint): 463 * rendering/RenderSVGContainer.cpp: 464 (WebCore::RenderSVGContainer::paint): 465 (WebCore::RenderSVGContainer::absoluteOutlineBounds): 466 * rendering/RenderSVGContainer.h: 467 (WebCore::RenderSVGContainer::width): 468 (WebCore::RenderSVGContainer::height): 469 * rendering/RenderSVGImage.cpp: 470 (WebCore::RenderSVGImage::layout): 471 * rendering/RenderSVGInlineText.cpp: 472 (WebCore::RenderSVGInlineText::computeAbsoluteRectForRange): 473 (WebCore::RenderSVGInlineText::positionForCoordinates): 474 * rendering/RenderSVGRoot.cpp: 475 (WebCore::RenderSVGRoot::layout): 476 (WebCore::RenderSVGRoot::applyContentTransforms): 477 (WebCore::RenderSVGRoot::paint): 478 (WebCore::RenderSVGRoot::absoluteTransform): 479 (WebCore::RenderSVGRoot::nodeAtPoint): 480 * rendering/RenderSVGTSpan.cpp: 481 (WebCore::RenderSVGTSpan::absoluteRects): 482 (WebCore::RenderSVGTSpan::absoluteQuads): 483 * rendering/RenderSVGText.cpp: 484 (WebCore::RenderSVGText::layout): 485 (WebCore::RenderSVGText::relativeBBox): 486 * rendering/RenderSVGTextPath.cpp: 487 (WebCore::RenderSVGTextPath::absoluteRects): 488 (WebCore::RenderSVGTextPath::absoluteQuads): 489 * rendering/RenderSVGViewportContainer.cpp: 490 (WebCore::RenderSVGViewportContainer::nodeAtPoint): 491 * rendering/RenderScrollbar.cpp: 492 (WebCore::RenderScrollbar::createCustomScrollbar): 493 (WebCore::RenderScrollbar::RenderScrollbar): 494 (WebCore::RenderScrollbar::setParent): 495 * rendering/RenderScrollbar.h: 496 (WebCore::RenderScrollbar::owningRenderer): 497 * rendering/RenderScrollbarPart.cpp: 498 (WebCore::RenderScrollbarPart::layout): 499 (WebCore::RenderScrollbarPart::layoutHorizontalPart): 500 (WebCore::RenderScrollbarPart::layoutVerticalPart): 501 (WebCore::RenderScrollbarPart::computeScrollbarWidth): 502 (WebCore::RenderScrollbarPart::computeScrollbarHeight): 503 (WebCore::RenderScrollbarPart::paintIntoRect): 504 * rendering/RenderSlider.cpp: 505 (WebCore::HTMLSliderThumbElement::defaultEventHandler): 506 (WebCore::RenderSlider::layout): 507 (WebCore::RenderSlider::mouseEventIsInThumb): 508 (WebCore::RenderSlider::positionForOffset): 509 (WebCore::RenderSlider::trackSize): 510 * rendering/RenderTable.cpp: 511 (WebCore::RenderTable::calcWidth): 512 (WebCore::RenderTable::layout): 513 (WebCore::RenderTable::paint): 514 (WebCore::RenderTable::getBaselineOfFirstLineBox): 515 * rendering/RenderTableCell.cpp: 516 (WebCore::RenderTableCell::updateWidth): 517 (WebCore::RenderTableCell::computeAbsoluteRepaintRect): 518 (WebCore::RenderTableCell::localToAbsolute): 519 (WebCore::RenderTableCell::absoluteToLocal): 520 (WebCore::RenderTableCell::localToAbsoluteQuad): 521 (WebCore::RenderTableCell::paint): 522 (WebCore::RenderTableCell::paintBackgroundsBehindCell): 523 * rendering/RenderTableCell.h: 524 * rendering/RenderTableSection.cpp: 525 (WebCore::RenderTableSection::addChild): 526 (WebCore::RenderTableSection::addCell): 527 (WebCore::RenderTableSection::setCellWidths): 528 (WebCore::RenderTableSection::calcRowHeight): 529 (WebCore::RenderTableSection::layoutRows): 530 (WebCore::RenderTableSection::lowestPosition): 531 (WebCore::RenderTableSection::rightmostPosition): 532 (WebCore::RenderTableSection::leftmostPosition): 533 (WebCore::RenderTableSection::getBaselineOfFirstLineBox): 534 (WebCore::RenderTableSection::paint): 535 (WebCore::RenderTableSection::recalcCells): 536 (WebCore::RenderTableSection::nodeAtPoint): 537 * rendering/RenderTableSection.h: 538 (WebCore::RenderTableSection::overflowWidth): 539 (WebCore::RenderTableSection::overflowHeight): 540 * rendering/RenderText.cpp: 541 (WebCore::RenderText::RenderText): 542 (WebCore::RenderText::boundingBoxX): 543 (WebCore::RenderText::boundingBoxY): 544 (WebCore::RenderText::firstRunX): 545 (WebCore::RenderText::firstRunY): 546 (WebCore::RenderText::boundingBoxHeight): 547 (WebCore::RenderText::boundingBoxWidth): 548 * rendering/RenderText.h: 549 * rendering/RenderTextControl.cpp: 550 (WebCore::RenderTextControl::textBlockHeight): 551 (WebCore::RenderTextControl::textBlockWidth): 552 (WebCore::RenderTextControl::setSelectionRange): 553 (WebCore::RenderTextControl::calcHeight): 554 (WebCore::RenderTextControl::hitInnerTextBlock): 555 (WebCore::RenderTextControl::controlClipRect): 556 * rendering/RenderTextControlMultiLine.cpp: 557 (WebCore::RenderTextControlMultiLine::layout): 558 (WebCore::RenderTextControlMultiLine::adjustControlHeightBasedOnLineHeight): 559 * rendering/RenderTextControlSingleLine.cpp: 560 (WebCore::RenderTextControlSingleLine::paint): 561 (WebCore::RenderTextControlSingleLine::layout): 562 (WebCore::RenderTextControlSingleLine::nodeAtPoint): 563 (WebCore::RenderTextControlSingleLine::forwardEvent): 564 (WebCore::RenderTextControlSingleLine::textBlockWidth): 565 (WebCore::RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight): 566 (WebCore::RenderTextControlSingleLine::clientPaddingLeft): 567 (WebCore::RenderTextControlSingleLine::clientPaddingRight): 568 * rendering/RenderTheme.cpp: 569 (WebCore::RenderTheme::hitTestMediaControlPart): 570 (WebCore::RenderTheme::baselinePosition): 571 * rendering/RenderThemeMac.mm: 572 (WebCore::RenderThemeMac::paintSearchFieldCancelButton): 573 (WebCore::RenderThemeMac::paintSearchFieldResultsDecoration): 574 (WebCore::RenderThemeMac::paintSearchFieldResultsButton): 575 (WebCore::RenderThemeMac::hitTestMediaControlPart): 576 * rendering/RenderTreeAsText.cpp: 577 (WebCore::operator<<): 578 * rendering/RenderVideo.cpp: 579 (WebCore::RenderVideo::videoBox): 580 * rendering/RenderView.cpp: 581 (WebCore::RenderView::RenderView): 582 (WebCore::RenderView::calcHeight): 583 (WebCore::RenderView::calcWidth): 584 (WebCore::RenderView::layout): 585 (WebCore::RenderView::viewRect): 586 (WebCore::RenderView::docHeight): 587 (WebCore::RenderView::docWidth): 588 (WebCore::RenderView::setBestTruncatedAt): 589 * rendering/RenderView.h: 590 * rendering/RenderWidget.cpp: 591 (WebCore::RenderWidget::paint): 592 (WebCore::RenderWidget::updateWidgetPosition): 593 (WebCore::RenderWidget::nodeAtPoint): 594 * rendering/RootInlineBox.h: 595 (WebCore::RootInlineBox::floats): 596 (WebCore::RootInlineBox::floatsPtr): 597 * rendering/SVGInlineFlowBox.cpp: 598 (WebCore::SVGInlineFlowBox::verticallyAlignBoxes): 599 * rendering/SVGInlineFlowBox.h: 600 * rendering/SVGRenderTreeAsText.cpp: 601 (WebCore::operator<<): 602 (WebCore::write): 603 * rendering/SVGRootInlineBox.cpp: 604 (WebCore::SVGRootInlineBox::verticallyAlignBoxes): 605 (WebCore::SVGRootInlineBox::computePerCharacterLayoutInformation): 606 (WebCore::SVGRootInlineBox::layoutInlineBoxes): 607 * rendering/SVGRootInlineBox.h: 608 * rendering/bidi.cpp: 609 (WebCore::RenderBlock::computeHorizontalPositionsForLine): 610 (WebCore::RenderBlock::computeVerticalPositionsForLine): 611 (WebCore::RenderBlock::layoutInlineChildren): 612 (WebCore::RenderBlock::determineStartPosition): 613 (WebCore::RenderBlock::matchedEndLine): 614 (WebCore::RenderBlock::skipTrailingWhitespace): 615 (WebCore::RenderBlock::skipLeadingWhitespace): 616 (WebCore::RenderBlock::fitBelowFloats): 617 (WebCore::RenderBlock::findNextLineBreak): 618 (WebCore::RenderBlock::checkLinesForOverflow): 619 * svg/SVGLength.cpp: 620 (WebCore::SVGLength::PercentageOfViewport): 621 622 2009-01-21 Anders Carlsson <andersca@apple.com> 623 624 Reviewed by Sam Weinig. 625 626 * WebCore.LP64.exp: 627 Add some bridge related symbols. 628 629 * WebCore.xcodeproj/project.pbxproj: 630 Make runtime_object.h a private header. 631 632 2009-01-20 David Levin <levin@chromium.org> 633 634 Reviewed by Alexey Proskuryakov. 635 636 Bug 22720: Make XMLHttpRequest work in Workers 637 <https://bugs.webkit.org/show_bug.cgi?id=22720> 638 639 More removal of document usage from XMLHttpRequest. 640 * Abstracted away the sync and async requests behind the ThreadableLoader class, which 641 will get an implementation for Workers. ThreadableLoader follows the same model as 642 SubresourceLoader because DocumentThreadableLoader is a thin wrapper around SubresourceLoader. 643 Also, WorkerThreadableLoader (coming soon) will use DocumentThreadableLoader to get things done. 644 * Consolidated dashboard compatibility checks into usesDashboardBackwardCompatibilityMode 645 which handles workers. 646 647 No observable change in behavior, so no test. 648 649 * GNUmakefile.am: 650 * WebCore.pro: 651 * WebCore.scons: 652 * WebCore.vcproj/WebCore.vcproj: 653 * WebCore.xcodeproj/project.pbxproj: 654 * WebCoreSources.bkl: 655 * loader/DocumentThreadableLoader.cpp: Added. 656 (WebCore::DocumentThreadableLoader::create): 657 (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): 658 (WebCore::DocumentThreadableLoader::~DocumentThreadableLoader): 659 (WebCore::DocumentThreadableLoader::cancel): 660 (WebCore::DocumentThreadableLoader::willSendRequest): 661 (WebCore::DocumentThreadableLoader::didSendData): 662 (WebCore::DocumentThreadableLoader::didReceiveResponse): 663 (WebCore::DocumentThreadableLoader::didReceiveData): 664 (WebCore::DocumentThreadableLoader::didFinishLoading): 665 (WebCore::DocumentThreadableLoader::didFail): 666 (WebCore::DocumentThreadableLoader::receivedCancellation): 667 * loader/DocumentThreadableLoader.h: Added. 668 (WebCore::DocumentThreadableLoader::refThreadableLoader): 669 (WebCore::DocumentThreadableLoader::derefThreadableLoader): 670 * loader/SubresourceLoaderClient.h: 671 (WebCore::SubresourceLoaderClient::didReceiveData): 672 * loader/ThreadableLoader.cpp: Added. 673 (WebCore::ThreadableLoader::create): 674 (WebCore::ThreadableLoader::loadResourceSynchronously): 675 * loader/ThreadableLoader.h: Added. 676 (WebCore::): 677 (WebCore::ThreadableLoader::ref): 678 (WebCore::ThreadableLoader::deref): 679 (WebCore::ThreadableLoader::~ThreadableLoader): 680 * loader/ThreadableLoaderClient.h: Added. 681 (WebCore::ThreadableLoaderClient::didSendData): 682 (WebCore::ThreadableLoaderClient::didReceiveResponse): 683 (WebCore::ThreadableLoaderClient::didReceiveData): 684 (WebCore::ThreadableLoaderClient::didFinishLoading): 685 (WebCore::ThreadableLoaderClient::didFail): 686 (WebCore::ThreadableLoaderClient::didGetCancelled): 687 (WebCore::ThreadableLoaderClient::didReceiveAuthenticationCancellation): 688 (WebCore::ThreadableLoaderClient::~ThreadableLoaderClient): 689 * xml/XMLHttpRequest.cpp: 690 (WebCore::XMLHttpRequest::XMLHttpRequest): 691 (WebCore::XMLHttpRequest::usesDashboardBackwardCompatibilityMode): 692 (WebCore::XMLHttpRequest::send): 693 (WebCore::XMLHttpRequest::loadRequestSynchronously): 694 (WebCore::XMLHttpRequest::loadRequestAsynchronously): 695 (WebCore::XMLHttpRequest::setRequestHeader): 696 (WebCore::XMLHttpRequest::processSyncLoadResults): 697 (WebCore::XMLHttpRequest::didFail): 698 (WebCore::XMLHttpRequest::didGetCancelled): 699 (WebCore::XMLHttpRequest::didFinishLoading): 700 (WebCore::XMLHttpRequest::didFinishLoadingPreflight): 701 (WebCore::XMLHttpRequest::didSendData): 702 (WebCore::XMLHttpRequest::didReceiveResponse): 703 (WebCore::XMLHttpRequest::didReceiveResponsePreflight): 704 (WebCore::XMLHttpRequest::didReceiveAuthenticationCancellation): 705 (WebCore::XMLHttpRequest::didReceiveData): 706 * xml/XMLHttpRequest.h: 707 708 2009-01-19 Chris Marrin <cmarrin@apple.com> 709 710 Reviewed by David Hyatt. 711 712 Fix for https://bugs.webkit.org/show_bug.cgi?id=23317 713 714 The high CPU usage was really from repeatedly firing transitions caused 715 by a bug in the way we handle background-color animations. If animating 716 from a valid background color to no background color, we sometimes left 717 (based on timing) the background color as transparent black, but valid 718 rather than invalid, which it should be. Fixing that got rid of the 719 repeated firing. 720 721 But we really were doing more expensive iteration of all objects with 722 animations or transitions on them (running or not). So I added two 723 optimizations to quickly short circuit when an object had no running 724 animations or transitions. Things are now as zippy as ever. 725 726 Test: transitions/repeated-firing-background-color.html 727 728 * page/animation/AnimationBase.cpp: 729 (WebCore::blendFunc): 730 * page/animation/AnimationController.cpp: 731 (WebCore::AnimationControllerPrivate::updateAnimationTimer): 732 * page/animation/CompositeAnimation.cpp: 733 (WebCore::CompositeAnimationPrivate::hasAnimations): 734 (WebCore::CompositeAnimationPrivate::clearRenderer): 735 (WebCore::CompositeAnimationPrivate::animate): 736 (WebCore::CompositeAnimationPrivate::setAnimating): 737 (WebCore::CompositeAnimationPrivate::willNeedService): 738 (WebCore::CompositeAnimationPrivate::getAnimationForProperty): 739 (WebCore::CompositeAnimationPrivate::cleanupFinishedAnimations): 740 (WebCore::CompositeAnimationPrivate::setAnimationStartTime): 741 (WebCore::CompositeAnimationPrivate::setTransitionStartTime): 742 (WebCore::CompositeAnimationPrivate::suspendAnimations): 743 (WebCore::CompositeAnimationPrivate::resumeAnimations): 744 (WebCore::CompositeAnimationPrivate::overrideImplicitAnimations): 745 (WebCore::CompositeAnimationPrivate::resumeOverriddenImplicitAnimations): 746 (WebCore::CompositeAnimationPrivate::styleAvailable): 747 (WebCore::CompositeAnimationPrivate::isAnimatingProperty): 748 (WebCore::CompositeAnimationPrivate::numberOfActiveAnimations): 749 (WebCore::CompositeAnimation::hasAnimations): 750 * page/animation/CompositeAnimation.h: 751 752 2009-01-21 Eric Seidel <eric@webkit.org> 753 754 Reviewed by Justin Garcia. 755 756 Remove the style='' turds left by some editing commands 757 https://bugs.webkit.org/show_bug.cgi?id=23463 758 759 Test: editing/execCommand/toggle-styles.html 760 761 * editing/ApplyStyleCommand.cpp: 762 (WebCore::ApplyStyleCommand::removeCSSStyle): check if we just removed the last CSS property and remove the style attribute as well 763 * editing/CompositeEditCommand.cpp: 764 (WebCore::CompositeEditCommand::removeNodeAttribute): remove extra ; 765 766 2009-01-21 Eric Seidel <eric@webkit.org> 767 768 No review, build fix. 769 770 Fix release-only build failure (and do a tiny code-cleanup). 771 772 * editing/ApplyStyleCommand.cpp: 773 (WebCore::createFontElement): 774 (WebCore::createStyleSpanElement): 775 (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded): 776 777 2009-01-21 Chris Fleizach <cfleizach@apple.com> 778 779 Reviewed by Beth Dakin. 780 781 Bug 23443: Table accessibility should be re-enabled after fixing crash that occurs at WebCore::AccessibilityTable::isTableExposableThroughAccessibility() 782 https://bugs.webkit.org/show_bug.cgi?id=23443 783 784 Test: accessibility/table-modification-crash.html 785 786 * page/AccessibilityObject.cpp: 787 (WebCore::AccessibilityObject::updateBackingStore): 788 * page/AccessibilityObject.h: 789 * page/AccessibilityRenderObject.cpp: 790 (WebCore::AccessibilityRenderObject::childrenChanged): 791 (WebCore::AccessibilityRenderObject::children): 792 (WebCore::AccessibilityRenderObject::updateBackingStore): 793 * page/AccessibilityRenderObject.h: 794 (WebCore::AccessibilityRenderObject::markChildrenDirty): 795 * page/AccessibilityTable.cpp: 796 (WebCore::AccessibilityTable::AccessibilityTable): 797 * page/mac/AccessibilityObjectWrapper.mm: 798 (-[AccessibilityObjectWrapper accessibilityActionNames]): 799 (-[AccessibilityObjectWrapper accessibilityAttributeNames]): 800 (-[AccessibilityObjectWrapper accessibilityAttributeValue:]): 801 (-[AccessibilityObjectWrapper accessibilityFocusedUIElement]): 802 (-[AccessibilityObjectWrapper accessibilityHitTest:]): 803 (-[AccessibilityObjectWrapper accessibilityIsAttributeSettable:]): 804 (-[AccessibilityObjectWrapper accessibilityIsIgnored]): 805 (-[AccessibilityObjectWrapper accessibilityParameterizedAttributeNames]): 806 (-[AccessibilityObjectWrapper accessibilityPerformPressAction]): 807 (-[AccessibilityObjectWrapper accessibilityPerformAction:]): 808 (-[AccessibilityObjectWrapper accessibilitySetValue:forAttribute:]): 809 (-[AccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): 810 (-[AccessibilityObjectWrapper accessibilityIndexOfChild:]): 811 (-[AccessibilityObjectWrapper accessibilityArrayAttributeCount:]): 812 (-[AccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]): 813 * rendering/RenderObject.cpp: 814 (WebCore::RenderObject::destroy): 815 * rendering/RenderWidget.cpp: 816 (WebCore::RenderWidget::destroy): 817 818 2009-01-16 Eric Seidel <eric@webkit.org> 819 820 Reviewed by Justin Garcia. 821 822 Fix execCommand() 'super' and 'sub' commands to add <sup> and <sub> in quirks mode, and to toggle when called twice 823 https://bugs.webkit.org/show_bug.cgi?id=17733 824 825 Test changed: editing/execCommand/toggle-styles-expected.txt 826 827 * editing/ApplyStyleCommand.cpp: 828 (WebCore::StyleChange::applySubscript): 829 (WebCore::StyleChange::applySuperscript): 830 (WebCore::StyleChange::StyleChange): 831 (WebCore::StyleChange::init): 832 (WebCore::StyleChange::checkForLegacyHTMLStyleChange): 833 (WebCore::ApplyStyleCommand::isHTMLStyleNode): 834 (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded): 835 * editing/EditorCommand.cpp: 836 (WebCore::executeSubscript): 837 (WebCore::executeSuperscript): 838 * editing/htmlediting.cpp: 839 (WebCore::createHTMLElement): 840 * editing/htmlediting.h: 841 842 2009-01-21 Anders Carlsson <andersca@apple.com> 843 844 Fix 64-bit build. 845 846 * WebCore.LP64.exp: 847 848 2009-01-21 Oliver Hunt <oliver@apple.com> 849 850 Reviewed by Alexey Proskuryakov. 851 852 Bug 23458: Reintroduce CanvasPixelArray in ImageData.idl 853 <https://bugs.webkit.org/show_bug.cgi?id=23458> 854 855 Return CanvasPixelArray, et al -- the only difference between this 856 and the original CPA implementation is that it now uses a ByteArray 857 rather than a vector. JSC still uses a custom wrapper, but this allows 858 ObjC, COM, and V8 bindings to be autogenerated again. 859 860 * GNUmakefile.am: 861 * WebCore.pro: 862 * WebCore.vcproj/WebCore.vcproj: 863 * WebCore.xcodeproj/project.pbxproj: 864 * WebCoreSources.bkl: 865 * bindings/js/JSImageDataCustom.cpp: 866 (WebCore::toJS): 867 * html/CanvasPixelArray.cpp: Added. 868 (WebCore::CanvasPixelArray::create): 869 (WebCore::CanvasPixelArray::CanvasPixelArray): 870 * html/CanvasPixelArray.h: Added. 871 (WebCore::CanvasPixelArray::data): 872 (WebCore::CanvasPixelArray::length): 873 (WebCore::CanvasPixelArray::set): 874 (WebCore::CanvasPixelArray::get): 875 * html/CanvasPixelArray.idl: Added. 876 * html/CanvasRenderingContext2D.cpp: 877 (WebCore::createEmptyImageData): 878 * html/ImageData.cpp: 879 (WebCore::ImageData::ImageData): 880 * html/ImageData.h: 881 (WebCore::ImageData::data): 882 * html/ImageData.idl: 883 * platform/graphics/cairo/ImageBufferCairo.cpp: 884 (WebCore::ImageBuffer::getImageData): 885 (WebCore::ImageBuffer::putImageData): 886 * platform/graphics/cg/ImageBufferCG.cpp: 887 (WebCore::ImageBuffer::getImageData): 888 (WebCore::ImageBuffer::putImageData): 889 890 2009-01-21 Dirk Schulze <krit@webkit.org> 891 892 Reviewed by Nikolas Zimmermann. 893 894 Remove last relics of platform dependent PaintServer in SVG. 895 We draw everything with the help of GraphicsContext. 896 897 Remove SVGPaintServerPlatform's 898 [https://bugs.webkit.org/show_bug.cgi?id=23439] 899 900 * GNUmakefile.am: 901 * WebCore.pro: 902 * WebCore.vcproj/WebCore.vcproj: 903 * WebCore.xcodeproj/project.pbxproj: 904 * svg/graphics/SVGPaintServer.cpp: 905 (WebCore::SVGPaintServer::draw): 906 (WebCore::SVGPaintServer::renderPath): 907 (WebCore::SVGPaintServer::teardown): 908 * svg/graphics/SVGPaintServer.h: 909 * svg/graphics/SVGPaintServerGradient.cpp: 910 * svg/graphics/SVGPaintServerGradient.h: 911 * svg/graphics/SVGPaintServerPattern.cpp: 912 * svg/graphics/SVGPaintServerPattern.h: 913 * svg/graphics/SVGPaintServerSolid.cpp: 914 * svg/graphics/SVGPaintServerSolid.h: 915 * svg/graphics/cairo/SVGPaintServerCairo.cpp: Removed. 916 * svg/graphics/cg/SVGPaintServerCg.cpp: Removed. 917 * svg/graphics/qt/SVGPaintServerQt.cpp: Removed. 918 * svg/graphics/skia/SVGPaintServerSkia.cpp: Removed. 919 920 2009-01-21 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com> 921 922 Reviewed by Alexey Proskuryakov. 923 924 Move "Element -> ScriptElement" casting functionality into ScriptElement.h 925 to be consistent with FormControlElement/InputElement/OptionElement/OptionGroupElement. 926 927 It was living in XMLTokenizer before, which is not an obvious place for this. 928 TODO: Rename 'formControlElementForElement' to 'toFormControlElement' (analogous changes for InputElement etc.) 929 as suggested by Alexey, it really reads better this way. 930 931 * dom/ScriptElement.cpp: 932 (WebCore::toScriptElement): 933 * dom/ScriptElement.h: 934 * dom/XMLTokenizer.cpp: 935 (WebCore::XMLTokenizer::notifyFinished): 936 * dom/XMLTokenizer.h: 937 * dom/XMLTokenizerLibxml2.cpp: 938 (WebCore::XMLTokenizer::startElementNs): 939 (WebCore::XMLTokenizer::endElementNs): 940 * dom/XMLTokenizerQt.cpp: 941 (WebCore::XMLTokenizer::parseStartElement): 942 (WebCore::XMLTokenizer::parseEndElement): 943 1 944 2009-01-20 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com> 2 945 -
trunk/WebCore/GNUmakefile.am
r40086 r40124 809 809 WebCore/html/CanvasPattern.cpp \ 810 810 WebCore/html/CanvasPattern.h \ 811 WebCore/html/CanvasPixelArray.cpp \ 812 WebCore/html/CanvasPixelArray.h \ 811 813 WebCore/html/CanvasRenderingContext2D.cpp \ 812 814 WebCore/html/CanvasRenderingContext2D.h \ … … 1042 1044 WebCore/loader/DocumentLoader.cpp \ 1043 1045 WebCore/loader/DocumentLoader.h \ 1046 WebCore/loader/DocumentThreadableLoader.cpp \ 1047 WebCore/loader/DocumentThreadableLoader.h \ 1044 1048 WebCore/loader/EmptyClients.h \ 1045 1049 WebCore/loader/FTPDirectoryDocument.cpp \ … … 1083 1087 WebCore/loader/TextResourceDecoder.cpp \ 1084 1088 WebCore/loader/TextResourceDecoder.h \ 1089 WebCore/loader/ThreadableLoader.cpp \ 1090 WebCore/loader/ThreadableLoader.h \ 1091 WebCore/loader/ThreadableLoaderClient.h \ 1085 1092 WebCore/loader/archive/Archive.h \ 1086 1093 WebCore/loader/archive/ArchiveFactory.cpp \ … … 1380 1387 WebCore/platform/network/FormDataBuilder.h \ 1381 1388 WebCore/platform/network/HTTPHeaderMap.h \ 1389 WebCore/platform/network/HTTPHeaderMap.cpp \ 1382 1390 WebCore/platform/network/HTTPParsers.cpp \ 1383 1391 WebCore/platform/network/HTTPParsers.h \ … … 2844 2852 2845 2853 webcoregtk_sources += \ 2846 WebCore/svg/graphics/cairo/SVGPaintServerCairo.cpp \2847 2854 WebCore/svg/graphics/cairo/SVGResourceFilterCairo.cpp \ 2848 2855 WebCore/svg/graphics/cairo/SVGResourceMaskerCairo.cpp -
trunk/WebCore/WebCore.LP64.exp
r40086 r40124 1 1 # This file gets appended to WebCore.exp, only for 64-bit architectures. 2 2 3 __ZN3JSC16RuntimeObjectImp6s_infoE 4 __ZN3JSC8Bindings10RootObjectD1Ev 5 __ZN3JSC8Bindings8Instance19createRuntimeObjectEPNS_9ExecStateE 6 __ZN3JSC8Bindings8InstanceC2EN3WTF10PassRefPtrINS0_10RootObjectEEE 7 __ZN3JSC8Bindings8InstanceD2Ev 8 __ZN7WebCore16ScriptController9isEnabledEv 3 9 __ZN7WebCore6String8fromUTF8EPKcm 4 __ZN7WebCore16ScriptController9isEnabledEv -
trunk/WebCore/WebCore.base.exp
r40086 r40124 735 735 __ZNK7WebCore12IconDatabase9isEnabledEv 736 736 __ZNK7WebCore12RenderObject14enclosingLayerEv 737 __ZNK7WebCore10RenderText16boundingBoxWidthEv 738 __ZNK7WebCore10RenderText17boundingBoxHeightEv 739 __ZNK7WebCore10RenderText9firstRunXEv 740 __ZNK7WebCore10RenderText9firstRunYEv 737 741 __ZNK7WebCore12SharedBuffer4dataEv 738 742 __ZNK7WebCore12SharedBuffer4sizeEv -
trunk/WebCore/WebCore.pro
r40086 r40124 683 683 html/CanvasGradient.cpp \ 684 684 html/CanvasPattern.cpp \ 685 html/CanvasPixelArray.cpp \ 685 686 html/CanvasRenderingContext2D.cpp \ 686 687 html/CanvasStyle.cpp \ … … 786 787 loader/DocLoader.cpp \ 787 788 loader/DocumentLoader.cpp \ 789 loader/DocumentThreadableLoader.cpp \ 788 790 loader/FormState.cpp \ 789 791 loader/FrameLoader.cpp \ … … 806 808 loader/TextDocument.cpp \ 807 809 loader/TextResourceDecoder.cpp \ 810 loader/ThreadableLoader.cpp \ 808 811 page/AccessibilityImageMapLink.cpp \ 809 812 page/AccessibilityObject.cpp \ … … 907 910 platform/network/FormData.cpp \ 908 911 platform/network/FormDataBuilder.cpp \ 912 platform/network/HTTPHeaderMap.cpp \ 909 913 platform/network/HTTPParsers.cpp \ 910 914 platform/network/NetworkStateNotifier.cpp \ … … 1802 1806 1803 1807 SOURCES += \ 1804 svg/graphics/qt/SVGPaintServerQt.cpp \1805 1808 svg/graphics/qt/SVGResourceFilterQt.cpp \ 1806 1809 svg/graphics/qt/SVGResourceMaskerQt.cpp -
trunk/WebCore/WebCore.scons
r40086 r40124 336 336 'loader/DocLoader.cpp', 337 337 'loader/DocumentLoader.cpp', 338 'loader/DocumentThreadableLoader.cpp', 338 339 'loader/FormState.cpp', 339 340 'loader/FrameLoader.cpp', … … 354 355 'loader/TextDocument.cpp', 355 356 'loader/TextResourceDecoder.cpp', 357 'loader/ThreadableLoader.cpp', 356 358 'loader/UserStyleSheetLoader.cpp', 357 359 ] … … 798 800 'platform/network/FormData.cpp', 799 801 'platform/network/FormDataBuilder.cpp', 802 'platform/network/HTTPHeaderMap.cpp', 800 803 'platform/network/HTTPParsers.cpp', 801 804 'platform/network/mac/NetworkStateNotifierMac.cpp', -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r40086 r40124 2749 2749 </File> 2750 2750 <File 2751 RelativePath="..\loader\DocumentThreadableLoader.cpp" 2752 > 2753 </File> 2754 <File 2755 RelativePath="..\loader\DocumentThreadableLoader.h" 2756 > 2757 </File> 2758 <File 2751 2759 RelativePath="..\loader\FormState.cpp" 2752 2760 > … … 2914 2922 <File 2915 2923 RelativePath="..\loader\TextResourceDecoder.h" 2924 > 2925 </File> 2926 <File 2927 RelativePath="..\loader\ThreadableLoader.cpp" 2928 > 2929 </File> 2930 <File 2931 RelativePath="..\loader\ThreadableLoader.h" 2932 > 2933 </File> 2934 <File 2935 RelativePath="..\loader\ThreadableLoaderClient.h" 2916 2936 > 2917 2937 </File> … … 5806 5826 </File> 5807 5827 <File 5828 RelativePath="..\platform\network\HTTPHeaderMap.cpp" 5829 > 5830 </File> 5831 <File 5808 5832 RelativePath="..\platform\network\HTTPHeaderMap.h" 5809 5833 > … … 12591 12615 </File> 12592 12616 <File 12617 RelativePath="..\html\CanvasPixelArray.cpp" 12618 > 12619 <FileConfiguration 12620 Name="Release_PGO|Win32" 12621 > 12622 <Tool 12623 Name="VCCLCompilerTool" 12624 WholeProgramOptimization="true" 12625 /> 12626 </FileConfiguration> 12627 </File> 12628 <File 12629 RelativePath="..\html\CanvasPixelArray.h" 12630 > 12631 </File> 12632 <File 12593 12633 RelativePath="..\html\CanvasRenderingContext2D.cpp" 12594 12634 > … … 15489 15529 > 15490 15530 <File 15491 RelativePath="..\svg\graphics\cg\SVGPaintServerCg.cpp"15492 >15493 <FileConfiguration15494 Name="Debug_Cairo|Win32"15495 ExcludedFromBuild="true"15496 >15497 <Tool15498 Name="VCCLCompilerTool"15499 />15500 </FileConfiguration>15501 <FileConfiguration15502 Name="Release_Cairo|Win32"15503 ExcludedFromBuild="true"15504 >15505 <Tool15506 Name="VCCLCompilerTool"15507 />15508 </FileConfiguration>15509 </File>15510 <File15511 15531 RelativePath="..\svg\graphics\cg\SVGResourceFilterCg.cpp" 15512 15532 > … … 15708 15728 Name="cairo" 15709 15729 > 15710 <File15711 RelativePath="..\svg\graphics\cairo\SVGPaintServerCairo.cpp"15712 >15713 <FileConfiguration15714 Name="Debug|Win32"15715 ExcludedFromBuild="true"15716 >15717 <Tool15718 Name="VCCLCompilerTool"15719 />15720 </FileConfiguration>15721 <FileConfiguration15722 Name="Release|Win32"15723 ExcludedFromBuild="true"15724 >15725 <Tool15726 Name="VCCLCompilerTool"15727 />15728 </FileConfiguration>15729 <FileConfiguration15730 Name="Debug_Internal|Win32"15731 ExcludedFromBuild="true"15732 >15733 <Tool15734 Name="VCCLCompilerTool"15735 />15736 </FileConfiguration>15737 <FileConfiguration15738 Name="Release_PGO|Win32"15739 ExcludedFromBuild="true"15740 >15741 <Tool15742 Name="VCCLCompilerTool"15743 />15744 </FileConfiguration>15745 </File>15746 15730 <File 15747 15731 RelativePath="..\svg\graphics\cairo\SVGResourceFilterCairo.cpp" -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r40086 r40124 125 125 08E6E0F20EFF42BA00029FBF /* WMLFieldSetElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08E6E0F00EFF42BA00029FBF /* WMLFieldSetElement.h */; }; 126 126 0A4844990CA44CB200B7BD48 /* SoftLinking.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A4844980CA44CB200B7BD48 /* SoftLinking.h */; settings = {ATTRIBUTES = (Private, ); }; }; 127 0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */; }; 128 0B9056190F2578BE0095FF6A /* DocumentThreadableLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */; }; 129 0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */; settings = {ATTRIBUTES = (); }; }; 130 0B90561B0F2578BF0095FF6A /* ThreadableLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9056170F2578BE0095FF6A /* ThreadableLoader.h */; settings = {ATTRIBUTES = (); }; }; 131 0B90561C0F2578BF0095FF6A /* ThreadableLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9056180F2578BE0095FF6A /* ThreadableLoaderClient.h */; settings = {ATTRIBUTES = (); }; }; 132 0B90561E0F257E930095FF6A /* ThreadableLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B90561D0F257E930095FF6A /* ThreadableLoader.cpp */; }; 127 133 0BA5D3860F240FB4009B870B /* GenericWorkerTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BA5D3850F240FB4009B870B /* GenericWorkerTask.h */; }; 128 134 0F56028F0E4B76580065B038 /* RenderMarquee.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F56028D0E4B76580065B038 /* RenderMarquee.h */; }; … … 253 259 1A569D210D7E2B82007C3983 /* runtime_method.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CF20D7E2B82007C3983 /* runtime_method.h */; }; 254 260 1A569D220D7E2B82007C3983 /* runtime_object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A569CF30D7E2B82007C3983 /* runtime_object.cpp */; }; 255 1A569D230D7E2B82007C3983 /* runtime_object.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CF40D7E2B82007C3983 /* runtime_object.h */; };261 1A569D230D7E2B82007C3983 /* runtime_object.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CF40D7E2B82007C3983 /* runtime_object.h */; settings = {ATTRIBUTES = (Private, ); }; }; 256 262 1A569D240D7E2B82007C3983 /* runtime_root.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A569CF50D7E2B82007C3983 /* runtime_root.cpp */; }; 257 263 1A569D250D7E2B82007C3983 /* runtime_root.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CF60D7E2B82007C3983 /* runtime_root.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1788 1794 85FF315A0AAFBFCB00374F38 /* DOMKeyboardEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FF31580AAFBFCB00374F38 /* DOMKeyboardEvent.h */; }; 1789 1795 85FF315B0AAFBFCB00374F38 /* DOMKeyboardEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85FF31590AAFBFCB00374F38 /* DOMKeyboardEvent.mm */; }; 1796 898D1FB30F27934B004BBAC7 /* CanvasPixelArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 898D1FB20F27934B004BBAC7 /* CanvasPixelArray.h */; }; 1790 1797 929264770B61FC7200B41D34 /* JSDocumentCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 929264760B61FC7200B41D34 /* JSDocumentCustom.cpp */; }; 1791 1798 9302B0BD0D79F82900C7EE83 /* PageGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */; }; … … 2044 2051 93F9B7A10BA6032600854064 /* JSCDATASection.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F9B79F0BA6032600854064 /* JSCDATASection.h */; }; 2045 2052 93FDAFCA0B11307400E2746F /* EditorInsertAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FDAFC90B11307400E2746F /* EditorInsertAction.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2053 A7094AFA0F27AE6000596CEC /* CanvasPixelArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7094AF90F27AE6000596CEC /* CanvasPixelArray.cpp */; }; 2054 A7094AFC0F27AEE300596CEC /* CanvasPixelArray.idl in Resources */ = {isa = PBXBuildFile; fileRef = A7094AFB0F27AEE300596CEC /* CanvasPixelArray.idl */; }; 2046 2055 A718760E0B2A120100A16ECE /* DragActions.h in Headers */ = {isa = PBXBuildFile; fileRef = A718760D0B2A120100A16ECE /* DragActions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2047 2056 A71878900B2D04AC00A16ECE /* DragControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */; }; … … 3213 3222 B24055650B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B24055630B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h */; }; 3214 3223 B24055660B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B24055640B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h */; }; 3215 B255992F0D00D8BA00BB825C /* SVGPaintServerCg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598930D00D8B800BB825C /* SVGPaintServerCg.cpp */; };3216 3224 B25599350D00D8BA00BB825C /* SVGResourceFilterCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598990D00D8B800BB825C /* SVGResourceFilterCg.mm */; }; 3217 3225 B25599370D00D8BA00BB825C /* SVGResourceMaskerCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B255989B0D00D8B800BB825C /* SVGResourceMaskerCg.mm */; }; … … 4949 4957 08FB84B10ECE373300DC064E /* WMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLElementFactory.h; sourceTree = "<group>"; }; 4950 4958 0A4844980CA44CB200B7BD48 /* SoftLinking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoftLinking.h; sourceTree = "<group>"; }; 4959 0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderMap.cpp; sourceTree = "<group>"; }; 4960 0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentThreadableLoader.cpp; sourceTree = "<group>"; }; 4961 0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentThreadableLoader.h; sourceTree = "<group>"; }; 4962 0B9056170F2578BE0095FF6A /* ThreadableLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadableLoader.h; sourceTree = "<group>"; }; 4963 0B9056180F2578BE0095FF6A /* ThreadableLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadableLoaderClient.h; sourceTree = "<group>"; }; 4964 0B90561D0F257E930095FF6A /* ThreadableLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadableLoader.cpp; sourceTree = "<group>"; }; 4951 4965 0BA5D3850F240FB4009B870B /* GenericWorkerTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericWorkerTask.h; sourceTree = "<group>"; }; 4952 4966 0F56028D0E4B76580065B038 /* RenderMarquee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMarquee.h; sourceTree = "<group>"; }; … … 6642 6656 85FF31580AAFBFCB00374F38 /* DOMKeyboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMKeyboardEvent.h; sourceTree = "<group>"; }; 6643 6657 85FF31590AAFBFCB00374F38 /* DOMKeyboardEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMKeyboardEvent.mm; sourceTree = "<group>"; }; 6658 898D1FB20F27934B004BBAC7 /* CanvasPixelArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanvasPixelArray.h; sourceTree = "<group>"; }; 6644 6659 929264760B61FC7200B41D34 /* JSDocumentCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocumentCustom.cpp; sourceTree = "<group>"; }; 6645 6660 9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroup.cpp; sourceTree = "<group>"; }; … … 6881 6896 93F9B79F0BA6032600854064 /* JSCDATASection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCDATASection.h; sourceTree = "<group>"; }; 6882 6897 93FDAFC90B11307400E2746F /* EditorInsertAction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EditorInsertAction.h; sourceTree = "<group>"; }; 6898 A7094AF90F27AE6000596CEC /* CanvasPixelArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasPixelArray.cpp; sourceTree = "<group>"; }; 6899 A7094AFB0F27AEE300596CEC /* CanvasPixelArray.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CanvasPixelArray.idl; sourceTree = "<group>"; }; 6883 6900 A718760D0B2A120100A16ECE /* DragActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragActions.h; sourceTree = "<group>"; }; 6884 6901 A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragControllerMac.mm; sourceTree = "<group>"; }; … … 7938 7955 B24055630B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGElementInstanceInternal.h; sourceTree = "<group>"; }; 7939 7956 B24055640B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGElementInstanceListInternal.h; sourceTree = "<group>"; }; 7940 B25598930D00D8B800BB825C /* SVGPaintServerCg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPaintServerCg.cpp; sourceTree = "<group>"; };7941 7957 B25598990D00D8B800BB825C /* SVGResourceFilterCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGResourceFilterCg.mm; sourceTree = "<group>"; }; 7942 7958 B255989B0D00D8B800BB825C /* SVGResourceMaskerCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGResourceMaskerCg.mm; sourceTree = "<group>"; }; … … 9902 9918 085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */, 9903 9919 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */, 9920 0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */, 9904 9921 514C765C0CE923A1007EF3CD /* HTTPHeaderMap.h */, 9905 9922 514C765D0CE923A1007EF3CD /* HTTPParsers.cpp */, … … 11374 11391 93EEC1F209C2877700C515D1 /* CanvasPattern.h */, 11375 11392 930CAB8F09C49F1B00229C04 /* CanvasPattern.idl */, 11393 A7094AF90F27AE6000596CEC /* CanvasPixelArray.cpp */, 11394 898D1FB20F27934B004BBAC7 /* CanvasPixelArray.h */, 11395 A7094AFB0F27AEE300596CEC /* CanvasPixelArray.idl */, 11376 11396 93EEC1ED09C2877700C515D1 /* CanvasRenderingContext2D.cpp */, 11377 11397 93EEC1EE09C2877700C515D1 /* CanvasRenderingContext2D.h */, … … 12772 12792 isa = PBXGroup; 12773 12793 children = ( 12774 B25598930D00D8B800BB825C /* SVGPaintServerCg.cpp */,12775 12794 B25598990D00D8B800BB825C /* SVGResourceFilterCg.mm */, 12776 12795 B255989B0D00D8B800BB825C /* SVGResourceMaskerCg.mm */, … … 13500 13519 93E227DB0AF589AD00D48324 /* DocumentLoader.cpp */, 13501 13520 656D371E0ADBA5DE00A4554D /* DocumentLoader.h */, 13521 0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */, 13522 0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */, 13502 13523 B255990D0D00D8B900BB825C /* EmptyClients.h */, 13503 13524 51E4ADB20C42B4CF0042BC55 /* FTPDirectoryDocument.cpp */, … … 13541 13562 F523D27802DE43D7018635CA /* TextResourceDecoder.cpp */, 13542 13563 F523D27902DE43D7018635CA /* TextResourceDecoder.h */, 13564 0B90561D0F257E930095FF6A /* ThreadableLoader.cpp */, 13565 0B9056170F2578BE0095FF6A /* ThreadableLoader.h */, 13566 0B9056180F2578BE0095FF6A /* ThreadableLoaderClient.h */, 13543 13567 7284ADDB0E6FEB31002EEFBD /* UserStyleSheetLoader.cpp */, 13544 13568 7284ADDC0E6FEB31002EEFBD /* UserStyleSheetLoader.h */, … … 14508 14532 93EEC20309C2877700C515D1 /* CanvasGradient.h in Headers */, 14509 14533 93EEC20409C2877700C515D1 /* CanvasPattern.h in Headers */, 14534 898D1FB30F27934B004BBAC7 /* CanvasPixelArray.h in Headers */, 14510 14535 93EEC20009C2877700C515D1 /* CanvasRenderingContext2D.h in Headers */, 14511 14536 93EEC20109C2877700C515D1 /* CanvasStyle.h in Headers */, … … 15308 15333 656D37360ADBA5DE00A4554D /* DocumentLoader.h in Headers */, 15309 15334 ED2BA83C09A24B91006C0AC4 /* DocumentMarker.h in Headers */, 15335 0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */, 15310 15336 A8185F3909765766005826D9 /* DocumentType.h in Headers */, 15311 15337 A718760E0B2A120100A16ECE /* DragActions.h in Headers */, … … 16420 16446 51DF6D7E0B92A16D00C2DC85 /* ThreadCheck.h in Headers */, 16421 16447 E1FF57A30F01255B00891EBB /* ThreadGlobalData.h in Headers */, 16448 0B90561B0F2578BF0095FF6A /* ThreadableLoader.h in Headers */, 16449 0B90561C0F2578BF0095FF6A /* ThreadableLoaderClient.h in Headers */, 16422 16450 E44613B00CD6331000FADA75 /* TimeRanges.h in Headers */, 16423 16451 9305B24D098F1B6B00C28855 /* Timer.h in Headers */, … … 16655 16683 buildActionMask = 2147483647; 16656 16684 files = ( 16685 A7094AFC0F27AEE300596CEC /* CanvasPixelArray.idl in Resources */, 16657 16686 B25599480D00D8BA00BB825C /* WKArithmeticFilter.cikernel in Resources */, 16658 16687 B255994B0D00D8BA00BB825C /* WKComponentMergeFilter.cikernel in Resources */, … … 16957 16986 93EEC20209C2877700C515D1 /* CanvasGradient.cpp in Sources */, 16958 16987 93EEC26F09C3218000C515D1 /* CanvasPattern.cpp in Sources */, 16988 A7094AFA0F27AE6000596CEC /* CanvasPixelArray.cpp in Sources */, 16959 16989 93EEC1FF09C2877700C515D1 /* CanvasRenderingContext2D.cpp in Sources */, 16960 16990 93EEC27109C3218800C515D1 /* CanvasStyle.cpp in Sources */, … … 17278 17308 93E227E00AF589AD00D48324 /* DocumentLoader.cpp in Sources */, 17279 17309 1C26497A0D7E248A00BD10F2 /* DocumentLoaderMac.cpp in Sources */, 17310 0B9056190F2578BE0095FF6A /* DocumentThreadableLoader.cpp in Sources */, 17280 17311 A8185F3A09765766005826D9 /* DocumentType.cpp in Sources */, 17281 17312 A7CA595E0B27BD9E00FA021D /* DragController.cpp in Sources */, … … 17458 17489 E44613AA0CD6331000FADA75 /* HTMLVideoElement.cpp in Sources */, 17459 17490 BCCD74E50A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp in Sources */, 17491 0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */, 17460 17492 514C76720CE923A1007EF3CD /* HTTPParsers.cpp in Sources */, 17461 17493 BC94D1530C275C8B006BC617 /* History.cpp in Sources */, … … 18224 18256 B2227A530D00BF220071B782 /* SVGPaint.cpp in Sources */, 18225 18257 B25599A60D00D8BA00BB825C /* SVGPaintServer.cpp in Sources */, 18226 B255992F0D00D8BA00BB825C /* SVGPaintServerCg.cpp in Sources */,18227 18258 B25599A80D00D8BA00BB825C /* SVGPaintServerGradient.cpp in Sources */, 18228 18259 B25599AA0D00D8BA00BB825C /* SVGPaintServerLinearGradient.cpp in Sources */, … … 18400 18431 51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */, 18401 18432 E1FF57A60F01256B00891EBB /* ThreadGlobalData.cpp in Sources */, 18433 0B90561E0F257E930095FF6A /* ThreadableLoader.cpp in Sources */, 18402 18434 E44613AF0CD6331000FADA75 /* TimeRanges.cpp in Sources */, 18403 18435 93309EA4099EB78C0056E581 /* Timer.cpp in Sources */, -
trunk/WebCore/WebCoreSources.bkl
r40086 r40124 522 522 html/CanvasGradient.cpp 523 523 html/CanvasPattern.cpp 524 html/CanvasPixelArray.cpp 524 525 html/CanvasRenderingContext2D.cpp 525 526 html/CanvasStyle.cpp … … 635 636 loader/DocLoader.cpp 636 637 loader/DocumentLoader.cpp 638 loader/DocumentThreadableLoader.cpp 637 639 loader/FormState.cpp 638 640 loader/FrameLoader.cpp … … 653 655 loader/TextDocument.cpp 654 656 loader/TextResourceDecoder.cpp 657 loader/ThreadableLoader.cpp 655 658 loader/loader.cpp 656 659 </set> … … 785 788 platform/network/AuthenticationChallengeBase.cpp 786 789 platform/network/Credential.cpp 790 platform/network/HTTPHeaderMap.cpp 787 791 platform/network/HTTPParsers.cpp 788 792 platform/network/FormData.cpp -
trunk/WebCore/bindings/js/JSImageDataCustom.cpp
r40086 r40124 50 50 DEFINE_STATIC_LOCAL(RefPtr<Structure>, cpaStructure, (JSByteArray::createStructure(jsNull()))); 51 51 static const ClassInfo cpaClassInfo = { "CanvasPixelArray", 0, 0, 0 }; 52 wrapper->putDirect(dataName, new (exec) JSByteArray(exec, cpaStructure, imageData->data() , &cpaClassInfo), DontDelete | ReadOnly);52 wrapper->putDirect(dataName, new (exec) JSByteArray(exec, cpaStructure, imageData->data()->data(), &cpaClassInfo), DontDelete | ReadOnly); 53 53 exec->heap()->reportExtraMemoryCost(imageData->data()->length()); 54 54 -
trunk/WebCore/css/CSSComputedStyleDeclaration.cpp
r40086 r40124 37 37 #include "Pair.h" 38 38 #include "Rect.h" 39 #include "Render Object.h"39 #include "RenderBox.h" 40 40 #include "ShadowValue.h" 41 41 #include "WebKitCSSTransformValue.h" … … 396 396 static IntRect sizingBox(RenderObject* renderer) 397 397 { 398 return renderer->style()->boxSizing() == CONTENT_BOX ? renderer->contentBox() : renderer->borderBox(); 398 if (!renderer->isBox()) 399 return IntRect(); 400 401 RenderBox* box = RenderBox::toRenderBox(renderer); 402 return box->style()->boxSizing() == CONTENT_BOX ? box->contentBoxRect() : box->borderBoxRect(); 399 403 } 400 404 -
trunk/WebCore/dom/ContainerNode.cpp
r40086 r40124 35 35 #include "InlineTextBox.h" 36 36 #include "MutationEvent.h" 37 #include "RenderBox.h" 37 38 #include "RenderTheme.h" 38 39 #include "RootInlineBox.h" … … 692 693 point = o->container()->localToAbsolute(); 693 694 if (o->isText() && static_cast<RenderText *>(o)->firstTextBox()) { 694 point.move(static_cast<RenderText *>(o)-> minXPos(),695 point.move(static_cast<RenderText *>(o)->boundingBoxX(), 695 696 static_cast<RenderText *>(o)->firstTextBox()->root()->topOverflow()); 696 } else 697 point.move(o->xPos(), o->yPos()); 697 } else if (o->isBox()) { 698 RenderBox* box = RenderBox::toRenderBox(o); 699 point.move(box->x(), box->y()); 700 } 698 701 return true; 699 702 } … … 718 721 if (!o->isInline() || o->isReplaced()) 719 722 { 723 RenderBox* box = RenderBox::toRenderBox(o); 720 724 point = o->localToAbsolute(); 721 point.move( o->width(),722 o->height() + o->borderTopExtra() + o->borderBottomExtra());725 point.move(box->width(), 726 box->height() + box->borderTopExtra() + box->borderBottomExtra()); 723 727 return true; 724 728 } … … 742 746 if (o->isText() || o->isReplaced()) { 743 747 point = o->container()->localToAbsolute(); 744 i nt xOffset;745 if (o->isText())746 xOffset = static_cast<RenderText *>(o)->minXPos() + o->width();747 else748 xOffset = o->xPos() + o->width();749 750 point.move(xOffset, o->yPos() + o->height());748 if (o->isText()) { 749 RenderText* text = static_cast<RenderText*>(o); 750 point.move(text->boundingBoxX() + text->boundingBoxWidth(), text->boundingBoxHeight()); 751 } else { 752 RenderBox* box = RenderBox::toRenderBox(o); 753 point.move(box->x() + box->width(), box->y() + box->height()); 754 } 751 755 return true; 752 756 } -
trunk/WebCore/dom/Element.cpp
r40086 r40124 275 275 { 276 276 document()->updateLayoutIgnorePendingStylesheets(); 277 if (Render Object* rend = renderer())277 if (RenderBox* rend = renderBox()) 278 278 return adjustForLocalZoom(rend->offsetLeft(), rend); 279 279 return 0; … … 283 283 { 284 284 document()->updateLayoutIgnorePendingStylesheets(); 285 if (Render Object* rend = renderer())285 if (RenderBox* rend = renderBox()) 286 286 return adjustForLocalZoom(rend->offsetTop(), rend); 287 287 return 0; … … 291 291 { 292 292 document()->updateLayoutIgnorePendingStylesheets(); 293 if (Render Object* rend = renderer())293 if (RenderBox* rend = renderBox()) 294 294 return adjustForAbsoluteZoom(rend->offsetWidth(), rend); 295 295 return 0; … … 299 299 { 300 300 document()->updateLayoutIgnorePendingStylesheets(); 301 if (Render Object* rend = renderer())301 if (RenderBox* rend = renderBox()) 302 302 return adjustForAbsoluteZoom(rend->offsetHeight(), rend); 303 303 return 0; … … 307 307 { 308 308 document()->updateLayoutIgnorePendingStylesheets(); 309 if (Render Object* rend = renderer())309 if (RenderBox* rend = renderBox()) 310 310 if (RenderObject* offsetParent = rend->offsetParent()) 311 311 return static_cast<Element*>(offsetParent->element()); … … 317 317 document()->updateLayoutIgnorePendingStylesheets(); 318 318 319 if (Render Object* rend = renderer())319 if (RenderBox* rend = renderBox()) 320 320 return adjustForAbsoluteZoom(rend->clientLeft(), rend); 321 321 return 0; … … 326 326 document()->updateLayoutIgnorePendingStylesheets(); 327 327 328 if (Render Object* rend = renderer())328 if (RenderBox* rend = renderBox()) 329 329 return adjustForAbsoluteZoom(rend->clientTop(), rend); 330 330 return 0; … … 345 345 346 346 347 if (Render Object* rend = renderer())347 if (RenderBox* rend = renderBox()) 348 348 return adjustForAbsoluteZoom(rend->clientWidth(), rend); 349 349 return 0; … … 364 364 } 365 365 366 if (Render Object* rend = renderer())366 if (RenderBox* rend = renderBox()) 367 367 return adjustForAbsoluteZoom(rend->clientHeight(), rend); 368 368 return 0; … … 372 372 { 373 373 document()->updateLayoutIgnorePendingStylesheets(); 374 if (Render Object* rend = renderer())374 if (RenderBox* rend = renderBox()) 375 375 return adjustForAbsoluteZoom(rend->scrollLeft(), rend); 376 376 return 0; … … 380 380 { 381 381 document()->updateLayoutIgnorePendingStylesheets(); 382 if (Render Object* rend = renderer())382 if (RenderBox* rend = renderBox()) 383 383 return adjustForAbsoluteZoom(rend->scrollTop(), rend); 384 384 return 0; … … 388 388 { 389 389 document()->updateLayoutIgnorePendingStylesheets(); 390 if (Render Object* rend = renderer())390 if (RenderBox* rend = renderBox()) 391 391 rend->setScrollLeft(static_cast<int>(newLeft * rend->style()->effectiveZoom())); 392 392 } … … 395 395 { 396 396 document()->updateLayoutIgnorePendingStylesheets(); 397 if (Render Object* rend = renderer())397 if (RenderBox* rend = renderBox()) 398 398 rend->setScrollTop(static_cast<int>(newTop * rend->style()->effectiveZoom())); 399 399 } … … 402 402 { 403 403 document()->updateLayoutIgnorePendingStylesheets(); 404 if (Render Object* rend = renderer())404 if (RenderBox* rend = renderBox()) 405 405 return adjustForAbsoluteZoom(rend->scrollWidth(), rend); 406 406 return 0; … … 410 410 { 411 411 document()->updateLayoutIgnorePendingStylesheets(); 412 if (Render Object* rend = renderer())412 if (RenderBox* rend = renderBox()) 413 413 return adjustForAbsoluteZoom(rend->scrollHeight(), rend); 414 414 return 0; -
trunk/WebCore/dom/Node.cpp
r40086 r40124 577 577 } 578 578 579 RenderBox* Node::renderBox() const 580 { 581 return m_renderer && m_renderer->isBox() ? static_cast<RenderBox*>(m_renderer) : 0; 582 } 583 579 584 IntRect Node::getRect() const 580 585 { 581 586 // FIXME: broken with transforms 582 if (renderer()) { 583 FloatPoint absPos = renderer()->localToAbsolute(); 584 return IntRect(roundedIntPoint(absPos), 585 IntSize(renderer()->width(), renderer()->height() + renderer()->borderTopExtra() + renderer()->borderBottomExtra())); 586 } 587 if (renderer()) 588 return renderer()->absoluteBoundingBoxRect(); 587 589 return IntRect(); 588 590 } -
trunk/WebCore/dom/Node.h
r40086 r40124 53 53 class QualifiedName; 54 54 class RenderArena; 55 class RenderBox; 55 56 class RenderObject; 56 57 class RenderStyle; … … 375 376 void setRenderer(RenderObject* renderer) { m_renderer = renderer; } 376 377 378 // Use with caution. Does no type checking. Mostly a convenience method for shadow nodes of form controls, where we know exactly 379 // what kind of renderer we made. 380 RenderBox* renderBox() const; 381 377 382 void checkSetPrefix(const AtomicString& prefix, ExceptionCode&); 378 383 bool isDescendantOf(const Node*) const; -
trunk/WebCore/dom/Position.cpp
r40086 r40124 285 285 286 286 // There is a VisiblePosition inside an empty inline-block container. 287 return node->renderer()->isReplaced() && canHaveChildrenForEditing(node) && node->renderer()->height() != 0 && !node->firstChild();287 return node->renderer()->isReplaced() && canHaveChildrenForEditing(node) && RenderBox::toRenderBox(node->renderer())->height() != 0 && !node->firstChild(); 288 288 } 289 289 … … 537 537 RenderObject* stop = renderer->nextInPreOrderAfterChildren(); 538 538 for (RenderObject *o = renderer->firstChild(); o && o != stop; o = o->nextInPreOrder()) 539 if (o->element() && o->height()) 540 return true; 541 539 if (o->element()) { 540 if ((o->isText() && static_cast<RenderText*>(o)->boundingBoxHeight()) || 541 (o->isBox() && RenderBox::toRenderBox(o)->height())) 542 return true; 543 } 542 544 return false; 543 545 } … … 570 572 571 573 if (!node()->hasTagName(htmlTag) && renderer->isBlockFlow() && !hasRenderedNonAnonymousDescendantsWithHeight(renderer) && 572 ( renderer->height() || node()->hasTagName(bodyTag)))574 (RenderBox::toRenderBox(renderer)->height() || node()->hasTagName(bodyTag))) 573 575 return offset() == 0 && !nodeIsUserSelectNone(node()); 574 576 -
trunk/WebCore/dom/PositionIterator.cpp
r40086 r40124 28 28 29 29 #include "Node.h" 30 #include "Render Object.h"30 #include "RenderBlock.h" 31 31 #include "htmlediting.h" 32 32 … … 152 152 153 153 if (!m_parent->hasTagName(htmlTag) && renderer->isBlockFlow() && !Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer) && 154 ( renderer->height() || m_parent->hasTagName(bodyTag)))154 (static_cast<RenderBlock*>(renderer)->height() || m_parent->hasTagName(bodyTag))) 155 155 return atStartOfNode() && !Position::nodeIsUserSelectNone(m_parent); 156 156 -
trunk/WebCore/dom/ScriptElement.cpp
r40086 r40124 30 30 #include "Frame.h" 31 31 #include "FrameLoader.h" 32 #include "HTMLNames.h" 33 #include "HTMLScriptElement.h" 32 34 #include "MIMETypeRegistry.h" 33 35 #include "ScriptController.h" … … 37 39 #include "Text.h" 38 40 #include <wtf/StdLibExtras.h> 41 42 #if ENABLE(SVG) 43 #include "SVGNames.h" 44 #include "SVGScriptElement.h" 45 #endif 39 46 40 47 namespace WebCore { … … 270 277 } 271 278 272 } 279 ScriptElement* toScriptElement(Element* element) 280 { 281 if (element->isHTMLElement() && element->hasTagName(HTMLNames::scriptTag)) 282 return static_cast<HTMLScriptElement*>(element); 283 284 #if ENABLE(SVG) 285 if (element->isSVGElement() && element->hasTagName(SVGNames::scriptTag)) 286 return static_cast<SVGScriptElement*>(element); 287 #endif 288 289 return 0; 290 } 291 292 } -
trunk/WebCore/dom/ScriptElement.h
r40086 r40124 94 94 }; 95 95 96 ScriptElement* toScriptElement(Element*); 97 96 98 } 97 99 -
trunk/WebCore/dom/XMLTokenizer.cpp
r40086 r40124 40 40 #include "HTMLLinkElement.h" 41 41 #include "HTMLNames.h" 42 #include "HTMLScriptElement.h"43 42 #include "HTMLStyleElement.h" 44 43 #include "ProcessingInstruction.h" … … 48 47 #include "ResourceResponse.h" 49 48 #include "ScriptController.h" 49 #include "ScriptElement.h" 50 50 #include "ScriptSourceCode.h" 51 51 #include "ScriptValue.h" … … 58 58 #if ENABLE(SVG) 59 59 #include "SVGNames.h" 60 #include "SVGScriptElement.h"61 60 #include "SVGStyleElement.h" 62 61 #endif … … 67 66 68 67 const int maxErrors = 25; 69 70 bool isScriptElement(Element* element)71 {72 return element->hasTagName(HTMLNames::scriptTag)73 #if ENABLE(SVG)74 || element->hasTagName(SVGNames::scriptTag)75 #endif76 ;77 }78 79 ScriptElement* castToScriptElement(Element* element)80 {81 ASSERT(isScriptElement(element));82 83 if (element->hasTagName(HTMLNames::scriptTag))84 return static_cast<HTMLScriptElement*>(element);85 86 #if ENABLE(SVG)87 if (element->hasTagName(SVGNames::scriptTag))88 return static_cast<SVGScriptElement*>(element);89 #endif90 91 ASSERT_NOT_REACHED();92 return 0;93 }94 68 95 69 #if ENABLE(WML) … … 316 290 m_scriptElement = 0; 317 291 318 ScriptElement* scriptElement = castToScriptElement(e.get());292 ScriptElement* scriptElement = toScriptElement(e.get()); 319 293 ASSERT(scriptElement); 320 294 -
trunk/WebCore/dom/XMLTokenizer.h
r40086 r40124 180 180 bool parseXMLDocumentFragment(const String&, DocumentFragment*, Element* parent = 0); 181 181 182 bool isScriptElement(Element*);183 ScriptElement* castToScriptElement(Element*);184 185 182 } // namespace WebCore 186 183 -
trunk/WebCore/dom/XMLTokenizerLibxml2.cpp
r40086 r40124 752 752 newElement->beginParsingChildren(); 753 753 754 if (isScriptElement(newElement.get())) 754 ScriptElement* scriptElement = toScriptElement(newElement.get()); 755 if (scriptElement) 755 756 m_scriptStartLine = lineNumber(); 756 757 … … 780 781 RefPtr<Node> parent = n->parentNode(); 781 782 n->finishParsingChildren(); 782 783 784 if (!n->isElementNode() || !m_view) { 785 setCurrentNode(parent.get()); 786 return; 787 } 788 789 Element* element = static_cast<Element*>(n); 790 ScriptElement* scriptElement = toScriptElement(element); 791 if (!scriptElement) { 792 setCurrentNode(parent.get()); 793 return; 794 } 795 783 796 // don't load external scripts for standalone documents (for now) 784 if (n->isElementNode() && m_view && isScriptElement(static_cast<Element*>(n))) { 785 ASSERT(!m_pendingScript); 786 m_requestingScript = true; 787 788 Element* element = static_cast<Element*>(n); 789 ScriptElement* scriptElement = castToScriptElement(element); 790 791 String scriptHref = scriptElement->sourceAttributeValue(); 792 if (!scriptHref.isEmpty()) { 793 // we have a src attribute 794 String scriptCharset = scriptElement->scriptCharset(); 795 if ((m_pendingScript = m_doc->docLoader()->requestScript(scriptHref, scriptCharset))) { 796 m_scriptElement = element; 797 m_pendingScript->addClient(this); 798 799 // m_pendingScript will be 0 if script was already loaded and ref() executed it 800 if (m_pendingScript) 801 pauseParsing(); 802 } else 803 m_scriptElement = 0; 804 } else 805 m_view->frame()->loader()->executeScript(ScriptSourceCode(scriptElement->scriptContent(), m_doc->url(), m_scriptStartLine)); 806 807 m_requestingScript = false; 808 } 809 797 ASSERT(!m_pendingScript); 798 m_requestingScript = true; 799 800 String scriptHref = scriptElement->sourceAttributeValue(); 801 if (!scriptHref.isEmpty()) { 802 // we have a src attribute 803 String scriptCharset = scriptElement->scriptCharset(); 804 if ((m_pendingScript = m_doc->docLoader()->requestScript(scriptHref, scriptCharset))) { 805 m_scriptElement = element; 806 m_pendingScript->addClient(this); 807 808 // m_pendingScript will be 0 if script was already loaded and ref() executed it 809 if (m_pendingScript) 810 pauseParsing(); 811 } else 812 m_scriptElement = 0; 813 } else 814 m_view->frame()->loader()->executeScript(ScriptSourceCode(scriptElement->scriptContent(), m_doc->url(), m_scriptStartLine)); 815 816 m_requestingScript = false; 810 817 setCurrentNode(parent.get()); 811 818 } -
trunk/WebCore/dom/XMLTokenizerQt.cpp
r40086 r40124 541 541 } 542 542 543 if (isScriptElement(newElement.get())) 543 ScriptElement* scriptElement = toScriptElement(newElement.get()); 544 if (scriptElement) 544 545 m_scriptStartLine = lineNumber(); 545 546 … … 562 563 n->finishParsingChildren(); 563 564 565 if (!n->isElementNode() || !m_view) { 566 setCurrentNode(parent.get()); 567 return; 568 } 569 570 Element* element = static_cast<Element*>(n); 571 ScriptElement* scriptElement = toScriptElement(element); 572 if (!scriptElement) { 573 setCurrentNode(parent.get()); 574 return; 575 } 576 564 577 // don't load external scripts for standalone documents (for now) 565 if (n->isElementNode() && m_view && isScriptElement(static_cast<Element*>(n))) { 566 ASSERT(!m_pendingScript); 567 m_requestingScript = true; 568 569 Element* element = static_cast<Element*>(n); 570 ScriptElement* scriptElement = castToScriptElement(element); 571 572 String scriptHref = scriptElement->sourceAttributeValue(); 573 if (!scriptHref.isEmpty()) { 574 // we have a src attribute 575 String scriptCharset = scriptElement->scriptCharset(); 576 if ((m_pendingScript = m_doc->docLoader()->requestScript(scriptHref, scriptCharset))) { 577 m_scriptElement = element; 578 m_pendingScript->addClient(this); 579 580 // m_pendingScript will be 0 if script was already loaded and ref() executed it 581 if (m_pendingScript) 582 pauseParsing(); 583 } else 584 m_scriptElement = 0; 585 } else 586 m_view->frame()->loader()->executeScript(ScriptSourceCode(scriptElement->scriptContent(), m_doc->url(), m_scriptStartLine)); 587 588 m_requestingScript = false; 589 } 590 578 ASSERT(!m_pendingScript); 579 m_requestingScript = true; 580 581 String scriptHref = scriptElement->sourceAttributeValue(); 582 if (!scriptHref.isEmpty()) { 583 // we have a src attribute 584 String scriptCharset = scriptElement->scriptCharset(); 585 if ((m_pendingScript = m_doc->docLoader()->requestScript(scriptHref, scriptCharset))) { 586 m_scriptElement = element; 587 m_pendingScript->addClient(this); 588 589 // m_pendingScript will be 0 if script was already loaded and ref() executed it 590 if (m_pendingScript) 591 pauseParsing(); 592 } else 593 m_scriptElement = 0; 594 } else 595 m_view->frame()->loader()->executeScript(ScriptSourceCode(scriptElement->scriptContent(), m_doc->url(), m_scriptStartLine)); 596 597 m_requestingScript = false; 591 598 setCurrentNode(parent.get()); 592 599 } -
trunk/WebCore/editing/ApplyStyleCommand.cpp
r40086 r40124 53 53 enum ELegacyHTMLStyles { DoNotUseLegacyHTMLStyles, UseLegacyHTMLStyles }; 54 54 55 explicit StyleChange(CSSStyleDeclaration 56 StyleChange(CSSStyleDeclaration *, const Position&, ELegacyHTMLStyles usesLegacyStyles=UseLegacyHTMLStyles);55 explicit StyleChange(CSSStyleDeclaration*, ELegacyHTMLStyles usesLegacyStyles=UseLegacyHTMLStyles); 56 StyleChange(CSSStyleDeclaration*, const Position&, ELegacyHTMLStyles usesLegacyStyles=UseLegacyHTMLStyles); 57 57 58 58 static ELegacyHTMLStyles styleModeForParseMode(bool); … … 61 61 bool applyBold() const { return m_applyBold; } 62 62 bool applyItalic() const { return m_applyItalic; } 63 bool applySubscript() const { return m_applySubscript; } 64 bool applySuperscript() const { return m_applySuperscript; } 63 65 bool applyFontColor() const { return m_applyFontColor.length() > 0; } 64 66 bool applyFontFace() const { return m_applyFontFace.length() > 0; } … … 72 74 73 75 private: 74 void init(PassRefPtr<CSSStyleDeclaration>, const Position 75 bool checkForLegacyHTMLStyleChange(const CSSProperty 76 static bool currentlyHasStyle(const Position &, const CSSProperty*);76 void init(PassRefPtr<CSSStyleDeclaration>, const Position&); 77 bool checkForLegacyHTMLStyleChange(const CSSProperty*); 78 static bool currentlyHasStyle(const Position&, const CSSProperty*); 77 79 78 80 String m_cssStyle; 79 81 bool m_applyBold; 80 82 bool m_applyItalic; 83 bool m_applySubscript; 84 bool m_applySuperscript; 81 85 String m_applyFontColor; 82 86 String m_applyFontFace; … … 87 91 88 92 89 StyleChange::StyleChange(CSSStyleDeclaration *style, ELegacyHTMLStyles usesLegacyStyles) 90 : m_applyBold(false), m_applyItalic(false), m_usesLegacyStyles(usesLegacyStyles) 93 StyleChange::StyleChange(CSSStyleDeclaration* style, ELegacyHTMLStyles usesLegacyStyles) 94 : m_applyBold(false) 95 , m_applyItalic(false) 96 , m_applySubscript(false) 97 , m_applySuperscript(false) 98 , m_usesLegacyStyles(usesLegacyStyles) 91 99 { 92 100 init(style, Position()); 93 101 } 94 102 95 StyleChange::StyleChange(CSSStyleDeclaration *style, const Position &position, ELegacyHTMLStyles usesLegacyStyles) 96 : m_applyBold(false), m_applyItalic(false), m_usesLegacyStyles(usesLegacyStyles) 103 StyleChange::StyleChange(CSSStyleDeclaration* style, const Position& position, ELegacyHTMLStyles usesLegacyStyles) 104 : m_applyBold(false) 105 , m_applyItalic(false) 106 , m_applySubscript(false) 107 , m_applySuperscript(false) 108 , m_usesLegacyStyles(usesLegacyStyles) 97 109 { 98 110 init(style, position); … … 133 145 if (property->id() == CSSPropertyWebkitTextDecorationsInEffect) { 134 146 // we have to special-case text decorations 147 // FIXME: Why? 135 148 CSSProperty alteredProperty(CSSPropertyTextDecoration, property->value(), property->isImportant()); 136 149 styleText += alteredProperty.cssText(); … … 153 166 } 154 167 155 bool StyleChange::checkForLegacyHTMLStyleChange(const CSSProperty *property) 156 { 157 if (!property || !property->value()) { 168 // This function is the mapping from CSS styles to styling tags (like font-weight: bold to <b>) 169 bool StyleChange::checkForLegacyHTMLStyleChange(const CSSProperty* property) 170 { 171 if (!property || !property->value()) 158 172 return false; 159 }160 173 161 174 String valueText(property->value()->cssText()); … … 164 177 if (equalIgnoringCase(valueText, "bold")) { 165 178 m_applyBold = true; 179 return true; 180 } 181 break; 182 case CSSPropertyVerticalAlign: 183 if (equalIgnoringCase(valueText, "sub")) { 184 m_applySubscript = true; 185 return true; 186 } 187 if (equalIgnoringCase(valueText, "super")) { 188 m_applySuperscript = true; 166 189 return true; 167 190 } … … 266 289 static PassRefPtr<Element> createFontElement(Document* document) 267 290 { 268 ExceptionCode ec = 0; 269 RefPtr<Element> fontNode = document->createElementNS(xhtmlNamespaceURI, "font", ec); 270 ASSERT(ec == 0); 291 RefPtr<Element> fontNode = createHTMLElement(document, fontTag); 271 292 fontNode->setAttribute(classAttr, styleSpanClassString()); 272 293 return fontNode.release(); … … 275 296 PassRefPtr<HTMLElement> createStyleSpanElement(Document* document) 276 297 { 277 RefPtr<HTMLElement> styleElement = new HTMLElement(spanTag, document);298 RefPtr<HTMLElement> styleElement = createHTMLElement(document, spanTag); 278 299 styleElement->setAttribute(classAttr, styleSpanClassString()); 279 300 return styleElement.release(); … … 915 936 } 916 937 917 bool ApplyStyleCommand::isHTMLStyleNode(CSSMutableStyleDeclaration *style, HTMLElement *elem) 938 // This function maps from styling tags to CSS styles. Used for knowing which 939 // styling tags should be removed when toggling styles. 940 bool ApplyStyleCommand::isHTMLStyleNode(CSSMutableStyleDeclaration* style, HTMLElement* elem) 918 941 { 919 942 CSSMutableStyleDeclaration::const_iterator end = style->end(); 920 943 for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it) { 921 944 switch ((*it).id()) { 922 case CSSPropertyFontWeight: 923 if (elem->hasLocalName(bTag)) 924 return true; 925 break; 926 case CSSPropertyFontStyle: 927 if (elem->hasLocalName(iTag)) 928 return true; 945 case CSSPropertyFontWeight: 946 if (elem->hasLocalName(bTag)) 947 return true; 948 break; 949 case CSSPropertyVerticalAlign: 950 if (elem->hasLocalName(subTag) || elem->hasLocalName(supTag)) 951 return true; 952 break; 953 case CSSPropertyFontStyle: 954 if (elem->hasLocalName(iTag)) 955 return true; 929 956 } 930 957 } … … 987 1014 } 988 1015 989 void ApplyStyleCommand::removeCSSStyle(CSSMutableStyleDeclaration *style, HTMLElement *elem)1016 void ApplyStyleCommand::removeCSSStyle(CSSMutableStyleDeclaration* style, HTMLElement* elem) 990 1017 { 991 1018 ASSERT(style); 992 1019 ASSERT(elem); 993 1020 994 CSSMutableStyleDeclaration *decl = elem->inlineStyleDecl();1021 CSSMutableStyleDeclaration* decl = elem->inlineStyleDecl(); 995 1022 if (!decl) 996 1023 return; … … 1006 1033 } 1007 1034 } 1035 1036 // No need to serialize <foo style=""> if we just removed the last css property 1037 if (decl->length() == 0) 1038 removeNodeAttribute(elem, styleAttr); 1008 1039 1009 1040 if (isUnstyledStyleSpan(elem)) … … 1497 1528 if (m_removeOnly) 1498 1529 return; 1499 1530 1500 1531 StyleChange styleChange(style, Position(startNode, 0), StyleChange::styleModeForParseMode(document()->inCompatMode())); 1501 ExceptionCode ec = 0; 1502 1532 1503 1533 // 1504 1534 // Font tags need to go outside of CSS so that CSS font sizes override leagcy font sizes. … … 1506 1536 if (styleChange.applyFontColor() || styleChange.applyFontFace() || styleChange.applyFontSize()) { 1507 1537 RefPtr<Element> fontElement = createFontElement(document()); 1508 ASSERT(ec == 0);1509 1538 RenderStyle* computedStyle = startNode->computedStyle(); 1510 1539 … … 1532 1561 1533 1562 if (styleChange.applyBold()) 1534 surroundNodeRangeWithElement(startNode, endNode, document()->createElementNS(xhtmlNamespaceURI, "b", ec));1563 surroundNodeRangeWithElement(startNode, endNode, createHTMLElement(document(), bTag)); 1535 1564 1536 1565 if (styleChange.applyItalic()) 1537 surroundNodeRangeWithElement(startNode, endNode, document()->createElementNS(xhtmlNamespaceURI, "i", ec)); 1538 1566 surroundNodeRangeWithElement(startNode, endNode, createHTMLElement(document(), iTag)); 1567 1568 if (styleChange.applySubscript()) 1569 surroundNodeRangeWithElement(startNode, endNode, createHTMLElement(document(), subTag)); 1570 else if (styleChange.applySuperscript()) 1571 surroundNodeRangeWithElement(startNode, endNode, createHTMLElement(document(), supTag)); 1572 1539 1573 if (m_styledInlineElement) 1540 1574 surroundNodeRangeWithElement(startNode, endNode, m_styledInlineElement->cloneElement()); -
trunk/WebCore/editing/CompositeEditCommand.cpp
r40086 r40124 52 52 #include "RemoveNodePreservingChildrenCommand.h" 53 53 #include "ReplaceSelectionCommand.h" 54 #include "RenderBlock.h" 54 55 #include "SetNodeAttributeCommand.h" 55 56 #include "SplitElementCommand.h" … … 357 358 void CompositeEditCommand::removeNodeAttribute(PassRefPtr<Element> element, const QualifiedName& attribute) 358 359 { 359 setNodeAttribute(element, attribute, AtomicString()); ;360 setNodeAttribute(element, attribute, AtomicString()); 360 361 } 361 362 … … 591 592 // append the placeholder to make sure it follows 592 593 // any unrendered blocks 593 if (renderer->height() == 0 || (renderer->isListItem() && renderer->isEmpty())) 594 RenderBlock* block = static_cast<RenderBlock*>(renderer); 595 if (block->height() == 0 || (block->isListItem() && block->isEmpty())) 594 596 return appendBlockPlaceholder(container); 595 597 -
trunk/WebCore/editing/DeleteButtonController.cpp
r40086 r40124 43 43 #include "Range.h" 44 44 #include "RemoveNodeCommand.h" 45 #include "Render Object.h"45 #include "RenderBox.h" 46 46 #include "SelectionController.h" 47 47 … … 72 72 73 73 RenderObject* renderer = node->renderer(); 74 if (!renderer || renderer->width() < minimumWidth || renderer->height() < minimumHeight) 74 if (!renderer || !renderer->isBox()) 75 return false; 76 77 RenderBox* box = RenderBox::toRenderBox(renderer); 78 if (box->width() < minimumWidth || box->height() < minimumHeight) 75 79 return false; 76 80 -
trunk/WebCore/editing/DeleteSelectionCommand.cpp
r40086 r40124 39 39 #include "HTMLNames.h" 40 40 #include "markup.h" 41 #include "RenderTableCell.h" 41 42 #include "ReplaceSelectionCommand.h" 42 43 #include "Text.h" … … 358 359 updateLayout(); 359 360 RenderObject *r = node->renderer(); 360 if (r && r->isTableCell() && r->contentHeight() <= 0)361 if (r && r->isTableCell() && static_cast<RenderTableCell*>(r)->contentHeight() <= 0) 361 362 insertBlockPlaceholder(Position(node,0)); 362 363 return; -
trunk/WebCore/editing/Editor.cpp
r40086 r40124 2072 2072 2073 2073 IntRect rectInPageCoords = container->getOverflowClipRect(0, 0); 2074 IntRect rectInFrameCoords = IntRect(renderer->x Pos() * -1, renderer->yPos() * -1,2074 IntRect rectInFrameCoords = IntRect(renderer->x() * -1, renderer->y() * -1, 2075 2075 rectInPageCoords.width(), rectInPageCoords.height()); 2076 2076 … … 2098 2098 2099 2099 IntRect rectInPageCoords = container->getOverflowClipRect(0, 0); 2100 IntRect rectInFrameCoords = IntRect(renderer->x Pos() * -1, renderer->yPos() * -1,2100 IntRect rectInFrameCoords = IntRect(renderer->x() * -1, renderer->y() * -1, 2101 2101 rectInPageCoords.width(), rectInPageCoords.height()); 2102 2102 IntRect resultRect = range->boundingBox(); -
trunk/WebCore/editing/EditorCommand.cpp
r40086 r40124 226 226 return 0; 227 227 RenderObject* renderer = focusedNode->renderer(); 228 if (!renderer )228 if (!renderer || !renderer->isBox()) 229 229 return 0; 230 230 RenderStyle* style = renderer->style(); … … 233 233 if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || renderer->isTextArea())) 234 234 return 0; 235 int height = renderer->clientHeight();235 int height = RenderBox::toRenderBox(renderer)->clientHeight(); 236 236 return max((height + 1) / 2, height - cAmountToKeepWhenPaging); 237 237 } … … 917 917 static bool executeSubscript(Frame* frame, Event*, EditorCommandSource source, const String&) 918 918 { 919 return execute ApplyStyle(frame, source, EditActionSubscript, CSSPropertyVerticalAlign, "sub");919 return executeToggleStyle(frame, source, EditActionSubscript, CSSPropertyVerticalAlign, "baseline", "sub"); 920 920 } 921 921 922 922 static bool executeSuperscript(Frame* frame, Event*, EditorCommandSource source, const String&) 923 923 { 924 return execute ApplyStyle(frame, source, EditActionSuperscript, CSSPropertyVerticalAlign, "super");924 return executeToggleStyle(frame, source, EditActionSuperscript, CSSPropertyVerticalAlign, "baseline", "super"); 925 925 } 926 926 -
trunk/WebCore/editing/htmlediting.cpp
r40086 r40124 786 786 } 787 787 788 PassRefPtr<HTMLElement> createHTMLElement(Document* document, const QualifiedName& name) 789 { 790 return HTMLElementFactory::createHTMLElement(name, document, 0, false); 791 } 792 788 793 PassRefPtr<HTMLElement> createHTMLElement(Document* document, const AtomicString& tagName) 789 794 { 790 return HTMLElementFactory::createHTMLElement(QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), document, 0, false);795 return createHTMLElement(document, QualifiedName(nullAtom, tagName, xhtmlNamespaceURI)); 791 796 } 792 797 -
trunk/WebCore/editing/htmlediting.h
r40086 r40124 83 83 PassRefPtr<HTMLElement> createUnorderedListElement(Document*); 84 84 PassRefPtr<HTMLElement> createListItemElement(Document*); 85 PassRefPtr<HTMLElement> createHTMLElement(Document*, const QualifiedName&); 85 86 PassRefPtr<HTMLElement> createHTMLElement(Document*, const AtomicString&); 86 87 -
trunk/WebCore/html/CanvasRenderingContext2D.cpp
r40086 r40124 1171 1171 static PassRefPtr<ImageData> createEmptyImageData(const IntSize& size) 1172 1172 { 1173 PassRefPtr<ImageData> data = ImageData::create(size.width(), size.height());1174 memset(data->data()->data() , 0, data->data()->length());1175 return data ;1173 RefPtr<ImageData> data = ImageData::create(size.width(), size.height()); 1174 memset(data->data()->data()->data(), 0, data->data()->data()->length()); 1175 return data.get(); 1176 1176 } 1177 1177 -
trunk/WebCore/html/HTMLAnchorElement.cpp
r40086 r40124 108 108 return false; 109 109 110 if (!renderer() )110 if (!renderer() || !renderer()->isBox()) 111 111 return false; 112 112 … … 114 114 // or one of the continuations is non-empty, since this is a faster check and 115 115 // almost always returns true. 116 for (RenderObject* r = renderer(); r; r = r->virtualContinuation()) 116 RenderBox* box = RenderBox::toRenderBox(renderer()); 117 if (box->width() > 0 && box->height() > 0) 118 return true; 119 for (RenderFlow* r = box->virtualContinuation(); r; r = r->continuation()) 117 120 if (r->width() > 0 && r->height() > 0) 118 121 return true; -
trunk/WebCore/html/HTMLCanvasElement.cpp
r40086 r40124 156 156 m_imageBuffer->clearImage(); 157 157 158 if (Render Object* ro = renderer()) {159 FloatRect destRect = ro->contentBox ();158 if (RenderBox* ro = renderBox()) { 159 FloatRect destRect = ro->contentBoxRect(); 160 160 FloatRect r = mapRect(rect, FloatRect(0, 0, m_size.width(), m_size.height()), destRect); 161 161 r.intersect(destRect); -
trunk/WebCore/html/HTMLFormControlElement.cpp
r40086 r40124 200 200 if (disabled() || !renderer() || 201 201 (renderer()->style() && renderer()->style()->visibility() != VISIBLE) || 202 renderer()->width() == 0 || renderer()->height() == 0)202 !renderer()->isBox() || RenderBox::toRenderBox(renderer())->size().isEmpty()) 203 203 return false; 204 204 return true; -
trunk/WebCore/html/HTMLFrameElementBase.cpp
r40086 r40124 312 312 313 313 document()->updateLayoutIgnorePendingStylesheets(); 314 return renderer()->width();314 return RenderBox::toRenderBox(renderer())->width(); 315 315 } 316 316 … … 321 321 322 322 document()->updateLayoutIgnorePendingStylesheets(); 323 return renderer()->height();323 return RenderBox::toRenderBox(renderer())->height(); 324 324 } 325 325 -
trunk/WebCore/html/HTMLImageElement.cpp
r40086 r40124 227 227 document()->updateLayout(); 228 228 229 return render er() ? renderer()->contentWidth() : 0;229 return renderBox() ? renderBox()->contentWidth() : 0; 230 230 } 231 231 … … 251 251 document()->updateLayout(); 252 252 253 return render er() ? renderer()->contentHeight() : 0;253 return renderBox() ? renderBox()->contentHeight() : 0; 254 254 } 255 255 -
trunk/WebCore/html/ImageData.cpp
r40086 r40124 30 30 #include "ImageData.h" 31 31 32 using namespace WTF;33 34 32 namespace WebCore { 35 33 … … 42 40 : m_width(width) 43 41 , m_height(height) 44 , m_data( ByteArray::create(width * height * 4))42 , m_data(CanvasPixelArray::create(width * height * 4)) 45 43 { 46 44 } -
trunk/WebCore/html/ImageData.h
r40086 r40124 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 #define ImageData_h 31 31 32 #include <wtf/ByteArray.h>32 #include "CanvasPixelArray.h" 33 33 #include <wtf/RefCounted.h> 34 34 #include <wtf/RefPtr.h> … … 42 42 unsigned width() const { return m_width; } 43 43 unsigned height() const { return m_height; } 44 WTF::ByteArray* data() const { return m_data.get(); }44 CanvasPixelArray* data() const { return m_data.get(); } 45 45 46 46 private: … … 48 48 unsigned m_width; 49 49 unsigned m_height; 50 RefPtr< WTF::ByteArray> m_data;50 RefPtr<CanvasPixelArray> m_data; 51 51 }; 52 52 -
trunk/WebCore/html/ImageData.idl
r40086 r40124 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 35 35 readonly attribute long width; 36 36 readonly attribute long height; 37 #if !defined(LANGUAGE_JAVASCRIPT) || defined(V8_BINDING) 38 readonly attribute CanvasPixelArray data; 39 #endif 37 40 }; 38 41 -
trunk/WebCore/inspector/InspectorController.cpp
r40086 r40124 2761 2761 return; 2762 2762 2763 Render Object* renderer = m_highlightedNode->renderer();2763 RenderBox* renderer = m_highlightedNode->renderBox(); 2764 2764 Frame* containingFrame = m_highlightedNode->document()->frame(); 2765 2765 if (!renderer || !containingFrame) 2766 2766 return; 2767 2767 2768 IntRect contentBox = renderer->contentBox ();2768 IntRect contentBox = renderer->contentBoxRect(); 2769 2769 2770 2770 // FIXME: Should we add methods to RenderObject to obtain these rects? -
trunk/WebCore/loader/SubresourceLoaderClient.h
r40086 r40124 47 47 48 48 virtual void didReceiveResponse(SubresourceLoader*, const ResourceResponse&) { } 49 virtual void didReceiveData(SubresourceLoader*, const char*, int ) { }49 virtual void didReceiveData(SubresourceLoader*, const char*, int /*lengthReceived*/) { } 50 50 virtual void didFinishLoading(SubresourceLoader*) { } 51 51 virtual void didFail(SubresourceLoader*, const ResourceError&) { } -
trunk/WebCore/page/AccessibilityObject.cpp
r40086 r40124 1029 1029 } 1030 1030 1031 void AccessibilityObject::updateBackingStore() 1032 { 1033 } 1034 1031 1035 } // namespace WebCore -
trunk/WebCore/page/AccessibilityObject.h
r40086 r40124 401 401 #endif 402 402 403 // allows for an AccessibilityObject to update its render tree or perform 404 // other operations update type operations 405 virtual void updateBackingStore(); 406 403 407 protected: 404 408 unsigned m_id; -
trunk/WebCore/page/AccessibilityRenderObject.cpp
r40086 r40124 1178 1178 1179 1179 // check for one-dimensional image 1180 if (m_renderer->height() <= 1 || m_renderer->width() <= 1) 1180 RenderImage* image = static_cast<RenderImage*>(m_renderer); 1181 if (image->height() <= 1 || image->width() <= 1) 1181 1182 return true; 1182 1183 1183 1184 // check whether rendered image was stretched from one-dimensional file image 1184 1185 if (isNativeImage()) { 1185 RenderImage* image = static_cast<RenderImage*>(m_renderer);1186 1186 if (image->cachedImage()) { 1187 1187 IntSize imageSize = image->cachedImage()->imageSize(image->view()->zoomFactor()); … … 2216 2216 void AccessibilityRenderObject::childrenChanged() 2217 2217 { 2218 clearChildren(); 2219 2220 if (accessibilityIsIgnored()) { 2221 AccessibilityObject* parent = parentObject(); 2222 if (parent) 2223 parent->childrenChanged(); 2218 // this method is meant as a quick way of marking dirty 2219 // a portion of the accessibility tree 2220 2221 markChildrenDirty(); 2222 2223 // this object may not be accessible (and thus may not appear 2224 // in the hierarchy), which means we need to go up the parent 2225 // chain and mark the parent's dirty. Ideally, we would want 2226 // to only access the next object that is not ignored, but 2227 // asking an element if it's ignored can lead to an examination of the 2228 // render tree which is dangerous. 2229 for (AccessibilityObject* parent = parentObject(); parent; parent = parent->parentObject()) { 2230 if (parent->isAccessibilityRenderObject()) 2231 static_cast<AccessibilityRenderObject *>(parent)->markChildrenDirty(); 2224 2232 } 2225 2233 } … … 2245 2253 const AccessibilityObject::AccessibilityChildrenVector& AccessibilityRenderObject::children() 2246 2254 { 2255 if (m_childrenDirty) { 2256 clearChildren(); 2257 m_childrenDirty = false; 2258 } 2259 2247 2260 if (!m_haveChildren) 2248 2261 addChildren(); … … 2405 2418 } 2406 2419 2420 void AccessibilityRenderObject::updateBackingStore() 2421 { 2422 if (!m_renderer) 2423 return; 2424 m_renderer->view()->layoutIfNeeded(); 2425 } 2407 2426 2408 2427 } // namespace WebCore -
trunk/WebCore/page/AccessibilityRenderObject.h
r40086 r40124 210 210 virtual IntRect doAXBoundsForRange(const PlainTextRange&) const; 211 211 212 virtual void updateBackingStore(); 213 212 214 protected: 213 215 RenderObject* m_renderer; 214 216 AccessibilityRole m_ariaRole; 217 mutable bool m_childrenDirty; 215 218 216 219 void setRenderObject(RenderObject* renderer) { m_renderer = renderer; } … … 232 235 AccessibilityObject* accessibilityParentForImageMap(HTMLMapElement* map) const; 233 236 237 void markChildrenDirty() const { m_childrenDirty = true; } 234 238 }; 235 239 -
trunk/WebCore/page/AccessibilityTable.cpp
r40086 r40124 54 54 m_headerContainer(0) 55 55 { 56 // FIXME: We need to disable Accessibility Tables entirely on the Mac until <rdar://problem/6372481> is resolved. 57 #if PLATFORM(MAC) 56 #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) 58 57 m_isAccessibilityTable = false; 59 #else 58 #else 60 59 m_isAccessibilityTable = isTableExposableThroughAccessibility(); 61 60 #endif 62 63 61 } 64 62 -
trunk/WebCore/page/EventHandler.cpp
r40086 r40124 1 1 /* 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 4 * … … 1580 1580 if (!docRenderer) 1581 1581 return false; 1582 1583 RefPtr<FrameView> protector(m_frame->view()); 1582 1584 1583 1585 IntPoint vPoint = m_frame->view()->windowToContents(e.pos()); -
trunk/WebCore/page/FrameView.cpp
r40086 r40124 289 289 Element* body = doc->body(); 290 290 if (body && body->renderer() && body->renderer()->style()->hasPseudoStyle(RenderStyle::SCROLLBAR)) 291 return RenderScrollbar::createCustomScrollbar(this, orientation, body->render er());291 return RenderScrollbar::createCustomScrollbar(this, orientation, body->renderBox()); 292 292 293 293 // If the <body> didn't have a custom style, then the root element might. 294 294 Element* docElement = doc->documentElement(); 295 295 if (docElement && docElement->renderer() && docElement->renderer()->style()->hasPseudoStyle(RenderStyle::SCROLLBAR)) 296 return RenderScrollbar::createCustomScrollbar(this, orientation, docElement->render er());296 return RenderScrollbar::createCustomScrollbar(this, orientation, docElement->renderBox()); 297 297 298 298 // If we have an owning iframe/frame element, then it can set the custom scrollbar also. … … 461 461 } else if (body->hasTagName(bodyTag)) { 462 462 if (!m_firstLayout && m_size.height() != layoutHeight() 463 && static_cast<RenderBox*>(body->renderer())->stretchesToViewHeight())463 && RenderBox::toRenderBox(body->renderer())->stretchesToViewHeight()) 464 464 body->renderer()->setChildNeedsLayout(true); 465 465 // It's sufficient to just check the X overflow, … … 1096 1096 return; 1097 1097 Vector<DashboardRegionValue> newRegions; 1098 document->render er()->collectDashboardRegions(newRegions);1098 document->renderBox()->collectDashboardRegions(newRegions); 1099 1099 if (newRegions == document->dashboardRegions()) 1100 1100 return; -
trunk/WebCore/page/animation/AnimationBase.cpp
r40086 r40124 81 81 82 82 static inline Color blendFunc(const AnimationBase* anim, const Color& from, const Color& to, double progress) 83 { 83 { 84 // We need to preserve the state of the valid flag at the end of the animation 85 if (progress == 1 && !to.isValid()) 86 return Color(); 87 84 88 return Color(blendFunc(anim, from.red(), to.red(), progress), 85 89 blendFunc(anim, from.green(), to.green(), progress), … … 131 135 } else { 132 136 // Convert the TransformOperations into matrices 133 IntSize size = anim->renderer()-> borderBox().size();137 IntSize size = anim->renderer()->isBox() ? RenderBox::toRenderBox(anim->renderer())->borderBoxRect().size() : IntSize(); 134 138 TransformationMatrix fromT; 135 139 TransformationMatrix toT; -
trunk/WebCore/page/animation/AnimationController.cpp
r40086 r40124 159 159 for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) { 160 160 RefPtr<CompositeAnimation> compAnim = it->second; 161 if (!compAnim->isSuspended() ) {161 if (!compAnim->isSuspended() && compAnim->hasAnimations()) { 162 162 double t = compAnim->willNeedService(); 163 163 if (t != -1 && (t < needsService || needsService == -1)) -
trunk/WebCore/page/animation/CompositeAnimation.cpp
r40086 r40124 74 74 void resumeOverriddenImplicitAnimations(int property); 75 75 76 bool hasAnimations() const { return !m_transitions.isEmpty() || !m_keyframeAnimations.isEmpty(); } 77 76 78 void styleAvailable(); 77 79 … … 110 112 void CompositeAnimationPrivate::clearRenderer() 111 113 { 112 // Clear the renderers from all running animations, in case we are in the middle of 113 // an animation callback (see https://bugs.webkit.org/show_bug.cgi?id=22052) 114 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 115 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 116 ImplicitAnimation* transition = it->second.get(); 117 transition->clearRenderer(); 118 } 119 120 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 121 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 122 KeyframeAnimation* anim = it->second.get(); 123 anim->clearRenderer(); 124 } 125 126 114 if (!m_transitions.isEmpty()) { 115 // Clear the renderers from all running animations, in case we are in the middle of 116 // an animation callback (see https://bugs.webkit.org/show_bug.cgi?id=22052) 117 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 118 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 119 ImplicitAnimation* transition = it->second.get(); 120 transition->clearRenderer(); 121 } 122 } 123 if (!m_keyframeAnimations.isEmpty()) { 124 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 125 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 126 KeyframeAnimation* anim = it->second.get(); 127 anim->clearRenderer(); 128 } 129 } 127 130 } 128 131 … … 267 270 // Now that we have transition objects ready, let them know about the new goal state. We want them 268 271 // to fill in a RenderStyle*& only if needed. 269 CSSPropertyTransitionsMap::const_iterator end = m_transitions.end(); 270 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) { 271 if (ImplicitAnimation* anim = it->second.get()) 272 anim->animate(m_compositeAnimation, renderer, currentStyle, targetStyle, resultStyle); 272 if (!m_transitions.isEmpty()) { 273 CSSPropertyTransitionsMap::const_iterator end = m_transitions.end(); 274 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) { 275 if (ImplicitAnimation* anim = it->second.get()) 276 anim->animate(m_compositeAnimation, renderer, currentStyle, targetStyle, resultStyle); 277 } 273 278 } 274 279 } … … 297 302 void CompositeAnimationPrivate::setAnimating(bool animating) 298 303 { 299 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 300 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 301 ImplicitAnimation* transition = it->second.get(); 302 transition->setAnimating(animating); 303 } 304 305 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 306 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 307 KeyframeAnimation* anim = it->second.get(); 308 anim->setAnimating(animating); 304 if (!m_transitions.isEmpty()) { 305 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 306 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 307 ImplicitAnimation* transition = it->second.get(); 308 transition->setAnimating(animating); 309 } 310 } 311 if (!m_keyframeAnimations.isEmpty()) { 312 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 313 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 314 KeyframeAnimation* anim = it->second.get(); 315 anim->setAnimating(animating); 316 } 309 317 } 310 318 } … … 316 324 double minT = -1; 317 325 318 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 319 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 320 ImplicitAnimation* transition = it->second.get(); 321 double t = transition ? transition->willNeedService() : -1; 322 if (t < minT || minT == -1) 323 minT = t; 324 if (minT == 0) 325 return 0; 326 } 327 328 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 329 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 330 KeyframeAnimation* animation = it->second.get(); 331 double t = animation ? animation->willNeedService() : -1; 332 if (t < minT || minT == -1) 333 minT = t; 334 if (minT == 0) 335 return 0; 326 if (!m_transitions.isEmpty()) { 327 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 328 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 329 ImplicitAnimation* transition = it->second.get(); 330 double t = transition ? transition->willNeedService() : -1; 331 if (t < minT || minT == -1) 332 minT = t; 333 if (minT == 0) 334 return 0; 335 } 336 } 337 if (!m_keyframeAnimations.isEmpty()) { 338 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 339 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 340 KeyframeAnimation* animation = it->second.get(); 341 double t = animation ? animation->willNeedService() : -1; 342 if (t < minT || minT == -1) 343 minT = t; 344 if (minT == 0) 345 return 0; 346 } 336 347 } 337 348 … … 345 356 // We want to send back the last animation with the property if there are multiples. 346 357 // So we need to iterate through all animations 347 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 348 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 349 RefPtr<KeyframeAnimation> anim = it->second; 350 if (anim->hasAnimationForProperty(property)) 351 retval = anim; 358 if (!m_keyframeAnimations.isEmpty()) { 359 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 360 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 361 RefPtr<KeyframeAnimation> anim = it->second; 362 if (anim->hasAnimationForProperty(property)) 363 retval = anim; 364 } 352 365 } 353 366 … … 362 375 // Make a list of transitions to be deleted 363 376 Vector<int> finishedTransitions; 364 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 365 366 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 367 ImplicitAnimation* anim = it->second.get(); 368 if (!anim) 369 continue; 370 if (anim->postActive()) 371 finishedTransitions.append(anim->animatingProperty()); 372 } 373 374 // Delete them 375 size_t finishedTransitionCount = finishedTransitions.size(); 376 for (size_t i = 0; i < finishedTransitionCount; ++i) 377 m_transitions.remove(finishedTransitions[i]); 377 if (!m_transitions.isEmpty()) { 378 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 379 380 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 381 ImplicitAnimation* anim = it->second.get(); 382 if (!anim) 383 continue; 384 if (anim->postActive()) 385 finishedTransitions.append(anim->animatingProperty()); 386 } 387 388 // Delete them 389 size_t finishedTransitionCount = finishedTransitions.size(); 390 for (size_t i = 0; i < finishedTransitionCount; ++i) 391 m_transitions.remove(finishedTransitions[i]); 392 } 378 393 379 394 // Make a list of animations to be deleted 380 395 Vector<AtomicStringImpl*> finishedAnimations; 381 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 382 383 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 384 KeyframeAnimation* anim = it->second.get(); 385 if (!anim) 386 continue; 387 if (anim->postActive()) 388 finishedAnimations.append(anim->name().impl()); 389 } 390 391 // Delete them 392 size_t finishedAnimationCount = finishedAnimations.size(); 393 for (size_t i = 0; i < finishedAnimationCount; ++i) 394 m_keyframeAnimations.remove(finishedAnimations[i]); 396 if (!m_keyframeAnimations.isEmpty()) { 397 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 398 399 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 400 KeyframeAnimation* anim = it->second.get(); 401 if (!anim) 402 continue; 403 if (anim->postActive()) 404 finishedAnimations.append(anim->name().impl()); 405 } 406 407 // Delete them 408 size_t finishedAnimationCount = finishedAnimations.size(); 409 for (size_t i = 0; i < finishedAnimationCount; ++i) 410 m_keyframeAnimations.remove(finishedAnimations[i]); 411 } 395 412 } 396 413 … … 398 415 { 399 416 // Set start time on all animations waiting for it 400 AnimationNameMap::const_iterator end = m_keyframeAnimations.end(); 401 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != end; ++it) { 402 KeyframeAnimation* anim = it->second.get(); 403 if (anim && anim->waitingForStartTime()) 404 anim->updateStateMachine(AnimationBase::AnimationStateInputStartTimeSet, t); 417 if (!m_keyframeAnimations.isEmpty()) { 418 AnimationNameMap::const_iterator end = m_keyframeAnimations.end(); 419 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != end; ++it) { 420 KeyframeAnimation* anim = it->second.get(); 421 if (anim && anim->waitingForStartTime()) 422 anim->updateStateMachine(AnimationBase::AnimationStateInputStartTimeSet, t); 423 } 405 424 } 406 425 } … … 409 428 { 410 429 // Set the start time for given property transition 411 CSSPropertyTransitionsMap::const_iterator end = m_transitions.end(); 412 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) { 413 ImplicitAnimation* anim = it->second.get(); 414 if (anim && anim->waitingForStartTime() && anim->animatingProperty() == property) 415 anim->updateStateMachine(AnimationBase::AnimationStateInputStartTimeSet, t); 430 if (!m_transitions.isEmpty()) { 431 CSSPropertyTransitionsMap::const_iterator end = m_transitions.end(); 432 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) { 433 ImplicitAnimation* anim = it->second.get(); 434 if (anim && anim->waitingForStartTime() && anim->animatingProperty() == property) 435 anim->updateStateMachine(AnimationBase::AnimationStateInputStartTimeSet, t); 436 } 416 437 } 417 438 } … … 424 445 m_isSuspended = true; 425 446 426 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 427 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 428 if (KeyframeAnimation* anim = it->second.get()) 429 anim->updatePlayState(false); 430 } 431 432 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 433 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 434 ImplicitAnimation* anim = it->second.get(); 435 if (anim && anim->hasStyle()) 436 anim->updatePlayState(false); 447 if (!m_keyframeAnimations.isEmpty()) { 448 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 449 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 450 if (KeyframeAnimation* anim = it->second.get()) 451 anim->updatePlayState(false); 452 } 453 } 454 if (!m_transitions.isEmpty()) { 455 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 456 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 457 ImplicitAnimation* anim = it->second.get(); 458 if (anim && anim->hasStyle()) 459 anim->updatePlayState(false); 460 } 437 461 } 438 462 } … … 445 469 m_isSuspended = false; 446 470 447 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 448 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 449 KeyframeAnimation* anim = it->second.get(); 450 if (anim && anim->playStatePlaying()) 451 anim->updatePlayState(true); 452 } 453 454 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 455 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 456 ImplicitAnimation* anim = it->second.get(); 457 if (anim && anim->hasStyle()) 458 anim->updatePlayState(true); 471 if (!m_keyframeAnimations.isEmpty()) { 472 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 473 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 474 KeyframeAnimation* anim = it->second.get(); 475 if (anim && anim->playStatePlaying()) 476 anim->updatePlayState(true); 477 } 478 } 479 480 if (!m_transitions.isEmpty()) { 481 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 482 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 483 ImplicitAnimation* anim = it->second.get(); 484 if (anim && anim->hasStyle()) 485 anim->updatePlayState(true); 486 } 459 487 } 460 488 } … … 463 491 { 464 492 CSSPropertyTransitionsMap::const_iterator end = m_transitions.end(); 465 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) { 466 ImplicitAnimation* anim = it->second.get(); 467 if (anim && anim->animatingProperty() == property) 468 anim->setOverridden(true); 493 if (!m_transitions.isEmpty()) { 494 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) { 495 ImplicitAnimation* anim = it->second.get(); 496 if (anim && anim->animatingProperty() == property) 497 anim->setOverridden(true); 498 } 469 499 } 470 500 } … … 472 502 void CompositeAnimationPrivate::resumeOverriddenImplicitAnimations(int property) 473 503 { 474 CSSPropertyTransitionsMap::const_iterator end = m_transitions.end(); 475 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) { 476 ImplicitAnimation* anim = it->second.get(); 477 if (anim && anim->animatingProperty() == property) 478 anim->setOverridden(false); 504 if (!m_transitions.isEmpty()) { 505 CSSPropertyTransitionsMap::const_iterator end = m_transitions.end(); 506 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) { 507 ImplicitAnimation* anim = it->second.get(); 508 if (anim && anim->animatingProperty() == property) 509 anim->setOverridden(false); 510 } 479 511 } 480 512 } … … 504 536 } 505 537 506 CSSPropertyTransitionsMap::const_iterator end = m_transitions.end(); 507 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) { 508 ImplicitAnimation* anim = it->second.get(); 509 if (anim && anim->waitingForStyleAvailable()) 510 anim->updateStateMachine(AnimationBase::AnimationStateInputStyleAvailable, -1); 538 if (!m_transitions.isEmpty()) { 539 CSSPropertyTransitionsMap::const_iterator end = m_transitions.end(); 540 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) { 541 ImplicitAnimation* anim = it->second.get(); 542 if (anim && anim->waitingForStyleAvailable()) 543 anim->updateStateMachine(AnimationBase::AnimationStateInputStyleAvailable, -1); 544 } 511 545 } 512 546 } … … 514 548 bool CompositeAnimationPrivate::isAnimatingProperty(int property, bool isRunningNow) const 515 549 { 516 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 517 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 518 KeyframeAnimation* anim = it->second.get(); 519 if (anim && anim->isAnimatingProperty(property, isRunningNow)) 520 return true; 521 } 522 523 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 524 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 525 ImplicitAnimation* anim = it->second.get(); 526 if (anim && anim->isAnimatingProperty(property, isRunningNow)) 527 return true; 550 if (!m_keyframeAnimations.isEmpty()) { 551 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 552 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 553 KeyframeAnimation* anim = it->second.get(); 554 if (anim && anim->isAnimatingProperty(property, isRunningNow)) 555 return true; 556 } 557 } 558 559 if (!m_transitions.isEmpty()) { 560 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 561 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 562 ImplicitAnimation* anim = it->second.get(); 563 if (anim && anim->isAnimatingProperty(property, isRunningNow)) 564 return true; 565 } 528 566 } 529 567 return false; … … 578 616 unsigned count = 0; 579 617 580 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 581 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 582 KeyframeAnimation* anim = it->second.get(); 583 if (anim->running()) 584 ++count; 585 } 586 587 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 588 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 589 ImplicitAnimation* anim = it->second.get(); 590 if (anim->running()) 591 ++count; 618 if (!m_keyframeAnimations.isEmpty()) { 619 AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); 620 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 621 KeyframeAnimation* anim = it->second.get(); 622 if (anim->running()) 623 ++count; 624 } 625 } 626 627 if (!m_transitions.isEmpty()) { 628 CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); 629 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 630 ImplicitAnimation* anim = it->second.get(); 631 if (anim->running()) 632 ++count; 633 } 592 634 } 593 635 … … 650 692 } 651 693 694 bool CompositeAnimation::hasAnimations() const 695 { 696 return m_data->hasAnimations(); 697 } 698 652 699 void CompositeAnimation::styleAvailable() 653 700 { -
trunk/WebCore/page/animation/CompositeAnimation.h
r40086 r40124 67 67 void resumeAnimations(); 68 68 bool isSuspended() const; 69 70 bool hasAnimations() const; 69 71 70 72 void styleAvailable(); -
trunk/WebCore/page/mac/AccessibilityObjectWrapper.mm
r40086 r40124 581 581 - (NSArray*)accessibilityActionNames 582 582 { 583 m_object->updateBackingStore(); 584 583 585 static NSArray* actionElementActions = [[NSArray alloc] initWithObjects: NSAccessibilityPressAction, NSAccessibilityShowMenuAction, nil]; 584 586 static NSArray* defaultElementActions = [[NSArray alloc] initWithObjects: NSAccessibilityShowMenuAction, nil]; … … 600 602 - (NSArray*)accessibilityAttributeNames 601 603 { 604 m_object->updateBackingStore(); 605 602 606 if (m_object->isAttachment()) 603 607 return [[self attachmentView] accessibilityAttributeNames]; … … 1125 1129 return nil; 1126 1130 1131 m_object->updateBackingStore(); 1132 1127 1133 if ([attributeName isEqualToString: NSAccessibilityRoleAttribute]) 1128 1134 return [self role]; … … 1431 1437 - (id)accessibilityFocusedUIElement 1432 1438 { 1439 m_object->updateBackingStore(); 1440 1433 1441 RefPtr<AccessibilityObject> focusedObj = m_object->focusedUIElement(); 1434 1442 … … 1441 1449 - (id)accessibilityHitTest:(NSPoint)point 1442 1450 { 1451 m_object->updateBackingStore(); 1452 1443 1453 RefPtr<AccessibilityObject> axObject = m_object->doAccessibilityHitTest(IntPoint(point)); 1444 1454 if (axObject) … … 1449 1459 - (BOOL)accessibilityIsAttributeSettable:(NSString*)attributeName 1450 1460 { 1461 m_object->updateBackingStore(); 1462 1451 1463 if ([attributeName isEqualToString: @"AXSelectedTextMarkerRange"]) 1452 1464 return YES; … … 1483 1495 - (BOOL)accessibilityIsIgnored 1484 1496 { 1497 m_object->updateBackingStore(); 1498 1485 1499 if (m_object->isAttachment()) 1486 1500 return [[self attachmentView] accessibilityIsIgnored]; … … 1490 1504 - (NSArray* )accessibilityParameterizedAttributeNames 1491 1505 { 1506 m_object->updateBackingStore(); 1507 1492 1508 if (m_object->isAttachment()) 1493 1509 return nil; … … 1570 1586 - (void)accessibilityPerformPressAction 1571 1587 { 1588 m_object->updateBackingStore(); 1589 1572 1590 if (m_object->isAttachment()) 1573 1591 [[self attachmentView] accessibilityPerformAction:NSAccessibilityPressAction]; … … 1614 1632 - (void)accessibilityPerformAction:(NSString*)action 1615 1633 { 1634 m_object->updateBackingStore(); 1635 1616 1636 if ([action isEqualToString:NSAccessibilityPressAction]) 1617 1637 [self accessibilityPerformPressAction]; … … 1623 1643 - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attributeName 1624 1644 { 1645 m_object->updateBackingStore(); 1646 1625 1647 WebCoreTextMarkerRange* textMarkerRange = nil; 1626 1648 NSNumber* number = nil; … … 1745 1767 return nil; 1746 1768 1769 m_object->updateBackingStore(); 1770 1747 1771 // common parameter type check/casting. Nil checks in handlers catch wrong type case. 1748 1772 // NOTE: This assumes nil is not a valid parameter, because it is indistinguishable from … … 1990 2014 - (NSUInteger)accessibilityIndexOfChild:(id)child 1991 2015 { 2016 m_object->updateBackingStore(); 2017 1992 2018 const AccessibilityObject::AccessibilityChildrenVector& children = m_object->children(); 1993 2019 … … 2006 2032 - (NSUInteger)accessibilityArrayAttributeCount:(NSString *)attribute 2007 2033 { 2034 m_object->updateBackingStore(); 2035 2008 2036 if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) { 2009 2037 const AccessibilityObject::AccessibilityChildrenVector& children = m_object->children(); … … 2019 2047 - (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount 2020 2048 { 2049 m_object->updateBackingStore(); 2050 2021 2051 if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) { 2022 2052 if (m_object->children().isEmpty()) { -
trunk/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
r40086 r40124 95 95 PassRefPtr<ImageData> result = ImageData::create(rect.width(), rect.height()); 96 96 unsigned char* dataSrc = cairo_image_surface_get_data(m_data.m_surface); 97 unsigned char* dataDst = result->data()->data() ;97 unsigned char* dataDst = result->data()->data()->data(); 98 98 99 99 if (rect.x() < 0 || rect.y() < 0 || (rect.x() + rect.width()) > m_size.width() || (rect.y() + rect.height()) > m_size.height()) … … 180 180 int stride = cairo_image_surface_get_stride(m_data.m_surface); 181 181 182 unsigned char* srcRows = source->data()->data() + originy * srcBytesPerRow + originx * 4;182 unsigned char* srcRows = source->data()->data()->data() + originy * srcBytesPerRow + originx * 4; 183 183 for (int y = 0; y < numRows; ++y) { 184 184 unsigned char *row = dataDst + stride * (y + desty); -
trunk/WebCore/platform/graphics/cg/ImageBufferCG.cpp
r40086 r40124 108 108 { 109 109 PassRefPtr<ImageData> result = ImageData::create(rect.width(), rect.height()); 110 unsigned char* data = result->data()->data() ;110 unsigned char* data = result->data()->data()->data(); 111 111 112 112 if (rect.x() < 0 || rect.y() < 0 || (rect.x() + rect.width()) > m_size.width() || (rect.y() + rect.height()) > m_size.height()) … … 189 189 unsigned destBytesPerRow = 4 * m_size.width(); 190 190 191 unsigned char* srcRows = source->data()->data() + originy * srcBytesPerRow + originx * 4;191 unsigned char* srcRows = source->data()->data()->data() + originy * srcBytesPerRow + originx * 4; 192 192 unsigned char* destRows = reinterpret_cast<unsigned char*>(m_data.m_data) + desty * destBytesPerRow + destx * 4; 193 193 for (int y = 0; y < numRows; ++y) { -
trunk/WebCore/platform/gtk/RenderThemeGtk.cpp
r40086 r40124 83 83 int RenderThemeGtk::baselinePosition(const RenderObject* o) const 84 84 { 85 if (!o->isBox()) 86 return 0; 87 85 88 // FIXME: This strategy is possibly incorrect for the GTK+ port. 86 89 if (o->style()->appearance() == CheckboxPart || 87 90 o->style()->appearance() == RadioPart) 88 return o->marginTop() + o->height() - 2;91 return o->marginTop() + RenderBox::toRenderBox(o)->height() - 2; 89 92 return RenderTheme::baselinePosition(o); 90 93 } -
trunk/WebCore/platform/network/HTTPHeaderMap.h
r40086 r40124 30 30 #include "AtomicStringHash.h" 31 31 #include "StringHash.h" 32 #include <memory> 33 #include <utility> 32 34 #include <wtf/HashMap.h> 35 #include <wtf/Vector.h> 33 36 34 37 namespace WebCore { 35 38 36 typedef HashMap<AtomicString, String, CaseFoldingHash> HTTPHeaderMap; 39 typedef Vector<std::pair<String, String> > HTTPHeaderMapData; 40 41 class HTTPHeaderMap : public HashMap<AtomicString, String, CaseFoldingHash> { 42 public: 43 // Gets a copy of the data suitable for passing to another thread. 44 std::auto_ptr<HTTPHeaderMapData> copyData() const; 45 46 void adopt(std::auto_ptr<HTTPHeaderMapData>); 47 }; 37 48 38 49 } // namespace WebCore -
trunk/WebCore/platform/qt/RenderThemeQt.cpp
r40086 r40124 155 155 int RenderThemeQt::baselinePosition(const RenderObject* o) const 156 156 { 157 if (!o->isBox()) 158 return 0; 159 157 160 if (o->style()->appearance() == CheckboxPart || 158 161 o->style()->appearance() == RadioPart) 159 return o->marginTop() + o->height() - 2; // Same as in old khtml162 return o->marginTop() + RenderBox::toRenderBox(o)->height() - 2; // Same as in old khtml 160 163 return RenderTheme::baselinePosition(o); 161 164 } -
trunk/WebCore/rendering/HitTestResult.cpp
r40086 r40124 225 225 if (!image()) 226 226 return IntRect(); 227 return m_innerNonSharedNode->render er()->absoluteContentBox();227 return m_innerNonSharedNode->renderBox()->absoluteContentBox(); 228 228 } 229 229 -
trunk/WebCore/rendering/InlineBox.cpp
r40086 r40124 24 24 #include "InlineFlowBox.h" 25 25 #include "RenderArena.h" 26 #include "RenderBox.h" 26 27 #include "RootInlineBox.h" 27 28 … … 84 85 } 85 86 #endif 87 88 RenderBox* InlineBox::renderBox() const 89 { 90 ASSERT(m_object->isBox()); 91 return RenderBox::toRenderBox(m_object); 92 } 86 93 87 94 int InlineBox::caretMinOffset() const … … 130 137 m_x += dx; 131 138 m_y += dy; 132 if (m_object->isReplaced() || m_object->isBR()) 133 m_object->setPos(m_object->xPos() + dx, m_object->yPos() + dy); 139 if (m_object->isReplaced()) { 140 RenderBox* box = RenderBox::toRenderBox(m_object); 141 box->move(dx, dy); 142 } 134 143 } 135 144 -
trunk/WebCore/rendering/InlineBox.h
r40086 r40124 28 28 29 29 class HitTestResult; 30 class RenderBox; 30 31 class RootInlineBox; 31 32 … … 240 241 bool visibleToHitTesting() const { return object()->style()->visibility() == VISIBLE && object()->style()->pointerEvents() != PE_NONE; } 241 242 243 // Use with caution! The type is not checked! 244 RenderBox* renderBox() const; 245 242 246 public: 243 247 RenderObject* m_object; -
trunk/WebCore/rendering/InlineFlowBox.cpp
r40086 r40124 326 326 // not the left border box. We have to subtract |x| from the width of the block 327 327 // (which can be obtained from the root line box). 328 curr->setXPos(root()-> object()->width()-x);328 curr->setXPos(root()->block()->width()-x); 329 329 continue; // The positioned object has no effect on the width. 330 330 } … … 342 342 x += curr->object()->marginLeft(); 343 343 curr->setXPos(x); 344 leftPosition = min(x + curr-> object()->overflowLeft(false), leftPosition);345 rightPosition = max(x + curr-> object()->overflowWidth(false), rightPosition);344 leftPosition = min(x + curr->renderBox()->overflowLeft(false), leftPosition); 345 rightPosition = max(x + curr->renderBox()->overflowWidth(false), rightPosition); 346 346 x += curr->width() + curr->object()->marginRight(); 347 347 } … … 356 356 } 357 357 358 void InlineFlowBox::verticallyAlignBoxes(int&heightOfBlock)358 int InlineFlowBox::verticallyAlignBoxes(int heightOfBlock) 359 359 { 360 360 int maxPositionTop = 0; … … 390 390 391 391 heightOfBlock += maxHeight; 392 393 return heightOfBlock; 392 394 } 393 395 … … 523 525 524 526 if (curr->object()->hasReflection()) { 525 overflowTop = min(overflowTop, curr-> object()->reflectionBox().y());526 overflowBottom = max(overflowBottom, curr-> object()->reflectionBox().bottom());527 overflowTop = min(overflowTop, curr->renderBox()->reflectionBox().y()); 528 overflowBottom = max(overflowBottom, curr->renderBox()->reflectionBox().bottom()); 527 529 } 528 530 … … 536 538 newY += curr->object()->marginTop(); 537 539 newHeight = curr->height() - (curr->object()->marginTop() + curr->object()->marginBottom()); 538 overflowTop = curr-> object()->overflowTop(false);539 overflowBottom = curr-> object()->overflowHeight(false) - newHeight;540 overflowTop = curr->renderBox()->overflowTop(false); 541 overflowBottom = curr->renderBox()->overflowHeight(false) - newHeight; 540 542 } 541 543 -
trunk/WebCore/rendering/InlineFlowBox.h
r40086 r40124 116 116 bool onEndChain(RenderObject* endObject); 117 117 virtual int placeBoxesHorizontally(int x, int& leftPosition, int& rightPosition, bool& needsWordSpacing); 118 virtual void verticallyAlignBoxes(int&heightOfBlock);118 virtual int verticallyAlignBoxes(int heightOfBlock); 119 119 void computeLogicalBoxHeights(int& maxPositionTop, int& maxPositionBottom, 120 120 int& maxAscent, int& maxDescent, bool strictMode); -
trunk/WebCore/rendering/RenderApplet.cpp
r40086 r40124 67 67 // use fixed widths/heights from the style system when we can, since the widget might 68 68 // not have an accurate m_width/m_height. 69 int width = style()->width().isFixed() ? style()->width().value() :70 m_width- borderLeft() - borderRight() - paddingLeft() - paddingRight();71 int height = style()->height().isFixed() ? style()->height().value() :72 m_height- borderTop() - borderBottom() - paddingTop() - paddingBottom();69 int contentWidth = style()->width().isFixed() ? style()->width().value() : 70 width() - borderLeft() - borderRight() - paddingLeft() - paddingRight(); 71 int contentHeight = style()->height().isFixed() ? style()->height().value() : 72 height() - borderTop() - borderBottom() - paddingTop() - paddingBottom(); 73 73 for (Node* child = element->firstChild(); child; child = child->nextSibling()) { 74 74 if (child->hasTagName(paramTag)) { … … 81 81 Frame* frame = document()->frame(); 82 82 ASSERT(frame); 83 setWidget(frame->loader()->createJavaAppletWidget(IntSize( width, height), element, m_args));83 setWidget(frame->loader()->createJavaAppletWidget(IntSize(contentWidth, contentHeight), element, m_args)); 84 84 } 85 85 -
trunk/WebCore/rendering/RenderBlock.cpp
r40086 r40124 423 423 for (ShadowData* boxShadow = style()->boxShadow(); boxShadow; boxShadow = boxShadow->next) 424 424 shadowHeight = max(boxShadow->y + boxShadow->blur, shadowHeight); 425 int height = m_height+ shadowHeight;425 int inflatedHeight = height() + shadowHeight; 426 426 if (hasReflection()) 427 height = max(height, reflectionBox().bottom());428 return height;427 inflatedHeight = max(inflatedHeight, reflectionBox().bottom()); 428 return inflatedHeight; 429 429 } 430 430 return m_overflowHeight; … … 437 437 for (ShadowData* boxShadow = style()->boxShadow(); boxShadow; boxShadow = boxShadow->next) 438 438 shadowWidth = max(boxShadow->x + boxShadow->blur, shadowWidth); 439 int width = m_width+ shadowWidth;439 int inflatedWidth = width() + shadowWidth; 440 440 if (hasReflection()) 441 width = max(width, reflectionBox().right());442 return width;441 inflatedWidth = max(inflatedWidth, reflectionBox().right()); 442 return inflatedWidth; 443 443 } 444 444 return m_overflowWidth; … … 476 476 { 477 477 if (!includeInterior && hasOverflowClip()) { 478 IntRect box = borderBox ();478 IntRect box = borderBoxRect(); 479 479 int shadowLeft = 0; 480 480 int shadowRight = 0; … … 509 509 510 510 if (!includeInterior && hasOverflowClip()) 511 return borderBox ();511 return borderBoxRect(); 512 512 int l = overflowLeft(includeInterior); 513 513 int t = min(overflowTop(includeInterior), -borderTopExtra()); … … 523 523 // (d) have a min-height 524 524 // (e) have specified that one of our margins can't collapse using a CSS extension 525 if ( m_height> 0 ||525 if (height() > 0 || 526 526 isTable() || (borderBottom() + paddingBottom() + borderTop() + paddingTop()) != 0 || 527 527 style()->minHeight().isPositive() || … … 571 571 if (hasControlClip()) { 572 572 // Because of the lightweight clip, there can never be any overflow from children. 573 m_overflowWidth = m_width;574 m_overflowHeight = m_height;573 m_overflowWidth = width(); 574 m_overflowHeight = height(); 575 575 m_overflowLeft = 0; 576 576 m_overflowTop = 0; … … 596 596 } 597 597 598 LayoutStateMaintainer statePusher(view(), this, IntSize(x Pos(), yPos()), m_hasColumns || hasTransform() || hasReflection());599 600 int oldWidth = m_width;598 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), m_hasColumns || hasTransform() || hasReflection()); 599 600 int oldWidth = width(); 601 601 int oldColumnWidth = desiredColumnWidth(); 602 602 … … 604 604 calcColumnWidth(); 605 605 606 m_overflowWidth = m_width;606 m_overflowWidth = width(); 607 607 m_overflowLeft = 0; 608 608 609 if (oldWidth != m_width|| oldColumnWidth != desiredColumnWidth())609 if (oldWidth != width() || oldColumnWidth != desiredColumnWidth()) 610 610 relayoutChildren = true; 611 611 612 612 clearFloats(); 613 613 614 int previousHeight = m_height; 615 m_height = 0; 614 int previousHeight = height(); 615 setHeight(0); 616 616 617 m_overflowHeight = 0; 617 618 … … 659 660 // Expand our intrinsic height to encompass floats. 660 661 int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight(); 661 if (floatBottom() > ( m_height- toAdd) && (isInlineBlockOrInlineTable() || isFloatingOrPositioned() || hasOverflowClip() ||662 if (floatBottom() > (height() - toAdd) && (isInlineBlockOrInlineTable() || isFloatingOrPositioned() || hasOverflowClip() || 662 663 (parent() && parent()->isFlexibleBox() || m_hasColumns))) 663 m_height = floatBottom() + toAdd;664 setHeight(floatBottom() + toAdd); 664 665 665 666 // Now lay out our columns within this intrinsic height, since they can slightly affect the intrinsic height as … … 668 669 669 670 // Calculate our new height. 670 int oldHeight = m_height;671 int oldHeight = height(); 671 672 calcHeight(); 672 if (oldHeight != m_height) {673 if (oldHeight > m_height && maxFloatBottom > m_height&& !childrenInline()) {673 if (oldHeight != height()) { 674 if (oldHeight > height() && maxFloatBottom > height() && !childrenInline()) { 674 675 // One of our children's floats may have become an overhanging float for us. We need to look for it. 675 676 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 676 677 if (child->isBlockFlow() && !child->isFloatingOrPositioned()) { 677 678 RenderBlock* block = static_cast<RenderBlock*>(child); 678 if (block->floatBottom() + block->y Pos() > m_height)679 addOverhangingFloats(block, -block->x Pos(), -block->yPos(), false);679 if (block->floatBottom() + block->y() > height()) 680 addOverhangingFloats(block, -block->x(), -block->y(), false); 680 681 } 681 682 } … … 685 686 686 687 // If the block got expanded in size, then increase our overflowheight to match. 687 if (m_overflowHeight > m_height)688 if (m_overflowHeight > height()) 688 689 m_overflowHeight -= toAdd; 689 if (m_overflowHeight < m_height)690 m_overflowHeight = m_height;691 } 692 if (previousHeight != m_height)690 if (m_overflowHeight < height()) 691 m_overflowHeight = height(); 692 } 693 if (previousHeight != height()) 693 694 relayoutChildren = true; 694 695 695 696 // Some classes of objects (floats and fieldsets with no specified heights and table cells) expand to encompass 696 697 // overhanging floats. 697 if (hasOverhangingFloats() && expandsToEncloseOverhangingFloats()) { 698 m_height = floatBottom(); 699 m_height += borderBottom() + paddingBottom(); 700 } 698 if (hasOverhangingFloats() && expandsToEncloseOverhangingFloats()) 699 setHeight(floatBottom() + borderBottom() + paddingBottom()); 701 700 702 701 if ((isCell || isInline() || isFloatingOrPositioned() || isRoot()) && !hasOverflowClip() && !hasControlClip()) … … 708 707 709 708 // Always ensure our overflow width/height are at least as large as our width/height. 710 m_overflowWidth = max(m_overflowWidth, m_width);711 m_overflowHeight = max(m_overflowHeight, m_height);709 m_overflowWidth = max(m_overflowWidth, width()); 710 m_overflowHeight = max(m_overflowHeight, height()); 712 711 713 712 if (!hasOverflowClip()) { 714 713 for (ShadowData* boxShadow = style()->boxShadow(); boxShadow; boxShadow = boxShadow->next) { 715 714 m_overflowLeft = min(m_overflowLeft, boxShadow->x - boxShadow->blur); 716 m_overflowWidth = max(m_overflowWidth, m_width+ boxShadow->x + boxShadow->blur);715 m_overflowWidth = max(m_overflowWidth, width() + boxShadow->x + boxShadow->blur); 717 716 m_overflowTop = min(m_overflowTop, boxShadow->y - boxShadow->blur); 718 m_overflowHeight = max(m_overflowHeight, m_height+ boxShadow->y + boxShadow->blur);717 m_overflowHeight = max(m_overflowHeight, height() + boxShadow->y + boxShadow->blur); 719 718 } 720 719 … … 753 752 754 753 // Don't allow this rect to spill out of our overflow box. 755 repaintRect.intersect(IntRect(0, 0, m_width, m_height));754 repaintRect.intersect(IntRect(0, 0, width(), height())); 756 755 } 757 756 … … 776 775 777 776 if (child->hasStaticY()) { 778 int y = m_height;777 int y = height(); 779 778 if (!marginInfo.canCollapseWithTop()) { 780 779 child->calcVerticalMargins(); … … 811 810 // an example of this scenario. 812 811 int marginOffset = marginInfo.canCollapseWithTop() ? 0 : marginInfo.margin(); 813 m_height += marginOffset;812 setHeight(height() + marginOffset); 814 813 positionNewFloats(); 815 m_height -= marginOffset;816 } 817 818 Render Object* RenderBlock::handleSpecialChild(RenderObject* child, const MarginInfo& marginInfo, CompactInfo& compactInfo, bool& handled)814 setHeight(height() - marginOffset); 815 } 816 817 RenderBox* RenderBlock::handleSpecialChild(RenderBox* child, const MarginInfo& marginInfo, CompactInfo& compactInfo, bool& handled) 819 818 { 820 819 // Handle positioned children first. 821 Render Object* next = handlePositionedChild(child, marginInfo, handled);820 RenderBox* next = handlePositionedChild(child, marginInfo, handled); 822 821 if (handled) return next; 823 822 … … 835 834 836 835 837 Render Object* RenderBlock::handlePositionedChild(RenderObject* child, const MarginInfo& marginInfo, bool& handled)836 RenderBox* RenderBlock::handlePositionedChild(RenderBox* child, const MarginInfo& marginInfo, bool& handled) 838 837 { 839 838 if (child->isPositioned()) { … … 841 840 child->containingBlock()->insertPositionedObject(child); 842 841 adjustPositionedBlock(child, marginInfo); 843 return child->nextSibling ();842 return child->nextSiblingBox(); 844 843 } 845 844 … … 847 846 } 848 847 849 Render Object* RenderBlock::handleFloatingChild(RenderObject* child, const MarginInfo& marginInfo, bool& handled)848 RenderBox* RenderBlock::handleFloatingChild(RenderBox* child, const MarginInfo& marginInfo, bool& handled) 850 849 { 851 850 if (child->isFloating()) { … … 853 852 insertFloatingObject(child); 854 853 adjustFloatingBlock(marginInfo); 855 return child->nextSibling ();854 return child->nextSiblingBox(); 856 855 } 857 856 … … 859 858 } 860 859 861 Render Object* RenderBlock::handleCompactChild(RenderObject* child, CompactInfo& compactInfo, bool& handled)860 RenderBox* RenderBlock::handleCompactChild(RenderBox* child, CompactInfo& compactInfo, bool& handled) 862 861 { 863 862 // FIXME: We only deal with one compact at a time. It is unclear what should be … … 882 881 handled = true; 883 882 compactInfo.set(child, curr); 884 child->setPos(0,0); // This position will be updated to reflect the compact's883 toRenderBox(child)->setLocation(IntPoint()); // This position will be updated to reflect the compact's 885 884 // desired position and the line box for the compact will 886 885 // pick that position up. 887 886 888 887 // Remove the child. 889 Render Object* next = child->nextSibling();888 RenderBox* next = child->nextSiblingBox(); 890 889 removeChildNode(child); 891 890 … … 901 900 } 902 901 903 void RenderBlock::insertCompactIfNeeded(Render Object* child, CompactInfo& compactInfo)902 void RenderBlock::insertCompactIfNeeded(RenderBox* child, CompactInfo& compactInfo) 904 903 { 905 904 if (compactInfo.matches(child)) { 906 905 // We have a compact child to squeeze in. 907 Render Object* compactChild = compactInfo.compact();906 RenderBox* compactChild = compactInfo.compact(); 908 907 int compactXPos = borderLeft() + paddingLeft() + compactChild->marginLeft(); 909 908 if (style()->direction() == RTL) { … … 912 911 compactChild->width() - compactChild->marginRight(); 913 912 } 914 compactXPos -= child->x Pos(); // Put compactXPos into the child's coordinate space.915 compactChild->set Pos(compactXPos, compactChild->yPos()); // Set the x position.913 compactXPos -= child->x(); // Put compactXPos into the child's coordinate space. 914 compactChild->setLocation(compactXPos, compactChild->y()); // Set the x position. 916 915 compactInfo.clear(); 917 916 } 918 917 } 919 918 920 Render Object* RenderBlock::handleRunInChild(RenderObject* child, bool& handled)919 RenderBox* RenderBlock::handleRunInChild(RenderBox* child, bool& handled) 921 920 { 922 921 // See if we have a run-in element with inline children. If the … … 933 932 handled = true; 934 933 child->setInline(true); 935 child->set Pos(0,0);934 child->setLocation(0,0); 936 935 937 936 // Remove the child. 938 Render Object* next = child->nextSibling();937 RenderBox* next = child->nextSiblingBox(); 939 938 removeChildNode(child); 940 939 … … 947 946 } 948 947 949 void RenderBlock::collapseMargins(Render Object* child, MarginInfo& marginInfo, int yPosEstimate)948 void RenderBlock::collapseMargins(RenderBox* child, MarginInfo& marginInfo, int yPosEstimate) 950 949 { 951 950 // Get our max pos and neg top margins. … … 992 991 marginInfo.setTopQuirk(topQuirk); 993 992 994 int ypos = m_height;993 int ypos = height(); 995 994 if (child->isSelfCollapsingBlock()) { 996 995 // This child has no height. We need to compute our … … 1011 1010 // that needs to be positioned correctly (e.g., a block that 1012 1011 // had a specified height of 0 but that actually had subcontent). 1013 ypos = m_height+ collapsedTopPos - collapsedTopNeg;1012 ypos = height() + collapsedTopPos - collapsedTopNeg; 1014 1013 } 1015 1014 else { 1016 1015 if (child->style()->marginTopCollapse() == MSEPARATE) { 1017 m_height += marginInfo.margin() + child->marginTop();1018 ypos = m_height;1016 setHeight(height() + marginInfo.margin() + child->marginTop()); 1017 ypos = height(); 1019 1018 } 1020 1019 else if (!marginInfo.atTopOfBlock() || … … 1023 1022 // We're collapsing with a previous sibling's margins and not 1024 1023 // with the top of the block. 1025 m_height += max(marginInfo.posMargin(), posTop) - max(marginInfo.negMargin(), negTop);1026 ypos = m_height;1024 setHeight(height() + max(marginInfo.posMargin(), posTop) - max(marginInfo.negMargin(), negTop)); 1025 ypos = height(); 1027 1026 } 1028 1027 … … 1037 1036 1038 1037 view()->addLayoutDelta(IntSize(0, yPosEstimate - ypos)); 1039 child->set Pos(child->xPos(), ypos);1038 child->setLocation(child->x(), ypos); 1040 1039 if (ypos != yPosEstimate) { 1041 1040 if (child->shrinkToAvoidFloats()) … … 1054 1053 } 1055 1054 1056 void RenderBlock::clearFloatsIfNeeded(Render Object* child, MarginInfo& marginInfo, int oldTopPosMargin, int oldTopNegMargin)1055 void RenderBlock::clearFloatsIfNeeded(RenderBox* child, MarginInfo& marginInfo, int oldTopPosMargin, int oldTopNegMargin) 1057 1056 { 1058 1057 int heightIncrease = getClearDelta(child); … … 1062 1061 // The child needs to be lowered. Move the child so that it just clears the float. 1063 1062 view()->addLayoutDelta(IntSize(0, -heightIncrease)); 1064 child->set Pos(child->xPos(), child->yPos() + heightIncrease);1063 child->setLocation(child->x(), child->y() + heightIncrease); 1065 1064 1066 1065 if (child->isSelfCollapsingBlock()) { … … 1072 1071 1073 1072 // Adjust our height such that we are ready to be collapsed with subsequent siblings. 1074 m_height = child->yPos() - max(0, marginInfo.margin());1073 setHeight(child->y() - max(0, marginInfo.margin())); 1075 1074 1076 1075 // Set a flag that we cleared a float so that we know both to increase the height of the block … … 1080 1079 } else 1081 1080 // Increase our height by the amount we had to clear. 1082 m_height += heightIncrease;1081 setHeight(height() + heightIncrease); 1083 1082 1084 1083 if (marginInfo.canCollapseWithTop()) { … … 1110 1109 // FIXME: We need to eliminate the estimation of vertical position, because when it's wrong we sometimes trigger a pathological 1111 1110 // relayout if there are intruding floats. 1112 int yPosEstimate = m_height;1111 int yPosEstimate = height(); 1113 1112 if (!marginInfo.canCollapseWithTop()) { 1114 1113 int childMarginTop = child->selfNeedsLayout() ? child->marginTop() : child->collapsedMarginTop(); … … 1118 1117 } 1119 1118 1120 void RenderBlock::determineHorizontalPosition(Render Object* child)1119 void RenderBlock::determineHorizontalPosition(RenderBox* child) 1121 1120 { 1122 1121 if (style()->direction() == LTR) { … … 1129 1128 // to shift over as necessary to dodge any floats that might get in the way. 1130 1129 if (child->avoidsFloats()) { 1131 int leftOff = leftOffset( m_height);1130 int leftOff = leftOffset(height()); 1132 1131 if (style()->textAlign() != WEBKIT_CENTER && child->style()->marginLeft().type() != Auto) { 1133 1132 if (child->marginLeft() < 0) … … 1141 1140 // so that we can just pass the content width in directly to the |calcHorizontalMargins| 1142 1141 // function. 1143 static_cast<RenderBox*>(child)->calcHorizontalMargins(child->style()->marginLeft(), child->style()->marginRight(), lineWidth(child->yPos()));1142 child->calcHorizontalMargins(child->style()->marginLeft(), child->style()->marginRight(), lineWidth(child->y())); 1144 1143 chPos = leftOff + child->marginLeft(); 1145 1144 } 1146 1145 } 1147 view()->addLayoutDelta(IntSize(child->x Pos() - chPos, 0));1148 child->set Pos(chPos, child->yPos());1146 view()->addLayoutDelta(IntSize(child->x() - chPos, 0)); 1147 child->setLocation(chPos, child->y()); 1149 1148 } else { 1150 int xPos = m_width- borderRight() - paddingRight() - verticalScrollbarWidth();1149 int xPos = width() - borderRight() - paddingRight() - verticalScrollbarWidth(); 1151 1150 int chPos = xPos - (child->width() + child->marginRight()); 1152 1151 if (child->avoidsFloats()) { 1153 int rightOff = rightOffset( m_height);1152 int rightOff = rightOffset(height()); 1154 1153 if (style()->textAlign() != WEBKIT_CENTER && child->style()->marginRight().type() != Auto) { 1155 1154 if (child->marginRight() < 0) … … 1162 1161 // so that we can just pass the content width in directly to the |calcHorizontalMargins| 1163 1162 // function. 1164 static_cast<RenderBox*>(child)->calcHorizontalMargins(child->style()->marginLeft(), child->style()->marginRight(), lineWidth(child->yPos()));1163 toRenderBox(child)->calcHorizontalMargins(child->style()->marginLeft(), child->style()->marginRight(), lineWidth(child->y())); 1165 1164 chPos = rightOff - child->marginRight() - child->width(); 1166 1165 } 1167 1166 } 1168 view()->addLayoutDelta(IntSize(child->x Pos() - chPos, 0));1169 child->set Pos(chPos, child->yPos());1167 view()->addLayoutDelta(IntSize(child->x() - chPos, 0)); 1168 child->setLocation(chPos, child->y()); 1170 1169 } 1171 1170 } … … 1206 1205 if (!marginInfo.canCollapseWithBottom() && !marginInfo.canCollapseWithTop() 1207 1206 && (!style()->htmlHacks() || !marginInfo.quirkContainer() || !marginInfo.bottomQuirk())) 1208 m_height += marginInfo.margin();1207 setHeight(height() + marginInfo.margin()); 1209 1208 1210 1209 // Now add in our bottom border/padding. 1211 m_height += bottom;1210 setHeight(height() + bottom); 1212 1211 1213 1212 // Negative margins can cause our height to shrink below our minimal height (border/padding). 1214 1213 // If this happens, ensure that the computed height is increased to the minimal height. 1215 m_height = max(m_height, top + bottom);1214 setHeight(max(height(), top + bottom)); 1216 1215 1217 1216 // Always make sure our overflow height is at least our height. 1218 m_overflowHeight = max( m_height, m_overflowHeight);1217 m_overflowHeight = max(height(), m_overflowHeight); 1219 1218 1220 1219 // Update our bottom collapsed margin info. … … 1245 1244 int bottom = borderBottom() + paddingBottom() + horizontalScrollbarHeight(); 1246 1245 1247 m_height = m_overflowHeight = top; 1246 m_overflowHeight = top; 1247 setHeight(m_overflowHeight); 1248 1248 1249 1249 // The margin struct caches all our current margin collapsing state. The compact struct caches state when we encounter compacts, … … 1258 1258 maxFloatBottom = 0; 1259 1259 1260 Render Object* child = firstChild();1260 RenderBox* child = firstChildBox(); 1261 1261 while (child) { 1262 1262 if (legend == child) { 1263 child = child->nextSibling ();1263 child = child->nextSiblingBox(); 1264 1264 continue; // Skip the legend, since it has already been positioned up in the fieldset's border. 1265 1265 } … … 1281 1281 // run-ins. When we encounter these four types of objects, we don't actually lay them out as normal flow blocks. 1282 1282 bool handled = false; 1283 Render Object* next = handleSpecialChild(child, marginInfo, compactInfo, handled);1283 RenderBox* next = handleSpecialChild(child, marginInfo, compactInfo, handled); 1284 1284 if (handled) { 1285 1285 child = next; … … 1302 1302 1303 1303 // Cache our old rect so that we can dirty the proper repaint rects if the child moves. 1304 IntRect oldRect(child->x Pos(), child->yPos() , child->width(), child->height());1304 IntRect oldRect(child->x(), child->y() , child->width(), child->height()); 1305 1305 #ifndef NDEBUG 1306 1306 IntSize oldLayoutDelta = view()->layoutDelta(); 1307 1307 #endif 1308 1308 // Go ahead and position the child as though it didn't collapse with the top. 1309 view()->addLayoutDelta(IntSize(0, child->y Pos() - yPosEstimate));1310 child->set Pos(child->xPos(), yPosEstimate);1309 view()->addLayoutDelta(IntSize(0, child->y() - yPosEstimate)); 1310 child->setLocation(child->x(), yPosEstimate); 1311 1311 1312 1312 bool markDescendantsWithFloats = false; … … 1317 1317 // layout. 1318 1318 int fb = max(previousFloatBottom, floatBottom()); 1319 if (fb > m_height|| fb > yPosEstimate)1319 if (fb > height() || fb > yPosEstimate) 1320 1320 markDescendantsWithFloats = true; 1321 1321 } … … 1348 1348 1349 1349 // Update our height now that the child has been placed in the correct position. 1350 m_height += child->height();1350 setHeight(height() + child->height()); 1351 1351 if (child->style()->marginBottomCollapse() == MSEPARATE) { 1352 m_height += child->marginBottom();1352 setHeight(height() + child->marginBottom()); 1353 1353 marginInfo.clearMargin(); 1354 1354 } 1355 1355 // If the child has overhanging floats that intrude into following siblings (or possibly out 1356 1356 // of this block), then the parent gets notified of the floats now. 1357 maxFloatBottom = max(maxFloatBottom, addOverhangingFloats(static_cast<RenderBlock *>(child), -child->xPos(), -child->yPos(), !childNeededLayout));1357 maxFloatBottom = max(maxFloatBottom, addOverhangingFloats(static_cast<RenderBlock*>(child), -child->x(), -child->y(), !childNeededLayout)); 1358 1358 1359 1359 // Update our overflow in case the child spills out the block. 1360 m_overflowTop = min(m_overflowTop, child->y Pos() + child->overflowTop(false));1361 m_overflowHeight = max(m_overflowHeight, m_height+ child->overflowHeight(false) - child->height());1362 m_overflowWidth = max(child->x Pos() + child->overflowWidth(false), m_overflowWidth);1363 m_overflowLeft = min(child->x Pos() + child->overflowLeft(false), m_overflowLeft);1360 m_overflowTop = min(m_overflowTop, child->y() + child->overflowTop(false)); 1361 m_overflowHeight = max(m_overflowHeight, height() + child->overflowHeight(false) - child->height()); 1362 m_overflowWidth = max(child->x() + child->overflowWidth(false), m_overflowWidth); 1363 m_overflowLeft = min(child->x() + child->overflowLeft(false), m_overflowLeft); 1364 1364 1365 1365 // Insert our compact into the block margin if we have one. 1366 1366 insertCompactIfNeeded(child, compactInfo); 1367 1367 1368 IntSize childOffset(child->x Pos() - oldRect.x(), child->yPos() - oldRect.y());1368 IntSize childOffset(child->x() - oldRect.x(), child->y() - oldRect.y()); 1369 1369 if (childOffset.width() || childOffset.height()) { 1370 1370 view()->addLayoutDelta(childOffset); … … 1381 1381 1382 1382 ASSERT(oldLayoutDelta == view()->layoutDelta()); 1383 child = child->nextSibling ();1383 child = child->nextSiblingBox(); 1384 1384 } 1385 1385 … … 1394 1394 return false; 1395 1395 1396 LayoutStateMaintainer statePusher(view(), this, IntSize(x Pos(), yPos()), m_hasColumns || hasTransform() || hasReflection());1396 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), m_hasColumns || hasTransform() || hasReflection()); 1397 1397 1398 1398 if (needsPositionedMovementLayout()) { … … 1417 1417 { 1418 1418 if (m_positionedObjects) { 1419 Render Object* r;1419 RenderBox* r; 1420 1420 Iterator end = m_positionedObjects->end(); 1421 1421 for (Iterator it = m_positionedObjects->begin(); it != end; ++it) { … … 1444 1444 { 1445 1445 if (m_positionedObjects) { 1446 Render Object* r;1446 RenderBox* r; 1447 1447 Iterator end = m_positionedObjects->end(); 1448 1448 for (Iterator it = m_positionedObjects->begin(); it != end; ++it) { … … 1473 1473 // is our responsibility to paint (m_shouldPaint is set). When paintAllDescendants is true, the latter 1474 1474 // condition is replaced with being a descendant of us. 1475 if (r->m_bottom > m_height&& (paintAllDescendants && r->m_renderer->isDescendantOf(this) || r->m_shouldPaint) && !r->m_renderer->hasLayer()) {1475 if (r->m_bottom > height() && (paintAllDescendants && r->m_renderer->isDescendantOf(this) || r->m_shouldPaint) && !r->m_renderer->hasLayer()) { 1476 1476 r->m_renderer->repaint(); 1477 1477 r->m_renderer->repaintOverhangingFloats(); … … 1484 1484 void RenderBlock::paint(PaintInfo& paintInfo, int tx, int ty) 1485 1485 { 1486 tx += m_x;1487 ty += m_ y;1486 tx += x(); 1487 ty += m_frameRect.y(); 1488 1488 1489 1489 PaintPhase phase = paintInfo.phase; … … 1620 1620 bool isPrinting = document()->printing(); 1621 1621 1622 for (Render Object* child = firstChild(); child; child = child->nextSibling()) {1622 for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) { 1623 1623 // Check for page-break-before: always, and if it's set, break and bail. 1624 1624 if (isPrinting && !childrenInline() && child->style()->pageBreakBefore() == PBALWAYS && 1625 inRootBlockContext() && (ty + child->y Pos()) > paintInfo.rect.y() &&1626 (ty + child->y Pos()) < paintInfo.rect.bottom()) {1627 view()->setBestTruncatedAt(ty + child->y Pos(), this, true);1625 inRootBlockContext() && (ty + child->y()) > paintInfo.rect.y() && 1626 (ty + child->y()) < paintInfo.rect.bottom()) { 1627 view()->setBestTruncatedAt(ty + child->y(), this, true); 1628 1628 return; 1629 1629 } … … 1634 1634 // Check for page-break-after: always, and if it's set, break and bail. 1635 1635 if (isPrinting && !childrenInline() && child->style()->pageBreakAfter() == PBALWAYS && 1636 inRootBlockContext() && (ty + child->y Pos() + child->height()) > paintInfo.rect.y() &&1637 (ty + child->y Pos() + child->height()) < paintInfo.rect.bottom()) {1638 view()->setBestTruncatedAt(ty + child->y Pos() + child->height() + max(0, child->collapsedMarginBottom()), this, true);1636 inRootBlockContext() && (ty + child->y() + child->height()) > paintInfo.rect.y() && 1637 (ty + child->y() + child->height()) < paintInfo.rect.bottom()) { 1638 view()->setBestTruncatedAt(ty + child->y() + child->height() + max(0, child->collapsedMarginBottom()), this, true); 1639 1639 return; 1640 1640 } … … 1713 1713 // 5. paint outline. 1714 1714 if (!inlineFlow && (paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && hasOutline() && style()->visibility() == VISIBLE) 1715 Render Object::paintOutline(paintInfo.context, tx, ty, width(), height(), style());1715 RenderBox::paintOutline(paintInfo.context, tx, ty, width(), height(), style()); 1716 1716 1717 1717 // 6. paint continuation outlines. … … 1722 1722 containingBlock()->addContinuationWithOutline(inlineFlow); 1723 1723 else if (!inlineFlow->firstLineBox()) 1724 inlineFlow->paintOutline(paintInfo.context, tx - x Pos() + inlineFlow->containingBlock()->xPos(),1725 ty - y Pos() + inlineFlow->containingBlock()->yPos());1724 inlineFlow->paintOutline(paintInfo.context, tx - x() + inlineFlow->containingBlock()->x(), 1725 ty - y() + inlineFlow->containingBlock()->y()); 1726 1726 } 1727 1727 paintContinuationOutlines(paintInfo, tx, ty); … … 1749 1749 PaintInfo currentPaintInfo(paintInfo); 1750 1750 currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground; 1751 int currentTX = tx + r->m_left - r->m_renderer->x Pos() + r->m_renderer->marginLeft();1752 int currentTY = ty + r->m_top - r->m_renderer->y Pos() + r->m_renderer->marginTop();1751 int currentTX = tx + r->m_left - r->m_renderer->x() + r->m_renderer->marginLeft(); 1752 int currentTY = ty + r->m_top - r->m_renderer->y() + r->m_renderer->marginTop(); 1753 1753 r->m_renderer->paint(currentPaintInfo, currentTX, currentTY); 1754 1754 if (!preservePhase) { … … 1830 1830 RenderBlock* block = flow->containingBlock(); 1831 1831 for ( ; block && block != this; block = block->containingBlock()) { 1832 tx += block->x Pos();1833 ty += block->y Pos();1832 tx += block->x(); 1833 ty += block->y(); 1834 1834 } 1835 1835 ASSERT(block); … … 1920 1920 } 1921 1921 1922 static void clipOutPositionedObjects(const RenderObject::PaintInfo* paintInfo, int tx, int ty, ListHashSet<Render Object*>* positionedObjects)1922 static void clipOutPositionedObjects(const RenderObject::PaintInfo* paintInfo, int tx, int ty, ListHashSet<RenderBox*>* positionedObjects) 1923 1923 { 1924 1924 if (!positionedObjects) 1925 1925 return; 1926 1926 1927 ListHashSet<Render Object*>::const_iterator end = positionedObjects->end();1928 for (ListHashSet<Render Object*>::const_iterator it = positionedObjects->begin(); it != end; ++it) {1929 Render Object* r = *it;1930 paintInfo->context->clipOut(IntRect(tx + r->x Pos(), ty + r->yPos(), r->width(), r->height()));1927 ListHashSet<RenderBox*>::const_iterator end = positionedObjects->end(); 1928 for (ListHashSet<RenderBox*>::const_iterator it = positionedObjects->begin(); it != end; ++it) { 1929 RenderBox* r = *it; 1930 paintInfo->context->clipOut(IntRect(tx + r->x(), ty + r->y(), r->width(), r->height())); 1931 1931 } 1932 1932 } … … 1942 1942 if (isBody() || isRoot()) // The <body> must make sure to examine its containingBlock's positioned objects. 1943 1943 for (RenderBlock* cb = containingBlock(); cb && !cb->isRenderView(); cb = cb->containingBlock()) 1944 clipOutPositionedObjects(paintInfo, cb->x Pos(), cb->yPos(), cb->m_positionedObjects);1944 clipOutPositionedObjects(paintInfo, cb->x(), cb->y(), cb->m_positionedObjects); 1945 1945 if (m_floatingObjects) { 1946 1946 for (DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); it.current(); ++it) { … … 2036 2036 2037 2037 // Go ahead and jump right to the first block child that contains some selected objects. 2038 Render Object* curr;2039 for (curr = firstChild (); curr && curr->selectionState() == SelectionNone; curr = curr->nextSibling()) { }2040 2041 for (bool sawSelectionEnd = false; curr && !sawSelectionEnd; curr = curr->nextSibling ()) {2038 RenderBox* curr; 2039 for (curr = firstChildBox(); curr && curr->selectionState() == SelectionNone; curr = curr->nextSiblingBox()) { } 2040 2041 for (bool sawSelectionEnd = false; curr && !sawSelectionEnd; curr = curr->nextSiblingBox()) { 2042 2042 SelectionState childState = curr->selectionState(); 2043 2043 if (childState == SelectionBoth || childState == SelectionEnd) … … 2062 2062 // Fill the gap above the object. 2063 2063 result.uniteCenter(fillVerticalSelectionGap(lastTop, lastLeft, lastRight, 2064 ty + curr->y Pos(), rootBlock, blockX, blockY, paintInfo));2064 ty + curr->y(), rootBlock, blockX, blockY, paintInfo)); 2065 2065 2066 2066 // Only fill side gaps for objects that paint their own selection if we know for sure the selection is going to extend all the way *past* … … 2074 2074 2075 2075 if (leftGap) 2076 result.uniteLeft(fillLeftSelectionGap(this, curr->x Pos(), curr->yPos(), curr->height(), rootBlock, blockX, blockY, tx, ty, paintInfo));2076 result.uniteLeft(fillLeftSelectionGap(this, curr->x(), curr->y(), curr->height(), rootBlock, blockX, blockY, tx, ty, paintInfo)); 2077 2077 if (rightGap) 2078 result.uniteRight(fillRightSelectionGap(this, curr->x Pos() + curr->width(), curr->yPos(), curr->height(), rootBlock, blockX, blockY, tx, ty, paintInfo));2078 result.uniteRight(fillRightSelectionGap(this, curr->x() + curr->width(), curr->y(), curr->height(), rootBlock, blockX, blockY, tx, ty, paintInfo)); 2079 2079 2080 2080 // Update lastTop to be just underneath the object. lastLeft and lastRight extend as far as 2081 2081 // they can without bumping into floating or positioned objects. Ideally they will go right up 2082 2082 // to the border of the root selection block. 2083 lastTop = (ty - blockY) + (curr->y Pos() + curr->height());2084 lastLeft = leftSelectionOffset(rootBlock, curr->y Pos() + curr->height());2085 lastRight = rightSelectionOffset(rootBlock, curr->y Pos() + curr->height());2083 lastTop = (ty - blockY) + (curr->y() + curr->height()); 2084 lastLeft = leftSelectionOffset(rootBlock, curr->y() + curr->height()); 2085 lastRight = rightSelectionOffset(rootBlock, curr->y() + curr->height()); 2086 2086 } else if (childState != SelectionNone) 2087 2087 // We must be a block that has some selected object inside it. Go ahead and recur. 2088 result.unite(static_cast<RenderBlock*>(curr)->fillSelectionGaps(rootBlock, blockX, blockY, tx + curr->x Pos(), ty + curr->yPos(),2088 result.unite(static_cast<RenderBlock*>(curr)->fillSelectionGaps(rootBlock, blockX, blockY, tx + curr->x(), ty + curr->y(), 2089 2089 lastTop, lastLeft, lastRight, paintInfo)); 2090 2090 } … … 2166 2166 } 2167 2167 2168 int RenderBlock::leftSelectionOffset(RenderBlock* rootBlock, int y )2169 { 2170 int left = leftOffset(y );2168 int RenderBlock::leftSelectionOffset(RenderBlock* rootBlock, int yPos) 2169 { 2170 int left = leftOffset(yPos); 2171 2171 if (left == borderLeft() + paddingLeft()) { 2172 2172 if (rootBlock != this) 2173 2173 // The border can potentially be further extended by our containingBlock(). 2174 return containingBlock()->leftSelectionOffset(rootBlock, y + yPos());2174 return containingBlock()->leftSelectionOffset(rootBlock, yPos + y()); 2175 2175 return left; 2176 2176 } … … 2178 2178 RenderBlock* cb = this; 2179 2179 while (cb != rootBlock) { 2180 left += cb->x Pos();2180 left += cb->x(); 2181 2181 cb = cb->containingBlock(); 2182 2182 } … … 2186 2186 } 2187 2187 2188 int RenderBlock::rightSelectionOffset(RenderBlock* rootBlock, int y )2189 { 2190 int right = rightOffset(y );2188 int RenderBlock::rightSelectionOffset(RenderBlock* rootBlock, int yPos) 2189 { 2190 int right = rightOffset(yPos); 2191 2191 if (right == (contentWidth() + (borderLeft() + paddingLeft()))) { 2192 2192 if (rootBlock != this) 2193 2193 // The border can potentially be further extended by our containingBlock(). 2194 return containingBlock()->rightSelectionOffset(rootBlock, y + yPos());2194 return containingBlock()->rightSelectionOffset(rootBlock, yPos + y()); 2195 2195 return right; 2196 2196 } … … 2198 2198 RenderBlock* cb = this; 2199 2199 while (cb != rootBlock) { 2200 right += cb->x Pos();2200 right += cb->x(); 2201 2201 cb = cb->containingBlock(); 2202 2202 } … … 2205 2205 } 2206 2206 2207 void RenderBlock::insertPositionedObject(Render Object *o)2207 void RenderBlock::insertPositionedObject(RenderBox* o) 2208 2208 { 2209 2209 // Create the list of special objects if we don't aleady have one 2210 2210 if (!m_positionedObjects) 2211 m_positionedObjects = new ListHashSet<Render Object*>;2211 m_positionedObjects = new ListHashSet<RenderBox*>; 2212 2212 2213 2213 m_positionedObjects->add(o); 2214 2214 } 2215 2215 2216 void RenderBlock::removePositionedObject(Render Object *o)2216 void RenderBlock::removePositionedObject(RenderBox* o) 2217 2217 { 2218 2218 if (m_positionedObjects) … … 2225 2225 return; 2226 2226 2227 Render Object* r;2227 RenderBox* r; 2228 2228 2229 2229 Iterator end = m_positionedObjects->end(); 2230 2230 2231 Vector<Render Object*, 16> deadObjects;2231 Vector<RenderBox*, 16> deadObjects; 2232 2232 2233 2233 for (Iterator it = m_positionedObjects->begin(); it != end; ++it) { … … 2253 2253 } 2254 2254 2255 void RenderBlock::insertFloatingObject(Render Object *o)2255 void RenderBlock::insertFloatingObject(RenderBox* o) 2256 2256 { 2257 2257 ASSERT(o->isFloating()); … … 2287 2287 } 2288 2288 2289 void RenderBlock::removeFloatingObject(Render Object *o)2289 void RenderBlock::removeFloatingObject(RenderBox* o) 2290 2290 { 2291 2291 if (m_floatingObjects) { … … 2322 2322 } 2323 2323 2324 int y = m_height;2324 int y = height(); 2325 2325 2326 2326 // The float cannot start above the y position of the last positioned float. … … 2337 2337 } 2338 2338 2339 Render Object* o = f->m_renderer;2339 RenderBox* o = f->m_renderer; 2340 2340 int _height = o->height() + o->marginTop() + o->marginBottom(); 2341 2341 … … 2346 2346 fwidth = ro - lo; // Never look for more than what will be available. 2347 2347 2348 IntRect oldRect(o->x Pos(), o->yPos() , o->width(), o->height());2348 IntRect oldRect(o->x(), o->y() , o->width(), o->height()); 2349 2349 2350 2350 if (o->style()->clear() & CLEFT) … … 2363 2363 fx = max(0, fx); 2364 2364 f->m_left = fx; 2365 o->set Pos(fx + o->marginLeft(), y + o->marginTop());2365 o->setLocation(fx + o->marginLeft(), y + o->marginTop()); 2366 2366 } else { 2367 2367 int heightRemainingLeft = 1; … … 2373 2373 } 2374 2374 f->m_left = fx - f->m_width; 2375 o->set Pos(fx - o->marginRight() - o->width(), y + o->marginTop());2375 o->setLocation(fx - o->marginRight() - o->width(), y + o->marginTop()); 2376 2376 } 2377 2377 … … 2406 2406 break; 2407 2407 } 2408 if ( m_height< newY)2409 m_height = newY;2408 if (height() < newY) 2409 setHeight(newY); 2410 2410 } 2411 2411 … … 2604 2604 2605 2605 if (m_positionedObjects) { 2606 Render Object* r;2606 RenderBox* r; 2607 2607 Iterator end = m_positionedObjects->end(); 2608 2608 for (Iterator it = m_positionedObjects->begin(); it != end; ++it) { … … 2614 2614 // If a positioned object lies completely to the left of the root it will be unreachable via scrolling. 2615 2615 // Therefore we should not allow it to contribute to the lowest position. 2616 if (!isRenderView() || r->x Pos() + r->width() > 0 || r->xPos() + r->rightmostPosition(false) > 0) {2617 int lp = r->y Pos() + r->lowestPosition(false);2616 if (!isRenderView() || r->x() + r->width() > 0 || r->x() + r->rightmostPosition(false) > 0) { 2617 int lp = r->y() + r->lowestPosition(false); 2618 2618 bottom = max(bottom, lp + relativeOffset); 2619 2619 } … … 2661 2661 2662 2662 if (m_positionedObjects) { 2663 Render Object* r;2663 RenderBox* r; 2664 2664 Iterator end = m_positionedObjects->end(); 2665 2665 for (Iterator it = m_positionedObjects->begin() ; it != end; ++it) { … … 2671 2671 // If a positioned object lies completely above the root it will be unreachable via scrolling. 2672 2672 // Therefore we should not allow it to contribute to the rightmost position. 2673 if (!isRenderView() || r->y Pos() + r->height() > 0 || r->yPos() + r->lowestPosition(false) > 0) {2674 int rp = r->x Pos() + r->rightmostPosition(false);2673 if (!isRenderView() || r->y() + r->height() > 0 || r->y() + r->lowestPosition(false) > 0) { 2674 int rp = r->x() + r->rightmostPosition(false); 2675 2675 right = max(right, rp + relativeOffset); 2676 2676 } … … 2723 2723 2724 2724 if (m_positionedObjects) { 2725 Render Object* r;2725 RenderBox* r; 2726 2726 Iterator end = m_positionedObjects->end(); 2727 2727 for (Iterator it = m_positionedObjects->begin(); it != end; ++it) { … … 2733 2733 // If a positioned object lies completely above the root it will be unreachable via scrolling. 2734 2734 // Therefore we should not allow it to contribute to the leftmost position. 2735 if (!isRenderView() || r->y Pos() + r->height() > 0 || r->yPos() + r->lowestPosition(false) > 0) {2736 int lp = r->x Pos() + r->leftmostPosition(false);2735 if (!isRenderView() || r->y() + r->height() > 0 || r->y() + r->lowestPosition(false) > 0) { 2736 int lp = r->x() + r->leftmostPosition(false); 2737 2737 left = min(left, lp + relativeOffset); 2738 2738 } … … 2838 2838 // to avoid floats. 2839 2839 bool parentHasFloats = false; 2840 RenderObject *prev = previousSibling();2841 while (prev && (!prev->is RenderBlock() || prev->avoidsFloats() || prev->isFloatingOrPositioned())) {2840 RenderObject* prev = previousSibling(); 2841 while (prev && (!prev->isBox() || !prev->isRenderBlock() || prev->avoidsFloats() || prev->isFloatingOrPositioned())) { 2842 2842 if (prev->isFloating()) 2843 2843 parentHasFloats = true; … … 2846 2846 2847 2847 // First add in floats from the parent. 2848 int offset = m_ y;2848 int offset = m_frameRect.y(); 2849 2849 if (parentHasFloats) 2850 2850 addIntrudingFloats(static_cast<RenderBlock *>(parent()), 2851 2851 parent()->borderLeft() + parent()->paddingLeft(), offset); 2852 2852 2853 2853 2854 int xoffset = 0; 2854 2855 if (prev) 2855 offset -= prev->yPos();2856 offset -= toRenderBox(prev)->y(); 2856 2857 else { 2857 2858 prev = parent(); … … 2917 2918 DeprecatedPtrListIterator<FloatingObject> it(*child->m_floatingObjects); 2918 2919 for (FloatingObject* r; (r = it.current()); ++it) { 2919 int bottom = child->y Pos() + r->m_bottom;2920 int bottom = child->y() + r->m_bottom; 2920 2921 lowestFloatBottom = max(lowestFloatBottom, bottom); 2921 2922 … … 3030 3031 } 3031 3032 3032 void RenderBlock::markAllDescendantsWithFloatsForLayout(Render Object* floatToRemove)3033 void RenderBlock::markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove) 3033 3034 { 3034 3035 setChildNeedsLayout(true); … … 3047 3048 } 3048 3049 3049 int RenderBlock::getClearDelta(Render Object *child)3050 int RenderBlock::getClearDelta(RenderBox* child) 3050 3051 { 3051 3052 // There is no need to compute clearance if we have no floats. … … 3075 3076 // Do not allow tables to wrap in quirks or even in almost strict mode 3076 3077 // (ebay on the PLT, finance.yahoo.com in the real world, versiontracker.com forces even almost strict mode not to work) 3077 int result = clearSet ? max(0, bottom - child->y Pos()) : 0;3078 int result = clearSet ? max(0, bottom - child->y()) : 0; 3078 3079 if (!result && child->avoidsFloats() && child->style()->width().isFixed() && 3079 child->minPrefWidth() > lineWidth(child->y Pos()) && child->minPrefWidth() <= availableWidth() &&3080 child->minPrefWidth() > lineWidth(child->y()) && child->minPrefWidth() <= availableWidth() && 3080 3081 document()->inStrictMode()) 3081 result = max(0, floatBottom() - child->y Pos());3082 result = max(0, floatBottom() - child->y()); 3082 3083 return result; 3083 3084 } … … 3105 3106 bool inlineFlow = isInlineFlow(); 3106 3107 3107 int tx = _tx + m_x;3108 int ty = _ty + m_y + borderTopExtra();3108 int tx = _tx + x(); 3109 int ty = _ty + y(); 3109 3110 3110 3111 if (!inlineFlow && !isRenderView()) { … … 3151 3152 for (it.toLast(); (o = it.current()); --it) { 3152 3153 if (o->m_shouldPaint && !o->m_renderer->hasLayer()) { 3153 int xoffset = scrolledX + o->m_left + o->m_renderer->marginLeft() - o->m_renderer->x Pos();3154 int yoffset = scrolledY + o->m_top + o->m_renderer->marginTop() - o->m_renderer->y Pos();3154 int xoffset = scrolledX + o->m_left + o->m_renderer->marginLeft() - o->m_renderer->x(); 3155 int yoffset = scrolledY + o->m_top + o->m_renderer->marginTop() - o->m_renderer->y(); 3155 3156 if (o->m_renderer->hitTest(request, result, IntPoint(_x, _y), xoffset, yoffset)) { 3156 3157 updateHitTestResult(result, IntPoint(_x - xoffset, _y - yoffset)); … … 3165 3166 if (!inlineFlow && (hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground)) { 3166 3167 int topExtra = borderTopExtra(); 3167 IntRect boundsRect(tx, ty - topExtra, m_width, m_height+ topExtra + borderBottomExtra());3168 IntRect boundsRect(tx, ty - topExtra, width(), height() + topExtra + borderBottomExtra()); 3168 3169 if (visibleToHitTesting() && boundsRect.contains(_x, _y)) { 3169 3170 updateHitTestResult(result, IntPoint(_x - tx, _y - ty + topExtra)); … … 3301 3302 if (y < top || (isEditableRoot && (y < bottom && x < left))) { 3302 3303 if (!isEditableRoot) 3303 if (Render Object* c = firstChild()) { // FIXME: This code doesn't make any sense. This child could be an inline or a positioned element or a float or a compact, etc.3304 VisiblePosition p = c->positionForCoordinates(contentsX - c->x Pos(), contentsY - c->yPos());3304 if (RenderBox* c = firstChildBox()) { // FIXME: This code doesn't make any sense. This child could be an inline or a positioned element or a float or a compact, etc. 3305 VisiblePosition p = c->positionForCoordinates(contentsX - c->x(), contentsY - c->y()); 3305 3306 if (p.isNotNull()) 3306 3307 return p; … … 3317 3318 if (y >= bottom || (isEditableRoot && (y >= top && x >= right))) { 3318 3319 if (!isEditableRoot) 3319 if (Render Object* c = lastChild()) { // FIXME: This code doesn't make any sense. This child could be an inline or a positioned element or a float or a compact, ect.3320 VisiblePosition p = c->positionForCoordinates(contentsX - c->x Pos(), contentsY - c->yPos());3320 if (RenderBox* c = lastChildBox()) { // FIXME: This code doesn't make any sense. This child could be an inline or a positioned element or a float or a compact, ect. 3321 VisiblePosition p = c->positionForCoordinates(contentsX - c->x(), contentsY - c->y()); 3321 3322 if (p.isNotNull()) 3322 3323 return p; … … 3365 3366 3366 3367 // See if any child blocks exist at this y coordinate. 3367 if (firstChild () && contentsY < firstChild()->yPos())3368 if (firstChildBox() && contentsY < firstChildBox()->y()) 3368 3369 return VisiblePosition(n, 0, DOWNSTREAM); 3369 for (Render Object* renderer = firstChild(); renderer; renderer = renderer->nextSibling()) {3370 for (RenderBox* renderer = firstChildBox(); renderer; renderer = renderer->nextSiblingBox()) { 3370 3371 if (renderer->height() == 0 || renderer->style()->visibility() != VISIBLE || renderer->isFloatingOrPositioned()) 3371 3372 continue; 3372 Render Object* next = renderer->nextSibling();3373 RenderBox* next = renderer->nextSiblingBox(); 3373 3374 while (next && next->isFloatingOrPositioned()) 3374 next = next->nextSibling ();3375 next = next->nextSiblingBox(); 3375 3376 if (next) 3376 bottom = next->y Pos();3377 bottom = next->y(); 3377 3378 else 3378 3379 bottom = top + scrollHeight(); 3379 if (contentsY >= renderer->y Pos() && contentsY < bottom)3380 return renderer->positionForCoordinates(contentsX - renderer->x Pos(), contentsY - renderer->yPos());3380 if (contentsY >= renderer->y() && contentsY < bottom) 3381 return renderer->positionForCoordinates(contentsX - renderer->x(), contentsY - renderer->y()); 3381 3382 } 3382 3383 … … 3596 3597 } 3597 3598 3598 m_overflowWidth = max( m_width, currX - colGap);3599 m_overflowWidth = max(width(), currX - colGap); 3599 3600 m_overflowLeft = min(0, currX + desiredColumnWidth + colGap); 3600 3601 … … 3603 3604 3604 3605 if (computeIntrinsicHeight) 3605 m_height = m_overflowHeight + toAdd;3606 setHeight(m_overflowHeight + toAdd); 3606 3607 3607 3608 v->setPrintRect(IntRect()); … … 4252 4253 } 4253 4254 else { 4254 for (Render Object* curr = firstChild(); curr; curr = curr->nextSibling()) {4255 for (RenderBox* curr = firstChildBox(); curr; curr = curr->nextSiblingBox()) { 4255 4256 if (!curr->isFloatingOrPositioned()) { 4256 4257 int result = curr->getBaselineOfFirstLineBox(); 4257 4258 if (result != -1) 4258 return curr->y Pos() + result; // Translate to our coordinate space.4259 return curr->y() + result; // Translate to our coordinate space. 4259 4260 } 4260 4261 } … … 4278 4279 else { 4279 4280 bool haveNormalFlowChild = false; 4280 for (Render Object* curr = lastChild(); curr; curr = curr->previousSibling()) {4281 for (RenderBox* curr = lastChildBox(); curr; curr = curr->previousSiblingBox()) { 4281 4282 if (!curr->isFloatingOrPositioned()) { 4282 4283 haveNormalFlowChild = true; 4283 4284 int result = curr->getBaselineOfLastLineBox(); 4284 4285 if (result != -1) 4285 return curr->y Pos() + result; // Translate to our coordinate space.4286 return curr->y() + result; // Translate to our coordinate space. 4286 4287 } 4287 4288 } … … 4501 4502 } 4502 4503 else { 4503 Render Object* normalFlowChildWithoutLines = 0;4504 for (Render Object* obj = block->firstChild(); obj; obj = obj->nextSibling()) {4504 RenderBox* normalFlowChildWithoutLines = 0; 4505 for (RenderBox* obj = block->firstChildBox(); obj; obj = obj->nextSiblingBox()) { 4505 4506 if (shouldCheckLines(obj)) { 4506 4507 int result = getHeightForLineCount(static_cast<RenderBlock*>(obj), l, false, count); 4507 4508 if (result != -1) 4508 return result + obj->y Pos() + (includeBottom ? (block->borderBottom() + block->paddingBottom()) : 0);4509 return result + obj->y() + (includeBottom ? (block->borderBottom() + block->paddingBottom()) : 0); 4509 4510 } 4510 4511 else if (!obj->isFloatingOrPositioned() && !obj->isCompact() && !obj->isRunIn()) … … 4512 4513 } 4513 4514 if (normalFlowChildWithoutLines && l == 0) 4514 return normalFlowChildWithoutLines->y Pos() + normalFlowChildWithoutLines->height();4515 return normalFlowChildWithoutLines->y() + normalFlowChildWithoutLines->height(); 4515 4516 } 4516 4517 } … … 4560 4561 } 4561 4562 else { 4562 for (Render Object* obj = firstChild(); obj; obj = obj->nextSibling()) {4563 for (RenderBox* obj = firstChildBox(); obj; obj = obj->nextSiblingBox()) { 4563 4564 if (!obj->isFloatingOrPositioned()) { 4564 4565 if (obj->isBlockFlow() && !obj->hasOverflowClip()) 4565 static_cast<RenderBlock*>(obj)->adjustForBorderFit(x + obj->x Pos(), left, right);4566 static_cast<RenderBlock*>(obj)->adjustForBorderFit(x + obj->x(), left, right); 4566 4567 else if (obj->style()->visibility() == VISIBLE) { 4567 4568 // We are a replaced element or some kind of non-block-flow object. 4568 left = min(left, x + obj->x Pos());4569 right = max(right, x + obj->x Pos() + obj->width());4569 left = min(left, x + obj->x()); 4570 right = max(right, x + obj->x() + obj->width()); 4570 4571 } 4571 4572 } … … 4579 4580 // Only examine the object if our m_shouldPaint flag is set. 4580 4581 if (r->m_shouldPaint) { 4581 int floatLeft = r->m_left - r->m_renderer->x Pos() + r->m_renderer->marginLeft();4582 int floatLeft = r->m_left - r->m_renderer->x() + r->m_renderer->marginLeft(); 4582 4583 int floatRight = floatLeft + r->m_renderer->width(); 4583 4584 left = min(left, floatLeft); -
trunk/WebCore/rendering/RenderBlock.h
r40086 r40124 113 113 114 114 void layoutPositionedObjects(bool relayoutChildren); 115 void insertPositionedObject(Render Object*);116 void removePositionedObject(Render Object*);115 void insertPositionedObject(RenderBox*); 116 void removePositionedObject(RenderBox*); 117 117 virtual void removePositionedObjects(RenderBlock*); 118 118 … … 129 129 // the implementation of the following functions is in bidi.cpp 130 130 struct FloatWithRect { 131 FloatWithRect(Render Object* f)131 FloatWithRect(RenderBox* f) 132 132 : object(f) 133 , rect(IntRect(f->x Pos() - f->marginLeft(), f->yPos() - f->marginTop(), f->width() + f->marginLeft() + f->marginRight(), f->height() + f->marginTop() + f->marginBottom()))133 , rect(IntRect(f->x() - f->marginLeft(), f->y() - f->marginTop(), f->width() + f->marginLeft() + f->marginRight(), f->height() + f->marginTop() + f->marginBottom())) 134 134 { 135 135 } 136 136 137 Render Object* object;137 RenderBox* object; 138 138 IntRect rect; 139 139 }; … … 170 170 void paintCaret(PaintInfo&, int tx, int ty, CaretType); 171 171 172 void insertFloatingObject(Render Object*);173 void removeFloatingObject(Render Object*);172 void insertFloatingObject(RenderBox*); 173 void removeFloatingObject(RenderBox*); 174 174 175 175 // Called from lineWidth, to position the floats added in the last line. … … 177 177 bool positionNewFloats(); 178 178 void clearFloats(); 179 int getClearDelta(Render Object* child);180 virtual void markAllDescendantsWithFloatsForLayout(Render Object* floatToRemove = 0);179 int getClearDelta(RenderBox* child); 180 virtual void markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove = 0); 181 181 void markPositionedObjectsForLayout(); 182 182 … … 186 186 virtual bool avoidsFloats() const; 187 187 188 virtual bool hasOverhangingFloats() { return !hasColumns() && floatBottom() > m_height; }188 virtual bool hasOverhangingFloats() { return !hasColumns() && floatBottom() > height(); } 189 189 void addIntrudingFloats(RenderBlock* prev, int xoffset, int yoffset); 190 190 int addOverhangingFloats(RenderBlock* child, int xoffset, int yoffset, bool makeChildPaintOtherFloats); … … 353 353 Type type() { return static_cast<Type>(m_type); } 354 354 355 Render Object* m_renderer;355 RenderBox* m_renderer; 356 356 int m_top; 357 357 int m_bottom; … … 366 366 class CompactInfo { 367 367 // A compact child that needs to be collapsed into the margin of the following block. 368 Render Object* m_compact;368 RenderBox* m_compact; 369 369 370 370 // The block with the open margin that the compact child is going to place itself within. … … 372 372 373 373 public: 374 Render Object* compact() const { return m_compact; }374 RenderBox* compact() const { return m_compact; } 375 375 RenderObject* block() const { return m_block; } 376 376 bool matches(RenderObject* child) const { return m_compact && m_block == child; } 377 377 378 378 void clear() { set(0, 0); } 379 void set(Render Object* c, RenderObject* b) { m_compact = c; m_block = b; }379 void set(RenderBox* c, RenderObject* b) { m_compact = c; m_block = b; } 380 380 381 381 CompactInfo() { clear(); } … … 450 450 void adjustPositionedBlock(RenderObject* child, const MarginInfo&); 451 451 void adjustFloatingBlock(const MarginInfo&); 452 Render Object* handleSpecialChild(RenderObject* child, const MarginInfo&, CompactInfo&, bool& handled);453 Render Object* handleFloatingChild(RenderObject* child, const MarginInfo&, bool& handled);454 Render Object* handlePositionedChild(RenderObject* child, const MarginInfo&, bool& handled);455 Render Object* handleCompactChild(RenderObject* child, CompactInfo&, bool& handled);456 Render Object* handleRunInChild(RenderObject* child, bool& handled);457 void collapseMargins(Render Object* child, MarginInfo&, int yPosEstimate);458 void clearFloatsIfNeeded(Render Object* child, MarginInfo&, int oldTopPosMargin, int oldTopNegMargin);459 void insertCompactIfNeeded(Render Object* child, CompactInfo&);452 RenderBox* handleSpecialChild(RenderBox* child, const MarginInfo&, CompactInfo&, bool& handled); 453 RenderBox* handleFloatingChild(RenderBox* child, const MarginInfo&, bool& handled); 454 RenderBox* handlePositionedChild(RenderBox* child, const MarginInfo&, bool& handled); 455 RenderBox* handleCompactChild(RenderBox* child, CompactInfo&, bool& handled); 456 RenderBox* handleRunInChild(RenderBox* child, bool& handled); 457 void collapseMargins(RenderBox* child, MarginInfo&, int yPosEstimate); 458 void clearFloatsIfNeeded(RenderBox* child, MarginInfo&, int oldTopPosMargin, int oldTopNegMargin); 459 void insertCompactIfNeeded(RenderBox* child, CompactInfo&); 460 460 int estimateVerticalPosition(RenderObject* child, const MarginInfo&); 461 void determineHorizontalPosition(Render Object* child);461 void determineHorizontalPosition(RenderBox* child); 462 462 void handleBottomOfBlock(int top, int bottom, MarginInfo&); 463 463 void setCollapsedBottomMargin(const MarginInfo&); … … 465 465 466 466 private: 467 typedef ListHashSet<Render Object*>::const_iterator Iterator;467 typedef ListHashSet<RenderBox*>::const_iterator Iterator; 468 468 DeprecatedPtrList<FloatingObject>* m_floatingObjects; 469 ListHashSet<Render Object*>* m_positionedObjects;469 ListHashSet<RenderBox*>* m_positionedObjects; 470 470 471 471 // Allocated only when some of these fields have non-default values -
trunk/WebCore/rendering/RenderBox.cpp
r40086 r40124 38 38 #include "RenderArena.h" 39 39 #include "RenderFlexibleBox.h" 40 #include "RenderInline.h" 40 41 #include "RenderLayer.h" 41 42 #include "RenderReplica.h" … … 61 62 RenderBox::RenderBox(Node* node) 62 63 : RenderObject(node) 63 , m_width(0)64 , m_height(0)65 , m_x(0)66 , m_y(0)67 64 , m_marginLeft(0) 68 65 , m_marginRight(0) … … 74 71 , m_inlineBoxWrapper(0) 75 72 { 73 setIsBox(); 76 74 } 77 75 … … 215 213 } 216 214 215 216 int RenderBox::offsetLeft() const 217 { 218 RenderBox* offsetPar = offsetParent(); 219 if (!offsetPar) 220 return 0; 221 int xPos = x() - offsetPar->borderLeft(); 222 if (!isPositioned()) { 223 if (isRelPositioned()) 224 xPos += relativePositionOffsetX(); 225 RenderObject* curr = parent(); 226 while (curr && curr != offsetPar) { 227 // FIXME: What are we supposed to do inside SVG content? 228 if (curr->isBox() && !curr->isTableRow()) 229 xPos += toRenderBox(curr)->x(); 230 curr = curr->parent(); 231 } 232 if (offsetPar->isBody() && !offsetPar->isRelPositioned() && !offsetPar->isPositioned()) 233 xPos += offsetPar->x(); 234 } 235 return xPos; 236 } 237 238 int RenderBox::offsetTop() const 239 { 240 RenderBox* offsetPar = offsetParent(); 241 if (!offsetPar) 242 return 0; 243 int yPos = m_frameRect.y() - offsetPar->borderTop(); 244 if (!isPositioned()) { 245 if (isRelPositioned()) 246 yPos += relativePositionOffsetY(); 247 RenderObject* curr = parent(); 248 while (curr && curr != offsetPar) { 249 // FIXME: What are we supposed to do inside SVG content? 250 if (curr->isBox() && !curr->isTableRow()) 251 yPos += toRenderBox(curr)->y(); 252 curr = curr->parent(); 253 } 254 if (offsetPar->isBody() && !offsetPar->isRelPositioned() && !offsetPar->isPositioned()) 255 yPos += offsetPar->y(); 256 } 257 return yPos; 258 } 259 260 RenderBox* RenderBox::offsetParent() const 261 { 262 // FIXME: It feels like this function could almost be written using containing blocks. 263 if (isBody()) 264 return 0; 265 266 bool skipTables = isPositioned() || isRelPositioned(); 267 float currZoom = style()->effectiveZoom(); 268 RenderObject* curr = parent(); 269 while (curr && (!curr->element() || 270 (!curr->isPositioned() && !curr->isRelPositioned() && !curr->isBody()))) { 271 Node* element = curr->element(); 272 if (!skipTables && element) { 273 bool isTableElement = element->hasTagName(tableTag) || 274 element->hasTagName(tdTag) || 275 element->hasTagName(thTag); 276 277 #if ENABLE(WML) 278 if (!isTableElement && element->isWMLElement()) 279 isTableElement = element->hasTagName(WMLNames::tableTag) || 280 element->hasTagName(WMLNames::tdTag); 281 #endif 282 283 if (isTableElement) 284 break; 285 } 286 287 float newZoom = curr->style()->effectiveZoom(); 288 if (currZoom != newZoom) 289 break; 290 currZoom = newZoom; 291 curr = curr->parent(); 292 } 293 return curr && curr->isBox() ? toRenderBox(curr) : 0; 294 } 295 296 // More IE extensions. clientWidth and clientHeight represent the interior of an object 297 // excluding border and scrollbar. 298 int RenderBox::clientWidth() const 299 { 300 return width() - borderLeft() - borderRight() - verticalScrollbarWidth(); 301 } 302 303 int RenderBox::clientHeight() const 304 { 305 return height() - borderTop() - borderBottom() - horizontalScrollbarHeight(); 306 } 307 308 // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the 309 // object has overflow:hidden/scroll/auto specified and also has overflow. 310 int RenderBox::scrollWidth() const 311 { 312 return hasOverflowClip() ? m_layer->scrollWidth() : overflowWidth(); 313 } 314 315 int RenderBox::scrollHeight() const 316 { 317 return hasOverflowClip() ? m_layer->scrollHeight() : overflowHeight(); 318 } 319 320 int RenderBox::scrollLeft() const 321 { 322 return hasOverflowClip() ? m_layer->scrollXOffset() : 0; 323 } 324 325 int RenderBox::scrollTop() const 326 { 327 return hasOverflowClip() ? m_layer->scrollYOffset() : 0; 328 } 329 330 void RenderBox::setScrollLeft(int newLeft) 331 { 332 if (hasOverflowClip()) 333 m_layer->scrollToXOffset(newLeft); 334 } 335 336 void RenderBox::setScrollTop(int newTop) 337 { 338 if (hasOverflowClip()) 339 m_layer->scrollToYOffset(newTop); 340 } 341 342 void RenderBox::absoluteRects(Vector<IntRect>& rects, int tx, int ty, bool topLevel) 343 { 344 // For blocks inside inlines, we go ahead and include margins so that we run right up to the 345 // inline boxes above and below us (thus getting merged with them to form a single irregular 346 // shape). 347 RenderFlow* continuation = virtualContinuation(); 348 if (topLevel && continuation) { 349 rects.append(IntRect(tx, ty - collapsedMarginTop(), 350 width(), height() + collapsedMarginTop() + collapsedMarginBottom())); 351 continuation->absoluteRects(rects, 352 tx - x() + continuation->containingBlock()->x(), 353 ty - y() + continuation->containingBlock()->y(), topLevel); 354 } else 355 rects.append(IntRect(tx, ty, width(), height() + borderTopExtra() + borderBottomExtra())); 356 } 357 358 void RenderBox::absoluteQuads(Vector<FloatQuad>& quads, bool topLevel) 359 { 360 // For blocks inside inlines, we go ahead and include margins so that we run right up to the 361 // inline boxes above and below us (thus getting merged with them to form a single irregular 362 // shape). 363 RenderFlow* continuation = virtualContinuation(); 364 if (topLevel && continuation) { 365 FloatRect localRect(0, -collapsedMarginTop(), 366 width(), height() + collapsedMarginTop() + collapsedMarginBottom()); 367 quads.append(localToAbsoluteQuad(localRect)); 368 continuation->absoluteQuads(quads, topLevel); 369 } else 370 quads.append(localToAbsoluteQuad(FloatRect(0, 0, width(), height() + borderTopExtra() + borderBottomExtra()))); 371 } 372 373 IntRect RenderBox::absoluteContentBox() const 374 { 375 IntRect rect = contentBoxRect(); 376 FloatPoint absPos = localToAbsoluteForContent(FloatPoint()); 377 rect.move(absPos.x(), absPos.y()); 378 return rect; 379 } 380 381 FloatQuad RenderBox::absoluteContentQuad() const 382 { 383 IntRect rect = contentBoxRect(); 384 return localToAbsoluteQuad(FloatRect(rect)); 385 } 386 387 388 IntRect RenderBox::absoluteOutlineBounds() const 389 { 390 IntRect box = borderBoxRect(); 391 adjustRectForOutlineAndShadow(box); 392 393 FloatQuad absOutlineQuad = localToAbsoluteQuad(FloatRect(box)); 394 box = absOutlineQuad.enclosingBoundingBox(); 395 box.move(view()->layoutDelta()); 396 397 return box; 398 } 399 400 void RenderBox::addFocusRingRects(GraphicsContext* graphicsContext, int tx, int ty) 401 { 402 // For blocks inside inlines, we go ahead and include margins so that we run right up to the 403 // inline boxes above and below us (thus getting merged with them to form a single irregular 404 // shape). 405 RenderFlow* continuation = virtualContinuation(); 406 if (continuation) { 407 graphicsContext->addFocusRingRect(IntRect(tx, ty - collapsedMarginTop(), width(), height() + collapsedMarginTop() + collapsedMarginBottom())); 408 continuation->addFocusRingRects(graphicsContext, 409 tx - x() + continuation->containingBlock()->x(), 410 ty - y() + continuation->containingBlock()->y()); 411 } else 412 graphicsContext->addFocusRingRect(IntRect(tx, ty, width(), height())); 413 } 414 415 416 IntRect RenderBox::reflectionBox() const 417 { 418 IntRect result; 419 if (!style()->boxReflect()) 420 return result; 421 IntRect box = borderBoxRect(); 422 result = box; 423 switch (style()->boxReflect()->direction()) { 424 case ReflectionBelow: 425 result.move(0, box.height() + reflectionOffset()); 426 break; 427 case ReflectionAbove: 428 result.move(0, -box.height() - reflectionOffset()); 429 break; 430 case ReflectionLeft: 431 result.move(-box.width() - reflectionOffset(), 0); 432 break; 433 case ReflectionRight: 434 result.move(box.width() + reflectionOffset(), 0); 435 break; 436 } 437 return result; 438 } 439 440 int RenderBox::reflectionOffset() const 441 { 442 if (!style()->boxReflect()) 443 return 0; 444 if (style()->boxReflect()->direction() == ReflectionLeft || style()->boxReflect()->direction() == ReflectionRight) 445 return style()->boxReflect()->offset().calcValue(borderBoxRect().width()); 446 return style()->boxReflect()->offset().calcValue(borderBoxRect().height()); 447 } 448 449 IntRect RenderBox::reflectedRect(const IntRect& r) const 450 { 451 if (!style()->boxReflect()) 452 return IntRect(); 453 454 IntRect box = borderBoxRect(); 455 IntRect result = r; 456 switch (style()->boxReflect()->direction()) { 457 case ReflectionBelow: 458 result.setY(box.bottom() + reflectionOffset() + (box.bottom() - r.bottom())); 459 break; 460 case ReflectionAbove: 461 result.setY(box.y() - reflectionOffset() - box.height() + (box.bottom() - r.bottom())); 462 break; 463 case ReflectionLeft: 464 result.setX(box.x() - reflectionOffset() - box.width() + (box.right() - r.right())); 465 break; 466 case ReflectionRight: 467 result.setX(box.right() + reflectionOffset() + (box.right() - r.right())); 468 break; 469 } 470 return result; 471 } 472 217 473 int RenderBox::minPrefWidth() const 218 474 { … … 255 511 int RenderBox::overrideWidth() const 256 512 { 257 return hasOverrideSize() ? overrideSize() : m_width;513 return hasOverrideSize() ? overrideSize() : width(); 258 514 } 259 515 260 516 int RenderBox::overrideHeight() const 261 517 { 262 return hasOverrideSize() ? overrideSize() : m_height; 263 } 264 265 void RenderBox::setPos(int xPos, int yPos) 266 { 267 // Optimize for the case where we don't move at all. 268 if (xPos == m_x && yPos == m_y) 269 return; 270 271 m_x = xPos; 272 m_y = yPos; 518 return hasOverrideSize() ? overrideSize() : height(); 273 519 } 274 520 … … 304 550 305 551 // Hit Testing 306 bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x , int y, int tx, int ty, HitTestAction action)307 { 308 tx += m_x;309 ty += m_ y;552 bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction action) 553 { 554 tx += x(); 555 ty += m_frameRect.y(); 310 556 311 557 // Check kids first. … … 315 561 // table-specific hit-test method (which we should do for performance reasons anyway), 316 562 // then we can remove this check. 317 if (!child->hasLayer() && !child->isInlineFlow() && child->nodeAtPoint(request, result, x , y, tx, ty, action)) {318 updateHitTestResult(result, IntPoint(x - tx, y- ty));563 if (!child->hasLayer() && !child->isInlineFlow() && child->nodeAtPoint(request, result, xPos, yPos, tx, ty, action)) { 564 updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty)); 319 565 return true; 320 566 } … … 323 569 // Check our bounds next. For this purpose always assume that we can only be hit in the 324 570 // foreground phase (which is true for replaced elements like images). 325 if (visibleToHitTesting() && action == HitTestForeground && IntRect(tx, ty, m_width, m_height).contains(x, y)) {326 updateHitTestResult(result, IntPoint(x - tx, y- ty));571 if (visibleToHitTesting() && action == HitTestForeground && IntRect(tx, ty, width(), height()).contains(xPos, yPos)) { 572 updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty)); 327 573 return true; 328 574 } … … 335 581 void RenderBox::paint(PaintInfo& paintInfo, int tx, int ty) 336 582 { 337 tx += m_x;338 ty += m_ y;583 tx += x(); 584 ty += m_frameRect.y(); 339 585 340 586 // default implementation. Just pass paint through to the children … … 490 736 IntRect RenderBox::maskClipRect() 491 737 { 492 IntRect bbox = borderBox ();738 IntRect bbox = borderBoxRect(); 493 739 if (style()->maskBoxImage().image()) 494 740 return bbox; … … 607 853 } else { 608 854 layerRenderer = this; 609 rendererRect = borderBox ();855 rendererRect = borderBoxRect(); 610 856 } 611 857 } … … 888 1134 if (r) { 889 1135 FloatRect rootRect(tx + r->xPos(), ty + r->selectionTop(), r->width(), r->selectionHeight()); 890 FloatRect imageRect(tx + m_x, rootRect.y(), width(), rootRect.height());1136 FloatRect imageRect(tx + x(), rootRect.y(), width(), rootRect.height()); 891 1137 page->chrome()->client()->paintCustomHighlight(node(), type, imageRect, rootRect, behindText, false); 892 1138 } else { 893 FloatRect imageRect(tx + m_x, ty + m_y, width(), height());1139 FloatRect imageRect(tx + x(), ty + m_frameRect.y(), width(), height()); 894 1140 page->chrome()->client()->paintCustomHighlight(node(), type, imageRect, imageRect, behindText, false); 895 1141 } … … 908 1154 int clipX = tx + bLeft; 909 1155 int clipY = ty + bTop; 910 int clipWidth = m_width- bLeft - borderRight();911 int clipHeight = m_height- bTop - borderBottom() + borderTopExtra() + borderBottomExtra();1156 int clipWidth = width() - bLeft - borderRight(); 1157 int clipHeight = height() - bTop - borderBottom() + borderTopExtra() + borderBottomExtra(); 912 1158 913 1159 // Subtract out scrollbars if we have them. … … 924 1170 int clipX = tx; 925 1171 int clipY = ty; 926 int clipWidth = m_width;927 int clipHeight = m_height;1172 int clipWidth = width(); 1173 int clipHeight = height(); 928 1174 929 1175 if (!style()->clipLeft().isAuto()) { 930 int c = style()->clipLeft().calcValue( m_width);1176 int c = style()->clipLeft().calcValue(width()); 931 1177 clipX += c; 932 1178 clipWidth -= c; … … 934 1180 935 1181 if (!style()->clipRight().isAuto()) 936 clipWidth -= m_width - style()->clipRight().calcValue(m_width);1182 clipWidth -= width() - style()->clipRight().calcValue(width()); 937 1183 938 1184 if (!style()->clipTop().isAuto()) { 939 int c = style()->clipTop().calcValue( m_height);1185 int c = style()->clipTop().calcValue(height()); 940 1186 clipY += c; 941 1187 clipHeight -= c; … … 943 1189 944 1190 if (!style()->clipBottom().isAuto()) 945 clipHeight -= m_height - style()->clipBottom().calcValue(m_height);1191 clipHeight -= height() - style()->clipBottom().calcValue(height()); 946 1192 947 1193 return IntRect(clipX, clipY, clipWidth, clipHeight); … … 954 1200 return 0; 955 1201 if (shrinkToAvoidFloats()) 956 return cb->lineWidth(m_ y);1202 return cb->lineWidth(m_frameRect.y()); 957 1203 return cb->availableWidth(); 958 1204 } … … 1001 1247 LayoutState* layoutState = v->layoutState(); 1002 1248 IntSize offset = layoutState->m_offset; 1003 offset.expand( m_x, m_y);1249 offset.expand(x(), m_frameRect.y()); 1004 1250 localPoint += offset; 1005 1251 if (style()->position() == RelativePosition && m_layer) … … 1094 1340 if (o->isBlockFlow() && style()->position() != AbsolutePosition && style()->position() != FixedPosition 1095 1341 && (cb = static_cast<RenderBlock*>(o))->hasColumns()) { 1096 IntRect rect( m_x, m_y, 1, 1);1342 IntRect rect(x(), m_frameRect.y(), 1, 1); 1097 1343 cb->adjustRectForColumns(rect); 1098 1344 offset.expand(rect.x(), rect.y()); 1099 1345 } else 1100 offset.expand( m_x, m_y);1346 offset.expand(x(), m_frameRect.y()); 1101 1347 } 1102 1348 … … 1145 1391 box->destroy(renderArena()); 1146 1392 } else if (isReplaced()) { 1147 m_x = box->xPos(); 1148 m_y = box->yPos(); 1393 setLocation(box->xPos(), box->yPos()); 1149 1394 m_inlineBoxWrapper = box; 1150 1395 } … … 1196 1441 rect.move(m_layer->relativePositionOffset()); 1197 1442 1198 rect.move( m_x, m_y);1443 rect.move(x(), m_frameRect.y()); 1199 1444 rect.move(layoutState->m_offset); 1200 1445 if (layoutState->m_clipped) … … 1212 1457 1213 1458 IntPoint topLeft = rect.location(); 1214 topLeft.move( m_x, m_y);1459 topLeft.move(x(), m_frameRect.y()); 1215 1460 1216 1461 if (style()->position() == FixedPosition) … … 1234 1479 // FIXME: this clobbers topLeft adjustment done for multicol above 1235 1480 topLeft = rect.location(); 1236 topLeft.move( m_x, m_y);1481 topLeft.move(x(), m_frameRect.y()); 1237 1482 } 1238 1483 … … 1268 1513 void RenderBox::repaintDuringLayoutIfMoved(const IntRect& rect) 1269 1514 { 1270 int newX = m_x;1271 int newY = m_ y;1272 int newWidth = m_width;1273 int newHeight = m_height;1515 int newX = x(); 1516 int newY = m_frameRect.y(); 1517 int newWidth = width(); 1518 int newHeight = height(); 1274 1519 if (rect.x() != newX || rect.y() != newY) { 1275 1520 // The child moved. Invalidate the object's old and new positions. We have to do this 1276 1521 // since the object may not have gotten a layout. 1277 m_x = rect.x(); 1278 m_y = rect.y(); 1279 m_width = rect.width(); 1280 m_height = rect.height(); 1522 m_frameRect = rect; 1281 1523 repaint(); 1282 1524 repaintOverhangingFloats(true); 1283 1284 m_x = newX; 1285 m_y = newY; 1286 m_width = newWidth; 1287 m_height = newHeight; 1525 m_frameRect = IntRect(newX, newY, newWidth, newHeight); 1288 1526 repaint(); 1289 1527 repaintOverhangingFloats(true); … … 1330 1568 if (hasOverrideSize() && parent()->style()->boxOrient() == HORIZONTAL 1331 1569 && parent()->isFlexibleBox() && parent()->isFlexingChildren()) { 1332 m_width = overrideSize();1570 setWidth(overrideSize()); 1333 1571 return; 1334 1572 } … … 1338 1576 bool treatAsReplaced = shouldCalculateSizeAsReplaced() && (!inVerticalBox || !stretching); 1339 1577 1340 Length w idth= (treatAsReplaced) ? Length(calcReplacedWidth(), Fixed) : style()->width();1578 Length w = (treatAsReplaced) ? Length(calcReplacedWidth(), Fixed) : style()->width(); 1341 1579 1342 1580 RenderBlock* cb = containingBlock(); … … 1351 1589 m_marginRight = marginRight.calcMinValue(containerWidth); 1352 1590 if (treatAsReplaced) 1353 m_width = max(width.value() + borderLeft() + borderRight() + paddingLeft() + paddingRight(), minPrefWidth());1591 setWidth(max(w.value() + borderLeft() + borderRight() + paddingLeft() + paddingRight(), minPrefWidth())); 1354 1592 1355 1593 return; … … 1358 1596 // Width calculations 1359 1597 if (treatAsReplaced) 1360 m_width = width.value() + borderLeft() + borderRight() + paddingLeft() + paddingRight();1598 setWidth(w.value() + borderLeft() + borderRight() + paddingLeft() + paddingRight()); 1361 1599 else { 1362 1600 // Calculate Width 1363 m_width = calcWidthUsing(Width, containerWidth);1601 setWidth(calcWidthUsing(Width, containerWidth)); 1364 1602 1365 1603 // Calculate MaxWidth 1366 1604 if (!style()->maxWidth().isUndefined()) { 1367 1605 int maxW = calcWidthUsing(MaxWidth, containerWidth); 1368 if ( m_width> maxW) {1369 m_width = maxW;1370 w idth= style()->maxWidth();1606 if (width() > maxW) { 1607 setWidth(maxW); 1608 w = style()->maxWidth(); 1371 1609 } 1372 1610 } … … 1374 1612 // Calculate MinWidth 1375 1613 int minW = calcWidthUsing(MinWidth, containerWidth); 1376 if ( m_width< minW) {1377 m_width = minW;1378 w idth= style()->minWidth();1614 if (width() < minW) { 1615 setWidth(minW); 1616 w = style()->minWidth(); 1379 1617 } 1380 1618 } 1381 1619 1382 1620 if (stretchesToMinIntrinsicWidth()) { 1383 m_width = max(m_width, minPrefWidth());1384 w idth = Length(m_width, Fixed);1621 setWidth(max(width(), minPrefWidth())); 1622 w = Length(width(), Fixed); 1385 1623 } 1386 1624 1387 1625 // Margin calculations 1388 if (w idth.isAuto()) {1626 if (w.isAuto()) { 1389 1627 m_marginLeft = marginLeft.calcMinValue(containerWidth); 1390 1628 m_marginRight = marginRight.calcMinValue(containerWidth); … … 1395 1633 } 1396 1634 1397 if (containerWidth && containerWidth != ( m_width+ m_marginLeft + m_marginRight)1635 if (containerWidth && containerWidth != (width() + m_marginLeft + m_marginRight) 1398 1636 && !isFloating() && !isInline() && !cb->isFlexibleBox()) { 1399 1637 if (cb->style()->direction() == LTR) 1400 m_marginRight = containerWidth - m_width- m_marginLeft;1638 m_marginRight = containerWidth - width() - m_marginLeft; 1401 1639 else 1402 m_marginLeft = containerWidth - m_width- m_marginRight;1640 m_marginLeft = containerWidth - width() - m_marginRight; 1403 1641 } 1404 1642 } … … 1406 1644 int RenderBox::calcWidthUsing(WidthType widthType, int cw) 1407 1645 { 1408 int width = m_width;1646 int widthResult = width(); 1409 1647 Length w; 1410 1648 if (widthType == Width) … … 1419 1657 int marginRight = style()->marginRight().calcMinValue(cw); 1420 1658 if (cw) 1421 width = cw - marginLeft - marginRight;1659 widthResult = cw - marginLeft - marginRight; 1422 1660 1423 1661 if (sizesToIntrinsicWidth(widthType)) { 1424 width = max(width, minPrefWidth());1425 width = min(width, maxPrefWidth());1662 widthResult = max(widthResult, minPrefWidth()); 1663 widthResult = min(widthResult, maxPrefWidth()); 1426 1664 } 1427 1665 } else 1428 width = calcBorderBoxWidth(w.calcValue(cw));1429 1430 return width ;1666 widthResult = calcBorderBoxWidth(w.calcValue(cw)); 1667 1668 return widthResult; 1431 1669 } 1432 1670 … … 1471 1709 } 1472 1710 1473 if ((marginLeft.isAuto() && marginRight.isAuto() && m_width< containerWidth)1711 if ((marginLeft.isAuto() && marginRight.isAuto() && width() < containerWidth) 1474 1712 || (!marginLeft.isAuto() && !marginRight.isAuto() && containingBlock()->style()->textAlign() == WEBKIT_CENTER)) { 1475 m_marginLeft = max(0, (containerWidth - m_width) / 2);1476 m_marginRight = containerWidth - m_width- m_marginLeft;1477 } else if ((marginRight.isAuto() && m_width< containerWidth)1713 m_marginLeft = max(0, (containerWidth - width()) / 2); 1714 m_marginRight = containerWidth - width() - m_marginLeft; 1715 } else if ((marginRight.isAuto() && width() < containerWidth) 1478 1716 || (!marginLeft.isAuto() && containingBlock()->style()->direction() == RTL && containingBlock()->style()->textAlign() == WEBKIT_LEFT)) { 1479 1717 m_marginLeft = marginLeft.calcValue(containerWidth); 1480 m_marginRight = containerWidth - m_width- m_marginLeft;1481 } else if ((marginLeft.isAuto() && m_width< containerWidth)1718 m_marginRight = containerWidth - width() - m_marginLeft; 1719 } else if ((marginLeft.isAuto() && width() < containerWidth) 1482 1720 || (!marginRight.isAuto() && containingBlock()->style()->direction() == LTR && containingBlock()->style()->textAlign() == WEBKIT_RIGHT)) { 1483 1721 m_marginRight = marginRight.calcValue(containerWidth); 1484 m_marginLeft = containerWidth - m_width- m_marginRight;1722 m_marginLeft = containerWidth - width() - m_marginRight; 1485 1723 } else { 1486 // This makes auto margins 0 if we failed a m_width< containerWidth test above (css2.1, 10.3.3).1724 // This makes auto margins 0 if we failed a width() < containerWidth test above (css2.1, 10.3.3). 1487 1725 m_marginLeft = marginLeft.calcMinValue(containerWidth); 1488 1726 m_marginRight = marginRight.calcMinValue(containerWidth); … … 1526 1764 if (h.isAuto() && parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL 1527 1765 && parent()->isStretchingChildren()) { 1528 h = Length(parent ()->contentHeight() - marginTop() - marginBottom() -1766 h = Length(parentBox()->contentHeight() - marginTop() - marginBottom() - 1529 1767 borderTop() - paddingTop() - borderBottom() - paddingBottom(), Fixed); 1530 1768 checkMinMaxHeight = false; 1531 1769 } 1532 1770 1533 int height ;1771 int heightResult; 1534 1772 if (checkMinMaxHeight) { 1535 height = calcHeightUsing(style()->height());1536 if (height == -1)1537 height = m_height;1773 heightResult = calcHeightUsing(style()->height()); 1774 if (heightResult == -1) 1775 heightResult = height(); 1538 1776 int minH = calcHeightUsing(style()->minHeight()); // Leave as -1 if unset. 1539 int maxH = style()->maxHeight().isUndefined() ? height : calcHeightUsing(style()->maxHeight());1777 int maxH = style()->maxHeight().isUndefined() ? heightResult : calcHeightUsing(style()->maxHeight()); 1540 1778 if (maxH == -1) 1541 maxH = height ;1542 height = min(maxH, height);1543 height = max(minH, height);1779 maxH = heightResult; 1780 heightResult = min(maxH, heightResult); 1781 heightResult = max(minH, heightResult); 1544 1782 } else 1545 1783 // The only times we don't check min/max height are when a fixed length has 1546 1784 // been given as an override. Just use that. The value has already been adjusted 1547 1785 // for box-sizing. 1548 height = h.value() + borderTop() + borderBottom() + paddingTop() + paddingBottom();1549 1550 m_height = height;1551 }1786 heightResult = h.value() + borderTop() + borderBottom() + paddingTop() + paddingBottom(); 1787 1788 setHeight(heightResult); 1789 } 1552 1790 1553 1791 // WinIE quirk: The <html> block always fills the entire canvas in quirks mode. The <body> always fills the … … 1558 1796 int visHeight = view()->viewHeight(); 1559 1797 if (isRoot()) 1560 m_height = max(m_height, visHeight - margins);1798 setHeight(max(height(), visHeight - margins)); 1561 1799 else { 1562 1800 int marginsBordersPadding = margins + parent()->marginTop() + parent()->marginBottom() 1563 1801 + parent()->borderTop() + parent()->borderBottom() 1564 1802 + parent()->paddingTop() + parent()->paddingBottom(); 1565 m_height = max(m_height, visHeight - marginsBordersPadding);1803 setHeight(max(height(), visHeight - marginsBordersPadding)); 1566 1804 } 1567 1805 } … … 1634 1872 result = cb->calcContentBoxHeight(result); 1635 1873 } else if (cb->isRenderView() || (cb->isBody() && style()->htmlHacks()) || isPositionedWithSpecifiedHeight) { 1636 // Don't allow this to affect the block' m_heightmember variable, since this1874 // Don't allow this to affect the block' height() member variable, since this 1637 1875 // can get called while the block is still laying out its kids. 1638 1876 int oldHeight = cb->height(); … … 1715 1953 } 1716 1954 1717 int availableHeight = isPositioned() ? containingBlockHeightForPositioned(cb) : cb->availableHeight();1955 int availableHeight = isPositioned() ? containingBlockHeightForPositioned(cb) : toRenderBox(cb)->availableHeight(); 1718 1956 1719 1957 // It is necessary to use the border-box to match WinIE's broken … … 1838 2076 } 1839 2077 1840 return containingBlock->width() - containingBlock->borderLeft() - containingBlock->borderRight() - containingBlock->verticalScrollbarWidth();2078 return RenderBox::toConstRenderBox(containingBlock)->width() - containingBlock->borderLeft() - containingBlock->borderRight() - containingBlock->verticalScrollbarWidth(); 1841 2079 } 1842 2080 1843 2081 int RenderBox::containingBlockHeightForPositioned(const RenderObject* containingBlock) const 1844 2082 { 1845 return containingBlock->height() - containingBlock->borderTop() - containingBlock->borderBottom(); 2083 int heightResult; 2084 if (containingBlock->isRenderInline()) { 2085 ASSERT(containingBlock->isRelPositioned()); 2086 heightResult = static_cast<const RenderInline*>(containingBlock)->boundingBoxHeight(); 2087 } else 2088 heightResult = RenderBox::toConstRenderBox(containingBlock)->height(); 2089 2090 return heightResult - containingBlock->borderTop() - containingBlock->borderBottom(); 1846 2091 } 1847 2092 … … 1868 2113 1869 2114 // FIXME 3: Can perhaps optimize out cases when max-width/min-width are greater 1870 // than or less than the computed m_width. Be careful of box-sizing and2115 // than or less than the computed width(). Be careful of box-sizing and 1871 2116 // percentage issues. 1872 2117 … … 1924 2169 // 'staticX' should already have been set through layout of the parent. 1925 2170 int staticPosition = staticX() - containerBlock->borderLeft(); 1926 for (Render Object* po = parent(); po && po != containerBlock; po = po->parent())1927 staticPosition += po->x Pos();2171 for (RenderBox* po = parentBox(); po && po != containerBlock; po = po->parentBox()) 2172 staticPosition += po->x(); 1928 2173 left.setValue(Fixed, staticPosition); 1929 2174 } else { 1930 Render Object* po = parent();2175 RenderBox* po = parentBox(); 1931 2176 // 'staticX' should already have been set through layout of the parent. 1932 2177 int staticPosition = staticX() + containerWidth + containerBlock->borderRight() - po->width(); 1933 for (; po && po != containerBlock; po = po->parent ())1934 staticPosition -= po->x Pos();2178 for (; po && po != containerBlock; po = po->parentBox()) 2179 staticPosition -= po->x(); 1935 2180 right.setValue(Fixed, staticPosition); 1936 2181 } … … 1938 2183 1939 2184 // Calculate constraint equation values for 'width' case. 2185 int widthResult; 2186 int xResult; 1940 2187 calcAbsoluteHorizontalValues(style()->width(), containerBlock, containerDirection, 1941 2188 containerWidth, bordersPlusPadding, 1942 2189 left, right, marginLeft, marginRight, 1943 m_width, m_marginLeft, m_marginRight, m_x); 2190 widthResult, m_marginLeft, m_marginRight, xResult); 2191 setWidth(widthResult); 2192 setX(xResult); 1944 2193 1945 2194 // Calculate constraint equation values for 'max-width' case. … … 1955 2204 maxWidth, maxMarginLeft, maxMarginRight, maxXPos); 1956 2205 1957 if ( m_width> maxWidth) {1958 m_width = maxWidth;2206 if (width() > maxWidth) { 2207 setWidth(maxWidth); 1959 2208 m_marginLeft = maxMarginLeft; 1960 2209 m_marginRight = maxMarginRight; 1961 m_ x = maxXPos;2210 m_frameRect.setX(maxXPos); 1962 2211 } 1963 2212 } … … 1975 2224 minWidth, minMarginLeft, minMarginRight, minXPos); 1976 2225 1977 if ( m_width< minWidth) {1978 m_width = minWidth;2226 if (width() < minWidth) { 2227 setWidth(minWidth); 1979 2228 m_marginLeft = minMarginLeft; 1980 2229 m_marginRight = minMarginRight; 1981 m_ x = minXPos;1982 } 1983 } 1984 1985 if (stretchesToMinIntrinsicWidth() && m_width < minPrefWidth() - bordersPlusPadding)2230 m_frameRect.setX(minXPos); 2231 } 2232 } 2233 2234 if (stretchesToMinIntrinsicWidth() && width() < minPrefWidth() - bordersPlusPadding) { 1986 2235 calcAbsoluteHorizontalValues(Length(minPrefWidth() - bordersPlusPadding, Fixed), containerBlock, containerDirection, 1987 2236 containerWidth, bordersPlusPadding, 1988 2237 left, right, marginLeft, marginRight, 1989 m_width, m_marginLeft, m_marginRight, m_x); 1990 1991 // Put m_width into correct form. 1992 m_width += bordersPlusPadding; 2238 widthResult, m_marginLeft, m_marginRight, xResult); 2239 setWidth(widthResult); 2240 setX(xResult); 2241 } 2242 2243 // Put width() into correct form. 2244 setWidth(width() + bordersPlusPadding); 1993 2245 } 1994 2246 … … 2212 2464 // staticY should already have been set through layout of the parent() 2213 2465 int staticTop = staticY() - containerBlock->borderTop(); 2214 for (Render Object* po = parent(); po && po != containerBlock; po = po->parent()) {2466 for (RenderBox* po = parentBox(); po && po != containerBlock; po = po->parentBox()) { 2215 2467 if (!po->isTableRow()) 2216 staticTop += po->y Pos();2468 staticTop += po->y(); 2217 2469 } 2218 2470 top.setValue(Fixed, staticTop); … … 2220 2472 2221 2473 2222 int height; // Needed to compute overflow. 2474 int h; // Needed to compute overflow. 2475 int y; 2223 2476 2224 2477 // Calculate constraint equation values for 'height' case. 2225 2478 calcAbsoluteVerticalValues(style()->height(), containerBlock, containerHeight, bordersPlusPadding, 2226 2479 top, bottom, marginTop, marginBottom, 2227 height, m_marginTop, m_marginBottom, m_y); 2480 h, m_marginTop, m_marginBottom, y); 2481 setY(y); 2228 2482 2229 2483 // Avoid doing any work in the common case (where the values of min-height and max-height are their defaults). … … 2241 2495 maxHeight, maxMarginTop, maxMarginBottom, maxYPos); 2242 2496 2243 if (h eight> maxHeight) {2244 h eight= maxHeight;2497 if (h > maxHeight) { 2498 h = maxHeight; 2245 2499 m_marginTop = maxMarginTop; 2246 2500 m_marginBottom = maxMarginBottom; 2247 m_ y = maxYPos;2501 m_frameRect.setY(maxYPos); 2248 2502 } 2249 2503 } … … 2260 2514 minHeight, minMarginTop, minMarginBottom, minYPos); 2261 2515 2262 if (h eight< minHeight) {2263 h eight= minHeight;2516 if (h < minHeight) { 2517 h = minHeight; 2264 2518 m_marginTop = minMarginTop; 2265 2519 m_marginBottom = minMarginBottom; 2266 m_ y = minYPos;2520 m_frameRect.setY(minYPos); 2267 2521 } 2268 2522 } 2269 2523 2270 2524 // Set final height value. 2271 m_height = height + bordersPlusPadding;2272 } 2273 2274 void RenderBox::calcAbsoluteVerticalValues(Length h eight, const RenderObject* containerBlock,2525 setHeight(h + bordersPlusPadding); 2526 } 2527 2528 void RenderBox::calcAbsoluteVerticalValues(Length h, const RenderObject* containerBlock, 2275 2529 const int containerHeight, const int bordersPlusPadding, 2276 2530 const Length top, const Length bottom, const Length marginTop, const Length marginBottom, … … 2281 2535 ASSERT(!(top.isAuto() && bottom.isAuto())); 2282 2536 2283 int contentHeight = m_height- bordersPlusPadding;2537 int contentHeight = height() - bordersPlusPadding; 2284 2538 2285 2539 int topValue = 0; 2286 2540 2287 bool heightIsAuto = h eight.isAuto();2541 bool heightIsAuto = h.isAuto(); 2288 2542 bool topIsAuto = top.isAuto(); 2289 2543 bool bottomIsAuto = bottom.isAuto(); … … 2291 2545 // Height is never unsolved for tables. 2292 2546 if (isTable()) { 2293 h eight.setValue(Fixed, contentHeight);2547 h.setValue(Fixed, contentHeight); 2294 2548 heightIsAuto = false; 2295 2549 } … … 2307 2561 // case because the value is not used for any further calculations. 2308 2562 2309 heightValue = calcContentBoxHeight(h eight.calcValue(containerHeight));2563 heightValue = calcContentBoxHeight(h.calcValue(containerHeight)); 2310 2564 topValue = top.calcValue(containerHeight); 2311 2565 … … 2374 2628 } else if (topIsAuto && !heightIsAuto && !bottomIsAuto) { 2375 2629 // RULE 4: (solve of top) 2376 heightValue = calcContentBoxHeight(h eight.calcValue(containerHeight));2630 heightValue = calcContentBoxHeight(h.calcValue(containerHeight)); 2377 2631 topValue = availableSpace - (heightValue + bottom.calcValue(containerHeight)); 2378 2632 } else if (!topIsAuto && heightIsAuto && !bottomIsAuto) { … … 2382 2636 } else if (!topIsAuto && !heightIsAuto && bottomIsAuto) { 2383 2637 // RULE 6: (no need solve of bottom) 2384 heightValue = calcContentBoxHeight(h eight.calcValue(containerHeight));2638 heightValue = calcContentBoxHeight(h.calcValue(containerHeight)); 2385 2639 topValue = top.calcValue(containerHeight); 2386 2640 } … … 2423 2677 // are dealt with in calcReplacedWidth(). This means that the steps to produce 2424 2678 // correct max/min in the non-replaced version, are not necessary. 2425 m_width = calcReplacedWidth() + borderLeft() + borderRight() + paddingLeft() + paddingRight();2426 const int availableSpace = containerWidth - m_width;2679 setWidth(calcReplacedWidth() + borderLeft() + borderRight() + paddingLeft() + paddingRight()); 2680 const int availableSpace = containerWidth - width(); 2427 2681 2428 2682 /*-----------------------------------------------------------------------*\ … … 2437 2691 // 'staticX' should already have been set through layout of the parent. 2438 2692 int staticPosition = staticX() - containerBlock->borderLeft(); 2439 for (Render Object* po = parent(); po && po != containerBlock; po = po->parent())2440 staticPosition += po->x Pos();2693 for (RenderBox* po = parentBox(); po && po != containerBlock; po = po->parentBox()) 2694 staticPosition += po->x(); 2441 2695 left.setValue(Fixed, staticPosition); 2442 2696 } else { 2443 Render Object* po = parent();2697 RenderBox* po = parentBox(); 2444 2698 // 'staticX' should already have been set through layout of the parent. 2445 2699 int staticPosition = staticX() + containerWidth + containerBlock->borderRight() - po->width(); 2446 for (; po && po != containerBlock; po = po->parent ())2447 staticPosition -= po->x Pos();2700 for (; po && po != containerBlock; po = po->parentBox()) 2701 staticPosition -= po->x(); 2448 2702 right.setValue(Fixed, staticPosition); 2449 2703 } … … 2542 2796 // NOTE: It is not necessary to solve for 'right' when the direction is 2543 2797 // LTR because the value is not used. 2544 int totalWidth = m_width+ leftValue + rightValue + m_marginLeft + m_marginRight;2798 int totalWidth = width() + leftValue + rightValue + m_marginLeft + m_marginRight; 2545 2799 if (totalWidth > containerWidth && (containerDirection == RTL)) 2546 2800 leftValue = containerWidth - (totalWidth - leftValue); … … 2557 2811 InlineFlowBox* lastLine = flow->lastLineBox(); 2558 2812 if (firstLine && lastLine && firstLine != lastLine) { 2559 m_ x = leftValue + m_marginLeft + lastLine->borderLeft() + (lastLine->xPos() - firstLine->xPos());2813 m_frameRect.setX(leftValue + m_marginLeft + lastLine->borderLeft() + (lastLine->xPos() - firstLine->xPos())); 2560 2814 return; 2561 2815 } 2562 2816 } 2563 2817 2564 m_ x = leftValue + m_marginLeft + containerBlock->borderLeft();2818 m_frameRect.setX(leftValue + m_marginLeft + containerBlock->borderLeft()); 2565 2819 } 2566 2820 … … 2592 2846 // are dealt with in calcReplacedHeight(). This means that the steps to produce 2593 2847 // correct max/min in the non-replaced version, are not necessary. 2594 m_height = calcReplacedHeight() + borderTop() + borderBottom() + paddingTop() + paddingBottom();2595 const int availableSpace = containerHeight - m_height;2848 setHeight(calcReplacedHeight() + borderTop() + borderBottom() + paddingTop() + paddingBottom()); 2849 const int availableSpace = containerHeight - height(); 2596 2850 2597 2851 /*-----------------------------------------------------------------------*\ … … 2603 2857 // staticY should already have been set through layout of the parent(). 2604 2858 int staticTop = staticY() - containerBlock->borderTop(); 2605 for (Render Object* po = parent(); po && po != containerBlock; po = po->parent()) {2859 for (RenderBox* po = parentBox(); po && po != containerBlock; po = po->parentBox()) { 2606 2860 if (!po->isTableRow()) 2607 staticTop += po->y Pos();2861 staticTop += po->y(); 2608 2862 } 2609 2863 top.setValue(Fixed, staticTop); … … 2694 2948 2695 2949 // Use computed values to calculate the vertical position. 2696 m_ y = topValue + m_marginTop + containerBlock->borderTop();2950 m_frameRect.setY(topValue + m_marginTop + containerBlock->borderTop()); 2697 2951 } 2698 2952 … … 2706 2960 // FIXME: What about border and padding? 2707 2961 const int caretWidth = 1; 2708 IntRect rect(x Pos(), yPos(), caretWidth, m_height);2962 IntRect rect(x(), y(), caretWidth, height()); 2709 2963 TextDirection direction = box ? box->direction() : style()->direction(); 2710 2964 2711 2965 if ((!caretOffset) ^ (direction == LTR)) 2712 rect.move(IntSize( m_width- caretWidth, 0));2966 rect.move(IntSize(width() - caretWidth, 0)); 2713 2967 2714 2968 if (box) { … … 2732 2986 2733 2987 if (extraWidthToEndOfLine) 2734 *extraWidthToEndOfLine = x Pos() + m_width- rect.right();2988 *extraWidthToEndOfLine = x() + width() - rect.right(); 2735 2989 2736 2990 // Move to local coords 2737 rect.move(-x Pos(), -yPos());2991 rect.move(-x(), -y()); 2738 2992 return rect; 2739 2993 } … … 2741 2995 int RenderBox::lowestPosition(bool /*includeOverflowInterior*/, bool includeSelf) const 2742 2996 { 2743 if (!includeSelf || ! m_width)2997 if (!includeSelf || !width()) 2744 2998 return 0; 2745 int bottom = m_height;2999 int bottom = height(); 2746 3000 if (isRelPositioned()) 2747 3001 bottom += relativePositionOffsetY(); … … 2751 3005 int RenderBox::rightmostPosition(bool /*includeOverflowInterior*/, bool includeSelf) const 2752 3006 { 2753 if (!includeSelf || ! m_height)3007 if (!includeSelf || !height()) 2754 3008 return 0; 2755 int right = m_width;3009 int right = width(); 2756 3010 if (isRelPositioned()) 2757 3011 right += relativePositionOffsetX(); … … 2761 3015 int RenderBox::leftmostPosition(bool /*includeOverflowInterior*/, bool includeSelf) const 2762 3016 { 2763 if (!includeSelf || ! m_height)2764 return m_width;3017 if (!includeSelf || !height()) 3018 return width(); 2765 3019 int left = 0; 2766 3020 if (isRelPositioned()) … … 2769 3023 } 2770 3024 3025 #if ENABLE(SVG) 3026 3027 TransformationMatrix RenderBox::localTransform() const 3028 { 3029 return TransformationMatrix(1, 0, 0, 1, x(), y()); 3030 } 3031 3032 #endif 3033 2771 3034 } // namespace WebCore -
trunk/WebCore/rendering/RenderBox.h
r40086 r40124 28 28 namespace WebCore { 29 29 30 30 enum WidthType { Width, MinWidth, MaxWidth }; 31 31 32 32 class RenderBox : public RenderObject { … … 37 37 virtual const char* renderName() const { return "RenderBox"; } 38 38 39 static RenderBox* toRenderBox(RenderObject* o) { ASSERT(!o || o->isBox()); return static_cast<RenderBox*>(o); } 40 static const RenderBox* toConstRenderBox(const RenderObject* o) { ASSERT(!o || o->isBox()); return static_cast<const RenderBox*>(o);} 41 42 int x() const { return m_frameRect.x(); } 43 int y() const { return m_frameRect.y() + borderTopExtra(); } // FIXME: Need to deal with the borderTopExtra() lie in a sane way. 44 int width() const { return m_frameRect.width(); } 45 int height() const { return m_frameRect.height(); } 46 47 void setX(int x) { m_frameRect.setX(x); } 48 void setY(int y) { m_frameRect.setY(y); } 49 void setWidth(int width) { m_frameRect.setWidth(width); } 50 void setHeight(int height) { m_frameRect.setHeight(height); } 51 52 IntPoint location() const { return m_frameRect.location(); } // FIXME: Be aware that this is not equivalent to x(), y() because of y()'s borderTopExtra() lie! 53 IntSize size() const { return m_frameRect.size(); } 54 55 void setLocation(const IntPoint& location) { m_frameRect.setLocation(location); } 56 void setLocation(int x, int y) { setLocation(IntPoint(x, y)); } 57 58 void setSize(const IntSize& size) { m_frameRect.setSize(size); } 59 void move(int dx, int dy) { m_frameRect.move(dx, dy); } 60 61 IntRect frameRect() const { return m_frameRect; } 62 void setFrameRect(const IntRect& rect) { m_frameRect = rect; } 63 64 IntRect borderBoxRect() const { return IntRect(0, -borderTopExtra(), width(), height() + borderTopExtra() + borderBottomExtra()); } 65 66 // The content area of the box (excludes padding and border). 67 IntRect contentBoxRect() const { return IntRect(borderLeft() + paddingLeft(), borderTop() + paddingTop(), contentWidth(), contentHeight()); } 68 // The content box in absolute coords. Ignores transforms. 69 IntRect absoluteContentBox() const; 70 // The content box converted to absolute coords (taking transforms into account). 71 FloatQuad absoluteContentQuad() const; 72 73 // Bounds of the outline box in absolute coords. Respects transforms 74 virtual IntRect absoluteOutlineBounds() const; 75 virtual void addFocusRingRects(GraphicsContext*, int tx, int ty); 76 77 // Use this with caution! No type checking is done! 78 RenderBox* previousSiblingBox() const { ASSERT(!previousSibling() || previousSibling()->isBox()); return toRenderBox(previousSibling()); } 79 RenderBox* nextSiblingBox() const { ASSERT(!nextSibling() || nextSibling()->isBox()); return toRenderBox(nextSibling()); } 80 RenderBox* parentBox() const { ASSERT(!parent() || parent()->isBox()); return toRenderBox(parent()); } 81 82 // The height of a block when you include normal flow overflow spillage out of the bottom 83 // of the block (e.g., a <div style="height:25px"> that has a 100px tall image inside 84 // it would have an overflow height of borderTop() + paddingTop() + 100px. 85 virtual int overflowHeight(bool /*includeInterior*/ = true) const { return height(); } 86 virtual int overflowWidth(bool /*includeInterior*/ = true) const { return width(); } 87 virtual void setOverflowHeight(int) { } 88 virtual void setOverflowWidth(int) { } 89 virtual int overflowLeft(bool /*includeInterior*/ = true) const { return 0; } 90 virtual int overflowTop(bool /*includeInterior*/ = true) const { return 0; } 91 virtual IntRect overflowRect(bool /*includeInterior*/ = true) const { return borderBoxRect(); } 92 93 int contentWidth() const { return clientWidth() - paddingLeft() - paddingRight(); } 94 int contentHeight() const { return clientHeight() - paddingTop() - paddingBottom(); } 95 96 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlines (RenderFlow) 97 // to return the remaining width on a given line (and the height of a single line). 98 virtual int offsetWidth() const { return width(); } 99 virtual int offsetHeight() const { return height() + borderTopExtra() + borderBottomExtra(); } 100 virtual int offsetLeft() const; 101 virtual int offsetTop() const; 102 virtual RenderBox* offsetParent() const; 103 104 // More IE extensions. clientWidth and clientHeight represent the interior of an object 105 // excluding border and scrollbar. clientLeft/Top are just the borderLeftWidth and borderTopWidth. 106 int clientLeft() const { return borderLeft(); } 107 int clientTop() const { return borderTop(); } 108 int clientWidth() const; 109 int clientHeight() const; 110 111 // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the 112 // object has overflow:hidden/scroll/auto specified and also has overflow. 113 // scrollLeft/Top return the current scroll position. These methods are virtual so that objects like 114 // textareas can scroll shadow content (but pretend that they are the objects that are 115 // scrolling). 116 virtual int scrollLeft() const; 117 virtual int scrollTop() const; 118 virtual int scrollWidth() const; 119 virtual int scrollHeight() const; 120 virtual void setScrollLeft(int); 121 virtual void setScrollTop(int); 122 123 virtual void absoluteRects(Vector<IntRect>&, int tx, int ty, bool topLevel = true); 124 virtual void absoluteQuads(Vector<FloatQuad>&, bool topLevel = true); 125 126 IntRect reflectionBox() const; 127 int reflectionOffset() const; 128 // Given a rect in the object's coordinate space, returns the corresponding rect in the reflection. 129 IntRect reflectedRect(const IntRect&) const; 130 39 131 virtual void paint(PaintInfo&, int tx, int ty); 40 132 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction); … … 56 148 virtual IntSize offsetFromContainer(RenderObject*) const; 57 149 58 virtual int xPos() const { return m_x; }59 virtual int yPos() const { return m_y; }60 virtual void setPos(int x, int y);61 62 virtual int width() const { return m_width; }63 virtual int height() const { return m_height; }64 virtual void setWidth(int width) { m_width = width; }65 virtual void setHeight(int height) { m_height = height; }66 67 150 virtual int marginTop() const { return m_marginTop; } 68 151 virtual int marginBottom() const { return m_marginBottom; } 69 152 virtual int marginLeft() const { return m_marginLeft; } 70 153 virtual int marginRight() const { return m_marginRight; } 71 72 virtual IntRect borderBox() const { return IntRect(0, -borderTopExtra(), width(), height() + borderTopExtra() + borderBottomExtra()); }73 154 74 155 int calcBorderBoxWidth(int width) const; … … 133 214 int calcPercentageHeight(const Length& height); 134 215 216 // Block flows subclass availableWidth to handle multi column layout (shrinking the width available to children when laying out.) 217 virtual int availableWidth() const { return contentWidth(); } 135 218 virtual int availableHeight() const; 136 219 int availableHeightUsing(const Length&) const; … … 166 249 virtual void tryLayoutDoingPositionedMovementOnly() 167 250 { 168 int oldWidth = m_width;251 int oldWidth = width(); 169 252 calcWidth(); 170 253 // If we shrink to fit our width may have changed, so we still need full layout. 171 if (oldWidth != m_width)254 if (oldWidth != width()) 172 255 return; 173 256 calcHeight(); … … 175 258 } 176 259 177 virtual IntRect maskClipRect(); 178 260 IntRect maskClipRect(); 261 262 #if ENABLE(SVG) 263 virtual TransformationMatrix localTransform() const; 264 #endif 265 179 266 protected: 180 267 virtual void styleWillChange(RenderStyle::Diff, const RenderStyle* newStyle); … … 223 310 224 311 protected: 225 // The width/height of the contents + borders + padding. 226 int m_width; 227 int m_height; 228 229 int m_x; 230 int m_y; 312 // The width/height of the contents + borders + padding. The x/y location is relative to our container (which is not always our parent). 313 IntRect m_frameRect; 231 314 232 315 int m_marginLeft; -
trunk/WebCore/rendering/RenderButton.cpp
r40086 r40124 173 173 { 174 174 // Clip to the padding box to at least give content the extra padding space. 175 return IntRect(tx + borderLeft(), ty + borderTop(), m_width - borderLeft() - borderRight(), m_height- borderTop() - borderBottom());175 return IntRect(tx + borderLeft(), ty + borderTop(), width() - borderLeft() - borderRight(), height() - borderTop() - borderBottom()); 176 176 } 177 177 -
trunk/WebCore/rendering/RenderContainer.cpp
r40086 r40124 525 525 ASSERT(needsLayout()); 526 526 527 LayoutStateMaintainer statePusher(view(), this, IntSize( m_x, m_y));527 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), m_frameRect.y())); 528 528 529 529 RenderObject* child = m_firstChild; … … 581 581 } 582 582 583 VisiblePosition RenderContainer::positionForCoordinates(int x , int y)583 VisiblePosition RenderContainer::positionForCoordinates(int xPos, int yPos) 584 584 { 585 585 // no children...return this render object's element, if there is one, and offset 0 … … 591 591 int bottom = contentHeight() + borderTop() + paddingTop() + borderBottom() + paddingBottom(); 592 592 593 if (x < 0 || x > right || y < 0 || y> bottom) {594 if (x <= right / 2)593 if (xPos < 0 || xPos > right || yPos < 0 || yPos > bottom) { 594 if (xPos <= right / 2) 595 595 return VisiblePosition(Position(element(), 0)); 596 596 else … … 601 601 // Pass off to the closest child. 602 602 int minDist = INT_MAX; 603 Render Object* closestRenderer = 0;604 int newX = x ;605 int newY = y ;603 RenderBox* closestRenderer = 0; 604 int newX = xPos; 605 int newY = yPos; 606 606 if (isTableRow()) { 607 newX += x Pos();608 newY += y Pos();609 } 610 for (RenderObject* render er = m_firstChild; renderer; renderer = renderer->nextSibling()) {611 if (!render er->firstChild() && !renderer->isInline() && !renderer->isBlockFlow()612 || render er->style()->visibility() != VISIBLE)607 newX += x(); 608 newY += y(); 609 } 610 for (RenderObject* renderObject = m_firstChild; renderObject; renderObject = renderObject->nextSibling()) { 611 if (!renderObject->firstChild() && !renderObject->isInline() && !renderObject->isBlockFlow() 612 || renderObject->style()->visibility() != VISIBLE) 613 613 continue; 614 614 615 int top = borderTop() + paddingTop() + (isTableRow() ? 0 : renderer->yPos()); 615 if (!renderObject->isBox()) 616 continue; 617 618 RenderBox* renderer = toRenderBox(renderObject); 619 620 int top = borderTop() + paddingTop() + (isTableRow() ? 0 : renderer->y()); 616 621 int bottom = top + renderer->contentHeight(); 617 int left = borderLeft() + paddingLeft() + (isTableRow() ? 0 : renderer->x Pos());622 int left = borderLeft() + paddingLeft() + (isTableRow() ? 0 : renderer->x()); 618 623 int right = left + renderer->contentWidth(); 619 624 620 if (x <= right && x >= left && y <= top && y>= bottom) {625 if (xPos <= right && xPos >= left && yPos <= top && yPos >= bottom) { 621 626 if (renderer->isTableRow()) 622 return renderer->positionForCoordinates(x + newX - renderer->xPos(), y + newY - renderer->yPos());623 return renderer->positionForCoordinates(x - renderer->xPos(), y - renderer->yPos());627 return renderer->positionForCoordinates(xPos + newX - renderer->x(), yPos + newY - renderer->y()); 628 return renderer->positionForCoordinates(xPos - renderer->x(), yPos - renderer->y()); 624 629 } 625 630 … … 627 632 // and use a different compare depending on which piece (x, y) is in. 628 633 IntPoint cmp; 629 if (x > right) {630 if (y < top)634 if (xPos > right) { 635 if (yPos < top) 631 636 cmp = IntPoint(right, top); 632 else if (y > bottom)637 else if (yPos > bottom) 633 638 cmp = IntPoint(right, bottom); 634 639 else 635 cmp = IntPoint(right, y );636 } else if (x < left) {637 if (y < top)640 cmp = IntPoint(right, yPos); 641 } else if (xPos < left) { 642 if (yPos < top) 638 643 cmp = IntPoint(left, top); 639 else if (y > bottom)644 else if (yPos > bottom) 640 645 cmp = IntPoint(left, bottom); 641 646 else 642 cmp = IntPoint(left, y );647 cmp = IntPoint(left, yPos); 643 648 } else { 644 if (y < top)645 cmp = IntPoint(x , top);649 if (yPos < top) 650 cmp = IntPoint(xPos, top); 646 651 else 647 cmp = IntPoint(x , bottom);648 } 649 650 int x1minusx2 = cmp.x() - x ;651 int y1minusy2 = cmp.y() - y ;652 cmp = IntPoint(xPos, bottom); 653 } 654 655 int x1minusx2 = cmp.x() - xPos; 656 int y1minusy2 = cmp.y() - yPos; 652 657 653 658 int dist = x1minusx2 * x1minusx2 + y1minusy2 * y1minusy2; … … 659 664 660 665 if (closestRenderer) 661 return closestRenderer->positionForCoordinates(newX - closestRenderer->x Pos(), newY - closestRenderer->yPos());666 return closestRenderer->positionForCoordinates(newX - closestRenderer->x(), newY - closestRenderer->y()); 662 667 663 668 return VisiblePosition(element(), 0, DOWNSTREAM); -
trunk/WebCore/rendering/RenderContainer.h
r40086 r40124 35 35 virtual RenderObject* lastChild() const { return m_lastChild; } 36 36 37 // Use this with caution! No type checking is done! 38 RenderBox* firstChildBox() const { ASSERT(!firstChild() || firstChild()->isBox()); return toRenderBox(m_firstChild); } 39 RenderBox* lastChildBox() const { ASSERT(!lastChild() || lastChild()->isBox()); return toRenderBox(m_lastChild); } 40 37 41 virtual bool canHaveChildren() const; 38 42 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0); … … 66 70 virtual void collectAbsoluteLineBoxQuads(Vector<FloatQuad>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false); 67 71 68 pr ivate:72 protected: 69 73 RenderObject* m_firstChild; 70 74 RenderObject* m_lastChild; -
trunk/WebCore/rendering/RenderFieldset.cpp
r40086 r40124 49 49 { 50 50 RenderBlock::calcPrefWidths(); 51 if (Render Object* legend = findLegend()) {51 if (RenderBox* legend = findLegend()) { 52 52 int legendMinWidth = legend->minPrefWidth(); 53 53 … … 67 67 RenderObject* RenderFieldset::layoutLegend(bool relayoutChildren) 68 68 { 69 Render Object* legend = findLegend();69 RenderBox* legend = findLegend(); 70 70 if (legend) { 71 71 if (relayoutChildren) … … 80 80 break; 81 81 case CENTER: 82 xPos = ( m_width- legend->width()) / 2;82 xPos = (width() - legend->width()) / 2; 83 83 break; 84 84 default: 85 xPos = m_width- paddingRight() - borderRight() - legend->width() - legend->marginRight();85 xPos = width() - paddingRight() - borderRight() - legend->width() - legend->marginRight(); 86 86 } 87 87 } else { 88 88 switch (legend->style()->textAlign()) { 89 89 case RIGHT: 90 xPos = m_width- paddingRight() - borderRight() - legend->width();90 xPos = width() - paddingRight() - borderRight() - legend->width(); 91 91 break; 92 92 case CENTER: 93 xPos = ( m_width- legend->width()) / 2;93 xPos = (width() - legend->width()) / 2; 94 94 break; 95 95 default: … … 99 99 int b = borderTop(); 100 100 int h = legend->height(); 101 legend->set Pos(xPos, max((b-h)/2, 0));102 m_height = max(b,h) + paddingTop();101 legend->setLocation(xPos, max((b-h)/2, 0)); 102 setHeight(max(b,h) + paddingTop()); 103 103 } 104 104 return legend; 105 105 } 106 106 107 Render Object* RenderFieldset::findLegend() const107 RenderBox* RenderFieldset::findLegend() const 108 108 { 109 109 for (RenderObject* legend = firstChild(); legend; legend = legend->nextSibling()) { … … 114 114 #endif 115 115 ) 116 return legend;116 return toRenderBox(legend); 117 117 } 118 118 return 0; … … 123 123 int w = width(); 124 124 int h = height() + borderTopExtra() + borderBottomExtra(); 125 Render Object* legend = findLegend();125 RenderBox* legend = findLegend(); 126 126 if (!legend) 127 127 return RenderBlock::paintBoxDecorations(paintInfo, tx, ty); 128 128 129 int yOff = (legend->y Pos() > 0) ? 0 : (legend->height() - borderTop()) / 2;130 int legendBottom = ty + legend->y Pos() + legend->height();129 int yOff = (legend->y() > 0) ? 0 : (legend->height() - borderTop()) / 2; 130 int legendBottom = ty + legend->y() + legend->height(); 131 131 h -= yOff; 132 132 ty += yOff - borderTopExtra(); … … 145 145 // Save time by not saving and restoring the GraphicsContext in the straight border case 146 146 if (!style()->hasBorderRadius()) 147 return paintBorderMinusLegend(paintInfo.context, tx, ty, w, h, style(), legend->x Pos(), legend->width(), legendBottom);147 return paintBorderMinusLegend(paintInfo.context, tx, ty, w, h, style(), legend->x(), legend->width(), legendBottom); 148 148 149 149 // We have rounded borders, create a clipping region … … 155 155 int clipHeight = max(static_cast<int>(style()->borderTopWidth()), legend->height()); 156 156 157 graphicsContext->clipOut(IntRect(tx + legend->x Pos(), clipTop,157 graphicsContext->clipOut(IntRect(tx + legend->x(), clipTop, 158 158 legend->width(), clipHeight)); 159 159 paintBorder(paintInfo.context, tx, ty, w, h, style(), true, true); … … 169 169 int w = width(); 170 170 int h = height() + borderTopExtra() + borderBottomExtra(); 171 Render Object* legend = findLegend();171 RenderBox* legend = findLegend(); 172 172 if (!legend) 173 173 return RenderBlock::paintMask(paintInfo, tx, ty); 174 174 175 int yOff = (legend->y Pos() > 0) ? 0 : (legend->height() - borderTop()) / 2;175 int yOff = (legend->y() > 0) ? 0 : (legend->height() - borderTop()) / 2; 176 176 h -= yOff; 177 177 ty += yOff - borderTopExtra(); -
trunk/WebCore/rendering/RenderFieldset.h
r40086 r40124 45 45 virtual bool stretchesToMinIntrinsicWidth() const { return true; } 46 46 47 Render Object* findLegend() const;47 RenderBox* findLegend() const; 48 48 49 49 protected: -
trunk/WebCore/rendering/RenderFileUploadControl.cpp
r40086 r40124 148 148 int RenderFileUploadControl::maxFilenameWidth() const 149 149 { 150 return max(0, contentWidth() - m_button->render er()->width() - afterButtonSpacing150 return max(0, contentWidth() - m_button->renderBox()->width() - afterButtonSpacing 151 151 - (m_fileChooser->icon() ? iconWidth + iconFilenameSpacing : 0)); 152 152 } … … 191 191 // Determine where the filename should be placed 192 192 int contentLeft = tx + borderLeft() + paddingLeft(); 193 int buttonAndIconWidth = m_button->render er()->width() + afterButtonSpacing193 int buttonAndIconWidth = m_button->renderBox()->width() + afterButtonSpacing 194 194 + (m_fileChooser->icon() ? iconWidth + iconFilenameSpacing : 0); 195 195 int textX; … … 214 214 int iconX; 215 215 if (style()->direction() == LTR) 216 iconX = contentLeft + m_button->render er()->width() + afterButtonSpacing;216 iconX = contentLeft + m_button->renderBox()->width() + afterButtonSpacing; 217 217 else 218 iconX = contentLeft + contentWidth() - m_button->render er()->width() - afterButtonSpacing - iconWidth;218 iconX = contentLeft + contentWidth() - m_button->renderBox()->width() - afterButtonSpacing - iconWidth; 219 219 220 220 // Draw the file icon -
trunk/WebCore/rendering/RenderFlexibleBox.cpp
r40086 r40124 46 46 if (!forward) { 47 47 // No choice, since we're going backwards, we have to find out the highest ordinal up front. 48 Render Object* child = box->firstChild();48 RenderBox* child = box->firstChildBox(); 49 49 while (child) { 50 50 if (child->style()->boxOrdinalGroup() > lastOrdinal) 51 51 lastOrdinal = child->style()->boxOrdinalGroup(); 52 child = child->nextSibling ();52 child = child->nextSiblingBox(); 53 53 } 54 54 } … … 62 62 } 63 63 64 Render Object* first() {64 RenderBox* first() { 65 65 reset(); 66 66 return next(); 67 67 } 68 68 69 RenderObject* next() { 70 69 RenderBox* next() { 71 70 do { 72 71 if (!current) { … … 75 74 if (currentOrdinal > lastOrdinal) 76 75 return 0; 77 current = box->firstChild ();76 current = box->firstChildBox(); 78 77 } else { 79 78 currentOrdinal--; 80 79 if (currentOrdinal == 0) 81 80 return 0; 82 current = box->lastChild ();81 current = box->lastChildBox(); 83 82 } 84 83 } 85 84 else 86 current = forward ? current->nextSibling () : current->previousSibling();85 current = forward ? current->nextSiblingBox() : current->previousSiblingBox(); 87 86 if (current && current->style()->boxOrdinalGroup() > lastOrdinal) 88 87 lastOrdinal = current->style()->boxOrdinalGroup(); … … 94 93 private: 95 94 RenderFlexibleBox* box; 96 Render Object* current;95 RenderBox* current; 97 96 bool forward; 98 97 unsigned int currentOrdinal; … … 113 112 void RenderFlexibleBox::calcHorizontalPrefWidths() 114 113 { 115 RenderObject *child = firstChild(); 116 while (child) { 114 for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) { 117 115 // positioned children don't affect the minmaxwidth 118 if (child->isPositioned() || child->style()->visibility() == COLLAPSE) { 119 child = child->nextSibling(); 116 if (child->isPositioned() || child->style()->visibility() == COLLAPSE) 120 117 continue; 121 }122 118 123 119 // A margin basically has three types: fixed, percentage, and auto (variable). … … 135 131 m_minPrefWidth += child->minPrefWidth() + margin; 136 132 m_maxPrefWidth += child->maxPrefWidth() + margin; 137 138 child = child->nextSibling();139 133 } 140 134 } … … 142 136 void RenderFlexibleBox::calcVerticalPrefWidths() 143 137 { 144 RenderObject *child = firstChild(); 145 while(child != 0) 146 { 138 for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) { 147 139 // Positioned children and collapsed children don't affect the min/max width 148 if (child->isPositioned() || child->style()->visibility() == COLLAPSE) { 149 child = child->nextSibling(); 140 if (child->isPositioned() || child->style()->visibility() == COLLAPSE) 150 141 continue; 151 }152 142 153 143 // A margin basically has three types: fixed, percentage, and auto (variable). … … 167 157 w = child->maxPrefWidth() + margin; 168 158 m_maxPrefWidth = max(w, m_maxPrefWidth); 169 170 child = child->nextSibling();171 159 } 172 160 } … … 221 209 } 222 210 223 LayoutStateMaintainer statePusher(view(), this, IntSize( m_x, m_y), hasTransform() || hasReflection());224 225 int previousWidth = m_width;226 int previousHeight = m_height;211 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), m_frameRect.y()), hasTransform() || hasReflection()); 212 213 int previousWidth = width(); 214 int previousHeight = height(); 227 215 228 216 calcWidth(); 229 217 calcHeight(); 230 m_overflowWidth = m_width;231 232 if (previousWidth != m_width || previousHeight != m_height||218 m_overflowWidth = width(); 219 220 if (previousWidth != width() || previousHeight != height() || 233 221 (parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL && 234 222 parent()->style()->boxAlign() == BSTRETCH)) 235 223 relayoutChildren = true; 236 224 237 m_height = 0;225 setHeight(0); 238 226 m_overflowHeight = 0; 239 227 m_flexingChildren = m_stretchingChildren = false; … … 254 242 layoutVerticalBox(relayoutChildren); 255 243 256 int oldHeight = m_height;244 int oldHeight = height(); 257 245 calcHeight(); 258 if (oldHeight != m_height) {246 if (oldHeight != height()) { 259 247 // If the block got expanded in size, then increase our overflowheight to match. 260 if (m_overflowHeight > m_height)248 if (m_overflowHeight > height()) 261 249 m_overflowHeight -= (borderBottom() + paddingBottom() + horizontalScrollbarHeight()); 262 if (m_overflowHeight < m_height)263 m_overflowHeight = m_height;264 } 265 if (previousHeight != m_height)250 if (m_overflowHeight < height()) 251 m_overflowHeight = height(); 252 } 253 if (previousHeight != height()) 266 254 relayoutChildren = true; 267 255 268 256 layoutPositionedObjects(relayoutChildren || isRoot()); 269 257 270 if (!isFloatingOrPositioned() && m_height== 0) {258 if (!isFloatingOrPositioned() && height() == 0) { 271 259 // We are a block with no border and padding and a computed height 272 260 // of 0. The CSS spec states that zero-height blocks collapse their margins … … 287 275 288 276 // Always ensure our overflow width is at least as large as our width. 289 if (m_overflowWidth < m_width)290 m_overflowWidth = m_width;277 if (m_overflowWidth < width()) 278 m_overflowWidth = width(); 291 279 292 280 if (!hasOverflowClip()) { 293 281 for (ShadowData* boxShadow = style()->boxShadow(); boxShadow; boxShadow = boxShadow->next) { 294 282 m_overflowLeft = min(m_overflowLeft, boxShadow->x - boxShadow->blur); 295 m_overflowWidth = max(m_overflowWidth, m_width+ boxShadow->x + boxShadow->blur);283 m_overflowWidth = max(m_overflowWidth, width() + boxShadow->x + boxShadow->blur); 296 284 m_overflowTop = min(m_overflowTop, boxShadow->y - boxShadow->blur); 297 m_overflowHeight = max(m_overflowHeight, m_height+ boxShadow->y + boxShadow->blur);285 m_overflowHeight = max(m_overflowHeight, height() + boxShadow->y + boxShadow->blur); 298 286 } 299 287 … … 333 321 bool haveFlex = false; 334 322 int remainingSpace = 0; 335 m_overflowHeight = m_height;323 m_overflowHeight = height(); 336 324 337 325 // The first walk over our kids is to find out if we have any flexible children. 338 326 FlexBoxIterator iterator(this); 339 Render Object* child = iterator.next();327 RenderBox* child = iterator.next(); 340 328 while (child) { 341 329 // Check to see if this child flexes. … … 362 350 do { 363 351 // Reset our height. 364 m_height = yPos;365 m_overflowHeight = m_height;352 setHeight(yPos); 353 m_overflowHeight = height(); 366 354 xPos = borderLeft() + paddingLeft(); 367 355 … … 401 389 402 390 // Now update our height. 403 m_height = max(yPos + maxAscent + maxDescent, m_height);391 setHeight(max(yPos + maxAscent + maxDescent, height())); 404 392 } 405 393 else 406 m_height = max(m_height, yPos + child->marginTop() + child->height() + child->marginBottom());394 setHeight(max(height(), yPos + child->marginTop() + child->height() + child->marginBottom())); 407 395 408 396 child = iterator.next(); … … 410 398 411 399 if (!iterator.first() && hasLineIfEmpty()) 412 m_height += lineHeight(true, true);400 setHeight(height() + lineHeight(true, true)); 413 401 414 m_height += toAdd;402 setHeight(height() + toAdd); 415 403 416 404 // Always make sure our overflowheight is at least our height. 417 if (m_overflowHeight < m_height)418 m_overflowHeight = m_height;405 if (m_overflowHeight < height()) 406 m_overflowHeight = height(); 419 407 420 oldHeight = m_height;408 oldHeight = height(); 421 409 calcHeight(); 422 410 423 411 relayoutChildren = false; 424 if (oldHeight != m_height)412 if (oldHeight != height()) 425 413 heightSpecified = true; 426 414 … … 446 434 // Now do a layout. 447 435 int oldChildHeight = child->height(); 448 static_cast<RenderBox*>(child)->calcHeight();436 toRenderBox(child)->calcHeight(); 449 437 if (oldChildHeight != child->height()) 450 438 child->setChildNeedsLayout(true, false); … … 479 467 480 468 m_overflowHeight = max(m_overflowHeight, childY + child->overflowHeight(false)); 481 m_overflowTop = min(m_overflowTop, child->y Pos() + child->overflowTop(false));469 m_overflowTop = min(m_overflowTop, child->y() + child->overflowTop(false)); 482 470 483 471 xPos += child->width() + child->marginRight(); … … 620 608 totalChildren--; 621 609 622 placeChild(child, child->x Pos()+offset, child->yPos());610 placeChild(child, child->x()+offset, child->y()); 623 611 child = iterator.next(); 624 612 } … … 635 623 continue; 636 624 } 637 placeChild(child, child->x Pos()+offset, child->yPos());625 placeChild(child, child->x()+offset, child->y()); 638 626 child = iterator.next(); 639 627 } … … 647 635 648 636 if (child) { 649 m_overflowLeft = min(child->x Pos() + child->overflowLeft(false), m_overflowLeft);650 651 Render Object* lastChild = child;637 m_overflowLeft = min(child->x() + child->overflowLeft(false), m_overflowLeft); 638 639 RenderBox* lastChild = child; 652 640 while ((child = iterator.next())) { 653 641 if (!child->isPositioned()) 654 642 lastChild = child; 655 643 } 656 m_overflowWidth = max(lastChild->x Pos() + lastChild->overflowWidth(false), m_overflowWidth);644 m_overflowWidth = max(lastChild->x() + lastChild->overflowWidth(false), m_overflowWidth); 657 645 } 658 646 … … 660 648 // a height change, we revert our height back to the intrinsic height before returning. 661 649 if (heightSpecified) 662 m_height = oldHeight;650 setHeight(oldHeight); 663 651 } 664 652 … … 668 656 int yPos = borderTop() + paddingTop(); 669 657 if( style()->direction() == RTL ) 670 xPos = m_width- paddingRight() - borderRight();658 xPos = width() - paddingRight() - borderRight(); 671 659 int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight(); 672 660 bool heightSpecified = false; … … 680 668 // The first walk over our kids is to find out if we have any flexible children. 681 669 FlexBoxIterator iterator(this); 682 Render Object *child = iterator.next();670 RenderBox* child = iterator.next(); 683 671 while (child) { 684 672 // Check to see if this child flexes. … … 809 797 // out within the box. 810 798 do { 811 m_height = borderTop() + paddingTop();812 int minHeight = m_height+ toAdd;813 m_overflowHeight = m_height;799 setHeight(borderTop() + paddingTop()); 800 int minHeight = height() + toAdd; 801 m_overflowHeight = height(); 814 802 815 803 child = iterator.first(); … … 829 817 } 830 818 if (child->hasStaticY()) 831 child->setStaticY( m_height);819 child->setStaticY(height()); 832 820 child = iterator.next(); 833 821 continue; … … 838 826 839 827 // Add in the child's marginTop to our height. 840 m_height += child->marginTop();828 setHeight(height() + child->marginTop()); 841 829 842 830 // Now do a layout. … … 865 853 866 854 // Place the child. 867 placeChild(child, childX, m_height);868 m_height += child->height() + child->marginBottom();855 placeChild(child, childX, height()); 856 setHeight(height() + child->height() + child->marginBottom()); 869 857 870 858 if (child->isRenderBlock()) … … 872 860 873 861 // See if this child has made our overflow need to grow. 874 m_overflowWidth = max(child->x Pos() + child->overflowWidth(false), m_overflowWidth);875 m_overflowLeft = min(child->x Pos() + child->overflowLeft(false), m_overflowLeft);862 m_overflowWidth = max(child->x() + child->overflowWidth(false), m_overflowWidth); 863 m_overflowLeft = min(child->x() + child->overflowLeft(false), m_overflowLeft); 876 864 877 865 child = iterator.next(); 878 866 } 879 867 880 yPos = m_height;868 yPos = height(); 881 869 882 870 if (!iterator.first() && hasLineIfEmpty()) 883 m_height += lineHeight(true, true);884 885 m_height += toAdd;871 setHeight(height() + lineHeight(true, true)); 872 873 setHeight(height() + toAdd); 886 874 887 875 // Negative margins can cause our height to shrink below our minimal height (border/padding). 888 876 // If this happens, ensure that the computed height is increased to the minimal height. 889 if ( m_height< minHeight)890 m_height = minHeight;877 if (height() < minHeight) 878 setHeight(minHeight); 891 879 892 880 // Always make sure our overflowheight is at least our height. 893 if (m_overflowHeight < m_height)894 m_overflowHeight = m_height;881 if (m_overflowHeight < height()) 882 m_overflowHeight = height(); 895 883 896 884 // Now we have to calc our height, so we know how much space we have remaining. 897 oldHeight = m_height;885 oldHeight = height(); 898 886 calcHeight(); 899 if (oldHeight != m_height)887 if (oldHeight != height()) 900 888 heightSpecified = true; 901 889 … … 1029 1017 remainingSpace -= (remainingSpace/totalChildren); 1030 1018 totalChildren--; 1031 placeChild(child, child->x Pos(), child->yPos()+offset);1019 placeChild(child, child->x(), child->y()+offset); 1032 1020 child = iterator.next(); 1033 1021 } … … 1044 1032 continue; 1045 1033 } 1046 placeChild(child, child->x Pos(), child->yPos()+offset);1034 placeChild(child, child->x(), child->y()+offset); 1047 1035 child = iterator.next(); 1048 1036 } … … 1056 1044 1057 1045 if (child) { 1058 m_overflowTop = min(child->y Pos() + child->overflowTop(false), m_overflowTop);1059 1060 Render Object* lastChild = child;1046 m_overflowTop = min(child->y() + child->overflowTop(false), m_overflowTop); 1047 1048 RenderBox* lastChild = child; 1061 1049 while ((child = iterator.next())) { 1062 1050 if (!child->isPositioned()) 1063 1051 lastChild = child; 1064 1052 } 1065 m_overflowHeight = max(lastChild->y Pos() + lastChild->overflowHeight(false), m_overflowHeight);1053 m_overflowHeight = max(lastChild->y() + lastChild->overflowHeight(false), m_overflowHeight); 1066 1054 } 1067 1055 … … 1069 1057 // a height change, we revert our height back to the intrinsic height before returning. 1070 1058 if (heightSpecified) 1071 m_height = oldHeight;1059 setHeight(oldHeight); 1072 1060 } 1073 1061 1074 void RenderFlexibleBox::placeChild(Render Object* child, int x, int y)1062 void RenderFlexibleBox::placeChild(RenderBox* child, int x, int y) 1075 1063 { 1076 IntRect oldRect(child->x Pos(), child->yPos() , child->width(), child->height());1064 IntRect oldRect(child->x(), child->y() , child->width(), child->height()); 1077 1065 1078 1066 // Place the child. 1079 child->set Pos(x, y);1067 child->setLocation(x, y); 1080 1068 1081 1069 // If the child moved, we have to repaint it as well as any floating/positioned … … 1086 1074 } 1087 1075 1088 int RenderFlexibleBox::allowedChildFlex(Render Object* child, bool expanding, unsigned int group)1076 int RenderFlexibleBox::allowedChildFlex(RenderBox* child, bool expanding, unsigned int group) 1089 1077 { 1090 1078 if (child->isPositioned() || child->style()->boxFlex() == 0.0f || child->style()->boxFlexGroup() != group) -
trunk/WebCore/rendering/RenderFlexibleBox.h
r40086 r40124 49 49 virtual bool isStretchingChildren() const { return m_stretchingChildren; } 50 50 51 void placeChild(Render Object* child, int x, int y);51 void placeChild(RenderBox* child, int x, int y); 52 52 53 53 protected: 54 int allowedChildFlex(Render Object* child, bool expanding, unsigned group);54 int allowedChildFlex(RenderBox* child, bool expanding, unsigned group); 55 55 56 56 bool hasMultipleLines() const { return style()->boxLines() == MULTIPLE; } -
trunk/WebCore/rendering/RenderFlow.cpp
r40086 r40124 501 501 int ow = style() ? style()->outlineSize() : 0; 502 502 if (isCompact()) 503 left -= m_x;503 left -= x(); 504 504 505 505 // We need to add in the relative position offsets of any inlines (including us) up to our … … 553 553 ASSERT(!isInlineFlow()); 554 554 if (!includeOverflowInterior && (hasOverflowClip() || hasControlClip())) 555 return includeSelf && m_width> 0 ? overflowHeight(false) : 0;556 557 int bottom = includeSelf && m_width > 0 ? m_height: 0;555 return includeSelf && width() > 0 ? overflowHeight(false) : 0; 556 557 int bottom = includeSelf && width() > 0 ? height() : 0; 558 558 if (!hasColumns()) { 559 559 // FIXME: Come up with a way to use the layer tree to avoid visiting all the kids. … … 563 563 for (RenderObject* c = firstChild(); c; c = c->nextSibling()) { 564 564 if (!c->isFloatingOrPositioned() && !c->isText() && !c->isInlineFlow()) 565 bottom = max(bottom, c->yPos() + c->lowestPosition(false));565 bottom = max(bottom, toRenderBox(c)->y() + c->lowestPosition(false)); 566 566 } 567 567 } … … 577 577 ASSERT(!isInlineFlow()); 578 578 if (!includeOverflowInterior && (hasOverflowClip() || hasControlClip())) 579 return includeSelf && m_height > 0 ? overflowWidth(false) : 0; 580 581 int right = includeSelf && m_height > 0 ? m_width : 0; 579 return includeSelf && height() > 0 ? overflowWidth(false) : 0; 580 581 int right = includeSelf && height() > 0 ? width() : 0; 582 582 583 if (!hasColumns()) { 583 584 // FIXME: Come up with a way to use the layer tree to avoid visiting all the kids. … … 586 587 // the abs div. 587 588 for (RenderObject* c = firstChild(); c; c = c->nextSibling()) { 588 if (!c->isFloatingOrPositioned() && !c->isText() && !c->isInlineFlow())589 right = max(right, c->xPos() + c->rightmostPosition(false));589 if (!c->isFloatingOrPositioned() && c->isBox() && !c->isInlineFlow()) 590 right = max(right, toRenderBox(c)->x() + c->rightmostPosition(false)); 590 591 } 591 592 } … … 601 602 ASSERT(!isInlineFlow()); 602 603 if (!includeOverflowInterior && (hasOverflowClip() || hasControlClip())) 603 return includeSelf && m_height > 0 ? overflowLeft(false) : m_width;604 605 int left = includeSelf && m_height > 0 ? 0 : m_width;604 return includeSelf && height() > 0 ? overflowLeft(false) : width(); 605 606 int left = includeSelf && height() > 0 ? 0 : width(); 606 607 if (!hasColumns()) { 607 608 // FIXME: Come up with a way to use the layer tree to avoid visiting all the kids. … … 610 611 // the abs div. 611 612 for (RenderObject* c = firstChild(); c; c = c->nextSibling()) { 612 if (!c->isFloatingOrPositioned() && !c->isText() && !c->isInlineFlow())613 left = min(left, c->xPos() + c->leftmostPosition(false));613 if (!c->isFloatingOrPositioned() && c->isBox() && !c->isInlineFlow()) 614 left = min(left, toRenderBox(c)->x() + c->leftmostPosition(false)); 614 615 } 615 616 } … … 688 689 FloatPoint absRightPoint = localToAbsoluteForContent(FloatPoint(myRight, 0)); 689 690 690 int containerRight = containingBlock()->x Pos() + containingBlockWidth();691 int containerRight = containingBlock()->x() + containingBlockWidth(); 691 692 FloatPoint absContainerPoint = localToAbsoluteForContent(FloatPoint(containerRight, 0)); 692 693 … … 720 721 721 722 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) 722 if (!curr->isText() && !curr->isListMarker()) { 723 if (!curr->isText() && !curr->isListMarker() && curr->isBox()) { 724 RenderBox* box = toRenderBox(curr); 723 725 FloatPoint pos; 724 726 // FIXME: This doesn't work correctly with transforms. … … 726 728 pos = curr->localToAbsolute(); 727 729 else 728 pos = FloatPoint(tx + curr->xPos(), ty + curr->yPos());729 curr->addFocusRingRects(graphicsContext, pos.x(), pos.y());730 pos = FloatPoint(tx + box->x(), ty + box->y()); 731 box->addFocusRingRects(graphicsContext, pos.x(), pos.y()); 730 732 } 731 733 } … … 734 736 if (isInline()) 735 737 continuation()->addFocusRingRects(graphicsContext, 736 tx - containingBlock()->x Pos() + continuation()->xPos(),737 ty - containingBlock()->y Pos() + continuation()->yPos());738 tx - containingBlock()->x() + continuation()->x(), 739 ty - containingBlock()->y() + continuation()->y()); 738 740 else 739 741 continuation()->addFocusRingRects(graphicsContext, 740 tx - x Pos() + continuation()->containingBlock()->xPos(),741 ty - y Pos() + continuation()->containingBlock()->yPos());742 tx - x() + continuation()->containingBlock()->x(), 743 ty - y() + continuation()->containingBlock()->y()); 742 744 } 743 745 } -
trunk/WebCore/rendering/RenderFrameSet.cpp
r40086 r40124 127 127 128 128 // Add in our offsets. 129 tx += m_x;130 ty += m_ y;129 tx += x(); 130 ty += m_frameRect.y(); 131 131 132 132 int rows = frameSet()->totalRows(); … … 458 458 459 459 if (!parent()->isFrameSet() && !document()->printing()) { 460 m_width = view()->viewWidth();461 m_height = view()->viewHeight();460 setWidth(view()->viewWidth()); 461 setHeight(view()->viewHeight()); 462 462 } 463 463 … … 471 471 472 472 int borderThickness = frameSet()->border(); 473 layOutAxis(m_rows, frameSet()->rowLengths(), m_height- (rows - 1) * borderThickness);474 layOutAxis(m_cols, frameSet()->colLengths(), m_width- (cols - 1) * borderThickness);473 layOutAxis(m_rows, frameSet()->rowLengths(), height() - (rows - 1) * borderThickness); 474 layOutAxis(m_cols, frameSet()->colLengths(), width() - (cols - 1) * borderThickness); 475 475 476 476 positionFrames(); … … 492 492 void RenderFrameSet::positionFrames() 493 493 { 494 Render Object* child = firstChild();494 RenderBox* child = firstChildBox(); 495 495 if (!child) 496 496 return; … … 505 505 int height = m_rows.m_sizes[r]; 506 506 for (int c = 0; c < cols; c++) { 507 child->set Pos(xPos, yPos);507 child->setLocation(xPos, yPos); 508 508 int width = m_cols.m_sizes[c]; 509 509 … … 518 518 xPos += width + borderThickness; 519 519 520 child = child->nextSibling ();520 child = child->nextSiblingBox(); 521 521 if (!child) 522 522 return; … … 526 526 527 527 // all the remaining frames are hidden to avoid ugly spurious unflowed frames 528 for (; child; child = child->nextSibling ()) {528 for (; child; child = child->nextSiblingBox()) { 529 529 child->setWidth(0); 530 530 child->setHeight(0); -
trunk/WebCore/rendering/RenderHTMLCanvas.cpp
r40086 r40124 44 44 void RenderHTMLCanvas::paintReplaced(PaintInfo& paintInfo, int tx, int ty) 45 45 { 46 IntRect rect = contentBox ();46 IntRect rect = contentBoxRect(); 47 47 rect.move(tx, ty); 48 48 static_cast<HTMLCanvasElement*>(node())->paint(paintInfo.context, rect); … … 51 51 void RenderHTMLCanvas::canvasSizeChanged() 52 52 { 53 IntSize size = static_cast<HTMLCanvasElement*>(node())->size();54 IntSize zoomedSize( size.width() * style()->effectiveZoom(), size.height() * style()->effectiveZoom());53 IntSize canvasSize = static_cast<HTMLCanvasElement*>(node())->size(); 54 IntSize zoomedSize(canvasSize.width() * style()->effectiveZoom(), canvasSize.height() * style()->effectiveZoom()); 55 55 56 if ( size == intrinsicSize())56 if (canvasSize == intrinsicSize()) 57 57 return; 58 58 59 setIntrinsicSize( size);59 setIntrinsicSize(canvasSize); 60 60 61 61 if (!prefWidthsDirty()) 62 62 setPrefWidthsDirty(true); 63 63 64 IntSize oldSize = IntSize(m_width, m_height);64 IntSize oldSize = size(); 65 65 calcWidth(); 66 66 calcHeight(); 67 if (oldSize == IntSize(m_width, m_height))67 if (oldSize == size()) 68 68 return; 69 69 -
trunk/WebCore/rendering/RenderImage.cpp
r40086 r40124 282 282 if (containingBlock()) { 283 283 // lets see if we need to relayout at all.. 284 int oldwidth = m_width;285 int oldheight = m_height;284 int oldwidth = width(); 285 int oldheight = height(); 286 286 if (!prefWidthsDirty()) 287 287 setPrefWidthsDirty(true); … … 289 289 calcHeight(); 290 290 291 if (imageSizeChanged || m_width != oldwidth || m_height!= oldheight) {291 if (imageSizeChanged || width() != oldwidth || height() != oldheight) { 292 292 shouldRepaint = false; 293 293 if (!selfNeedsLayout()) … … 295 295 } 296 296 297 m_width = oldwidth;298 m_height = oldheight;297 setWidth(oldwidth); 298 setHeight(oldheight); 299 299 } 300 300 } … … 305 305 // The image changed rect is in source image coordinates (pre-zooming), 306 306 // so map from the bounds of the image to the contentsBox. 307 repaintRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatPoint(), imageSize(1.0f)), contentBox ()));307 repaintRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatPoint(), imageSize(1.0f)), contentBoxRect())); 308 308 // Guard against too-large changed rects. 309 repaintRect.intersect(contentBox ());309 repaintRect.intersect(contentBoxRect()); 310 310 } else 311 repaintRect = contentBox ();311 repaintRect = contentBoxRect(); 312 312 313 313 repaintRectangle(repaintRect); … … 397 397 #if PLATFORM(MAC) 398 398 if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled()) 399 paintCustomHighlight(tx - m_x, ty - m_y, style()->highlight(), true);399 paintCustomHighlight(tx - x(), ty - m_frameRect.y(), style()->highlight(), true); 400 400 #endif 401 401 … … 425 425 426 426 if (inside && element()) { 427 int tx = _tx + m_x;428 int ty = _ty + m_ y;427 int tx = _tx + x(); 428 int ty = _ty + m_frameRect.y(); 429 429 430 430 HTMLMapElement* map = imageMap(); … … 491 491 { 492 492 if (imageHasRelativeWidth()) 493 if (RenderObject* cb = isPositioned() ? container() : containingBlock()) 494 setImageContainerSize(IntSize(cb->availableWidth(), cb->availableHeight())); 493 if (RenderObject* cb = isPositioned() ? container() : containingBlock()) { 494 if (cb->isBox()) 495 setImageContainerSize(IntSize(toRenderBox(cb)->availableWidth(), toRenderBox(cb)->availableHeight())); 496 } 495 497 496 498 int width; -
trunk/WebCore/rendering/RenderInline.cpp
r40086 r40124 293 293 294 294 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) { 295 if (!curr->isText()) 296 curr->absoluteRects(rects, tx + curr->xPos(), ty + curr->yPos(), false); 295 if (curr->isBox()) { 296 RenderBox* box = toRenderBox(curr); 297 curr->absoluteRects(rects, tx + box->x(), ty + box->y(), false); 298 } 297 299 } 298 300 299 301 if (continuation() && topLevel) 300 302 continuation()->absoluteRects(rects, 301 tx - containingBlock()->x Pos() + continuation()->xPos(),302 ty - containingBlock()->y Pos() + continuation()->yPos(),303 tx - containingBlock()->x() + continuation()->x(), 304 ty - containingBlock()->y() + continuation()->y(), 303 305 topLevel); 304 306 } … … 325 327 } 326 328 327 int RenderInline:: width() const329 int RenderInline::boundingBoxWidth() const 328 330 { 329 331 // Return the width of the minimal left side and the maximal right side. … … 340 342 } 341 343 342 int RenderInline:: height() const344 int RenderInline::boundingBoxHeight() const 343 345 { 344 346 // See <rdar://problem/5289721>, for an unknown reason the linked list here is sometimes inconsistent, first is non-zero and last is zero. We have been … … 386 388 // Translate the coords from the pre-anonymous block to the post-anonymous block. 387 389 RenderBlock* cb = containingBlock(); 388 int parentBlockX = cb->x Pos() + x;389 int parentBlockY = cb->y Pos() + y;390 int parentBlockX = cb->x() + x; 391 int parentBlockY = cb->y() + y; 390 392 for (RenderFlow* c = continuation(); c; c = c->continuation()) { 391 Render Object* contBlock = c;393 RenderFlow* contBlock = c; 392 394 if (c->isInline()) 393 395 contBlock = c->containingBlock(); 394 396 if (c->isInline() || c->firstChild()) 395 return c->positionForCoordinates(parentBlockX - contBlock->x Pos(), parentBlockY - contBlock->yPos());397 return c->positionForCoordinates(parentBlockX - contBlock->x(), parentBlockY - contBlock->y()); 396 398 } 397 399 -
trunk/WebCore/rendering/RenderInline.h
r40086 r40124 60 60 virtual bool requiresLayer(); 61 61 62 virtual int width() const;63 virtual int height() const;62 int boundingBoxWidth() const; 63 int boundingBoxHeight() const; 64 64 65 // used to calculate offsetWidth/Height. Overridden by inlines (RenderFlow) to return66 // the remaining width on a given line (and the height of a single line).67 65 virtual int offsetLeft() const; 68 66 virtual int offsetTop() const; 67 virtual int offsetWidth() const { return boundingBoxWidth(); } 68 virtual int offsetHeight() const { return boundingBoxHeight(); } 69 69 70 70 void absoluteRects(Vector<IntRect>&, int tx, int ty, bool topLevel = true); -
trunk/WebCore/rendering/RenderLayer.cpp
r40086 r40124 278 278 if (hasTransform) { 279 279 m_transform->reset(); 280 renderer()->style()->applyTransform(*m_transform, renderer()->borderBox ().size());280 renderer()->style()->applyTransform(*m_transform, renderer()->borderBoxRect().size()); 281 281 } 282 282 } … … 378 378 clearClipRects(); 379 379 380 int x = renderer()->x Pos();381 int y = renderer()->y Pos() - renderer()->borderTopExtra();380 int x = renderer()->x(); 381 int y = renderer()->y() - renderer()->borderTopExtra(); 382 382 383 383 if (!renderer()->isPositioned() && renderer()->parent()) { 384 384 // We must adjust our position by walking up the render tree looking for the 385 385 // nearest enclosing object with a layer. 386 Render Object* curr = renderer()->parent();386 RenderBox* curr = renderer()->parentBox(); 387 387 while (curr && !curr->hasLayer()) { 388 388 if (!curr->isTableRow()) { 389 389 // Rows and cells share the same coordinate space (that of the section). 390 390 // Omit them when computing our xpos/ypos. 391 x += curr->x Pos();392 y += curr->y Pos();391 x += curr->x(); 392 y += curr->y(); 393 393 } 394 curr = curr->parent ();394 curr = curr->parentBox(); 395 395 } 396 396 y += curr->borderTopExtra(); 397 397 if (curr->isTableRow()) { 398 398 // Put ourselves into the row coordinate space. 399 x -= curr->x Pos();400 y -= curr->y Pos();399 x -= curr->x(); 400 y -= curr->y(); 401 401 } 402 402 } … … 404 404 m_relX = m_relY = 0; 405 405 if (renderer()->isRelPositioned()) { 406 m_relX = static_cast<RenderBox*>(renderer())->relativePositionOffsetX();407 m_relY = static_cast<RenderBox*>(renderer())->relativePositionOffsetY();406 m_relX = RenderBox::toRenderBox(renderer())->relativePositionOffsetX(); 407 m_relY = RenderBox::toRenderBox(renderer())->relativePositionOffsetY(); 408 408 x += m_relX; y += m_relY; 409 409 } … … 417 417 418 418 if (renderer()->isPositioned()) { 419 IntSize offset = static_cast<RenderBox*>(renderer())->offsetForPositionedInContainer(positionedParent->renderer());419 IntSize offset = RenderBox::toRenderBox(renderer())->offsetForPositionedInContainer(positionedParent->renderer()); 420 420 x += offset.width(); 421 421 y += offset.height(); … … 424 424 parent()->subtractScrolledContentOffset(x, y); 425 425 426 setPos(x,y); 427 428 setWidth(renderer()->width()); 429 setHeight(renderer()->height() + renderer()->borderTopExtra() + renderer()->borderBottomExtra()); 426 // FIXME: We'd really like to just get rid of the concept of a layer rectangle and rely on the renderers. 427 428 setPos(x, y); 429 430 if (renderer()->isRenderInline()) { 431 RenderInline* inlineFlow = static_cast<RenderInline*>(renderer()); 432 setWidth(inlineFlow->boundingBoxWidth()); 433 setHeight(inlineFlow->boundingBoxHeight()); 434 } else { 435 setWidth(renderer()->width()); 436 setHeight(renderer()->height() + renderer()->borderTopExtra() + renderer()->borderBottomExtra()); 437 } 430 438 431 439 if (!renderer()->hasOverflowClip()) { … … 1036 1044 // This is necessary for textarea elements since the resizable layer is in the shadow content. 1037 1045 Element* element = static_cast<Element*>(renderer()->node()->shadowAncestorNode()); 1038 RenderBox* renderer = static_cast<RenderBox*>(element->renderer());1046 RenderBox* renderer = RenderBox::toRenderBox(element->renderer()); 1039 1047 1040 1048 EResize resize = renderer->style()->resize(); … … 1172 1180 bool RenderLayer::scrollbarCornerPresent() const 1173 1181 { 1174 return !scrollCornerRect(this, renderer()->borderBox ()).isEmpty();1182 return !scrollCornerRect(this, renderer()->borderBoxRect()).isEmpty(); 1175 1183 } 1176 1184 … … 1190 1198 bool hasCustomScrollbarStyle = renderer()->node()->shadowAncestorNode()->renderer()->style()->hasPseudoStyle(RenderStyle::SCROLLBAR); 1191 1199 if (hasCustomScrollbarStyle) 1192 widget = RenderScrollbar::createCustomScrollbar(this, orientation, renderer()->node()->shadowAncestorNode()->render er());1200 widget = RenderScrollbar::createCustomScrollbar(this, orientation, renderer()->node()->shadowAncestorNode()->renderBox()); 1193 1201 else 1194 1202 widget = Scrollbar::createNativeScrollbar(this, orientation, RegularScrollbar); … … 1280 1288 return; 1281 1289 1282 IntRect borderBox = renderer()->borderBox ();1290 IntRect borderBox = renderer()->borderBoxRect(); 1283 1291 IntRect scrollCorner(scrollCornerRect(this, borderBox)); 1284 1292 IntRect absBounds(borderBox.x() + tx, borderBox.y() + ty, borderBox.width(), borderBox.height()); … … 1296 1304 1297 1305 if (m_scrollCorner) 1298 m_scrollCorner->set Rect(scrollCorner);1306 m_scrollCorner->setFrameRect(scrollCorner); 1299 1307 if (m_resizer) 1300 m_resizer->set Rect(resizerCornerRect(this, borderBox));1308 m_resizer->setFrameRect(resizerCornerRect(this, borderBox)); 1301 1309 } 1302 1310 … … 1494 1502 void RenderLayer::paintScrollCorner(GraphicsContext* context, int tx, int ty, const IntRect& damageRect) 1495 1503 { 1496 IntRect cornerRect = scrollCornerRect(this, renderer()->borderBox ());1504 IntRect cornerRect = scrollCornerRect(this, renderer()->borderBoxRect()); 1497 1505 IntRect absRect = IntRect(cornerRect.x() + tx, cornerRect.y() + ty, cornerRect.width(), cornerRect.height()); 1498 1506 if (!absRect.intersects(damageRect)) … … 1517 1525 return; 1518 1526 1519 IntRect cornerRect = resizerCornerRect(this, renderer()->borderBox ());1527 IntRect cornerRect = resizerCornerRect(this, renderer()->borderBoxRect()); 1520 1528 IntRect absRect = IntRect(cornerRect.x() + tx, cornerRect.y() + ty, cornerRect.width(), cornerRect.height()); 1521 1529 if (!absRect.intersects(damageRect)) … … 1725 1733 int x = layerBounds.x(); 1726 1734 int y = layerBounds.y(); 1727 int tx = x - renderer()->x Pos();1728 int ty = y - renderer()->y Pos() + renderer()->borderTopExtra();1735 int tx = x - renderer()->x(); 1736 int ty = y - renderer()->y() + renderer()->borderTopExtra(); 1729 1737 1730 1738 // Ensure our lists are up-to-date. … … 1949 1957 if (fgRect.contains(hitTestPoint) && 1950 1958 renderer()->hitTest(request, result, hitTestPoint, 1951 layerBounds.x() - renderer()->x Pos(),1952 layerBounds.y() - renderer()->y Pos() + renderer()->borderTopExtra(),1959 layerBounds.x() - renderer()->x(), 1960 layerBounds.y() - renderer()->y() + renderer()->borderTopExtra(), 1953 1961 HitTestDescendants)) { 1954 1962 // For positioned generated content, we might still not have a … … 1979 1987 if (bgRect.contains(hitTestPoint) && 1980 1988 renderer()->hitTest(request, result, hitTestPoint, 1981 layerBounds.x() - renderer()->x Pos(),1982 layerBounds.y() - renderer()->y Pos() + renderer()->borderTopExtra(),1989 layerBounds.x() - renderer()->x(), 1990 layerBounds.y() - renderer()->y() + renderer()->borderTopExtra(), 1983 1991 HitTestSelf)) { 1984 1992 if (!result.innerNode() || !result.innerNonSharedNode()) { … … 2123 2131 int y = 0; 2124 2132 convertToLayerCoords(rootLayer, x, y); 2125 layerBounds = IntRect(x, y,width(),height());2133 layerBounds = IntRect(x, y, width(), height()); 2126 2134 2127 2135 // Update the clip rects that will be passed to child layers. … … 2218 2226 for (InlineRunBox* curr = firstBox->nextLineBox(); curr; curr = curr->nextLineBox()) 2219 2227 left = min(left, curr->xPos()); 2220 result = IntRect(m_x + left, m_y + (top - renderer()->y Pos()), width(), bottom - top);2228 result = IntRect(m_x + left, m_y + (top - renderer()->y()), width(), bottom - top); 2221 2229 } else if (renderer()->isTableRow()) { 2222 2230 // Our bounding box is just the union of all of our cells' border/overflow rects. 2223 2231 for (RenderObject* child = renderer()->firstChild(); child; child = child->nextSibling()) { 2224 2232 if (child->isTableCell()) { 2225 IntRect bbox = child->borderBox();2233 IntRect bbox = RenderBox::toRenderBox(child)->borderBoxRect(); 2226 2234 bbox.move(0, child->borderTopExtra()); 2227 2235 result.unite(bbox); … … 2237 2245 result = renderer()->maskClipRect(); 2238 2246 else { 2239 IntRect bbox = renderer()->borderBox ();2247 IntRect bbox = renderer()->borderBoxRect(); 2240 2248 result = bbox; 2241 2249 IntRect overflowRect = renderer()->overflowRect(false); … … 2245 2253 2246 2254 // We have to adjust the x/y of this result so that it is in the coordinate space of the layer. 2247 // We also have to add in borderTopExtra here, since borderBox(), in order to play well with methods like2255 // We also have to add in intrinsicPaddingTop here, since borderBoxRect(), in order to play well with methods like 2248 2256 // floatRect that deal with child content, uses an origin of (0,0) that is at the child content box (so 2249 2257 // border box returns a y coord of -borderTopExtra(). The layer, however, uses the outer box. This is all -
trunk/WebCore/rendering/RenderListBox.cpp
r40086 r40124 225 225 226 226 int itemHeight = RenderListBox::itemHeight(); 227 m_height = itemHeight * size() - rowSpacing + toAdd;227 setHeight(itemHeight * size() - rowSpacing + toAdd); 228 228 229 229 RenderBlock::calcHeight(); … … 582 582 IntRect RenderListBox::controlClipRect(int tx, int ty) const 583 583 { 584 IntRect clipRect = contentBox ();584 IntRect clipRect = contentBoxRect(); 585 585 clipRect.move(tx, ty); 586 586 return clipRect; -
trunk/WebCore/rendering/RenderListItem.cpp
r40086 r40124 236 236 { 237 237 if (m_marker && !m_marker->isInside() && m_marker->inlineBoxWrapper()) { 238 int markerOldX = m_marker->x Pos();238 int markerOldX = m_marker->x(); 239 239 int yOffset = 0; 240 240 int xOffset = 0; 241 for (Render Object* o = m_marker->parent(); o != this; o = o->parent()) {242 yOffset += o->y Pos();243 xOffset += o->x Pos();241 for (RenderBox* o = m_marker->parentBox(); o != this; o = o->parentBox()) { 242 yOffset += o->y(); 243 xOffset += o->x(); 244 244 } 245 245 … … 268 268 if (adjustOverflow) { 269 269 IntRect markerRect(markerXPos + xOffset, yOffset, m_marker->width(), m_marker->height()); 270 Render Object* o = m_marker;270 RenderBox* o = m_marker; 271 271 do { 272 o = o->parent ();272 o = o->parentBox(); 273 273 if (o->isRenderBlock()) 274 274 static_cast<RenderBlock*>(o)->addVisualOverflow(markerRect); 275 markerRect.move(-o->x Pos(), -o->yPos());275 markerRect.move(-o->x(), -o->y()); 276 276 } while (o != this); 277 277 } … … 281 281 void RenderListItem::paint(PaintInfo& paintInfo, int tx, int ty) 282 282 { 283 if (! m_height)283 if (!height()) 284 284 return; 285 285 -
trunk/WebCore/rendering/RenderListMarker.cpp
r40086 r40124 531 531 marker.move(tx, ty); 532 532 533 IntRect box(tx + m_x, ty + m_y, m_width, m_height);533 IntRect box(tx + x(), ty + m_frameRect.y(), width(), height()); 534 534 535 535 if (box.y() > paintInfo.rect.bottom() || box.y() + box.height() < paintInfo.rect.y()) … … 637 637 638 638 if (isImage()) { 639 m_width = m_image->imageSize(this, style()->effectiveZoom()).width();640 m_height = m_image->imageSize(this, style()->effectiveZoom()).height();639 setWidth(m_image->imageSize(this, style()->effectiveZoom()).width()); 640 setHeight(m_image->imageSize(this, style()->effectiveZoom()).height()); 641 641 } else { 642 m_width = minPrefWidth();643 m_height = style()->font().height();642 setWidth(minPrefWidth()); 643 setHeight(style()->font().height()); 644 644 } 645 645 … … 662 662 return; 663 663 664 if ( m_width != m_image->imageSize(this, style()->effectiveZoom()).width() || m_height!= m_image->imageSize(this, style()->effectiveZoom()).height() || m_image->errorOccurred())664 if (width() != m_image->imageSize(this, style()->effectiveZoom()).width() || height() != m_image->imageSize(this, style()->effectiveZoom()).height() || m_image->errorOccurred()) 665 665 setNeedsLayoutAndPrefWidthsRecalc(); 666 666 else … … 830 830 { 831 831 if (isImage()) 832 return IntRect( m_x, m_y, m_image->imageSize(this, style()->effectiveZoom()).width(), m_image->imageSize(this, style()->effectiveZoom()).height());832 return IntRect(x(), m_frameRect.y(), m_image->imageSize(this, style()->effectiveZoom()).width(), m_image->imageSize(this, style()->effectiveZoom()).height()); 833 833 834 834 switch (style()->listStyleType()) { … … 840 840 int ascent = font.ascent(); 841 841 int bulletWidth = (ascent * 2 / 3 + 1) / 2; 842 return IntRect( m_x + 1, m_y+ 3 * (ascent - ascent * 2 / 3) / 2, bulletWidth, bulletWidth);842 return IntRect(x() + 1, m_frameRect.y() + 3 * (ascent - ascent * 2 / 3) / 2, bulletWidth, bulletWidth); 843 843 } 844 844 case LNONE: … … 867 867 const UChar periodSpace[2] = { '.', ' ' }; 868 868 int periodSpaceWidth = font.width(TextRun(periodSpace, 2)); 869 return IntRect( m_x, m_y+ font.ascent(), itemWidth + periodSpaceWidth, font.height());869 return IntRect(x(), m_frameRect.y() + font.ascent(), itemWidth + periodSpaceWidth, font.height()); 870 870 } 871 871 … … 890 890 891 891 RootInlineBox* root = inlineBoxWrapper()->root(); 892 IntRect rect(0, root->selectionTop() - y Pos(), width(), root->selectionHeight());892 IntRect rect(0, root->selectionTop() - y(), width(), root->selectionHeight()); 893 893 894 894 if (clipToVisibleContent) -
trunk/WebCore/rendering/RenderMarquee.cpp
r40086 r40124 106 106 int RenderMarquee::computePosition(EMarqueeDirection dir, bool stopAtContentEdge) 107 107 { 108 Render Object* o = m_layer->renderer();108 RenderBox* o = m_layer->renderer(); 109 109 RenderStyle* s = o->style(); 110 110 if (isHorizontal()) { -
trunk/WebCore/rendering/RenderMedia.cpp
r40086 r40124 106 106 void RenderMedia::layout() 107 107 { 108 IntSize oldSize = contentBox ().size();108 IntSize oldSize = contentBoxRect().size(); 109 109 110 110 RenderReplaced::layout(); 111 111 112 Render Object* controlsRenderer = m_controlsShadowRoot ? m_controlsShadowRoot->renderer() : 0;112 RenderBox* controlsRenderer = m_controlsShadowRoot ? m_controlsShadowRoot->renderBox() : 0; 113 113 if (!controlsRenderer) 114 114 return; 115 IntSize newSize = contentBox ().size();115 IntSize newSize = contentBoxRect().size(); 116 116 if (newSize != oldSize || controlsRenderer->needsLayout()) { 117 controlsRenderer->set Pos(borderLeft() + paddingLeft(), borderTop() + paddingTop());117 controlsRenderer->setLocation(borderLeft() + paddingLeft(), borderTop() + paddingTop()); 118 118 controlsRenderer->style()->setHeight(Length(newSize.height(), Fixed)); 119 119 controlsRenderer->style()->setWidth(Length(newSize.width(), Fixed)); … … 441 441 return bottom; 442 442 443 return max(bottom, m_controlsShadowRoot->render er()->yPos() + m_controlsShadowRoot->renderer()->lowestPosition(includeOverflowInterior, includeSelf));443 return max(bottom, m_controlsShadowRoot->renderBox()->y() + m_controlsShadowRoot->renderer()->lowestPosition(includeOverflowInterior, includeSelf)); 444 444 } 445 445 … … 450 450 return right; 451 451 452 return max(right, m_controlsShadowRoot->render er()->xPos() + m_controlsShadowRoot->renderer()->rightmostPosition(includeOverflowInterior, includeSelf));452 return max(right, m_controlsShadowRoot->renderBox()->x() + m_controlsShadowRoot->renderer()->rightmostPosition(includeOverflowInterior, includeSelf)); 453 453 } 454 454 … … 459 459 return left; 460 460 461 return min(left, m_controlsShadowRoot->render er()->xPos() + m_controlsShadowRoot->renderer()->leftmostPosition(includeOverflowInterior, includeSelf));461 return min(left, m_controlsShadowRoot->renderBox()->x() + m_controlsShadowRoot->renderer()->leftmostPosition(includeOverflowInterior, includeSelf)); 462 462 } 463 463 -
trunk/WebCore/rendering/RenderMenuList.cpp
r40086 r40124 228 228 contentHeight()); 229 229 230 IntRect innerBox(tx + m_innerBlock->x Pos() + m_innerBlock->paddingLeft(),231 ty + m_innerBlock->y Pos() + m_innerBlock->paddingTop(),230 IntRect innerBox(tx + m_innerBlock->x() + m_innerBlock->paddingLeft(), 231 ty + m_innerBlock->y() + m_innerBlock->paddingTop(), 232 232 m_innerBlock->contentWidth(), 233 233 m_innerBlock->contentHeight()); -
trunk/WebCore/rendering/RenderObject.cpp
r40086 r40124 189 189 , m_isAnonymous(node == node->document()) 190 190 , m_isText(false) 191 , m_isBox(false) 191 192 , m_inline(true) 192 193 , m_replaced(false) … … 505 506 } 506 507 507 int RenderObject::offsetLeft() const508 {509 RenderObject* offsetPar = offsetParent();510 if (!offsetPar)511 return 0;512 int x = xPos() - offsetPar->borderLeft();513 if (!isPositioned()) {514 if (isRelPositioned())515 x += static_cast<const RenderBox*>(this)->relativePositionOffsetX();516 RenderObject* curr = parent();517 while (curr && curr != offsetPar) {518 x += curr->xPos();519 curr = curr->parent();520 }521 if (offsetPar->isBody() && !offsetPar->isRelPositioned() && !offsetPar->isPositioned())522 x += offsetPar->xPos();523 }524 return x;525 }526 527 int RenderObject::offsetTop() const528 {529 RenderObject* offsetPar = offsetParent();530 if (!offsetPar)531 return 0;532 int y = yPos() - borderTopExtra() - offsetPar->borderTop();533 if (!isPositioned()) {534 if (isRelPositioned())535 y += static_cast<const RenderBox*>(this)->relativePositionOffsetY();536 RenderObject* curr = parent();537 while (curr && curr != offsetPar) {538 if (!curr->isTableRow())539 y += curr->yPos();540 curr = curr->parent();541 }542 if (offsetPar->isBody() && !offsetPar->isRelPositioned() && !offsetPar->isPositioned())543 y += offsetPar->yPos();544 }545 return y;546 }547 548 RenderObject* RenderObject::offsetParent() const549 {550 // FIXME: It feels like this function could almost be written using containing blocks.551 if (isBody())552 return 0;553 554 bool skipTables = isPositioned() || isRelPositioned();555 float currZoom = style()->effectiveZoom();556 RenderObject* curr = parent();557 while (curr && (!curr->element() ||558 (!curr->isPositioned() && !curr->isRelPositioned() && !curr->isBody()))) {559 Node* element = curr->element();560 if (!skipTables && element) {561 bool isTableElement = element->hasTagName(tableTag) ||562 element->hasTagName(tdTag) ||563 element->hasTagName(thTag);564 565 #if ENABLE(WML)566 if (!isTableElement && element->isWMLElement())567 isTableElement = element->hasTagName(WMLNames::tableTag) ||568 element->hasTagName(WMLNames::tdTag);569 #endif570 571 if (isTableElement)572 break;573 }574 575 float newZoom = curr->style()->effectiveZoom();576 if (currZoom != newZoom)577 break;578 currZoom = newZoom;579 curr = curr->parent();580 }581 return curr;582 }583 584 508 int RenderObject::verticalScrollbarWidth() const 585 509 { … … 590 514 { 591 515 return includeHorizontalScrollbarSize() ? layer()->horizontalScrollbarHeight() : 0; 592 }593 594 // More IE extensions. clientWidth and clientHeight represent the interior of an object595 // excluding border and scrollbar.596 int RenderObject::clientWidth() const597 {598 return width() - borderLeft() - borderRight() - verticalScrollbarWidth();599 }600 601 int RenderObject::clientHeight() const602 {603 return height() - borderTop() - borderBottom() - horizontalScrollbarHeight();604 }605 606 // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the607 // object has overflow:hidden/scroll/auto specified and also has overflow.608 int RenderObject::scrollWidth() const609 {610 return hasOverflowClip() ? layer()->scrollWidth() : overflowWidth();611 }612 613 int RenderObject::scrollHeight() const614 {615 return hasOverflowClip() ? layer()->scrollHeight() : overflowHeight();616 }617 618 int RenderObject::scrollLeft() const619 {620 return hasOverflowClip() ? layer()->scrollXOffset() : 0;621 }622 623 int RenderObject::scrollTop() const624 {625 return hasOverflowClip() ? layer()->scrollYOffset() : 0;626 }627 628 void RenderObject::setScrollLeft(int newLeft)629 {630 if (hasOverflowClip())631 layer()->scrollToXOffset(newLeft);632 }633 634 void RenderObject::setScrollTop(int newTop)635 {636 if (hasOverflowClip())637 layer()->scrollToYOffset(newTop);638 516 } 639 517 … … 677 555 } 678 556 679 void RenderObject::markAllDescendantsWithFloatsForLayout(Render Object*)557 void RenderObject::markAllDescendantsWithFloatsForLayout(RenderBox*) 680 558 { 681 559 } … … 1698 1576 } 1699 1577 1700 void RenderObject::addLineBoxRects(Vector<IntRect>&, unsigned, unsigned, bool)1701 {1702 }1703 1704 void RenderObject::absoluteRects(Vector<IntRect>& rects, int tx, int ty, bool topLevel)1705 {1706 // For blocks inside inlines, we go ahead and include margins so that we run right up to the1707 // inline boxes above and below us (thus getting merged with them to form a single irregular1708 // shape).1709 RenderFlow* continuation = virtualContinuation();1710 if (topLevel && continuation) {1711 rects.append(IntRect(tx, ty - collapsedMarginTop(),1712 width(), height() + collapsedMarginTop() + collapsedMarginBottom()));1713 continuation->absoluteRects(rects,1714 tx - xPos() + continuation->containingBlock()->xPos(),1715 ty - yPos() + continuation->containingBlock()->yPos(), topLevel);1716 } else1717 rects.append(IntRect(tx, ty, width(), height() + borderTopExtra() + borderBottomExtra()));1718 }1719 1720 IntRect RenderObject::absoluteBoundingBoxRect(bool useTransforms)1721 {1722 if (useTransforms) {1723 Vector<FloatQuad> quads;1724 absoluteQuads(quads);1725 1726 size_t n = quads.size();1727 if (!n)1728 return IntRect();1729 1730 IntRect result = quads[0].enclosingBoundingBox();1731 for (size_t i = 1; i < n; ++i)1732 result.unite(quads[i].enclosingBoundingBox());1733 return result;1734 }1735 1736 FloatPoint absPos = localToAbsolute();1737 Vector<IntRect> rects;1738 absoluteRects(rects, absPos.x(), absPos.y());1739 1740 size_t n = rects.size();1741 if (!n)1742 return IntRect();1743 1744 IntRect result = rects[0];1745 for (size_t i = 1; i < n; ++i)1746 result.unite(rects[i]);1747 return result;1748 }1749 1750 void RenderObject::collectAbsoluteLineBoxQuads(Vector<FloatQuad>&, unsigned, unsigned, bool)1751 {1752 }1753 1754 void RenderObject::absoluteQuads(Vector<FloatQuad>& quads, bool topLevel)1755 {1756 // For blocks inside inlines, we go ahead and include margins so that we run right up to the1757 // inline boxes above and below us (thus getting merged with them to form a single irregular1758 // shape).1759 RenderFlow* continuation = virtualContinuation();1760 if (topLevel && continuation) {1761 FloatRect localRect(0, -collapsedMarginTop(),1762 width(), height() + collapsedMarginTop() + collapsedMarginBottom());1763 quads.append(localToAbsoluteQuad(localRect));1764 continuation->absoluteQuads(quads, topLevel);1765 } else1766 quads.append(localToAbsoluteQuad(FloatRect(0, 0, width(), height() + borderTopExtra() + borderBottomExtra())));1767 }1768 1769 void RenderObject::addAbsoluteRectForLayer(IntRect& result)1770 {1771 if (hasLayer())1772 result.unite(absoluteBoundingBoxRect());1773 for (RenderObject* current = firstChild(); current; current = current->nextSibling())1774 current->addAbsoluteRectForLayer(result);1775 }1776 1777 IntRect RenderObject::paintingRootRect(IntRect& topLevelRect)1778 {1779 IntRect result = absoluteBoundingBoxRect();1780 topLevelRect = result;1781 for (RenderObject* current = firstChild(); current; current = current->nextSibling())1782 current->addAbsoluteRectForLayer(result);1783 return result;1784 }1785 1786 1578 void RenderObject::addPDFURLRect(GraphicsContext* context, const IntRect& rect) 1787 1579 { … … 1797 1589 } 1798 1590 1799 1800 void RenderObject::addFocusRingRects(GraphicsContext* graphicsContext, int tx, int ty)1801 {1802 // For blocks inside inlines, we go ahead and include margins so that we run right up to the1803 // inline boxes above and below us (thus getting merged with them to form a single irregular1804 // shape).1805 RenderFlow* continuation = virtualContinuation();1806 if (continuation) {1807 graphicsContext->addFocusRingRect(IntRect(tx, ty - collapsedMarginTop(), width(), height() + collapsedMarginTop() + collapsedMarginBottom()));1808 continuation->addFocusRingRects(graphicsContext,1809 tx - xPos() + continuation->containingBlock()->xPos(),1810 ty - yPos() + continuation->containingBlock()->yPos());1811 } else1812 graphicsContext->addFocusRingRect(IntRect(tx, ty, width(), height()));1813 }1814 1815 1591 void RenderObject::paintOutline(GraphicsContext* graphicsContext, int tx, int ty, int w, int h, const RenderStyle* style) 1816 1592 { … … 1819 1595 1820 1596 int ow = style->outlineWidth(); 1821 1822 1597 EBorderStyle os = style->outlineStyle(); 1823 1598 … … 1863 1638 drawBorder(graphicsContext, tx - ow, ty + h, tx + w + ow, ty + h + ow, 1864 1639 BSBottom, Color(oc), style->color(), os, ow, ow); 1640 } 1641 1642 void RenderObject::addLineBoxRects(Vector<IntRect>&, unsigned, unsigned, bool) 1643 { 1644 } 1645 1646 IntRect RenderObject::absoluteBoundingBoxRect(bool useTransforms) 1647 { 1648 if (useTransforms) { 1649 Vector<FloatQuad> quads; 1650 absoluteQuads(quads); 1651 1652 size_t n = quads.size(); 1653 if (!n) 1654 return IntRect(); 1655 1656 IntRect result = quads[0].enclosingBoundingBox(); 1657 for (size_t i = 1; i < n; ++i) 1658 result.unite(quads[i].enclosingBoundingBox()); 1659 return result; 1660 } 1661 1662 FloatPoint absPos = localToAbsolute(); 1663 Vector<IntRect> rects; 1664 absoluteRects(rects, absPos.x(), absPos.y()); 1665 1666 size_t n = rects.size(); 1667 if (!n) 1668 return IntRect(); 1669 1670 IntRect result = rects[0]; 1671 for (size_t i = 1; i < n; ++i) 1672 result.unite(rects[i]); 1673 return result; 1674 } 1675 1676 void RenderObject::addAbsoluteRectForLayer(IntRect& result) 1677 { 1678 if (hasLayer()) 1679 result.unite(absoluteBoundingBoxRect()); 1680 for (RenderObject* current = firstChild(); current; current = current->nextSibling()) 1681 current->addAbsoluteRectForLayer(result); 1682 } 1683 1684 IntRect RenderObject::paintingRootRect(IntRect& topLevelRect) 1685 { 1686 IntRect result = absoluteBoundingBoxRect(); 1687 topLevelRect = result; 1688 for (RenderObject* current = firstChild(); current; current = current->nextSibling()) 1689 current->addAbsoluteRectForLayer(result); 1690 return result; 1865 1691 } 1866 1692 … … 2558 2384 // aren't we'll get the root of our little subtree (most likely 2559 2385 // we'll just return 0). 2386 // FIXME: The definition of view() has changed to not crawl up the render tree. It might 2387 // be safe now to use it. 2560 2388 while (o && o->parent() && !(o->hasTransform() && o->isRenderBlock())) 2561 2389 o = o->parent(); … … 2597 2425 2598 2426 if (outermostBlock) 2599 outermostBlock->markAllDescendantsWithFloatsForLayout( this);2427 outermostBlock->markAllDescendantsWithFloatsForLayout(RenderBox::toRenderBox(this)); 2600 2428 } 2601 2429 … … 2604 2432 for (p = parent(); p; p = p->parent()) { 2605 2433 if (p->isRenderBlock()) 2606 static_cast<RenderBlock*>(p)->removePositionedObject( this);2434 static_cast<RenderBlock*>(p)->removePositionedObject(RenderBox::toRenderBox(this)); 2607 2435 } 2608 2436 } … … 2623 2451 RenderCounter::destroyCounterNodes(this); 2624 2452 2625 if (AXObjectCache::accessibilityEnabled()) 2453 if (AXObjectCache::accessibilityEnabled()) { 2454 document()->axObjectCache()->childrenChanged(this->parent()); 2626 2455 document()->axObjectCache()->remove(this); 2627 2456 } 2628 2457 animation()->cancelAnimations(this); 2629 2458 … … 2735 2564 // We're in the continuation of a split inline. Adjust our local point to be in the coordinate space 2736 2565 // of the principal renderer's containing block. This will end up being the innerNonSharedNode. 2737 Render Object* firstBlock = node->renderer()->containingBlock();2566 RenderBlock* firstBlock = node->renderer()->containingBlock(); 2738 2567 2739 2568 // Get our containing block. 2740 Render Object* block = this;2569 RenderBox* block = RenderBox::toRenderBox(this); 2741 2570 if (isInline()) 2742 2571 block = containingBlock(); 2743 2572 2744 localPoint.move(block->x Pos() - firstBlock->xPos(), block->yPos() - firstBlock->yPos());2573 localPoint.move(block->x() - firstBlock->x(), block->y() - firstBlock->y()); 2745 2574 } 2746 2575 … … 3001 2830 { 3002 2831 // Convert the style regions to absolute coordinates. 3003 if (style()->visibility() != VISIBLE )2832 if (style()->visibility() != VISIBLE || !isBox()) 3004 2833 return; 2834 2835 RenderBox* box = RenderBox::toRenderBox(this); 3005 2836 3006 2837 const Vector<StyleDashboardRegion>& styleRegions = style()->dashboardRegions(); … … 3009 2840 StyleDashboardRegion styleRegion = styleRegions[i]; 3010 2841 3011 int w = width();3012 int h = height();2842 int w = box->width(); 2843 int h = box->height(); 3013 2844 3014 2845 DashboardRegionValue region; … … 3130 2961 } 3131 2962 3132 IntRect RenderObject::contentBox() const3133 {3134 return IntRect(borderLeft() + paddingLeft(), borderTop() + paddingTop(),3135 contentWidth(), contentHeight());3136 }3137 3138 IntRect RenderObject::absoluteContentBox() const3139 {3140 IntRect rect = contentBox();3141 FloatPoint absPos = localToAbsoluteForContent(FloatPoint());3142 rect.move(absPos.x(), absPos.y());3143 return rect;3144 }3145 3146 FloatQuad RenderObject::absoluteContentQuad() const3147 {3148 IntRect rect = contentBox();3149 return localToAbsoluteQuad(FloatRect(rect));3150 }3151 3152 2963 void RenderObject::adjustRectForOutlineAndShadow(IntRect& rect) const 3153 2964 { … … 3175 2986 } 3176 2987 3177 IntRect RenderObject::absoluteOutlineBounds() const3178 {3179 IntRect box = borderBox();3180 adjustRectForOutlineAndShadow(box);3181 3182 FloatQuad absOutlineQuad = localToAbsoluteQuad(FloatRect(box));3183 box = absOutlineQuad.enclosingBoundingBox();3184 box.move(view()->layoutDelta());3185 3186 return box;3187 }3188 3189 2988 bool RenderObject::isScrollable() const 3190 2989 { … … 3203 3002 } 3204 3003 3205 IntRect RenderObject::reflectionBox() const3206 {3207 IntRect result;3208 if (!m_style->boxReflect())3209 return result;3210 IntRect box = borderBox();3211 result = box;3212 switch (m_style->boxReflect()->direction()) {3213 case ReflectionBelow:3214 result.move(0, box.height() + reflectionOffset());3215 break;3216 case ReflectionAbove:3217 result.move(0, -box.height() - reflectionOffset());3218 break;3219 case ReflectionLeft:3220 result.move(-box.width() - reflectionOffset(), 0);3221 break;3222 case ReflectionRight:3223 result.move(box.width() + reflectionOffset(), 0);3224 break;3225 }3226 return result;3227 }3228 3229 int RenderObject::reflectionOffset() const3230 {3231 if (!m_style->boxReflect())3232 return 0;3233 if (m_style->boxReflect()->direction() == ReflectionLeft || m_style->boxReflect()->direction() == ReflectionRight)3234 return m_style->boxReflect()->offset().calcValue(borderBox().width());3235 return m_style->boxReflect()->offset().calcValue(borderBox().height());3236 }3237 3238 IntRect RenderObject::reflectedRect(const IntRect& r) const3239 {3240 if (!m_style->boxReflect())3241 return IntRect();3242 3243 IntRect box = borderBox();3244 IntRect result = r;3245 switch (m_style->boxReflect()->direction()) {3246 case ReflectionBelow:3247 result.setY(box.bottom() + reflectionOffset() + (box.bottom() - r.bottom()));3248 break;3249 case ReflectionAbove:3250 result.setY(box.y() - reflectionOffset() - box.height() + (box.bottom() - r.bottom()));3251 break;3252 case ReflectionLeft:3253 result.setX(box.x() - reflectionOffset() - box.width() + (box.right() - r.right()));3254 break;3255 case ReflectionRight:3256 result.setX(box.right() + reflectionOffset() + (box.right() - r.right()));3257 break;3258 }3259 return result;3260 }3261 3262 3004 #if ENABLE(SVG) 3263 3005 … … 3269 3011 TransformationMatrix RenderObject::localTransform() const 3270 3012 { 3271 return TransformationMatrix( 1, 0, 0, 1, xPos(), yPos());3013 return TransformationMatrix(); 3272 3014 } 3273 3015 -
trunk/WebCore/rendering/RenderObject.h
r40086 r40124 51 51 class RenderArena; 52 52 class RenderBlock; 53 class RenderBox; 53 54 class RenderFlow; 54 55 class RenderFrameSet; … … 330 331 bool isRelPositioned() const { return m_relPositioned; } // relative positioning 331 332 bool isText() const { return m_isText; } 333 bool isBox() const { return m_isBox; } 332 334 bool isInline() const { return m_inline; } // inline object 333 335 bool isCompact() const { return style()->display() == COMPACT; } // compact object … … 371 373 bool hasTransform() const { return m_hasTransform; } 372 374 bool hasMask() const { return style() && style()->hasMask(); } 373 virtual IntRect maskClipRect() { return borderBox(); }374 375 375 376 private: … … 403 404 RenderObject* hoverAncestor() const; 404 405 405 virtual void markAllDescendantsWithFloatsForLayout(Render Object* floatToRemove = 0);406 virtual void markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove = 0); 406 407 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObject* newRoot = 0); 407 408 void setNeedsLayout(bool b, bool markParents = true); … … 423 424 void setInline(bool b = true) { m_inline = b; } 424 425 void setHasBoxDecorations(bool b = true) { m_paintBackground = b; } 425 void setRenderText() { m_isText = true; } 426 void setIsText() { m_isText = true; } 427 void setIsBox() { m_isBox = true; } 426 428 void setReplaced(bool b = true) { m_replaced = b; } 427 429 void setHasOverflowClip(bool b = true) { m_hasOverflowClip = b; } … … 480 482 void paintBorder(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, bool begin = true, bool end = true); 481 483 bool paintNinePieceImage(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver); 482 void paintOutline(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*);483 484 void paintBoxShadow(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, bool begin = true, bool end = true); 484 485 … … 520 521 virtual void updateFromElement() { } 521 522 522 // Block flows subclass availableWidth to handle multi column layout (shrinking the width available to children when laying out.)523 virtual int availableWidth() const { return contentWidth(); }524 525 virtual int availableHeight() const { return 0; }526 527 523 virtual void updateWidgetPosition(); 528 524 … … 560 556 // return just the height of the containing block 561 557 virtual int containingBlockHeight() const; 562 563 // content area (box minus padding/border)564 IntRect contentBox() const;565 // absolute coords of content area. Ignores transforms.566 IntRect absoluteContentBox() const;567 // content rect converted to absolute coords, taking transforms into account568 FloatQuad absoluteContentQuad() const;569 570 int contentWidth() const { return clientWidth() - paddingLeft() - paddingRight(); }571 int contentHeight() const { return clientHeight() - paddingTop() - paddingBottom(); }572 558 573 559 // used by flexible boxes to impose a flexed width/height override … … 577 563 virtual void setOverrideSize(int /*overrideSize*/) { } 578 564 579 // relative to parent node580 virtual void setPos(int /*xPos*/, int /*yPos*/) { }581 virtual void setWidth(int /*width*/) { }582 virtual void setHeight(int /*height*/) { }583 virtual void setRect(const IntRect& rect) { setPos(rect.x(), rect.y()); setWidth(rect.width()); setHeight(rect.height()); }584 585 virtual int xPos() const { return 0; }586 virtual int yPos() const { return 0; }587 588 565 // Convert the given local point to absolute coordinates 589 566 // FIXME: Temporary. If useTransforms is true, take transforms into account. Eventually localToAbsolute() will always be transform-aware. … … 591 568 virtual FloatPoint absoluteToLocal(FloatPoint, bool fixed = false, bool useTransforms = false) const; 592 569 593 // This function is used to deal with the extra top space that can occur in table cells (called borderTopExtra).570 // This function is used to deal with the extra top space that can occur in table cells (called intrinsicPaddingTop). 594 571 // The children of the cell do not factor this space in, so we have to add it in. Any code that wants to 595 572 // accurately deal with the contents of a cell must call this function instad of absolutePosition. … … 605 582 // Return the offset from the container() renderer (excluding transforms) 606 583 virtual IntSize offsetFromContainer(RenderObject*) const; 607 608 // width and height are without margins but include paddings and borders609 virtual int width() const { return 0; }610 virtual int height() const { return 0; }611 612 virtual IntRect borderBox() const { return IntRect(0, 0, width(), height()); }613 // Bounds of the outline box in absolute coords. Respects transforms614 IntRect absoluteOutlineBounds() const;615 616 // The height of a block when you include normal flow overflow spillage out of the bottom617 // of the block (e.g., a <div style="height:25px"> that has a 100px tall image inside618 // it would have an overflow height of borderTop() + paddingTop() + 100px.619 virtual int overflowHeight(bool /*includeInterior*/ = true) const { return height(); }620 virtual int overflowWidth(bool /*includeInterior*/ = true) const { return width(); }621 virtual void setOverflowHeight(int) { }622 virtual void setOverflowWidth(int) { }623 virtual int overflowLeft(bool /*includeInterior*/ = true) const { return 0; }624 virtual int overflowTop(bool /*includeInterior*/ = true) const { return 0; }625 virtual IntRect overflowRect(bool /*includeInterior*/ = true) const { return borderBox(); }626 627 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlines (RenderFlow)628 // to return the remaining width on a given line (and the height of a single line).629 virtual int offsetWidth() const { return width(); }630 virtual int offsetHeight() const { return height() + borderTopExtra() + borderBottomExtra(); }631 632 // IE extensions. Also supported by Gecko. We override in render flow to get the633 // left and top correct. -dwh634 virtual int offsetLeft() const;635 virtual int offsetTop() const;636 virtual RenderObject* offsetParent() const;637 638 // More IE extensions. clientWidth and clientHeight represent the interior of an object639 // excluding border and scrollbar. clientLeft/Top are just the borderLeftWidth and borderTopWidth.640 int clientLeft() const { return borderLeft(); }641 int clientTop() const { return borderTop(); }642 int clientWidth() const;643 int clientHeight() const;644 645 // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the646 // object has overflow:hidden/scroll/auto specified and also has overflow.647 // scrollLeft/Top return the current scroll position. These methods are virtual so that objects like648 // textareas can scroll shadow content (but pretend that they are the objects that are649 // scrolling).650 virtual int scrollLeft() const;651 virtual int scrollTop() const;652 virtual int scrollWidth() const;653 virtual int scrollHeight() const;654 virtual void setScrollLeft(int);655 virtual void setScrollTop(int);656 584 657 585 virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f); … … 690 618 virtual int paddingRight() const; 691 619 620 virtual int borderTopExtra() const { return 0; } 621 virtual int borderBottomExtra() const { return 0; } 622 692 623 virtual int borderTop() const { return style()->borderTopWidth(); } 693 624 virtual int borderBottom() const { return style()->borderBottomWidth(); } 694 virtual int borderTopExtra() const { return 0; }695 virtual int borderBottomExtra() const { return 0; }696 625 virtual int borderLeft() const { return style()->borderLeftWidth(); } 697 626 virtual int borderRight() const { return style()->borderRightWidth(); } 698 627 699 628 virtual void addLineBoxRects(Vector<IntRect>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false); 700 701 virtual void absoluteRects(Vector<IntRect>&, int tx, int ty, bool topLevel = true);629 630 virtual void absoluteRects(Vector<IntRect>&, int, int, bool = true) { } 702 631 // FIXME: useTransforms should go away eventually 703 632 IntRect absoluteBoundingBoxRect(bool useTransforms = false); 704 633 705 634 // Build an array of quads in absolute coords for line boxes 706 virtual void collectAbsoluteLineBoxQuads(Vector<FloatQuad>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false);707 virtual void absoluteQuads(Vector<FloatQuad>&, bool topLevel = true);635 virtual void collectAbsoluteLineBoxQuads(Vector<FloatQuad>&, unsigned /*startOffset*/ = 0, unsigned /*endOffset*/ = UINT_MAX, bool /*useSelectionHeight*/ = false) { }; 636 virtual void absoluteQuads(Vector<FloatQuad>&, bool /*topLevel*/ = true) { }; 708 637 709 638 // the rect that will be painted if this object is passed as the paintingRoot 710 639 IntRect paintingRootRect(IntRect& topLevelRect); 711 712 void addPDFURLRect(GraphicsContext*, const IntRect&);713 714 virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);715 640 716 641 virtual int minPrefWidth() const { return 0; } … … 757 682 // coordinate space. This method deals with outlines and overflow. 758 683 virtual IntRect absoluteClippedOverflowRect(); 759 684 760 685 IntRect getAbsoluteRepaintRectWithOutline(int ow); 761 686 … … 784 709 785 710 bool hasReflection() const { return m_hasReflection; } 786 IntRect reflectionBox() const;787 int reflectionOffset() const;788 // Given a rect in the object's coordinate space, returns the corresponding rect in the reflection.789 IntRect reflectedRect(const IntRect&) const;790 711 791 712 // Applied as a "slop" to dirty rect checks during the outline painting phase's dirty-rect checks. … … 915 836 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE && style()->pointerEvents() != PE_NONE; } 916 837 838 virtual void addFocusRingRects(GraphicsContext*, int /*tx*/, int /*ty*/) { }; 839 virtual IntRect absoluteOutlineBounds() const { return IntRect(); } 840 917 841 protected: 918 842 // Overrides should call the superclass at the end … … 922 846 923 847 virtual void printBoxDecorations(GraphicsContext*, int /*x*/, int /*y*/, int /*w*/, int /*h*/, int /*tx*/, int /*ty*/) { } 848 849 void paintOutline(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*); 850 void addPDFURLRect(GraphicsContext*, const IntRect&); 924 851 925 852 virtual IntRect viewRect() const; … … 959 886 bool m_isAnonymous : 1; 960 887 bool m_isText : 1; 888 bool m_isBox : 1; 961 889 bool m_inline : 1; 962 890 bool m_replaced : 1; -
trunk/WebCore/rendering/RenderPart.cpp
r40086 r40124 89 89 return; 90 90 91 int width, height;92 91 FloatPoint absPos = localToAbsolute(); 93 92 absPos.move(borderLeft() + paddingLeft(), borderTop() + paddingTop()); 94 width = m_width- borderLeft() - borderRight() - paddingLeft() - paddingRight();95 height = m_height- borderTop() - borderBottom() - paddingTop() - paddingBottom();96 IntRect newBounds(absPos.x(), absPos.y(), w idth, height);93 int w = width() - borderLeft() - borderRight() - paddingLeft() - paddingRight(); 94 int h = height() - borderTop() - borderBottom() - paddingTop() - paddingBottom(); 95 IntRect newBounds(absPos.x(), absPos.y(), w, h); 97 96 bool boundsChanged = newBounds != m_widget->frameRect(); 98 97 if (boundsChanged) { -
trunk/WebCore/rendering/RenderPath.cpp
r40086 r40124 172 172 173 173 m_absoluteBounds = absoluteClippedOverflowRect(); 174 175 setWidth(m_absoluteBounds.width());176 setHeight(m_absoluteBounds.height());177 174 178 175 if (checkForRepaint) … … 486 483 } 487 484 485 IntRect RenderPath::absoluteOutlineBounds() const 486 { 487 IntRect result = m_absoluteBounds; 488 adjustRectForOutlineAndShadow(result); 489 return result; 490 } 491 488 492 } 489 493 -
trunk/WebCore/rendering/RenderPath.h
r40086 r40124 74 74 FloatRect drawMarkersIfNeeded(GraphicsContext*, const FloatRect&, const Path&) const; 75 75 76 virtual IntRect absoluteOutlineBounds() const; 77 76 78 private: 77 79 FloatPoint mapAbsolutePointToLocal(const FloatPoint&) const; -
trunk/WebCore/rendering/RenderReplaced.cpp
r40086 r40124 86 86 } 87 87 88 m_height = minimumReplacedHeight();88 setHeight(minimumReplacedHeight()); 89 89 90 90 calcWidth(); … … 111 111 return; 112 112 113 tx += m_x;114 ty += m_ y;113 tx += x(); 114 ty += m_frameRect.y(); 115 115 116 116 if (hasBoxDecorations() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)) … … 160 160 return false; 161 161 162 int currentTX = tx + m_x;163 int currentTY = ty + m_ y;162 int currentTX = tx + x(); 163 int currentTY = ty + m_frameRect.y(); 164 164 165 165 // Early exit if the element touches the edges. … … 216 216 } 217 217 218 VisiblePosition RenderReplaced::positionForCoordinates(int x , int y)218 VisiblePosition RenderReplaced::positionForCoordinates(int xPos, int yPos) 219 219 { 220 220 InlineBox* box = inlineBoxWrapper(); … … 229 229 int bottom = root->nextRootBox() ? root->nextRootBox()->topOverflow() : root->bottomOverflow(); 230 230 231 if (y + yPos() < top)231 if (yPos + y() < top) 232 232 return VisiblePosition(element(), caretMinOffset(), DOWNSTREAM); // coordinates are above 233 233 234 if (y + yPos() >= bottom)234 if (yPos + y() >= bottom) 235 235 return VisiblePosition(element(), caretMaxOffset(), DOWNSTREAM); // coordinates are below 236 236 237 237 if (element()) { 238 if (x <= width() / 2)238 if (xPos <= width() / 2) 239 239 return VisiblePosition(element(), 0, DOWNSTREAM); 240 240 return VisiblePosition(element(), 1, DOWNSTREAM); 241 241 } 242 242 243 return RenderBox::positionForCoordinates(x , y);243 return RenderBox::positionForCoordinates(xPos, yPos); 244 244 } 245 245 … … 276 276 277 277 RootInlineBox* root = m_inlineBoxWrapper->root(); 278 return IntRect(0, root->selectionTop() - y Pos(), width(), root->selectionHeight());278 return IntRect(0, root->selectionTop() - y(), width(), root->selectionHeight()); 279 279 } 280 280 … … 328 328 IntRect overflow; 329 329 for (ShadowData* boxShadow = style()->boxShadow(); boxShadow; boxShadow = boxShadow->next) { 330 IntRect shadow = borderBox ();330 IntRect shadow = borderBoxRect(); 331 331 shadow.move(boxShadow->x, boxShadow->y); 332 332 shadow.inflate(boxShadow->blur); … … 337 337 if (!gOverflowRectMap) 338 338 gOverflowRectMap = new OverflowRectMap(); 339 overflow.unite(borderBox ());339 overflow.unite(borderBoxRect()); 340 340 gOverflowRectMap->set(this, overflow); 341 341 m_hasOverflow = true; … … 387 387 return gOverflowRectMap->find(this)->second; 388 388 389 return borderBox ();389 return borderBoxRect(); 390 390 } 391 391 -
trunk/WebCore/rendering/RenderReplica.cpp
r40086 r40124 43 43 void RenderReplica::layout() 44 44 { 45 IntRect box = parent()->borderBox(); 46 m_x = box.x(); 47 m_y = box.y(); 48 m_width = box.width(); 49 m_height = box.height(); 45 m_frameRect = parentBox()->borderBoxRect(); 50 46 setNeedsLayout(false); 51 47 } … … 53 49 void RenderReplica::calcPrefWidths() 54 50 { 55 m_minPrefWidth = parent ()->width();51 m_minPrefWidth = parentBox()->width(); 56 52 m_maxPrefWidth = m_minPrefWidth; 57 53 setPrefWidthsDirty(false); … … 63 59 return; 64 60 65 tx += m_x;66 ty += m_ y;61 tx += x(); 62 ty += m_frameRect.y(); 67 63 68 64 if (paintInfo.phase == PaintPhaseForeground) -
trunk/WebCore/rendering/RenderSVGContainer.cpp
r40086 r40124 45 45 , m_drawsContents(true) 46 46 { 47 setReplaced(true);48 47 } 49 48 … … 432 431 } 433 432 433 IntRect RenderSVGContainer::absoluteOutlineBounds() const 434 { 435 IntRect result = m_absoluteBounds; 436 adjustRectForOutlineAndShadow(result); 437 return result; 438 } 439 434 440 } 435 441 -
trunk/WebCore/rendering/RenderSVGContainer.h
r40086 r40124 41 41 virtual RenderObject* lastChild() const { return m_lastChild; } 42 42 43 virtualint width() const { return m_width; }44 virtualint height() const { return m_height; }43 int width() const { return m_width; } 44 int height() const { return m_height; } 45 45 46 46 virtual bool canHaveChildren() const; … … 90 90 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction); 91 91 92 virtual IntRect absoluteOutlineBounds() const; 93 92 94 protected: 93 95 virtual void applyContentTransforms(PaintInfo&); -
trunk/WebCore/rendering/RenderSVGImage.cpp
r40086 r40124 148 148 149 149 // minimum height 150 m_height = errorOccurred() ? intrinsicSize().height() : 0;150 setHeight(errorOccurred() ? intrinsicSize().height() : 0); 151 151 152 152 calcWidth(); -
trunk/WebCore/rendering/RenderSVGInlineText.cpp
r40086 r40124 130 130 TransformationMatrix htmlParentCtm = root->RenderContainer::absoluteTransform(); 131 131 132 FloatRect fixedRect(narrowPrecisionToFloat(rect.x() + absPos.x() - xPos() - htmlParentCtm.e()),133 narrowPrecisionToFloat(rect.y() + absPos.y() - yPos() - htmlParentCtm.f()), rect.width(), rect.height());132 FloatRect fixedRect(narrowPrecisionToFloat(rect.x() + absPos.x() - (firstTextBox() ? firstTextBox()->xPos() : 0) - htmlParentCtm.e()), 133 narrowPrecisionToFloat(rect.y() + absPos.y() - (firstTextBox() ? firstTextBox()->yPos() : 0) - htmlParentCtm.f()), rect.width(), rect.height()); 134 134 // FIXME: broken with CSS transforms 135 135 return enclosingIntRect(absoluteTransform().mapRect(fixedRect)); … … 156 156 157 157 SVGRootInlineBox* rootBox = textBox->svgRootInlineBox(); 158 Render Object* object = rootBox ? rootBox->object() : 0;158 RenderBlock* object = rootBox ? rootBox->block() : 0; 159 159 160 160 if (!object) … … 164 164 165 165 for (SVGInlineTextBox* box = textBox; box; box = static_cast<SVGInlineTextBox*>(box->nextTextBox())) { 166 if (box->svgCharacterHitsPosition(x + object->x Pos(), y + object->yPos(), offset)) {166 if (box->svgCharacterHitsPosition(x + object->x(), y + object->y(), offset)) { 167 167 // If we're not at the end/start of the box, stop looking for other selected boxes. 168 168 if (box->direction() == LTR) { -
trunk/WebCore/rendering/RenderSVGRoot.cpp
r40086 r40124 103 103 m_absoluteBounds = absoluteClippedOverflowRect(); 104 104 SVGSVGElement* svg = static_cast<SVGSVGElement*>(element()); 105 m_width = static_cast<int>(m_width * svg->currentScale());106 m_height = static_cast<int>(m_height * svg->currentScale());105 setWidth(static_cast<int>(width() * svg->currentScale())); 106 setHeight(static_cast<int>(height() * svg->currentScale())); 107 107 108 108 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { … … 126 126 IntPoint origin; 127 127 origin.move(parentX, parentY); 128 origin.move( m_x, m_y);128 origin.move(x(), m_frameRect.y()); 129 129 origin.move(borderLeft(), borderTop()); 130 130 origin.move(paddingLeft(), paddingTop()); … … 166 166 // This should only exist for <svg> renderers 167 167 if (hasBoxDecorations() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)) 168 paintBoxDecorations(paintInfo, m_x + parentX, m_y+ parentY);168 paintBoxDecorations(paintInfo, x() + parentX, m_frameRect.y() + parentY); 169 169 170 170 if (!firstChild()) { … … 269 269 { 270 270 TransformationMatrix ctm = RenderContainer::absoluteTransform(); 271 ctm.translate( m_x, m_y);271 ctm.translate(x(), m_frameRect.y()); 272 272 SVGSVGElement* svg = static_cast<SVGSVGElement*>(element()); 273 273 ctm.scale(svg->currentScale()); … … 309 309 && style()->overflowX() == OHIDDEN 310 310 && style()->overflowY() == OHIDDEN) { 311 int tx = m_x- _tx + sx;312 int ty = m_ y- _ty + sy;311 int tx = x() - _tx + sx; 312 int ty = m_frameRect.y() - _ty + sy; 313 313 314 314 // Check if we need to do anything at all. -
trunk/WebCore/rendering/RenderSVGTSpan.cpp
r40086 r40124 28 28 29 29 #include "FloatRect.h" 30 #include "RenderBlock.h" 30 31 #include "SVGInlineTextBox.h" 31 32 #include "SVGRootInlineBox.h" … … 43 44 44 45 SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0; 45 Render Object* object = rootBox ? rootBox->object() : 0;46 RenderBox* object = rootBox ? rootBox->block() : 0; 46 47 47 48 if (!object) 48 49 return; 49 50 50 int xRef = object->x Pos() + xPos();51 int yRef = object->y Pos() + yPos();51 int xRef = object->x() + x(); 52 int yRef = object->y() + y(); 52 53 53 54 for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) { … … 63 64 64 65 SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0; 65 Render Object* object = rootBox ? rootBox->object() : 0;66 RenderBox* object = rootBox ? rootBox->block() : 0; 66 67 67 68 if (!object) 68 69 return; 69 70 70 int xRef = object->x Pos() + xPos();71 int yRef = object->y Pos() + yPos();71 int xRef = object->x() + x(); 72 int yRef = object->y() + y(); 72 73 73 74 for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) { -
trunk/WebCore/rendering/RenderSVGText.cpp
r40086 r40124 97 97 int xOffset = (int)(text->x()->getFirst().value(text)); 98 98 int yOffset = (int)(text->y()->getFirst().value(text)); 99 set Pos(xOffset, yOffset);99 setLocation(xOffset, yOffset); 100 100 101 101 calculateLocalTransform(); … … 232 232 } 233 233 234 repaintRect.move(x Pos(), yPos());234 repaintRect.move(x(), y()); 235 235 return repaintRect; 236 236 } -
trunk/WebCore/rendering/RenderSVGTextPath.cpp
r40086 r40124 27 27 28 28 #include "FloatRect.h" 29 #include "RenderBlock.h" 29 30 #include "SVGInlineTextBox.h" 30 31 #include "SVGPathElement.h" … … 83 84 84 85 SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0; 85 Render Object* object = rootBox ? rootBox->object() : 0;86 RenderBlock* object = rootBox ? rootBox->block() : 0; 86 87 87 88 if (!object) 88 89 return; 89 90 90 int xRef = object->x Pos() + xPos();91 int yRef = object->y Pos() + yPos();91 int xRef = object->x() + x(); 92 int yRef = object->y() + y(); 92 93 93 94 for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) { … … 103 104 104 105 SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0; 105 Render Object* object = rootBox ? rootBox->object() : 0;106 RenderBlock* object = rootBox ? rootBox->block() : 0; 106 107 107 108 if (!object) 108 109 return; 109 110 110 int xRef = object->x Pos() + xPos();111 int yRef = object->y Pos() + yPos();111 int xRef = object->x() + x(); 112 int yRef = object->y() + y(); 112 113 113 114 for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) { -
trunk/WebCore/rendering/RenderSVGViewportContainer.cpp
r40086 r40124 38 38 : RenderSVGContainer(node) 39 39 { 40 setReplaced(true);41 40 } 42 41 … … 160 159 && style()->overflowY() == OHIDDEN) { 161 160 // Check if we need to do anything at all. 162 IntRect overflowBox = overflowRect(false);161 IntRect overflowBox = IntRect(0, 0, width(), height()); 163 162 overflowBox.move(_tx, _ty); 164 163 TransformationMatrix ctm = RenderObject::absoluteTransform(); -
trunk/WebCore/rendering/RenderScrollbar.cpp
r40086 r40124 31 31 namespace WebCore { 32 32 33 PassRefPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, Render Object* renderer)33 PassRefPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, RenderBox* renderer) 34 34 { 35 35 return adoptRef(new RenderScrollbar(client, orientation, renderer)); 36 36 } 37 37 38 RenderScrollbar::RenderScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, Render Object* renderer)38 RenderScrollbar::RenderScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, RenderBox* renderer) 39 39 : Scrollbar(client, orientation, RegularScrollbar, RenderScrollbarTheme::renderScrollbarTheme()) 40 40 , m_owner(renderer) … … 51 51 Scrollbar::setParent(parent); 52 52 if (!parent) { 53 // Destroy all of the scrollbar's Render Objects.53 // Destroy all of the scrollbar's RenderBoxes. 54 54 updateScrollbarParts(true); 55 55 } -
trunk/WebCore/rendering/RenderScrollbar.h
r40086 r40124 33 33 namespace WebCore { 34 34 35 class Render Object;35 class RenderBox; 36 36 class RenderScrollbarPart; 37 37 class RenderStyle; … … 39 39 class RenderScrollbar : public Scrollbar { 40 40 protected: 41 RenderScrollbar(ScrollbarClient*, ScrollbarOrientation, Render Object*);41 RenderScrollbar(ScrollbarClient*, ScrollbarOrientation, RenderBox*); 42 42 43 43 public: 44 44 friend class Scrollbar; 45 static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollbarClient*, ScrollbarOrientation, Render Object*);45 static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollbarClient*, ScrollbarOrientation, RenderBox*); 46 46 virtual ~RenderScrollbar(); 47 47 … … 61 61 virtual void styleChanged(); 62 62 63 Render Object* owningRenderer() const { return m_owner; }63 RenderBox* owningRenderer() const { return m_owner; } 64 64 65 65 void paintPart(GraphicsContext*, ScrollbarPart, const IntRect&); … … 75 75 void updateScrollbarPart(ScrollbarPart, bool destroy = false); 76 76 77 Render Object* m_owner;77 RenderBox* m_owner; 78 78 HashMap<unsigned, RenderScrollbarPart*> m_parts; 79 79 }; -
trunk/WebCore/rendering/RenderScrollbarPart.cpp
r40086 r40124 46 46 void RenderScrollbarPart::layout() 47 47 { 48 set Pos(0, 0); // We don't worry about positioning ourselves. We're just determining our minimum width/height.48 setLocation(IntPoint()); // We don't worry about positioning ourselves. We're just determining our minimum width/height. 49 49 if (m_scrollbar->orientation() == HorizontalScrollbar) 50 50 layoutHorizontalPart(); … … 52 52 layoutVerticalPart(); 53 53 54 m_overflowWidth = max( m_width, m_overflowWidth);55 m_overflowHeight = max( m_height, m_overflowHeight);54 m_overflowWidth = max(width(), m_overflowWidth); 55 m_overflowHeight = max(height(), m_overflowHeight); 56 56 57 57 setNeedsLayout(false); … … 61 61 { 62 62 if (m_part == ScrollbarBGPart) { 63 m_width = m_scrollbar->width();63 setWidth(m_scrollbar->width()); 64 64 computeScrollbarHeight(); 65 65 } else { 66 66 computeScrollbarWidth(); 67 m_height = m_scrollbar->height();67 setHeight(m_scrollbar->height()); 68 68 } 69 69 } … … 73 73 if (m_part == ScrollbarBGPart) { 74 74 computeScrollbarWidth(); 75 m_height = m_scrollbar->height();75 setHeight(m_scrollbar->height()); 76 76 } else { 77 m_width = m_scrollbar->width();77 setWidth(m_scrollbar->width()); 78 78 computeScrollbarHeight(); 79 79 } … … 90 90 { 91 91 int visibleSize = m_scrollbar->owningRenderer()->width() - m_scrollbar->owningRenderer()->borderLeft() - m_scrollbar->owningRenderer()->borderRight(); 92 int w idth= calcScrollbarThicknessUsing(style()->width(), visibleSize);92 int w = calcScrollbarThicknessUsing(style()->width(), visibleSize); 93 93 int minWidth = calcScrollbarThicknessUsing(style()->minWidth(), visibleSize); 94 int maxWidth = style()->maxWidth().isUndefined() ? w idth: calcScrollbarThicknessUsing(style()->maxWidth(), visibleSize);95 m_width = max(minWidth, min(maxWidth, width));94 int maxWidth = style()->maxWidth().isUndefined() ? w : calcScrollbarThicknessUsing(style()->maxWidth(), visibleSize); 95 setWidth(max(minWidth, min(maxWidth, w))); 96 96 97 97 // Buttons and track pieces can all have margins along the axis of the scrollbar. … … 103 103 { 104 104 int visibleSize = m_scrollbar->owningRenderer()->height() - m_scrollbar->owningRenderer()->borderTop() - m_scrollbar->owningRenderer()->borderBottom(); 105 int h eight= calcScrollbarThicknessUsing(style()->height(), visibleSize);105 int h = calcScrollbarThicknessUsing(style()->height(), visibleSize); 106 106 int minHeight = calcScrollbarThicknessUsing(style()->minHeight(), visibleSize); 107 int maxHeight = style()->maxHeight().isUndefined() ? h eight: calcScrollbarThicknessUsing(style()->maxHeight(), visibleSize);108 m_height = max(minHeight, min(maxHeight, height));107 int maxHeight = style()->maxHeight().isUndefined() ? h : calcScrollbarThicknessUsing(style()->maxHeight(), visibleSize); 108 setHeight(max(minHeight, min(maxHeight, h))); 109 109 110 110 // Buttons and track pieces can all have margins along the axis of the scrollbar. … … 145 145 { 146 146 // Make sure our dimensions match the rect. 147 set Pos(rect.x() - tx, rect.y() - ty);147 setLocation(rect.x() - tx, rect.y() - ty); 148 148 setWidth(rect.width()); 149 149 setHeight(rect.height()); -
trunk/WebCore/rendering/RenderSlider.cpp
r40086 r40124 106 106 int newPosition = slider->positionForOffset( 107 107 IntPoint(m_initialPosition + curPoint.x() - m_initialClickPoint.x() 108 + (render er()->width() / 2),108 + (renderBox()->width() / 2), 109 109 m_initialPosition + curPoint.y() - m_initialClickPoint.y() 110 + (render er()->height() / 2)));110 + (renderBox()->height() / 2))); 111 111 if (slider->currentPosition() != newPosition) { 112 112 slider->setCurrentPosition(newPosition); … … 214 214 if (m_thumb && m_thumb->renderer()) { 215 215 216 int oldWidth = m_width;216 int oldWidth = width(); 217 217 calcWidth(); 218 int oldHeight = m_height;218 int oldHeight = height(); 219 219 calcHeight(); 220 220 221 if (oldWidth != m_width || oldHeight != m_height)221 if (oldWidth != width() || oldHeight != height()) 222 222 relayoutChildren = true; 223 223 … … 269 269 #endif 270 270 { 271 FloatPoint localPoint = m_thumb->render er()->absoluteToLocal(FloatPoint(evt->pageX(), evt->pageY()), false, true);272 IntRect thumbBounds = m_thumb->render er()->borderBox();271 FloatPoint localPoint = m_thumb->renderBox()->absoluteToLocal(FloatPoint(evt->pageX(), evt->pageY()), false, true); 272 IntRect thumbBounds = m_thumb->renderBox()->borderBoxRect(); 273 273 return thumbBounds.contains(roundedIntPoint(localPoint)); 274 274 } … … 352 352 int position; 353 353 if (style()->appearance() == SliderVerticalPart) 354 position = p.y() - m_thumb->render er()->height() / 2;354 position = p.y() - m_thumb->renderBox()->height() / 2; 355 355 else 356 position = p.x() - m_thumb->render er()->width() / 2;356 position = p.x() - m_thumb->renderBox()->width() / 2; 357 357 358 358 return max(0, min(position, trackSize())); … … 396 396 397 397 if (style()->appearance() == SliderVerticalPart) 398 return contentHeight() - m_thumb->render er()->height();399 return contentWidth() - m_thumb->render er()->width();398 return contentHeight() - m_thumb->renderBox()->height(); 399 return contentWidth() - m_thumb->renderBox()->width(); 400 400 } 401 401 -
trunk/WebCore/rendering/RenderTable.cpp
r40086 r40124 220 220 if (widthType > Relative && style()->width().isPositive()) { 221 221 // Percent or fixed table 222 m_width = style()->width().calcMinValue(availableWidth);223 m_width = max(minPrefWidth(), m_width);222 setWidth(style()->width().calcMinValue(availableWidth)); 223 setWidth(max(minPrefWidth(), width())); 224 224 } else { 225 225 // An auto width table should shrink to fit within the line width if necessary in order to 226 226 // avoid overlapping floats. 227 availableWidth = cb->lineWidth(m_ y);227 availableWidth = cb->lineWidth(m_frameRect.y()); 228 228 229 229 // Subtract out any fixed margins from our available width for auto width tables. … … 238 238 239 239 // Ensure we aren't bigger than our max width or smaller than our min width. 240 m_width = min(availContentWidth, maxPrefWidth());240 setWidth(min(availContentWidth, maxPrefWidth())); 241 241 } 242 242 243 m_width = max(m_width, minPrefWidth());243 setWidth(max(width(), minPrefWidth())); 244 244 245 245 // Finally, with our true width determined, compute our margins for real. … … 266 266 } 267 267 268 LayoutStateMaintainer statePusher(view(), this, IntSize( m_x, m_y));269 270 m_height = 0;268 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), m_frameRect.y())); 269 270 setHeight(0); 271 271 m_overflowHeight = 0; 272 272 m_overflowTop = 0; 273 273 initMaxMarginValues(); 274 274 275 int oldWidth = m_width;275 int oldWidth = width(); 276 276 calcWidth(); 277 277 278 if (m_caption && m_width!= oldWidth)278 if (m_caption && width() != oldWidth) 279 279 m_caption->setNeedsLayout(true, false); 280 280 … … 283 283 // layout that tells us if something has changed in the min max 284 284 // calculations to do it correctly. 285 // if ( oldWidth != m_width|| columns.size() + 1 != columnPos.size() )285 // if ( oldWidth != width() || columns.size() + 1 != columnPos.size() ) 286 286 m_tableLayout->layout(); 287 287 … … 306 306 } 307 307 308 m_overflowWidth = m_width+ (collapsing ? outerBorderRight() - borderRight() : 0);308 m_overflowWidth = width() + (collapsing ? outerBorderRight() - borderRight() : 0); 309 309 m_overflowLeft = collapsing ? borderLeft() - outerBorderLeft() : 0; 310 310 … … 317 317 // FIXME: Collapse caption margin. 318 318 if (m_caption && m_caption->style()->captionSide() != CAPBOTTOM) { 319 IntRect captionRect(m_caption->x Pos(), m_caption->yPos(), m_caption->width(), m_caption->height());320 321 m_caption->set Pos(m_caption->marginLeft(), m_height);319 IntRect captionRect(m_caption->x(), m_caption->y(), m_caption->width(), m_caption->height()); 320 321 m_caption->setLocation(m_caption->marginLeft(), height()); 322 322 if (!selfNeedsLayout() && m_caption->checkForRepaintDuringLayout()) 323 323 m_caption->repaintDuringLayoutIfMoved(captionRect); 324 324 325 m_height += m_caption->height() + m_caption->marginTop() + m_caption->marginBottom();326 m_overflowLeft = min(m_overflowLeft, m_caption->x Pos() + m_caption->overflowLeft(false));327 m_overflowWidth = max(m_overflowWidth, m_caption->x Pos() + m_caption->overflowWidth(false));328 m_overflowTop = min(m_overflowTop, m_caption->y Pos() + m_caption->overflowTop(false));329 m_overflowHeight = max(m_overflowHeight, m_caption->y Pos() + m_caption->overflowHeight(false));330 331 if ( m_height!= oldTableTop) {325 setHeight(height() + m_caption->height() + m_caption->marginTop() + m_caption->marginBottom()); 326 m_overflowLeft = min(m_overflowLeft, m_caption->x() + m_caption->overflowLeft(false)); 327 m_overflowWidth = max(m_overflowWidth, m_caption->x() + m_caption->overflowWidth(false)); 328 m_overflowTop = min(m_overflowTop, m_caption->y() + m_caption->overflowTop(false)); 329 m_overflowHeight = max(m_overflowHeight, m_caption->y() + m_caption->overflowHeight(false)); 330 331 if (height() != oldTableTop) { 332 332 sectionMoved = true; 333 movedSectionTop = min( m_height, oldTableTop);333 movedSectionTop = min(height(), oldTableTop); 334 334 } 335 335 } … … 338 338 int bpBottom = borderBottom() + (collapsing ? 0 : paddingBottom()); 339 339 340 m_height += bpTop;340 setHeight(height() + bpTop); 341 341 342 342 if (!isPositioned()) … … 362 362 // Completely empty tables (with no sections or anything) should at least honor specified height 363 363 // in strict mode. 364 m_height += th;364 setHeight(height() + th); 365 365 } 366 366 … … 372 372 RenderTableSection* section = m_head ? m_head : (m_firstBody ? m_firstBody : m_foot); 373 373 while (section) { 374 if (!sectionMoved && section->y Pos() != m_height) {374 if (!sectionMoved && section->y() != height()) { 375 375 sectionMoved = true; 376 movedSectionTop = min( m_height, section->yPos()) + section->overflowTop(false);377 } 378 section->set Pos(bl, m_height);379 380 m_height += section->height();381 m_overflowLeft = min(m_overflowLeft, section->x Pos() + section->overflowLeft(false));382 m_overflowWidth = max(m_overflowWidth, section->x Pos() + section->overflowWidth(false));383 m_overflowTop = min(m_overflowTop, section->y Pos() + section->overflowTop(false));384 m_overflowHeight = max(m_overflowHeight, section->y Pos() + section->overflowHeight(false));376 movedSectionTop = min(height(), section->y()) + section->overflowTop(false); 377 } 378 section->setLocation(bl, height()); 379 380 setHeight(height() + section->height()); 381 m_overflowLeft = min(m_overflowLeft, section->x() + section->overflowLeft(false)); 382 m_overflowWidth = max(m_overflowWidth, section->x() + section->overflowWidth(false)); 383 m_overflowTop = min(m_overflowTop, section->y() + section->overflowTop(false)); 384 m_overflowHeight = max(m_overflowHeight, section->y() + section->overflowHeight(false)); 385 385 section = sectionBelow(section); 386 386 } 387 387 388 m_height += bpBottom;388 setHeight(height() + bpBottom); 389 389 390 390 if (m_caption && m_caption->style()->captionSide() == CAPBOTTOM) { 391 IntRect captionRect(m_caption->x Pos(), m_caption->yPos(), m_caption->width(), m_caption->height());392 393 m_caption->set Pos(m_caption->marginLeft(), m_height);391 IntRect captionRect(m_caption->x(), m_caption->y(), m_caption->width(), m_caption->height()); 392 393 m_caption->setLocation(m_caption->marginLeft(), height()); 394 394 if (!selfNeedsLayout() && m_caption->checkForRepaintDuringLayout()) 395 395 m_caption->repaintDuringLayoutIfMoved(captionRect); 396 396 397 m_height += m_caption->height() + m_caption->marginTop() + m_caption->marginBottom();398 m_overflowLeft = min(m_overflowLeft, m_caption->x Pos() + m_caption->overflowLeft(false));399 m_overflowWidth = max(m_overflowWidth, m_caption->x Pos() + m_caption->overflowWidth(false));397 setHeight(height() + m_caption->height() + m_caption->marginTop() + m_caption->marginBottom()); 398 m_overflowLeft = min(m_overflowLeft, m_caption->x() + m_caption->overflowLeft(false)); 399 m_overflowWidth = max(m_overflowWidth, m_caption->x() + m_caption->overflowWidth(false)); 400 400 } 401 401 … … 403 403 calcHeight(); 404 404 405 m_overflowHeight = max(m_overflowHeight, m_height);405 m_overflowHeight = max(m_overflowHeight, height()); 406 406 407 407 // table can be containing block of positioned elements. … … 412 412 for (ShadowData* boxShadow = style()->boxShadow(); boxShadow; boxShadow = boxShadow->next) { 413 413 m_overflowLeft = min(m_overflowLeft, boxShadow->x - boxShadow->blur); 414 m_overflowWidth = max(m_overflowWidth, m_width+ boxShadow->x + boxShadow->blur);414 m_overflowWidth = max(m_overflowWidth, width() + boxShadow->x + boxShadow->blur); 415 415 m_overflowTop = min(m_overflowTop, boxShadow->y - boxShadow->blur); 416 m_overflowHeight = max(m_overflowHeight, m_height+ boxShadow->y + boxShadow->blur);416 m_overflowHeight = max(m_overflowHeight, height() + boxShadow->y + boxShadow->blur); 417 417 } 418 418 … … 448 448 void RenderTable::paint(PaintInfo& paintInfo, int tx, int ty) 449 449 { 450 tx += x Pos();451 ty += y Pos();450 tx += x(); 451 ty += y(); 452 452 453 453 PaintPhase paintPhase = paintInfo.phase; … … 1129 1129 return -1; 1130 1130 1131 return firstNonEmptySection->y Pos() + firstNonEmptySection->getBaselineOfFirstLineBox();1131 return firstNonEmptySection->y() + firstNonEmptySection->getBaselineOfFirstLineBox(); 1132 1132 } 1133 1133 -
trunk/WebCore/rendering/RenderTableCell.cpp
r40086 r40124 124 124 } 125 125 126 void RenderTableCell:: setWidth(int width)127 { 128 if (w idth != m_width) {129 m_width = width;126 void RenderTableCell::updateWidth(int w) 127 { 128 if (w != width()) { 129 setWidth(w); 130 130 m_widthChanged = true; 131 131 } … … 193 193 RenderView* v = view(); 194 194 if ((!v || !v->layoutStateEnabled()) && parent()) 195 r.move(-parent ()->xPos(), -parent()->yPos()); // Rows are in the same coordinate space, so don't add their offset in.195 r.move(-parentBox()->x(), -parentBox()->y()); // Rows are in the same coordinate space, so don't add their offset in. 196 196 RenderBlock::computeAbsoluteRepaintRect(r, fixed); 197 197 } … … 202 202 if ((!v || !v->layoutStateEnabled()) && parent()) { 203 203 // Rows are in the same coordinate space, so don't add their offset in. 204 localPoint.move(-parent ()->xPos(), -parent()->yPos());204 localPoint.move(-parentBox()->x(), -parentBox()->y()); 205 205 } 206 206 return RenderBlock::localToAbsolute(localPoint, fixed, useTransforms); … … 212 212 if (parent()) { 213 213 // Rows are in the same coordinate space, so add their offset back in. 214 localPoint.move(parent ()->xPos(), parent()->yPos());214 localPoint.move(parentBox()->x(), parentBox()->y()); 215 215 } 216 216 return localPoint; … … 222 222 if (parent()) { 223 223 // Rows are in the same coordinate space, so don't add their offset in. 224 quad.move(-parent ()->xPos(), -parent()->yPos());224 quad.move(-parentBox()->x(), -parentBox()->y()); 225 225 } 226 226 return RenderBlock::localToAbsoluteQuad(quad, fixed); … … 631 631 void RenderTableCell::paint(PaintInfo& paintInfo, int tx, int ty) 632 632 { 633 tx += m_x;634 ty += m_ y;633 tx += x(); 634 ty += m_frameRect.y(); 635 635 636 636 // check if we need to do anything at all... … … 639 639 if (paintInfo.phase == PaintPhaseCollapsedTableBorders && style()->visibility() == VISIBLE) { 640 640 if (ty - table()->outerBorderTop() >= paintInfo.rect.bottom() + os || 641 ty + m_topExtra + m_height+ m_bottomExtra + table()->outerBorderBottom() <= paintInfo.rect.y() - os)641 ty + m_topExtra + height() + m_bottomExtra + table()->outerBorderBottom() <= paintInfo.rect.y() - os) 642 642 return; 643 643 int w = width(); … … 808 808 809 809 if (backgroundObject != this) { 810 tx += m_x;811 ty += m_ y+ m_topExtra;810 tx += x(); 811 ty += m_frameRect.y() + m_topExtra; 812 812 } 813 813 -
trunk/WebCore/rendering/RenderTableCell.h
r40086 r40124 64 64 virtual void calcPrefWidths(); 65 65 virtual void calcWidth(); 66 v irtual void setWidth(int);66 void updateWidth(int); 67 67 68 68 virtual bool expandsToEncloseOverhangingFloats() const { return true; } … … 96 96 void paintCollapsedBorder(GraphicsContext*, int x, int y, int w, int h); 97 97 void paintBackgroundsBehindCell(PaintInfo&, int tx, int ty, RenderObject* backgroundObject); 98 99 // Lie about position to outside observers.100 virtual int yPos() const { return m_y + m_topExtra; }101 98 102 99 virtual IntRect absoluteClippedOverflowRect(); -
trunk/WebCore/rendering/RenderTableSection.cpp
r40086 r40124 132 132 return; 133 133 134 m_grid[m_cRow].rowRenderer = child;134 m_grid[m_cRow].rowRenderer = static_cast<RenderTableRow*>(child); 135 135 136 136 if (!beforeChild) { … … 175 175 } 176 176 177 void RenderTableSection::addCell(RenderTableCell* cell, Render Object* row)177 void RenderTableSection::addCell(RenderTableCell* cell, RenderTableRow* row) 178 178 { 179 179 int rSpan = cell->rowSpan(); … … 284 284 // Technically, we should also push state for the row, but since 285 285 // rows don't push a coordinate transform, that's not necessary. 286 statePusher.push(this, IntSize( m_x, m_y));286 statePusher.push(this, IntSize(x(), m_frameRect.y())); 287 287 } 288 288 cell->repaint(); 289 289 } 290 cell-> setWidth(w);290 cell->updateWidth(w); 291 291 } 292 292 } … … 334 334 // Technically, we should also push state for the row, but since 335 335 // rows don't push a coordinate transform, that's not necessary. 336 statePusher.push(this, IntSize( m_x, m_y));336 statePusher.push(this, IntSize(x(), m_frameRect.y())); 337 337 } 338 338 cell->setOverrideSize(-1); … … 385 385 386 386 // Set the width of our section now. The rows will also be this width. 387 m_width = table()->contentWidth();387 setWidth(table()->contentWidth()); 388 388 m_overflowLeft = 0; 389 m_overflowWidth = m_width;389 m_overflowWidth = width(); 390 390 m_overflowTop = 0; 391 391 m_overflowHeight = 0; … … 455 455 int nEffCols = table()->numEffCols(); 456 456 457 LayoutStateMaintainer statePusher(view(), this, IntSize( m_x, m_y));457 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), m_frameRect.y())); 458 458 459 459 for (int r = 0; r < totalRows; r++) { 460 460 // Set the row's x/y position and width/height. 461 if (Render Object* rowRenderer = m_grid[r].rowRenderer) {462 rowRenderer->set Pos(0, m_rowPos[r]);463 rowRenderer->setWidth( m_width);461 if (RenderTableRow* rowRenderer = m_grid[r].rowRenderer) { 462 rowRenderer->setLocation(0, m_rowPos[r]); 463 rowRenderer->setWidth(width()); 464 464 rowRenderer->setHeight(m_rowPos[r + 1] - m_rowPos[r] - vspacing); 465 465 } … … 553 553 cell->repaint(); 554 554 555 IntRect oldCellRect(cell->x Pos(), cell->yPos() - cell->borderTopExtra() , cell->width(), cell->height());555 IntRect oldCellRect(cell->x(), cell->y() - cell->borderTopExtra() , cell->width(), cell->height()); 556 556 557 557 if (style()->direction() == RTL) { 558 cell->set Pos(table()->columnPositions()[nEffCols] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + hspacing, m_rowPos[rindx]);558 cell->setLocation(table()->columnPositions()[nEffCols] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + hspacing, m_rowPos[rindx]); 559 559 } else 560 cell->set Pos(table()->columnPositions()[c] + hspacing, m_rowPos[rindx]);561 562 m_overflowLeft = min(m_overflowLeft, cell->x Pos() + cell->overflowLeft(false));563 m_overflowWidth = max(m_overflowWidth, cell->x Pos() + cell->overflowWidth(false));564 m_overflowTop = min(m_overflowTop, cell->y Pos() + cell->overflowTop(false));565 m_overflowHeight = max(m_overflowHeight, cell->y Pos() + cell->overflowHeight(false));560 cell->setLocation(table()->columnPositions()[c] + hspacing, m_rowPos[rindx]); 561 562 m_overflowLeft = min(m_overflowLeft, cell->x() + cell->overflowLeft(false)); 563 m_overflowWidth = max(m_overflowWidth, cell->x() + cell->overflowWidth(false)); 564 m_overflowTop = min(m_overflowTop, cell->y() + cell->overflowTop(false)); 565 m_overflowHeight = max(m_overflowHeight, cell->y() + cell->overflowHeight(false)); 566 566 m_hasOverflowingCell |= cell->overflowLeft(false) || cell->overflowWidth(false) > cell->width() || cell->overflowTop(false) || cell->overflowHeight(false) > cell->height(); 567 567 … … 576 576 statePusher.pop(); 577 577 578 m_height = m_rowPos[totalRows];579 m_overflowHeight = max(m_overflowHeight, m_height);580 return m_height;578 setHeight(m_rowPos[totalRows]); 579 m_overflowHeight = max(m_overflowHeight, height()); 580 return height(); 581 581 } 582 582 … … 590 590 for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) { 591 591 if (cell->isTableCell()) 592 bottom = max(bottom, cell->yPos() + cell->lowestPosition(false));592 bottom = max(bottom, static_cast<RenderTableCell*>(cell)->y() + cell->lowestPosition(false)); 593 593 } 594 594 } … … 606 606 for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) { 607 607 if (cell->isTableCell()) 608 right = max(right, cell->xPos() + cell->rightmostPosition(false));608 right = max(right, static_cast<RenderTableCell*>(cell)->x() + cell->rightmostPosition(false)); 609 609 } 610 610 } … … 622 622 for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) { 623 623 if (cell->isTableCell()) 624 left = min(left, cell->xPos() + cell->leftmostPosition(false));624 left = min(left, static_cast<RenderTableCell*>(cell)->x() + cell->leftmostPosition(false)); 625 625 } 626 626 } … … 852 852 RenderTableCell* cell = firstRow->at(i).cell; 853 853 if (cell) 854 firstLineBaseline = max(firstLineBaseline, cell->y Pos() + cell->paddingTop() + cell->borderTop() + cell->contentHeight());854 firstLineBaseline = max(firstLineBaseline, cell->y() + cell->paddingTop() + cell->borderTop() + cell->contentHeight()); 855 855 } 856 856 … … 872 872 return; 873 873 874 tx += m_x;875 ty += m_ y;874 tx += x(); 875 ty += m_frameRect.y(); 876 876 877 877 // Check which rows and cols are visible and only paint these. … … 993 993 if (!ensureRows(m_cRow + 1)) 994 994 break; 995 m_grid[m_cRow].rowRenderer = row; 995 996 RenderTableRow* tableRow = static_cast<RenderTableRow*>(row); 997 m_grid[m_cRow].rowRenderer = tableRow; 996 998 997 999 for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) { 998 1000 if (cell->isTableCell()) 999 addCell(static_cast<RenderTableCell*>(cell), row);1001 addCell(static_cast<RenderTableCell*>(cell), tableRow); 1000 1002 } 1001 1003 } … … 1057 1059 1058 1060 // Hit Testing 1059 bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x , int y, int tx, int ty, HitTestAction action)1061 bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction action) 1060 1062 { 1061 1063 // Table sections cannot ever be hit tested. Effectively they do not exist. 1062 1064 // Just forward to our children always. 1063 tx += m_x;1064 ty += m_ y;1065 tx += x(); 1066 ty += m_frameRect.y(); 1065 1067 1066 1068 for (RenderObject* child = lastChild(); child; child = child->previousSibling()) { … … 1069 1071 // table-specific hit-test method (which we should do for performance reasons anyway), 1070 1072 // then we can remove this check. 1071 if (!child->hasLayer() && !child->isInlineFlow() && child->nodeAtPoint(request, result, x , y, tx, ty, action)) {1072 updateHitTestResult(result, IntPoint(x - tx, y- ty));1073 if (!child->hasLayer() && !child->isInlineFlow() && child->nodeAtPoint(request, result, xPos, yPos, tx, ty, action)) { 1074 updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty)); 1073 1075 return true; 1074 1076 } -
trunk/WebCore/rendering/RenderTableSection.h
r40086 r40124 34 34 35 35 class RenderTableCell; 36 class RenderTableRow; 36 37 37 38 class RenderTableSection : public RenderContainer { … … 50 51 virtual int getBaselineOfFirstLineBox() const; 51 52 52 void addCell(RenderTableCell*, Render Object* row);53 void addCell(RenderTableCell*, RenderTableRow* row); 53 54 54 55 void setCellWidths(); … … 67 68 struct RowStruct { 68 69 Row* row; 69 Render Object* rowRenderer;70 RenderTableRow* rowRenderer; 70 71 int baseline; 71 72 Length height; … … 78 79 void splitColumn(int pos, int newSize); 79 80 80 virtual int overflowWidth(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? m_width: m_overflowWidth; }81 virtual int overflowWidth(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? width() : m_overflowWidth; } 81 82 virtual int overflowLeft(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? 0 : m_overflowLeft; } 82 virtual int overflowHeight(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? m_height: m_overflowHeight; }83 virtual int overflowHeight(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? height() : m_overflowHeight; } 83 84 virtual int overflowTop(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? 0 : m_overflowTop; } 84 85 -
trunk/WebCore/rendering/RenderText.cpp
r40086 r40124 67 67 { 68 68 ASSERT(m_text); 69 set RenderText();69 setIsText(); 70 70 m_text = document()->displayStringModifiedByEncoding(PassRefPtr<StringImpl>(m_text)); 71 71 … … 736 736 } 737 737 738 int RenderText:: minXPos() const738 int RenderText::boundingBoxX() const 739 739 { 740 740 if (!m_firstTextBox) … … 748 748 } 749 749 750 int RenderText::xPos() const 750 int RenderText::boundingBoxY() const 751 { 752 if (!m_firstTextBox) 753 return 0; 754 755 // FIXME: we should not use an arbitrary value like this. Perhaps we should use INT_MAX. 756 int minYPos = 6666666; 757 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) 758 minYPos = min(minYPos, static_cast<int>(box->m_y)); 759 return minYPos; 760 } 761 762 int RenderText::firstRunX() const 751 763 { 752 764 return m_firstTextBox ? m_firstTextBox->m_x : 0; 753 765 } 754 766 755 int RenderText:: yPos() const767 int RenderText::firstRunY() const 756 768 { 757 769 return m_firstTextBox ? m_firstTextBox->m_y : 0; 758 770 } 759 771 760 772 void RenderText::setSelectionState(SelectionState state) 761 773 { … … 974 986 } 975 987 976 int RenderText:: height() const988 int RenderText::boundingBoxHeight() const 977 989 { 978 990 int retval = 0; … … 1066 1078 } 1067 1079 1068 int RenderText:: width() const1080 int RenderText::boundingBoxWidth() const 1069 1081 { 1070 1082 // FIXME: we should not use an arbitrary value like this. Perhaps we should use INT_MAX. -
trunk/WebCore/rendering/RenderText.h
r40086 r40124 71 71 virtual unsigned width(unsigned from, unsigned len, const Font&, int xPos) const; 72 72 virtual unsigned width(unsigned from, unsigned len, int xPos, bool firstLine = false) const; 73 virtual int width() const;74 virtual int height() const;75 73 76 74 virtual int lineHeight(bool firstLine, bool isRootLineBox = false) const; … … 86 84 int& minW, int& maxW, bool& stripFrontSpaces); 87 85 88 // returns the minimum x position of all runs relative to the parent.89 // defaults to 0.90 int minXPos() const;86 // Returns the leftmost (and topmost) position of the bounding box that encloses all text runs 87 int boundingBoxX() const; 88 int boundingBoxY() const; 91 89 92 virtual int xPos() const; 93 virtual int yPos() const; 90 // Returns the width and height of the bounding box that encloses all text runs. 91 int boundingBoxWidth() const; 92 int boundingBoxHeight() const; 93 94 int firstRunX() const; 95 int firstRunY() const; 94 96 95 97 virtual int verticalPositionHint(bool firstLine) const; -
trunk/WebCore/rendering/RenderTextControl.cpp
r40086 r40124 127 127 int RenderTextControl::textBlockHeight() const 128 128 { 129 return m_height- paddingTop() - paddingBottom() - borderTop() - borderBottom();129 return height() - paddingTop() - paddingBottom() - borderTop() - borderBottom(); 130 130 } 131 131 132 132 int RenderTextControl::textBlockWidth() const 133 133 { 134 return m_width- paddingLeft() - paddingRight() - borderLeft() - borderRight()134 return width() - paddingLeft() - paddingRight() - borderLeft() - borderRight() 135 135 - m_innerText->renderer()->paddingLeft() - m_innerText->renderer()->paddingRight(); 136 136 } … … 218 218 document()->updateLayout(); 219 219 220 if (style()->visibility() == HIDDEN || !m_innerText || !m_innerText->renderer() || !m_innerText->render er()->height()) {220 if (style()->visibility() == HIDDEN || !m_innerText || !m_innerText->renderer() || !m_innerText->renderBox()->height()) { 221 221 cacheSelection(start, end); 222 222 return; … … 419 419 void RenderTextControl::calcHeight() 420 420 { 421 m_height =m_innerText->renderer()->borderTop() + m_innerText->renderer()->borderBottom() +422 423 m_innerText->renderer()->marginTop() + m_innerText->renderer()->marginBottom();421 setHeight(m_innerText->renderer()->borderTop() + m_innerText->renderer()->borderBottom() + 422 m_innerText->renderer()->paddingTop() + m_innerText->renderer()->paddingBottom() + 423 m_innerText->renderer()->marginTop() + m_innerText->renderer()->marginBottom()); 424 424 425 425 adjustControlHeightBasedOnLineHeight(m_innerText->renderer()->lineHeight(true, true)); 426 m_height += paddingTop() + paddingBottom() + borderTop() + borderBottom();426 setHeight(height() + paddingTop() + paddingBottom() + borderTop() + borderBottom()); 427 427 428 428 // We are able to have a horizontal scrollbar if the overflow style is scroll, or if its auto and there's no word wrap. 429 429 if (m_innerText->renderer()->style()->overflowX() == OSCROLL || (m_innerText->renderer()->style()->overflowX() == OAUTO && m_innerText->renderer()->style()->wordWrap() == NormalWordWrap)) 430 m_height += scrollbarThickness();430 setHeight(height() + scrollbarThickness()); 431 431 432 432 RenderBlock::calcHeight(); 433 433 } 434 434 435 void RenderTextControl::hitInnerTextBlock(HitTestResult& result, int x , int y, int tx, int ty)435 void RenderTextControl::hitInnerTextBlock(HitTestResult& result, int xPos, int yPos, int tx, int ty) 436 436 { 437 437 result.setInnerNode(m_innerText.get()); 438 result.setLocalPoint(IntPoint(x - tx - m_x - m_innerText->renderer()->xPos(),439 y - ty - m_y - m_innerText->renderer()->yPos()));438 result.setLocalPoint(IntPoint(xPos - tx - x() - m_innerText->renderBox()->x(), 439 yPos - ty - y() - m_innerText->renderBox()->y())); 440 440 } 441 441 … … 449 449 IntRect RenderTextControl::controlClipRect(int tx, int ty) const 450 450 { 451 IntRect clipRect = contentBox ();451 IntRect clipRect = contentBoxRect(); 452 452 clipRect.move(tx, ty); 453 453 return clipRect; -
trunk/WebCore/rendering/RenderTextControlMultiLine.cpp
r40086 r40124 55 55 void RenderTextControlMultiLine::layout() 56 56 { 57 int oldHeight = m_height;57 int oldHeight = height(); 58 58 calcHeight(); 59 59 60 int oldWidth = m_width;60 int oldWidth = width(); 61 61 calcWidth(); 62 62 63 bool relayoutChildren = oldHeight != m_height || oldWidth != m_width;64 Render Object* innerTextRenderer = innerTextElement()->renderer();63 bool relayoutChildren = oldHeight != height() || oldWidth != width(); 64 RenderBox* innerTextRenderer = innerTextElement()->renderBox(); 65 65 66 66 // Set the text block height … … 105 105 void RenderTextControlMultiLine::adjustControlHeightBasedOnLineHeight(int lineHeight) 106 106 { 107 m_height += lineHeight * static_cast<HTMLTextAreaElement*>(node())->rows();107 setHeight(height() + lineHeight * static_cast<HTMLTextAreaElement*>(node())->rows()); 108 108 } 109 109 -
trunk/WebCore/rendering/RenderTextControlSingleLine.cpp
r40086 r40124 198 198 199 199 if (paintInfo.phase == PaintPhaseBlockBackground && m_shouldDrawCapsLockIndicator) { 200 IntRect contentsRect = contentBox ();200 IntRect contentsRect = contentBoxRect(); 201 201 202 202 // Convert the rect into the coords used for painting the content 203 contentsRect.move(tx + x Pos(), ty + yPos());203 contentsRect.move(tx + x(), ty + y()); 204 204 theme()->paintCapsLockIndicator(this, paintInfo, contentsRect); 205 205 } … … 208 208 void RenderTextControlSingleLine::layout() 209 209 { 210 int oldHeight = m_height;210 int oldHeight = height(); 211 211 calcHeight(); 212 212 213 int oldWidth = m_width;213 int oldWidth = width(); 214 214 calcWidth(); 215 215 216 bool relayoutChildren = oldHeight != m_height || oldWidth != m_width;217 218 Render Object* innerTextRenderer = innerTextElement()->renderer();219 Render Object* innerBlockRenderer = m_innerBlock ? m_innerBlock->renderer() : 0;216 bool relayoutChildren = oldHeight != height() || oldWidth != width(); 217 218 RenderBox* innerTextRenderer = innerTextElement()->renderBox(); 219 RenderBox* innerBlockRenderer = m_innerBlock ? m_innerBlock->renderBox() : 0; 220 220 221 221 // Set the text block height … … 223 223 int currentHeight = innerTextRenderer->height(); 224 224 225 if (m_innerBlock || currentHeight > m_height) {225 if (m_innerBlock || currentHeight > height()) { 226 226 if (desiredHeight != currentHeight) 227 227 relayoutChildren = true; … … 243 243 244 244 if (m_innerBlock) { 245 int innerBlockWidth = m_width- paddingLeft() - paddingRight() - borderLeft() - borderRight();245 int innerBlockWidth = width() - paddingLeft() - paddingRight() - borderLeft() - borderRight(); 246 246 if (innerBlockWidth != innerBlockRenderer->width()) 247 247 relayoutChildren = true; … … 255 255 if (!m_innerBlock) { 256 256 currentHeight = innerTextRenderer->height(); 257 if (currentHeight < m_height)258 innerTextRenderer->set Pos(innerTextRenderer->xPos(), (m_height- currentHeight) / 2);259 } 260 } 261 262 bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x , int y, int tx, int ty, HitTestAction hitTestAction)257 if (currentHeight < height()) 258 innerTextRenderer->setLocation(innerTextRenderer->x(), (height() - currentHeight) / 2); 259 } 260 } 261 262 bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction hitTestAction) 263 263 { 264 264 // If we're within the text control, we want to act as if we've hit the inner text block element, in case the point … … 268 268 // and act as if we've hit the close block if we're to the right of the inner text block. 269 269 270 if (!RenderTextControl::nodeAtPoint(request, result, x , y, tx, ty, hitTestAction))270 if (!RenderTextControl::nodeAtPoint(request, result, xPos, yPos, tx, ty, hitTestAction)) 271 271 return false; 272 272 … … 274 274 return false; 275 275 276 hitInnerTextBlock(result, x , y, tx, ty);276 hitInnerTextBlock(result, xPos, yPos, tx, ty); 277 277 278 278 if (!m_innerBlock) … … 280 280 281 281 Node* innerNode = 0; 282 Render Object* innerBlockRenderer = m_innerBlock->renderer();283 Render Object* innerTextRenderer = innerTextElement()->renderer();282 RenderBox* innerBlockRenderer = m_innerBlock->renderBox(); 283 RenderBox* innerTextRenderer = innerTextElement()->renderBox(); 284 284 285 285 IntPoint localPoint = result.localPoint(); 286 localPoint.move(-innerBlockRenderer->x Pos(), -innerBlockRenderer->yPos());287 288 int textLeft = tx + m_x + innerBlockRenderer->xPos() + innerTextRenderer->xPos();289 if (m_resultsButton && m_resultsButton->renderer() && x < textLeft)286 localPoint.move(-innerBlockRenderer->x(), -innerBlockRenderer->y()); 287 288 int textLeft = tx + x() + innerBlockRenderer->x() + innerTextRenderer->x(); 289 if (m_resultsButton && m_resultsButton->renderer() && xPos < textLeft) 290 290 innerNode = m_resultsButton.get(); 291 291 292 292 if (!innerNode) { 293 293 int textRight = textLeft + innerTextRenderer->width(); 294 if (m_cancelButton && m_cancelButton->renderer() && x > textRight)294 if (m_cancelButton && m_cancelButton->renderer() && xPos > textRight) 295 295 innerNode = m_cancelButton.get(); 296 296 } … … 298 298 if (innerNode) { 299 299 result.setInnerNode(innerNode); 300 localPoint.move(-innerNode->render er()->xPos(), -innerNode->renderer()->yPos());300 localPoint.move(-innerNode->renderBox()->x(), -innerNode->renderBox()->y()); 301 301 } 302 302 … … 307 307 void RenderTextControlSingleLine::forwardEvent(Event* event) 308 308 { 309 Render Object* innerTextRenderer = innerTextElement()->renderer();309 RenderBox* innerTextRenderer = innerTextElement()->renderBox(); 310 310 311 311 if (event->type() == eventNames().blurEvent) { … … 325 325 326 326 FloatPoint localPoint = innerTextRenderer->absoluteToLocal(FloatPoint(static_cast<MouseEvent*>(event)->pageX(), static_cast<MouseEvent*>(event)->pageY()), false, true); 327 if (m_resultsButton && localPoint.x() < innerTextRenderer->borderBox ().x())327 if (m_resultsButton && localPoint.x() < innerTextRenderer->borderBoxRect().x()) 328 328 m_resultsButton->defaultEventHandler(event); 329 else if (m_cancelButton && localPoint.x() > innerTextRenderer->borderBox ().right())329 else if (m_cancelButton && localPoint.x() > innerTextRenderer->borderBoxRect().right()) 330 330 m_cancelButton->defaultEventHandler(event); 331 331 else … … 380 380 int width = RenderTextControl::textBlockWidth(); 381 381 382 if (Render Object* resultsRenderer = m_resultsButton ? m_resultsButton->renderer() : 0) {382 if (RenderBox* resultsRenderer = m_resultsButton ? m_resultsButton->renderBox() : 0) { 383 383 resultsRenderer->calcWidth(); 384 384 width -= resultsRenderer->width() + resultsRenderer->marginLeft() + resultsRenderer->marginRight(); 385 385 } 386 386 387 if (Render Object* cancelRenderer = m_cancelButton ? m_cancelButton->renderer() : 0) {387 if (RenderBox* cancelRenderer = m_cancelButton ? m_cancelButton->renderBox() : 0) { 388 388 cancelRenderer->calcWidth(); 389 389 width -= cancelRenderer->width() + cancelRenderer->marginLeft() + cancelRenderer->marginRight(); … … 414 414 void RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight(int lineHeight) 415 415 { 416 if (Render Object* resultsRenderer = m_resultsButton ? m_resultsButton->renderer() : 0) {416 if (RenderBox* resultsRenderer = m_resultsButton ? m_resultsButton->renderBox() : 0) { 417 417 static_cast<RenderBlock*>(resultsRenderer)->calcHeight(); 418 m_height = max(m_height,419 420 421 resultsRenderer->marginTop() + resultsRenderer->marginBottom());418 setHeight(max(height(), 419 resultsRenderer->borderTop() + resultsRenderer->borderBottom() + 420 resultsRenderer->paddingTop() + resultsRenderer->paddingBottom() + 421 resultsRenderer->marginTop() + resultsRenderer->marginBottom())); 422 422 lineHeight = max(lineHeight, resultsRenderer->height()); 423 423 } 424 424 425 if (Render Object* cancelRenderer = m_cancelButton ? m_cancelButton->renderer() : 0) {425 if (RenderBox* cancelRenderer = m_cancelButton ? m_cancelButton->renderBox() : 0) { 426 426 static_cast<RenderBlock*>(cancelRenderer)->calcHeight(); 427 m_height = max(m_height,428 429 430 cancelRenderer->marginTop() + cancelRenderer->marginBottom());427 setHeight(max(height(), 428 cancelRenderer->borderTop() + cancelRenderer->borderBottom() + 429 cancelRenderer->paddingTop() + cancelRenderer->paddingBottom() + 430 cancelRenderer->marginTop() + cancelRenderer->marginBottom())); 431 431 lineHeight = max(lineHeight, cancelRenderer->height()); 432 432 } 433 433 434 m_height += lineHeight;434 setHeight(height() + lineHeight); 435 435 } 436 436 … … 696 696 int padding = paddingLeft(); 697 697 698 if (Render Object* resultsRenderer = m_resultsButton ? m_resultsButton->renderer() : 0)698 if (RenderBox* resultsRenderer = m_resultsButton ? m_resultsButton->renderBox() : 0) 699 699 padding += resultsRenderer->width(); 700 700 … … 706 706 int padding = paddingRight(); 707 707 708 if (Render Object* cancelRenderer = m_cancelButton ? m_cancelButton->renderer() : 0)708 if (RenderBox* cancelRenderer = m_cancelButton ? m_cancelButton->renderBox() : 0) 709 709 padding += cancelRenderer->width(); 710 710 -
trunk/WebCore/rendering/RenderTheme.cpp
r40086 r40124 372 372 bool RenderTheme::hitTestMediaControlPart(RenderObject* o, const IntPoint& absPoint) 373 373 { 374 if (!o->isBox()) 375 return false; 376 374 377 FloatPoint localPoint = o->absoluteToLocal(absPoint, false, true); // respect transforms 375 376 return o->borderBox().contains(roundedIntPoint(localPoint)); 378 return RenderBox::toRenderBox(o)->borderBoxRect().contains(roundedIntPoint(localPoint)); 377 379 } 378 380 #endif … … 409 411 { 410 412 if (!m_activeListBoxSelectionBackgroundColor.isValid()) 411 m_activeListBoxSelectionBackgroundColor = platformActive SelectionBackgroundColor();413 m_activeListBoxSelectionBackgroundColor = platformActiveListBoxSelectionBackgroundColor(); 412 414 return m_activeListBoxSelectionBackgroundColor; 413 415 } … … 416 418 { 417 419 if (!m_inactiveListBoxSelectionBackgroundColor.isValid()) 418 m_inactiveListBoxSelectionBackgroundColor = platformInactive SelectionBackgroundColor();420 m_inactiveListBoxSelectionBackgroundColor = platformInactiveListBoxSelectionBackgroundColor(); 419 421 return m_inactiveListBoxSelectionBackgroundColor; 420 422 } … … 423 425 { 424 426 if (!m_activeListBoxSelectionForegroundColor.isValid() && supportsListBoxSelectionForegroundColors()) 425 m_activeListBoxSelectionForegroundColor = platformActive SelectionForegroundColor();427 m_activeListBoxSelectionForegroundColor = platformActiveListBoxSelectionForegroundColor(); 426 428 return m_activeListBoxSelectionForegroundColor; 427 429 } … … 430 432 { 431 433 if (!m_inactiveListBoxSelectionForegroundColor.isValid() && supportsListBoxSelectionForegroundColors()) 432 m_inactiveListBoxSelectionForegroundColor = platformInactive SelectionForegroundColor();434 m_inactiveListBoxSelectionForegroundColor = platformInactiveListBoxSelectionForegroundColor(); 433 435 return m_inactiveListBoxSelectionForegroundColor; 434 436 } … … 481 483 int RenderTheme::baselinePosition(const RenderObject* o) const 482 484 { 485 if (!o->isBox()) 486 return 0; 487 483 488 #if USE(NEW_THEME) 484 return o->height() + o->marginTop() + m_theme->baselinePositionAdjustment(o->style()->appearance()) * o->style()->effectiveZoom();489 return RenderBox::toConstRenderBox(o)->height() + o->marginTop() + m_theme->baselinePositionAdjustment(o->style()->appearance()) * o->style()->effectiveZoom(); 485 490 #else 486 return o->height() + o->marginTop();491 return RenderBox::toConstRenderBox(o)->height() + o->marginTop(); 487 492 #endif 488 493 } -
trunk/WebCore/rendering/RenderThemeMac.mm
r40086 r40124 154 154 Color RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor() const 155 155 { 156 return Color(128, 128, 128);156 return platformInactiveSelectionBackgroundColor(); 157 157 } 158 158 … … 1255 1255 { 1256 1256 Node* input = o->node()->shadowAncestorNode(); 1257 if (!input->renderer()->isBox()) 1258 return false; 1259 1257 1260 setSearchCellState(input->renderer(), r); 1258 1261 … … 1265 1268 float zoomLevel = o->style()->effectiveZoom(); 1266 1269 1267 FloatRect localBounds = [search cancelButtonRectForBounds:NSRect(input->render er()->borderBox())];1270 FloatRect localBounds = [search cancelButtonRectForBounds:NSRect(input->renderBox()->borderBoxRect())]; 1268 1271 localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r); 1269 1272 … … 1329 1332 { 1330 1333 Node* input = o->node()->shadowAncestorNode(); 1334 if (!input->renderer()->isBox()) 1335 return false; 1336 1331 1337 setSearchCellState(input->renderer(), r); 1332 1338 … … 1336 1342 [search setSearchMenuTemplate:nil]; 1337 1343 1338 FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->render er()->borderBox())];1344 FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->borderBoxRect())]; 1339 1345 localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r); 1340 1346 … … 1356 1362 { 1357 1363 Node* input = o->node()->shadowAncestorNode(); 1364 if (!input->renderer()->isBox()) 1365 return false; 1366 1358 1367 setSearchCellState(input->renderer(), r); 1359 1368 … … 1367 1376 float zoomLevel = o->style()->effectiveZoom(); 1368 1377 1369 FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->render er()->borderBox())];1378 FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->borderBoxRect())]; 1370 1379 localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r); 1371 1380 … … 1595 1604 bool RenderThemeMac::hitTestMediaControlPart(RenderObject* o, const IntPoint& absPoint) 1596 1605 { 1606 if (!o->isBox()) 1607 return false; 1608 1597 1609 if (mediaControllerTheme() == MediaControllerThemeQT) { 1598 1610 ControlPart part = o->style()->appearance(); 1599 1611 FloatPoint localPoint = o->absoluteToLocal(absPoint, false, true); // respect transforms 1600 return wkHitTestMediaUIPart(part - MediaFullscreenButtonPart, MediaControllerThemeQT, CGRect( o->borderBox()), CGPoint(localPoint));1612 return wkHitTestMediaUIPart(part - MediaFullscreenButtonPart, MediaControllerThemeQT, CGRect(RenderBox::toRenderBox(o)->borderBoxRect()), CGPoint(localPoint)); 1601 1613 } 1602 1614 else -
trunk/WebCore/rendering/RenderThemeSafari.cpp
r40086 r40124 273 273 int RenderThemeSafari::baselinePosition(const RenderObject* o) const 274 274 { 275 if (!o->isBox()) 276 return 0; 277 275 278 if (o->style()->appearance() == CheckboxPart || o->style()->appearance() == RadioPart) 276 return o->marginTop() + o->height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.279 return o->marginTop() + RenderBox::toConstRenderBox(o)->height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit. 277 280 return RenderTheme::baselinePosition(o); 278 281 } -
trunk/WebCore/rendering/RenderThemeWin.cpp
r40086 r40124 741 741 IntRect bounds = r; 742 742 ASSERT(o->parent()); 743 if (!o->parent() )743 if (!o->parent() || !o->parent()->isBox()) 744 744 return false; 745 IntRect parentBox = o->parent()->absoluteContentBox(); 745 746 RenderBox* parentRenderBox = RenderBox::toRenderBox(o->parent()); 747 748 IntRect parentBox = parentRenderBox->absoluteContentBox(); 746 749 747 750 // Make sure the scaled button stays square and will fit in its parent's box … … 789 792 IntRect bounds = r; 790 793 ASSERT(o->parent()); 791 if (!o->parent() )794 if (!o->parent() || !o->parent()->isBox()) 792 795 return false; 793 IntRect parentBox = o->parent()->absoluteContentBox(); 796 797 RenderBox* parentRenderBox = RenderBox::toRenderBox(o->parent()); 798 IntRect parentBox = parentRenderBox->absoluteContentBox(); 794 799 795 800 // Make sure the scaled decoration stays square and will fit in its parent's box … … 823 828 if (!o->parent()) 824 829 return false; 825 IntRect parentBox = o->parent()->absoluteContentBox(); 830 if (!o->parent() || !o->parent()->isBox()) 831 return false; 832 833 RenderBox* parentRenderBox = RenderBox::toRenderBox(o->parent()); 834 IntRect parentBox = parentRenderBox->absoluteContentBox(); 826 835 827 836 // Make sure the scaled decoration will fit in its parent's box -
trunk/WebCore/rendering/RenderTreeAsText.cpp
r40086 r40124 35 35 #include "InlineTextBox.h" 36 36 #include "RenderBR.h" 37 #include "RenderInline.h" 37 38 #include "RenderListMarker.h" 38 39 #include "RenderTableCell.h" … … 181 182 } 182 183 183 IntRect r(o.xPos(), o.yPos(), o.width(), o.height()); 184 IntRect r; 185 if (o.isText()) { 186 // FIXME: Would be better to dump the bounding box x and y rather than the first run's x and y, but that would involve updating 187 // many test results. 188 const RenderText& text = static_cast<const RenderText&>(o); 189 r = IntRect(text.firstRunX(), text.firstRunY(), text.boundingBoxWidth(), text.boundingBoxHeight()); 190 } else if (o.isBox()) { 191 if (o.isRenderInline()) { 192 // FIXME: Would be better not to just dump 0, 0 as the x and y here. 193 const RenderInline& inlineFlow = static_cast<const RenderInline&>(o); 194 r = IntRect(0, 0, inlineFlow.boundingBoxWidth(), inlineFlow.boundingBoxHeight()); 195 } else { 196 // FIXME: We can't just use the actual frameRect of the box because dump render tree dumps the "inner box" of table cells. 197 // Because of the lie we have to call y(). We would like to fix dump render tree to dump the actual dimensions of the table 198 // cell including the extra intrinsic padding. 199 const RenderBox& box = static_cast<const RenderBox&>(o); 200 r = IntRect(box.x(), box.y(), box.width(), box.height()); 201 } 202 } 203 184 204 ts << " " << r; 185 205 -
trunk/WebCore/rendering/RenderVideo.cpp
r40086 r40124 69 69 IntRect RenderVideo::videoBox() const 70 70 { 71 IntRect contentRect = contentBox ();71 IntRect contentRect = contentBoxRect(); 72 72 73 73 if (intrinsicSize().isEmpty() || contentRect.isEmpty()) -
trunk/WebCore/rendering/RenderView.cpp
r40086 r40124 51 51 // init RenderObject attributes 52 52 setInline(false); 53 54 // try to contrain the width to the views width 55 m_width = 0; 56 m_height = 0; 53 57 54 m_minPrefWidth = 0; 58 55 m_maxPrefWidth = 0; … … 74 71 { 75 72 if (!printing() && m_frameView) 76 m_height = viewHeight();73 setHeight(viewHeight()); 77 74 } 78 75 … … 80 77 { 81 78 if (!printing() && m_frameView) 82 m_width = viewWidth();79 setWidth(viewWidth()); 83 80 m_marginLeft = 0; 84 81 m_marginRight = 0; … … 97 94 { 98 95 if (printing()) 99 m_minPrefWidth = m_maxPrefWidth = m_width;96 m_minPrefWidth = m_maxPrefWidth = width(); 100 97 101 98 // Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account. 102 bool relayoutChildren = !printing() && (!m_frameView || m_width != viewWidth() || m_height!= viewHeight());99 bool relayoutChildren = !printing() && (!m_frameView || width() != viewWidth() || height() != viewHeight()); 103 100 if (relayoutChildren) { 104 101 setChildNeedsLayout(true, false); … … 119 116 120 117 // Ensure that docWidth() >= width() and docHeight() >= height(). 121 setOverflowWidth( m_width);122 setOverflowHeight( m_height);118 setOverflowWidth(width()); 119 setOverflowHeight(height()); 123 120 124 121 setOverflowWidth(docWidth()); … … 515 512 { 516 513 if (printing()) 517 return IntRect(0, 0, m_width, m_height);514 return IntRect(0, 0, width(), height()); 518 515 if (m_frameView) 519 516 return m_frameView->visibleContentRect(); … … 523 520 int RenderView::docHeight() const 524 521 { 525 int h = m_height;522 int h = height(); 526 523 int lowestPos = lowestPosition(); 527 524 if (lowestPos > h) … … 532 529 // when we call RenderBlock::layout. 533 530 int dh = 0; 534 for (Render Object* c = firstChild(); c; c = c->nextSibling())531 for (RenderBox* c = firstChildBox(); c; c = c->nextSiblingBox()) 535 532 dh += c->height() + c->marginTop() + c->marginBottom(); 536 533 … … 543 540 int RenderView::docWidth() const 544 541 { 545 int w = m_width;542 int w = width(); 546 543 int rightmostPos = rightmostPosition(); 547 544 if (rightmostPos > w) 548 545 w = rightmostPos; 549 550 for (Render Object *c = firstChild(); c; c = c->nextSibling()) {546 547 for (RenderBox* c = firstChildBox(); c; c = c->nextSiblingBox()) { 551 548 int dw = c->width() + c->marginLeft() + c->marginRight(); 552 549 if (dw > w) … … 579 576 // The idea here is to take into account what object is moving the pagination point, and 580 577 // thus choose the best place to chop it. 581 void RenderView::setBestTruncatedAt(int y, Render Object* forRenderer, bool forcedBreak)578 void RenderView::setBestTruncatedAt(int y, RenderBox* forRenderer, bool forcedBreak) 582 579 { 583 580 // Nobody else can set a page break once we have a forced break. … … 593 590 594 591 // prefer the widest object who tries to move the pagination point 595 int width = forRenderer->width(); 596 if (width > m_truncatorWidth) { 597 m_truncatorWidth = width; 592 if (forRenderer->width() > m_truncatorWidth) { 593 m_truncatorWidth = forRenderer->width(); 598 594 m_bestTruncatedAt = y; 599 595 } -
trunk/WebCore/rendering/RenderView.h
r40086 r40124 77 77 bool printImages() const { return m_printImages; } 78 78 void setTruncatedAt(int y) { m_truncatedAt = y; m_bestTruncatedAt = m_truncatorWidth = 0; m_forcedPageBreak = false; } 79 void setBestTruncatedAt(int y, Render Object *forRenderer, bool forcedBreak = false);79 void setBestTruncatedAt(int y, RenderBox* forRenderer, bool forcedBreak = false); 80 80 int bestTruncatedAt() const { return m_bestTruncatedAt; } 81 81 -
trunk/WebCore/rendering/RenderWidget.cpp
r40086 r40124 76 76 v->removeWidget(this); 77 77 78 if (AXObjectCache::accessibilityEnabled()) 78 if (AXObjectCache::accessibilityEnabled()) { 79 document()->axObjectCache()->childrenChanged(this->parent()); 79 80 document()->axObjectCache()->remove(this); 80 81 } 81 82 remove(); 82 83 … … 173 174 return; 174 175 175 tx += m_x;176 ty += m_ y;176 tx += x(); 177 ty += m_frameRect.y(); 177 178 178 179 if (hasBoxDecorations() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)) … … 189 190 #if PLATFORM(MAC) 190 191 if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled()) 191 paintCustomHighlight(tx - m_x, ty - m_y, style()->highlight(), true);192 paintCustomHighlight(tx - x(), ty - m_frameRect.y(), style()->highlight(), true); 192 193 #endif 193 194 … … 223 224 absPos.move(borderLeft() + paddingLeft(), borderTop() + paddingTop()); 224 225 225 int w idth = m_width- borderLeft() - borderRight() - paddingLeft() - paddingRight();226 int h eight = m_height- borderTop() - borderBottom() - paddingTop() - paddingBottom();227 228 IntRect newBounds(absPos.x(), absPos.y(), w idth, height);226 int w = width() - borderLeft() - borderRight() - paddingLeft() - paddingRight(); 227 int h = height() - borderTop() - borderBottom() - paddingTop() - paddingBottom(); 228 229 IntRect newBounds(absPos.x(), absPos.y(), w, h); 229 230 IntRect oldBounds(m_widget->frameRect()); 230 231 if (newBounds != oldBounds) { … … 272 273 // Check to see if we are really over the widget itself (and not just in the border/padding area). 273 274 if (inside && !hadResult && result.innerNode() == element()) 274 result.setIsOverWidget(contentBox ().contains(result.localPoint()));275 result.setIsOverWidget(contentBoxRect().contains(result.localPoint())); 275 276 return inside; 276 277 } -
trunk/WebCore/rendering/RootInlineBox.h
r40086 r40124 120 120 InlineBox* closestLeafChildForXPos(int x, bool onlyEditableLeaves = false); 121 121 122 Vector<Render Object*>& floats()122 Vector<RenderBox*>& floats() 123 123 { 124 124 ASSERT(!isDirty()); … … 128 128 } 129 129 130 Vector<Render Object*>* floatsPtr() { ASSERT(!isDirty()); return m_overflow ? &m_overflow->floats : 0; }130 Vector<RenderBox*>* floatsPtr() { ASSERT(!isDirty()); return m_overflow ? &m_overflow->floats : 0; } 131 131 132 132 protected: … … 159 159 // Floats hanging off the line are pushed into this vector during layout. It is only 160 160 // good for as long as the line has not been marked dirty. 161 Vector<Render Object*> floats;161 Vector<RenderBox*> floats; 162 162 private: 163 163 void* operator new(size_t) throw(); -
trunk/WebCore/rendering/SVGInlineFlowBox.cpp
r40086 r40124 44 44 } 45 45 46 void SVGInlineFlowBox::verticallyAlignBoxes(int&)46 int SVGInlineFlowBox::verticallyAlignBoxes(int) 47 47 { 48 48 // no-op 49 return 0; 49 50 } 50 51 -
trunk/WebCore/rendering/SVGInlineFlowBox.h
r40086 r40124 39 39 virtual void paint(RenderObject::PaintInfo&, int tx, int ty); 40 40 virtual int placeBoxesHorizontally(int x, int& leftPosition, int& rightPosition, bool& needsWordSpacing); 41 virtual void verticallyAlignBoxes(int&heightOfBlock);41 virtual int verticallyAlignBoxes(int heightOfBlock); 42 42 }; 43 43 -
trunk/WebCore/rendering/SVGRenderTreeAsText.cpp
r40086 r40124 330 330 331 331 Vector<SVGTextChunk>& chunks = const_cast<Vector<SVGTextChunk>& >(box->svgTextChunks()); 332 ts << " at (" << text.x Pos() << "," << text.yPos() << ") size " << box->width() << "x" << box->height() << " contains " << chunks.size() << " chunk(s)";332 ts << " at (" << text.x() << "," << text.y() << ") size " << box->width() << "x" << box->height() << " contains " << chunks.size() << " chunk(s)"; 333 333 334 334 if (text.parent() && (text.parent()->style()->color() != text.style()->color())) … … 515 515 } 516 516 517 ts << " at (" << text. xPos() << "," << text.yPos() << ") size " << text.width() << "x" << text.height() << "\n";517 ts << " at (" << text.firstRunX() << "," << text.firstRunY() << ") size " << text.boundingBoxWidth() << "x" << text.boundingBoxHeight() << "\n"; 518 518 writeSVGInlineText(ts, text, indent); 519 519 } -
trunk/WebCore/rendering/SVGRootInlineBox.cpp
r40086 r40124 31 31 #include "Frame.h" 32 32 #include "GraphicsContext.h" 33 #include "RenderBlock.h" 33 34 #include "RenderSVGRoot.h" 34 35 #include "SVGInlineFlowBox.h" … … 612 613 } 613 614 614 void SVGRootInlineBox::verticallyAlignBoxes(int& heightOfBlock)615 int SVGRootInlineBox::verticallyAlignBoxes(int) 615 616 { 616 617 // height is set by layoutInlineBoxes. 617 heightOfBlock =height();618 return height(); 618 619 } 619 620 … … 888 889 // Propogate this knownledge to our RenderSVGText parent. 889 890 FloatPoint topLeft = topLeftPositionOfCharacterRange(m_svgChars); 890 object()->setPos((int) floorf(topLeft.x()), (int) floorf(topLeft.y()));891 block()->setLocation((int) floorf(topLeft.x()), (int) floorf(topLeft.y())); 891 892 892 893 // Layout all InlineText/Flow boxes … … 1039 1040 int maxY = minY + enclosedStringRect.height(); 1040 1041 1041 curr->setXPos(minX - object()->xPos());1042 curr->setXPos(minX - block()->x()); 1042 1043 curr->setWidth(enclosedStringRect.width()); 1043 1044 1044 curr->setYPos(minY - object()->yPos());1045 curr->setYPos(minY - block()->y()); 1045 1046 curr->setBaseline(font.ascent()); 1046 1047 curr->setHeight(enclosedStringRect.height()); … … 1072 1073 layoutInlineBoxes(flowBox, it, minX, maxX, minY, maxY); 1073 1074 1074 curr->setXPos(minX - object()->xPos());1075 curr->setXPos(minX - block()->x()); 1075 1076 curr->setWidth(maxX - minX); 1076 1077 1077 curr->setYPos(minY - object()->yPos());1078 curr->setYPos(minY - block()->y()); 1078 1079 curr->setBaseline(font.ascent()); 1079 1080 curr->setHeight(maxY - minY); … … 1094 1095 1095 1096 if (start->isRootInlineBox()) { 1096 int top = lowY - object()->yPos();1097 int bottom = highY - object()->yPos();1098 1099 start->setXPos(lowX - object()->xPos());1097 int top = lowY - block()->y(); 1098 int bottom = highY - block()->y(); 1099 1100 start->setXPos(lowX - block()->x()); 1100 1101 start->setYPos(top); 1101 1102 -
trunk/WebCore/rendering/SVGRootInlineBox.h
r40086 r40124 56 56 57 57 virtual int placeBoxesHorizontally(int x, int& leftPosition, int& rightPosition, bool& needsWordSpacing); 58 virtual void verticallyAlignBoxes(int&heightOfBlock);58 virtual int verticallyAlignBoxes(int heightOfBlock); 59 59 60 60 virtual void computePerCharacterLayoutInformation(); -
trunk/WebCore/rendering/bidi.cpp
r40086 r40124 567 567 { 568 568 // First determine our total width. 569 int availableWidth = lineWidth( m_height);569 int availableWidth = lineWidth(height()); 570 570 int totWidth = lineBox->getFlowSpacingWidth(); 571 571 bool needsWordSpacing = false; … … 598 598 } else if (!r->m_object->isInlineFlow()) { 599 599 r->m_object->calcWidth(); 600 r->m_box->setWidth( r->m_object->width());600 r->m_box->setWidth(toRenderBox(r->m_object)->width()); 601 601 if (!r->m_compact) 602 602 totWidth += r->m_object->marginLeft() + r->m_object->marginRight(); … … 612 612 // objects horizontally. The total width of the line can be increased if we end up 613 613 // justifying text. 614 int x = leftOffset( m_height);614 int x = leftOffset(height()); 615 615 switch(textAlign) { 616 616 case LEFT: … … 721 721 void RenderBlock::computeVerticalPositionsForLine(RootInlineBox* lineBox, BidiRun* firstRun) 722 722 { 723 lineBox->verticallyAlignBoxes(m_height);724 lineBox->setBlockHeight( m_height);723 setHeight(lineBox->verticallyAlignBoxes(height())); 724 lineBox->setBlockHeight(height()); 725 725 726 726 // See if the line spilled out. If so set overflow height accordingly. 727 727 int bottomOfLine = lineBox->bottomOverflow(); 728 if (bottomOfLine > m_height&& bottomOfLine > m_overflowHeight)728 if (bottomOfLine > height() && bottomOfLine > m_overflowHeight) 729 729 m_overflowHeight = bottomOfLine; 730 730 … … 737 737 // a reasonable approximation of an appropriate y position. 738 738 if (r->m_object->isPositioned()) 739 r->m_box->setYPos( m_height);739 r->m_box->setYPos(height()); 740 740 741 741 // Position is used to properly position both replaced elements and … … 801 801 m_overflowHeight = 0; 802 802 803 m_height = borderTop() + paddingTop();803 setHeight(borderTop() + paddingTop()); 804 804 int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight(); 805 805 … … 831 831 o->invalidateVerticalPosition(); 832 832 if (o->isReplaced() || o->isFloating() || o->isPositioned()) { 833 RenderBox* box = toRenderBox(o); 834 833 835 if (relayoutChildren || o->style()->width().isPercent() || o->style()->height().isPercent()) 834 836 o->setChildNeedsLayout(true, false); … … 839 841 840 842 if (o->isPositioned()) 841 o->containingBlock()->insertPositionedObject( o);843 o->containingBlock()->insertPositionedObject(box); 842 844 else { 843 845 if (o->isFloating()) 844 floats.append(FloatWithRect( o));846 floats.append(FloatWithRect(box)); 845 847 else if (fullLayout || o->needsLayout()) // Replaced elements 846 848 o->dirtyLineBoxes(fullLayout); … … 896 898 if (startLine) { 897 899 useRepaintBounds = true; 898 repaintTop = m_height;899 repaintBottom = m_height;900 repaintTop = height(); 901 repaintBottom = height(); 900 902 RenderArena* arena = renderArena(); 901 903 RootInlineBox* box = startLine; … … 930 932 bool checkForEndLineMatch = endLine; 931 933 bool checkForFloatsFromLastLine = false; 932 int lastHeight = m_height;934 int lastHeight = height(); 933 935 934 936 while (!end.atEnd()) { … … 1073 1075 } 1074 1076 1075 lastHeight = m_height;1077 lastHeight = height(); 1076 1078 sNumMidpoints = 0; 1077 1079 sCurrMidpoint = 0; … … 1082 1084 if (endLineMatched) { 1083 1085 // Attach all the remaining lines, and then adjust their y-positions as needed. 1084 int delta = m_height- endLineYPos;1086 int delta = height() - endLineYPos; 1085 1087 for (RootInlineBox* line = endLine; line; line = line->nextRootBox()) { 1086 1088 line->attachLine(); … … 1090 1092 line->adjustPosition(0, delta); 1091 1093 } 1092 if (Vector<Render Object*>* cleanLineFloats = line->floatsPtr()) {1093 Vector<Render Object*>::iterator end = cleanLineFloats->end();1094 for (Vector<Render Object*>::iterator f = cleanLineFloats->begin(); f != end; ++f) {1095 int floatTop = (*f)->y Pos() - (*f)->marginTop();1094 if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr()) { 1095 Vector<RenderBox*>::iterator end = cleanLineFloats->end(); 1096 for (Vector<RenderBox*>::iterator f = cleanLineFloats->begin(); f != end; ++f) { 1097 int floatTop = (*f)->y() - (*f)->marginTop(); 1096 1098 insertFloatingObject(*f); 1097 m_height = floatTop + delta;1099 setHeight(floatTop + delta); 1098 1100 positionNewFloats(); 1099 1101 } 1100 1102 } 1101 1103 } 1102 m_height = lastRootBox()->blockHeight();1104 setHeight(lastRootBox()->blockHeight()); 1103 1105 } else { 1104 1106 // Delete all the remaining lines. … … 1136 1138 1137 1139 // Now add in the bottom border/padding. 1138 m_height += toAdd;1140 setHeight(height() + toAdd); 1139 1141 1140 1142 // Always make sure this is at least our height. 1141 m_overflowHeight = max( m_height, m_overflowHeight);1143 m_overflowHeight = max(height(), m_overflowHeight); 1142 1144 1143 1145 // See if any lines spill out of the block. If so, we need to update our overflow width. … … 1145 1147 1146 1148 if (!firstLineBox() && hasLineIfEmpty()) 1147 m_height += lineHeight(true, true);1149 setHeight(height() + lineHeight(true, true)); 1148 1150 1149 1151 // See if we have any lines that spill out of our block. If we do, then we will possibly need to … … 1162 1164 size_t floatIndex = 0; 1163 1165 for (curr = firstRootBox(); curr && !curr->isDirty(); curr = curr->nextRootBox()) { 1164 if (Vector<Render Object*>* cleanLineFloats = curr->floatsPtr()) {1165 Vector<Render Object*>::iterator end = cleanLineFloats->end();1166 for (Vector<Render Object*>::iterator o = cleanLineFloats->begin(); o != end; ++o) {1167 Render Object* f = *o;1166 if (Vector<RenderBox*>* cleanLineFloats = curr->floatsPtr()) { 1167 Vector<RenderBox*>::iterator end = cleanLineFloats->end(); 1168 for (Vector<RenderBox*>::iterator o = cleanLineFloats->begin(); o != end; ++o) { 1169 RenderBox* f = *o; 1168 1170 IntSize newSize(f->width() + f->marginLeft() +f->marginRight(), f->height() + f->marginTop() + f->marginBottom()); 1169 1171 ASSERT(floatIndex < floats.size()); … … 1227 1229 numCleanFloats = 0; 1228 1230 if (!floats.isEmpty()) { 1229 int savedHeight = m_height;1231 int savedHeight = height(); 1230 1232 // Restore floats from clean lines. 1231 1233 RootInlineBox* line = firstRootBox(); 1232 1234 while (line != curr) { 1233 if (Vector<Render Object*>* cleanLineFloats = line->floatsPtr()) {1234 Vector<Render Object*>::iterator end = cleanLineFloats->end();1235 for (Vector<Render Object*>::iterator f = cleanLineFloats->begin(); f != end; ++f) {1235 if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr()) { 1236 Vector<RenderBox*>::iterator end = cleanLineFloats->end(); 1237 for (Vector<RenderBox*>::iterator f = cleanLineFloats->begin(); f != end; ++f) { 1236 1238 insertFloatingObject(*f); 1237 m_height = (*f)->yPos() - (*f)->marginTop();1239 setHeight((*f)->y() - (*f)->marginTop()); 1238 1240 positionNewFloats(); 1239 1241 ASSERT(floats[numCleanFloats].object == *f); … … 1243 1245 line = line->nextRootBox(); 1244 1246 } 1245 m_height = savedHeight;1247 setHeight(savedHeight); 1246 1248 } 1247 1249 … … 1252 1254 int pos = 0; 1253 1255 if (last) { 1254 m_height = last->blockHeight();1256 setHeight(last->blockHeight()); 1255 1257 startObj = last->lineBreakObj(); 1256 1258 pos = last->lineBreakPos(); … … 1312 1314 return false; 1313 1315 1314 int delta = m_height- endYPos;1316 int delta = height() - endYPos; 1315 1317 if (!delta || !m_floatingObjects) 1316 1318 return true; 1317 1319 1318 1320 // See if any floats end in the range along which we want to shift the lines vertically. 1319 int top = min( m_height, endYPos);1321 int top = min(height(), endYPos); 1320 1322 1321 1323 RootInlineBox* lastLine = endLine; … … 1348 1350 endYPos = line->blockHeight(); 1349 1351 1350 int delta = m_height- endYPos;1352 int delta = height() - endYPos; 1351 1353 if (delta && m_floatingObjects) { 1352 1354 // See if any floats end in the range along which we want to shift the lines vertically. 1353 int top = min( m_height, endYPos);1355 int top = min(height(), endYPos); 1354 1356 1355 1357 RootInlineBox* lastLine = endLine; … … 1460 1462 RenderObject* object = iterator.obj; 1461 1463 if (object->isFloating()) { 1462 insertFloatingObject( object);1464 insertFloatingObject(toRenderBox(object)); 1463 1465 } else if (object->isPositioned()) { 1464 1466 // FIXME: The math here is actually not really right. It's a best-guess approximation that … … 1469 1471 // position as though we were an inline. Set |staticX| and |staticY| on the relative positioned 1470 1472 // inline so that we can obtain the value later. 1471 c->setStaticX(style()->direction() == LTR ? leftOffset( m_height) : rightOffset(m_height));1472 c->setStaticY( m_height);1473 c->setStaticX(style()->direction() == LTR ? leftOffset(height()) : rightOffset(height())); 1474 c->setStaticY(height()); 1473 1475 } 1474 1476 1475 1477 if (object->hasStaticX()) { 1476 1478 if (object->style()->isOriginalDisplayInlineType()) 1477 object->setStaticX(style()->direction() == LTR ? leftOffset( m_height) : width() - rightOffset(m_height));1479 object->setStaticX(style()->direction() == LTR ? leftOffset(height()) : width() - rightOffset(height())); 1478 1480 else 1479 1481 object->setStaticX(style()->direction() == LTR ? borderLeft() + paddingLeft() : borderRight() + paddingRight()); … … 1481 1483 1482 1484 if (object->hasStaticY()) 1483 object->setStaticY( m_height);1485 object->setStaticY(height()); 1484 1486 } 1485 1487 iterator.increment(); … … 1489 1491 int RenderBlock::skipLeadingWhitespace(InlineBidiResolver& resolver) 1490 1492 { 1491 int availableWidth = lineWidth( m_height);1493 int availableWidth = lineWidth(height()); 1492 1494 while (!resolver.position().atEnd() && !requiresLineBox(resolver.position())) { 1493 1495 RenderObject* object = resolver.position().obj; 1494 1496 if (object->isFloating()) { 1495 insertFloatingObject( object);1497 insertFloatingObject(toRenderBox(object)); 1496 1498 positionNewFloats(); 1497 availableWidth = lineWidth( m_height);1499 availableWidth = lineWidth(height()); 1498 1500 } else if (object->isPositioned()) { 1499 1501 // FIXME: The math here is actually not really right. It's a best-guess approximation that … … 1504 1506 // position as though we were an inline. Set |staticX| and |staticY| on the relative positioned 1505 1507 // inline so that we can obtain the value later. 1506 c->setStaticX(style()->direction() == LTR ? leftOffset( m_height) : rightOffset(m_height));1507 c->setStaticY( m_height);1508 c->setStaticX(style()->direction() == LTR ? leftOffset(height()) : rightOffset(height())); 1509 c->setStaticY(height()); 1508 1510 } 1509 1511 1510 1512 if (object->hasStaticX()) { 1511 1513 if (object->style()->isOriginalDisplayInlineType()) 1512 object->setStaticX(style()->direction() == LTR ? leftOffset( m_height) : width() - rightOffset(m_height));1514 object->setStaticX(style()->direction() == LTR ? leftOffset(height()) : width() - rightOffset(height())); 1513 1515 else 1514 1516 object->setStaticX(style()->direction() == LTR ? borderLeft() + paddingLeft() : borderRight() + paddingRight()); … … 1516 1518 1517 1519 if (object->hasStaticY()) 1518 object->setStaticY( m_height);1520 object->setStaticY(height()); 1519 1521 } 1520 1522 resolver.increment(); … … 1546 1548 1547 1549 int floatBottom; 1548 int lastFloatBottom = m_height;1550 int lastFloatBottom = height(); 1549 1551 int newLineWidth = availableWidth; 1550 1552 while (true) { … … 1560 1562 1561 1563 if (newLineWidth > availableWidth) { 1562 m_height = lastFloatBottom;1564 setHeight(lastFloatBottom); 1563 1565 availableWidth = newLineWidth; 1564 1566 } … … 1653 1655 // add to special objects... 1654 1656 if (o->isFloating()) { 1655 insertFloatingObject(o); 1657 RenderBox* floatBox = toRenderBox(o); 1658 insertFloatingObject(floatBox); 1656 1659 // check if it fits in the current line. 1657 1660 // If it does, position it now, otherwise, position 1658 1661 // it after moving to next line (in newLine() func) 1659 if (floatsFitOnLine && o->width() + o->marginLeft() + o->marginRight() + w + tmpW <= width) {1662 if (floatsFitOnLine && floatBox->width() + floatBox->marginLeft() + floatBox->marginRight() + w + tmpW <= width) { 1660 1663 positionNewFloats(); 1661 width = lineWidth( m_height);1664 width = lineWidth(height()); 1662 1665 } else 1663 1666 floatsFitOnLine = false; … … 1678 1681 bool needToSetStaticY = o->hasStaticY(); 1679 1682 if (o->hasStaticY() && isInlineType) { 1680 o->setStaticY( m_height);1683 o->setStaticY(height()); 1681 1684 needToSetStaticY = false; 1682 1685 } … … 1727 1730 o->marginRight() + o->borderRight() + o->paddingRight(); 1728 1731 } else if (o->isReplaced()) { 1732 RenderBox* replacedBox = toRenderBox(o); 1733 1729 1734 // Break on replaced elements if either has normal white-space. 1730 1735 if ((autoWrap || RenderStyle::autoWrap(lastWS)) && (!o->isImage() || allowImagesToBreak)) { … … 1756 1761 } 1757 1762 } else 1758 tmpW += o->width() + o->marginLeft() + o->marginRight() + inlineWidth(o);1763 tmpW += replacedBox->width() + replacedBox->marginLeft() + replacedBox->marginRight() + inlineWidth(o); 1759 1764 } else if (o->isText()) { 1760 1765 if (!pos) … … 2173 2178 void RenderBlock::checkLinesForOverflow() 2174 2179 { 2175 m_overflowWidth = m_width;2180 m_overflowWidth = width(); 2176 2181 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) { 2177 2182 m_overflowLeft = min(curr->leftOverflow(), m_overflowLeft); -
trunk/WebCore/svg/SVGLength.cpp
r40086 r40124 302 302 } else if (context->parent() && !context->parent()->isSVGElement()) { 303 303 if (RenderObject* renderer = context->renderer()) { 304 width = renderer->width(); 305 height = renderer->height(); 304 if (renderer->isBox()) { 305 RenderBox* box = RenderBox::toRenderBox(renderer); 306 width = box->width(); 307 height = box->height(); 308 } 306 309 } 307 310 } -
trunk/WebCore/svg/graphics/SVGPaintServer.cpp
r40086 r40124 2 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * 2007 Rob Buis <buis@kde.org> 4 * 2008 Dirk Schulze <krit@webkit.org> 4 5 * 5 6 * Redistribution and use in source and binary forms, with or without … … 159 160 } 160 161 162 void SVGPaintServer::draw(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const 163 { 164 if (!setup(context, path, type)) 165 return; 166 167 renderPath(context, path, type); 168 teardown(context, path, type); 169 } 170 171 void SVGPaintServer::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const 172 { 173 const SVGRenderStyle* style = path ? path->style()->svgStyle() : 0; 174 175 if ((type & ApplyToFillTargetType) && (!style || style->hasFill())) 176 context->fillPath(); 177 178 if ((type & ApplyToStrokeTargetType) && (!style || style->hasStroke())) 179 context->strokePath(); 180 } 181 182 void SVGPaintServer::teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool) const 183 { 184 #if PLATFORM(SKIA) 185 // FIXME: Move this into the GraphicsContext 186 // WebKit implicitly expects us to reset the path. 187 // For example in fillAndStrokePath() of RenderPath.cpp the path is 188 // added back to the context after filling. This is because internally it 189 // calls CGContextFillPath() which closes the path. 190 context->beginPath(); 191 context->platformContext()->setGradient(0); 192 context->platformContext()->setPattern(0); 193 #endif 194 } 195 161 196 DashArray dashArrayFromRenderingStyle(const RenderStyle* style) 162 197 { -
trunk/WebCore/svg/graphics/SVGPaintServer.h
r40086 r40124 78 78 79 79 protected: 80 #if PLATFORM(CG)81 void strokePath(CGContextRef, const RenderObject*) const;82 void fillPath(CGContextRef, const RenderObject*) const;83 #endif84 85 protected:86 80 SVGPaintServer(); 87 81 }; -
trunk/WebCore/svg/graphics/SVGPaintServerGradient.cpp
r40086 r40124 258 258 } 259 259 260 void SVGPaintServerGradient::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const261 {262 const SVGRenderStyle* style = path->style()->svgStyle();263 264 if ((type & ApplyToFillTargetType) && style->hasFill())265 context->fillPath();266 267 if ((type & ApplyToStrokeTargetType) && style->hasStroke())268 context->strokePath();269 }270 271 260 void SVGPaintServerGradient::teardown(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType, bool isPaintingText) const 272 261 { -
trunk/WebCore/svg/graphics/SVGPaintServerGradient.h
r40086 r40124 72 72 virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const; 73 73 virtual void teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const; 74 virtual void renderPath(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;75 74 76 75 protected: -
trunk/WebCore/svg/graphics/SVGPaintServerPattern.cpp
r40086 r40124 174 174 } 175 175 176 void SVGPaintServerPattern::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const177 {178 const SVGRenderStyle* style = path->style()->svgStyle();179 180 if ((type & ApplyToFillTargetType) && style->hasFill())181 context->fillPath();182 183 if ((type & ApplyToStrokeTargetType) && style->hasStroke())184 context->strokePath();185 }186 187 176 void SVGPaintServerPattern::teardown(GraphicsContext*& context, const RenderObject*, SVGPaintTargetType, bool) const 188 177 { -
trunk/WebCore/svg/graphics/SVGPaintServerPattern.h
r40086 r40124 65 65 66 66 virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const; 67 virtual void renderPath(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;68 67 virtual void teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const; 69 68 -
trunk/WebCore/svg/graphics/SVGPaintServerSolid.cpp
r40086 r40124 89 89 } 90 90 91 void SVGPaintServerSolid::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const92 {93 const SVGRenderStyle* svgStyle = path ? path->style()->svgStyle() : 0;94 95 if ((type & ApplyToFillTargetType) && (!svgStyle || svgStyle->hasFill()))96 context->fillPath();97 98 if ((type & ApplyToStrokeTargetType) && (!svgStyle || svgStyle->hasStroke()))99 context->strokePath();100 }101 102 91 } // namespace WebCore 103 92 -
trunk/WebCore/svg/graphics/SVGPaintServerSolid.h
r40086 r40124 47 47 48 48 virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const; 49 virtual void renderPath(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;50 49 51 50 private: -
trunk/WebCore/wml/WMLAElement.cpp
r40086 r40124 105 105 // or one of the continuations is non-empty, since this is a faster check and 106 106 // almost always returns true. 107 for (RenderObject* r = renderer(); r; r = r->virtualContinuation()) 107 RenderBox* box = RenderBox::toRenderBox(renderer()); 108 if (box->width() > 0 && box->height() > 0) 109 return true; 110 for (RenderFlow* r = box->virtualContinuation(); r; r = r->continuation()) 108 111 if (r->width() > 0 && r->height() > 0) 109 112 return true; -
trunk/WebCore/wml/WMLInputElement.cpp
r40086 r40124 51 51 static inline bool isInputFocusable(RenderObject* renderer) 52 52 { 53 if (!renderer )53 if (!renderer || !renderer->isBox()) 54 54 return false; 55 55 56 if ( !renderer->width() || !renderer->height())56 if (RenderBox::toRenderBox(renderer)->size().isEmpty()) 57 57 return false; 58 58 -
trunk/WebCore/xml/XMLHttpRequest.cpp
r40086 r40124 24 24 25 25 #include "CString.h" 26 #include "Console.h"27 26 #include "DOMImplementation.h" 28 #include "D OMWindow.h"27 #include "Document.h" 29 28 #include "Event.h" 30 29 #include "EventException.h" … … 32 31 #include "EventNames.h" 33 32 #include "File.h" 34 #include "Frame.h"35 #include "FrameLoader.h"36 33 #include "HTTPParsers.h" 37 #include "InspectorController.h"38 34 #include "KURL.h" 39 35 #include "KURLHash.h" 40 #include "Page.h" 36 #include "ResourceError.h" 37 #include "ResourceRequest.h" 38 #include "ScriptExecutionContext.h" 41 39 #include "Settings.h" 42 #include "S ubresourceLoader.h"40 #include "SystemTime.h" 43 41 #include "TextResourceDecoder.h" 42 #include "ThreadableLoader.h" 44 43 #include "XMLHttpRequestException.h" 45 44 #include "XMLHttpRequestProgressEvent.h" … … 324 323 , m_includeCredentials(false) 325 324 , m_state(UNSENT) 326 , m_identifier(std::numeric_limits<unsigned long>::max())327 325 , m_responseText("") 328 326 , m_createdDocument(false) … … 348 346 return static_cast<Document*>(scriptExecutionContext()); 349 347 } 348 349 #if ENABLE(DASHBOARD_SUPPORT) 350 bool XMLHttpRequest::usesDashboardBackwardCompatibilityMode() const 351 { 352 if (scriptExecutionContext()->isWorkerContext()) 353 return false; 354 Settings* settings = document()->settings(); 355 return settings && settings->usesDashboardBackwardCompatibilityMode(); 356 } 357 #endif 350 358 351 359 XMLHttpRequest::State XMLHttpRequest::readyState() const … … 559 567 if (contentType.isEmpty()) { 560 568 #if ENABLE(DASHBOARD_SUPPORT) 561 Settings* settings = document->settings(); 562 if (settings && settings->usesDashboardBackwardCompatibilityMode()) 569 if (usesDashboardBackwardCompatibilityMode()) 563 570 setRequestHeaderInternal("Content-Type", "application/x-www-form-urlencoded"); 564 571 else … … 591 598 if (contentType.isEmpty()) { 592 599 #if ENABLE(DASHBOARD_SUPPORT) 593 Settings* settings = document()->settings(); 594 if (settings && settings->usesDashboardBackwardCompatibilityMode()) 600 if (usesDashboardBackwardCompatibilityMode()) 595 601 setRequestHeaderInternal("Content-Type", "application/x-www-form-urlencoded"); 596 602 else … … 806 812 ResourceResponse response; 807 813 808 if (document()->frame()) 809 m_identifier = document()->frame()->loader()->loadResourceSynchronously(request, error, response, data); 810 814 unsigned long identifier = ThreadableLoader::loadResourceSynchronously(scriptExecutionContext(), request, error, response, data); 811 815 m_loader = 0; 812 816 … … 814 818 // Also, if we have an HTTP response, then it wasn't a network error in fact. 815 819 if (error.isNull() || request.url().isLocalFile() || response.httpStatusCode() > 0) { 816 processSyncLoadResults( data, response, ec);820 processSyncLoadResults(identifier, data, response, ec); 817 821 return; 818 822 } … … 838 842 // We need to keep content sniffing enabled for local files due to CFNetwork not providing a MIME type 839 843 // for local files otherwise, <rdar://problem/5671813>. 840 bool sendResourceLoadCallbacks = !m_inPreflight; 841 m_loader = SubresourceLoader::create(document()->frame(), this, request, false, sendResourceLoadCallbacks, request.url().isLocalFile()); 844 LoadCallbacks callbacks = m_inPreflight ? DoNotSendLoadCallbacks : SendLoadCallbacks; 845 ContentSniff contentSniff = request.url().isLocalFile() ? SniffContent : DoNotSniffContent; 846 m_loader = ThreadableLoader::create(scriptExecutionContext(), this, request, callbacks, contentSniff); 842 847 843 848 if (m_loader) { … … 979 984 if (m_state != OPENED || m_loader) { 980 985 #if ENABLE(DASHBOARD_SUPPORT) 981 Settings* settings = document() ? document()->settings() : 0; 982 if (settings && settings->usesDashboardBackwardCompatibilityMode()) 986 if (usesDashboardBackwardCompatibilityMode()) 983 987 return; 984 988 #endif … … 1131 1135 } 1132 1136 1133 void XMLHttpRequest::processSyncLoadResults( const Vector<char>& data, const ResourceResponse& response, ExceptionCode& ec)1137 void XMLHttpRequest::processSyncLoadResults(unsigned long identifier, const Vector<char>& data, const ResourceResponse& response, ExceptionCode& ec) 1134 1138 { 1135 1139 if (m_sameOriginRequest && !scriptExecutionContext()->securityOrigin()->canRequest(response.url())) { … … 1138 1142 } 1139 1143 1140 didReceiveResponse( 0,response);1144 didReceiveResponse(response); 1141 1145 changeState(HEADERS_RECEIVED); 1142 1146 1143 1147 const char* bytes = static_cast<const char*>(data.data()); 1144 1148 int len = static_cast<int>(data.size()); 1145 didReceiveData( 0,bytes, len);1146 1147 didFinishLoading( 0);1149 didReceiveData(bytes, len); 1150 1151 didFinishLoading(identifier); 1148 1152 if (m_error) 1149 1153 ec = XMLHttpRequestException::NETWORK_ERR; 1150 1154 } 1151 1155 1152 void XMLHttpRequest::didFail( SubresourceLoader*, const ResourceError& error)1156 void XMLHttpRequest::didFail() 1153 1157 { 1154 1158 // If we are already in an error state, for instance we called abort(), bail out early. … … 1156 1160 return; 1157 1161 1158 if (error.isCancellation()) { 1159 abortError(); 1160 return; 1161 } 1162 1162 internalAbort(); 1163 1163 networkError(); 1164 return; 1165 } 1166 1167 void XMLHttpRequest::didFinishLoading(SubresourceLoader* loader) 1168 { 1164 } 1165 1166 void XMLHttpRequest::didGetCancelled() 1167 { 1168 // If we are already in an error state, for instance we called abort(), bail out early. 1169 1169 if (m_error) 1170 1170 return; 1171 1171 1172 abortError(); 1173 } 1174 1175 void XMLHttpRequest::didFinishLoading(unsigned long identifier) 1176 { 1177 if (m_error) 1178 return; 1179 1172 1180 if (m_inPreflight) { 1173 didFinishLoadingPreflight(loader); 1174 return; 1175 } 1176 1177 ASSERT(loader == m_loader); 1181 didFinishLoadingPreflight(); 1182 return; 1183 } 1178 1184 1179 1185 if (m_state < HEADERS_RECEIVED) … … 1183 1189 m_responseText += m_decoder->flush(); 1184 1190 1185 scriptExecutionContext()->resourceRetrievedByXMLHttpRequest( m_loader ? m_loader->identifier() : m_identifier, m_responseText);1191 scriptExecutionContext()->resourceRetrievedByXMLHttpRequest(identifier, m_responseText); 1186 1192 scriptExecutionContext()->addMessage(InspectorControllerDestination, JSMessageSource, LogMessageLevel, "XHR finished loading: \"" + m_url + "\".", m_lastSendLineNumber, m_lastSendURL); 1187 1193 … … 1196 1202 } 1197 1203 1198 void XMLHttpRequest::didFinishLoadingPreflight( SubresourceLoader*)1204 void XMLHttpRequest::didFinishLoadingPreflight() 1199 1205 { 1200 1206 ASSERT(m_inPreflight); … … 1209 1215 } 1210 1216 1211 void XMLHttpRequest::willSendRequest(SubresourceLoader*, ResourceRequest& request, const ResourceResponse&) 1212 { 1213 // FIXME: This needs to be fixed to follow the redirect correctly even for cross-domain requests. 1214 if (!scriptExecutionContext()->securityOrigin()->canRequest(request.url())) { 1215 internalAbort(); 1216 networkError(); 1217 } 1218 } 1219 1220 void XMLHttpRequest::didSendData(SubresourceLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) 1217 void XMLHttpRequest::didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) 1221 1218 { 1222 1219 if (!m_upload) … … 1254 1251 } 1255 1252 1256 void XMLHttpRequest::didReceiveResponse( SubresourceLoader* loader,const ResourceResponse& response)1253 void XMLHttpRequest::didReceiveResponse(const ResourceResponse& response) 1257 1254 { 1258 1255 if (m_inPreflight) { 1259 didReceiveResponsePreflight( loader,response);1256 didReceiveResponsePreflight(response); 1260 1257 return; 1261 1258 } … … 1274 1271 } 1275 1272 1276 void XMLHttpRequest::didReceiveResponsePreflight( SubresourceLoader*,const ResourceResponse& response)1273 void XMLHttpRequest::didReceiveResponsePreflight(const ResourceResponse& response) 1277 1274 { 1278 1275 ASSERT(m_inPreflight); … … 1285 1282 1286 1283 OwnPtr<PreflightResultCacheItem> preflightResult(new PreflightResultCacheItem(m_includeCredentials)); 1287 if (!preflightResult->parse(response)) { 1284 if (!preflightResult->parse(response) 1285 || !preflightResult->allowsCrossSiteMethod(m_method) 1286 || !preflightResult->allowsCrossSiteHeaders(m_requestHeaders)) { 1288 1287 networkError(); 1289 1288 return; 1290 1289 } 1291 1290 1292 if (!preflightResult->allowsCrossSiteMethod(m_method)) {1293 networkError();1294 return;1295 }1296 1297 if (!preflightResult->allowsCrossSiteHeaders(m_requestHeaders)) {1298 networkError();1299 return;1300 }1301 1302 1291 PreflightResultCache::shared().appendEntry(scriptExecutionContext()->securityOrigin()->toString(), m_url, preflightResult.release()); 1303 1292 } 1304 1293 1305 void XMLHttpRequest:: receivedCancellation(SubresourceLoader*, const AuthenticationChallenge& challenge)1306 { 1307 m_response = challenge.failureResponse();1308 } 1309 1310 void XMLHttpRequest::didReceiveData( SubresourceLoader*,const char* data, int len)1294 void XMLHttpRequest::didReceiveAuthenticationCancellation(const ResourceResponse& failureResponse) 1295 { 1296 m_response = failureResponse; 1297 } 1298 1299 void XMLHttpRequest::didReceiveData(const char* data, int len) 1311 1300 { 1312 1301 if (m_inPreflight) … … 1327 1316 m_decoder = TextResourceDecoder::create("text/plain", "UTF-8"); 1328 1317 } 1329 if ( len == 0)1318 if (!len) 1330 1319 return; 1331 1320 -
trunk/WebCore/xml/XMLHttpRequest.h
r40086 r40124 27 27 #include "FormData.h" 28 28 #include "ResourceResponse.h" 29 #include "SubresourceLoaderClient.h"30 29 #include "ScriptString.h" 30 #include "ThreadableLoaderClient.h" 31 31 #include <wtf/OwnPtr.h> 32 32 … … 35 35 class Document; 36 36 class File; 37 class ResourceRequest; 37 38 class TextResourceDecoder; 38 39 class XMLHttpRequest : public RefCounted<XMLHttpRequest>, public EventTarget, private SubresourceLoaderClient, public ActiveDOMObject { 39 class ThreadableLoader; 40 41 class XMLHttpRequest : public RefCounted<XMLHttpRequest>, public EventTarget, private ThreadableLoaderClient, public ActiveDOMObject { 40 42 public: 41 43 static PassRefPtr<XMLHttpRequest> create(ScriptExecutionContext* context) { return adoptRef(new XMLHttpRequest(context)); } … … 120 122 Document* document() const; 121 123 122 virtual void willSendRequest(SubresourceLoader*, ResourceRequest& request, const ResourceResponse& redirectResponse); 123 virtual void didSendData(SubresourceLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent); 124 virtual void didReceiveResponse(SubresourceLoader*, const ResourceResponse&); 125 virtual void didReceiveData(SubresourceLoader*, const char* data, int size); 126 virtual void didFail(SubresourceLoader*, const ResourceError&); 127 virtual void didFinishLoading(SubresourceLoader*); 128 virtual void receivedCancellation(SubresourceLoader*, const AuthenticationChallenge&); 124 #if ENABLE(DASHBOARD_SUPPORT) 125 bool usesDashboardBackwardCompatibilityMode() const; 126 #endif 127 128 virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent); 129 virtual void didReceiveResponse(const ResourceResponse&); 130 virtual void didReceiveData(const char* data, int lengthReceived); 131 virtual void didFinishLoading(unsigned long identifier); 132 virtual void didFail(); 133 virtual void didGetCancelled(); 134 virtual void didReceiveAuthenticationCancellation(const ResourceResponse&); 129 135 130 136 // Special versions for the preflight 131 void didReceiveResponsePreflight( SubresourceLoader*,const ResourceResponse&);132 void didFinishLoadingPreflight( SubresourceLoader*);133 134 void processSyncLoadResults( const Vector<char>& data, const ResourceResponse&, ExceptionCode&);137 void didReceiveResponsePreflight(const ResourceResponse&); 138 void didFinishLoadingPreflight(); 139 140 void processSyncLoadResults(unsigned long identifier, const Vector<char>& data, const ResourceResponse&, ExceptionCode&); 135 141 void updateAndDispatchOnProgress(unsigned int len); 136 142 … … 199 205 bool m_includeCredentials; 200 206 201 RefPtr< SubresourceLoader> m_loader;207 RefPtr<ThreadableLoader> m_loader; 202 208 State m_state; 203 209 … … 206 212 207 213 RefPtr<TextResourceDecoder> m_decoder; 208 unsigned long m_identifier; 209 210 // Unlike most strings in the DOM, we keep this as a JSC::UString, not a WebCore::String. 214 215 // Unlike most strings in the DOM, we keep this as a ScriptString, not a WebCore::String. 211 216 // That's because these strings can easily get huge (they are filled from the network with 212 217 // no parsing) and because JS can easily observe many intermediate states, so it's very useful -
trunk/WebKit/mac/ChangeLog
r40086 r40124 1 2009-01-21 David Hyatt <hyatt@apple.com> 2 3 Devirtualize width/height/x/y on RenderObject and move the methods to RenderBox. 4 5 Reviewed by Eric Seidel and Darin Adler 6 7 * WebView/WebRenderNode.mm: 8 (copyRenderNode): 9 10 2009-01-21 Anders Carlsson <andersca@apple.com> 11 12 Reviewed by Sam Weinig. 13 14 More browser->plug-in scripting support. 15 16 * Plugins/Hosted/NetscapePluginHostProxy.mm: 17 (WKPCNPObjectHasPropertyReply): 18 (WKPCNPObjectHasMethodReply): 19 (WKPCNPObjectInvokeReply): 20 MIG reply functions. 21 22 (WKPCIdentifierInfo): 23 Return information about an identifier given its 64-bit value. 24 25 * Plugins/Hosted/NetscapePluginInstanceProxy.h: 26 Add new reply structs. 27 28 * Plugins/Hosted/NetscapePluginInstanceProxy.mm: 29 (WebKit::NetscapePluginInstanceProxy::addValueToArray): 30 Split out code that adds values to the arrays from marshalValue. 31 32 (WebKit::NetscapePluginInstanceProxy::marshalValue): 33 Call addValueToArray. 34 35 (WebKit::NetscapePluginInstanceProxy::marshalValues): 36 Marshal a list of values. 37 38 (WebKit::NetscapePluginInstanceProxy::createBindingsInstance): 39 Actually create a proxy instance. 40 41 * Plugins/Hosted/ProxyInstance.h: 42 * Plugins/Hosted/ProxyInstance.mm: 43 (WebKit::ProxyClass::methodsNamed): 44 (WebKit::ProxyClass::fieldNamed): 45 Add a proxy ProxyClass class that just forwards everything to the ProxyInstance class. 46 47 (WebKit::proxyClass): 48 Shared proxyClass getter. 49 50 (WebKit::ProxyField::ProxyField): 51 (WebKit::ProxyField::valueFromInstance): 52 (WebKit::ProxyField::setValueToInstance): 53 Add a proxy ProxyField class that just forwards everything to the ProxyInstance class. 54 55 (WebKit::ProxyMethod::ProxyMethod): 56 (WebKit::ProxyMethod::serverIdentifier): 57 (WebKit::ProxyMethod::numParameters): 58 Add a dummy ProxyMethod class. 59 60 (WebKit::ProxyInstance::invokeMethod): 61 Call _WKPHNPObjectInvoke. 62 63 (WebKit::ProxyInstance::defaultValue): 64 (WebKit::ProxyInstance::stringValue): 65 (WebKit::ProxyInstance::numberValue): 66 (WebKit::ProxyInstance::booleanValue): 67 (WebKit::ProxyInstance::valueOf): 68 Add dummy implementations (taken from CInstance). 69 70 (WebKit::ProxyInstance::methodsNamed): 71 Call _WKPHNPObjectHasMethod to determine whether a method with the given name exists. 72 73 (WebKit::ProxyInstance::fieldNamed): 74 Call _WKPHNPObjectHasProperty to determine whether a property with the given name exists. 75 76 * Plugins/Hosted/WebKitPluginClient.defs: 77 * Plugins/Hosted/WebKitPluginHost.defs: 78 Add new MIG definitions. 79 80 2009-01-21 Mark Rowe <mrowe@apple.com> 81 82 Reviewed by Tim Hatcher. 83 84 Clean up how we force invocations of API that happened on background threads over to the main thread. 85 86 This was previously accomplished in a somewhat ad-hoc manner using a mutable dictionary to pass arguments 87 and return values back from the function. The new approach is to use a proxy object that forwards an 88 NSInvocation over to the main thread and applies it to the target object, which leads to a much cleaner 89 call site. 90 91 * Misc/WebNSObjectExtras.h: 92 * Misc/WebNSObjectExtras.mm: 93 (-[WebMainThreadInvoker initWithTarget:]): 94 (-[WebMainThreadInvoker forwardInvocation:]): 95 (-[WebMainThreadInvoker methodSignatureForSelector:]): 96 (-[WebMainThreadInvoker handleException:]): 97 (-[NSInvocation _webkit_invokeAndHandleException:]): Execute the invocation and forward any exception that was 98 raised back to the WebMainThreadInvoker. 99 (-[NSObject _webkit_invokeOnMainThread]): 100 101 The following methods are updated to use the proxy object to forward methods to the main thread: 102 103 * WebView/WebArchive.mm: 104 (-[WebArchive initWithMainResource:subresources:subframeArchives:]): 105 (-[WebArchive mainResource]): 106 (-[WebArchive subresources]): 107 (-[WebArchive subframeArchives]): 108 * WebView/WebResource.mm: 109 (-[WebResource data]): 110 (-[WebResource URL]): 111 (-[WebResource MIMEType]): 112 (-[WebResource textEncodingName]): 113 (-[WebResource frameName]): 114 (-[WebResource _ignoreWhenUnarchiving]): 115 (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]): 116 (-[WebResource _initWithData:URL:response:]): 117 (-[WebResource _suggestedFilename]): 118 (-[WebResource _response]): 119 (-[WebResource _stringValue]): 120 * WebView/WebView.mm: 121 (-[WebView initWithFrame:frameName:groupName:]): 122 (-[WebView initWithCoder:]): 123 1 124 2009-01-20 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com> 2 125 -
trunk/WebKit/mac/Misc/WebNSObjectExtras.h
r40086 r40124 55 55 56 56 @interface NSObject (WebNSObjectExtras) 57 - (id)_webkit_performSelectorOnMainThread:(SEL)selector withObject:(id)object; 58 - (id)_webkit_getPropertyOnMainThread:(SEL)selector; 57 - (id)_webkit_invokeOnMainThread; 59 58 @end -
trunk/WebKit/mac/Misc/WebNSObjectExtras.mm
r40086 r40124 29 29 #import "WebNSObjectExtras.h" 30 30 31 @implementation NSObject (WebNSObjectExtras)32 31 33 - (void)_webkit_performSelectorWithArguments:(NSMutableDictionary *)arguments 32 @interface WebMainThreadInvoker : NSProxy 34 33 { 35 SEL selector = static_cast<SEL>([[arguments objectForKey:@"selector"] pointerValue]); 36 @try { 37 id object = [arguments objectForKey:@"object"]; 38 id result = [self performSelector:selector withObject:object]; 39 if (result) 40 [arguments setObject:result forKey:@"result"]; 41 } @catch(NSException *exception) { 42 [arguments setObject:exception forKey:@"exception"]; 34 id target; 35 id exception; 36 } 37 @end 38 39 @implementation WebMainThreadInvoker 40 41 - (id)initWithTarget:(id)theTarget 42 { 43 target = theTarget; 44 return self; 45 } 46 47 - (void)forwardInvocation:(NSInvocation *)invocation 48 { 49 [invocation setTarget:target]; 50 [invocation retainArguments]; 51 [invocation performSelectorOnMainThread:@selector(_webkit_invokeAndHandleException:) withObject:self waitUntilDone:YES]; 52 if (exception) { 53 id exceptionToThrow = [exception autorelease]; 54 exception = nil; 55 @throw exceptionToThrow; 43 56 } 44 57 } 45 58 46 - ( id)_webkit_performSelectorOnMainThread:(SEL)selector withObject:(id)object59 - (NSMethodSignature *)methodSignatureForSelector:(SEL)selector 47 60 { 48 NSMutableDictionary *arguments = [[NSMutableDictionary alloc] init]; 49 [arguments setObject:[NSValue valueWithPointer:selector] forKey:@"selector"]; 50 if (object) 51 [arguments setObject:object forKey:@"object"]; 52 53 [self performSelectorOnMainThread:@selector(_webkit_performSelectorWithArguments:) withObject:arguments waitUntilDone:TRUE]; 54 55 NSException *exception = [[[arguments objectForKey:@"exception"] retain] autorelease]; 56 id value = [[[arguments objectForKey:@"result"] retain] autorelease]; 57 [arguments release]; 58 59 if (exception) 60 [exception raise]; 61 return value; 61 return [target methodSignatureForSelector:selector]; 62 62 } 63 63 64 - ( id)_webkit_getPropertyOnMainThread:(SEL)selector64 - (void)handleException:(id)e 65 65 { 66 return [self _webkit_performSelectorOnMainThread:selector withObject:nil];66 exception = [e retain]; 67 67 } 68 68 69 69 @end 70 71 72 @implementation NSInvocation (WebMainThreadInvoker) 73 74 - (void)_webkit_invokeAndHandleException:(WebMainThreadInvoker *)exceptionHandler 75 { 76 @try { 77 [self invoke]; 78 } @catch (id e) { 79 [exceptionHandler handleException:e]; 80 } 81 } 82 83 @end 84 85 86 @implementation NSObject (WebNSObjectExtras) 87 88 - (id)_webkit_invokeOnMainThread 89 { 90 return [[[WebMainThreadInvoker alloc] initWithTarget:self] autorelease]; 91 } 92 93 @end -
trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
r40086 r40124 241 241 } 242 242 243 kern_return_t WKPCNPObjectHasPropertyReply(mach_port_t clientPort, uint32_t pluginID, boolean_t hasProperty) 244 { 245 NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); 246 if (!hostProxy) 247 return KERN_FAILURE; 248 249 NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); 250 if (!instanceProxy) 251 return KERN_FAILURE; 252 253 instanceProxy->setCurrentReply(new NetscapePluginInstanceProxy::NPObjectHasPropertyReply(hasProperty)); 254 return KERN_SUCCESS; 255 } 256 257 kern_return_t WKPCNPObjectHasMethodReply(mach_port_t clientPort, uint32_t pluginID, boolean_t hasMethod) 258 { 259 NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); 260 if (!hostProxy) 261 return KERN_FAILURE; 262 263 NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); 264 if (!instanceProxy) 265 return KERN_FAILURE; 266 267 instanceProxy->setCurrentReply(new NetscapePluginInstanceProxy::NPObjectHasMethodReply(hasMethod)); 268 return KERN_SUCCESS; 269 } 270 271 kern_return_t WKPCNPObjectInvokeReply(mach_port_t clientPort, uint32_t pluginID, boolean_t returnValue, data_t resultData, mach_msg_type_number_t resultLength) 272 { 273 NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); 274 if (!hostProxy) 275 return KERN_FAILURE; 276 277 NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); 278 if (!instanceProxy) 279 return KERN_FAILURE; 280 281 RetainPtr<CFDataRef> result = CFDataCreate(0, reinterpret_cast<UInt8*>(resultData), resultLength); 282 instanceProxy->setCurrentReply(new NetscapePluginInstanceProxy::NPObjectInvokeReply(returnValue, result)); 283 284 return KERN_SUCCESS; 285 } 286 243 287 kern_return_t WKPCInstantiatePluginReply(mach_port_t clientPort, uint32_t pluginID, kern_return_t result, uint32_t renderContextID, boolean_t useSoftwareRenderer) 244 288 { … … 497 541 } 498 542 543 kern_return_t WKPCIdentifierInfo(mach_port_t clientPort, uint64_t serverIdentifier, data_t* infoData, mach_msg_type_number_t* infoLength) 544 { 545 NPIdentifier identifier = reinterpret_cast<NPIdentifier>(serverIdentifier); 546 547 id info; 548 if (_NPN_IdentifierIsString(identifier)) { 549 char* s = _NPN_UTF8FromIdentifier(identifier); 550 info = [NSData dataWithBytesNoCopy:s length:strlen(s) freeWhenDone:NO]; 551 } else 552 info = [NSNumber numberWithInt:_NPN_IntFromIdentifier(identifier)]; 553 554 RetainPtr<NSData*> data = [NSPropertyListSerialization dataFromPropertyList:info format:NSPropertyListBinaryFormat_v1_0 errorDescription:0]; 555 ASSERT(data); 556 557 *infoLength = [data.get() length]; 558 mig_allocate(reinterpret_cast<vm_address_t*>(infoData), *infoLength); 559 560 memcpy(*infoData, [data.get() bytes], *infoLength); 561 562 return KERN_SUCCESS; 563 } 564 499 565 #endif // USE(PLUGIN_HOST_PROCESS) -
trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h
r40086 r40124 113 113 114 114 PassRefPtr<JSC::Bindings::Instance> createBindingsInstance(PassRefPtr<JSC::Bindings::RootObject>); 115 115 RetainPtr<NSData *> marshalValues(JSC::ExecState*, const JSC::ArgList& args); 116 JSC::JSValuePtr demarshalValue(JSC::ExecState*, const char* valueData, mach_msg_type_number_t valueLength); 117 116 118 // Reply structs 117 119 struct Reply { 118 120 enum Type { 119 121 InstantiatePlugin, 120 GetScriptableNPObject 122 GetScriptableNPObject, 123 NPObjectHasProperty, 124 NPObjectHasMethod, 125 NPObjectInvoke 121 126 }; 122 127 … … 144 149 145 150 struct GetScriptableNPObjectReply : public Reply { 146 static const intReplyType = GetScriptableNPObject;151 static const Reply::Type ReplyType = GetScriptableNPObject; 147 152 148 153 GetScriptableNPObjectReply(uint32_t objectID) 149 : Reply( GetScriptableNPObject)154 : Reply(ReplyType) 150 155 , m_objectID(objectID) 151 156 { … … 153 158 154 159 uint32_t m_objectID; 160 }; 161 162 struct NPObjectHasPropertyReply : public Reply { 163 static const Reply::Type ReplyType = NPObjectHasProperty; 164 165 NPObjectHasPropertyReply(boolean_t hasProperty) 166 : Reply(ReplyType) 167 , m_hasProperty(hasProperty) 168 { 169 } 170 171 boolean_t m_hasProperty; 172 }; 173 174 struct NPObjectHasMethodReply : public Reply { 175 static const Reply::Type ReplyType = NPObjectHasMethod; 176 177 NPObjectHasMethodReply(boolean_t hasMethod) 178 : Reply(ReplyType) 179 , m_hasMethod(hasMethod) 180 { 181 } 182 183 boolean_t m_hasMethod; 184 }; 185 186 struct NPObjectInvokeReply : public Reply { 187 static const Reply::Type ReplyType = NPObjectInvoke; 188 189 NPObjectInvokeReply(boolean_t returnValue, RetainPtr<CFDataRef> result) 190 : Reply(ReplyType) 191 , m_returnValue(returnValue) 192 , m_result(result) 193 { 194 } 195 196 boolean_t m_returnValue; 197 RetainPtr<CFDataRef> m_result; 155 198 }; 156 199 … … 207 250 // NPRuntime 208 251 uint32_t idForObject(JSC::JSObject*); 209 void marshalValue(JSC::ExecState*, JSC::JSValuePtr value, data_t& resultData, mach_msg_type_number_t& resultLength); 252 253 void marshalValue(JSC::ExecState*, JSC::JSValuePtr value, data_t& resultData, mach_msg_type_number_t& resultLength); 254 void addValueToArray(NSMutableArray *, JSC::ExecState* exec, JSC::JSValuePtr value); 255 210 256 bool demarshalValueFromArray(JSC::ExecState*, NSArray *array, NSUInteger& index, JSC::JSValuePtr& result); 211 257 void demarshalValues(JSC::ExecState*, data_t valuesData, mach_msg_type_number_t valuesLength, JSC::ArgList& result); 212 JSC::JSValuePtr demarshalValue(JSC::ExecState*, data_t valueData, mach_msg_type_number_t valueLength);213 258 214 259 uint32_t m_objectIDCounter; -
trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
r40086 r40124 47 47 #import <WebCore/FrameLoader.h> 48 48 #import <WebCore/FrameTree.h> 49 #import <WebCore/runtime_object.h> 49 50 #import <WebCore/ScriptController.h> 50 51 #import <WebCore/ScriptValue.h> … … 462 463 } 463 464 464 uint32_t NetscapePluginInstanceProxy::idForObject(JS C::JSObject* object)465 uint32_t NetscapePluginInstanceProxy::idForObject(JSObject* object) 465 466 { 466 467 uint32_t objectID = 0; … … 611 612 } 612 613 613 bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, const JSC::Identifier& propertyName, data_t &resultData, mach_msg_type_number_t& resultLength)614 bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, const Identifier& propertyName, data_t& resultData, mach_msg_type_number_t& resultLength) 614 615 { 615 616 JSObject* object = m_objects.get(objectID); … … 630 631 } 631 632 632 bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, unsigned propertyName, data_t &resultData, mach_msg_type_number_t& resultLength)633 bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, unsigned propertyName, data_t& resultData, mach_msg_type_number_t& resultLength) 633 634 { 634 635 JSObject* object = m_objects.get(objectID); … … 649 650 } 650 651 651 bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, const JSC::Identifier& propertyName, data_t valueData, mach_msg_type_number_t valueLength)652 bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, const Identifier& propertyName, data_t valueData, mach_msg_type_number_t valueLength) 652 653 { 653 654 JSObject* object = m_objects.get(objectID); … … 690 691 } 691 692 692 bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, const JSC::Identifier& propertyName)693 bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, const Identifier& propertyName) 693 694 { 694 695 JSObject* object = m_objects.get(objectID); … … 734 735 } 735 736 736 bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, const JSC::Identifier& propertyName)737 bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, const Identifier& propertyName) 737 738 { 738 739 JSObject* object = m_objects.get(objectID); … … 768 769 } 769 770 770 bool NetscapePluginInstanceProxy::hasMethod(uint32_t objectID, const JSC::Identifier& methodName)771 bool NetscapePluginInstanceProxy::hasMethod(uint32_t objectID, const Identifier& methodName) 771 772 { 772 773 JSObject* object = m_objects.get(objectID); … … 785 786 } 786 787 788 void NetscapePluginInstanceProxy::addValueToArray(NSMutableArray *array, ExecState* exec, JSValuePtr value) 789 { 790 JSLock lock(false); 791 792 if (value.isString()) { 793 [array addObject:[NSNumber numberWithInt:StringValueType]]; 794 [array addObject:String(value.toString(exec))]; 795 } else if (value.isNumber()) { 796 [array addObject:[NSNumber numberWithInt:DoubleValueType]]; 797 [array addObject:[NSNumber numberWithDouble:value.toNumber(exec)]]; 798 } else if (value.isBoolean()) { 799 [array addObject:[NSNumber numberWithInt:BoolValueType]]; 800 [array addObject:[NSNumber numberWithDouble:value.toBoolean(exec)]]; 801 } else if (value.isNull()) 802 [array addObject:[NSNumber numberWithInt:NullValueType]]; 803 else if (value.isObject()) { 804 JSObject* object = asObject(value); 805 if (object->classInfo() == &RuntimeObjectImp::s_info) { 806 // FIXME: Handle ProxyInstance objects. 807 ASSERT_NOT_REACHED(); 808 } else { 809 [array addObject:[NSNumber numberWithInt:ObjectValueType]]; 810 [array addObject:[NSNumber numberWithInt:idForObject(object)]]; 811 } 812 } else 813 [array addObject:[NSNumber numberWithInt:VoidValueType]]; 814 } 815 787 816 void NetscapePluginInstanceProxy::marshalValue(ExecState* exec, JSValuePtr value, data_t& resultData, mach_msg_type_number_t& resultLength) 788 817 { 789 818 RetainPtr<NSMutableArray*> array(AdoptNS, [[NSMutableArray alloc] init]); 790 819 791 JSLock lock(false); 792 793 if (value.isString()) { 794 [array.get() addObject:[NSNumber numberWithInt:StringValueType]]; 795 [array.get() addObject:String(value.toString(exec))]; 796 } else if (value.isNumber()) { 797 [array.get() addObject:[NSNumber numberWithInt:DoubleValueType]]; 798 [array.get() addObject:[NSNumber numberWithDouble:value.toNumber(exec)]]; 799 } else if (value.isBoolean()) { 800 [array.get() addObject:[NSNumber numberWithInt:BoolValueType]]; 801 [array.get() addObject:[NSNumber numberWithDouble:value.toBoolean(exec)]]; 802 } else if (value.isNull()) 803 [array.get() addObject:[NSNumber numberWithInt:NullValueType]]; 804 else if (value.isObject()) { 805 [array.get() addObject:[NSNumber numberWithInt:ObjectValueType]]; 806 [array.get() addObject:[NSNumber numberWithInt:idForObject(asObject(value))]]; 807 } else 808 [array.get() addObject:[NSNumber numberWithInt:VoidValueType]]; 809 810 RetainPtr<NSData*> data = [NSPropertyListSerialization dataFromPropertyList:array.get() format:NSPropertyListBinaryFormat_v1_0 errorDescription:0]; 820 addValueToArray(array.get(), exec, value); 821 822 RetainPtr<NSData *> data = [NSPropertyListSerialization dataFromPropertyList:array.get() format:NSPropertyListBinaryFormat_v1_0 errorDescription:0]; 811 823 ASSERT(data); 812 824 … … 816 828 memcpy(resultData, [data.get() bytes], resultLength); 817 829 } 830 831 RetainPtr<NSData *> NetscapePluginInstanceProxy::marshalValues(ExecState* exec, const ArgList& args) 832 { 833 RetainPtr<NSMutableArray*> array(AdoptNS, [[NSMutableArray alloc] init]); 834 835 for (unsigned i = 0; i < args.size(); i++) 836 addValueToArray(array.get(), exec, args.at(exec, i)); 837 838 RetainPtr<NSData *> data = [NSPropertyListSerialization dataFromPropertyList:array.get() format:NSPropertyListBinaryFormat_v1_0 errorDescription:0]; 839 ASSERT(data); 840 841 return data; 842 } 818 843 819 844 bool NetscapePluginInstanceProxy::demarshalValueFromArray(ExecState* exec, NSArray *array, NSUInteger& index, JSValuePtr& result) … … 853 878 } 854 879 855 JSValuePtr NetscapePluginInstanceProxy::demarshalValue(ExecState* exec, data_tvalueData, mach_msg_type_number_t valueLength)856 { 857 RetainPtr<NSData*> data(AdoptNS, [[NSData alloc] initWithBytesNoCopy: valueData length:valueLength freeWhenDone:NO]);880 JSValuePtr NetscapePluginInstanceProxy::demarshalValue(ExecState* exec, const char* valueData, mach_msg_type_number_t valueLength) 881 { 882 RetainPtr<NSData*> data(AdoptNS, [[NSData alloc] initWithBytesNoCopy:(void*)valueData length:valueLength freeWhenDone:NO]); 858 883 859 884 RetainPtr<NSArray*> array = [NSPropertyListSerialization propertyListFromData:data.get() … … 883 908 } 884 909 885 PassRefPtr<Instance> NetscapePluginInstanceProxy::createBindingsInstance(PassRefPtr<RootObject> )910 PassRefPtr<Instance> NetscapePluginInstanceProxy::createBindingsInstance(PassRefPtr<RootObject> rootObject) 886 911 { 887 912 if (_WKPHGetScriptableNPObject(m_pluginHostProxy->port(), m_pluginID) != KERN_SUCCESS) … … 891 916 if (!reply.get()) 892 917 return 0; 893 894 // FIXME: Implement 895 return 0; 918 919 if (!reply->m_objectID) 920 return 0; 921 922 return ProxyInstance::create(rootObject, this, reply->m_objectID); 896 923 } 897 924 -
trunk/WebKit/mac/Plugins/Hosted/ProxyInstance.h
r40086 r40124 30 30 31 31 #include <WebCore/runtime.h> 32 #include <WebCore/runtime_root.h> 33 #include <wtf/OwnPtr.h> 32 34 33 35 namespace WebKit { 36 37 class ProxyClass; 38 class NetscapePluginInstanceProxy; 39 40 class ProxyInstance : public JSC::Bindings::Instance { 41 public: 42 static PassRefPtr<ProxyInstance> create(PassRefPtr<JSC::Bindings::RootObject> rootObject, NetscapePluginInstanceProxy* instanceProxy, uint32_t objectID) 43 { 44 return adoptRef(new ProxyInstance(rootObject, instanceProxy, objectID)); 45 } 46 ~ProxyInstance(); 47 48 JSC::Bindings::MethodList methodsNamed(const JSC::Identifier&); 49 JSC::Bindings::Field* fieldNamed(const JSC::Identifier&); 50 51 private: 52 ProxyInstance(PassRefPtr<JSC::Bindings::RootObject>, NetscapePluginInstanceProxy*, uint32_t objectID); 53 54 virtual JSC::Bindings::Class *getClass() const; 55 56 virtual JSC::JSValuePtr invokeMethod(JSC::ExecState*, const JSC::Bindings::MethodList&, const JSC::ArgList& args); 57 virtual JSC::JSValuePtr defaultValue(JSC::ExecState*, JSC::PreferredPrimitiveType) const; 58 virtual JSC::JSValuePtr valueOf(JSC::ExecState*) const; 59 60 JSC::JSValuePtr stringValue(JSC::ExecState*) const; 61 JSC::JSValuePtr numberValue(JSC::ExecState*) const; 62 JSC::JSValuePtr booleanValue() const; 63 64 NetscapePluginInstanceProxy* m_instanceProxy; 65 uint32_t m_objectID; 66 JSC::Bindings::FieldMap m_fields; 67 JSC::Bindings::MethodMap m_methods; 68 }; 69 34 70 } 35 71 -
trunk/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
r40086 r40124 28 28 #import "ProxyInstance.h" 29 29 30 #import "NetscapePluginHostProxy.h" 31 #import "NetscapePluginInstanceProxy.h" 32 #import <WebCore/npruntime_impl.h> 33 34 extern "C" { 35 #import "WebKitPluginHost.h" 36 } 37 38 using namespace JSC; 39 using namespace JSC::Bindings; 40 using namespace std; 41 30 42 namespace WebKit { 31 43 44 class ProxyClass : public JSC::Bindings::Class { 45 private: 46 virtual MethodList methodsNamed(const Identifier&, Instance*) const; 47 virtual Field* fieldNamed(const Identifier&, Instance*) const; 48 }; 49 50 MethodList ProxyClass::methodsNamed(const Identifier& identifier, Instance* instance) const 51 { 52 return static_cast<ProxyInstance*>(instance)->methodsNamed(identifier); 53 } 54 55 Field* ProxyClass::fieldNamed(const Identifier& identifier, Instance* instance) const 56 { 57 return static_cast<ProxyInstance*>(instance)->fieldNamed(identifier); 58 } 59 60 ProxyClass* proxyClass() 61 { 62 DEFINE_STATIC_LOCAL(ProxyClass, proxyClass, ()); 63 return &proxyClass; 64 } 65 66 class ProxyField : public JSC::Bindings::Field { 67 public: 68 ProxyField(uint64_t serverIdentifier) 69 : m_serverIdentifier(serverIdentifier) 70 { 71 } 72 73 private: 74 virtual JSValuePtr valueFromInstance(ExecState*, const Instance*) const; 75 virtual void setValueToInstance(ExecState*, const Instance*, JSValuePtr) const; 76 77 uint64_t m_serverIdentifier; 78 }; 79 80 JSValuePtr ProxyField::valueFromInstance(ExecState*, const Instance*) const 81 { 82 ASSERT_NOT_REACHED(); 83 return JSValuePtr(); 84 } 85 86 void ProxyField::setValueToInstance(ExecState*, const Instance*, JSValuePtr) const 87 { 88 ASSERT_NOT_REACHED(); 89 } 90 91 class ProxyMethod : public JSC::Bindings::Method { 92 public: 93 ProxyMethod(uint64_t serverIdentifier) 94 : m_serverIdentifier(serverIdentifier) 95 { 96 } 97 98 uint64_t serverIdentifier() const { return m_serverIdentifier; } 99 100 private: 101 virtual int numParameters() const { return 0; } 102 103 uint64_t m_serverIdentifier; 104 }; 105 106 ProxyInstance::ProxyInstance(PassRefPtr<RootObject> rootObject, NetscapePluginInstanceProxy* instanceProxy, uint32_t objectID) 107 : Instance(rootObject) 108 , m_instanceProxy(instanceProxy) 109 , m_objectID(objectID) 110 { 111 } 112 113 ProxyInstance::~ProxyInstance() 114 { 115 deleteAllValues(m_fields); 116 deleteAllValues(m_methods); 117 118 // FIXME: Tell the host that we're no longer interested in this object. 119 } 120 121 JSC::Bindings::Class *ProxyInstance::getClass() const 122 { 123 return proxyClass(); 124 } 125 126 JSValuePtr ProxyInstance::invokeMethod(ExecState* exec, const MethodList& methodList, const ArgList& args) 127 { 128 ASSERT(methodList.size() == 1); 129 130 ProxyMethod* method = static_cast<ProxyMethod*>(methodList[0]); 131 132 RetainPtr<NSData*> arguments(m_instanceProxy->marshalValues(exec, args)); 133 134 if (_WKPHNPObjectInvoke(m_instanceProxy->hostProxy()->port(), m_instanceProxy->pluginID(), m_objectID, 135 method->serverIdentifier(), (char*)[arguments.get() bytes], [arguments.get() length]) != KERN_SUCCESS) 136 return jsUndefined(); 137 138 auto_ptr<NetscapePluginInstanceProxy::NPObjectInvokeReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::NPObjectInvokeReply>(); 139 if (!reply.get()) 140 return jsUndefined(); 141 142 return m_instanceProxy->demarshalValue(exec, (char*)CFDataGetBytePtr(reply->m_result.get()), CFDataGetLength(reply->m_result.get())); 143 } 144 145 JSValuePtr ProxyInstance::defaultValue(ExecState* exec, PreferredPrimitiveType hint) const 146 { 147 if (hint == PreferString) 148 return stringValue(exec); 149 if (hint == PreferNumber) 150 return numberValue(exec); 151 return valueOf(exec); 152 } 153 154 JSValuePtr ProxyInstance::stringValue(ExecState* exec) const 155 { 156 // FIXME: Implement something sensible. 157 return jsString(exec, ""); 158 } 159 160 JSValuePtr ProxyInstance::numberValue(ExecState* exec) const 161 { 162 // FIXME: Implement something sensible. 163 return jsNumber(exec, 0); 164 } 165 166 JSValuePtr ProxyInstance::booleanValue() const 167 { 168 // FIXME: Implement something sensible. 169 return jsBoolean(false); 170 } 171 172 JSValuePtr ProxyInstance::valueOf(ExecState* exec) const 173 { 174 return stringValue(exec); 175 } 176 177 MethodList ProxyInstance::methodsNamed(const Identifier& identifier) 178 { 179 if (Method* method = m_methods.get(identifier.ustring().rep())) { 180 MethodList methodList; 181 methodList.append(method); 182 return methodList; 183 } 184 185 uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii())); 186 if (_WKPHNPObjectHasMethod(m_instanceProxy->hostProxy()->port(), 187 m_instanceProxy->pluginID(), 188 m_objectID, methodName) != KERN_SUCCESS) 189 return MethodList(); 190 191 auto_ptr<NetscapePluginInstanceProxy::NPObjectHasMethodReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::NPObjectHasMethodReply>(); 192 if (reply.get() && reply->m_hasMethod) { 193 Method* method = new ProxyMethod(methodName); 194 195 m_methods.set(identifier.ustring().rep(), method); 196 197 MethodList methodList; 198 methodList.append(method); 199 return methodList; 200 } 201 202 return MethodList(); 203 } 204 205 Field* ProxyInstance::fieldNamed(const Identifier& identifier) 206 { 207 if (Field* field = m_fields.get(identifier.ustring().rep())) 208 return field; 209 210 uint64_t propertyName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii())); 211 if (_WKPHNPObjectHasProperty(m_instanceProxy->hostProxy()->port(), 212 m_instanceProxy->pluginID(), 213 m_objectID, propertyName) != KERN_SUCCESS) 214 return 0; 215 216 auto_ptr<NetscapePluginInstanceProxy::NPObjectHasPropertyReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::NPObjectHasPropertyReply>(); 217 if (reply.get() && reply->m_hasProperty) { 218 Field* field = new ProxyField(propertyName); 219 220 m_fields.set(identifier.ustring().rep(), field); 221 222 return field; 223 } 224 225 return 0; 226 } 227 32 228 } // namespace WebKit 33 229 -
trunk/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
r40086 r40124 134 134 out returnValue :boolean_t); 135 135 136 routine IdentifierInfo(clientPort :mach_port_t; 137 identifier :uint64_t; 138 out info :data_t, dealloc); 139 136 140 // Replies 137 141 simpleroutine InstantiatePluginReply(clientPort :mach_port_t; … … 145 149 objectID :uint32_t); 146 150 151 simpleroutine NPObjectHasPropertyReply(clientPort :mach_port_t; 152 pluginID :uint32_t; 153 hasProperty :boolean_t); 154 155 simpleroutine NPObjectHasMethodReply(clientPort :mach_port_t; 156 pluginID :uint32_t; 157 hasMethod :boolean_t); 158 159 simpleroutine NPObjectInvokeReply(clientPort :mach_port_t; 160 pluginID :uint32_t; 161 returnValue :boolean_t; 162 result :data_t); 147 163 148 164 -
trunk/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs
r40086 r40124 125 125 pluginID :uint32_t); 126 126 127 simpleroutine NPObjectHasProperty(pluginHostPort :mach_port_t; 128 pluginID :uint32_t; 129 objectID :uint32_t; 130 propertyName :uint64_t); 131 132 simpleroutine NPObjectHasMethod(pluginHostPort :mach_port_t; 133 pluginID :uint32_t; 134 objectID :uint32_t; 135 methodName :uint64_t); 136 137 simpleroutine NPObjectInvoke(pluginHostPort :mach_port_t; 138 pluginID :uint32_t; 139 objectID :uint32_t; 140 methodName :uint64_t; 141 arguments :data_t); 142 127 143 // Replies 128 144 -
trunk/WebKit/mac/WebView/WebArchive.mm
r40086 r40124 160 160 { 161 161 #ifdef MAIL_THREAD_WORKAROUND 162 if (needMailThreadWorkaround()) { 163 // Maybe this could be done more cleanly with NSInvocation. 164 NSMutableDictionary *arguments = [[NSMutableDictionary alloc] init]; 165 if (mainResource) 166 [arguments setObject:mainResource forKey:@"mainResource"]; 167 if (subresources) 168 [arguments setObject:subresources forKey:@"subresources"]; 169 if (subframeArchives) 170 [arguments setObject:subframeArchives forKey:@"subframeArchives"]; 171 172 self = [self _webkit_performSelectorOnMainThread:@selector(_initWithArguments:) withObject:arguments]; 173 [arguments release]; 174 return self; 175 } 162 if (needMailThreadWorkaround()) 163 return [[self _webkit_invokeOnMainThread] initWithMainResource:mainResource subresources:subresources subframeArchives:subframeArchives]; 176 164 #endif 177 165 … … 297 285 #ifdef MAIL_THREAD_WORKAROUND 298 286 if (needMailThreadWorkaround()) 299 return [ self _webkit_getPropertyOnMainThread:_cmd];287 return [[self _webkit_invokeOnMainThread] mainResource]; 300 288 #endif 301 289 … … 317 305 #ifdef MAIL_THREAD_WORKAROUND 318 306 if (needMailThreadWorkaround()) 319 return [ self _webkit_getPropertyOnMainThread:_cmd];307 return [[self _webkit_invokeOnMainThread] subresources]; 320 308 #endif 321 309 … … 349 337 #ifdef MAIL_THREAD_WORKAROUND 350 338 if (needMailThreadWorkaround()) 351 return [ self _webkit_getPropertyOnMainThread:_cmd];339 return [[self _webkit_invokeOnMainThread] subframeArchives]; 352 340 #endif 353 341 … … 423 411 424 412 @end 425 426 #ifdef MAIL_THREAD_WORKAROUND427 428 @implementation WebArchive (WebMailThreadWorkaround)429 430 - (id)_initWithArguments:(NSDictionary *)arguments431 {432 WebResource *mainResource = [arguments objectForKey:@"mainResource"];433 NSArray *subresources = [arguments objectForKey:@"subresources"];434 NSArray *subframeArchives = [arguments objectForKey:@"subframeArchives"];435 return [self initWithMainResource:mainResource subresources:subresources subframeArchives:subframeArchives];436 }437 438 @end439 440 #endif -
trunk/WebKit/mac/WebView/WebRenderNode.mm
r40086 r40124 33 33 #import "WebHTMLView.h" 34 34 #import <WebCore/Frame.h> 35 #import <WebCore/RenderText.h> 35 36 #import <WebCore/RenderWidget.h> 36 37 #import <WebCore/RenderView.h> … … 89 90 // FIXME: broken with transforms 90 91 FloatPoint absPos = node->localToAbsolute(FloatPoint()); 92 int x = 0; 93 int y = 0; 94 int width = 0; 95 int height = 0; 96 if (node->isBox()) { 97 RenderBox* box = static_cast<RenderBox*>(node); 98 x = box->x(); 99 y = box->y(); 100 width = box->width(); 101 height = box->height(); 102 } else if (node->isText()) { 103 // FIXME: Preserve old behavior even though it's strange. 104 RenderText* text = static_cast<RenderText*>(node); 105 x = text->firstRunX(); 106 y = text->firstRunY(); 107 width = text->boundingBoxWidth(); 108 height = text->boundingBoxHeight(); 109 } 110 91 111 WebRenderNode *result = [[WebRenderNode alloc] initWithName:name 92 position:absPos rect:NSMakeRect( node->xPos(), node->yPos(), node->width(), node->height())112 position:absPos rect:NSMakeRect(x, y, width, height) 93 113 view:view children:children]; 94 114 -
trunk/WebKit/mac/WebView/WebResource.mm
r40086 r40124 203 203 #ifdef MAIL_THREAD_WORKAROUND 204 204 if (needMailThreadWorkaround()) 205 return [ self _webkit_getPropertyOnMainThread:_cmd];205 return [[self _webkit_invokeOnMainThread] data]; 206 206 #endif 207 207 … … 219 219 #ifdef MAIL_THREAD_WORKAROUND 220 220 if (needMailThreadWorkaround()) 221 return [ self _webkit_getPropertyOnMainThread:_cmd];221 return [[self _webkit_invokeOnMainThread] URL]; 222 222 #endif 223 223 … … 234 234 #ifdef MAIL_THREAD_WORKAROUND 235 235 if (needMailThreadWorkaround()) 236 return [ self _webkit_getPropertyOnMainThread:_cmd];236 return [[self _webkit_invokeOnMainThread] MIMEType]; 237 237 #endif 238 238 … … 249 249 #ifdef MAIL_THREAD_WORKAROUND 250 250 if (needMailThreadWorkaround()) 251 return [ self _webkit_getPropertyOnMainThread:_cmd];251 return [[self _webkit_invokeOnMainThread] textEncodingName]; 252 252 #endif 253 253 … … 264 264 #ifdef MAIL_THREAD_WORKAROUND 265 265 if (needMailThreadWorkaround()) 266 return [ self _webkit_getPropertyOnMainThread:_cmd];266 return [[self _webkit_invokeOnMainThread] frameName]; 267 267 #endif 268 268 … … 319 319 #ifdef MAIL_THREAD_WORKAROUND 320 320 if (needMailThreadWorkaround()) { 321 [ self performSelectorOnMainThread:_cmd withObject:nil waitUntilDone:TRUE];321 [[self _webkit_invokeOnMainThread] _ignoreWhenUnarchiving]; 322 322 return; 323 323 } … … 340 340 { 341 341 #ifdef MAIL_THREAD_WORKAROUND 342 if (needMailThreadWorkaround()) { 343 // Maybe this could be done more cleanly with NSInvocation. 344 NSMutableDictionary *arguments = [[NSMutableDictionary alloc] init]; 345 if (data) 346 [arguments setObject:data forKey:@"data"]; 347 if (URL) 348 [arguments setObject:URL forKey:@"URL"]; 349 if (MIMEType) 350 [arguments setObject:MIMEType forKey:@"MIMEType"]; 351 if (textEncodingName) 352 [arguments setObject:textEncodingName forKey:@"textEncodingName"]; 353 if (frameName) 354 [arguments setObject:frameName forKey:@"frameName"]; 355 if (response) 356 [arguments setObject:response forKey:@"response"]; 357 if (copyData) 358 [arguments setObject:[NSNumber numberWithBool:YES] forKey:@"copyData"]; 359 360 self = [self _webkit_performSelectorOnMainThread:@selector(_initWithArguments:) withObject:arguments]; 361 [arguments release]; 362 363 return self; 364 } 342 if (needMailThreadWorkaround()) 343 return [[self _webkit_invokeOnMainThread] _initWithData:data URL:URL MIMEType:MIMEType textEncodingName:textEncodingName frameName:frameName response:response copyData:copyData]; 365 344 #endif 366 345 … … 375 354 return nil; 376 355 } 377 356 378 357 _private = [[WebResourcePrivate alloc] initWithCoreResource:ArchiveResource::create(SharedBuffer::wrapNSData(copyData ? [[data copy] autorelease] : data), URL, MIMEType, textEncodingName, frameName, response)]; 379 358 380 359 return self; 381 360 } … … 391 370 frameName:nil 392 371 response:response 393 copyData:NO]; 372 copyData:NO]; 394 373 } 395 374 … … 398 377 #ifdef MAIL_THREAD_WORKAROUND 399 378 if (needMailThreadWorkaround()) 400 return [ self _webkit_getPropertyOnMainThread:_cmd];379 return [[self _webkit_invokeOnMainThread] _suggestedFilename]; 401 380 #endif 402 381 … … 423 402 #ifdef MAIL_THREAD_WORKAROUND 424 403 if (needMailThreadWorkaround()) 425 return [ self _webkit_getPropertyOnMainThread:_cmd];404 return [[self _webkit_invokeOnMainThread] _response]; 426 405 #endif 427 406 … … 438 417 #ifdef MAIL_THREAD_WORKAROUND 439 418 if (needMailThreadWorkaround()) 440 return [ self _webkit_getPropertyOnMainThread:_cmd];419 return [[self _webkit_invokeOnMainThread] _stringValue]; 441 420 #endif 442 421 … … 466 445 } 467 446 468 - (id)_initWithArguments:(NSDictionary *)arguments 469 { 470 NSData *data = [arguments objectForKey:@"data"]; 471 NSURL *URL = [arguments objectForKey:@"URL"]; 472 NSString *MIMEType = [arguments objectForKey:@"MIMEType"]; 473 NSString *textEncodingName = [arguments objectForKey:@"textEncodingName"]; 474 NSString *frameName = [arguments objectForKey:@"frameName"]; 475 NSURLResponse *response = [arguments objectForKey:@"response"]; 476 BOOL copyData = [[arguments objectForKey:@"copyData"] boolValue]; 477 return [self _initWithData:data URL:URL MIMEType:MIMEType textEncodingName:textEncodingName frameName:frameName response:response copyData:copyData]; 478 } 479 480 @end 481 482 #endif 447 @end 448 449 #endif -
trunk/WebKit/mac/WebView/WebView.mm
r40086 r40124 2280 2280 - (id)initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName 2281 2281 { 2282 if (needsWebViewInitThreadWorkaround()) { 2283 NSMutableDictionary *arguments = [[NSMutableDictionary alloc] initWithCapacity:3]; 2284 [arguments setObject:[NSValue valueWithRect:f] forKey:@"frame"]; 2285 if (frameName) 2286 [arguments setObject:frameName forKey:@"frameName"]; 2287 if (groupName) 2288 [arguments setObject:groupName forKey:@"groupName"]; 2289 2290 self = [self _webkit_performSelectorOnMainThread:@selector(_initWithArguments:) withObject:arguments]; 2291 [arguments release]; 2292 return self; 2293 } 2282 if (needsWebViewInitThreadWorkaround()) 2283 return [[self _webkit_invokeOnMainThread] initWithFrame:f frameName:frameName groupName:groupName]; 2294 2284 2295 2285 WebCoreThreadViolationCheck(); … … 2299 2289 - (id)initWithCoder:(NSCoder *)decoder 2300 2290 { 2301 if (needsWebViewInitThreadWorkaround()) { 2302 NSDictionary *arguments = [[NSDictionary alloc] initWithObjectsAndKeys:decoder, @"decoder", nil]; 2303 self = [self _webkit_performSelectorOnMainThread:@selector(_initWithArguments:) withObject:arguments]; 2304 [arguments release]; 2305 return self; 2306 } 2291 if (needsWebViewInitThreadWorkaround()) 2292 return [[self _webkit_invokeOnMainThread] initWithCoder:decoder]; 2307 2293 2308 2294 WebCoreThreadViolationCheck(); -
trunk/WebKitTools/ChangeLog
r40086 r40124 1 2009-01-21 Pierre-Olivier Latour <pol@apple.com> 2 3 Tweaked earlier fix to only print a warning when Perian is installed, 4 and fail completely only if attempting to generate new pixel test results. 5 6 https://bugs.webkit.org/show_bug.cgi?id=23392 7 8 * Scripts/run-webkit-tests: 9 1 10 2009-01-20 Darin Adler <darin@apple.com> 2 11 -
trunk/WebKitTools/Scripts/run-webkit-tests
r40086 r40124 307 307 die "can't find executable $imageDiffTool (looked in $productDir)\n" if $pixelTests && !-x $imageDiffTool; 308 308 309 die "You can't run pixel tests if Perian's QuickTime component is installed as it affects the results\n\thttps://bugs.webkit.org/show_bug.cgi?id=22615\n" if $pixelTests && isPerianInstalled(); 309 die "You can't generate new pixel test results if Perian's QuickTime component is installed as it may affect the results\n\thttps://bugs.webkit.org/show_bug.cgi?id=22615\n" if $resetResults && $pixelTests && isPerianInstalled(); 310 print "WARNING: Perian's QuickTime component is installed and this may affect pixel test results!!!\n\thttps://bugs.webkit.org/show_bug.cgi?id=22615\n" if $pixelTests && isPerianInstalled(); 310 311 311 312 checkFrameworks() unless isCygwin();
Note:
See TracChangeset
for help on using the changeset viewer.