Disclaimer: Characters belong to J K Rowling.
She's under a spell. That's what it is. It's the only rational explanation she can think of. Nothing else makes sense, with the possible exception of temporary insanity. Why else would she be gazing over at that side of the classroom right now? It must be a spell. She's certainly not doing this voluntarily. She doesn't want to be staring at Malfoy and admiring the way his hair – which has never seemed special before – looks rather soft, begging to be touched. She certainly doesn't want to be looking at his lips. So often they're curled into a sneer, but now he's chewing nervously on his bottom lip as he answers the questions on the test Professor McGonagall has just handed out. It's rather endearing. It's incredibly endearing, in fact, and she finds herself wanting to hug him. Or more. No! Don't think like that! It's Malfoy. But she finds that she likes the path that her mind has taken, and rather than recheck her test paper, she daydreams. She's definitely under a spell. There's no other explanation.