Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: sky/engine/core/dom/Document.cpp

Issue 788883005: Remove REM units. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 evaluateMediaQueryListIfNeeded(); 1071 evaluateMediaQueryListIfNeeded();
1072 updateDistributionIfNeeded(); 1072 updateDistributionIfNeeded();
1073 1073
1074 // FIXME: We should update style on our ancestor chain before proceeding 1074 // FIXME: We should update style on our ancestor chain before proceeding
1075 // however doing so currently causes several tests to crash, as LocalFrame:: setDocument calls Document::attach 1075 // however doing so currently causes several tests to crash, as LocalFrame:: setDocument calls Document::attach
1076 // before setting the LocalDOMWindow on the LocalFrame, or the SecurityOrigi n on the document. The attach, in turn 1076 // before setting the LocalDOMWindow on the LocalFrame, or the SecurityOrigi n on the document. The attach, in turn
1077 // resolves style (here) and then when we resolve style on the parent chain, we may end up 1077 // resolves style (here) and then when we resolve style on the parent chain, we may end up
1078 // re-attaching our containing iframe, which when asked HTMLFrameElementBase ::isURLAllowed 1078 // re-attaching our containing iframe, which when asked HTMLFrameElementBase ::isURLAllowed
1079 // hits a null-dereference due to security code always assuming the document has a SecurityOrigin. 1079 // hits a null-dereference due to security code always assuming the document has a SecurityOrigin.
1080 1080
1081 if (m_elemSheet && m_elemSheet->contents()->usesRemUnits())
1082 m_styleEngine->setUsesRemUnit(true);
1083
1084 updateStyle(change); 1081 updateStyle(change);
1085 1082
1086 // As a result of the style recalculation, the currently hovered element mig ht have been 1083 // As a result of the style recalculation, the currently hovered element mig ht have been
1087 // detached (for example, by setting display:none in the :hover style), sche dule another mouseMove event 1084 // detached (for example, by setting display:none in the :hover style), sche dule another mouseMove event
1088 // to check if any other elements ended up under the mouse pointer due to re -layout. 1085 // to check if any other elements ended up under the mouse pointer due to re -layout.
1089 if (hoverNode() && !hoverNode()->renderer() && frame()) 1086 if (hoverNode() && !hoverNode()->renderer() && frame())
1090 frame()->eventHandler().dispatchFakeMouseMoveEventSoon(); 1087 frame()->eventHandler().dispatchFakeMouseMoveEventSoon();
1091 1088
1092 if (m_focusedElement && !m_focusedElement->isFocusable()) 1089 if (m_focusedElement && !m_focusedElement->isFocusable())
1093 clearFocusedElementSoon(); 1090 clearFocusedElementSoon();
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 updateBaseURL(); 1563 updateBaseURL();
1567 } 1564 }
1568 1565
1569 void Document::updateBaseURL() 1566 void Document::updateBaseURL()
1570 { 1567 {
1571 KURL oldBaseURL = m_baseURL; 1568 KURL oldBaseURL = m_baseURL;
1572 m_baseURL = m_url; 1569 m_baseURL = m_url;
1573 1570
1574 if (!m_baseURL.isValid()) 1571 if (!m_baseURL.isValid())
1575 m_baseURL = KURL(); 1572 m_baseURL = KURL();
1576
1577 // FIXME(sky): remove?
1578 if (m_elemSheet) {
1579 // Element sheet is silly. It never contains anything.
1580 bool usesRemUnits = m_elemSheet->contents()->usesRemUnits();
1581 m_elemSheet = CSSStyleSheet::create(this, m_baseURL);
1582 // FIXME: So we are not really the parser. The right fix is to eliminate the element sheet completely.
1583 m_elemSheet->contents()->parserSetUsesRemUnits(usesRemUnits);
1584 }
1585 } 1573 }
1586 1574
1587 void Document::didLoadAllImports() 1575 void Document::didLoadAllImports()
1588 { 1576 {
1589 if (!importLoader()) 1577 if (!importLoader())
1590 styleResolverChanged(); 1578 styleResolverChanged();
1591 didLoadAllScriptBlockingResources(); 1579 didLoadAllScriptBlockingResources();
1592 } 1580 }
1593 1581
1594 void Document::didRemoveAllPendingStylesheet() 1582 void Document::didRemoveAllPendingStylesheet()
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2778 using namespace blink; 2766 using namespace blink;
2779 void showLiveDocumentInstances() 2767 void showLiveDocumentInstances()
2780 { 2768 {
2781 WeakDocumentSet& set = liveDocumentSet(); 2769 WeakDocumentSet& set = liveDocumentSet();
2782 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 2770 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
2783 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) { 2771 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) {
2784 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data()); 2772 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data());
2785 } 2773 }
2786 } 2774 }
2787 #endif 2775 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/css/resolver/StyleResolverState.cpp ('k') | sky/engine/core/dom/DocumentStyleSheetCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698