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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 183893021: Add use counter for UTF-16 as a Web-exposed encoding Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 6 years, 9 months 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
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4099 matching lines...) Expand 10 before | Expand all | Expand 10 after
4110 && m_titleElement->textContent().containsOnlyLatin1()) { 4110 && m_titleElement->textContent().containsOnlyLatin1()) {
4111 4111
4112 CString originalBytes = m_titleElement->textContent().latin1(); 4112 CString originalBytes = m_titleElement->textContent().latin1();
4113 OwnPtr<TextCodec> codec = newTextCodec(newData.encoding()); 4113 OwnPtr<TextCodec> codec = newTextCodec(newData.encoding());
4114 String correctlyDecodedTitle = codec->decode(originalBytes.data(), origi nalBytes.length(), true); 4114 String correctlyDecodedTitle = codec->decode(originalBytes.data(), origi nalBytes.length(), true);
4115 m_titleElement->setTextContent(correctlyDecodedTitle); 4115 m_titleElement->setTextContent(correctlyDecodedTitle);
4116 } 4116 }
4117 4117
4118 m_encodingData = newData; 4118 m_encodingData = newData;
4119 4119
4120 if (m_encodingData.encoding() == UTF16LittleEndianEncoding()
4121 || m_encodingData.encoding() == UTF16BigEndianEncoding()) {
4122 UseCounter::count(this, UseCounter::UTF16AsWebExposedEncoding);
4123 }
4124
4120 // FIXME: Should be removed as part of https://code.google.com/p/chromium/is sues/detail?id=319643 4125 // FIXME: Should be removed as part of https://code.google.com/p/chromium/is sues/detail?id=319643
4121 bool shouldUseVisualOrdering = m_encodingData.encoding().usesVisualOrdering( ); 4126 bool shouldUseVisualOrdering = m_encodingData.encoding().usesVisualOrdering( );
4122 if (shouldUseVisualOrdering != m_visuallyOrdered) { 4127 if (shouldUseVisualOrdering != m_visuallyOrdered) {
4123 m_visuallyOrdered = shouldUseVisualOrdering; 4128 m_visuallyOrdered = shouldUseVisualOrdering;
4124 // FIXME: How is possible to not have a renderer here? 4129 // FIXME: How is possible to not have a renderer here?
4125 if (renderView()) 4130 if (renderView())
4126 renderView()->style()->setRTLOrdering(m_visuallyOrdered ? VisualOrde r : LogicalOrder); 4131 renderView()->style()->setRTLOrdering(m_visuallyOrdered ? VisualOrde r : LogicalOrder);
4127 setNeedsStyleRecalc(SubtreeStyleChange); 4132 setNeedsStyleRecalc(SubtreeStyleChange);
4128 } 4133 }
4129 } 4134 }
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
5445 void Document::defaultEventHandler(Event* event) 5450 void Document::defaultEventHandler(Event* event)
5446 { 5451 {
5447 if (frame() && frame()->remotePlatformLayer()) { 5452 if (frame() && frame()->remotePlatformLayer()) {
5448 frame()->chromeClient().forwardInputEvent(this, event); 5453 frame()->chromeClient().forwardInputEvent(this, event);
5449 return; 5454 return;
5450 } 5455 }
5451 Node::defaultEventHandler(event); 5456 Node::defaultEventHandler(event);
5452 } 5457 }
5453 5458
5454 } // namespace WebCore 5459 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698