| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
| (...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1910 HashSet<Document*>::iterator it = documentsThatNeedStyleRecalc->begin(); | 1910 HashSet<Document*>::iterator it = documentsThatNeedStyleRecalc->begin(); |
| 1911 Document* doc = *it; | 1911 Document* doc = *it; |
| 1912 documentsThatNeedStyleRecalc->remove(doc); | 1912 documentsThatNeedStyleRecalc->remove(doc); |
| 1913 doc->updateStyleIfNeeded(); | 1913 doc->updateStyleIfNeeded(); |
| 1914 } | 1914 } |
| 1915 } | 1915 } |
| 1916 | 1916 |
| 1917 void Document::updateLayout() | 1917 void Document::updateLayout() |
| 1918 { | 1918 { |
| 1919 ASSERT(isMainThread()); | 1919 ASSERT(isMainThread()); |
| 1920 |
| 1921 FrameView* frameView = view(); |
| 1922 if (frameView && frameView->isInLayout()) { |
| 1923 // View layout should not be re-entrant. |
| 1924 ASSERT_NOT_REACHED(); |
| 1925 return; |
| 1926 } |
| 1927 |
| 1920 if (Element* oe = ownerElement()) | 1928 if (Element* oe = ownerElement()) |
| 1921 oe->document()->updateLayout(); | 1929 oe->document()->updateLayout(); |
| 1922 | 1930 |
| 1923 updateStyleIfNeeded(); | 1931 updateStyleIfNeeded(); |
| 1924 | 1932 |
| 1925 StackStats::LayoutCheckPoint layoutCheckPoint; | 1933 StackStats::LayoutCheckPoint layoutCheckPoint; |
| 1934 |
| 1926 // Only do a layout if changes have occurred that make it necessary. | 1935 // Only do a layout if changes have occurred that make it necessary. |
| 1927 FrameView* v = view(); | 1936 if (frameView && renderer() && (frameView->layoutPending() || renderer()->ne
edsLayout())) |
| 1928 if (v && renderer() && (v->layoutPending() || renderer()->needsLayout())) | 1937 frameView->layout(); |
| 1929 v->layout(); | |
| 1930 } | 1938 } |
| 1931 | 1939 |
| 1932 // FIXME: This is a bad idea and needs to be removed eventually. | 1940 // FIXME: This is a bad idea and needs to be removed eventually. |
| 1933 // Other browsers load stylesheets before they continue parsing the web page. | 1941 // Other browsers load stylesheets before they continue parsing the web page. |
| 1934 // Since we don't, we can run JavaScript code that needs answers before the | 1942 // Since we don't, we can run JavaScript code that needs answers before the |
| 1935 // stylesheets are loaded. Doing a layout ignoring the pending stylesheets | 1943 // stylesheets are loaded. Doing a layout ignoring the pending stylesheets |
| 1936 // lets us get reasonable answers. The long term solution to this problem is | 1944 // lets us get reasonable answers. The long term solution to this problem is |
| 1937 // to instead suspend JavaScript execution. | 1945 // to instead suspend JavaScript execution. |
| 1938 void Document::updateLayoutIgnorePendingStylesheets() | 1946 void Document::updateLayoutIgnorePendingStylesheets() |
| 1939 { | 1947 { |
| (...skipping 4102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6042 AtomicString localeKey = locale; | 6050 AtomicString localeKey = locale; |
| 6043 if (locale.isEmpty() || !RuntimeEnabledFeatures::langAttributeAwareFormContr
olUIEnabled()) | 6051 if (locale.isEmpty() || !RuntimeEnabledFeatures::langAttributeAwareFormContr
olUIEnabled()) |
| 6044 localeKey = defaultLanguage(); | 6052 localeKey = defaultLanguage(); |
| 6045 LocaleIdentifierToLocaleMap::AddResult result = m_localeCache.add(localeKey,
nullptr); | 6053 LocaleIdentifierToLocaleMap::AddResult result = m_localeCache.add(localeKey,
nullptr); |
| 6046 if (result.isNewEntry) | 6054 if (result.isNewEntry) |
| 6047 result.iterator->value = Locale::create(localeKey); | 6055 result.iterator->value = Locale::create(localeKey); |
| 6048 return *(result.iterator->value); | 6056 return *(result.iterator->value); |
| 6049 } | 6057 } |
| 6050 | 6058 |
| 6051 } // namespace WebCore | 6059 } // namespace WebCore |
| OLD | NEW |