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

Side by Side Diff: sky/engine/core/css/resolver/StyleResolver.cpp

Issue 674073005: Remove final instances of WritingMode in Sky. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | sky/engine/core/rendering/RenderBlockFlow.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) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 documentStyle->setZoom(frame ? frame->pageZoomFactor() : 1); 388 documentStyle->setZoom(frame ? frame->pageZoomFactor() : 1);
389 documentStyle->setLocale(document.contentLanguage()); 389 documentStyle->setLocale(document.contentLanguage());
390 documentStyle->setZIndex(0); 390 documentStyle->setZIndex(0);
391 documentStyle->setUserModify(READ_ONLY); 391 documentStyle->setUserModify(READ_ONLY);
392 392
393 document.setupFontBuilder(documentStyle.get()); 393 document.setupFontBuilder(documentStyle.get());
394 394
395 return documentStyle.release(); 395 return documentStyle.release();
396 } 396 }
397 397
398 static inline void resetDirectionAndWritingModeOnDocument(Document& document)
399 {
400 document.setDirectionSetOnDocumentElement(false);
401 }
402
403 static void addContentAttrValuesToFeatures(const Vector<AtomicString>& contentAt trValues, RuleFeatureSet& features) 398 static void addContentAttrValuesToFeatures(const Vector<AtomicString>& contentAt trValues, RuleFeatureSet& features)
404 { 399 {
405 for (size_t i = 0; i < contentAttrValues.size(); ++i) 400 for (size_t i = 0; i < contentAttrValues.size(); ++i)
406 features.addContentAttr(contentAttrValues[i]); 401 features.addContentAttr(contentAttrValues[i]);
407 } 402 }
408 403
409 // Start loading resources referenced by this style. 404 // Start loading resources referenced by this style.
410 void StyleResolver::loadPendingResources(StyleResolverState& state) 405 void StyleResolver::loadPendingResources(StyleResolverState& state)
411 { 406 {
412 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources()); 407 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources());
(...skipping 17 matching lines...) Expand all
430 s_styleNotYetAvailable->font().update(document().styleEngine()->font Selector()); 425 s_styleNotYetAvailable->font().update(document().styleEngine()->font Selector());
431 } 426 }
432 427
433 document().setHasNodesWithPlaceholderStyle(); 428 document().setHasNodesWithPlaceholderStyle();
434 return s_styleNotYetAvailable; 429 return s_styleNotYetAvailable;
435 } 430 }
436 431
437 didAccess(); 432 didAccess();
438 433
439 if (element == document().documentElement()) 434 if (element == document().documentElement())
440 resetDirectionAndWritingModeOnDocument(document()); 435 document().setDirectionSetOnDocumentElement(false);
441 StyleResolverState state(document(), element, defaultParent); 436 StyleResolverState state(document(), element, defaultParent);
442 437
443 if (sharingBehavior == AllowStyleSharing && state.parentStyle()) { 438 if (sharingBehavior == AllowStyleSharing && state.parentStyle()) {
444 SharedStyleFinder styleFinder(state.elementContext(), m_features, m_attr ibuteRuleSet.get(), *this); 439 SharedStyleFinder styleFinder(state.elementContext(), m_features, m_attr ibuteRuleSet.get(), *this);
445 if (RefPtr<RenderStyle> sharedStyle = styleFinder.findSharedStyle()) 440 if (RefPtr<RenderStyle> sharedStyle = styleFinder.findSharedStyle())
446 return sharedStyle.release(); 441 return sharedStyle.release();
447 } 442 }
448 443
449 if (state.parentStyle()) { 444 if (state.parentStyle()) {
450 state.setStyle(RenderStyle::create()); 445 state.setStyle(RenderStyle::create());
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 return state.takeStyle(); 495 return state.takeStyle();
501 } 496 }
502 497
503 PassRefPtr<RenderStyle> StyleResolver::styleForKeyframe(Element* element, const RenderStyle& elementStyle, RenderStyle* parentStyle, const StyleKeyframe* keyfra me, const AtomicString& animationName) 498 PassRefPtr<RenderStyle> StyleResolver::styleForKeyframe(Element* element, const RenderStyle& elementStyle, RenderStyle* parentStyle, const StyleKeyframe* keyfra me, const AtomicString& animationName)
504 { 499 {
505 ASSERT(document().frame()); 500 ASSERT(document().frame());
506 ASSERT(document().settings()); 501 ASSERT(document().settings());
507 ASSERT(!hasPendingAuthorStyleSheets()); 502 ASSERT(!hasPendingAuthorStyleSheets());
508 503
509 if (element == document().documentElement()) 504 if (element == document().documentElement())
510 resetDirectionAndWritingModeOnDocument(document()); 505 document().setDirectionSetOnDocumentElement(false);
511 StyleResolverState state(document(), element, parentStyle); 506 StyleResolverState state(document(), element, parentStyle);
512 507
513 MatchResult result; 508 MatchResult result;
514 result.addMatchedProperties(&keyframe->properties()); 509 result.addMatchedProperties(&keyframe->properties());
515 510
516 ASSERT(!state.style()); 511 ASSERT(!state.style());
517 512
518 // Create the style 513 // Create the style
519 state.setStyle(RenderStyle::clone(&elementStyle)); 514 state.setStyle(RenderStyle::clone(&elementStyle));
520 state.setLineHeightValue(0); 515 state.setLineHeightValue(0);
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 visitor->trace(m_viewportDependentMediaQueryResults); 1007 visitor->trace(m_viewportDependentMediaQueryResults);
1013 visitor->trace(m_features); 1008 visitor->trace(m_features);
1014 visitor->trace(m_attributeRuleSet); 1009 visitor->trace(m_attributeRuleSet);
1015 visitor->trace(m_styleSharingLists); 1010 visitor->trace(m_styleSharingLists);
1016 visitor->trace(m_pendingStyleSheets); 1011 visitor->trace(m_pendingStyleSheets);
1017 visitor->trace(m_document); 1012 visitor->trace(m_document);
1018 #endif 1013 #endif
1019 } 1014 }
1020 1015
1021 } // namespace blink 1016 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/rendering/RenderBlockFlow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698